diff --git a/package.json b/package.json index ee5753a6..b74db92c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/segments/bff.segment.json b/segments/bff.segment.json index 86e87507..c22a63ec 100644 --- a/segments/bff.segment.json +++ b/segments/bff.segment.json @@ -3,12 +3,28 @@ "./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" } }, @@ -16,20 +32,22 @@ "./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" } } } \ No newline at end of file diff --git a/segments/notification.segment.json b/segments/notification.segment.skip.json similarity index 100% rename from segments/notification.segment.json rename to segments/notification.segment.skip.json diff --git a/segments/reads.segment.skip.json b/segments/reads.segment.skip.json index 617fe99b..4292553f 100644 --- a/segments/reads.segment.skip.json +++ b/segments/reads.segment.skip.json @@ -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" } }, @@ -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" } } } \ No newline at end of file diff --git a/segments/writes.segment.skip.json b/segments/writes.segment.skip.json index a02da5e9..56b3dd5c 100644 --- a/segments/writes.segment.skip.json +++ b/segments/writes.segment.skip.json @@ -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" } } } \ No newline at end of file diff --git a/services/standalone.json b/services/standalone.json index 2c4dcfda..bf2cc835 100644 --- a/services/standalone.json +++ b/services/standalone.json @@ -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" ] diff --git a/src/domain/notification/getByIdAggregated/feature.ts b/src/domain/notification/getByIdAggregated/feature.ts index e41a84c3..99e47ade 100644 --- a/src/domain/notification/getByIdAggregated/feature.ts +++ b/src/domain/notification/getByIdAggregated/feature.ts @@ -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 +export default async function feature(requester: Requester, id: string): Promise { const data = await getById(id); diff --git a/src/domain/post/create/eraseData.ts b/src/domain/post/create/eraseData.ts deleted file mode 100644 index c4395509..00000000 --- a/src/domain/post/create/eraseData.ts +++ /dev/null @@ -1,9 +0,0 @@ - -import database from '^/integrations/database/module'; - -import { RECORD_TYPE } from '../definitions'; - -export default async function eraseData(id: string): Promise -{ - return database.deleteRecord(RECORD_TYPE, id); -} diff --git a/src/domain/reaction/remove/removeData.ts b/src/domain/reaction/remove/deleteData.ts similarity index 83% rename from src/domain/reaction/remove/removeData.ts rename to src/domain/reaction/remove/deleteData.ts index ed0ac9bf..bdd873cf 100644 --- a/src/domain/reaction/remove/removeData.ts +++ b/src/domain/reaction/remove/deleteData.ts @@ -3,7 +3,7 @@ import database from '^/integrations/database/module'; import { RECORD_TYPE } from '../definitions'; -export default async function removeData(id: string): Promise +export default async function deleteData(id: string): Promise { // 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. diff --git a/src/domain/reaction/remove/feature.ts b/src/domain/reaction/remove/feature.ts index 7e54603a..86f60a45 100644 --- a/src/domain/reaction/remove/feature.ts +++ b/src/domain/reaction/remove/feature.ts @@ -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 @@ -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) { diff --git a/src/domain/relation/establish/feature.ts b/src/domain/relation/establish/feature.ts index fb3c0887..9547cd10 100644 --- a/src/domain/relation/establish/feature.ts +++ b/src/domain/relation/establish/feature.ts @@ -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 +export default async function feature(requester: Requester, followingId: string): Promise { const relationExists = await dataExists(requester.id, followingId);