ddd-ts-kit 0.108.1 → 0.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +144 -0
- package/README.fr.md +33 -14
- package/README.md +28 -14
- package/dist/affected/reach-of.d.ts.map +1 -1
- package/dist/affected/reach-of.js +4 -1
- package/dist/affected/reach-of.js.map +1 -1
- package/dist/check/canonical/holds-shared-files.d.ts +3 -0
- package/dist/check/canonical/holds-shared-files.d.ts.map +1 -0
- package/dist/check/canonical/holds-shared-files.js +7 -0
- package/dist/check/canonical/holds-shared-files.js.map +1 -0
- package/dist/check/canonical/is-shared-directory.d.ts +7 -0
- package/dist/check/canonical/is-shared-directory.d.ts.map +1 -0
- package/dist/check/canonical/is-shared-directory.js +13 -0
- package/dist/check/canonical/is-shared-directory.js.map +1 -0
- package/dist/check/canonical/role.d.ts +2 -0
- package/dist/check/canonical/role.d.ts.map +1 -1
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +10 -5
- package/dist/check/canonical/roles.js.map +1 -1
- package/dist/check/canonical/shared-directories.d.ts +3 -0
- package/dist/check/canonical/shared-directories.d.ts.map +1 -0
- package/dist/check/canonical/shared-directories.js +8 -0
- package/dist/check/canonical/shared-directories.js.map +1 -0
- package/dist/check/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +43 -4
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +2 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/configuration/module-problems.js +20 -16
- package/dist/check/configuration/module-problems.js.map +1 -1
- package/dist/check/errors/code-reference.d.ts +7 -0
- package/dist/check/errors/code-reference.d.ts.map +1 -0
- package/dist/check/errors/code-reference.js +2 -0
- package/dist/check/errors/code-reference.js.map +1 -0
- package/dist/check/errors/code-references.d.ts +7 -0
- package/dist/check/errors/code-references.d.ts.map +1 -0
- package/dist/check/errors/code-references.js +13 -0
- package/dist/check/errors/code-references.js.map +1 -0
- package/dist/check/errors/kit-code-keys.d.ts +3 -0
- package/dist/check/errors/kit-code-keys.d.ts.map +1 -0
- package/dist/check/errors/kit-code-keys.js +5 -0
- package/dist/check/errors/kit-code-keys.js.map +1 -0
- package/dist/check/errors/kit-codes-list.d.ts +3 -0
- package/dist/check/errors/kit-codes-list.d.ts.map +1 -0
- package/dist/check/errors/kit-codes-list.js +3 -0
- package/dist/check/errors/kit-codes-list.js.map +1 -0
- package/dist/check/explain/errors-docs.d.ts.map +1 -1
- package/dist/check/explain/errors-docs.js +5 -2
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/module-docs.d.ts.map +1 -1
- package/dist/check/explain/module-docs.js +9 -6
- package/dist/check/explain/module-docs.js.map +1 -1
- package/dist/check/explain/persistence-docs.d.ts.map +1 -1
- package/dist/check/explain/persistence-docs.js +18 -0
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +3 -1
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/fixtures/errors-route.d.ts +1 -1
- package/dist/check/fixtures/errors-route.d.ts.map +1 -1
- package/dist/check/fixtures/errors-route.js +2 -2
- package/dist/check/fixtures/errors-route.js.map +1 -1
- package/dist/check/fixtures/files-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/files-fixtures.js +77 -0
- package/dist/check/fixtures/files-fixtures.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +2 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/module-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/module-fixtures.js +27 -31
- package/dist/check/fixtures/module-fixtures.js.map +1 -1
- package/dist/check/fixtures/named-refusal-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/named-refusal-fixtures.js +40 -0
- package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -1
- package/dist/check/fixtures/shared-folder-fixtures.d.ts +7 -0
- package/dist/check/fixtures/shared-folder-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/shared-folder-fixtures.js +176 -0
- package/dist/check/fixtures/shared-folder-fixtures.js.map +1 -0
- package/dist/check/fixtures/shared-kernel-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/shared-kernel-fixtures.js +11 -0
- package/dist/check/fixtures/shared-kernel-fixtures.js.map +1 -1
- package/dist/check/fixtures/with-modules.d.ts +4 -0
- package/dist/check/fixtures/with-modules.d.ts.map +1 -0
- package/dist/check/fixtures/with-modules.js +22 -0
- package/dist/check/fixtures/with-modules.js.map +1 -0
- package/dist/check/model/context-location.d.ts +5 -0
- package/dist/check/model/context-location.d.ts.map +1 -1
- package/dist/check/project/locate.js +12 -5
- package/dist/check/project/locate.js.map +1 -1
- package/dist/check/rules/errors-known-code.d.ts.map +1 -1
- package/dist/check/rules/errors-known-code.js +60 -9
- package/dist/check/rules/errors-known-code.js.map +1 -1
- package/dist/check/rules/module-complete.d.ts.map +1 -1
- package/dist/check/rules/module-complete.js +19 -20
- package/dist/check/rules/module-complete.js.map +1 -1
- package/dist/check/rules/module-declared.js +5 -1
- package/dist/check/rules/module-declared.js.map +1 -1
- package/dist/check/rules/search-store-from-platform.d.ts +3 -0
- package/dist/check/rules/search-store-from-platform.d.ts.map +1 -0
- package/dist/check/rules/search-store-from-platform.js +93 -0
- package/dist/check/rules/search-store-from-platform.js.map +1 -0
- package/dist/check/rules/test-acceptance-black-box.d.ts.map +1 -1
- package/dist/check/rules/test-acceptance-black-box.js +6 -7
- package/dist/check/rules/test-acceptance-black-box.js.map +1 -1
- package/dist/check/rules/test-builder-required.d.ts.map +1 -1
- package/dist/check/rules/test-builder-required.js +15 -12
- package/dist/check/rules/test-builder-required.js.map +1 -1
- package/dist/check/rules/test-spec-required.d.ts.map +1 -1
- package/dist/check/rules/test-spec-required.js +12 -11
- package/dist/check/rules/test-spec-required.js.map +1 -1
- package/dist/check/rules/tree-closed.js +1 -1
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/check/support/path-in-context.d.ts +1 -1
- package/dist/check/support/path-in-context.d.ts.map +1 -1
- package/dist/check/support/path-in-context.js +6 -3
- package/dist/check/support/path-in-context.js.map +1 -1
- package/dist/check/support/test-folder-of.d.ts +11 -0
- package/dist/check/support/test-folder-of.d.ts.map +1 -0
- package/dist/check/support/test-folder-of.js +12 -0
- package/dist/check/support/test-folder-of.js.map +1 -0
- package/dist/commands/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +9 -0
- package/dist/commands/drizzle-generate.js.map +1 -1
- package/dist/commands/generate.js +9 -1
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.d.ts +2 -1
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +4 -1
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/move-to-module.d.ts.map +1 -1
- package/dist/commands/move-to-module.js +0 -2
- package/dist/commands/move-to-module.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/known-stack-keys.d.ts +1 -1
- package/dist/config/known-stack-keys.d.ts.map +1 -1
- package/dist/config/known-stack-keys.js +1 -0
- package/dist/config/known-stack-keys.js.map +1 -1
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +2 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/stack.d.ts +9 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +1 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/context-layout/context-layout.d.ts +3 -2
- package/dist/context-layout/context-layout.d.ts.map +1 -1
- package/dist/context-layout/context-layout.js +18 -8
- package/dist/context-layout/context-layout.js.map +1 -1
- package/dist/context-layout/imports-of.d.ts +11 -0
- package/dist/context-layout/imports-of.d.ts.map +1 -0
- package/dist/context-layout/imports-of.js +20 -0
- package/dist/context-layout/imports-of.js.map +1 -0
- package/dist/context-layout/module-moves.d.ts +10 -7
- package/dist/context-layout/module-moves.d.ts.map +1 -1
- package/dist/context-layout/module-moves.js +65 -122
- package/dist/context-layout/module-moves.js.map +1 -1
- package/dist/context-layout/runner-configs-by-hand.d.ts +11 -0
- package/dist/context-layout/runner-configs-by-hand.d.ts.map +1 -0
- package/dist/context-layout/runner-configs-by-hand.js +23 -0
- package/dist/context-layout/runner-configs-by-hand.js.map +1 -0
- package/dist/context-layout/settle.d.ts +20 -0
- package/dist/context-layout/settle.d.ts.map +1 -0
- package/dist/context-layout/settle.js +58 -0
- package/dist/context-layout/settle.js.map +1 -0
- package/dist/controllers/declared-code.d.ts +3 -0
- package/dist/controllers/declared-code.d.ts.map +1 -0
- package/dist/controllers/declared-code.js +8 -0
- package/dist/controllers/declared-code.js.map +1 -0
- package/dist/controllers/finish-migration.d.ts.map +1 -1
- package/dist/controllers/finish-migration.js +5 -3
- package/dist/controllers/finish-migration.js.map +1 -1
- package/dist/controllers/migrate-context.js +3 -2
- package/dist/controllers/migrate-context.js.map +1 -1
- package/dist/controllers/plan-context.d.ts +1 -1
- package/dist/controllers/plan-context.d.ts.map +1 -1
- package/dist/controllers/plan-context.js +11 -6
- package/dist/controllers/plan-context.js.map +1 -1
- package/dist/controllers/render-controller.d.ts.map +1 -1
- package/dist/controllers/render-controller.js +20 -4
- package/dist/controllers/render-controller.js.map +1 -1
- package/dist/depcruise/hygiene-rules.js +2 -2
- package/dist/depcruise/hygiene-rules.js.map +1 -1
- package/dist/depcruise/test-files.d.ts +4 -1
- package/dist/depcruise/test-files.d.ts.map +1 -1
- package/dist/depcruise/test-files.js +5 -2
- package/dist/depcruise/test-files.js.map +1 -1
- package/dist/describe/codes-named-in.d.ts +8 -0
- package/dist/describe/codes-named-in.d.ts.map +1 -0
- package/dist/describe/codes-named-in.js +33 -0
- package/dist/describe/codes-named-in.js.map +1 -0
- package/dist/describe/read-controllers.js +2 -2
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/read-route-groups.d.ts +6 -2
- package/dist/describe/read-route-groups.d.ts.map +1 -1
- package/dist/describe/read-route-groups.js +8 -4
- package/dist/describe/read-route-groups.js.map +1 -1
- package/dist/describe/read-routes.d.ts.map +1 -1
- package/dist/describe/read-routes.js +7 -2
- package/dist/describe/read-routes.js.map +1 -1
- package/dist/docs/spec-heading.d.ts +5 -4
- package/dist/docs/spec-heading.d.ts.map +1 -1
- package/dist/docs/spec-heading.js +4 -6
- package/dist/docs/spec-heading.js.map +1 -1
- package/dist/docs/spec-of-page.d.ts +7 -2
- package/dist/docs/spec-of-page.d.ts.map +1 -1
- package/dist/docs/spec-of-page.js +8 -3
- package/dist/docs/spec-of-page.js.map +1 -1
- package/dist/docs/specs-by-directory.d.ts +2 -2
- package/dist/docs/specs-by-directory.d.ts.map +1 -1
- package/dist/docs/specs-by-directory.js +4 -5
- package/dist/docs/specs-by-directory.js.map +1 -1
- package/dist/docs/write-behaviour.d.ts +1 -1
- package/dist/docs/write-behaviour.d.ts.map +1 -1
- package/dist/docs/write-behaviour.js +17 -2
- package/dist/docs/write-behaviour.js.map +1 -1
- package/dist/file-moves/follow-in-migrations.d.ts +10 -0
- package/dist/file-moves/follow-in-migrations.d.ts.map +1 -0
- package/dist/file-moves/follow-in-migrations.js +30 -0
- package/dist/file-moves/follow-in-migrations.js.map +1 -0
- package/dist/file-moves/move-files.d.ts +2 -1
- package/dist/file-moves/move-files.d.ts.map +1 -1
- package/dist/file-moves/move-files.js +4 -2
- package/dist/file-moves/move-files.js.map +1 -1
- package/dist/generate/errors/write-named-refusal.d.ts.map +1 -1
- package/dist/generate/errors/write-named-refusal.js +6 -2
- package/dist/generate/errors/write-named-refusal.js.map +1 -1
- package/dist/generate/kinds/builder-kind.js +1 -1
- package/dist/generate/kinds/builder-kind.js.map +1 -1
- package/dist/generate/kinds/declarations-of.js +1 -1
- package/dist/generate/kinds/declarations-of.js.map +1 -1
- package/dist/generate/kinds/declare-storage.d.ts +2 -1
- package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
- package/dist/generate/kinds/declare-storage.js +19 -5
- package/dist/generate/kinds/declare-storage.js.map +1 -1
- package/dist/generate/kinds/e2e/acting-role.d.ts +15 -0
- package/dist/generate/kinds/e2e/acting-role.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/acting-role.js +19 -0
- package/dist/generate/kinds/e2e/acting-role.js.map +1 -0
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +5 -1
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/kinds/gateway-kind.d.ts.map +1 -1
- package/dist/generate/kinds/gateway-kind.js +14 -2
- package/dist/generate/kinds/gateway-kind.js.map +1 -1
- package/dist/generate/kinds/generate-repository.js +1 -1
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/module-kind.d.ts.map +1 -1
- package/dist/generate/kinds/module-kind.js +9 -1
- package/dist/generate/kinds/module-kind.js.map +1 -1
- package/dist/generate/kinds/route/group-vars.d.ts.map +1 -1
- package/dist/generate/kinds/route/group-vars.js +5 -3
- package/dist/generate/kinds/route/group-vars.js.map +1 -1
- package/dist/generate/kinds/route/route-vars.js +1 -1
- package/dist/generate/kinds/route/route-vars.js.map +1 -1
- package/dist/generate/kinds/world/context-fakes.d.ts +1 -1
- package/dist/generate/kinds/world/context-fakes.d.ts.map +1 -1
- package/dist/generate/kinds/world/context-fakes.js +8 -7
- package/dist/generate/kinds/world/context-fakes.js.map +1 -1
- package/dist/generate/kinds/world/context-world.d.ts +1 -1
- package/dist/generate/kinds/world/context-world.d.ts.map +1 -1
- package/dist/generate/kinds/world/context-world.js +3 -1
- package/dist/generate/kinds/world/context-world.js.map +1 -1
- package/dist/generate/place-generated-files.d.ts +2 -0
- package/dist/generate/place-generated-files.d.ts.map +1 -1
- package/dist/generate/place-generated-files.js +13 -13
- package/dist/generate/place-generated-files.js.map +1 -1
- package/dist/generate/refresh-docs.d.ts +1 -1
- package/dist/generate/refresh-docs.d.ts.map +1 -1
- package/dist/generate/refresh-docs.js +3 -1
- package/dist/generate/refresh-docs.js.map +1 -1
- package/dist/generate/refuse-earlier-layout.d.ts +4 -3
- package/dist/generate/refuse-earlier-layout.d.ts.map +1 -1
- package/dist/generate/refuse-earlier-layout.js +9 -6
- package/dist/generate/refuse-earlier-layout.js.map +1 -1
- package/dist/help/flag-notes.d.ts.map +1 -1
- package/dist/help/flag-notes.js +8 -7
- package/dist/help/flag-notes.js.map +1 -1
- package/dist/help/tool-notes.d.ts.map +1 -1
- package/dist/help/tool-notes.js +23 -17
- package/dist/help/tool-notes.js.map +1 -1
- package/dist/help/usage.js +2 -2
- package/dist/help/work-notes.d.ts.map +1 -1
- package/dist/help/work-notes.js +4 -3
- package/dist/help/work-notes.js.map +1 -1
- package/dist/init/files/platform-files.d.ts.map +1 -1
- package/dist/init/files/platform-files.js +11 -0
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +2 -0
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +25 -24
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/rewire-personal-data.d.ts.map +1 -1
- package/dist/init/rewire-personal-data.js +4 -2
- package/dist/init/rewire-personal-data.js.map +1 -1
- package/dist/init/rewire-tables.d.ts.map +1 -1
- package/dist/init/rewire-tables.js +4 -2
- package/dist/init/rewire-tables.js.map +1 -1
- package/dist/init/stack/resolve-operations.d.ts +12 -0
- package/dist/init/stack/resolve-operations.d.ts.map +1 -0
- package/dist/init/stack/resolve-operations.js +23 -0
- package/dist/init/stack/resolve-operations.js.map +1 -0
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +2 -19
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +2 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/template-vars.d.ts.map +1 -1
- package/dist/init/template-vars.js +6 -4
- package/dist/init/template-vars.js.map +1 -1
- package/dist/init/with-held-imports.d.ts +9 -0
- package/dist/init/with-held-imports.d.ts.map +1 -0
- package/dist/init/with-held-imports.js +15 -0
- package/dist/init/with-held-imports.js.map +1 -0
- package/dist/knip/enter-module-test-folders.d.ts +10 -0
- package/dist/knip/enter-module-test-folders.d.ts.map +1 -0
- package/dist/knip/enter-module-test-folders.js +42 -0
- package/dist/knip/enter-module-test-folders.js.map +1 -0
- package/dist/knip/index.d.ts +1 -0
- package/dist/knip/index.d.ts.map +1 -1
- package/dist/knip/index.js +1 -0
- package/dist/knip/index.js.map +1 -1
- package/dist/lint/eslint-in-project.d.ts +1 -1
- package/dist/lint/eslint-in-project.d.ts.map +1 -1
- package/dist/lint/eslint-in-project.js +3 -2
- package/dist/lint/eslint-in-project.js.map +1 -1
- package/dist/lint/lint-run.d.ts +2 -0
- package/dist/lint/lint-run.d.ts.map +1 -1
- package/dist/merge/landed-commit.js +14 -2
- package/dist/merge/landed-commit.js.map +1 -1
- package/dist/merge/landed-point.js +3 -0
- package/dist/merge/landed-point.js.map +1 -1
- package/dist/merge/lost/dropped-additions.d.ts +20 -0
- package/dist/merge/lost/dropped-additions.d.ts.map +1 -0
- package/dist/merge/lost/dropped-additions.js +42 -0
- package/dist/merge/lost/dropped-additions.js.map +1 -0
- package/dist/merge/lost/expected-over.d.ts +13 -0
- package/dist/merge/lost/expected-over.d.ts.map +1 -0
- package/dist/merge/lost/expected-over.js +16 -0
- package/dist/merge/lost/expected-over.js.map +1 -0
- package/dist/merge/lost/kept-rows.d.ts +4 -2
- package/dist/merge/lost/kept-rows.d.ts.map +1 -1
- package/dist/merge/lost/kept-rows.js +10 -7
- package/dist/merge/lost/kept-rows.js.map +1 -1
- package/dist/merge/lost/lost-lines.d.ts +2 -2
- package/dist/merge/lost/lost-lines.d.ts.map +1 -1
- package/dist/merge/lost/lost-lines.js +5 -3
- package/dist/merge/lost/lost-lines.js.map +1 -1
- package/dist/merge/lost/lost-tests.d.ts +2 -2
- package/dist/merge/lost/lost-tests.d.ts.map +1 -1
- package/dist/merge/lost/lost-tests.js +5 -3
- package/dist/merge/lost/lost-tests.js.map +1 -1
- package/dist/merge/lost/verify-merge.d.ts.map +1 -1
- package/dist/merge/lost/verify-merge.js +12 -5
- package/dist/merge/lost/verify-merge.js.map +1 -1
- package/dist/merge/merge-trunk.d.ts.map +1 -1
- package/dist/merge/merge-trunk.js +35 -7
- package/dist/merge/merge-trunk.js.map +1 -1
- package/dist/merge/slices-from-fork.d.ts +20 -0
- package/dist/merge/slices-from-fork.d.ts.map +1 -0
- package/dist/merge/slices-from-fork.js +27 -0
- package/dist/merge/slices-from-fork.js.map +1 -0
- package/dist/merge/trunk-of.d.ts +4 -2
- package/dist/merge/trunk-of.d.ts.map +1 -1
- package/dist/merge/trunk-of.js +4 -2
- package/dist/merge/trunk-of.js.map +1 -1
- package/dist/migration/warn-dropped-context-tables.d.ts.map +1 -1
- package/dist/migration/warn-dropped-context-tables.js +6 -4
- package/dist/migration/warn-dropped-context-tables.js.map +1 -1
- package/dist/model-modules/context-level-folder-of.d.ts +9 -0
- package/dist/model-modules/context-level-folder-of.d.ts.map +1 -0
- package/dist/model-modules/context-level-folder-of.js +11 -0
- package/dist/model-modules/context-level-folder-of.js.map +1 -0
- package/dist/model-modules/earlier-folders.d.ts +10 -0
- package/dist/model-modules/earlier-folders.d.ts.map +1 -0
- package/dist/model-modules/earlier-folders.js +20 -0
- package/dist/model-modules/earlier-folders.js.map +1 -0
- package/dist/model-modules/folders-of-context.d.ts +8 -0
- package/dist/model-modules/folders-of-context.d.ts.map +1 -0
- package/dist/model-modules/folders-of-context.js +11 -0
- package/dist/model-modules/folders-of-context.js.map +1 -0
- package/dist/model-modules/held-file-of.d.ts +10 -0
- package/dist/model-modules/held-file-of.d.ts.map +1 -0
- package/dist/model-modules/held-file-of.js +18 -0
- package/dist/model-modules/held-file-of.js.map +1 -0
- package/dist/model-modules/index.d.ts +8 -1
- package/dist/model-modules/index.d.ts.map +1 -1
- package/dist/model-modules/index.js +8 -1
- package/dist/model-modules/index.js.map +1 -1
- package/dist/model-modules/into-module.d.ts +3 -3
- package/dist/model-modules/into-module.d.ts.map +1 -1
- package/dist/model-modules/into-module.js +9 -12
- package/dist/model-modules/into-module.js.map +1 -1
- package/dist/model-modules/is-context-level.d.ts +4 -5
- package/dist/model-modules/is-context-level.d.ts.map +1 -1
- package/dist/model-modules/is-context-level.js +6 -16
- package/dist/model-modules/is-context-level.js.map +1 -1
- package/dist/model-modules/is-held-by-shared.d.ts +8 -0
- package/dist/model-modules/is-held-by-shared.d.ts.map +1 -0
- package/dist/model-modules/is-held-by-shared.js +20 -0
- package/dist/model-modules/is-held-by-shared.js.map +1 -0
- package/dist/model-modules/module-layers.d.ts +9 -2
- package/dist/model-modules/module-layers.d.ts.map +1 -1
- package/dist/model-modules/module-layers.js +10 -3
- package/dist/model-modules/module-layers.js.map +1 -1
- package/dist/model-modules/module-name-flaw.d.ts +4 -1
- package/dist/model-modules/module-name-flaw.d.ts.map +1 -1
- package/dist/model-modules/module-name-flaw.js +6 -2
- package/dist/model-modules/module-name-flaw.js.map +1 -1
- package/dist/model-modules/module-placement.d.ts +8 -6
- package/dist/model-modules/module-placement.d.ts.map +1 -1
- package/dist/model-modules/module-placement.js +32 -30
- package/dist/model-modules/module-placement.js.map +1 -1
- package/dist/model-modules/module-split.d.ts +7 -5
- package/dist/model-modules/module-split.d.ts.map +1 -1
- package/dist/model-modules/module-split.js +18 -17
- package/dist/model-modules/module-split.js.map +1 -1
- package/dist/model-modules/module-test-folder-of.d.ts +8 -0
- package/dist/model-modules/module-test-folder-of.d.ts.map +1 -0
- package/dist/model-modules/module-test-folder-of.js +11 -0
- package/dist/model-modules/module-test-folder-of.js.map +1 -0
- package/dist/model-modules/role-folders-of.d.ts +5 -3
- package/dist/model-modules/role-folders-of.d.ts.map +1 -1
- package/dist/model-modules/role-folders-of.js +19 -11
- package/dist/model-modules/role-folders-of.js.map +1 -1
- package/dist/model-modules/role-folders.d.ts +1 -1
- package/dist/model-modules/role-folders.js +1 -1
- package/dist/model-modules/subject-module.d.ts +13 -0
- package/dist/model-modules/subject-module.d.ts.map +1 -0
- package/dist/model-modules/subject-module.js +34 -0
- package/dist/model-modules/subject-module.js.map +1 -0
- package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
- package/dist/move-to-module/moves-into-module.js +29 -16
- package/dist/move-to-module/moves-into-module.js.map +1 -1
- package/dist/naming/plural.d.ts.map +1 -1
- package/dist/naming/plural.js +5 -0
- package/dist/naming/plural.js.map +1 -1
- package/dist/plan/format-plan.js +1 -1
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/progress/build-next-of.d.ts.map +1 -1
- package/dist/progress/build-next-of.js +8 -3
- package/dist/progress/build-next-of.js.map +1 -1
- package/dist/refusals/apply-plan.d.ts.map +1 -1
- package/dist/refusals/apply-plan.js +8 -4
- package/dist/refusals/apply-plan.js.map +1 -1
- package/dist/refusals/move-named-specs.d.ts.map +1 -1
- package/dist/refusals/move-named-specs.js +7 -4
- package/dist/refusals/move-named-specs.js.map +1 -1
- package/dist/refusals/unit-folder-of.d.ts +9 -0
- package/dist/refusals/unit-folder-of.d.ts.map +1 -0
- package/dist/refusals/unit-folder-of.js +15 -0
- package/dist/refusals/unit-folder-of.js.map +1 -0
- package/dist/slice/plan-staging.d.ts +2 -1
- package/dist/slice/plan-staging.d.ts.map +1 -1
- package/dist/slice/plan-staging.js +3 -1
- package/dist/slice/plan-staging.js.map +1 -1
- package/dist/stack/declares-roles.d.ts +8 -0
- package/dist/stack/declares-roles.d.ts.map +1 -0
- package/dist/stack/declares-roles.js +11 -0
- package/dist/stack/declares-roles.js.map +1 -0
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +7 -4
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/progress-of.js +12 -1
- package/dist/worker/progress-of.js.map +1 -1
- package/dist/worker/row-commits.js +7 -1
- package/dist/worker/row-commits.js.map +1 -1
- package/package.json +6 -5
- package/templates/command/handler.spec.buses.ts.tpl +4 -1
- package/templates/command/handler.spec.container.ts.tpl +6 -1
- package/templates/controller/controller.spec.ts.tpl +4 -1
- package/templates/controller/guard.spec.ts.tpl +2 -2
- package/templates/controller/guard.ts.tpl +2 -1
- package/templates/e2e/e2e.spec.ts.tpl +5 -2
- package/templates/error/codes-import.ts.tpl +1 -0
- package/templates/error/refusal-case.spec.ts.tpl +1 -1
- package/templates/error/refusal.spec.ts.tpl +1 -0
- package/templates/file-upload/handler.spec.ts.tpl +4 -1
- package/templates/init/README.md.tpl +20 -0
- package/templates/init/docker/docker-compose.yml.tpl +24 -0
- package/templates/init/docker/env.example.tpl +9 -0
- package/templates/init/e2e/create-credentials.jwt.ts.tpl +13 -0
- package/templates/init/e2e/create-credentials.keycloak.ts.tpl +13 -0
- package/templates/init/e2e/create-credentials.none.ts.tpl +13 -0
- package/templates/init/e2e/create-credentials.passport.ts.tpl +13 -0
- package/templates/init/e2e/test-environment.ts.tpl +4 -0
- package/templates/init/main.ts.tpl +3 -0
- package/templates/init/platform/audit/search-audit-entries/search-audit-entries.controller.ts.tpl +2 -2
- package/templates/init/platform/audit/search-audit-entries/search-audit-entries.route.ts.tpl +2 -2
- package/templates/init/platform/composition/compose-application.container.ts.tpl +13 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +4 -0
- package/templates/init/platform/composition/create-platform.manual.ts.tpl +14 -4
- package/templates/init/platform/composition/lay-foundations.container.ts.tpl +30 -0
- package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +11 -0
- package/templates/init/platform/composition/platform-options.manual.ts.tpl +7 -0
- package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
- package/templates/init/platform/config/app-config.ts.tpl +13 -0
- package/templates/init/platform/config/load-config.ts.tpl +38 -3
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +8 -2
- package/templates/init/platform/search/open-search.ts.tpl +88 -0
- package/templates/init/platform/search/provisioned-indexes.ts.tpl +134 -0
- package/templates/init/platform/search/search-indexes.ts.tpl +23 -0
- package/templates/init/platform/search/search-name-taken-error.ts.tpl +10 -0
- package/templates/init/platform/search/search.module.container.ts.tpl +17 -0
- package/templates/init/platform/search/store-index.ts.tpl +49 -0
- package/templates/init/rules/infrastructure.md.tpl +3 -0
- package/templates/init/rules/platform.md.tpl +3 -0
- package/templates/init/rules/presentation.md.tpl +2 -2
- package/templates/init/rules/tests.md.tpl +1 -0
- package/templates/init/scripts/privacy-erase.container.ts.tpl +9 -0
- package/templates/init/scripts/privacy-erase.manual.ts.tpl +9 -0
- package/templates/init/scripts/privacy-export.container.ts.tpl +9 -0
- package/templates/init/scripts/privacy-export.manual.ts.tpl +9 -0
- package/templates/init/scripts/privacy-purge.container.ts.tpl +9 -0
- package/templates/init/scripts/privacy-purge.manual.ts.tpl +9 -0
- package/templates/nest-controller/controller.spec.ts.tpl +4 -1
- package/templates/pipeline/biome.json.tpl +1 -1
- package/templates/pipeline/jest.mutation.config.js.tpl +1 -1
- package/templates/pipeline/knip.json.tpl +2 -0
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/pipeline/vitest.config.ts.tpl +11 -6
- package/templates/pipeline/vitest.mutation.config.ts.tpl +1 -1
- package/templates/presets/identity/context/presentation/http/accounts.routes.ts.tpl +2 -1
- package/templates/presets/identity/context/presentation/http/invitations.routes.ts.tpl +2 -1
- package/templates/presets/identity/context/presentation/http/organisations.routes.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/change-member-role.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/deactivate-account.handler.spec.ts.tpl +4 -4
- package/templates/presets/identity/context/test/unit/grant-delegation.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/invite-member.handler.spec.ts.tpl +3 -3
- package/templates/presets/identity/context/test/unit/provision-account.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/remove-member.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/revoke-delegation.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/revoke-invitation.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/search-members.handler.spec.ts.tpl +2 -2
- package/templates/query/handler.spec.buses.ts.tpl +4 -1
- package/templates/query/handler.spec.container.ts.tpl +6 -1
- package/templates/query/search.handler.spec.buses.ts.tpl +2 -2
- package/templates/query/search.handler.spec.container.ts.tpl +2 -2
- package/templates/query/search.reader.spec.ts.tpl +2 -2
- package/templates/route/route.class-validator.ts.tpl +5 -0
- package/templates/route/route.none.ts.tpl +6 -1
- package/templates/route/route.search.ts.tpl +3 -3
- package/templates/route/route.spec.ts.tpl +4 -1
- package/templates/route/route.standard-schema.ts.tpl +5 -0
- package/templates/route/route.typebox.ts.tpl +5 -0
- package/templates/route/route.zod.ts.tpl +5 -0
- package/templates/service/main.ts.tpl +3 -0
- package/templates/value-object/value-object.spec.ts.tpl +6 -3
- package/templates/worker/main.ts.tpl +3 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two stores built under one name with another definition or other fields: they would share the
|
|
3
|
+
* indices and aliases of that name. Each name starts with its context (`billing_invoices`).
|
|
4
|
+
*/
|
|
5
|
+
export class SearchNameTakenError extends Error {
|
|
6
|
+
constructor(readonly readModel: string) {
|
|
7
|
+
super(`the search read model "${readModel}" is already built with another definition or other fields`);
|
|
8
|
+
this.name = 'SearchNameTakenError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineContextModule, type ContextModule } from '@ddd-ts-kit/di';
|
|
2
|
+
import { SearchIndexes } from '{{alias.platform}}/search/search-indexes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The read models of OpenSearch as a capability of the platform: `SearchIndexes`, which the
|
|
6
|
+
* adapter of a read model port names in its constructor, and the provisioning of the index of
|
|
7
|
+
* every store built by then, at the start.
|
|
8
|
+
*/
|
|
9
|
+
export function searchModule(search: SearchIndexes): ContextModule {
|
|
10
|
+
return defineContextModule({
|
|
11
|
+
name: 'search',
|
|
12
|
+
register(builder) {
|
|
13
|
+
builder.bind(SearchIndexes).toValue(search);
|
|
14
|
+
},
|
|
15
|
+
onStart: () => search.provision(),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { OpenSearchReadModelStore } from '@ddd-ts-kit/opensearch';
|
|
2
|
+
|
|
3
|
+
/** What provisions the index of a store: the store itself, built on the transport of the platform. */
|
|
4
|
+
type Provisioned = Pick<OpenSearchReadModelStore<object>, 'ensureMapping' | 'provision'>;
|
|
5
|
+
|
|
6
|
+
/** The index of one store, provisioned once, or once per tenant: an attempt that failed is made again at the next request. */
|
|
7
|
+
export class StoreIndex {
|
|
8
|
+
private mapping: Promise<void> | undefined;
|
|
9
|
+
private readonly tenants = new Map<string, Promise<void>>();
|
|
10
|
+
|
|
11
|
+
constructor(private readonly store: Provisioned) {}
|
|
12
|
+
|
|
13
|
+
/** Whether the tenant was provisioned, or is being. */
|
|
14
|
+
has(tenant: string): boolean {
|
|
15
|
+
return this.tenants.has(tenant);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Without tenancy: the index and its alias. */
|
|
19
|
+
mapped(): Promise<void> {
|
|
20
|
+
this.mapping ??= this.store.ensureMapping().catch((error: unknown) => {
|
|
21
|
+
this.mapping = undefined;
|
|
22
|
+
|
|
23
|
+
throw error;
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return this.mapping;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Under a tenant strategy: the index or the filtered alias of one tenant; its failure is its own. */
|
|
30
|
+
provisioned(tenant: string): Promise<void> {
|
|
31
|
+
const known = this.tenants.get(tenant);
|
|
32
|
+
|
|
33
|
+
if (known !== undefined) {
|
|
34
|
+
return known;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const provisioning = Promise.resolve()
|
|
38
|
+
.then(() => this.store.provision(tenant))
|
|
39
|
+
.catch((error: unknown) => {
|
|
40
|
+
this.tenants.delete(tenant);
|
|
41
|
+
|
|
42
|
+
throw error;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
this.tenants.set(tenant, provisioning);
|
|
46
|
+
|
|
47
|
+
return provisioning;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -34,6 +34,9 @@ paths:
|
|
|
34
34
|
{{#if eventSourcing.on}}
|
|
35
35
|
- The repository adapter of an event-sourced aggregate delegates to `EventSourcedRepository` of the kernel. Its stored events are declared in `persistence/<aggregate>-events.mapper.ts` with `defineStoredEvent` and a named type of their data; a change of that type is a new version with its upcaster, never an edit (`event-sourcing/upcaster-required`, against `stored-events.lock.json`, which `ddd-ts-kit docs --stored-events` writes once the shape of a version is final; `docs --check` fails while a version is unrecorded). Every named type the data reaches is declared in the codec file too.
|
|
36
36
|
{{/if}}
|
|
37
|
+
{{#if search.opensearch}}
|
|
38
|
+
- A read model kept in OpenSearch is written by hand, no generator yet: `class SearchInvoiceList extends OpenSearchReadModelStore<InvoiceRow> implements InvoiceList`, whose constructor takes `SearchIndexes` of the platform and calls `super(search.options('billing_invoices', invoiceCriteria))`; its name starts with the context, and nothing else of `@ddd-ts-kit/opensearch` is named here (`search/store-from-platform`). It is a copy for reading, written by its projection (`upsertIfNewer` with the stamp of the event, `delete` that keeps a tombstone) and rebuilt from the events: never read to decide an invariant or a right. It passes `readModelRowsContract` and `criteriaContract` of `@ddd-ts-kit/testing/contracts`, on a node the run names (`OPENSEARCH_URL`); the specs of the context bind its port to `InMemoryReadModelStore` of the kernel.
|
|
39
|
+
{{/if}}
|
|
37
40
|
- Infrastructure faults are plain errors (a 5xx, reported from outside); business refusals are `DomainError`s raised by the domain.
|
|
38
41
|
- Every adapter passes the contract suite of the fake of its port (`test/integration/*.contract.spec.ts`).
|
|
39
42
|
- Method: `/ddd-ts-kit:persistence`. Create with `npx ddd-ts-kit generate repository|adapter|gateway|acl ... --json`.
|
|
@@ -24,6 +24,9 @@ paths:
|
|
|
24
24
|
{{#if files.any}}
|
|
25
25
|
- Files: `files/open-files.ts` opens the connector of `stack.storage` from `config/read-files.ts`{{#if di.container}}, `files/files.module.ts` binds the ports and the hourly purge of staged files, `files/staging-uploads.ts` stages the file a command carries on the command bus, before the transaction{{/if}}{{#unless di.container}}, `files/create-files.ts` builds them, `composition/compose-application.ts` registers the hourly purge of staged files and `buses/create-command-bus.ts` stages the file a command carries on the command bus, before the transaction{{/unless}}; the tools and the tests keep files in memory. A scanner of your own (an antivirus) is bound here, never called from a use case.
|
|
26
26
|
{{/if}}
|
|
27
|
+
{{#if search.opensearch}}
|
|
28
|
+
- Search: `search/open-search.ts` builds `SearchIndexes` from `config.search`, with the transport and the tenancy of the project{{#if tenancy.any}} (`attribute`: one index, a filtered alias per tenant; `index` there gives each tenant its own){{/if}}{{#if di.container}}, `search/search.module.ts` binds it{{/if}}{{#unless di.container}}, `platform.search` hands it to each context{{/unless}}, and the index of every store built from it is provisioned before its first request. No context opens a transport or sets a tenancy of its own (`search/store-from-platform`). In production the security plugin stays on, with TLS and a user allowed on the indices and aliases of this project only.
|
|
29
|
+
{{/if}}
|
|
27
30
|
- `@ddd-ts-kit/tracing` and `@opentelemetry/*` are imported here and nowhere else (`tracing/platform-only`).
|
|
28
31
|
- Logs, spans and error reports carry identifiers and codes only: never arguments, payloads, error messages, nor anything personal beyond the id of the actor.
|
|
29
32
|
- Configuration is read here only, by `config/load-config.ts`: validated, fail fast, every problem named by its variable. A new variable joins `AppConfig` and `.env.example`. `RUN_JOBS` says whether a process runs the jobs, `jobs/job-settings.ts` what configuration changes of each.
|
|
@@ -30,10 +30,10 @@ paths:
|
|
|
30
30
|
- Imports `application/` (and domain types for mapping), never `infrastructure/` (`layer/presentation-no-infrastructure`).
|
|
31
31
|
- Input shape is validated here with the schema library of the project, behind the `Schema` port. Business rules are not validated here.
|
|
32
32
|
{{#if refusals.named}}
|
|
33
|
-
- Every route says who may call it (its group or its guards for a controller, `security` for a function) and the codes of the refusals it can answer in `errors`, as the code list of its context, `<context>.codes.ts`, lists them (`errors/known-code`); the mapping from code to status lives in one place, the error mapper. A client reads the `code`, under `facts` only what a factory exposed, and the message of the refusal as `detail` unless it quotes a fact that is not exposed.
|
|
33
|
+
- Every route says who may call it (its group or its guards for a controller, `security` for a function) and the codes of the refusals it can answer in `errors`, as the code list of its context, `<context>.codes.ts`, lists them, each named by its member of that list (`<Context>Codes.<Refusal>`) and a code of the kit by `KitCodes` of `@ddd-ts-kit/kernel` (`KitCodes.Forbidden`), so that a misspelled code does not compile (`errors/known-code`); the mapping from code to status lives in one place, the error mapper. A client reads the `code`, under `facts` only what a factory exposed, and the message of the refusal as `detail` unless it quotes a fact that is not exposed.
|
|
34
34
|
{{/if}}
|
|
35
35
|
{{#if refusals.factories}}
|
|
36
|
-
- Every route says who may call it (its group or its guards for a controller, `security` for a function) and the codes of the refusals it can answer in `errors`, as their factories set them (`errors/known-code`); the mapping from code to status lives in one place, the error mapper. A client reads the `code`, under `facts` only what a factory exposed, and the message of the refusal as `detail` unless it quotes a fact that is not exposed.
|
|
36
|
+
- Every route says who may call it (its group or its guards for a controller, `security` for a function) and the codes of the refusals it can answer in `errors`, as their factories set them, a code of the kit named by `KitCodes` of `@ddd-ts-kit/kernel` (`KitCodes.Forbidden`) (`errors/known-code`); the mapping from code to status lives in one place, the error mapper. A client reads the `code`, under `facts` only what a factory exposed, and the message of the refusal as `detail` unless it quotes a fact that is not exposed.
|
|
37
37
|
{{/if}}
|
|
38
38
|
{{#if refusals.classes}}
|
|
39
39
|
- Every route says who may call it (its group or its guards for a controller, `security` for a function) and the `DomainError` codes it can answer in `errors`; the mapping from code to status lives in one place, the error mapper.
|
|
@@ -13,6 +13,11 @@ import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
|
13
13
|
{{#if queue.redis}}
|
|
14
14
|
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
15
15
|
{{/if}}
|
|
16
|
+
{{#unless queue.redis}}
|
|
17
|
+
{{#if search.opensearch}}
|
|
18
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{/unless}}
|
|
16
21
|
{{/unless}}
|
|
17
22
|
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
18
23
|
{{#if tenancy.any}}
|
|
@@ -86,6 +91,10 @@ const application = composeApplication(persistence, {
|
|
|
86
91
|
{{#if http.any}}
|
|
87
92
|
authenticator: offlineAuthenticator,
|
|
88
93
|
{{/if}}
|
|
94
|
+
{{#if search.opensearch}}
|
|
95
|
+
// The copies of a person in the read models of OpenSearch are reached on the node of the application.
|
|
96
|
+
search: loadConfig(process.env).search,
|
|
97
|
+
{{/if}}
|
|
89
98
|
{{#if queue.redis}}
|
|
90
99
|
redis,
|
|
91
100
|
{{/if}}
|
|
@@ -13,6 +13,11 @@ import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
|
13
13
|
{{#if queue.redis}}
|
|
14
14
|
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
15
15
|
{{/if}}
|
|
16
|
+
{{#unless queue.redis}}
|
|
17
|
+
{{#if search.opensearch}}
|
|
18
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{/unless}}
|
|
16
21
|
{{/unless}}
|
|
17
22
|
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
18
23
|
{{#if tenancy.any}}
|
|
@@ -86,6 +91,10 @@ const application = composeApplication(persistence, {
|
|
|
86
91
|
{{#if http.any}}
|
|
87
92
|
authenticator: offlineAuthenticator,
|
|
88
93
|
{{/if}}
|
|
94
|
+
{{#if search.opensearch}}
|
|
95
|
+
// The copies of a person in the read models of OpenSearch are reached on the node of the application.
|
|
96
|
+
search: loadConfig(process.env).search,
|
|
97
|
+
{{/if}}
|
|
89
98
|
{{#if queue.redis}}
|
|
90
99
|
redis,
|
|
91
100
|
{{/if}}
|
|
@@ -8,6 +8,11 @@ import { composeApplication } from '{{alias.platform}}/composition/compose-appli
|
|
|
8
8
|
{{#if persistence.needsUrl}}
|
|
9
9
|
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
10
10
|
{{/if}}
|
|
11
|
+
{{#unless persistence.needsUrl}}
|
|
12
|
+
{{#if search.opensearch}}
|
|
13
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{/unless}}
|
|
11
16
|
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
12
17
|
{{#if tenancy.any}}
|
|
13
18
|
import { tenantDirectory } from '{{alias.platform}}/composition/tenant-directory{{alias.ext}}';
|
|
@@ -57,6 +62,10 @@ const application = composeApplication(persistence, {
|
|
|
57
62
|
{{#if http.any}}
|
|
58
63
|
authenticator: offlineAuthenticator,
|
|
59
64
|
{{/if}}
|
|
65
|
+
{{#if search.opensearch}}
|
|
66
|
+
// The copies of a person in the read models of OpenSearch are reached on the node of the application.
|
|
67
|
+
search: loadConfig(process.env).search,
|
|
68
|
+
{{/if}}
|
|
60
69
|
});
|
|
61
70
|
|
|
62
71
|
{{#if tenancy.any}}
|
|
@@ -8,6 +8,11 @@ import { composeApplication } from '{{alias.platform}}/composition/compose-appli
|
|
|
8
8
|
{{#if persistence.needsUrl}}
|
|
9
9
|
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
10
10
|
{{/if}}
|
|
11
|
+
{{#unless persistence.needsUrl}}
|
|
12
|
+
{{#if search.opensearch}}
|
|
13
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{/unless}}
|
|
11
16
|
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
12
17
|
{{#if tenancy.any}}
|
|
13
18
|
import { tenantDirectory } from '{{alias.platform}}/composition/tenant-directory{{alias.ext}}';
|
|
@@ -57,6 +62,10 @@ const application = composeApplication(persistence, {
|
|
|
57
62
|
{{#if http.any}}
|
|
58
63
|
authenticator: offlineAuthenticator,
|
|
59
64
|
{{/if}}
|
|
65
|
+
{{#if search.opensearch}}
|
|
66
|
+
// The copies of a person in the read models of OpenSearch are reached on the node of the application.
|
|
67
|
+
search: loadConfig(process.env).search,
|
|
68
|
+
{{/if}}
|
|
60
69
|
});
|
|
61
70
|
|
|
62
71
|
{{#if tenancy.any}}
|
|
@@ -9,6 +9,11 @@ import { composeApplication } from '{{alias.platform}}/composition/compose-appli
|
|
|
9
9
|
{{#if persistence.needsUrl}}
|
|
10
10
|
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
11
11
|
{{/if}}
|
|
12
|
+
{{#unless persistence.needsUrl}}
|
|
13
|
+
{{#if search.opensearch}}
|
|
14
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
15
|
+
{{/if}}
|
|
16
|
+
{{/unless}}
|
|
12
17
|
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
13
18
|
import { inProcessEvents } from '{{alias.platform}}/events/in-process-events{{alias.ext}}';
|
|
14
19
|
import { runPurge } from '{{alias.platform}}/privacy/run-purge{{alias.ext}}';
|
|
@@ -37,6 +42,10 @@ const application = composeApplication(persistence, {
|
|
|
37
42
|
{{#if http.any}}
|
|
38
43
|
authenticator: offlineAuthenticator,
|
|
39
44
|
{{/if}}
|
|
45
|
+
{{#if search.opensearch}}
|
|
46
|
+
// The copies of a person in the read models of OpenSearch are reached on the node of the application.
|
|
47
|
+
search: loadConfig(process.env).search,
|
|
48
|
+
{{/if}}
|
|
40
49
|
});
|
|
41
50
|
|
|
42
51
|
const actor: Actor = { id: values.operator, type: 'user', roles: [], attributes: {} };
|
|
@@ -9,6 +9,11 @@ import { composeApplication } from '{{alias.platform}}/composition/compose-appli
|
|
|
9
9
|
{{#if persistence.needsUrl}}
|
|
10
10
|
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
11
11
|
{{/if}}
|
|
12
|
+
{{#unless persistence.needsUrl}}
|
|
13
|
+
{{#if search.opensearch}}
|
|
14
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
15
|
+
{{/if}}
|
|
16
|
+
{{/unless}}
|
|
12
17
|
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
13
18
|
import { inProcessEvents } from '{{alias.platform}}/events/in-process-events{{alias.ext}}';
|
|
14
19
|
import { runPurge } from '{{alias.platform}}/privacy/run-purge{{alias.ext}}';
|
|
@@ -37,6 +42,10 @@ const application = composeApplication(persistence, {
|
|
|
37
42
|
{{#if http.any}}
|
|
38
43
|
authenticator: offlineAuthenticator,
|
|
39
44
|
{{/if}}
|
|
45
|
+
{{#if search.opensearch}}
|
|
46
|
+
// The copies of a person in the read models of OpenSearch are reached on the node of the application.
|
|
47
|
+
search: loadConfig(process.env).search,
|
|
48
|
+
{{/if}}
|
|
40
49
|
});
|
|
41
50
|
|
|
42
51
|
const actor: Actor = { id: values.operator, type: 'user', roles: [], attributes: {} };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
2
|
import { nestControllerRoute } from '@ddd-ts-kit/http/nest';
|
|
3
3
|
import { routeOf } from '@ddd-ts-kit/http/testing';
|
|
4
|
+
{{#if route.refusesMissing}}
|
|
5
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
6
|
+
{{/if}}
|
|
4
7
|
import { {{route.recordingBus}} } from '@ddd-ts-kit/kernel/testing';
|
|
5
8
|
import { classSchema } from '@ddd-ts-kit/validation/class-validator';
|
|
6
9
|
{{route.messageImport}}
|
|
@@ -43,7 +46,7 @@ describe('{{route.method}} {{route.path}}', () => {
|
|
|
43
46
|
expect(response).toMatchObject({
|
|
44
47
|
status: 422,
|
|
45
48
|
body: {
|
|
46
|
-
code:
|
|
49
|
+
code: KitCodes.ValidationFailed,
|
|
47
50
|
issues: expect.arrayContaining([expect.objectContaining({ path: 'body.{{route.missingField}}' })]),
|
|
48
51
|
},
|
|
49
52
|
});
|
|
@@ -4,5 +4,5 @@ import base from './jest.config.js';
|
|
|
4
4
|
export default {
|
|
5
5
|
...base,
|
|
6
6
|
testMatch: ['<rootDir>/{{config.sourceRoot}}/**/*.spec.ts'],
|
|
7
|
-
testPathIgnorePatterns: [...base.testPathIgnorePatterns, '/{{config.contextsDir}}/[^/]+/test/integration/'],
|
|
7
|
+
testPathIgnorePatterns: [...base.testPathIgnorePatterns, '/{{config.contextsDir}}/[^/]+/(?:test|[^/]+/test)/integration/'],
|
|
8
8
|
};
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
"{{config.sourceRoot}}/**/*.spec.ts",
|
|
21
21
|
"{{config.contextsDir}}/*/test/fakes/*.ts",
|
|
22
22
|
"{{config.contextsDir}}/*/test/worlds/*.ts",
|
|
23
|
+
"{{config.contextsDir}}/*/*/test/fakes/*.ts",
|
|
24
|
+
"{{config.contextsDir}}/*/*/test/worlds/*.ts",
|
|
23
25
|
"test/architecture/**/*.spec.ts"{{knip.e2eSpecs}}{{knip.testDatabase}}
|
|
24
26
|
]
|
|
25
27
|
}
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"ci:build": "npm run build"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@biomejs/biome": "2.6.
|
|
23
|
+
"@biomejs/biome": "2.6.4",
|
|
24
24
|
"@commitlint/cli": "^21.2.3",
|
|
25
25
|
"@commitlint/config-conventional": "^21.2.3",
|
|
26
|
-
"@ddd-ts-kit/eslint-plugin": "^0.
|
|
26
|
+
"@ddd-ts-kit/eslint-plugin": "^0.110.0",
|
|
27
27
|
"@eslint/js": "^10.0.1",
|
|
28
28
|
"@typescript/native": "npm:typescript@~7.0.2",
|
|
29
29
|
"@vitest/coverage-v8": "^5.0.3",
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { governedCoverage, unaffectedContexts } from '@ddd-ts-kit/testing/coverage';
|
|
2
2
|
{{#if decorators.standard}}
|
|
3
|
-
import { decorators } from '@ddd-ts-kit/testing/vitest';
|
|
3
|
+
import { decoratorCoverage, decorators } from '@ddd-ts-kit/testing/vitest';
|
|
4
4
|
{{/if}}
|
|
5
5
|
{{#if decorators.legacy}}
|
|
6
6
|
import { decoratorCoverage } from '@ddd-ts-kit/testing/vitest';
|
|
7
7
|
{{/if}}
|
|
8
8
|
import { configDefaults, defineConfig, type TestProjectInlineConfiguration } from 'vitest/config';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// The integration specs of a context, and of a module of its model that holds its tests.
|
|
11
|
+
const INTEGRATION_SPECS = [
|
|
12
|
+
'{{config.contextsDir}}/*/test/integration/**/*.spec.ts',
|
|
13
|
+
'{{config.contextsDir}}/*/*/test/integration/**/*.spec.ts',
|
|
14
|
+
];
|
|
15
|
+
|
|
11
16
|
const INTEGRATION_MODE = 'integration';
|
|
12
17
|
// A pull request names the contexts its change reaches (DDD_TS_KIT_AFFECTED, from `ddd-ts-kit affected`): the specs of the others are left to the default branch.
|
|
13
18
|
const NOT_AFFECTED = unaffectedContexts().map((directory) => `${directory}**`);
|
|
@@ -19,7 +24,7 @@ const UNIT_PROJECT: TestProjectInlineConfiguration = {
|
|
|
19
24
|
test: {
|
|
20
25
|
name: 'unit',
|
|
21
26
|
include: ['{{config.sourceRoot}}/**/*.spec.ts', 'test/architecture/**/*.spec.ts'],
|
|
22
|
-
exclude: [INTEGRATION_SPECS, ...NOT_AFFECTED],
|
|
27
|
+
exclude: [...INTEGRATION_SPECS, ...NOT_AFFECTED],
|
|
23
28
|
// The unit specs share no state: each worker runs them in one module graph, the declarations of a context evaluated once rather than once per spec file. `isolate: true` gives each file its own graph again.
|
|
24
29
|
isolate: false,
|
|
25
30
|
},
|
|
@@ -29,7 +34,7 @@ const INTEGRATION_PROJECT: TestProjectInlineConfiguration = {
|
|
|
29
34
|
extends: true,
|
|
30
35
|
test: {
|
|
31
36
|
name: INTEGRATION_MODE,
|
|
32
|
-
include:
|
|
37
|
+
include: INTEGRATION_SPECS,
|
|
33
38
|
exclude: NOT_AFFECTED,
|
|
34
39
|
{{#if persistence.hasDatabase}}
|
|
35
40
|
globalSetup: ['test/support/test-database-template.ts'],
|
|
@@ -44,8 +49,8 @@ const INTEGRATION_PROJECT: TestProjectInlineConfiguration = {
|
|
|
44
49
|
|
|
45
50
|
export default defineConfig(({ mode }) => ({
|
|
46
51
|
{{#if decorators.standard}}
|
|
47
|
-
// Vitest does not lower standard (TC39) decorators, which every class of a declared context carries: the compiler the project builds with does.
|
|
48
|
-
plugins: [decorators({ compiler: '@typescript/native' })],
|
|
52
|
+
// Vitest does not lower standard (TC39) decorators, which every class of a declared context carries: the compiler the project builds with does. What it writes to apply them holds closures no spec calls, kept out of the measure.
|
|
53
|
+
plugins: [decorators({ compiler: '@typescript/native' }), decoratorCoverage()],
|
|
49
54
|
{{/if}}
|
|
50
55
|
{{#if decorators.legacy}}
|
|
51
56
|
// Under `emitDecoratorMetadata` the transform guards every type a decorated class names with a branch no test can take: the statements that apply decorators are kept out of the measure.
|
|
@@ -20,7 +20,7 @@ export default defineConfig({
|
|
|
20
20
|
resolve: { tsconfigPaths: true },
|
|
21
21
|
test: {
|
|
22
22
|
include: ['{{config.sourceRoot}}/**/*.spec.ts'],
|
|
23
|
-
exclude: ['{{config.contextsDir}}/*/test/integration/**'],
|
|
23
|
+
exclude: ['{{config.contextsDir}}/*/test/integration/**', '{{config.contextsDir}}/*/*/test/integration/**'],
|
|
24
24
|
{{#if assembly.discovery}}
|
|
25
25
|
// Discovery imports the role files of a context itself: inlined, the package loads them through the runner, which compiles them.
|
|
26
26
|
server: { deps: { inline: ['@ddd-ts-kit/di'] } },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Authenticated, RouteGroup } from '@ddd-ts-kit/http';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
|
|
3
4
|
/** The account of the person who calls: every route is about the caller, named by their token. */
|
|
4
|
-
@RouteGroup({ prefix: '/accounts', tags: ['{{context.kebab}}'], guards: [Authenticated], errors: [
|
|
5
|
+
@RouteGroup({ prefix: '/accounts', tags: ['{{context.kebab}}'], guards: [Authenticated], errors: [KitCodes.Forbidden] })
|
|
5
6
|
export class AccountsRoutes {}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Authenticated, RouteGroup } from '@ddd-ts-kit/http';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
|
|
3
4
|
/** The answers of a person to an invitation sent to them, by its token. */
|
|
4
|
-
@RouteGroup({ prefix: '/invitations', tags: ['{{context.kebab}}'], guards: [Authenticated], errors: [
|
|
5
|
+
@RouteGroup({ prefix: '/invitations', tags: ['{{context.kebab}}'], guards: [Authenticated], errors: [KitCodes.Forbidden] })
|
|
5
6
|
export class InvitationsRoutes {}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Authenticated, RouteGroup } from '@ddd-ts-kit/http';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
|
|
3
4
|
/** The organisations, their members, their invitations and their delegations: inside one, the policies of the context decide. */
|
|
4
|
-
@RouteGroup({ prefix: '/organisations', tags: ['{{context.kebab}}'], guards: [Authenticated], errors: [
|
|
5
|
+
@RouteGroup({ prefix: '/organisations', tags: ['{{context.kebab}}'], guards: [Authenticated], errors: [KitCodes.Forbidden] })
|
|
5
6
|
export class OrganisationsRoutes {}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
3
4
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
4
5
|
import { ChangeMemberRoleCommand } from '{{alias.context}}/application/commands/change-member-role/change-member-role.command{{alias.ext}}';
|
|
@@ -76,7 +77,7 @@ describe('Change member role', () => {
|
|
|
76
77
|
|
|
77
78
|
await expect(
|
|
78
79
|
arranged.application.commandBus.execute(new ChangeMemberRoleCommand(arranged.as('subject-alan'), 'acme', 'subject-grace', MemberRole.Admin)),
|
|
79
|
-
).rejects.toMatchObject({ code:
|
|
80
|
+
).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
80
81
|
});
|
|
81
82
|
});
|
|
82
83
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
-
import { offsetPage } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { KitCodes, offsetPage } from '@ddd-ts-kit/kernel';
|
|
3
3
|
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
4
4
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
5
5
|
import { DeactivateAccountCommand } from '{{alias.context}}/application/commands/deactivate-account/deactivate-account.command{{alias.ext}}';
|
|
@@ -74,9 +74,9 @@ describe('Deactivate account', () => {
|
|
|
74
74
|
const remove = new RemoveMemberCommand(as('subject-grace'), 'acme', 'subject-alan');
|
|
75
75
|
const search = new SearchMembersQuery(as('subject-grace'), 'acme', offsetPage({ limit: 20 }));
|
|
76
76
|
|
|
77
|
-
await expect(application.commandBus.execute(invite)).rejects.toMatchObject({ code:
|
|
78
|
-
await expect(application.commandBus.execute(remove)).rejects.toMatchObject({ code:
|
|
79
|
-
await expect(application.queryBus.execute(search)).rejects.toMatchObject({ code:
|
|
77
|
+
await expect(application.commandBus.execute(invite)).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
78
|
+
await expect(application.commandBus.execute(remove)).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
79
|
+
await expect(application.queryBus.execute(search)).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
80
80
|
expect(await members.countOwners('acme')).toBe(1);
|
|
81
81
|
});
|
|
82
82
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
3
4
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
4
5
|
import { GrantDelegationCommand } from '{{alias.context}}/application/commands/grant-delegation/grant-delegation.command{{alias.ext}}';
|
|
@@ -57,7 +58,7 @@ describe('Grant delegation', () => {
|
|
|
57
58
|
|
|
58
59
|
await expect(
|
|
59
60
|
application.commandBus.execute(new GrantDelegationCommand(as('subject-ada'), 'acme', lend(MemberRight.InviteMembers))),
|
|
60
|
-
).rejects.toMatchObject({ code:
|
|
61
|
+
).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
61
62
|
});
|
|
62
63
|
});
|
|
63
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
-
import type
|
|
2
|
+
import { type DomainEvent, KitCodes } from '@ddd-ts-kit/kernel';
|
|
3
3
|
import { InvitationIssued } from '{{alias.context}}/domain/events/invitation-issued.event{{alias.ext}}';
|
|
4
4
|
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
5
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
@@ -87,11 +87,11 @@ describe('Invite member', () => {
|
|
|
87
87
|
|
|
88
88
|
await expect(
|
|
89
89
|
application.commandBus.execute(new InviteMemberCommand(as('subject-alan'), 'acme', grace)),
|
|
90
|
-
).rejects.toMatchObject({ code:
|
|
90
|
+
).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
91
91
|
|
|
92
92
|
await expect(
|
|
93
93
|
application.commandBus.execute(new InviteMemberCommand(as('subject-mallory'), 'acme', grace)),
|
|
94
|
-
).rejects.toMatchObject({ code:
|
|
94
|
+
).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
95
95
|
|
|
96
96
|
expect(invitations.all()).toEqual([]);
|
|
97
97
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
import { ProvisionAccountCommand } from '{{alias.context}}/application/commands/provision-account/provision-account.command{{alias.ext}}';
|
|
3
4
|
import { anAccount } from '{{alias.context}}/test/builders/account.builder{{alias.ext}}';
|
|
4
5
|
import { arrangeIdentity } from '{{alias.context}}/test/worlds/{{context.kebab}}.world{{alias.ext}}';
|
|
@@ -59,7 +60,7 @@ describe('Provision account', () => {
|
|
|
59
60
|
const { application, stranger } = arrangeIdentity();
|
|
60
61
|
|
|
61
62
|
await expect(application.commandBus.execute(new ProvisionAccountCommand(stranger, profile))).rejects.toMatchObject({
|
|
62
|
-
code:
|
|
63
|
+
code: KitCodes.Forbidden,
|
|
63
64
|
});
|
|
64
65
|
});
|
|
65
66
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
3
4
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
4
5
|
import { RemoveMemberCommand } from '{{alias.context}}/application/commands/remove-member/remove-member.command{{alias.ext}}';
|
|
@@ -68,7 +69,7 @@ describe('Remove member', () => {
|
|
|
68
69
|
|
|
69
70
|
await expect(
|
|
70
71
|
application.commandBus.execute(new RemoveMemberCommand(as('subject-alan'), 'acme', 'subject-grace')),
|
|
71
|
-
).rejects.toMatchObject({ code:
|
|
72
|
+
).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
72
73
|
});
|
|
73
74
|
});
|
|
74
75
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
3
4
|
import { RevokeDelegationCommand } from '{{alias.context}}/application/commands/revoke-delegation/revoke-delegation.command{{alias.ext}}';
|
|
4
5
|
import { aDelegation } from '{{alias.context}}/test/builders/delegation.builder{{alias.ext}}';
|
|
@@ -46,6 +47,6 @@ describe('Revoke delegation', () => {
|
|
|
46
47
|
|
|
47
48
|
await expect(
|
|
48
49
|
application.commandBus.execute(new RevokeDelegationCommand(as('subject-alan'), 'acme', 'delegation-1')),
|
|
49
|
-
).rejects.toMatchObject({ code:
|
|
50
|
+
).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
50
51
|
});
|
|
51
52
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
2
3
|
import { InvitationStatus } from '{{alias.context}}/domain/vocabularies/invitation-status.vocabulary{{alias.ext}}';
|
|
3
4
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
4
5
|
import { RevokeInvitationCommand } from '{{alias.context}}/application/commands/revoke-invitation/revoke-invitation.command{{alias.ext}}';
|
|
@@ -41,6 +42,6 @@ describe('Revoke invitation', () => {
|
|
|
41
42
|
|
|
42
43
|
await expect(
|
|
43
44
|
application.commandBus.execute(new RevokeInvitationCommand(as('subject-alan'), 'acme', 'invitation-1')),
|
|
44
|
-
).rejects.toMatchObject({ code:
|
|
45
|
+
).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
45
46
|
});
|
|
46
47
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
-
import { offsetPage } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { KitCodes, offsetPage } from '@ddd-ts-kit/kernel';
|
|
3
3
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
4
4
|
import { SearchMembersQuery } from '{{alias.context}}/application/queries/search-members/search-members.query{{alias.ext}}';
|
|
5
5
|
import { aMember } from '{{alias.context}}/test/builders/member.builder{{alias.ext}}';
|
|
@@ -33,6 +33,6 @@ describe('Search members', () => {
|
|
|
33
33
|
|
|
34
34
|
await expect(
|
|
35
35
|
application.queryBus.execute(new SearchMembersQuery(as('subject-mallory'), 'acme', offsetPage({ limit: 20 }))),
|
|
36
|
-
).rejects.toMatchObject({ code:
|
|
36
|
+
).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
37
37
|
});
|
|
38
38
|
});
|
|
@@ -8,6 +8,9 @@ import { AuthorizationMap, authorizationMiddleware, requires } from '@ddd-ts-kit
|
|
|
8
8
|
{{/unless}}
|
|
9
9
|
import { anActor, holdersOf } from '@ddd-ts-kit/auth/testing';
|
|
10
10
|
{{/if}}
|
|
11
|
+
{{#if access.protected}}
|
|
12
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
13
|
+
{{/if}}
|
|
11
14
|
{{#unless world.through}}
|
|
12
15
|
import { createTestBuses } from '@ddd-ts-kit/testing';
|
|
13
16
|
{{/unless}}
|
|
@@ -45,7 +48,7 @@ describe('{{name.title}}', () => {
|
|
|
45
48
|
const queryBus = {{world.await}}arrange({});
|
|
46
49
|
const query = new {{name.pascal}}Query(anActor().build());
|
|
47
50
|
|
|
48
|
-
await expect(queryBus.execute(query)).rejects.toMatchObject({ code:
|
|
51
|
+
await expect(queryBus.execute(query)).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
49
52
|
});
|
|
50
53
|
{{/if}}
|
|
51
54
|
|
|
@@ -15,6 +15,11 @@ import { fake } from '@ddd-ts-kit/di';
|
|
|
15
15
|
{{#unless world.through}}
|
|
16
16
|
{{spec.diWithFake}}
|
|
17
17
|
{{spec.contextImports}}
|
|
18
|
+
{{/unless}}
|
|
19
|
+
{{#if access.protected}}
|
|
20
|
+
import { KitCodes } from '@ddd-ts-kit/kernel';
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#unless world.through}}
|
|
18
23
|
import { platformTestModule } from '{{alias.platform}}/composition/platform-test.module{{alias.ext}}';
|
|
19
24
|
{{/unless}}
|
|
20
25
|
{{#if access.protected}}
|
|
@@ -53,7 +58,7 @@ describe('{{name.title}}', () => {
|
|
|
53
58
|
const application = {{world.await}}arrange({});
|
|
54
59
|
const query = new {{name.pascal}}Query(anActor().build());
|
|
55
60
|
|
|
56
|
-
await expect(application.queryBus.execute(query)).rejects.toMatchObject({ code:
|
|
61
|
+
await expect(application.queryBus.execute(query)).rejects.toMatchObject({ code: KitCodes.Forbidden });
|
|
57
62
|
});
|
|
58
63
|
{{/if}}
|
|
59
64
|
|