Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"changelog-debug": "auto-changelog --template changelog.hbs -p --template json --output changelog-data.json",
"review": "npm run compile && npm run lint && npm run test",
"rebuild": "npm run clean && npm run build && npm run standalone",

"standalone": "node --experimental-network-imports --env-file=development.env dist/jitar.js --config=services/standalone.json --bodylimit=512000",
"proxy": "node --experimental-network-imports --env-file=development.env dist/jitar.js --config=services/proxy.json --bodylimit=512000",
"repository": "node --experimental-network-imports --env-file=development.env dist/jitar.js --config=services/repository.json --bodylimit=512000",
Expand Down
30 changes: 24 additions & 6 deletions segments/bff.segment.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,51 @@
"./domain/authentication/login/feature": { "default": { "access": "public" } },
"./domain/authentication/logout/feature": { "default": { "access": "public" } },

"./domain/comic/create/feature": { "default": { "access": "private" } },

"./domain/creator/aggregate/feature": { "default": { "access": "private" } },
"./domain/creator/getByNicknameAggregated/feature": { "default": { "access": "public" } },
"./domain/creator/getByIdAggregated/feature": { "default": { "access": "private" } },
"./domain/creator/getMeAggregated/feature": { "default": { "access": "public" } },
"./domain/creator/register/feature": { "default": { "access": "private" }},
"./domain/creator/updateFullName/feature": { "default": { "access": "public" }},
"./domain/creator/updateNickname/feature": { "default": { "access": "public" }},
"./domain/creator/updateFollowerCount/feature": { "default": { "access": "private" }},
"./domain/creator/updateFollowingCount/feature": { "default": { "access": "private" }},
"./domain/creator/updatePostCount/feature": { "default": { "access": "private" }},

"./domain/image/create/feature": { "default": { "access": "private" } },
"./domain/image/download/feature": { "default": { "access": "private" } },

"./domain/notification/aggregate/feature": { "default": { "access": "private" } },
"./domain/notification/getRecentAggregated/feature": { "default": { "access": "public" } },
"./domain/notification/getByIdAggregated/feature": { "default": { "access": "public" } },

"./domain/post/add/feature": { "default": { "access": "public" } },
"./domain/post/aggregate/feature": { "default": { "access": "private" } },
"./domain/post/exploreAggregated/feature": { "default": { "access": "public" } },
"./domain/post/getByIdAggregated/feature": { "default": { "access": "public" } },
"./domain/post/getByCreatorAggregated/feature": { "default": { "access": "public" } },
"./domain/post/getAllAggregated/feature": { "default": { "access": "public"}},
"./domain/post/getByFollowingAggregated/feature": { "default": { "access": "public" } },
"./domain/post/remove/feature": { "default": { "access": "public" } },
"./domain/post/toggleRating/feature": { "default": { "access": "public" } },
"./domain/post/updateRatingCount/feature": { "default": { "access": "private" }},
"./domain/post/updateReactionCount/feature": { "default": { "access": "private" }},

"./domain/reaction/aggregate/feature": { "default": { "access": "private" } },
"./domain/reaction/createComic/feature": { "default": { "access": "public" } },
"./domain/reaction/createComment/feature": { "default": { "access": "public" } },
"./domain/reaction/toggleRating/feature": { "default": { "access": "public" } },
"./domain/reaction/getByIdAggregated/feature": { "default": { "access": "public" } },
"./domain/reaction/getByPostAggregated/feature": { "default": { "access": "public" } },
"./domain/reaction/remove/feature": { "default": { "access": "public" } },

"./domain/reaction/toggleRating/feature": { "default": { "access": "public" } },
"./domain/reaction/updateRatingCount/feature": { "default": { "access": "private" }},

"./domain/relation/aggregate/feature": { "default": { "access": "private" } },
"./domain/relation/exploreAggregated/feature": { "default": { "access": "public" } },
"./domain/relation/establish/feature": { "default": { "access": "public" }},
"./domain/relation/getAggregated/feature": { "default": { "access": "public" } },
"./domain/relation/getFollowersAggregated/feature": { "default": { "access": "public" } },
"./domain/relation/getFollowingAggregated/feature": { "default": { "access": "public" } },

"./domain/notification/getRecentAggregated/feature": { "default": { "access": "public" } },
"./domain/notification/getByIdAggregated/feature": { "default": { "access": "public" } }
"./domain/relation/getFollowingAggregated/feature": { "default": { "access": "public" } }
}
7 changes: 6 additions & 1 deletion segments/reads.segment.skip.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
"./domain/comment/getById/feature": { "default": { "access": "protected" } },

"./domain/creator/getById/feature": { "default": { "access": "protected" } },
"./domain/creator/getByEmail/feature": { "default": { "access": "protected" } },
"./domain/creator/getByNickname/feature": { "default": { "access": "protected" } },
"./domain/creator/getMe/feature": { "default": { "access": "protected" } },
"./domain/creator/getOthers/feature": { "default": { "access": "private" } },

"./domain/image/getById/feature": { "default": { "access": "protected" } },

Expand All @@ -20,7 +22,10 @@
"./domain/reaction/getById/feature": { "default": { "access": "protected" } },
"./domain/reaction/getByPost/feature": { "default": { "access": "protected" } },

"./domain/relation/establish/dataExists": { "default": { "access": "protected" } },
"./domain/relation/explore/feature": { "default": { "access": "protected" } },
"./domain/relation/get/feature": { "default": { "access": "protected" } },
"./domain/relation/getFollowers/feature": { "default": { "access": "protected" } },
"./domain/relation/getFollowing/feature": { "default": { "access": "protected" } }
"./domain/relation/getFollowing/feature": { "default": { "access": "protected" } },
"./domain/relation/translateToRequester/feature": { "default": { "access": "private" } }
}
10 changes: 8 additions & 2 deletions segments/writes.segment.skip.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@

"./domain/post/create/feature": { "default": { "access": "protected" } },
"./domain/post/erase/feature": { "default": { "access": "protected" } },
"./domain/post/remove/deleteData": { "default": { "access": "protected" }},
"./domain/post/update/feature": { "default": { "access": "protected" } },

"./domain/rating/update/feature": { "default": { "access": "protected" } },

"./domain/reaction/remove/removeData": { "default": { "access": "protected" } },
"./domain/reaction/update/feature": { "default": { "access": "protected" } }
"./domain/reaction/create/feature": { "default": { "access": "protected" } },
"./domain/reaction/remove/deleteData": { "default": { "access": "protected" } },
"./domain/reaction/update/feature": { "default": { "access": "protected" } },

"./domain/relation/establish/insertData": { "default": { "access": "protected" } },
"./domain/relation/establish/eraseData": { "default": { "access": "protected" } }
}
2 changes: 1 addition & 1 deletion services/standalone.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"trustKey": "${JITAR_TRUST_KEY}",
"serveIndexOnNotFound": true,
"assets": ["index.html", "main.js", "assets/**/*", "webui/**/*"],
"segments": ["bff", "notification"],
"segments": ["bff"],
"middlewares": [
"./integrations/runtime/authenticationMiddleware"
]
Expand Down
2 changes: 1 addition & 1 deletion src/domain/notification/getByIdAggregated/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import aggregate from '../aggregate/feature';
import type { AggregatedData } from '../aggregate/types';
import getById from '../getById/feature';

export default async function get(requester: Requester, id: string): Promise<AggregatedData>
export default async function feature(requester: Requester, id: string): Promise<AggregatedData>
{
const data = await getById(id);

Expand Down
9 changes: 0 additions & 9 deletions src/domain/post/create/eraseData.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import database from '^/integrations/database/module';

import { RECORD_TYPE } from '../definitions';

export default async function removeData(id: string): Promise<void>
export default async function deleteData(id: string): Promise<void>
{
// This function could be moved to a separate feature, but we keep it here
// to demonstrate that separate parts of a feature can be segmented.
Expand Down
4 changes: 2 additions & 2 deletions src/domain/reaction/remove/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Requester } from '^/domain/authentication/types';
import updateReactionCount from '^/domain/post/updateReactionCount/feature';

import ReactionNotFound from './ReactionNotFound';
import removeData from './removeData';
import deleteData from './deleteData';
import retrieveOwnedData from './retrieveOwnedData';

export default async function feature(requester: Requester, id: string): Promise<void>
Expand All @@ -26,7 +26,7 @@ export default async function feature(requester: Requester, id: string): Promise
{
reactionCount = await updateReactionCount(reaction.postId, 'decrease');

await removeData(reaction.id);
await deleteData(reaction.id);
}
catch (error: unknown)
{
Expand Down
2 changes: 1 addition & 1 deletion src/domain/relation/establish/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import insertData from './insertData';
import RelationAlreadyExists from './RelationAlreadyExists';
import validateData from './validateData';

export default async function establish(requester: Requester, followingId: string): Promise<void>
export default async function feature(requester: Requester, followingId: string): Promise<void>
{
const relationExists = await dataExists(requester.id, followingId);

Expand Down