ddd-ts-kit 0.90.0 → 0.92.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 +474 -0
- package/README.fr.md +53 -17
- package/README.md +49 -15
- package/dist/acceptance/lock-acceptance.d.ts.map +1 -1
- package/dist/acceptance/lock-acceptance.js +2 -1
- package/dist/acceptance/lock-acceptance.js.map +1 -1
- package/dist/alias/index.d.ts +2 -1
- package/dist/alias/index.d.ts.map +1 -1
- package/dist/alias/index.js +1 -0
- package/dist/alias/index.js.map +1 -1
- package/dist/alias/mapper-target-text.d.ts +4 -0
- package/dist/alias/mapper-target-text.d.ts.map +1 -0
- package/dist/alias/mapper-target-text.js +5 -0
- package/dist/alias/mapper-target-text.js.map +1 -0
- package/dist/alias/module-name-mapper.d.ts +5 -2
- package/dist/alias/module-name-mapper.d.ts.map +1 -1
- package/dist/alias/module-name-mapper.js +5 -2
- package/dist/alias/module-name-mapper.js.map +1 -1
- package/dist/check/alias/test-runners.js +8 -3
- package/dist/check/alias/test-runners.js.map +1 -1
- package/dist/check/baseline/apply-baseline.d.ts +14 -0
- package/dist/check/baseline/apply-baseline.d.ts.map +1 -0
- package/dist/check/baseline/apply-baseline.js +30 -0
- package/dist/check/baseline/apply-baseline.js.map +1 -0
- package/dist/check/baseline/baseline-following-moves.d.ts +9 -0
- package/dist/check/baseline/baseline-following-moves.d.ts.map +1 -0
- package/dist/check/baseline/baseline-following-moves.js +10 -0
- package/dist/check/baseline/baseline-following-moves.js.map +1 -0
- package/dist/check/baseline/baseline-move.d.ts +6 -0
- package/dist/check/baseline/baseline-move.d.ts.map +1 -0
- package/dist/check/baseline/baseline-move.js +2 -0
- package/dist/check/baseline/baseline-move.js.map +1 -0
- package/dist/check/baseline/baseline-text.d.ts +4 -0
- package/dist/check/baseline/baseline-text.d.ts.map +1 -0
- package/dist/check/baseline/baseline-text.js +12 -0
- package/dist/check/baseline/baseline-text.js.map +1 -0
- package/dist/check/baseline/baseline.d.ts +6 -0
- package/dist/check/baseline/baseline.d.ts.map +1 -0
- package/dist/check/baseline/baseline.js +2 -0
- package/dist/check/baseline/baseline.js.map +1 -0
- package/dist/check/baseline/moved-baseline-text.d.ts +4 -0
- package/dist/check/baseline/moved-baseline-text.d.ts.map +1 -0
- package/dist/check/baseline/moved-baseline-text.js +13 -0
- package/dist/check/baseline/moved-baseline-text.js.map +1 -0
- package/dist/check/baseline/parse-baseline.d.ts +4 -0
- package/dist/check/baseline/parse-baseline.d.ts.map +1 -0
- package/dist/check/baseline/parse-baseline.js +19 -0
- package/dist/check/baseline/parse-baseline.js.map +1 -0
- package/dist/check/baseline/pruned-baseline.d.ts +5 -0
- package/dist/check/baseline/pruned-baseline.d.ts.map +1 -0
- package/dist/check/baseline/pruned-baseline.js +14 -0
- package/dist/check/baseline/pruned-baseline.js.map +1 -0
- package/dist/check/baseline/read-baseline.d.ts +6 -0
- package/dist/check/baseline/read-baseline.d.ts.map +1 -0
- package/dist/check/baseline/read-baseline.js +11 -0
- package/dist/check/baseline/read-baseline.js.map +1 -0
- package/dist/check/baseline/recorded-baseline.d.ts +5 -0
- package/dist/check/baseline/recorded-baseline.d.ts.map +1 -0
- package/dist/check/baseline/recorded-baseline.js +11 -0
- package/dist/check/baseline/recorded-baseline.js.map +1 -0
- package/dist/check/baseline/renamed-files.d.ts +8 -0
- package/dist/check/baseline/renamed-files.d.ts.map +1 -0
- package/dist/check/baseline/renamed-files.js +23 -0
- package/dist/check/baseline/renamed-files.js.map +1 -0
- package/dist/check/baseline/write-baseline.d.ts +4 -0
- package/dist/check/baseline/write-baseline.d.ts.map +1 -0
- package/dist/check/baseline/write-baseline.js +9 -0
- package/dist/check/baseline/write-baseline.js.map +1 -0
- package/dist/check/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +5 -1
- 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 +4 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/commands/check-command.d.ts.map +1 -1
- package/dist/check/commands/check-command.js +46 -1
- package/dist/check/commands/check-command.js.map +1 -1
- package/dist/check/commands/check-file-command.d.ts +5 -0
- package/dist/check/commands/check-file-command.d.ts.map +1 -1
- package/dist/check/commands/check-file-command.js +27 -6
- package/dist/check/commands/check-file-command.js.map +1 -1
- package/dist/check/event-sourcing/read-stored-shape.d.ts +2 -0
- package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
- package/dist/check/event-sourcing/read-stored-shape.js +3 -1
- package/dist/check/event-sourcing/read-stored-shape.js.map +1 -1
- package/dist/check/event-sourcing/stored-event-declaration.d.ts +2 -0
- package/dist/check/event-sourcing/stored-event-declaration.d.ts.map +1 -1
- package/dist/check/event-sourcing/stored-event-declarations.js +1 -0
- package/dist/check/event-sourcing/stored-event-declarations.js.map +1 -1
- package/dist/check/event-sourcing/stored-shape.d.ts +2 -0
- package/dist/check/event-sourcing/stored-shape.d.ts.map +1 -1
- package/dist/check/explain/nest-docs.d.ts +3 -0
- package/dist/check/explain/nest-docs.d.ts.map +1 -0
- package/dist/check/explain/nest-docs.js +31 -0
- package/dist/check/explain/nest-docs.js.map +1 -0
- package/dist/check/explain/rule-docs.d.ts.map +1 -1
- package/dist/check/explain/rule-docs.js +2 -0
- package/dist/check/explain/rule-docs.js.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/authz-declared-fixtures.js +1 -1
- package/dist/check/fixtures/authz-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +4 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/nest-controllers-fixtures.d.ts +3 -0
- package/dist/check/fixtures/nest-controllers-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/nest-controllers-fixtures.js +104 -0
- package/dist/check/fixtures/nest-controllers-fixtures.js.map +1 -0
- package/dist/check/fixtures/nest-fixtures.d.ts +3 -0
- package/dist/check/fixtures/nest-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/nest-fixtures.js +59 -0
- package/dist/check/fixtures/nest-fixtures.js.map +1 -0
- package/dist/check/nest/nest-equivalents-of.d.ts +14 -0
- package/dist/check/nest/nest-equivalents-of.d.ts.map +1 -0
- package/dist/check/nest/nest-equivalents-of.js +124 -0
- package/dist/check/nest/nest-equivalents-of.js.map +1 -0
- package/dist/check/project/load-project.d.ts +2 -0
- package/dist/check/project/load-project.d.ts.map +1 -1
- package/dist/check/project/load-project.js +7 -3
- package/dist/check/project/load-project.js.map +1 -1
- package/dist/check/rules/nest-controllers-current.d.ts +3 -0
- package/dist/check/rules/nest-controllers-current.d.ts.map +1 -0
- package/dist/check/rules/nest-controllers-current.js +54 -0
- package/dist/check/rules/nest-controllers-current.js.map +1 -0
- package/dist/check/rules/nest-no-parallel-pipeline.d.ts +3 -0
- package/dist/check/rules/nest-no-parallel-pipeline.d.ts.map +1 -0
- package/dist/check/rules/nest-no-parallel-pipeline.js +70 -0
- package/dist/check/rules/nest-no-parallel-pipeline.js.map +1 -0
- package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
- package/dist/check/support/is-generated-context-file.js +4 -1
- package/dist/check/support/is-generated-context-file.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +13 -5
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +21 -1
- package/dist/commands/drizzle-generate.js.map +1 -1
- package/dist/commands/generate.js +2 -0
- 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/prisma-generate.d.ts +7 -0
- package/dist/commands/prisma-generate.d.ts.map +1 -0
- package/dist/commands/prisma-generate.js +23 -0
- package/dist/commands/prisma-generate.js.map +1 -0
- package/dist/commands/typeorm-generate.d.ts +10 -0
- package/dist/commands/typeorm-generate.d.ts.map +1 -0
- package/dist/commands/typeorm-generate.js +37 -0
- package/dist/commands/typeorm-generate.js.map +1 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.d.ts.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/parse-config.js +1 -0
- package/dist/config/parse-config.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/serialize-config.js +9 -2
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +18 -5
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +5 -2
- package/dist/config/stack.js.map +1 -1
- package/dist/describe/guard-errors.d.ts +3 -0
- package/dist/describe/guard-errors.d.ts.map +1 -0
- package/dist/describe/guard-errors.js +10 -0
- package/dist/describe/guard-errors.js.map +1 -0
- package/dist/describe/no-group.d.ts +4 -0
- package/dist/describe/no-group.d.ts.map +1 -0
- package/dist/describe/no-group.js +3 -0
- package/dist/describe/no-group.js.map +1 -0
- package/dist/describe/read-controllers.d.ts +1 -1
- package/dist/describe/read-controllers.d.ts.map +1 -1
- package/dist/describe/read-controllers.js +12 -19
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/read-nest-controller-routes.d.ts +16 -0
- package/dist/describe/read-nest-controller-routes.d.ts.map +1 -0
- package/dist/describe/read-nest-controller-routes.js +117 -0
- package/dist/describe/read-nest-controller-routes.js.map +1 -0
- package/dist/describe/schema-class-of.d.ts +3 -0
- package/dist/describe/schema-class-of.d.ts.map +1 -0
- package/dist/describe/schema-class-of.js +10 -0
- package/dist/describe/schema-class-of.js.map +1 -0
- package/dist/dev/refresh-declarations.d.ts.map +1 -1
- package/dist/dev/refresh-declarations.js +4 -1
- package/dist/dev/refresh-declarations.js.map +1 -1
- package/dist/docs/declared-stored-events.d.ts +6 -2
- package/dist/docs/declared-stored-events.d.ts.map +1 -1
- package/dist/docs/declared-stored-events.js +4 -3
- package/dist/docs/declared-stored-events.js.map +1 -1
- package/dist/docs/emptily-recorded-stored-events.d.ts +6 -0
- package/dist/docs/emptily-recorded-stored-events.d.ts.map +1 -0
- package/dist/docs/emptily-recorded-stored-events.js +12 -0
- package/dist/docs/emptily-recorded-stored-events.js.map +1 -0
- package/dist/docs/refuse-unreadable-stored-events.d.ts +7 -0
- package/dist/docs/refuse-unreadable-stored-events.d.ts.map +1 -0
- package/dist/docs/refuse-unreadable-stored-events.js +27 -0
- package/dist/docs/refuse-unreadable-stored-events.js.map +1 -0
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +2 -0
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/docs/write-stored-events-lock.d.ts +3 -2
- package/dist/docs/write-stored-events-lock.d.ts.map +1 -1
- package/dist/docs/write-stored-events-lock.js +5 -2
- package/dist/docs/write-stored-events-lock.js.map +1 -1
- package/dist/file-moves/move-files.d.ts.map +1 -1
- package/dist/file-moves/move-files.js +10 -0
- package/dist/file-moves/move-files.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/aggregate-kind.d.ts.map +1 -1
- package/dist/generate/kinds/aggregate-kind.js +6 -2
- package/dist/generate/kinds/aggregate-kind.js.map +1 -1
- package/dist/generate/kinds/assert-event-store.d.ts +4 -0
- package/dist/generate/kinds/assert-event-store.d.ts.map +1 -0
- package/dist/generate/kinds/assert-event-store.js +10 -0
- package/dist/generate/kinds/assert-event-store.js.map +1 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts +9 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +49 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -0
- package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload-kind.js +9 -2
- package/dist/generate/kinds/file-upload-kind.js.map +1 -1
- package/dist/generate/kinds/form-kind.d.ts.map +1 -1
- package/dist/generate/kinds/form-kind.js +15 -11
- package/dist/generate/kinds/form-kind.js.map +1 -1
- package/dist/generate/kinds/generate-event-sourced-repository.d.ts +11 -0
- package/dist/generate/kinds/generate-event-sourced-repository.d.ts.map +1 -0
- package/dist/generate/kinds/generate-event-sourced-repository.js +48 -0
- package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -0
- package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
- package/dist/generate/kinds/generate-repository.js +5 -0
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/is-event-sourced.d.ts +9 -0
- package/dist/generate/kinds/is-event-sourced.d.ts.map +1 -0
- package/dist/generate/kinds/is-event-sourced.js +11 -0
- package/dist/generate/kinds/is-event-sourced.js.map +1 -0
- package/dist/generate/kinds/presentation/controller-source.d.ts +11 -3
- package/dist/generate/kinds/presentation/controller-source.d.ts.map +1 -1
- package/dist/generate/kinds/presentation/controller-source.js +25 -4
- package/dist/generate/kinds/presentation/controller-source.js.map +1 -1
- package/dist/generate/kinds/property-kind.d.ts +3 -0
- package/dist/generate/kinds/property-kind.d.ts.map +1 -0
- package/dist/generate/kinds/property-kind.js +51 -0
- package/dist/generate/kinds/property-kind.js.map +1 -0
- package/dist/generate/kinds/repository-kind.js +1 -1
- package/dist/generate/kinds/repository-kind.js.map +1 -1
- package/dist/generate/kinds/representation-kind.d.ts.map +1 -1
- package/dist/generate/kinds/representation-kind.js +4 -3
- package/dist/generate/kinds/representation-kind.js.map +1 -1
- package/dist/generate/kinds/route/nest-controller-vars.d.ts +11 -0
- package/dist/generate/kinds/route/nest-controller-vars.d.ts.map +1 -0
- package/dist/generate/kinds/route/nest-controller-vars.js +91 -0
- package/dist/generate/kinds/route/nest-controller-vars.js.map +1 -0
- package/dist/generate/kinds/route/nest-search-vars.d.ts +6 -0
- package/dist/generate/kinds/route/nest-search-vars.d.ts.map +1 -0
- package/dist/generate/kinds/route/nest-search-vars.js +18 -0
- package/dist/generate/kinds/route/nest-search-vars.js.map +1 -0
- package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
- package/dist/generate/kinds/route/route-vars.js +1 -9
- package/dist/generate/kinds/route/route-vars.js.map +1 -1
- package/dist/generate/kinds/route/success-status.d.ts +5 -0
- package/dist/generate/kinds/route/success-status.d.ts.map +1 -0
- package/dist/generate/kinds/route/success-status.js +11 -0
- package/dist/generate/kinds/route/success-status.js.map +1 -0
- package/dist/generate/kinds/route/write-nest-controller.d.ts +8 -0
- package/dist/generate/kinds/route/write-nest-controller.d.ts.map +1 -0
- package/dist/generate/kinds/route/write-nest-controller.js +50 -0
- package/dist/generate/kinds/route/write-nest-controller.js.map +1 -0
- package/dist/generate/kinds/route-kind.d.ts.map +1 -1
- package/dist/generate/kinds/route-kind.js +6 -1
- package/dist/generate/kinds/route-kind.js.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.js +2 -1
- package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js +5 -13
- package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/refresh-docs.d.ts.map +1 -1
- package/dist/generate/refresh-docs.js +2 -0
- package/dist/generate/refresh-docs.js.map +1 -1
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +5 -0
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +3 -1
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +7 -3
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.js +12 -6
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/files/audit-files.js +1 -1
- package/dist/init/files/audit-files.js.map +1 -1
- package/dist/init/files/auth-files.js +4 -0
- package/dist/init/files/auth-files.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +2 -0
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/platform-files.js +1 -0
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +14 -5
- package/dist/init/knip-vars.js.map +1 -1
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +10 -4
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/dependencies-against-stack.d.ts +18 -0
- package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -0
- package/dist/init/manifest/dependencies-against-stack.js +99 -0
- package/dist/init/manifest/dependencies-against-stack.js.map +1 -0
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +19 -3
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/scripts-for.js +5 -2
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +40 -30
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +14 -1
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-queue.d.ts +4 -10
- package/dist/init/stack/resolve-queue.d.ts.map +1 -1
- package/dist/init/stack/resolve-queue.js +7 -11
- package/dist/init/stack/resolve-queue.js.map +1 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +30 -9
- 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.js +1 -1
- package/dist/init/template-vars.js.map +1 -1
- package/dist/init/write-type-script-configs.d.ts.map +1 -1
- package/dist/init/write-type-script-configs.js +4 -1
- package/dist/init/write-type-script-configs.js.map +1 -1
- package/dist/markers/insert-in-region.js +1 -1
- package/dist/markers/insert-in-region.js.map +1 -1
- package/dist/merge/lost/untouched-by-branch.d.ts +12 -0
- package/dist/merge/lost/untouched-by-branch.d.ts.map +1 -0
- package/dist/merge/lost/untouched-by-branch.js +22 -0
- package/dist/merge/lost/untouched-by-branch.js.map +1 -0
- package/dist/merge/lost/verify-merge.d.ts.map +1 -1
- package/dist/merge/lost/verify-merge.js +6 -1
- package/dist/merge/lost/verify-merge.js.map +1 -1
- package/dist/migration/audit-guard/append-audit-guard.d.ts +18 -0
- package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -0
- package/dist/migration/audit-guard/append-audit-guard.js +27 -0
- package/dist/migration/audit-guard/append-audit-guard.js.map +1 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.d.ts +7 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.d.ts.map +1 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.js +18 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.js.map +1 -0
- package/dist/migration/audit-guard/audit-schema-created.d.ts +3 -0
- package/dist/migration/audit-guard/audit-schema-created.d.ts.map +1 -0
- package/dist/migration/audit-guard/audit-schema-created.js +9 -0
- package/dist/migration/audit-guard/audit-schema-created.js.map +1 -0
- package/dist/migration/audit-guard/generate-guarded.d.ts +16 -0
- package/dist/migration/audit-guard/generate-guarded.d.ts.map +1 -0
- package/dist/migration/audit-guard/generate-guarded.js +22 -0
- package/dist/migration/audit-guard/generate-guarded.js.map +1 -0
- package/dist/migration/audit-guard/guard-marker.d.ts +3 -0
- package/dist/migration/audit-guard/guard-marker.d.ts.map +1 -0
- package/dist/migration/audit-guard/guard-marker.js +3 -0
- package/dist/migration/audit-guard/guard-marker.js.map +1 -0
- package/dist/migration/audit-guard/guarded-text.d.ts +5 -0
- package/dist/migration/audit-guard/guarded-text.d.ts.map +1 -0
- package/dist/migration/audit-guard/guarded-text.js +26 -0
- package/dist/migration/audit-guard/guarded-text.js.map +1 -0
- package/dist/migration/audit-guard/migrations-under.d.ts +3 -0
- package/dist/migration/audit-guard/migrations-under.d.ts.map +1 -0
- package/dist/migration/audit-guard/migrations-under.js +15 -0
- package/dist/migration/audit-guard/migrations-under.js.map +1 -0
- package/dist/migration/audit-guard/run-orm-tool.d.ts +3 -0
- package/dist/migration/audit-guard/run-orm-tool.d.ts.map +1 -0
- package/dist/migration/audit-guard/run-orm-tool.js +13 -0
- package/dist/migration/audit-guard/run-orm-tool.js.map +1 -0
- package/dist/migration/audit-guard/schemas-first.d.ts +6 -0
- package/dist/migration/audit-guard/schemas-first.d.ts.map +1 -0
- package/dist/migration/audit-guard/schemas-first.js +17 -0
- package/dist/migration/audit-guard/schemas-first.js.map +1 -0
- package/dist/migration/audit-guard/schemas-if-missing.d.ts +7 -0
- package/dist/migration/audit-guard/schemas-if-missing.d.ts.map +1 -0
- package/dist/migration/audit-guard/schemas-if-missing.js +9 -0
- package/dist/migration/audit-guard/schemas-if-missing.js.map +1 -0
- package/dist/migration/audit-guard/type-only-imports.d.ts +6 -0
- package/dist/migration/audit-guard/type-only-imports.d.ts.map +1 -0
- package/dist/migration/audit-guard/type-only-imports.js +8 -0
- package/dist/migration/audit-guard/type-only-imports.js.map +1 -0
- package/dist/migration/format-as-the-project.d.ts +4 -0
- package/dist/migration/format-as-the-project.d.ts.map +1 -0
- package/dist/migration/format-as-the-project.js +27 -0
- package/dist/migration/format-as-the-project.js.map +1 -0
- package/dist/migration/format-written-files.d.ts.map +1 -1
- package/dist/migration/format-written-files.js +2 -24
- package/dist/migration/format-written-files.js.map +1 -1
- package/dist/migration/index.d.ts +8 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +8 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/nest-controllers/controllers-file.d.ts +3 -0
- package/dist/nest-controllers/controllers-file.d.ts.map +1 -0
- package/dist/nest-controllers/controllers-file.js +5 -0
- package/dist/nest-controllers/controllers-file.js.map +1 -0
- package/dist/nest-controllers/nest-answer.d.ts +8 -0
- package/dist/nest-controllers/nest-answer.d.ts.map +1 -0
- package/dist/nest-controllers/nest-answer.js +2 -0
- package/dist/nest-controllers/nest-answer.js.map +1 -0
- package/dist/nest-controllers/nest-controller-entry.d.ts +18 -0
- package/dist/nest-controllers/nest-controller-entry.d.ts.map +1 -0
- package/dist/nest-controllers/nest-controller-entry.js +2 -0
- package/dist/nest-controllers/nest-controller-entry.js.map +1 -0
- package/dist/nest-controllers/nest-controllers-in.d.ts +6 -0
- package/dist/nest-controllers/nest-controllers-in.d.ts.map +1 -0
- package/dist/nest-controllers/nest-controllers-in.js +108 -0
- package/dist/nest-controllers/nest-controllers-in.js.map +1 -0
- package/dist/nest-controllers/nest-read-type.d.ts +12 -0
- package/dist/nest-controllers/nest-read-type.d.ts.map +1 -0
- package/dist/nest-controllers/nest-read-type.js +2 -0
- package/dist/nest-controllers/nest-read-type.js.map +1 -0
- package/dist/nest-controllers/nest-request-part.d.ts +9 -0
- package/dist/nest-controllers/nest-request-part.d.ts.map +1 -0
- package/dist/nest-controllers/nest-request-part.js +2 -0
- package/dist/nest-controllers/nest-request-part.js.map +1 -0
- package/dist/nest-controllers/parameters-of.d.ts +8 -0
- package/dist/nest-controllers/parameters-of.d.ts.map +1 -0
- package/dist/nest-controllers/parameters-of.js +32 -0
- package/dist/nest-controllers/parameters-of.js.map +1 -0
- package/dist/nest-controllers/project-files.d.ts +6 -0
- package/dist/nest-controllers/project-files.d.ts.map +1 -0
- package/dist/nest-controllers/project-files.js +2 -0
- package/dist/nest-controllers/project-files.js.map +1 -0
- package/dist/nest-controllers/read-nest-controllers.d.ts +12 -0
- package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -0
- package/dist/nest-controllers/read-nest-controllers.js +17 -0
- package/dist/nest-controllers/read-nest-controllers.js.map +1 -0
- package/dist/nest-controllers/refresh-nest-controllers.d.ts +9 -0
- package/dist/nest-controllers/refresh-nest-controllers.d.ts.map +1 -0
- package/dist/nest-controllers/refresh-nest-controllers.js +32 -0
- package/dist/nest-controllers/refresh-nest-controllers.js.map +1 -0
- package/dist/nest-controllers/render-controllers-file.d.ts +9 -0
- package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -0
- package/dist/nest-controllers/render-controllers-file.js +72 -0
- package/dist/nest-controllers/render-controllers-file.js.map +1 -0
- package/dist/platform-folders/platform-folders.d.ts.map +1 -1
- package/dist/platform-folders/platform-folders.js +10 -0
- package/dist/platform-folders/platform-folders.js.map +1 -1
- package/dist/platform-layout/platform-layout.d.ts +3 -0
- package/dist/platform-layout/platform-layout.d.ts.map +1 -1
- package/dist/platform-layout/platform-layout.js +3 -0
- package/dist/platform-layout/platform-layout.js.map +1 -1
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +22 -2
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-preset.d.ts.map +1 -1
- package/dist/presets/identity-preset.js +4 -1
- package/dist/presets/identity-preset.js.map +1 -1
- package/dist/presets/identity-refusal.d.ts.map +1 -1
- package/dist/presets/identity-refusal.js +14 -8
- package/dist/presets/identity-refusal.js.map +1 -1
- package/dist/presets/lay-out-prisma-models.d.ts +8 -0
- package/dist/presets/lay-out-prisma-models.d.ts.map +1 -0
- package/dist/presets/lay-out-prisma-models.js +51 -0
- package/dist/presets/lay-out-prisma-models.js.map +1 -0
- package/dist/presets/preset-files.d.ts.map +1 -1
- package/dist/presets/preset-files.js +6 -1
- package/dist/presets/preset-files.js.map +1 -1
- package/dist/presets/preset.d.ts +11 -0
- package/dist/presets/preset.d.ts.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +4 -0
- package/dist/run.js.map +1 -1
- package/dist/sdk/client-files.d.ts +5 -3
- package/dist/sdk/client-files.d.ts.map +1 -1
- package/dist/sdk/client-files.js +8 -3
- package/dist/sdk/client-files.js.map +1 -1
- package/dist/sdk/client-manifest.d.ts +3 -0
- package/dist/sdk/client-manifest.d.ts.map +1 -1
- package/dist/sdk/client-manifest.js +15 -2
- package/dist/sdk/client-manifest.js.map +1 -1
- package/dist/sdk/client-operation.d.ts +6 -0
- package/dist/sdk/client-operation.d.ts.map +1 -1
- package/dist/sdk/read-operation.d.ts.map +1 -1
- package/dist/sdk/read-operation.js +6 -0
- package/dist/sdk/read-operation.js.map +1 -1
- package/dist/sdk/render-orpc.d.ts +8 -0
- package/dist/sdk/render-orpc.d.ts.map +1 -0
- package/dist/sdk/render-orpc.js +42 -0
- package/dist/sdk/render-orpc.js.map +1 -0
- package/dist/sdk/render-readme.d.ts +3 -0
- package/dist/sdk/render-readme.d.ts.map +1 -1
- package/dist/sdk/render-readme.js +46 -0
- package/dist/sdk/render-readme.js.map +1 -1
- package/dist/sdk/render-trpc.d.ts +9 -0
- package/dist/sdk/render-trpc.d.ts.map +1 -0
- package/dist/sdk/render-trpc.js +36 -0
- package/dist/sdk/render-trpc.js.map +1 -0
- package/dist/sdk/rpc-packages.d.ts +7 -0
- package/dist/sdk/rpc-packages.d.ts.map +1 -0
- package/dist/sdk/rpc-packages.js +9 -0
- package/dist/sdk/rpc-packages.js.map +1 -0
- package/dist/sdk/rpc.d.ts +4 -0
- package/dist/sdk/rpc.d.ts.map +1 -0
- package/dist/sdk/rpc.js +2 -0
- package/dist/sdk/rpc.js.map +1 -0
- package/dist/sdk/write-clients.d.ts.map +1 -1
- package/dist/sdk/write-clients.js +18 -3
- package/dist/sdk/write-clients.js.map +1 -1
- package/dist/stack/alias-vars.d.ts.map +1 -1
- package/dist/stack/alias-vars.js +2 -2
- package/dist/stack/alias-vars.js.map +1 -1
- package/dist/stack/audit-vars.js +1 -1
- package/dist/stack/audit-vars.js.map +1 -1
- package/dist/stack/authentication-vars.d.ts.map +1 -1
- package/dist/stack/authentication-vars.js +8 -2
- package/dist/stack/authentication-vars.js.map +1 -1
- package/dist/stack/cache-vars.d.ts +5 -1
- package/dist/stack/cache-vars.d.ts.map +1 -1
- package/dist/stack/cache-vars.js +9 -3
- package/dist/stack/cache-vars.js.map +1 -1
- package/dist/stack/stack-vars.d.ts +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +11 -6
- 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/briefing-of.d.ts.map +1 -1
- package/dist/worker/briefing-of.js +2 -4
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/worker/resume-message.d.ts.map +1 -1
- package/dist/worker/resume-message.js +1 -2
- package/dist/worker/resume-message.js.map +1 -1
- package/package.json +6 -4
- package/templates/architecture/extractable.declared.spec.ts.tpl +22 -17
- package/templates/architecture/extractable.manual.spec.ts.tpl +14 -9
- package/templates/architecture/extractable.tsyringe.spec.ts.tpl +19 -14
- package/templates/background-job/wiring.manual.tpl +1 -1
- package/templates/command/wiring.manual.tpl +1 -1
- package/templates/context/module.manual.ts.tpl +52 -10
- package/templates/erasure-handler/wiring.manual.tpl +1 -1
- package/templates/event-handler/wiring.manual.tpl +1 -1
- package/templates/file-upload/wiring.manual.tpl +1 -1
- package/templates/init/docker/env.example.tpl +1 -1
- package/templates/init/e2e/auth-environment.passport.ts.tpl +6 -0
- package/templates/init/e2e/create-credentials.passport.ts.tpl +47 -0
- package/templates/init/jest.config.js.tpl +6 -0
- package/templates/init/platform/auth/authentication/actor-of-token.ts.tpl +15 -0
- package/templates/init/platform/auth/authentication/bearer-strategy.ts.tpl +29 -0
- package/templates/init/platform/auth/authentication/create-authenticator.passport.ts.tpl +13 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +55 -2
- package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +1 -1
- package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/composition/platform-error-mapper.ts.tpl +9 -0
- package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +11 -0
- package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +14 -5
- package/templates/init/platform/config/app-config.ts.tpl +2 -2
- package/templates/init/platform/config/load-config.ts.tpl +2 -2
- package/templates/init/platform/database/open-persistence.memory.ts.tpl +10 -0
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +6 -1
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +6 -1
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +12 -1
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +28 -1
- package/templates/init/platform/database/persistence.contract.spec.ts.tpl +131 -0
- package/templates/init/platform/database/persistence.memory.ts.tpl +7 -1
- package/templates/init/platform/database/persistence.orm.ts.tpl +16 -3
- package/templates/init/platform/database/schema.drizzle.ts.tpl +11 -1
- package/templates/init/platform/database/schema.prisma.tpl +5 -2
- package/templates/init/platform/database/schema.typeorm.ts.tpl +17 -3
- package/templates/init/platform/database/table-statements.drizzle.ts.tpl +36 -0
- package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +18 -6
- package/templates/init/platform/files/bind-files.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/files/create-files.ts.tpl +1 -1
- package/templates/init/platform/http/create-app-module.ts.tpl +20 -0
- package/templates/init/platform/http/start-http-server.express.ts.tpl +58 -2
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +50 -2
- package/templates/init/platform/http/start-http-server.hono.ts.tpl +60 -1
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +67 -4
- package/templates/init/platform/jobs/create-background-work.ts.tpl +2 -2
- package/templates/init/rules/infrastructure.md.tpl +3 -0
- package/templates/init/rules/presentation.md.tpl +7 -0
- package/templates/integration-event/wiring.manual.tpl +1 -1
- package/templates/integration-handler/wiring.manual.tpl +1 -1
- package/templates/job/wiring.manual.tpl +1 -1
- package/templates/nest-controller/controller.search.ts.tpl +38 -0
- package/templates/nest-controller/controller.spec.ts.tpl +57 -0
- package/templates/nest-controller/controller.ts.tpl +49 -0
- package/templates/nest-controller/upload.spec.ts.tpl +47 -0
- package/templates/nest-controller/upload.ts.tpl +25 -0
- package/templates/pipeline/biome.json.tpl +2 -2
- package/templates/pipeline/eslint.config.mjs.tpl +6 -0
- package/templates/pipeline/knip.json.tpl +4 -8
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +271 -0
- package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/integration/handlers/account-deactivated.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/member-joined.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/member-removed.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/organisation-opened.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/publishers/account-deactivated.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/delegation-granted.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/delegation-revoked.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-joined.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-removed.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-role-changed.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/organisation-opened.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +6 -0
- package/templates/presets/identity/context/infrastructure/external/crypto-invitation-tokens.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/external/environment-identity-provider-connection.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/external/keycloak-identity-provider-admin.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.mapper.prisma.ts.tpl +36 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.prisma.ts.tpl +19 -0
- package/templates/presets/identity/context/infrastructure/persistence/delegation.mapper.prisma.ts.tpl +48 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-search-members-reader.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +43 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.prisma.ts.tpl +20 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-account.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-delegation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-invitation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-member.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-organisation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-search-members-reader.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/member.mapper.prisma.ts.tpl +34 -0
- package/templates/presets/identity/context/infrastructure/persistence/organisation.mapper.prisma.ts.tpl +26 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +63 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +81 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +69 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +80 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +63 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-search-members-reader.repository.prisma.ts.tpl +82 -0
- package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/deactivate-account.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.controller.nest-routes.ts.tpl +44 -0
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +56 -0
- package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.controller.nest-routes.ts.tpl +54 -0
- package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.controller.nest-routes.ts.tpl +32 -0
- package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.controller.nest-routes.ts.tpl +43 -0
- package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.controller.nest-routes.ts.tpl +25 -0
- package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.controller.nest-routes.ts.tpl +37 -0
- package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.controller.nest-routes.ts.tpl +42 -0
- package/templates/presets/identity/context/test/integration/account.repository.contract.spec.ts.tpl +3 -3
- package/templates/presets/identity/context/test/integration/delegation.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/member.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/organisation.repository.contract.spec.ts.tpl +4 -4
- package/templates/presets/identity/context/test/integration/search-members-reader.spec.ts.tpl +8 -8
- package/templates/presets/identity/context/test/unit/__context__.module.spec.explicit.ts.tpl +108 -0
- package/templates/presets/identity/context/test/unit/accept-invitation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/change-member-role.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/deactivate-account.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/decline-invitation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/grant-delegation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/invite-member.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/open-organisation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/provision-account.controller.spec.nest-routes.ts.tpl +99 -0
- package/templates/presets/identity/context/test/unit/remove-member.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/revoke-delegation.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/revoke-invitation.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/search-members.controller.spec.nest-routes.ts.tpl +54 -0
- package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +332 -0
- package/templates/presets/identity/explicit/access-policies.wiring.tpl +16 -0
- package/templates/presets/identity/prisma/models.prisma.tpl +128 -0
- package/templates/process/timeout-job.wiring.manual.tpl +1 -1
- package/templates/property/value-object.properties.spec.ts.tpl +38 -0
- package/templates/query/search.wiring.manual.tpl +1 -1
- package/templates/query/wiring.manual.tpl +1 -1
- package/templates/repository/contract.spec.ts.tpl +1 -3
- package/templates/repository/event-sourced/contract.spec.ts.tpl +36 -0
- package/templates/repository/event-sourced/fake.ts.tpl +24 -0
- package/templates/repository/event-sourced/repository.ts.tpl +38 -0
- package/templates/repository/event-sourced-first-use.wiring.manual.tpl +4 -0
- package/templates/repository/event-sourced.wiring.tsyringe.tpl +6 -0
- package/templates/repository/first-use.wiring.manual.tpl +1 -1
- package/templates/sdk/orpc.ts.tpl +46 -0
- package/templates/sdk/trpc.ts.tpl +86 -0
- /package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/{deactivate-account.controller.ts.tpl → deactivate-account.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/accounts/provision-account/{provision-account.controller.ts.tpl → provision-account.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/{accept-invitation.controller.ts.tpl → accept-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/{decline-invitation.controller.ts.tpl → decline-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/change-member-role/{change-member-role.controller.ts.tpl → change-member-role.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/{grant-delegation.controller.ts.tpl → grant-delegation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/invite-member/{invite-member.controller.ts.tpl → invite-member.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/open-organisation/{open-organisation.controller.ts.tpl → open-organisation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/remove-member/{remove-member.controller.ts.tpl → remove-member.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/{revoke-delegation.controller.ts.tpl → revoke-delegation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/{revoke-invitation.controller.ts.tpl → revoke-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/search-members/{search-members.controller.ts.tpl → search-members.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{accept-invitation.controller.spec.ts.tpl → accept-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{change-member-role.controller.spec.ts.tpl → change-member-role.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{deactivate-account.controller.spec.ts.tpl → deactivate-account.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{decline-invitation.controller.spec.ts.tpl → decline-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{grant-delegation.controller.spec.ts.tpl → grant-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{invite-member.controller.spec.ts.tpl → invite-member.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{open-organisation.controller.spec.ts.tpl → open-organisation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{provision-account.controller.spec.ts.tpl → provision-account.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{remove-member.controller.spec.ts.tpl → remove-member.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{revoke-delegation.controller.spec.ts.tpl → revoke-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{revoke-invitation.controller.spec.ts.tpl → revoke-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{search-members.controller.spec.ts.tpl → search-members.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/worlds/{__context__.world.ts.tpl → __context__.world.declared.ts.tpl} +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { executeRoute } from '@ddd-ts-kit/http';
|
|
3
|
+
import { nestControllerRoute } from '@ddd-ts-kit/http/nest';
|
|
4
|
+
import { InMemoryCommandBus, type Actor } from '@ddd-ts-kit/kernel';
|
|
5
|
+
import { classSchema } from '@ddd-ts-kit/validation/class-validator';
|
|
6
|
+
import { RevokeDelegationCommand } from '{{alias.context}}/application/commands/revoke-delegation/revoke-delegation.command{{alias.ext}}';
|
|
7
|
+
import { RevokeDelegationController } from '{{alias.context}}/presentation/http/organisations/revoke-delegation/revoke-delegation.controller{{alias.ext}}';
|
|
8
|
+
import { {{context.camel}}Controllers } from '{{alias.context}}/{{context.kebab}}.controllers{{alias.ext}}';
|
|
9
|
+
|
|
10
|
+
/** Who calls, as the authenticator of the platform makes them from the token. */
|
|
11
|
+
const caller: Actor = {
|
|
12
|
+
id: 'subject-ada',
|
|
13
|
+
type: 'user',
|
|
14
|
+
roles: [],
|
|
15
|
+
attributes: { email: 'ada@example.test', username: 'ada' },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe('DELETE /organisations/:organisationId/delegations/:delegationId', () => {
|
|
19
|
+
it('answers 200 with what the use case answered, and sends it what the request says', async () => {
|
|
20
|
+
const { route, sent } = arrange();
|
|
21
|
+
|
|
22
|
+
const response = await executeRoute(
|
|
23
|
+
route,
|
|
24
|
+
{ params: { organisationId: 'acme', delegationId: 'delegation-1' }, query: {}, headers: {}, body: {}, raw: undefined },
|
|
25
|
+
{ validateResponses: true, resolvePrincipal: () => caller },
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
expect(route.path).toBe('/organisations/:organisationId/delegations/:delegationId');
|
|
29
|
+
expect([response.status, response.body]).toEqual([200, { id: 'delegation-1' }]);
|
|
30
|
+
expect(sent).toMatchObject([{ organisationId: 'acme', delegationId: 'delegation-1' }]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('is listed in the Nest controllers of the context, which say what its signature takes and answers', () => {
|
|
34
|
+
expect({{context.camel}}Controllers).toContain(RevokeDelegationController);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/** The route, on a bus that keeps what it was sent and answers as the use case would. */
|
|
39
|
+
function arrange() {
|
|
40
|
+
const sent: RevokeDelegationCommand[] = [];
|
|
41
|
+
|
|
42
|
+
const commands = new InMemoryCommandBus().register(RevokeDelegationCommand, {
|
|
43
|
+
execute: async (command) => {
|
|
44
|
+
sent.push(command);
|
|
45
|
+
|
|
46
|
+
return 'delegation-1';
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const route = nestControllerRoute(RevokeDelegationController, {
|
|
51
|
+
instanceOf: () => new RevokeDelegationController(commands),
|
|
52
|
+
// A DTO without a decorated field accepts the empty object alone: whitelist and forbidNonWhitelisted refuse any field.
|
|
53
|
+
schemaOfClass: (dto) => classSchema(dto, { validator: { forbidUnknownValues: false } }),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return { route, sent };
|
|
57
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { executeRoute } from '@ddd-ts-kit/http';
|
|
3
|
+
import { nestControllerRoute } from '@ddd-ts-kit/http/nest';
|
|
4
|
+
import { InMemoryCommandBus, type Actor } from '@ddd-ts-kit/kernel';
|
|
5
|
+
import { classSchema } from '@ddd-ts-kit/validation/class-validator';
|
|
6
|
+
import { RevokeInvitationCommand } from '{{alias.context}}/application/commands/revoke-invitation/revoke-invitation.command{{alias.ext}}';
|
|
7
|
+
import { RevokeInvitationController } from '{{alias.context}}/presentation/http/organisations/revoke-invitation/revoke-invitation.controller{{alias.ext}}';
|
|
8
|
+
import { {{context.camel}}Controllers } from '{{alias.context}}/{{context.kebab}}.controllers{{alias.ext}}';
|
|
9
|
+
|
|
10
|
+
/** Who calls, as the authenticator of the platform makes them from the token. */
|
|
11
|
+
const caller: Actor = {
|
|
12
|
+
id: 'subject-ada',
|
|
13
|
+
type: 'user',
|
|
14
|
+
roles: [],
|
|
15
|
+
attributes: { email: 'ada@example.test', username: 'ada' },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe('DELETE /organisations/:organisationId/invitations/:invitationId', () => {
|
|
19
|
+
it('answers 200 with what the use case answered, and sends it what the request says', async () => {
|
|
20
|
+
const { route, sent } = arrange();
|
|
21
|
+
|
|
22
|
+
const response = await executeRoute(
|
|
23
|
+
route,
|
|
24
|
+
{ params: { organisationId: 'acme', invitationId: 'invitation-1' }, query: {}, headers: {}, body: {}, raw: undefined },
|
|
25
|
+
{ validateResponses: true, resolvePrincipal: () => caller },
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
expect(route.path).toBe('/organisations/:organisationId/invitations/:invitationId');
|
|
29
|
+
expect([response.status, response.body]).toEqual([200, { id: 'invitation-1' }]);
|
|
30
|
+
expect(sent).toMatchObject([{ organisationId: 'acme', invitationId: 'invitation-1' }]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('is listed in the Nest controllers of the context, which say what its signature takes and answers', () => {
|
|
34
|
+
expect({{context.camel}}Controllers).toContain(RevokeInvitationController);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/** The route, on a bus that keeps what it was sent and answers as the use case would. */
|
|
39
|
+
function arrange() {
|
|
40
|
+
const sent: RevokeInvitationCommand[] = [];
|
|
41
|
+
|
|
42
|
+
const commands = new InMemoryCommandBus().register(RevokeInvitationCommand, {
|
|
43
|
+
execute: async (command) => {
|
|
44
|
+
sent.push(command);
|
|
45
|
+
|
|
46
|
+
return 'invitation-1';
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const route = nestControllerRoute(RevokeInvitationController, {
|
|
51
|
+
instanceOf: () => new RevokeInvitationController(commands),
|
|
52
|
+
// A DTO without a decorated field accepts the empty object alone: whitelist and forbidNonWhitelisted refuse any field.
|
|
53
|
+
schemaOfClass: (dto) => classSchema(dto, { validator: { forbidUnknownValues: false } }),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return { route, sent };
|
|
57
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { executeRoute } from '@ddd-ts-kit/http';
|
|
3
|
+
import { nestControllerRoute } from '@ddd-ts-kit/http/nest';
|
|
4
|
+
import { InMemoryQueryBus, pageOf, type Actor } from '@ddd-ts-kit/kernel';
|
|
5
|
+
import { classSchema } from '@ddd-ts-kit/validation/class-validator';
|
|
6
|
+
import { SearchMembersQuery } from '{{alias.context}}/application/queries/search-members/search-members.query{{alias.ext}}';
|
|
7
|
+
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
8
|
+
import { SearchMembersController } from '{{alias.context}}/presentation/http/organisations/search-members/search-members.controller{{alias.ext}}';
|
|
9
|
+
import { {{context.camel}}Controllers } from '{{alias.context}}/{{context.kebab}}.controllers{{alias.ext}}';
|
|
10
|
+
|
|
11
|
+
const caller: Actor = { id: 'subject-ada', type: 'user', roles: [], attributes: {} };
|
|
12
|
+
|
|
13
|
+
const ada = {
|
|
14
|
+
memberId: 'member-1',
|
|
15
|
+
accountId: 'subject-ada',
|
|
16
|
+
displayName: 'Ada Lovelace',
|
|
17
|
+
email: 'ada@example.test',
|
|
18
|
+
role: MemberRole.Owner,
|
|
19
|
+
joinedAt: new Date('2026-01-01T00:00:00.000Z'),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
describe('GET /organisations/:organisationId/members', () => {
|
|
23
|
+
it('answers 200 with a page of the members, each instant written as ISO 8601', async () => {
|
|
24
|
+
const asked: SearchMembersQuery[] = [];
|
|
25
|
+
|
|
26
|
+
const queries = new InMemoryQueryBus().register(SearchMembersQuery, {
|
|
27
|
+
execute: async (query) => {
|
|
28
|
+
asked.push(query);
|
|
29
|
+
|
|
30
|
+
return pageOf([ada], { total: 1 });
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const route = nestControllerRoute(SearchMembersController, {
|
|
35
|
+
instanceOf: () => new SearchMembersController(queries),
|
|
36
|
+
// A DTO without a decorated field accepts the empty object alone: whitelist and forbidNonWhitelisted refuse any field.
|
|
37
|
+
schemaOfClass: (dto) => classSchema(dto, { validator: { forbidUnknownValues: false } }),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const response = await executeRoute(
|
|
41
|
+
route,
|
|
42
|
+
{ params: { organisationId: 'acme' }, query: { limit: '10' }, headers: {}, body: {}, raw: undefined },
|
|
43
|
+
{ validateResponses: true, resolvePrincipal: () => caller },
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
expect(response.status).toBe(200);
|
|
47
|
+
expect(response.body).toMatchObject({ items: [{ ...ada, joinedAt: '2026-01-01T00:00:00.000Z' }], total: 1 });
|
|
48
|
+
expect(asked).toMatchObject([{ organisationId: 'acme', page: { kind: 'offset', limit: 10 } }]);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('is listed in the Nest controllers of the context, which say what its signature takes and answers', () => {
|
|
52
|
+
expect({{context.camel}}Controllers).toContain(SearchMembersController);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthorizationMap,
|
|
3
|
+
PolicyAccess,
|
|
4
|
+
RoleBasedAuthorizer,
|
|
5
|
+
authorizationMiddleware,
|
|
6
|
+
requires,
|
|
7
|
+
type Access,
|
|
8
|
+
} from '@ddd-ts-kit/auth';
|
|
9
|
+
import { anActor } from '@ddd-ts-kit/auth/testing';
|
|
10
|
+
import { on, subscribeAll } from '@ddd-ts-kit/events';
|
|
11
|
+
import { InMemoryProcessedEventStore, type Actor } from '@ddd-ts-kit/kernel';
|
|
12
|
+
import { createTestBuses, type TestBuses } from '@ddd-ts-kit/testing';
|
|
13
|
+
import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
|
|
14
|
+
import { AcceptInvitationCommand } from '{{alias.context}}/application/commands/accept-invitation/accept-invitation.command{{alias.ext}}';
|
|
15
|
+
import { AcceptInvitationHandler } from '{{alias.context}}/application/commands/accept-invitation/accept-invitation.handler{{alias.ext}}';
|
|
16
|
+
import { ChangeMemberRoleCommand } from '{{alias.context}}/application/commands/change-member-role/change-member-role.command{{alias.ext}}';
|
|
17
|
+
import { ChangeMemberRoleHandler } from '{{alias.context}}/application/commands/change-member-role/change-member-role.handler{{alias.ext}}';
|
|
18
|
+
import { DeactivateAccountCommand } from '{{alias.context}}/application/commands/deactivate-account/deactivate-account.command{{alias.ext}}';
|
|
19
|
+
import { DeactivateAccountHandler } from '{{alias.context}}/application/commands/deactivate-account/deactivate-account.handler{{alias.ext}}';
|
|
20
|
+
import { DeclineInvitationCommand } from '{{alias.context}}/application/commands/decline-invitation/decline-invitation.command{{alias.ext}}';
|
|
21
|
+
import { DeclineInvitationHandler } from '{{alias.context}}/application/commands/decline-invitation/decline-invitation.handler{{alias.ext}}';
|
|
22
|
+
import { GrantDelegationCommand } from '{{alias.context}}/application/commands/grant-delegation/grant-delegation.command{{alias.ext}}';
|
|
23
|
+
import { GrantDelegationHandler } from '{{alias.context}}/application/commands/grant-delegation/grant-delegation.handler{{alias.ext}}';
|
|
24
|
+
import { InviteMemberCommand } from '{{alias.context}}/application/commands/invite-member/invite-member.command{{alias.ext}}';
|
|
25
|
+
import { InviteMemberHandler } from '{{alias.context}}/application/commands/invite-member/invite-member.handler{{alias.ext}}';
|
|
26
|
+
import { OpenOrganisationCommand } from '{{alias.context}}/application/commands/open-organisation/open-organisation.command{{alias.ext}}';
|
|
27
|
+
import { OpenOrganisationHandler } from '{{alias.context}}/application/commands/open-organisation/open-organisation.handler{{alias.ext}}';
|
|
28
|
+
import { ProvisionAccountCommand } from '{{alias.context}}/application/commands/provision-account/provision-account.command{{alias.ext}}';
|
|
29
|
+
import { ProvisionAccountHandler } from '{{alias.context}}/application/commands/provision-account/provision-account.handler{{alias.ext}}';
|
|
30
|
+
import { RemoveMemberCommand } from '{{alias.context}}/application/commands/remove-member/remove-member.command{{alias.ext}}';
|
|
31
|
+
import { RemoveMemberHandler } from '{{alias.context}}/application/commands/remove-member/remove-member.handler{{alias.ext}}';
|
|
32
|
+
import { RevokeDelegationCommand } from '{{alias.context}}/application/commands/revoke-delegation/revoke-delegation.command{{alias.ext}}';
|
|
33
|
+
import { RevokeDelegationHandler } from '{{alias.context}}/application/commands/revoke-delegation/revoke-delegation.handler{{alias.ext}}';
|
|
34
|
+
import { RevokeInvitationCommand } from '{{alias.context}}/application/commands/revoke-invitation/revoke-invitation.command{{alias.ext}}';
|
|
35
|
+
import { RevokeInvitationHandler } from '{{alias.context}}/application/commands/revoke-invitation/revoke-invitation.handler{{alias.ext}}';
|
|
36
|
+
import { SearchMembersQuery } from '{{alias.context}}/application/queries/search-members/search-members.query{{alias.ext}}';
|
|
37
|
+
import { SearchMembersHandler } from '{{alias.context}}/application/queries/search-members/search-members.handler{{alias.ext}}';
|
|
38
|
+
import { AccountDeactivatedIntegrationHandler } from '{{alias.context}}/application/integration/handlers/account-deactivated.integration-handler{{alias.ext}}';
|
|
39
|
+
import { accountDeactivatedV1 } from '{{alias.context}}/published-language/account-deactivated.v1.integration-event{{alias.ext}}';
|
|
40
|
+
import { MemberJoinedIntegrationHandler } from '{{alias.context}}/application/integration/handlers/member-joined.integration-handler{{alias.ext}}';
|
|
41
|
+
import { memberJoinedV1 } from '{{alias.context}}/published-language/member-joined.v1.integration-event{{alias.ext}}';
|
|
42
|
+
import { MemberRemovedIntegrationHandler } from '{{alias.context}}/application/integration/handlers/member-removed.integration-handler{{alias.ext}}';
|
|
43
|
+
import { memberRemovedV1 } from '{{alias.context}}/published-language/member-removed.v1.integration-event{{alias.ext}}';
|
|
44
|
+
import { OrganisationOpenedIntegrationHandler } from '{{alias.context}}/application/integration/handlers/organisation-opened.integration-handler{{alias.ext}}';
|
|
45
|
+
import { organisationOpenedV1 } from '{{alias.context}}/published-language/organisation-opened.v1.integration-event{{alias.ext}}';
|
|
46
|
+
import { AccountDeactivatedPublisher } from '{{alias.context}}/application/integration/publishers/account-deactivated.publisher{{alias.ext}}';
|
|
47
|
+
import { AccountDeactivated } from '{{alias.context}}/domain/events/account-deactivated.event{{alias.ext}}';
|
|
48
|
+
import { OrganisationOpenedPublisher } from '{{alias.context}}/application/integration/publishers/organisation-opened.publisher{{alias.ext}}';
|
|
49
|
+
import { OrganisationOpened } from '{{alias.context}}/domain/events/organisation-opened.event{{alias.ext}}';
|
|
50
|
+
import { MemberJoinedPublisher } from '{{alias.context}}/application/integration/publishers/member-joined.publisher{{alias.ext}}';
|
|
51
|
+
import { MemberJoined } from '{{alias.context}}/domain/events/member-joined.event{{alias.ext}}';
|
|
52
|
+
import { MemberRoleChangedPublisher } from '{{alias.context}}/application/integration/publishers/member-role-changed.publisher{{alias.ext}}';
|
|
53
|
+
import { MemberRoleChanged } from '{{alias.context}}/domain/events/member-role-changed.event{{alias.ext}}';
|
|
54
|
+
import { MemberRemovedPublisher } from '{{alias.context}}/application/integration/publishers/member-removed.publisher{{alias.ext}}';
|
|
55
|
+
import { MemberRemoved } from '{{alias.context}}/domain/events/member-removed.event{{alias.ext}}';
|
|
56
|
+
import { DelegationGrantedPublisher } from '{{alias.context}}/application/integration/publishers/delegation-granted.publisher{{alias.ext}}';
|
|
57
|
+
import { DelegationGranted } from '{{alias.context}}/domain/events/delegation-granted.event{{alias.ext}}';
|
|
58
|
+
import { DelegationRevokedPublisher } from '{{alias.context}}/application/integration/publishers/delegation-revoked.publisher{{alias.ext}}';
|
|
59
|
+
import { DelegationRevoked } from '{{alias.context}}/domain/events/delegation-revoked.event{{alias.ext}}';
|
|
60
|
+
import { ChangeMemberRolesPolicy } from '{{alias.context}}/application/authorization/change-member-roles.policy{{alias.ext}}';
|
|
61
|
+
import { GrantDelegationsPolicy } from '{{alias.context}}/application/authorization/grant-delegations.policy{{alias.ext}}';
|
|
62
|
+
import { InviteMembersPolicy } from '{{alias.context}}/application/authorization/invite-members.policy{{alias.ext}}';
|
|
63
|
+
import { ReadMembersPolicy } from '{{alias.context}}/application/authorization/read-members.policy{{alias.ext}}';
|
|
64
|
+
import { RemoveMembersPolicy } from '{{alias.context}}/application/authorization/remove-members.policy{{alias.ext}}';
|
|
65
|
+
import { RevokeDelegationsPolicy } from '{{alias.context}}/application/authorization/revoke-delegations.policy{{alias.ext}}';
|
|
66
|
+
import { RevokeInvitationsPolicy } from '{{alias.context}}/application/authorization/revoke-invitations.policy{{alias.ext}}';
|
|
67
|
+
import { FakeAccountRepository } from '{{alias.context}}/test/fakes/account.repository.fake{{alias.ext}}';
|
|
68
|
+
import { FakeDelegationRepository } from '{{alias.context}}/test/fakes/delegation.repository.fake{{alias.ext}}';
|
|
69
|
+
import { FakeIdentityProviderAdmin } from '{{alias.context}}/test/fakes/identity-provider-admin.fake{{alias.ext}}';
|
|
70
|
+
import { FakeInvitationRepository } from '{{alias.context}}/test/fakes/invitation.repository.fake{{alias.ext}}';
|
|
71
|
+
import { FakeInvitationTokens } from '{{alias.context}}/test/fakes/invitation-tokens.fake{{alias.ext}}';
|
|
72
|
+
import { FakeMemberRepository } from '{{alias.context}}/test/fakes/member.repository.fake{{alias.ext}}';
|
|
73
|
+
import { FakeOrganisationRepository } from '{{alias.context}}/test/fakes/organisation.repository.fake{{alias.ext}}';
|
|
74
|
+
import { FakeSearchMembersReader } from '{{alias.context}}/test/fakes/search-members-reader.fake{{alias.ext}}';
|
|
75
|
+
|
|
76
|
+
/** The role every signed-in person holds in these specs: the platform grants it the permissions of the context. */
|
|
77
|
+
const PERSON = 'person';
|
|
78
|
+
|
|
79
|
+
const authorizer = new RoleBasedAuthorizer({ roles: { [PERSON]: Object.values({{context.camel}}Permissions) } });
|
|
80
|
+
|
|
81
|
+
/** What each use case of the context requires, as `{{context.kebab}}.module.ts` lists it. */
|
|
82
|
+
const people = authorizationMiddleware({
|
|
83
|
+
authorizer,
|
|
84
|
+
map: AuthorizationMap.of(
|
|
85
|
+
requires(AcceptInvitationCommand, {{context.camel}}Permissions['invitation.accept'], {
|
|
86
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
87
|
+
}),
|
|
88
|
+
requires(ChangeMemberRoleCommand, {{context.camel}}Permissions['member.change-role'], {
|
|
89
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
90
|
+
}),
|
|
91
|
+
requires(DeactivateAccountCommand, {{context.camel}}Permissions['account.deactivate'], {
|
|
92
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
93
|
+
}),
|
|
94
|
+
requires(DeclineInvitationCommand, {{context.camel}}Permissions['invitation.decline'], {
|
|
95
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
96
|
+
}),
|
|
97
|
+
requires(GrantDelegationCommand, {{context.camel}}Permissions['delegation.grant'], {
|
|
98
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
99
|
+
}),
|
|
100
|
+
requires(InviteMemberCommand, {{context.camel}}Permissions['member.invite'], {
|
|
101
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
102
|
+
}),
|
|
103
|
+
requires(OpenOrganisationCommand, {{context.camel}}Permissions['organisation.open'], {
|
|
104
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
105
|
+
}),
|
|
106
|
+
requires(ProvisionAccountCommand, {{context.camel}}Permissions['account.provision'], {
|
|
107
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
108
|
+
}),
|
|
109
|
+
requires(RemoveMemberCommand, {{context.camel}}Permissions['member.remove'], {
|
|
110
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
111
|
+
}),
|
|
112
|
+
requires(RevokeDelegationCommand, {{context.camel}}Permissions['delegation.revoke'], {
|
|
113
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
114
|
+
}),
|
|
115
|
+
requires(RevokeInvitationCommand, {{context.camel}}Permissions['invitation.revoke'], {
|
|
116
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
117
|
+
}),
|
|
118
|
+
requires(SearchMembersQuery, {{context.camel}}Permissions['member.search'], {
|
|
119
|
+
resource: () => ({ type: 'context', id: '{{context.kebab}}' }),
|
|
120
|
+
}),
|
|
121
|
+
),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The context on fakes, wired as `{{context.kebab}}.module.ts` wires it, behind an authorizer that
|
|
126
|
+
* grants its permissions to every signed-in person: inside an organisation, its own policies
|
|
127
|
+
* decide. `as(id)` is that person, `stranger` an actor the platform grants nothing.
|
|
128
|
+
*/
|
|
129
|
+
export function arrangeIdentity() {
|
|
130
|
+
const ports = fakePorts();
|
|
131
|
+
const buses = createTestBuses({ eventBusFailures: 'as-thrown' });
|
|
132
|
+
const wired = { buses, ports, repositories: dispatchedBy(buses, ports), access: accessOn(buses) };
|
|
133
|
+
|
|
134
|
+
buses.commandBus.use(people);
|
|
135
|
+
buses.queryBus.use(people);
|
|
136
|
+
registerAccountsAndOrganisations(wired);
|
|
137
|
+
registerInvitations(wired);
|
|
138
|
+
registerMembersAndDelegations(wired);
|
|
139
|
+
publishTheFacts(buses);
|
|
140
|
+
|
|
141
|
+
const start = (): Promise<void> => listen(wired);
|
|
142
|
+
const as = (id: string): Actor => anActor().named(id).withRole(PERSON).build();
|
|
143
|
+
|
|
144
|
+
return { application: { ...buses, start }, ...ports, as, stranger: anActor().named('stranger').build() };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The same, started: its consumers listen, among them those that bring the identity provider in
|
|
149
|
+
* line with the facts the context publishes (`application/integration/handlers/`).
|
|
150
|
+
*/
|
|
151
|
+
export async function startedIdentity(): Promise<ReturnType<typeof arrangeIdentity>> {
|
|
152
|
+
const arranged = arrangeIdentity();
|
|
153
|
+
|
|
154
|
+
await arranged.application.start();
|
|
155
|
+
|
|
156
|
+
return arranged;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function fakePorts() {
|
|
160
|
+
return {
|
|
161
|
+
accounts: new FakeAccountRepository(),
|
|
162
|
+
organisations: new FakeOrganisationRepository(),
|
|
163
|
+
members: new FakeMemberRepository(),
|
|
164
|
+
invitations: new FakeInvitationRepository(),
|
|
165
|
+
delegations: new FakeDelegationRepository(),
|
|
166
|
+
identityProvider: new FakeIdentityProviderAdmin(),
|
|
167
|
+
tokens: new FakeInvitationTokens(),
|
|
168
|
+
reader: new FakeSearchMembersReader(),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** The repositories as the application hands them to the handlers: a save announces the events of the aggregate. */
|
|
173
|
+
function dispatchedBy(buses: TestBuses, ports: ReturnType<typeof fakePorts>) {
|
|
174
|
+
return {
|
|
175
|
+
accounts: buses.dispatching(ports.accounts),
|
|
176
|
+
organisations: buses.dispatching(ports.organisations),
|
|
177
|
+
members: buses.dispatching(ports.members),
|
|
178
|
+
invitations: buses.dispatching(ports.invitations),
|
|
179
|
+
delegations: buses.dispatching(ports.delegations),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** The policies of the context, as the platform lists them in `access-policies.ts`. */
|
|
184
|
+
function accessOn(buses: TestBuses): Access {
|
|
185
|
+
return new PolicyAccess({
|
|
186
|
+
authorizer,
|
|
187
|
+
clock: buses.clock,
|
|
188
|
+
policies: [
|
|
189
|
+
new ChangeMemberRolesPolicy(),
|
|
190
|
+
new GrantDelegationsPolicy(),
|
|
191
|
+
new InviteMembersPolicy(),
|
|
192
|
+
new ReadMembersPolicy(),
|
|
193
|
+
new RemoveMembersPolicy(),
|
|
194
|
+
new RevokeDelegationsPolicy(),
|
|
195
|
+
new RevokeInvitationsPolicy(),
|
|
196
|
+
],
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
interface Wired {
|
|
201
|
+
readonly buses: TestBuses;
|
|
202
|
+
readonly ports: ReturnType<typeof fakePorts>;
|
|
203
|
+
readonly repositories: ReturnType<typeof dispatchedBy>;
|
|
204
|
+
readonly access: Access;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function registerAccountsAndOrganisations({ buses, repositories }: Wired): void {
|
|
208
|
+
const { commandBus, ids, clock } = buses;
|
|
209
|
+
const { accounts, organisations, members, delegations } = repositories;
|
|
210
|
+
|
|
211
|
+
commandBus.register(ProvisionAccountCommand, new ProvisionAccountHandler(accounts, clock));
|
|
212
|
+
|
|
213
|
+
commandBus.register(
|
|
214
|
+
DeactivateAccountCommand,
|
|
215
|
+
new DeactivateAccountHandler(accounts, organisations, members, delegations, clock),
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
commandBus.register(
|
|
219
|
+
OpenOrganisationCommand,
|
|
220
|
+
new OpenOrganisationHandler(organisations, members, accounts, ids, clock),
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function registerInvitations({ buses, repositories, ports, access }: Wired): void {
|
|
225
|
+
const { commandBus, ids, clock } = buses;
|
|
226
|
+
const { accounts, members, invitations, delegations } = repositories;
|
|
227
|
+
|
|
228
|
+
commandBus.register(
|
|
229
|
+
InviteMemberCommand,
|
|
230
|
+
new InviteMemberHandler(invitations, members, delegations, ports.tokens, access, ids, clock),
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
commandBus.register(
|
|
234
|
+
AcceptInvitationCommand,
|
|
235
|
+
new AcceptInvitationHandler(invitations, members, accounts, ports.tokens, ids, clock),
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
commandBus.register(
|
|
239
|
+
DeclineInvitationCommand,
|
|
240
|
+
new DeclineInvitationHandler(invitations, accounts, ports.tokens, clock),
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
commandBus.register(
|
|
244
|
+
RevokeInvitationCommand,
|
|
245
|
+
new RevokeInvitationHandler(invitations, members, delegations, access, clock),
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function registerMembersAndDelegations({ buses, repositories, ports, access }: Wired): void {
|
|
250
|
+
const { commandBus, queryBus, ids, clock } = buses;
|
|
251
|
+
const { organisations, members, delegations } = repositories;
|
|
252
|
+
|
|
253
|
+
commandBus.register(
|
|
254
|
+
ChangeMemberRoleCommand,
|
|
255
|
+
new ChangeMemberRoleHandler(organisations, members, delegations, access, clock),
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
commandBus.register(RemoveMemberCommand, new RemoveMemberHandler(organisations, members, delegations, access, clock));
|
|
259
|
+
commandBus.register(GrantDelegationCommand, new GrantDelegationHandler(delegations, members, access, ids, clock));
|
|
260
|
+
commandBus.register(RevokeDelegationCommand, new RevokeDelegationHandler(delegations, members, access, clock));
|
|
261
|
+
queryBus.register(SearchMembersQuery, new SearchMembersHandler(ports.reader, members, delegations, access, clock));
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** The facts the context announces, published as the integration events of its published language. */
|
|
265
|
+
function publishTheFacts({ domainEvents, eventBus, ids }: TestBuses): void {
|
|
266
|
+
domainEvents.on(
|
|
267
|
+
AccountDeactivated.eventName,
|
|
268
|
+
announcedBy(AccountDeactivated, new AccountDeactivatedPublisher(eventBus, ids)),
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
domainEvents.on(
|
|
272
|
+
OrganisationOpened.eventName,
|
|
273
|
+
announcedBy(OrganisationOpened, new OrganisationOpenedPublisher(eventBus, ids)),
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
domainEvents.on(MemberJoined.eventName, announcedBy(MemberJoined, new MemberJoinedPublisher(eventBus, ids)));
|
|
277
|
+
|
|
278
|
+
domainEvents.on(
|
|
279
|
+
MemberRoleChanged.eventName,
|
|
280
|
+
announcedBy(MemberRoleChanged, new MemberRoleChangedPublisher(eventBus, ids)),
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
domainEvents.on(MemberRemoved.eventName, announcedBy(MemberRemoved, new MemberRemovedPublisher(eventBus, ids)));
|
|
284
|
+
|
|
285
|
+
domainEvents.on(
|
|
286
|
+
DelegationGranted.eventName,
|
|
287
|
+
announcedBy(DelegationGranted, new DelegationGrantedPublisher(eventBus, ids)),
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
domainEvents.on(
|
|
291
|
+
DelegationRevoked.eventName,
|
|
292
|
+
announcedBy(DelegationRevoked, new DelegationRevokedPublisher(eventBus, ids)),
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/** A handler of the dispatcher that hands the events of one class to their publisher. */
|
|
297
|
+
function announcedBy<Fact>(
|
|
298
|
+
fact: abstract new (...args: never[]) => Fact,
|
|
299
|
+
publisher: { handle(event: Fact): Promise<void> },
|
|
300
|
+
) {
|
|
301
|
+
return async (event: unknown): Promise<void> => {
|
|
302
|
+
if (event instanceof fact) {
|
|
303
|
+
await publisher.handle(event);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/** The consumers that bring the identity provider in line, each event handled once. */
|
|
309
|
+
function listen({ buses, repositories, ports }: Wired): Promise<void> {
|
|
310
|
+
const processed = new InMemoryProcessedEventStore();
|
|
311
|
+
|
|
312
|
+
const options = (consumer: string) => ({
|
|
313
|
+
consumer: `{{context.kebab}}.${consumer}`,
|
|
314
|
+
processed,
|
|
315
|
+
unitOfWork: buses.unitOfWork,
|
|
316
|
+
scope: buses.executionScope,
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
const disables = new AccountDeactivatedIntegrationHandler(ports.identityProvider);
|
|
320
|
+
const joins = new MemberJoinedIntegrationHandler(repositories.members, ports.identityProvider);
|
|
321
|
+
const removes = new MemberRemovedIntegrationHandler(repositories.members, ports.identityProvider);
|
|
322
|
+
const opens = new OrganisationOpenedIntegrationHandler(ports.identityProvider);
|
|
323
|
+
|
|
324
|
+
subscribeAll(buses.eventBus, [
|
|
325
|
+
on(accountDeactivatedV1, (event) => disables.handle(event), options('provider-disables-account')),
|
|
326
|
+
on(memberJoinedV1, (event) => joins.handle(event), options('provider-follows-joined-member')),
|
|
327
|
+
on(memberRemovedV1, (event) => removes.handle(event), options('provider-follows-removed-member')),
|
|
328
|
+
on(organisationOpenedV1, (event) => opens.handle(event), options('provider-opens-organisation')),
|
|
329
|
+
]);
|
|
330
|
+
|
|
331
|
+
return Promise.resolve();
|
|
332
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@@imports
|
|
2
|
+
import { ChangeMemberRolesPolicy } from '{{alias.context}}/application/authorization/change-member-roles.policy{{alias.ext}}';
|
|
3
|
+
import { GrantDelegationsPolicy } from '{{alias.context}}/application/authorization/grant-delegations.policy{{alias.ext}}';
|
|
4
|
+
import { InviteMembersPolicy } from '{{alias.context}}/application/authorization/invite-members.policy{{alias.ext}}';
|
|
5
|
+
import { ReadMembersPolicy } from '{{alias.context}}/application/authorization/read-members.policy{{alias.ext}}';
|
|
6
|
+
import { RemoveMembersPolicy } from '{{alias.context}}/application/authorization/remove-members.policy{{alias.ext}}';
|
|
7
|
+
import { RevokeDelegationsPolicy } from '{{alias.context}}/application/authorization/revoke-delegations.policy{{alias.ext}}';
|
|
8
|
+
import { RevokeInvitationsPolicy } from '{{alias.context}}/application/authorization/revoke-invitations.policy{{alias.ext}}';
|
|
9
|
+
@@policies
|
|
10
|
+
new ChangeMemberRolesPolicy(),
|
|
11
|
+
new GrantDelegationsPolicy(),
|
|
12
|
+
new InviteMembersPolicy(),
|
|
13
|
+
new ReadMembersPolicy(),
|
|
14
|
+
new RemoveMembersPolicy(),
|
|
15
|
+
new RevokeDelegationsPolicy(),
|
|
16
|
+
new RevokeInvitationsPolicy(),
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/// Whether an account may still act: a deactivated account keeps its history and signs in no more.
|
|
2
|
+
enum {{context.pascal}}AccountStatus {
|
|
3
|
+
active
|
|
4
|
+
deactivated
|
|
5
|
+
|
|
6
|
+
@@map("account_status")
|
|
7
|
+
@@schema("{{context.schema}}")
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/// The role of a member in an organisation: what the member may do there follows from it.
|
|
11
|
+
enum {{context.pascal}}MemberRole {
|
|
12
|
+
owner
|
|
13
|
+
admin
|
|
14
|
+
member
|
|
15
|
+
|
|
16
|
+
@@map("member_role")
|
|
17
|
+
@@schema("{{context.schema}}")
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/// Where an invitation stands: pending until its person answers, or the organisation takes it back.
|
|
21
|
+
enum {{context.pascal}}InvitationStatus {
|
|
22
|
+
pending
|
|
23
|
+
accepted
|
|
24
|
+
declined
|
|
25
|
+
revoked
|
|
26
|
+
|
|
27
|
+
@@map("invitation_status")
|
|
28
|
+
@@schema("{{context.schema}}")
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// Keyed by the subject the identity provider gives the person. No password is stored.
|
|
32
|
+
model {{context.pascal}}Account {
|
|
33
|
+
id String @id
|
|
34
|
+
email String
|
|
35
|
+
displayName String @map("display_name")
|
|
36
|
+
status {{context.pascal}}AccountStatus
|
|
37
|
+
provisionedAt DateTime @map("provisioned_at") @db.Timestamptz(3)
|
|
38
|
+
deactivatedAt DateTime? @map("deactivated_at") @db.Timestamptz(3)
|
|
39
|
+
version Int
|
|
40
|
+
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
41
|
+
createdBy String @map("created_by")
|
|
42
|
+
updatedAt DateTime @map("updated_at") @db.Timestamptz(3)
|
|
43
|
+
updatedBy String @map("updated_by")
|
|
44
|
+
|
|
45
|
+
@@map("accounts")
|
|
46
|
+
@@schema("{{context.schema}}")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// Keyed by the slug, which is also the tenant id when the project has tenants.
|
|
50
|
+
model {{context.pascal}}Organisation {
|
|
51
|
+
id String @id
|
|
52
|
+
name String
|
|
53
|
+
openedBy String @map("opened_by")
|
|
54
|
+
openedAt DateTime @map("opened_at") @db.Timestamptz(3)
|
|
55
|
+
version Int
|
|
56
|
+
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
57
|
+
createdBy String @map("created_by")
|
|
58
|
+
updatedAt DateTime @map("updated_at") @db.Timestamptz(3)
|
|
59
|
+
updatedBy String @map("updated_by")
|
|
60
|
+
|
|
61
|
+
@@map("organisations")
|
|
62
|
+
@@schema("{{context.schema}}")
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// One current membership per account and organisation: the partial unique index is the guard.
|
|
66
|
+
model {{context.pascal}}Member {
|
|
67
|
+
id String @id
|
|
68
|
+
organisationId String @map("organisation_id")
|
|
69
|
+
accountId String @map("account_id")
|
|
70
|
+
role {{context.pascal}}MemberRole
|
|
71
|
+
joinedAt DateTime @map("joined_at") @db.Timestamptz(3)
|
|
72
|
+
removedAt DateTime? @map("removed_at") @db.Timestamptz(3)
|
|
73
|
+
version Int
|
|
74
|
+
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
75
|
+
createdBy String @map("created_by")
|
|
76
|
+
updatedAt DateTime @map("updated_at") @db.Timestamptz(3)
|
|
77
|
+
updatedBy String @map("updated_by")
|
|
78
|
+
|
|
79
|
+
// Preview feature `partialIndexes`: after an upgrade of Prisma, check generated/schema.sql keeps the WHERE.
|
|
80
|
+
@@unique([organisationId, accountId], map: "members_current_idx", where: { removedAt: null })
|
|
81
|
+
@@index([accountId], map: "members_account_idx")
|
|
82
|
+
@@map("members")
|
|
83
|
+
@@schema("{{context.schema}}")
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
model {{context.pascal}}Invitation {
|
|
87
|
+
id String @id
|
|
88
|
+
organisationId String @map("organisation_id")
|
|
89
|
+
email String
|
|
90
|
+
role {{context.pascal}}MemberRole
|
|
91
|
+
tokenHash String @unique @map("token_hash")
|
|
92
|
+
invitedBy String @map("invited_by")
|
|
93
|
+
issuedAt DateTime @map("issued_at") @db.Timestamptz(3)
|
|
94
|
+
expiresAt DateTime @map("expires_at") @db.Timestamptz(3)
|
|
95
|
+
status {{context.pascal}}InvitationStatus
|
|
96
|
+
answeredAt DateTime? @map("answered_at") @db.Timestamptz(3)
|
|
97
|
+
version Int
|
|
98
|
+
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
99
|
+
createdBy String @map("created_by")
|
|
100
|
+
updatedAt DateTime @map("updated_at") @db.Timestamptz(3)
|
|
101
|
+
updatedBy String @map("updated_by")
|
|
102
|
+
|
|
103
|
+
@@index([organisationId, status], map: "invitations_organisation_idx")
|
|
104
|
+
@@map("invitations")
|
|
105
|
+
@@schema("{{context.schema}}")
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
model {{context.pascal}}Delegation {
|
|
109
|
+
id String @id
|
|
110
|
+
organisationId String @map("organisation_id")
|
|
111
|
+
delegatorId String @map("delegator_id")
|
|
112
|
+
delegateId String @map("delegate_id")
|
|
113
|
+
/// The rights lent, separated by commas: a right is a word of `MemberRight`, which holds none.
|
|
114
|
+
rights String
|
|
115
|
+
startsAt DateTime @map("starts_at") @db.Timestamptz(3)
|
|
116
|
+
endsAt DateTime @map("ends_at") @db.Timestamptz(3)
|
|
117
|
+
endedAt DateTime? @map("ended_at") @db.Timestamptz(3)
|
|
118
|
+
version Int
|
|
119
|
+
createdAt DateTime @map("created_at") @db.Timestamptz(3)
|
|
120
|
+
createdBy String @map("created_by")
|
|
121
|
+
updatedAt DateTime @map("updated_at") @db.Timestamptz(3)
|
|
122
|
+
updatedBy String @map("updated_by")
|
|
123
|
+
|
|
124
|
+
@@index([organisationId, delegateId], map: "delegations_delegate_idx")
|
|
125
|
+
@@index([organisationId, delegatorId], map: "delegations_delegator_idx")
|
|
126
|
+
@@map("delegations")
|
|
127
|
+
@@schema("{{context.schema}}")
|
|
128
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
@@imports
|
|
2
2
|
import { {{name.pascal}}TimeoutBackgroundJob } from '{{alias.context}}/application/background/{{name.kebab}}-timeout.background-job{{alias.ext}}';
|
|
3
|
-
@@
|
|
3
|
+
@@jobs
|
|
4
4
|
platform.backgroundJobs.register({{name.pascal}}TimeoutBackgroundJob, [platform.processes]);
|