ddd-ts-kit 0.89.0 → 0.91.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 +318 -0
- package/README.fr.md +58 -12
- package/README.md +54 -11
- 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/catalogue/default-severities.d.ts.map +1 -1
- package/dist/check/catalogue/default-severities.js +0 -4
- package/dist/check/catalogue/default-severities.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/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 +86 -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 +119 -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 +43 -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/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +4 -2
- package/dist/commands/doctor.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/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 +17 -4
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +4 -1
- package/dist/config/stack.js.map +1 -1
- 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/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/doctor/diagnose.d.ts +2 -1
- package/dist/doctor/diagnose.d.ts.map +1 -1
- package/dist/doctor/diagnose.js +4 -1
- package/dist/doctor/diagnose.js.map +1 -1
- package/dist/doctor/doctor-finding.d.ts +3 -2
- package/dist/doctor/doctor-finding.d.ts.map +1 -1
- package/dist/doctor/format-diagnosis.js +4 -1
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/override-findings.d.ts +10 -0
- package/dist/doctor/override-findings.d.ts.map +1 -0
- package/dist/doctor/override-findings.js +87 -0
- package/dist/doctor/override-findings.js.map +1 -0
- 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/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/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 +97 -0
- package/dist/generate/kinds/route/nest-controller-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 +52 -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.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 +4 -2
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.js +2 -0
- 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/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/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +10 -2
- package/dist/init/knip-vars.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 +95 -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 +12 -2
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/overrides-for.d.ts +7 -0
- package/dist/init/manifest/overrides-for.d.ts.map +1 -0
- package/dist/init/manifest/overrides-for.js +9 -0
- package/dist/init/manifest/overrides-for.js.map +1 -0
- package/dist/init/manifest/pinned-below-a-fix.d.ts +14 -0
- package/dist/init/manifest/pinned-below-a-fix.d.ts.map +1 -0
- package/dist/init/manifest/pinned-below-a-fix.js +20 -0
- package/dist/init/manifest/pinned-below-a-fix.js.map +1 -0
- 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 +31 -25
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/manifest/write-overrides.d.ts +9 -0
- package/dist/init/manifest/write-overrides.d.ts.map +1 -0
- package/dist/init/manifest/write-overrides.js +56 -0
- package/dist/init/manifest/write-overrides.js.map +1 -0
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +19 -3
- 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 +23 -4
- 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/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 +16 -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 +16 -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/read-nest-controllers.d.ts +15 -0
- package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -0
- package/dist/nest-controllers/read-nest-controllers.js +89 -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 +8 -0
- package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -0
- package/dist/nest-controllers/render-controllers-file.js +56 -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/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 +11 -5
- 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 +3 -0
- 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/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/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/package.json +4 -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/context/module.manual.ts.tpl +11 -0
- package/templates/init/jest.config.js.tpl +6 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +50 -0
- package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +9 -3
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +1 -1
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +1 -1
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +30 -1
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +23 -1
- package/templates/init/platform/database/persistence.contract.spec.ts.tpl +113 -0
- package/templates/init/platform/database/persistence.orm.ts.tpl +8 -3
- package/templates/init/platform/database/schema.prisma.tpl +53 -0
- 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/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 +48 -1
- 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 +61 -3
- 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/nest-controller/controller.spec.ts.tpl +57 -0
- package/templates/nest-controller/controller.ts.tpl +65 -0
- package/templates/pipeline/knip.json.tpl +4 -8
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +254 -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/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 +3 -3
- 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 +95 -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/property/value-object.properties.spec.ts.tpl +38 -0
- package/templates/sdk/orpc.ts.tpl +46 -0
- package/templates/sdk/trpc.ts.tpl +86 -0
- /package/templates/presets/identity/context/test/worlds/{__context__.world.ts.tpl → __context__.world.declared.ts.tpl} +0 -0
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Access } from '@ddd-ts-kit/auth';
|
|
2
2
|
import type { Clock, IdGenerator } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#unless style.declared}}
|
|
7
|
+
import type { CommandHandler } from '@ddd-ts-kit/kernel';
|
|
8
|
+
{{/unless}}
|
|
4
9
|
import { Delegation } from '{{alias.context}}/domain/aggregates/delegation.aggregate{{alias.ext}}';
|
|
5
10
|
{{#unless refusals.named}}
|
|
6
11
|
import { MemberError } from '{{alias.context}}/domain/errors/member.error{{alias.ext}}';
|
|
@@ -13,9 +18,16 @@ import type { MemberRepository } from '{{alias.context}}/domain/repositories/mem
|
|
|
13
18
|
import { RoleRightsService } from '{{alias.context}}/domain/services/role-rights.service{{alias.ext}}';
|
|
14
19
|
import { DelegationPeriod } from '{{alias.context}}/domain/value-objects/delegation-period.vo{{alias.ext}}';
|
|
15
20
|
import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
|
|
21
|
+
{{#if style.declared}}
|
|
16
22
|
import { GrantDelegationCommand } from '{{alias.context}}/application/commands/grant-delegation/grant-delegation.command{{alias.ext}}';
|
|
23
|
+
{{/if}}
|
|
24
|
+
{{#unless style.declared}}
|
|
25
|
+
import type { GrantDelegationCommand } from '{{alias.context}}/application/commands/grant-delegation/grant-delegation.command{{alias.ext}}';
|
|
26
|
+
{{/unless}}
|
|
17
27
|
|
|
28
|
+
{{#if style.declared}}
|
|
18
29
|
@CommandHandler(GrantDelegationCommand)
|
|
30
|
+
{{/if}}
|
|
19
31
|
export class GrantDelegationHandler implements CommandHandler<GrantDelegationCommand> {
|
|
20
32
|
constructor(
|
|
21
33
|
private readonly delegationRepository: DelegationRepository,
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { AuthorizedCommand, type Actor } 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 { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
5
9
|
|
|
6
10
|
/** Invites a person to an organisation by email address, in a role: the answer carries the token to send them, never stored. */
|
|
11
|
+
{{#if style.declared}}
|
|
7
12
|
@Requires({{context.camel}}Permissions['member.invite'], { resource: () => ({ type: 'context', id: '{{context.kebab}}' }) })
|
|
13
|
+
{{/if}}
|
|
8
14
|
export class InviteMemberCommand extends AuthorizedCommand<{ readonly id: string; readonly token: string }> {
|
|
9
15
|
constructor(
|
|
10
16
|
actor: Actor,
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Access } from '@ddd-ts-kit/auth';
|
|
2
2
|
import type { Clock, IdGenerator } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{#if style.declared}}
|
|
3
4
|
import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#unless style.declared}}
|
|
7
|
+
import type { CommandHandler } from '@ddd-ts-kit/kernel';
|
|
8
|
+
{{/unless}}
|
|
4
9
|
import { Invitation } from '{{alias.context}}/domain/aggregates/invitation.aggregate{{alias.ext}}';
|
|
5
10
|
import { Member } from '{{alias.context}}/domain/aggregates/member.aggregate{{alias.ext}}';
|
|
6
11
|
import type { DelegationRepository } from '{{alias.context}}/domain/repositories/delegation.repository{{alias.ext}}';
|
|
@@ -11,10 +16,17 @@ import { EmailAddress } from '{{alias.context}}/domain/value-objects/email-addre
|
|
|
11
16
|
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
12
17
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
13
18
|
import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
|
|
19
|
+
{{#if style.declared}}
|
|
14
20
|
import { InviteMemberCommand } from '{{alias.context}}/application/commands/invite-member/invite-member.command{{alias.ext}}';
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#unless style.declared}}
|
|
23
|
+
import type { InviteMemberCommand } from '{{alias.context}}/application/commands/invite-member/invite-member.command{{alias.ext}}';
|
|
24
|
+
{{/unless}}
|
|
15
25
|
import type { InvitationTokens } from '{{alias.context}}/application/ports/invitation-tokens.port{{alias.ext}}';
|
|
16
26
|
|
|
27
|
+
{{#if style.declared}}
|
|
17
28
|
@CommandHandler(InviteMemberCommand)
|
|
29
|
+
{{/if}}
|
|
18
30
|
export class InviteMemberHandler implements CommandHandler<InviteMemberCommand> {
|
|
19
31
|
constructor(
|
|
20
32
|
private readonly invitationRepository: InvitationRepository,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { AuthorizedCommand, type Actor } 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
|
|
|
5
9
|
/** Opens an organisation; the account that opens it is its first owner. */
|
|
10
|
+
{{#if style.declared}}
|
|
6
11
|
@Requires({{context.camel}}Permissions['organisation.open'], { resource: () => ({ type: 'context', id: '{{context.kebab}}' }) })
|
|
12
|
+
{{/if}}
|
|
7
13
|
export class OpenOrganisationCommand extends AuthorizedCommand<string> {
|
|
8
14
|
constructor(
|
|
9
15
|
actor: Actor,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Clock, IdGenerator } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#unless style.declared}}
|
|
6
|
+
import type { CommandHandler } from '@ddd-ts-kit/kernel';
|
|
7
|
+
{{/unless}}
|
|
3
8
|
import { Member } from '{{alias.context}}/domain/aggregates/member.aggregate{{alias.ext}}';
|
|
4
9
|
import { Organisation } from '{{alias.context}}/domain/aggregates/organisation.aggregate{{alias.ext}}';
|
|
5
10
|
{{#unless refusals.named}}
|
|
@@ -16,9 +21,16 @@ import type { OrganisationRepository } from '{{alias.context}}/domain/repositori
|
|
|
16
21
|
import { OrganisationName } from '{{alias.context}}/domain/value-objects/organisation-name.vo{{alias.ext}}';
|
|
17
22
|
import { OrganisationSlug } from '{{alias.context}}/domain/value-objects/organisation-slug.vo{{alias.ext}}';
|
|
18
23
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
24
|
+
{{#if style.declared}}
|
|
19
25
|
import { OpenOrganisationCommand } from '{{alias.context}}/application/commands/open-organisation/open-organisation.command{{alias.ext}}';
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{#unless style.declared}}
|
|
28
|
+
import type { OpenOrganisationCommand } from '{{alias.context}}/application/commands/open-organisation/open-organisation.command{{alias.ext}}';
|
|
29
|
+
{{/unless}}
|
|
20
30
|
|
|
31
|
+
{{#if style.declared}}
|
|
21
32
|
@CommandHandler(OpenOrganisationCommand)
|
|
33
|
+
{{/if}}
|
|
22
34
|
export class OpenOrganisationHandler implements CommandHandler<OpenOrganisationCommand> {
|
|
23
35
|
constructor(
|
|
24
36
|
private readonly organisationRepository: OrganisationRepository,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { AuthorizedCommand, type Actor } 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
|
|
|
5
9
|
/** Provisions the account of the person who signs in, from what their token says of them, or refreshes it at a later sign-in. */
|
|
10
|
+
{{#if style.declared}}
|
|
6
11
|
@Requires({{context.camel}}Permissions['account.provision'], { resource: () => ({ type: 'context', id: '{{context.kebab}}' }) })
|
|
12
|
+
{{/if}}
|
|
7
13
|
export class ProvisionAccountCommand extends AuthorizedCommand<string> {
|
|
8
14
|
constructor(
|
|
9
15
|
actor: Actor,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Clock } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#unless style.declared}}
|
|
6
|
+
import type { CommandHandler } from '@ddd-ts-kit/kernel';
|
|
7
|
+
{{/unless}}
|
|
3
8
|
import { Account } from '{{alias.context}}/domain/aggregates/account.aggregate{{alias.ext}}';
|
|
4
9
|
{{#unless refusals.named}}
|
|
5
10
|
import { AccountError } from '{{alias.context}}/domain/errors/account.error{{alias.ext}}';
|
|
@@ -10,9 +15,16 @@ import { EmailNotVerified } from '{{alias.context}}/domain/errors/email-not-veri
|
|
|
10
15
|
import type { AccountRepository } from '{{alias.context}}/domain/repositories/account.repository{{alias.ext}}';
|
|
11
16
|
import { DisplayName } from '{{alias.context}}/domain/value-objects/display-name.vo{{alias.ext}}';
|
|
12
17
|
import { EmailAddress } from '{{alias.context}}/domain/value-objects/email-address.vo{{alias.ext}}';
|
|
18
|
+
{{#if style.declared}}
|
|
13
19
|
import { ProvisionAccountCommand } from '{{alias.context}}/application/commands/provision-account/provision-account.command{{alias.ext}}';
|
|
20
|
+
{{/if}}
|
|
21
|
+
{{#unless style.declared}}
|
|
22
|
+
import type { ProvisionAccountCommand } from '{{alias.context}}/application/commands/provision-account/provision-account.command{{alias.ext}}';
|
|
23
|
+
{{/unless}}
|
|
14
24
|
|
|
25
|
+
{{#if style.declared}}
|
|
15
26
|
@CommandHandler(ProvisionAccountCommand)
|
|
27
|
+
{{/if}}
|
|
16
28
|
export class ProvisionAccountHandler implements CommandHandler<ProvisionAccountCommand> {
|
|
17
29
|
constructor(
|
|
18
30
|
private readonly accountRepository: AccountRepository,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { AuthorizedCommand, type Actor } 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
|
|
|
5
9
|
/** Removes a member from an organisation. */
|
|
10
|
+
{{#if style.declared}}
|
|
6
11
|
@Requires({{context.camel}}Permissions['member.remove'], { resource: () => ({ type: 'context', id: '{{context.kebab}}' }) })
|
|
12
|
+
{{/if}}
|
|
7
13
|
export class RemoveMemberCommand extends AuthorizedCommand<string> {
|
|
8
14
|
constructor(
|
|
9
15
|
actor: Actor,
|
|
@@ -1,6 +1,11 @@
|
|
|
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 { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#unless style.declared}}
|
|
7
|
+
import type { CommandHandler } from '@ddd-ts-kit/kernel';
|
|
8
|
+
{{/unless}}
|
|
4
9
|
import type { Member } from '{{alias.context}}/domain/aggregates/member.aggregate{{alias.ext}}';
|
|
5
10
|
import type { Organisation } from '{{alias.context}}/domain/aggregates/organisation.aggregate{{alias.ext}}';
|
|
6
11
|
{{#unless refusals.named}}
|
|
@@ -18,9 +23,16 @@ import { RoleRightsService, type HeldRights } from '{{alias.context}}/domain/ser
|
|
|
18
23
|
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
19
24
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
20
25
|
import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
|
|
26
|
+
{{#if style.declared}}
|
|
21
27
|
import { RemoveMemberCommand } from '{{alias.context}}/application/commands/remove-member/remove-member.command{{alias.ext}}';
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{#unless style.declared}}
|
|
30
|
+
import type { RemoveMemberCommand } from '{{alias.context}}/application/commands/remove-member/remove-member.command{{alias.ext}}';
|
|
31
|
+
{{/unless}}
|
|
22
32
|
|
|
33
|
+
{{#if style.declared}}
|
|
23
34
|
@CommandHandler(RemoveMemberCommand)
|
|
35
|
+
{{/if}}
|
|
24
36
|
export class RemoveMemberHandler implements CommandHandler<RemoveMemberCommand> {
|
|
25
37
|
constructor(
|
|
26
38
|
private readonly organisationRepository: OrganisationRepository,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { AuthorizedCommand, type Actor } 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
|
|
|
5
9
|
/** Ends a delegation of an organisation before its period. */
|
|
10
|
+
{{#if style.declared}}
|
|
6
11
|
@Requires({{context.camel}}Permissions['delegation.revoke'], { resource: () => ({ type: 'context', id: '{{context.kebab}}' }) })
|
|
12
|
+
{{/if}}
|
|
7
13
|
export class RevokeDelegationCommand extends AuthorizedCommand<string> {
|
|
8
14
|
constructor(
|
|
9
15
|
actor: Actor,
|
|
@@ -1,6 +1,11 @@
|
|
|
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 { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#unless style.declared}}
|
|
7
|
+
import type { CommandHandler } from '@ddd-ts-kit/kernel';
|
|
8
|
+
{{/unless}}
|
|
4
9
|
{{#unless refusals.named}}
|
|
5
10
|
import { DelegationError } from '{{alias.context}}/domain/errors/delegation.error{{alias.ext}}';
|
|
6
11
|
{{/unless}}
|
|
@@ -11,9 +16,16 @@ import type { DelegationRepository } from '{{alias.context}}/domain/repositories
|
|
|
11
16
|
import type { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
12
17
|
import { RoleRightsService } from '{{alias.context}}/domain/services/role-rights.service{{alias.ext}}';
|
|
13
18
|
import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
|
|
19
|
+
{{#if style.declared}}
|
|
14
20
|
import { RevokeDelegationCommand } from '{{alias.context}}/application/commands/revoke-delegation/revoke-delegation.command{{alias.ext}}';
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#unless style.declared}}
|
|
23
|
+
import type { RevokeDelegationCommand } from '{{alias.context}}/application/commands/revoke-delegation/revoke-delegation.command{{alias.ext}}';
|
|
24
|
+
{{/unless}}
|
|
15
25
|
|
|
26
|
+
{{#if style.declared}}
|
|
16
27
|
@CommandHandler(RevokeDelegationCommand)
|
|
28
|
+
{{/if}}
|
|
17
29
|
export class RevokeDelegationHandler implements CommandHandler<RevokeDelegationCommand> {
|
|
18
30
|
constructor(
|
|
19
31
|
private readonly delegationRepository: DelegationRepository,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { AuthorizedCommand, type Actor } 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
|
|
|
5
9
|
/** Takes back an invitation of an organisation that was not answered. */
|
|
10
|
+
{{#if style.declared}}
|
|
6
11
|
@Requires({{context.camel}}Permissions['invitation.revoke'], { resource: () => ({ type: 'context', id: '{{context.kebab}}' }) })
|
|
12
|
+
{{/if}}
|
|
7
13
|
export class RevokeInvitationCommand extends AuthorizedCommand<string> {
|
|
8
14
|
constructor(
|
|
9
15
|
actor: Actor,
|
|
@@ -1,6 +1,11 @@
|
|
|
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 { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#unless style.declared}}
|
|
7
|
+
import type { CommandHandler } from '@ddd-ts-kit/kernel';
|
|
8
|
+
{{/unless}}
|
|
4
9
|
{{#unless refusals.named}}
|
|
5
10
|
import { InvitationError } from '{{alias.context}}/domain/errors/invitation.error{{alias.ext}}';
|
|
6
11
|
{{/unless}}
|
|
@@ -12,9 +17,16 @@ import type { InvitationRepository } from '{{alias.context}}/domain/repositories
|
|
|
12
17
|
import type { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
13
18
|
import { RoleRightsService } from '{{alias.context}}/domain/services/role-rights.service{{alias.ext}}';
|
|
14
19
|
import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
|
|
20
|
+
{{#if style.declared}}
|
|
15
21
|
import { RevokeInvitationCommand } from '{{alias.context}}/application/commands/revoke-invitation/revoke-invitation.command{{alias.ext}}';
|
|
22
|
+
{{/if}}
|
|
23
|
+
{{#unless style.declared}}
|
|
24
|
+
import type { RevokeInvitationCommand } from '{{alias.context}}/application/commands/revoke-invitation/revoke-invitation.command{{alias.ext}}';
|
|
25
|
+
{{/unless}}
|
|
16
26
|
|
|
27
|
+
{{#if style.declared}}
|
|
17
28
|
@CommandHandler(RevokeInvitationCommand)
|
|
29
|
+
{{/if}}
|
|
18
30
|
export class RevokeInvitationHandler implements CommandHandler<RevokeInvitationCommand> {
|
|
19
31
|
constructor(
|
|
20
32
|
private readonly invitationRepository: InvitationRepository,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
{{#if style.declared}}
|
|
1
2
|
import { IntegrationEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
{{/if}}
|
|
2
4
|
import { accountDeactivatedV1, type AccountDeactivatedV1 } from '{{alias.context}}/published-language/account-deactivated.v1.integration-event{{alias.ext}}';
|
|
3
5
|
import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/identity-provider-admin.port{{alias.ext}}';
|
|
4
6
|
|
|
@@ -7,7 +9,9 @@ import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/
|
|
|
7
9
|
* outbox, so a provider down at the time of the deactivation is asked again until it answers;
|
|
8
10
|
* disabling twice changes nothing.
|
|
9
11
|
*/
|
|
12
|
+
{{#if style.declared}}
|
|
10
13
|
@IntegrationEventHandler(accountDeactivatedV1, { consumer: '{{context.kebab}}.provider-disables-account' })
|
|
14
|
+
{{/if}}
|
|
11
15
|
export class AccountDeactivatedIntegrationHandler {
|
|
12
16
|
static readonly eventType = accountDeactivatedV1.type;
|
|
13
17
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
{{#if style.declared}}
|
|
1
2
|
import { IntegrationEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
{{/if}}
|
|
2
4
|
import type { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
3
5
|
import { memberJoinedV1, type MemberJoinedV1 } from '{{alias.context}}/published-language/member-joined.v1.integration-event{{alias.ext}}';
|
|
4
6
|
import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/identity-provider-admin.port{{alias.ext}}';
|
|
@@ -9,7 +11,9 @@ import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/
|
|
|
9
11
|
* alone. A membership already ended (removed, or its account deactivated) is taken out again,
|
|
10
12
|
* so that a late retry of this fact never gives a removed person back their organisation.
|
|
11
13
|
*/
|
|
14
|
+
{{#if style.declared}}
|
|
12
15
|
@IntegrationEventHandler(memberJoinedV1, { consumer: '{{context.kebab}}.provider-follows-joined-member' })
|
|
16
|
+
{{/if}}
|
|
13
17
|
export class MemberJoinedIntegrationHandler {
|
|
14
18
|
static readonly eventType = memberJoinedV1.type;
|
|
15
19
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
{{#if style.declared}}
|
|
1
2
|
import { IntegrationEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
{{/if}}
|
|
2
4
|
import type { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
3
5
|
import { memberRemovedV1, type MemberRemovedV1 } from '{{alias.context}}/published-language/member-removed.v1.integration-event{{alias.ext}}';
|
|
4
6
|
import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/identity-provider-admin.port{{alias.ext}}';
|
|
@@ -9,7 +11,9 @@ import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/
|
|
|
9
11
|
* provider down at the time of the removal is asked again until it answers; a person who joined
|
|
10
12
|
* again since is left in, the context holding the membership now.
|
|
11
13
|
*/
|
|
14
|
+
{{#if style.declared}}
|
|
12
15
|
@IntegrationEventHandler(memberRemovedV1, { consumer: '{{context.kebab}}.provider-follows-removed-member' })
|
|
16
|
+
{{/if}}
|
|
13
17
|
export class MemberRemovedIntegrationHandler {
|
|
14
18
|
static readonly eventType = memberRemovedV1.type;
|
|
15
19
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
{{#if style.declared}}
|
|
1
2
|
import { IntegrationEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
3
|
+
{{/if}}
|
|
2
4
|
import { organisationOpenedV1, type OrganisationOpenedV1 } from '{{alias.context}}/published-language/organisation-opened.v1.integration-event{{alias.ext}}';
|
|
3
5
|
import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/identity-provider-admin.port{{alias.ext}}';
|
|
4
6
|
|
|
@@ -7,7 +9,9 @@ import type { IdentityProviderAdmin } from '{{alias.context}}/application/ports/
|
|
|
7
9
|
* the fact the context published through its outbox, so delivered at least once: a provider that
|
|
8
10
|
* fails is asked again until it answers, and asking twice changes nothing (the adapter is idempotent).
|
|
9
11
|
*/
|
|
12
|
+
{{#if style.declared}}
|
|
10
13
|
@IntegrationEventHandler(organisationOpenedV1, { consumer: '{{context.kebab}}.provider-opens-organisation' })
|
|
14
|
+
{{/if}}
|
|
11
15
|
export class OrganisationOpenedIntegrationHandler {
|
|
12
16
|
static readonly eventType = organisationOpenedV1.type;
|
|
13
17
|
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { IdGenerator, IntegrationEventPublisher } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { AccountDeactivated } from '{{alias.context}}/domain/events/account-deactivated.event{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless style.declared}}
|
|
9
|
+
import type { AccountDeactivated } from '{{alias.context}}/domain/events/account-deactivated.event{{alias.ext}}';
|
|
10
|
+
{{/unless}}
|
|
4
11
|
import { accountDeactivatedV1 } from '{{alias.context}}/published-language/account-deactivated.v1.integration-event{{alias.ext}}';
|
|
5
12
|
|
|
6
13
|
/** Tells the other contexts, through the outbox, in the transaction of the fact. */
|
|
14
|
+
{{#if style.declared}}
|
|
7
15
|
@DomainEventHandler(AccountDeactivated)
|
|
8
|
-
|
|
16
|
+
{{/if}}
|
|
17
|
+
export class AccountDeactivatedPublisher{{#if style.declared}} implements DomainEventHandler<AccountDeactivated>{{/if}} {
|
|
9
18
|
constructor(
|
|
10
19
|
private readonly publisher: IntegrationEventPublisher,
|
|
11
20
|
private readonly ids: IdGenerator,
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { IdGenerator, IntegrationEventPublisher } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { DelegationGranted } from '{{alias.context}}/domain/events/delegation-granted.event{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless style.declared}}
|
|
9
|
+
import type { DelegationGranted } from '{{alias.context}}/domain/events/delegation-granted.event{{alias.ext}}';
|
|
10
|
+
{{/unless}}
|
|
4
11
|
import { delegationGrantedV1 } from '{{alias.context}}/published-language/delegation-granted.v1.integration-event{{alias.ext}}';
|
|
5
12
|
|
|
6
13
|
/** Tells the other contexts, through the outbox, in the transaction of the fact. */
|
|
14
|
+
{{#if style.declared}}
|
|
7
15
|
@DomainEventHandler(DelegationGranted)
|
|
8
|
-
|
|
16
|
+
{{/if}}
|
|
17
|
+
export class DelegationGrantedPublisher{{#if style.declared}} implements DomainEventHandler<DelegationGranted>{{/if}} {
|
|
9
18
|
constructor(
|
|
10
19
|
private readonly publisher: IntegrationEventPublisher,
|
|
11
20
|
private readonly ids: IdGenerator,
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { IdGenerator, IntegrationEventPublisher } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { DelegationRevoked } from '{{alias.context}}/domain/events/delegation-revoked.event{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless style.declared}}
|
|
9
|
+
import type { DelegationRevoked } from '{{alias.context}}/domain/events/delegation-revoked.event{{alias.ext}}';
|
|
10
|
+
{{/unless}}
|
|
4
11
|
import { delegationRevokedV1 } from '{{alias.context}}/published-language/delegation-revoked.v1.integration-event{{alias.ext}}';
|
|
5
12
|
|
|
6
13
|
/** Tells the other contexts, through the outbox, in the transaction of the fact. */
|
|
14
|
+
{{#if style.declared}}
|
|
7
15
|
@DomainEventHandler(DelegationRevoked)
|
|
8
|
-
|
|
16
|
+
{{/if}}
|
|
17
|
+
export class DelegationRevokedPublisher{{#if style.declared}} implements DomainEventHandler<DelegationRevoked>{{/if}} {
|
|
9
18
|
constructor(
|
|
10
19
|
private readonly publisher: IntegrationEventPublisher,
|
|
11
20
|
private readonly ids: IdGenerator,
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { IdGenerator, IntegrationEventPublisher } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { MemberJoined } from '{{alias.context}}/domain/events/member-joined.event{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless style.declared}}
|
|
9
|
+
import type { MemberJoined } from '{{alias.context}}/domain/events/member-joined.event{{alias.ext}}';
|
|
10
|
+
{{/unless}}
|
|
4
11
|
import { memberJoinedV1 } from '{{alias.context}}/published-language/member-joined.v1.integration-event{{alias.ext}}';
|
|
5
12
|
|
|
6
13
|
/** Tells the other contexts, through the outbox, in the transaction of the fact. */
|
|
14
|
+
{{#if style.declared}}
|
|
7
15
|
@DomainEventHandler(MemberJoined)
|
|
8
|
-
|
|
16
|
+
{{/if}}
|
|
17
|
+
export class MemberJoinedPublisher{{#if style.declared}} implements DomainEventHandler<MemberJoined>{{/if}} {
|
|
9
18
|
constructor(
|
|
10
19
|
private readonly publisher: IntegrationEventPublisher,
|
|
11
20
|
private readonly ids: IdGenerator,
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { IdGenerator, IntegrationEventPublisher } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { MemberRemoved } from '{{alias.context}}/domain/events/member-removed.event{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless style.declared}}
|
|
9
|
+
import type { MemberRemoved } from '{{alias.context}}/domain/events/member-removed.event{{alias.ext}}';
|
|
10
|
+
{{/unless}}
|
|
4
11
|
import { memberRemovedV1 } from '{{alias.context}}/published-language/member-removed.v1.integration-event{{alias.ext}}';
|
|
5
12
|
|
|
6
13
|
/** Tells the other contexts, through the outbox, in the transaction of the fact. */
|
|
14
|
+
{{#if style.declared}}
|
|
7
15
|
@DomainEventHandler(MemberRemoved)
|
|
8
|
-
|
|
16
|
+
{{/if}}
|
|
17
|
+
export class MemberRemovedPublisher{{#if style.declared}} implements DomainEventHandler<MemberRemoved>{{/if}} {
|
|
9
18
|
constructor(
|
|
10
19
|
private readonly publisher: IntegrationEventPublisher,
|
|
11
20
|
private readonly ids: IdGenerator,
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { IdGenerator, IntegrationEventPublisher } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { MemberRoleChanged } from '{{alias.context}}/domain/events/member-role-changed.event{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless style.declared}}
|
|
9
|
+
import type { MemberRoleChanged } from '{{alias.context}}/domain/events/member-role-changed.event{{alias.ext}}';
|
|
10
|
+
{{/unless}}
|
|
4
11
|
import { memberRoleChangedV1 } from '{{alias.context}}/published-language/member-role-changed.v1.integration-event{{alias.ext}}';
|
|
5
12
|
|
|
6
13
|
/** Tells the other contexts, through the outbox, in the transaction of the fact. */
|
|
14
|
+
{{#if style.declared}}
|
|
7
15
|
@DomainEventHandler(MemberRoleChanged)
|
|
8
|
-
|
|
16
|
+
{{/if}}
|
|
17
|
+
export class MemberRoleChangedPublisher{{#if style.declared}} implements DomainEventHandler<MemberRoleChanged>{{/if}} {
|
|
9
18
|
constructor(
|
|
10
19
|
private readonly publisher: IntegrationEventPublisher,
|
|
11
20
|
private readonly ids: IdGenerator,
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { IdGenerator, IntegrationEventPublisher } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#if style.declared}}
|
|
2
3
|
import { DomainEventHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{#if style.declared}}
|
|
3
6
|
import { OrganisationOpened } from '{{alias.context}}/domain/events/organisation-opened.event{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{#unless style.declared}}
|
|
9
|
+
import type { OrganisationOpened } from '{{alias.context}}/domain/events/organisation-opened.event{{alias.ext}}';
|
|
10
|
+
{{/unless}}
|
|
4
11
|
import { organisationOpenedV1 } from '{{alias.context}}/published-language/organisation-opened.v1.integration-event{{alias.ext}}';
|
|
5
12
|
|
|
6
13
|
/** Tells the other contexts, through the outbox, in the transaction of the fact. */
|
|
14
|
+
{{#if style.declared}}
|
|
7
15
|
@DomainEventHandler(OrganisationOpened)
|
|
8
|
-
|
|
16
|
+
{{/if}}
|
|
17
|
+
export class OrganisationOpenedPublisher{{#if style.declared}} implements DomainEventHandler<OrganisationOpened>{{/if}} {
|
|
9
18
|
constructor(
|
|
10
19
|
private readonly publisher: IntegrationEventPublisher,
|
|
11
20
|
private readonly ids: IdGenerator,
|
|
@@ -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 {
|