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
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import type { Access } from '@ddd-ts-kit/auth';
|
|
2
2
|
import type { Clock } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { QueryHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#unless style.declared}}
|
|
7
|
+
import type { QueryHandler } from '@ddd-ts-kit/kernel';
|
|
8
|
+
{{/unless}}
|
|
4
9
|
import type { DelegationRepository } from '{{alias.context}}/domain/repositories/delegation.repository{{alias.ext}}';
|
|
5
10
|
import type { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
6
11
|
import { RoleRightsService } from '{{alias.context}}/domain/services/role-rights.service{{alias.ext}}';
|
|
7
12
|
import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
|
|
8
13
|
import type { SearchMembersReader } from '{{alias.context}}/application/ports/search-members-reader.port{{alias.ext}}';
|
|
14
|
+
{{#if style.declared}}
|
|
9
15
|
import { SearchMembersQuery } from '{{alias.context}}/application/queries/search-members/search-members.query{{alias.ext}}';
|
|
16
|
+
{{/if}}
|
|
17
|
+
{{#unless style.declared}}
|
|
18
|
+
import type { SearchMembersQuery } from '{{alias.context}}/application/queries/search-members/search-members.query{{alias.ext}}';
|
|
19
|
+
{{/unless}}
|
|
10
20
|
import type { SearchMembersResult } from '{{alias.context}}/application/queries/search-members/search-members.result{{alias.ext}}';
|
|
11
21
|
|
|
22
|
+
{{#if style.declared}}
|
|
12
23
|
@QueryHandler(SearchMembersQuery)
|
|
24
|
+
{{/if}}
|
|
13
25
|
export class SearchMembersHandler implements QueryHandler<SearchMembersQuery> {
|
|
14
26
|
constructor(
|
|
15
27
|
private readonly reader: SearchMembersReader,
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { AuthorizedQuery, type Actor, type PageRequest } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { Requires } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
4
8
|
import type {
|
|
5
9
|
SearchMembersResult,
|
|
6
10
|
SearchMembersSort,
|
|
7
11
|
} from '{{alias.context}}/application/queries/search-members/search-members.result{{alias.ext}}';
|
|
8
12
|
|
|
9
13
|
/** One page of the current members of an organisation, for its members. */
|
|
14
|
+
{{#if style.declared}}
|
|
10
15
|
@Requires({{context.camel}}Permissions['member.search'], { resource: () => ({ type: 'context', id: '{{context.kebab}}' }) })
|
|
16
|
+
{{/if}}
|
|
11
17
|
export class SearchMembersQuery extends AuthorizedQuery<SearchMembersResult> {
|
|
12
18
|
constructor(
|
|
13
19
|
actor: Actor,
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { createHash, randomBytes } from 'node:crypto';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { Adapter } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { InvitationTokens } from '{{alias.context}}/application/ports/invitation-tokens.port{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless style.declared}}
|
|
9
|
+
import type { InvitationTokens } from '{{alias.context}}/application/ports/invitation-tokens.port{{alias.ext}}';
|
|
10
|
+
{{/unless}}
|
|
4
11
|
|
|
5
12
|
/** 256 bits: a token is never guessed, and never stored. */
|
|
6
13
|
const TOKEN_BYTES = 32;
|
|
7
14
|
|
|
8
15
|
/** Tokens drawn from the random source of the platform, kept as their SHA-256 digest. */
|
|
16
|
+
{{#if style.declared}}
|
|
9
17
|
@Adapter(InvitationTokens, { kind: 'external' })
|
|
18
|
+
{{/if}}
|
|
10
19
|
export class CryptoInvitationTokens implements InvitationTokens {
|
|
11
20
|
issue(): { token: string; digest: string } {
|
|
12
21
|
const token = randomBytes(TOKEN_BYTES).toString('base64url');
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
{{#if style.declared}}
|
|
1
2
|
import { Adapter } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
{{/if}}
|
|
4
|
+
{{#if style.declared}}
|
|
2
5
|
import { IdentityProviderConnection } from '{{alias.context}}/application/ports/identity-provider-connection.port{{alias.ext}}';
|
|
6
|
+
{{/if}}
|
|
7
|
+
{{#unless style.declared}}
|
|
8
|
+
import type { IdentityProviderConnection } from '{{alias.context}}/application/ports/identity-provider-connection.port{{alias.ext}}';
|
|
9
|
+
{{/unless}}
|
|
3
10
|
|
|
4
11
|
/** The variables read, and what each one holds. */
|
|
5
12
|
const VARIABLES = {
|
|
@@ -14,7 +21,9 @@ const VARIABLES = {
|
|
|
14
21
|
* is made: an application that never calls it starts without it. A missing variable fails the
|
|
15
22
|
* call that needed it, with its name; its value is never written.
|
|
16
23
|
*/
|
|
24
|
+
{{#if style.declared}}
|
|
17
25
|
@Adapter(IdentityProviderConnection, { kind: 'external' })
|
|
26
|
+
{{/if}}
|
|
18
27
|
export class EnvironmentIdentityProviderConnection implements IdentityProviderConnection {
|
|
19
28
|
async settings(): Promise<{ baseUrl: string; realm: string; clientId: string; clientSecret: string }> {
|
|
20
29
|
return {
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
{{#if style.declared}}
|
|
1
2
|
import { Adapter } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
{{/if}}
|
|
4
|
+
{{#if style.declared}}
|
|
2
5
|
import { IdentityProviderAdmin } from '{{alias.context}}/application/ports/identity-provider-admin.port{{alias.ext}}';
|
|
6
|
+
{{/if}}
|
|
7
|
+
{{#unless style.declared}}
|
|
8
|
+
import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/identity-provider-admin.port{{alias.ext}}';
|
|
9
|
+
{{/unless}}
|
|
3
10
|
import type { IdentityProviderConnection } from '{{alias.context}}/application/ports/identity-provider-connection.port{{alias.ext}}';
|
|
4
11
|
|
|
5
12
|
const CONFLICT = 409;
|
|
@@ -36,7 +43,9 @@ interface SearchedPage {
|
|
|
36
43
|
* that answers as Keycloak does, not against Keycloak itself: run it once against your realm
|
|
37
44
|
* before relying on it (docs/guides/bootstrap-with-well-designed-contexts.md says how).
|
|
38
45
|
*/
|
|
46
|
+
{{#if style.declared}}
|
|
39
47
|
@Adapter(IdentityProviderAdmin, { kind: 'external' })
|
|
48
|
+
{{/if}}
|
|
40
49
|
export class KeycloakIdentityProviderAdmin implements IdentityProviderAdmin {
|
|
41
50
|
constructor(private readonly connection: IdentityProviderConnection) {}
|
|
42
51
|
|
package/templates/presets/identity/context/infrastructure/persistence/account.mapper.prisma.ts.tpl
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { AuditStamp } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Account } from '{{alias.context}}/domain/aggregates/account.aggregate{{alias.ext}}';
|
|
3
|
+
import { DisplayName } from '{{alias.context}}/domain/value-objects/display-name.vo{{alias.ext}}';
|
|
4
|
+
import { EmailAddress } from '{{alias.context}}/domain/value-objects/email-address.vo{{alias.ext}}';
|
|
5
|
+
import type { {{context.pascal}}Account as AccountRow } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
6
|
+
|
|
7
|
+
export type AccountColumns = Omit<AccountRow, 'version' | keyof AuditStamp>;
|
|
8
|
+
|
|
9
|
+
export const AccountMapper = {
|
|
10
|
+
toDomain(row: AccountRow): Account {
|
|
11
|
+
const loaded = Account.rehydrate(row.id, {
|
|
12
|
+
email: EmailAddress.create(row.email),
|
|
13
|
+
displayName: DisplayName.create(row.displayName),
|
|
14
|
+
status: row.status,
|
|
15
|
+
provisionedAt: row.provisionedAt,
|
|
16
|
+
deactivatedAt: row.deactivatedAt ?? undefined,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
loaded.version = row.version;
|
|
20
|
+
|
|
21
|
+
return loaded;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
toRow(saved: Account): AccountColumns {
|
|
25
|
+
const state = saved.toState();
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
id: saved.id,
|
|
29
|
+
email: state.email.value,
|
|
30
|
+
displayName: state.displayName.value,
|
|
31
|
+
status: state.status,
|
|
32
|
+
provisionedAt: state.provisionedAt,
|
|
33
|
+
deactivatedAt: state.deactivatedAt ?? null,
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { personalFields, type PersonalFieldsOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import type { PrismaPersonalTable } from '@ddd-ts-kit/prisma';
|
|
3
|
+
|
|
4
|
+
/** The table as the erasure reaches it, by the names `@@schema` and `@@map` give it: its statements are written on the table, not through the model. */
|
|
5
|
+
const TABLE: PrismaPersonalTable = { schema: '{{context.schema}}', table: 'accounts' };
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What an account keeps of the person it is, named by the subject the identity provider gives
|
|
9
|
+
* them: the address and the name read `[erased]` once that person is erased, and the account stays,
|
|
10
|
+
* deactivated or not, for the members and the delegations that name it.
|
|
11
|
+
*/
|
|
12
|
+
// The columns are named as the database spells them (`@map`), since the erasure writes SQL on the table.
|
|
13
|
+
const declaration: PersonalFieldsOptions<Record<string, unknown>> = {
|
|
14
|
+
subject: 'id',
|
|
15
|
+
fields: ['email', 'display_name'],
|
|
16
|
+
erasure: 'pseudonymise',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const AccountPersonalFields = personalFields(TABLE, declaration);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AuditStamp } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Delegation } from '{{alias.context}}/domain/aggregates/delegation.aggregate{{alias.ext}}';
|
|
3
|
+
import { DelegationPeriod } from '{{alias.context}}/domain/value-objects/delegation-period.vo{{alias.ext}}';
|
|
4
|
+
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
|
+
import type { {{context.pascal}}Delegation as DelegationRow } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
6
|
+
|
|
7
|
+
const SEPARATOR = ',';
|
|
8
|
+
|
|
9
|
+
export type DelegationColumns = Omit<DelegationRow, 'version' | keyof AuditStamp>;
|
|
10
|
+
|
|
11
|
+
export const DelegationMapper = {
|
|
12
|
+
toDomain(row: DelegationRow): Delegation {
|
|
13
|
+
const loaded = Delegation.rehydrate(row.id, {
|
|
14
|
+
organisationId: row.organisationId,
|
|
15
|
+
delegatorId: row.delegatorId,
|
|
16
|
+
delegateId: row.delegateId,
|
|
17
|
+
rights: rightsOf(row.rights),
|
|
18
|
+
period: DelegationPeriod.create(row.startsAt, row.endsAt),
|
|
19
|
+
endedAt: row.endedAt ?? undefined,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
loaded.version = row.version;
|
|
23
|
+
|
|
24
|
+
return loaded;
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
toRow(saved: Delegation): DelegationColumns {
|
|
28
|
+
const state = saved.toState();
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
id: saved.id,
|
|
32
|
+
organisationId: state.organisationId,
|
|
33
|
+
delegatorId: state.delegatorId,
|
|
34
|
+
delegateId: state.delegateId,
|
|
35
|
+
rights: state.rights.join(SEPARATOR),
|
|
36
|
+
startsAt: state.period.startsAt,
|
|
37
|
+
endsAt: state.period.endsAt,
|
|
38
|
+
endedAt: state.endedAt ?? null,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** The rights of a stored delegation, those the vocabulary no longer names left out. */
|
|
44
|
+
function rightsOf(stored: string): MemberRight[] {
|
|
45
|
+
const lent = stored.split(SEPARATOR);
|
|
46
|
+
|
|
47
|
+
return Object.values(MemberRight).filter((right) => lent.includes(right));
|
|
48
|
+
}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { and, eq } from 'drizzle-orm';
|
|
2
2
|
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
|
+
{{#if style.declared}}
|
|
4
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
6
|
+
{{/if}}
|
|
5
7
|
import type { Account } from '{{alias.context}}/domain/aggregates/account.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { AccountRepository } from '{{alias.context}}/domain/repositories/account.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { AccountRepository } from '{{alias.context}}/domain/repositories/account.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import type { Database } from '{{alias.platform}}/database/database{{alias.ext}}';
|
|
8
15
|
import { accounts } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
9
16
|
import { AccountMapper, type AccountColumns } from '{{alias.context}}/infrastructure/persistence/account.mapper{{alias.ext}}';
|
|
10
17
|
|
|
11
18
|
type VersionedAccount = AccountColumns & { readonly version: number };
|
|
12
19
|
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(AccountRepository)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class DrizzleAccountRepository implements AccountRepository {
|
|
15
24
|
constructor(
|
|
16
25
|
private readonly database: Database,
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { and, eq, isNull, or } from 'drizzle-orm';
|
|
2
2
|
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
|
+
{{#if style.declared}}
|
|
4
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
6
|
+
{{/if}}
|
|
5
7
|
import type { Delegation } from '{{alias.context}}/domain/aggregates/delegation.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { DelegationRepository } from '{{alias.context}}/domain/repositories/delegation.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { DelegationRepository } from '{{alias.context}}/domain/repositories/delegation.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import type { Database } from '{{alias.platform}}/database/database{{alias.ext}}';
|
|
8
15
|
import { delegations } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
9
16
|
import { DelegationMapper, type DelegationColumns } from '{{alias.context}}/infrastructure/persistence/delegation.mapper{{alias.ext}}';
|
|
10
17
|
|
|
11
18
|
type VersionedDelegation = DelegationColumns & { readonly version: number };
|
|
12
19
|
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(DelegationRepository)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class DrizzleDelegationRepository implements DelegationRepository {
|
|
15
24
|
constructor(
|
|
16
25
|
private readonly database: Database,
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { and, eq } from 'drizzle-orm';
|
|
2
2
|
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
|
+
{{#if style.declared}}
|
|
4
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
6
|
+
{{/if}}
|
|
5
7
|
import type { Invitation } from '{{alias.context}}/domain/aggregates/invitation.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { InvitationRepository } from '{{alias.context}}/domain/repositories/invitation.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { InvitationRepository } from '{{alias.context}}/domain/repositories/invitation.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import type { Database } from '{{alias.platform}}/database/database{{alias.ext}}';
|
|
8
15
|
import { invitations } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
9
16
|
import { InvitationMapper, type InvitationColumns } from '{{alias.context}}/infrastructure/persistence/invitation.mapper{{alias.ext}}';
|
|
10
17
|
|
|
11
18
|
type VersionedInvitation = InvitationColumns & { readonly version: number };
|
|
12
19
|
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(InvitationRepository)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class DrizzleInvitationRepository implements InvitationRepository {
|
|
15
24
|
constructor(
|
|
16
25
|
private readonly database: Database,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { and, count, eq, isNull } from 'drizzle-orm';
|
|
2
2
|
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
|
+
{{#if style.declared}}
|
|
4
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
6
|
+
{{/if}}
|
|
5
7
|
import type { Member } from '{{alias.context}}/domain/aggregates/member.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
8
15
|
import type { Database } from '{{alias.platform}}/database/database{{alias.ext}}';
|
|
9
16
|
import { members } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
@@ -11,7 +18,9 @@ import { MemberMapper, type MemberColumns } from '{{alias.context}}/infrastructu
|
|
|
11
18
|
|
|
12
19
|
type VersionedMember = MemberColumns & { readonly version: number };
|
|
13
20
|
|
|
21
|
+
{{#if style.declared}}
|
|
14
22
|
@Repository(MemberRepository)
|
|
23
|
+
{{/if}}
|
|
15
24
|
export class DrizzleMemberRepository implements MemberRepository {
|
|
16
25
|
constructor(
|
|
17
26
|
private readonly database: Database,
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { and, eq } from 'drizzle-orm';
|
|
2
2
|
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
|
+
{{#if style.declared}}
|
|
4
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
6
|
+
{{/if}}
|
|
5
7
|
import type { Organisation } from '{{alias.context}}/domain/aggregates/organisation.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { OrganisationRepository } from '{{alias.context}}/domain/repositories/organisation.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { OrganisationRepository } from '{{alias.context}}/domain/repositories/organisation.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import type { Database } from '{{alias.platform}}/database/database{{alias.ext}}';
|
|
8
15
|
import { organisations } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
9
16
|
import { OrganisationMapper, type OrganisationColumns } from '{{alias.context}}/infrastructure/persistence/organisation.mapper{{alias.ext}}';
|
|
10
17
|
|
|
11
18
|
type VersionedOrganisation = OrganisationColumns & { readonly version: number };
|
|
12
19
|
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(OrganisationRepository)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class DrizzleOrganisationRepository implements OrganisationRepository {
|
|
15
24
|
constructor(
|
|
16
25
|
private readonly database: Database,
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { and, asc, count, desc, eq, isNull } from 'drizzle-orm';
|
|
2
2
|
import { InvalidPageRequestError, pageOf, type PageRequest } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#if style.declared}}
|
|
4
7
|
import { SearchMembersReader } from '{{alias.context}}/application/ports/search-members-reader.port{{alias.ext}}';
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#unless style.declared}}
|
|
10
|
+
import type { SearchMembersReader } from '{{alias.context}}/application/ports/search-members-reader.port{{alias.ext}}';
|
|
11
|
+
{{/unless}}
|
|
5
12
|
import type {
|
|
6
13
|
SearchMembersResult,
|
|
7
14
|
SearchMembersSort,
|
|
@@ -10,7 +17,9 @@ import type { Database } from '{{alias.platform}}/database/database{{alias.ext}}
|
|
|
10
17
|
import { accounts, members } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
11
18
|
|
|
12
19
|
/** The current members of an organisation joined to the profile of their account: one statement, the page applied by the database. */
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(SearchMembersReader)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class DrizzleSearchMembersReader implements SearchMembersReader {
|
|
15
24
|
constructor(private readonly database: Database) {}
|
|
16
25
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AuditStamp } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Invitation } from '{{alias.context}}/domain/aggregates/invitation.aggregate{{alias.ext}}';
|
|
3
|
+
import { EmailAddress } from '{{alias.context}}/domain/value-objects/email-address.vo{{alias.ext}}';
|
|
4
|
+
import type { {{context.pascal}}Invitation as InvitationRow } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
5
|
+
|
|
6
|
+
export type InvitationColumns = Omit<InvitationRow, 'version' | keyof AuditStamp>;
|
|
7
|
+
|
|
8
|
+
export const InvitationMapper = {
|
|
9
|
+
toDomain(row: InvitationRow): Invitation {
|
|
10
|
+
const loaded = Invitation.rehydrate(row.id, {
|
|
11
|
+
organisationId: row.organisationId,
|
|
12
|
+
email: EmailAddress.create(row.email),
|
|
13
|
+
role: row.role,
|
|
14
|
+
tokenHash: row.tokenHash,
|
|
15
|
+
invitedBy: row.invitedBy,
|
|
16
|
+
issuedAt: row.issuedAt,
|
|
17
|
+
expiresAt: row.expiresAt,
|
|
18
|
+
status: row.status,
|
|
19
|
+
answeredAt: row.answeredAt ?? undefined,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
loaded.version = row.version;
|
|
23
|
+
|
|
24
|
+
return loaded;
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
toRow(saved: Invitation): InvitationColumns {
|
|
28
|
+
const state = saved.toState();
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
id: saved.id,
|
|
32
|
+
organisationId: state.organisationId,
|
|
33
|
+
email: state.email.value,
|
|
34
|
+
role: state.role,
|
|
35
|
+
tokenHash: state.tokenHash,
|
|
36
|
+
invitedBy: state.invitedBy,
|
|
37
|
+
issuedAt: state.issuedAt,
|
|
38
|
+
expiresAt: state.expiresAt,
|
|
39
|
+
status: state.status,
|
|
40
|
+
answeredAt: state.answeredAt ?? null,
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { personalFields, type PersonalFieldsOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import type { PrismaPersonalTable } from '@ddd-ts-kit/prisma';
|
|
3
|
+
|
|
4
|
+
/** The table as the erasure reaches it, by the names `@@schema` and `@@map` give it: its statements are written on the table, not through the model. */
|
|
5
|
+
const TABLE: PrismaPersonalTable = { schema: '{{context.schema}}', table: 'invitations' };
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What an invitation keeps of the person invited, who has no account yet and is named by the
|
|
9
|
+
* invitation alone: the address it was sent to. The row leaves thirty days after the invitation
|
|
10
|
+
* expired, answered or not, by the nightly purge of the platform.
|
|
11
|
+
*/
|
|
12
|
+
// The columns are named as the database spells them (`@map`), since the erasure writes SQL on the table.
|
|
13
|
+
const declaration: PersonalFieldsOptions<Record<string, unknown>> = {
|
|
14
|
+
subject: 'id',
|
|
15
|
+
fields: ['email'],
|
|
16
|
+
erasure: 'row',
|
|
17
|
+
retention: { after: 'expires_at', days: 30 },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const InvitationPersonalFields = personalFields(TABLE, declaration);
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import type { Knex } from 'knex';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
4
6
|
import { type KnexContext, auditRow, insertIgnoringConflict, optimisticUpdate } from '@ddd-ts-kit/knex';
|
|
5
7
|
import type { Account } from '{{alias.context}}/domain/aggregates/account.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { AccountRepository } from '{{alias.context}}/domain/repositories/account.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { AccountRepository } from '{{alias.context}}/domain/repositories/account.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import { {{context.constant}}_SCHEMA } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
8
15
|
import { AccountMapper } from '{{alias.context}}/infrastructure/persistence/account.mapper{{alias.ext}}';
|
|
9
16
|
import type { AccountColumns, AccountRow } from '{{alias.context}}/infrastructure/persistence/account-row.schema{{alias.ext}}';
|
|
10
17
|
|
|
11
18
|
type VersionedAccount = AccountColumns & { readonly version: number };
|
|
12
19
|
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(AccountRepository)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class KnexAccountRepository implements AccountRepository {
|
|
15
24
|
constructor(
|
|
16
25
|
private readonly database: KnexContext,
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import type { Knex } from 'knex';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
4
6
|
import { type KnexContext, auditRow, insertIgnoringConflict, optimisticUpdate } from '@ddd-ts-kit/knex';
|
|
5
7
|
import type { Delegation } from '{{alias.context}}/domain/aggregates/delegation.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { DelegationRepository } from '{{alias.context}}/domain/repositories/delegation.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { DelegationRepository } from '{{alias.context}}/domain/repositories/delegation.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import { {{context.constant}}_SCHEMA } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
8
15
|
import { DelegationMapper } from '{{alias.context}}/infrastructure/persistence/delegation.mapper{{alias.ext}}';
|
|
9
16
|
import type { DelegationColumns, DelegationRow } from '{{alias.context}}/infrastructure/persistence/delegation-row.schema{{alias.ext}}';
|
|
10
17
|
|
|
11
18
|
type VersionedDelegation = DelegationColumns & { readonly version: number };
|
|
12
19
|
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(DelegationRepository)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class KnexDelegationRepository implements DelegationRepository {
|
|
15
24
|
constructor(
|
|
16
25
|
private readonly database: KnexContext,
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import type { Knex } from 'knex';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
4
6
|
import { type KnexContext, auditRow, insertIgnoringConflict, optimisticUpdate } from '@ddd-ts-kit/knex';
|
|
5
7
|
import type { Invitation } from '{{alias.context}}/domain/aggregates/invitation.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { InvitationRepository } from '{{alias.context}}/domain/repositories/invitation.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { InvitationRepository } from '{{alias.context}}/domain/repositories/invitation.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import { {{context.constant}}_SCHEMA } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
8
15
|
import { InvitationMapper } from '{{alias.context}}/infrastructure/persistence/invitation.mapper{{alias.ext}}';
|
|
9
16
|
import type { InvitationColumns, InvitationRow } from '{{alias.context}}/infrastructure/persistence/invitation-row.schema{{alias.ext}}';
|
|
10
17
|
|
|
11
18
|
type VersionedInvitation = InvitationColumns & { readonly version: number };
|
|
12
19
|
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(InvitationRepository)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class KnexInvitationRepository implements InvitationRepository {
|
|
15
24
|
constructor(
|
|
16
25
|
private readonly database: KnexContext,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { Knex } from 'knex';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
4
6
|
import { type KnexContext, auditRow, insertIgnoringConflict, optimisticUpdate } from '@ddd-ts-kit/knex';
|
|
5
7
|
import type { Member } from '{{alias.context}}/domain/aggregates/member.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
8
15
|
import { {{context.constant}}_SCHEMA } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
9
16
|
import { MemberMapper } from '{{alias.context}}/infrastructure/persistence/member.mapper{{alias.ext}}';
|
|
@@ -11,7 +18,9 @@ import type { MemberColumns, MemberRow } from '{{alias.context}}/infrastructure/
|
|
|
11
18
|
|
|
12
19
|
type VersionedMember = MemberColumns & { readonly version: number };
|
|
13
20
|
|
|
21
|
+
{{#if style.declared}}
|
|
14
22
|
@Repository(MemberRepository)
|
|
23
|
+
{{/if}}
|
|
15
24
|
export class KnexMemberRepository implements MemberRepository {
|
|
16
25
|
constructor(
|
|
17
26
|
private readonly database: KnexContext,
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import type { Knex } from 'knex';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
4
6
|
import { type KnexContext, auditRow, insertIgnoringConflict, optimisticUpdate } from '@ddd-ts-kit/knex';
|
|
5
7
|
import type { Organisation } from '{{alias.context}}/domain/aggregates/organisation.aggregate{{alias.ext}}';
|
|
8
|
+
{{#if style.declared}}
|
|
6
9
|
import { OrganisationRepository } from '{{alias.context}}/domain/repositories/organisation.repository{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { OrganisationRepository } from '{{alias.context}}/domain/repositories/organisation.repository{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
7
14
|
import { {{context.constant}}_SCHEMA } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
8
15
|
import { OrganisationMapper } from '{{alias.context}}/infrastructure/persistence/organisation.mapper{{alias.ext}}';
|
|
9
16
|
import type { OrganisationColumns, OrganisationRow } from '{{alias.context}}/infrastructure/persistence/organisation-row.schema{{alias.ext}}';
|
|
10
17
|
|
|
11
18
|
type VersionedOrganisation = OrganisationColumns & { readonly version: number };
|
|
12
19
|
|
|
20
|
+
{{#if style.declared}}
|
|
13
21
|
@Repository(OrganisationRepository)
|
|
22
|
+
{{/if}}
|
|
14
23
|
export class KnexOrganisationRepository implements OrganisationRepository {
|
|
15
24
|
constructor(
|
|
16
25
|
private readonly database: KnexContext,
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import type { Knex } from 'knex';
|
|
2
2
|
import { InvalidPageRequestError, pageOf, type PageRequest } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
4
6
|
import type { KnexContext } from '@ddd-ts-kit/knex';
|
|
7
|
+
{{#if style.declared}}
|
|
5
8
|
import { SearchMembersReader } from '{{alias.context}}/application/ports/search-members-reader.port{{alias.ext}}';
|
|
9
|
+
{{/if}}
|
|
10
|
+
{{#unless style.declared}}
|
|
11
|
+
import type { SearchMembersReader } from '{{alias.context}}/application/ports/search-members-reader.port{{alias.ext}}';
|
|
12
|
+
{{/unless}}
|
|
6
13
|
import type {
|
|
7
14
|
SearchMembersItem,
|
|
8
15
|
SearchMembersResult,
|
|
@@ -26,7 +33,9 @@ const COLUMNS = [
|
|
|
26
33
|
];
|
|
27
34
|
|
|
28
35
|
/** The current members of an organisation joined to the profile of their account: one statement, the page applied by the database. */
|
|
36
|
+
{{#if style.declared}}
|
|
29
37
|
@Repository(SearchMembersReader)
|
|
38
|
+
{{/if}}
|
|
30
39
|
export class KnexSearchMembersReader implements SearchMembersReader {
|
|
31
40
|
constructor(private readonly database: KnexContext) {}
|
|
32
41
|
|
package/templates/presets/identity/context/infrastructure/persistence/member.mapper.prisma.ts.tpl
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AuditStamp } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { Member } from '{{alias.context}}/domain/aggregates/member.aggregate{{alias.ext}}';
|
|
3
|
+
import type { {{context.pascal}}Member as MemberRow } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
4
|
+
|
|
5
|
+
export type MemberColumns = Omit<MemberRow, 'version' | keyof AuditStamp>;
|
|
6
|
+
|
|
7
|
+
export const MemberMapper = {
|
|
8
|
+
toDomain(row: MemberRow): Member {
|
|
9
|
+
const loaded = Member.rehydrate(row.id, {
|
|
10
|
+
organisationId: row.organisationId,
|
|
11
|
+
accountId: row.accountId,
|
|
12
|
+
role: row.role,
|
|
13
|
+
joinedAt: row.joinedAt,
|
|
14
|
+
removedAt: row.removedAt ?? undefined,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
loaded.version = row.version;
|
|
18
|
+
|
|
19
|
+
return loaded;
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
toRow(saved: Member): MemberColumns {
|
|
23
|
+
const state = saved.toState();
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
id: saved.id,
|
|
27
|
+
organisationId: state.organisationId,
|
|
28
|
+
accountId: state.accountId,
|
|
29
|
+
role: state.role,
|
|
30
|
+
joinedAt: state.joinedAt,
|
|
31
|
+
removedAt: state.removedAt ?? null,
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
};
|