ddd-ts-kit 0.90.0 → 0.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +474 -0
- package/README.fr.md +53 -17
- package/README.md +49 -15
- package/dist/acceptance/lock-acceptance.d.ts.map +1 -1
- package/dist/acceptance/lock-acceptance.js +2 -1
- package/dist/acceptance/lock-acceptance.js.map +1 -1
- package/dist/alias/index.d.ts +2 -1
- package/dist/alias/index.d.ts.map +1 -1
- package/dist/alias/index.js +1 -0
- package/dist/alias/index.js.map +1 -1
- package/dist/alias/mapper-target-text.d.ts +4 -0
- package/dist/alias/mapper-target-text.d.ts.map +1 -0
- package/dist/alias/mapper-target-text.js +5 -0
- package/dist/alias/mapper-target-text.js.map +1 -0
- package/dist/alias/module-name-mapper.d.ts +5 -2
- package/dist/alias/module-name-mapper.d.ts.map +1 -1
- package/dist/alias/module-name-mapper.js +5 -2
- package/dist/alias/module-name-mapper.js.map +1 -1
- package/dist/check/alias/test-runners.js +8 -3
- package/dist/check/alias/test-runners.js.map +1 -1
- package/dist/check/baseline/apply-baseline.d.ts +14 -0
- package/dist/check/baseline/apply-baseline.d.ts.map +1 -0
- package/dist/check/baseline/apply-baseline.js +30 -0
- package/dist/check/baseline/apply-baseline.js.map +1 -0
- package/dist/check/baseline/baseline-following-moves.d.ts +9 -0
- package/dist/check/baseline/baseline-following-moves.d.ts.map +1 -0
- package/dist/check/baseline/baseline-following-moves.js +10 -0
- package/dist/check/baseline/baseline-following-moves.js.map +1 -0
- package/dist/check/baseline/baseline-move.d.ts +6 -0
- package/dist/check/baseline/baseline-move.d.ts.map +1 -0
- package/dist/check/baseline/baseline-move.js +2 -0
- package/dist/check/baseline/baseline-move.js.map +1 -0
- package/dist/check/baseline/baseline-text.d.ts +4 -0
- package/dist/check/baseline/baseline-text.d.ts.map +1 -0
- package/dist/check/baseline/baseline-text.js +12 -0
- package/dist/check/baseline/baseline-text.js.map +1 -0
- package/dist/check/baseline/baseline.d.ts +6 -0
- package/dist/check/baseline/baseline.d.ts.map +1 -0
- package/dist/check/baseline/baseline.js +2 -0
- package/dist/check/baseline/baseline.js.map +1 -0
- package/dist/check/baseline/moved-baseline-text.d.ts +4 -0
- package/dist/check/baseline/moved-baseline-text.d.ts.map +1 -0
- package/dist/check/baseline/moved-baseline-text.js +13 -0
- package/dist/check/baseline/moved-baseline-text.js.map +1 -0
- package/dist/check/baseline/parse-baseline.d.ts +4 -0
- package/dist/check/baseline/parse-baseline.d.ts.map +1 -0
- package/dist/check/baseline/parse-baseline.js +19 -0
- package/dist/check/baseline/parse-baseline.js.map +1 -0
- package/dist/check/baseline/pruned-baseline.d.ts +5 -0
- package/dist/check/baseline/pruned-baseline.d.ts.map +1 -0
- package/dist/check/baseline/pruned-baseline.js +14 -0
- package/dist/check/baseline/pruned-baseline.js.map +1 -0
- package/dist/check/baseline/read-baseline.d.ts +6 -0
- package/dist/check/baseline/read-baseline.d.ts.map +1 -0
- package/dist/check/baseline/read-baseline.js +11 -0
- package/dist/check/baseline/read-baseline.js.map +1 -0
- package/dist/check/baseline/recorded-baseline.d.ts +5 -0
- package/dist/check/baseline/recorded-baseline.d.ts.map +1 -0
- package/dist/check/baseline/recorded-baseline.js +11 -0
- package/dist/check/baseline/recorded-baseline.js.map +1 -0
- package/dist/check/baseline/renamed-files.d.ts +8 -0
- package/dist/check/baseline/renamed-files.d.ts.map +1 -0
- package/dist/check/baseline/renamed-files.js +23 -0
- package/dist/check/baseline/renamed-files.js.map +1 -0
- package/dist/check/baseline/write-baseline.d.ts +4 -0
- package/dist/check/baseline/write-baseline.d.ts.map +1 -0
- package/dist/check/baseline/write-baseline.js +9 -0
- package/dist/check/baseline/write-baseline.js.map +1 -0
- package/dist/check/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +5 -1
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +4 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/commands/check-command.d.ts.map +1 -1
- package/dist/check/commands/check-command.js +46 -1
- package/dist/check/commands/check-command.js.map +1 -1
- package/dist/check/commands/check-file-command.d.ts +5 -0
- package/dist/check/commands/check-file-command.d.ts.map +1 -1
- package/dist/check/commands/check-file-command.js +27 -6
- package/dist/check/commands/check-file-command.js.map +1 -1
- package/dist/check/event-sourcing/read-stored-shape.d.ts +2 -0
- package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
- package/dist/check/event-sourcing/read-stored-shape.js +3 -1
- package/dist/check/event-sourcing/read-stored-shape.js.map +1 -1
- package/dist/check/event-sourcing/stored-event-declaration.d.ts +2 -0
- package/dist/check/event-sourcing/stored-event-declaration.d.ts.map +1 -1
- package/dist/check/event-sourcing/stored-event-declarations.js +1 -0
- package/dist/check/event-sourcing/stored-event-declarations.js.map +1 -1
- package/dist/check/event-sourcing/stored-shape.d.ts +2 -0
- package/dist/check/event-sourcing/stored-shape.d.ts.map +1 -1
- package/dist/check/explain/nest-docs.d.ts +3 -0
- package/dist/check/explain/nest-docs.d.ts.map +1 -0
- package/dist/check/explain/nest-docs.js +31 -0
- package/dist/check/explain/nest-docs.js.map +1 -0
- package/dist/check/explain/rule-docs.d.ts.map +1 -1
- package/dist/check/explain/rule-docs.js +2 -0
- package/dist/check/explain/rule-docs.js.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/authz-declared-fixtures.js +1 -1
- package/dist/check/fixtures/authz-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +4 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/nest-controllers-fixtures.d.ts +3 -0
- package/dist/check/fixtures/nest-controllers-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/nest-controllers-fixtures.js +104 -0
- package/dist/check/fixtures/nest-controllers-fixtures.js.map +1 -0
- package/dist/check/fixtures/nest-fixtures.d.ts +3 -0
- package/dist/check/fixtures/nest-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/nest-fixtures.js +59 -0
- package/dist/check/fixtures/nest-fixtures.js.map +1 -0
- package/dist/check/nest/nest-equivalents-of.d.ts +14 -0
- package/dist/check/nest/nest-equivalents-of.d.ts.map +1 -0
- package/dist/check/nest/nest-equivalents-of.js +124 -0
- package/dist/check/nest/nest-equivalents-of.js.map +1 -0
- package/dist/check/project/load-project.d.ts +2 -0
- package/dist/check/project/load-project.d.ts.map +1 -1
- package/dist/check/project/load-project.js +7 -3
- package/dist/check/project/load-project.js.map +1 -1
- package/dist/check/rules/nest-controllers-current.d.ts +3 -0
- package/dist/check/rules/nest-controllers-current.d.ts.map +1 -0
- package/dist/check/rules/nest-controllers-current.js +54 -0
- package/dist/check/rules/nest-controllers-current.js.map +1 -0
- package/dist/check/rules/nest-no-parallel-pipeline.d.ts +3 -0
- package/dist/check/rules/nest-no-parallel-pipeline.d.ts.map +1 -0
- package/dist/check/rules/nest-no-parallel-pipeline.js +70 -0
- package/dist/check/rules/nest-no-parallel-pipeline.js.map +1 -0
- package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
- package/dist/check/support/is-generated-context-file.js +4 -1
- package/dist/check/support/is-generated-context-file.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +13 -5
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +21 -1
- package/dist/commands/drizzle-generate.js.map +1 -1
- package/dist/commands/generate.js +2 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/prisma-generate.d.ts +7 -0
- package/dist/commands/prisma-generate.d.ts.map +1 -0
- package/dist/commands/prisma-generate.js +23 -0
- package/dist/commands/prisma-generate.js.map +1 -0
- package/dist/commands/typeorm-generate.d.ts +10 -0
- package/dist/commands/typeorm-generate.d.ts.map +1 -0
- package/dist/commands/typeorm-generate.js +37 -0
- package/dist/commands/typeorm-generate.js.map +1 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/parse-config.js +1 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +2 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/serialize-config.js +9 -2
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +18 -5
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +5 -2
- package/dist/config/stack.js.map +1 -1
- package/dist/describe/guard-errors.d.ts +3 -0
- package/dist/describe/guard-errors.d.ts.map +1 -0
- package/dist/describe/guard-errors.js +10 -0
- package/dist/describe/guard-errors.js.map +1 -0
- package/dist/describe/no-group.d.ts +4 -0
- package/dist/describe/no-group.d.ts.map +1 -0
- package/dist/describe/no-group.js +3 -0
- package/dist/describe/no-group.js.map +1 -0
- package/dist/describe/read-controllers.d.ts +1 -1
- package/dist/describe/read-controllers.d.ts.map +1 -1
- package/dist/describe/read-controllers.js +12 -19
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/read-nest-controller-routes.d.ts +16 -0
- package/dist/describe/read-nest-controller-routes.d.ts.map +1 -0
- package/dist/describe/read-nest-controller-routes.js +117 -0
- package/dist/describe/read-nest-controller-routes.js.map +1 -0
- package/dist/describe/schema-class-of.d.ts +3 -0
- package/dist/describe/schema-class-of.d.ts.map +1 -0
- package/dist/describe/schema-class-of.js +10 -0
- package/dist/describe/schema-class-of.js.map +1 -0
- package/dist/dev/refresh-declarations.d.ts.map +1 -1
- package/dist/dev/refresh-declarations.js +4 -1
- package/dist/dev/refresh-declarations.js.map +1 -1
- package/dist/docs/declared-stored-events.d.ts +6 -2
- package/dist/docs/declared-stored-events.d.ts.map +1 -1
- package/dist/docs/declared-stored-events.js +4 -3
- package/dist/docs/declared-stored-events.js.map +1 -1
- package/dist/docs/emptily-recorded-stored-events.d.ts +6 -0
- package/dist/docs/emptily-recorded-stored-events.d.ts.map +1 -0
- package/dist/docs/emptily-recorded-stored-events.js +12 -0
- package/dist/docs/emptily-recorded-stored-events.js.map +1 -0
- package/dist/docs/refuse-unreadable-stored-events.d.ts +7 -0
- package/dist/docs/refuse-unreadable-stored-events.d.ts.map +1 -0
- package/dist/docs/refuse-unreadable-stored-events.js +27 -0
- package/dist/docs/refuse-unreadable-stored-events.js.map +1 -0
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +2 -0
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/docs/write-stored-events-lock.d.ts +3 -2
- package/dist/docs/write-stored-events-lock.d.ts.map +1 -1
- package/dist/docs/write-stored-events-lock.js +5 -2
- package/dist/docs/write-stored-events-lock.js.map +1 -1
- package/dist/file-moves/move-files.d.ts.map +1 -1
- package/dist/file-moves/move-files.js +10 -0
- package/dist/file-moves/move-files.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/aggregate-kind.d.ts.map +1 -1
- package/dist/generate/kinds/aggregate-kind.js +6 -2
- package/dist/generate/kinds/aggregate-kind.js.map +1 -1
- package/dist/generate/kinds/assert-event-store.d.ts +4 -0
- package/dist/generate/kinds/assert-event-store.d.ts.map +1 -0
- package/dist/generate/kinds/assert-event-store.js +10 -0
- package/dist/generate/kinds/assert-event-store.js.map +1 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts +9 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +49 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -0
- package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload-kind.js +9 -2
- package/dist/generate/kinds/file-upload-kind.js.map +1 -1
- package/dist/generate/kinds/form-kind.d.ts.map +1 -1
- package/dist/generate/kinds/form-kind.js +15 -11
- package/dist/generate/kinds/form-kind.js.map +1 -1
- package/dist/generate/kinds/generate-event-sourced-repository.d.ts +11 -0
- package/dist/generate/kinds/generate-event-sourced-repository.d.ts.map +1 -0
- package/dist/generate/kinds/generate-event-sourced-repository.js +48 -0
- package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -0
- package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
- package/dist/generate/kinds/generate-repository.js +5 -0
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/is-event-sourced.d.ts +9 -0
- package/dist/generate/kinds/is-event-sourced.d.ts.map +1 -0
- package/dist/generate/kinds/is-event-sourced.js +11 -0
- package/dist/generate/kinds/is-event-sourced.js.map +1 -0
- package/dist/generate/kinds/presentation/controller-source.d.ts +11 -3
- package/dist/generate/kinds/presentation/controller-source.d.ts.map +1 -1
- package/dist/generate/kinds/presentation/controller-source.js +25 -4
- package/dist/generate/kinds/presentation/controller-source.js.map +1 -1
- package/dist/generate/kinds/property-kind.d.ts +3 -0
- package/dist/generate/kinds/property-kind.d.ts.map +1 -0
- package/dist/generate/kinds/property-kind.js +51 -0
- package/dist/generate/kinds/property-kind.js.map +1 -0
- package/dist/generate/kinds/repository-kind.js +1 -1
- package/dist/generate/kinds/repository-kind.js.map +1 -1
- package/dist/generate/kinds/representation-kind.d.ts.map +1 -1
- package/dist/generate/kinds/representation-kind.js +4 -3
- package/dist/generate/kinds/representation-kind.js.map +1 -1
- package/dist/generate/kinds/route/nest-controller-vars.d.ts +11 -0
- package/dist/generate/kinds/route/nest-controller-vars.d.ts.map +1 -0
- package/dist/generate/kinds/route/nest-controller-vars.js +91 -0
- package/dist/generate/kinds/route/nest-controller-vars.js.map +1 -0
- package/dist/generate/kinds/route/nest-search-vars.d.ts +6 -0
- package/dist/generate/kinds/route/nest-search-vars.d.ts.map +1 -0
- package/dist/generate/kinds/route/nest-search-vars.js +18 -0
- package/dist/generate/kinds/route/nest-search-vars.js.map +1 -0
- package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
- package/dist/generate/kinds/route/route-vars.js +1 -9
- package/dist/generate/kinds/route/route-vars.js.map +1 -1
- package/dist/generate/kinds/route/success-status.d.ts +5 -0
- package/dist/generate/kinds/route/success-status.d.ts.map +1 -0
- package/dist/generate/kinds/route/success-status.js +11 -0
- package/dist/generate/kinds/route/success-status.js.map +1 -0
- package/dist/generate/kinds/route/write-nest-controller.d.ts +8 -0
- package/dist/generate/kinds/route/write-nest-controller.d.ts.map +1 -0
- package/dist/generate/kinds/route/write-nest-controller.js +50 -0
- package/dist/generate/kinds/route/write-nest-controller.js.map +1 -0
- package/dist/generate/kinds/route-kind.d.ts.map +1 -1
- package/dist/generate/kinds/route-kind.js +6 -1
- package/dist/generate/kinds/route-kind.js.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.js +2 -1
- package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js +5 -13
- package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/refresh-docs.d.ts.map +1 -1
- package/dist/generate/refresh-docs.js +2 -0
- package/dist/generate/refresh-docs.js.map +1 -1
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +5 -0
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +3 -1
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +7 -3
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.js +12 -6
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/files/audit-files.js +1 -1
- package/dist/init/files/audit-files.js.map +1 -1
- package/dist/init/files/auth-files.js +4 -0
- package/dist/init/files/auth-files.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +2 -0
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/platform-files.js +1 -0
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +14 -5
- package/dist/init/knip-vars.js.map +1 -1
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +10 -4
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/dependencies-against-stack.d.ts +18 -0
- package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -0
- package/dist/init/manifest/dependencies-against-stack.js +99 -0
- package/dist/init/manifest/dependencies-against-stack.js.map +1 -0
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +19 -3
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/scripts-for.js +5 -2
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +40 -30
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +14 -1
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-queue.d.ts +4 -10
- package/dist/init/stack/resolve-queue.d.ts.map +1 -1
- package/dist/init/stack/resolve-queue.js +7 -11
- package/dist/init/stack/resolve-queue.js.map +1 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +30 -9
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +2 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/template-vars.js +1 -1
- package/dist/init/template-vars.js.map +1 -1
- package/dist/init/write-type-script-configs.d.ts.map +1 -1
- package/dist/init/write-type-script-configs.js +4 -1
- package/dist/init/write-type-script-configs.js.map +1 -1
- package/dist/markers/insert-in-region.js +1 -1
- package/dist/markers/insert-in-region.js.map +1 -1
- package/dist/merge/lost/untouched-by-branch.d.ts +12 -0
- package/dist/merge/lost/untouched-by-branch.d.ts.map +1 -0
- package/dist/merge/lost/untouched-by-branch.js +22 -0
- package/dist/merge/lost/untouched-by-branch.js.map +1 -0
- package/dist/merge/lost/verify-merge.d.ts.map +1 -1
- package/dist/merge/lost/verify-merge.js +6 -1
- package/dist/merge/lost/verify-merge.js.map +1 -1
- package/dist/migration/audit-guard/append-audit-guard.d.ts +18 -0
- package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -0
- package/dist/migration/audit-guard/append-audit-guard.js +27 -0
- package/dist/migration/audit-guard/append-audit-guard.js.map +1 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.d.ts +7 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.d.ts.map +1 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.js +18 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.js.map +1 -0
- package/dist/migration/audit-guard/audit-schema-created.d.ts +3 -0
- package/dist/migration/audit-guard/audit-schema-created.d.ts.map +1 -0
- package/dist/migration/audit-guard/audit-schema-created.js +9 -0
- package/dist/migration/audit-guard/audit-schema-created.js.map +1 -0
- package/dist/migration/audit-guard/generate-guarded.d.ts +16 -0
- package/dist/migration/audit-guard/generate-guarded.d.ts.map +1 -0
- package/dist/migration/audit-guard/generate-guarded.js +22 -0
- package/dist/migration/audit-guard/generate-guarded.js.map +1 -0
- package/dist/migration/audit-guard/guard-marker.d.ts +3 -0
- package/dist/migration/audit-guard/guard-marker.d.ts.map +1 -0
- package/dist/migration/audit-guard/guard-marker.js +3 -0
- package/dist/migration/audit-guard/guard-marker.js.map +1 -0
- package/dist/migration/audit-guard/guarded-text.d.ts +5 -0
- package/dist/migration/audit-guard/guarded-text.d.ts.map +1 -0
- package/dist/migration/audit-guard/guarded-text.js +26 -0
- package/dist/migration/audit-guard/guarded-text.js.map +1 -0
- package/dist/migration/audit-guard/migrations-under.d.ts +3 -0
- package/dist/migration/audit-guard/migrations-under.d.ts.map +1 -0
- package/dist/migration/audit-guard/migrations-under.js +15 -0
- package/dist/migration/audit-guard/migrations-under.js.map +1 -0
- package/dist/migration/audit-guard/run-orm-tool.d.ts +3 -0
- package/dist/migration/audit-guard/run-orm-tool.d.ts.map +1 -0
- package/dist/migration/audit-guard/run-orm-tool.js +13 -0
- package/dist/migration/audit-guard/run-orm-tool.js.map +1 -0
- package/dist/migration/audit-guard/schemas-first.d.ts +6 -0
- package/dist/migration/audit-guard/schemas-first.d.ts.map +1 -0
- package/dist/migration/audit-guard/schemas-first.js +17 -0
- package/dist/migration/audit-guard/schemas-first.js.map +1 -0
- package/dist/migration/audit-guard/schemas-if-missing.d.ts +7 -0
- package/dist/migration/audit-guard/schemas-if-missing.d.ts.map +1 -0
- package/dist/migration/audit-guard/schemas-if-missing.js +9 -0
- package/dist/migration/audit-guard/schemas-if-missing.js.map +1 -0
- package/dist/migration/audit-guard/type-only-imports.d.ts +6 -0
- package/dist/migration/audit-guard/type-only-imports.d.ts.map +1 -0
- package/dist/migration/audit-guard/type-only-imports.js +8 -0
- package/dist/migration/audit-guard/type-only-imports.js.map +1 -0
- package/dist/migration/format-as-the-project.d.ts +4 -0
- package/dist/migration/format-as-the-project.d.ts.map +1 -0
- package/dist/migration/format-as-the-project.js +27 -0
- package/dist/migration/format-as-the-project.js.map +1 -0
- package/dist/migration/format-written-files.d.ts.map +1 -1
- package/dist/migration/format-written-files.js +2 -24
- package/dist/migration/format-written-files.js.map +1 -1
- package/dist/migration/index.d.ts +8 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +8 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/nest-controllers/controllers-file.d.ts +3 -0
- package/dist/nest-controllers/controllers-file.d.ts.map +1 -0
- package/dist/nest-controllers/controllers-file.js +5 -0
- package/dist/nest-controllers/controllers-file.js.map +1 -0
- package/dist/nest-controllers/nest-answer.d.ts +8 -0
- package/dist/nest-controllers/nest-answer.d.ts.map +1 -0
- package/dist/nest-controllers/nest-answer.js +2 -0
- package/dist/nest-controllers/nest-answer.js.map +1 -0
- package/dist/nest-controllers/nest-controller-entry.d.ts +18 -0
- package/dist/nest-controllers/nest-controller-entry.d.ts.map +1 -0
- package/dist/nest-controllers/nest-controller-entry.js +2 -0
- package/dist/nest-controllers/nest-controller-entry.js.map +1 -0
- package/dist/nest-controllers/nest-controllers-in.d.ts +6 -0
- package/dist/nest-controllers/nest-controllers-in.d.ts.map +1 -0
- package/dist/nest-controllers/nest-controllers-in.js +108 -0
- package/dist/nest-controllers/nest-controllers-in.js.map +1 -0
- package/dist/nest-controllers/nest-read-type.d.ts +12 -0
- package/dist/nest-controllers/nest-read-type.d.ts.map +1 -0
- package/dist/nest-controllers/nest-read-type.js +2 -0
- package/dist/nest-controllers/nest-read-type.js.map +1 -0
- package/dist/nest-controllers/nest-request-part.d.ts +9 -0
- package/dist/nest-controllers/nest-request-part.d.ts.map +1 -0
- package/dist/nest-controllers/nest-request-part.js +2 -0
- package/dist/nest-controllers/nest-request-part.js.map +1 -0
- package/dist/nest-controllers/parameters-of.d.ts +8 -0
- package/dist/nest-controllers/parameters-of.d.ts.map +1 -0
- package/dist/nest-controllers/parameters-of.js +32 -0
- package/dist/nest-controllers/parameters-of.js.map +1 -0
- package/dist/nest-controllers/project-files.d.ts +6 -0
- package/dist/nest-controllers/project-files.d.ts.map +1 -0
- package/dist/nest-controllers/project-files.js +2 -0
- package/dist/nest-controllers/project-files.js.map +1 -0
- package/dist/nest-controllers/read-nest-controllers.d.ts +12 -0
- package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -0
- package/dist/nest-controllers/read-nest-controllers.js +17 -0
- package/dist/nest-controllers/read-nest-controllers.js.map +1 -0
- package/dist/nest-controllers/refresh-nest-controllers.d.ts +9 -0
- package/dist/nest-controllers/refresh-nest-controllers.d.ts.map +1 -0
- package/dist/nest-controllers/refresh-nest-controllers.js +32 -0
- package/dist/nest-controllers/refresh-nest-controllers.js.map +1 -0
- package/dist/nest-controllers/render-controllers-file.d.ts +9 -0
- package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -0
- package/dist/nest-controllers/render-controllers-file.js +72 -0
- package/dist/nest-controllers/render-controllers-file.js.map +1 -0
- package/dist/platform-folders/platform-folders.d.ts.map +1 -1
- package/dist/platform-folders/platform-folders.js +10 -0
- package/dist/platform-folders/platform-folders.js.map +1 -1
- package/dist/platform-layout/platform-layout.d.ts +3 -0
- package/dist/platform-layout/platform-layout.d.ts.map +1 -1
- package/dist/platform-layout/platform-layout.js +3 -0
- package/dist/platform-layout/platform-layout.js.map +1 -1
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +22 -2
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-preset.d.ts.map +1 -1
- package/dist/presets/identity-preset.js +4 -1
- package/dist/presets/identity-preset.js.map +1 -1
- package/dist/presets/identity-refusal.d.ts.map +1 -1
- package/dist/presets/identity-refusal.js +14 -8
- package/dist/presets/identity-refusal.js.map +1 -1
- package/dist/presets/lay-out-prisma-models.d.ts +8 -0
- package/dist/presets/lay-out-prisma-models.d.ts.map +1 -0
- package/dist/presets/lay-out-prisma-models.js +51 -0
- package/dist/presets/lay-out-prisma-models.js.map +1 -0
- package/dist/presets/preset-files.d.ts.map +1 -1
- package/dist/presets/preset-files.js +6 -1
- package/dist/presets/preset-files.js.map +1 -1
- package/dist/presets/preset.d.ts +11 -0
- package/dist/presets/preset.d.ts.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +4 -0
- package/dist/run.js.map +1 -1
- package/dist/sdk/client-files.d.ts +5 -3
- package/dist/sdk/client-files.d.ts.map +1 -1
- package/dist/sdk/client-files.js +8 -3
- package/dist/sdk/client-files.js.map +1 -1
- package/dist/sdk/client-manifest.d.ts +3 -0
- package/dist/sdk/client-manifest.d.ts.map +1 -1
- package/dist/sdk/client-manifest.js +15 -2
- package/dist/sdk/client-manifest.js.map +1 -1
- package/dist/sdk/client-operation.d.ts +6 -0
- package/dist/sdk/client-operation.d.ts.map +1 -1
- package/dist/sdk/read-operation.d.ts.map +1 -1
- package/dist/sdk/read-operation.js +6 -0
- package/dist/sdk/read-operation.js.map +1 -1
- package/dist/sdk/render-orpc.d.ts +8 -0
- package/dist/sdk/render-orpc.d.ts.map +1 -0
- package/dist/sdk/render-orpc.js +42 -0
- package/dist/sdk/render-orpc.js.map +1 -0
- package/dist/sdk/render-readme.d.ts +3 -0
- package/dist/sdk/render-readme.d.ts.map +1 -1
- package/dist/sdk/render-readme.js +46 -0
- package/dist/sdk/render-readme.js.map +1 -1
- package/dist/sdk/render-trpc.d.ts +9 -0
- package/dist/sdk/render-trpc.d.ts.map +1 -0
- package/dist/sdk/render-trpc.js +36 -0
- package/dist/sdk/render-trpc.js.map +1 -0
- package/dist/sdk/rpc-packages.d.ts +7 -0
- package/dist/sdk/rpc-packages.d.ts.map +1 -0
- package/dist/sdk/rpc-packages.js +9 -0
- package/dist/sdk/rpc-packages.js.map +1 -0
- package/dist/sdk/rpc.d.ts +4 -0
- package/dist/sdk/rpc.d.ts.map +1 -0
- package/dist/sdk/rpc.js +2 -0
- package/dist/sdk/rpc.js.map +1 -0
- package/dist/sdk/write-clients.d.ts.map +1 -1
- package/dist/sdk/write-clients.js +18 -3
- package/dist/sdk/write-clients.js.map +1 -1
- package/dist/stack/alias-vars.d.ts.map +1 -1
- package/dist/stack/alias-vars.js +2 -2
- package/dist/stack/alias-vars.js.map +1 -1
- package/dist/stack/audit-vars.js +1 -1
- package/dist/stack/audit-vars.js.map +1 -1
- package/dist/stack/authentication-vars.d.ts.map +1 -1
- package/dist/stack/authentication-vars.js +8 -2
- package/dist/stack/authentication-vars.js.map +1 -1
- package/dist/stack/cache-vars.d.ts +5 -1
- package/dist/stack/cache-vars.d.ts.map +1 -1
- package/dist/stack/cache-vars.js +9 -3
- package/dist/stack/cache-vars.js.map +1 -1
- package/dist/stack/stack-vars.d.ts +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +11 -6
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/briefing-of.d.ts.map +1 -1
- package/dist/worker/briefing-of.js +2 -4
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/worker/resume-message.d.ts.map +1 -1
- package/dist/worker/resume-message.js +1 -2
- package/dist/worker/resume-message.js.map +1 -1
- package/package.json +6 -4
- package/templates/architecture/extractable.declared.spec.ts.tpl +22 -17
- package/templates/architecture/extractable.manual.spec.ts.tpl +14 -9
- package/templates/architecture/extractable.tsyringe.spec.ts.tpl +19 -14
- package/templates/background-job/wiring.manual.tpl +1 -1
- package/templates/command/wiring.manual.tpl +1 -1
- package/templates/context/module.manual.ts.tpl +52 -10
- package/templates/erasure-handler/wiring.manual.tpl +1 -1
- package/templates/event-handler/wiring.manual.tpl +1 -1
- package/templates/file-upload/wiring.manual.tpl +1 -1
- package/templates/init/docker/env.example.tpl +1 -1
- package/templates/init/e2e/auth-environment.passport.ts.tpl +6 -0
- package/templates/init/e2e/create-credentials.passport.ts.tpl +47 -0
- package/templates/init/jest.config.js.tpl +6 -0
- package/templates/init/platform/auth/authentication/actor-of-token.ts.tpl +15 -0
- package/templates/init/platform/auth/authentication/bearer-strategy.ts.tpl +29 -0
- package/templates/init/platform/auth/authentication/create-authenticator.passport.ts.tpl +13 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +55 -2
- package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +1 -1
- package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/composition/platform-error-mapper.ts.tpl +9 -0
- package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +11 -0
- package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +14 -5
- package/templates/init/platform/config/app-config.ts.tpl +2 -2
- package/templates/init/platform/config/load-config.ts.tpl +2 -2
- package/templates/init/platform/database/open-persistence.memory.ts.tpl +10 -0
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +6 -1
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +6 -1
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +12 -1
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +28 -1
- package/templates/init/platform/database/persistence.contract.spec.ts.tpl +131 -0
- package/templates/init/platform/database/persistence.memory.ts.tpl +7 -1
- package/templates/init/platform/database/persistence.orm.ts.tpl +16 -3
- package/templates/init/platform/database/schema.drizzle.ts.tpl +11 -1
- package/templates/init/platform/database/schema.prisma.tpl +5 -2
- package/templates/init/platform/database/schema.typeorm.ts.tpl +17 -3
- package/templates/init/platform/database/table-statements.drizzle.ts.tpl +36 -0
- package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +18 -6
- package/templates/init/platform/files/bind-files.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/files/create-files.ts.tpl +1 -1
- package/templates/init/platform/http/create-app-module.ts.tpl +20 -0
- package/templates/init/platform/http/start-http-server.express.ts.tpl +58 -2
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +50 -2
- package/templates/init/platform/http/start-http-server.hono.ts.tpl +60 -1
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +67 -4
- package/templates/init/platform/jobs/create-background-work.ts.tpl +2 -2
- package/templates/init/rules/infrastructure.md.tpl +3 -0
- package/templates/init/rules/presentation.md.tpl +7 -0
- package/templates/integration-event/wiring.manual.tpl +1 -1
- package/templates/integration-handler/wiring.manual.tpl +1 -1
- package/templates/job/wiring.manual.tpl +1 -1
- package/templates/nest-controller/controller.search.ts.tpl +38 -0
- package/templates/nest-controller/controller.spec.ts.tpl +57 -0
- package/templates/nest-controller/controller.ts.tpl +49 -0
- package/templates/nest-controller/upload.spec.ts.tpl +47 -0
- package/templates/nest-controller/upload.ts.tpl +25 -0
- package/templates/pipeline/biome.json.tpl +2 -2
- package/templates/pipeline/eslint.config.mjs.tpl +6 -0
- package/templates/pipeline/knip.json.tpl +4 -8
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +271 -0
- package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/integration/handlers/account-deactivated.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/member-joined.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/member-removed.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/organisation-opened.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/publishers/account-deactivated.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/delegation-granted.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/delegation-revoked.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-joined.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-removed.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-role-changed.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/organisation-opened.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +6 -0
- package/templates/presets/identity/context/infrastructure/external/crypto-invitation-tokens.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/external/environment-identity-provider-connection.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/external/keycloak-identity-provider-admin.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.mapper.prisma.ts.tpl +36 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.prisma.ts.tpl +19 -0
- package/templates/presets/identity/context/infrastructure/persistence/delegation.mapper.prisma.ts.tpl +48 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-search-members-reader.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +43 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.prisma.ts.tpl +20 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-account.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-delegation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-invitation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-member.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-organisation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-search-members-reader.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/member.mapper.prisma.ts.tpl +34 -0
- package/templates/presets/identity/context/infrastructure/persistence/organisation.mapper.prisma.ts.tpl +26 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +63 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +81 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +69 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +80 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +63 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-search-members-reader.repository.prisma.ts.tpl +82 -0
- package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/deactivate-account.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.controller.nest-routes.ts.tpl +44 -0
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +56 -0
- package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.controller.nest-routes.ts.tpl +54 -0
- package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.controller.nest-routes.ts.tpl +32 -0
- package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.controller.nest-routes.ts.tpl +43 -0
- package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.controller.nest-routes.ts.tpl +25 -0
- package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.controller.nest-routes.ts.tpl +37 -0
- package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.controller.nest-routes.ts.tpl +42 -0
- package/templates/presets/identity/context/test/integration/account.repository.contract.spec.ts.tpl +3 -3
- package/templates/presets/identity/context/test/integration/delegation.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/member.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/organisation.repository.contract.spec.ts.tpl +4 -4
- package/templates/presets/identity/context/test/integration/search-members-reader.spec.ts.tpl +8 -8
- package/templates/presets/identity/context/test/unit/__context__.module.spec.explicit.ts.tpl +108 -0
- package/templates/presets/identity/context/test/unit/accept-invitation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/change-member-role.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/deactivate-account.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/decline-invitation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/grant-delegation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/invite-member.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/open-organisation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/provision-account.controller.spec.nest-routes.ts.tpl +99 -0
- package/templates/presets/identity/context/test/unit/remove-member.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/revoke-delegation.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/revoke-invitation.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/search-members.controller.spec.nest-routes.ts.tpl +54 -0
- package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +332 -0
- package/templates/presets/identity/explicit/access-policies.wiring.tpl +16 -0
- package/templates/presets/identity/prisma/models.prisma.tpl +128 -0
- package/templates/process/timeout-job.wiring.manual.tpl +1 -1
- package/templates/property/value-object.properties.spec.ts.tpl +38 -0
- package/templates/query/search.wiring.manual.tpl +1 -1
- package/templates/query/wiring.manual.tpl +1 -1
- package/templates/repository/contract.spec.ts.tpl +1 -3
- package/templates/repository/event-sourced/contract.spec.ts.tpl +36 -0
- package/templates/repository/event-sourced/fake.ts.tpl +24 -0
- package/templates/repository/event-sourced/repository.ts.tpl +38 -0
- package/templates/repository/event-sourced-first-use.wiring.manual.tpl +4 -0
- package/templates/repository/event-sourced.wiring.tsyringe.tpl +6 -0
- package/templates/repository/first-use.wiring.manual.tpl +1 -1
- package/templates/sdk/orpc.ts.tpl +46 -0
- package/templates/sdk/trpc.ts.tpl +86 -0
- /package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/{deactivate-account.controller.ts.tpl → deactivate-account.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/accounts/provision-account/{provision-account.controller.ts.tpl → provision-account.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/{accept-invitation.controller.ts.tpl → accept-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/{decline-invitation.controller.ts.tpl → decline-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/change-member-role/{change-member-role.controller.ts.tpl → change-member-role.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/{grant-delegation.controller.ts.tpl → grant-delegation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/invite-member/{invite-member.controller.ts.tpl → invite-member.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/open-organisation/{open-organisation.controller.ts.tpl → open-organisation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/remove-member/{remove-member.controller.ts.tpl → remove-member.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/{revoke-delegation.controller.ts.tpl → revoke-delegation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/{revoke-invitation.controller.ts.tpl → revoke-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/search-members/{search-members.controller.ts.tpl → search-members.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{accept-invitation.controller.spec.ts.tpl → accept-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{change-member-role.controller.spec.ts.tpl → change-member-role.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{deactivate-account.controller.spec.ts.tpl → deactivate-account.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{decline-invitation.controller.spec.ts.tpl → decline-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{grant-delegation.controller.spec.ts.tpl → grant-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{invite-member.controller.spec.ts.tpl → invite-member.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{open-organisation.controller.spec.ts.tpl → open-organisation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{provision-account.controller.spec.ts.tpl → provision-account.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{remove-member.controller.spec.ts.tpl → remove-member.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{revoke-delegation.controller.spec.ts.tpl → revoke-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{revoke-invitation.controller.spec.ts.tpl → revoke-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{search-members.controller.spec.ts.tpl → search-members.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/worlds/{__context__.world.ts.tpl → __context__.world.declared.ts.tpl} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emptily-recorded-stored-events.js","sourceRoot":"","sources":["../../src/docs/emptily-recorded-stored-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAEvF;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,IAAY;IACtD,OAAO,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,CAC7E,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SACrB,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,WAAW,KAAK,uBAAuB,CAAC;SACpE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,YAAY,OAAO,EAAE,CAAC,CACpD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CodecDeclaration } from './declared-stored-events.js';
|
|
2
|
+
/**
|
|
3
|
+
* Refuses to record what the reader cannot read: a shape of no type found for its data or of no member would be
|
|
4
|
+
* recorded as the hash of nothing, and the lock would vouch for it. Nothing is written when one is refused.
|
|
5
|
+
*/
|
|
6
|
+
export declare function refuseUnreadableStoredEvents(declared: readonly CodecDeclaration[]): void;
|
|
7
|
+
//# sourceMappingURL=refuse-unreadable-stored-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refuse-unreadable-stored-events.d.ts","sourceRoot":"","sources":["../../src/docs/refuse-unreadable-stored-events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,GAAG,IAAI,CAaxF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CliError } from '../cli-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Refuses to record what the reader cannot read: a shape of no type found for its data or of no member would be
|
|
4
|
+
* recorded as the hash of nothing, and the lock would vouch for it. Nothing is written when one is refused.
|
|
5
|
+
*/
|
|
6
|
+
export function refuseUnreadableStoredEvents(declared) {
|
|
7
|
+
const refused = declared.flatMap((declaration) => {
|
|
8
|
+
const reason = reasonOf(declaration);
|
|
9
|
+
return reason === undefined ? [] : [`${declaration.file}:${declaration.line}: ${reason}`];
|
|
10
|
+
});
|
|
11
|
+
if (refused.length > 0) {
|
|
12
|
+
throw new CliError(`Cannot record the stored shape of ${refused.length === 1 ? 'a stored event' : 'stored events'}, nothing is written:\n ${refused.join('\n ')}`, 'Declare the stored shape as a named type with its fields in the codec file (`interface InvoiceIssuedData { readonly cents: number }`), answer it from encode, then run `ddd-ts-kit docs --stored-events` again.');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/** Why the shape of a declaration cannot be recorded, or `undefined` when it can. */
|
|
16
|
+
function reasonOf({ eventClass, payloadType, fingerprint, emptyShape }) {
|
|
17
|
+
if (payloadType === undefined) {
|
|
18
|
+
return `the encode of ${eventClass} does not name the type of the data it stores`;
|
|
19
|
+
}
|
|
20
|
+
if (fingerprint === undefined) {
|
|
21
|
+
return `${payloadType}, the data of ${eventClass}, is not declared in this file`;
|
|
22
|
+
}
|
|
23
|
+
return emptyShape === true
|
|
24
|
+
? `${payloadType}, the data of ${eventClass}, declares no member: fill its fields, or write \`type ${payloadType} = Record<string, never>\` if the event carries nothing`
|
|
25
|
+
: undefined;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=refuse-unreadable-stored-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refuse-unreadable-stored-events.js","sourceRoot":"","sources":["../../src/docs/refuse-unreadable-stored-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAAqC;IAChF,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QAC/C,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;QAErC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC,CAAC;IAC5F,CAAC,CAAC,CAAC;IAEH,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,QAAQ,CAChB,qCAAqC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,eAAe,4BAA4B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAChJ,iNAAiN,CAClN,CAAC;IACJ,CAAC;AACH,CAAC;AAED,qFAAqF;AACrF,SAAS,QAAQ,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAoB;IACtF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,iBAAiB,UAAU,+CAA+C,CAAC;IACpF,CAAC;IAED,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,GAAG,WAAW,iBAAiB,UAAU,gCAAgC,CAAC;IACnF,CAAC;IAED,OAAO,UAAU,KAAK,IAAI;QACxB,CAAC,CAAC,GAAG,WAAW,iBAAiB,UAAU,0DAA0D,WAAW,yDAAyD;QACzK,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-docs.d.ts","sourceRoot":"","sources":["../../src/docs/write-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,WAAW,EAAkB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"write-docs.d.ts","sourceRoot":"","sources":["../../src/docs/write-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,WAAW,EAAkB,MAAM,6BAA6B,CAAC;AAIzG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAa9C,sIAAsI;AACtI,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACtC;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,EACd,EAAE,OAAgB,EAAE,KAAe,EAAE,GAAE,WAAgB,GACtD,WAAW,EAAE,CAgCf"}
|
package/dist/docs/write-docs.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CliError } from '../cli-error.js';
|
|
2
2
|
import { refreshBarrels } from '../generate/refresh-barrels.js';
|
|
3
|
+
import { refreshNestControllers } from '../nest-controllers/refresh-nest-controllers.js';
|
|
3
4
|
import { replaceRegion } from '../markers/index.js';
|
|
4
5
|
import { readTemplate, renderTemplate } from '../templating/index.js';
|
|
5
6
|
import { brokerStrategy } from './broker-strategy.js';
|
|
@@ -28,6 +29,7 @@ export function writeDocs(ws, config, { earlier = 'move', scope = 'whole' } = {}
|
|
|
28
29
|
writeContextMap(ws, contextMapLines(contexts));
|
|
29
30
|
writePrivacyRegister(ws, config, contexts);
|
|
30
31
|
const kept = refreshBarrels(ws, config, earlier);
|
|
32
|
+
refreshNestControllers(ws, config);
|
|
31
33
|
writeOpenApiDocuments(ws, config);
|
|
32
34
|
writeCodeOwners(ws, config, contexts);
|
|
33
35
|
if (scope === 'whole') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-docs.js","sourceRoot":"","sources":["../../src/docs/write-docs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAA8C,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eA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ClC,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEtC,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;QACtB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,yEAAyE;IACzE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACnC,EAAE,CAAC,MAAM,CACP,kBAAkB,EAClB,cAAc,CAAC,gCAAgC,EAAE,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CACxG,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,eAAe,CAAC,EAAa,EAAE,KAAwB;IAC9D,MAAM,QAAQ,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,aAAa,CAAC,QAAQ,IAAI,YAAY,CAAC,yBAAyB,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IAEtG,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,QAAQ,CAChB,GAAG,WAAW,2CAA2C,EACzD,gKAAgK,CACjK,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IAC/B,CAAC;AACH,CAAC"}
|
|
@@ -2,12 +2,13 @@ import type { Config } from '../config/index.js';
|
|
|
2
2
|
import type { Workspace } from '../workspace/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* `ddd-ts-kit docs --stored-events`: records in `stored-events.lock.json` the shape of each
|
|
5
|
-
* version of a stored event declared in the codecs of `infrastructure/persistence
|
|
5
|
+
* version of a stored event declared in the codecs of `infrastructure/persistence/`, of the context and of each module of its model. Run when a
|
|
6
6
|
* version starts being stored where events are kept (before the release that ships it): from
|
|
7
7
|
* then on its shape is the one stored. A version already recorded is never rewritten, so a
|
|
8
8
|
* changed shape stays visible to `event-sourcing/upcaster-required`, save the fingerprint 0.82.0
|
|
9
9
|
* and earlier recorded for the same shape, recorded again as it reads now; a project without
|
|
10
|
-
* stored events gets no lock.
|
|
10
|
+
* stored events gets no lock. A codec whose data type is not found or declares no member is refused, with
|
|
11
|
+
* its file and the reason, and nothing is recorded: the hash of nothing would vouch for no shape. `docs --check` fails while a declared version is not recorded.
|
|
11
12
|
*/
|
|
12
13
|
export declare function writeStoredEventsLock(ws: Workspace, config: Config, contexts: readonly string[]): void;
|
|
13
14
|
//# sourceMappingURL=write-stored-events-lock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-stored-events-lock.d.ts","sourceRoot":"","sources":["../../src/docs/write-stored-events-lock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"write-stored-events-lock.d.ts","sourceRoot":"","sources":["../../src/docs/write-stored-events-lock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CA8BtG"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { readStoredEventsLock } from '../check/event-sourcing/read-stored-events-lock.js';
|
|
2
2
|
import { STORED_EVENTS_LOCK } from '../check/event-sourcing/stored-events-lock-file.js';
|
|
3
3
|
import { declaredStoredEvents } from './declared-stored-events.js';
|
|
4
|
+
import { refuseUnreadableStoredEvents } from './refuse-unreadable-stored-events.js';
|
|
4
5
|
/**
|
|
5
6
|
* `ddd-ts-kit docs --stored-events`: records in `stored-events.lock.json` the shape of each
|
|
6
|
-
* version of a stored event declared in the codecs of `infrastructure/persistence
|
|
7
|
+
* version of a stored event declared in the codecs of `infrastructure/persistence/`, of the context and of each module of its model. Run when a
|
|
7
8
|
* version starts being stored where events are kept (before the release that ships it): from
|
|
8
9
|
* then on its shape is the one stored. A version already recorded is never rewritten, so a
|
|
9
10
|
* changed shape stays visible to `event-sourcing/upcaster-required`, save the fingerprint 0.82.0
|
|
10
11
|
* and earlier recorded for the same shape, recorded again as it reads now; a project without
|
|
11
|
-
* stored events gets no lock.
|
|
12
|
+
* stored events gets no lock. A codec whose data type is not found or declares no member is refused, with
|
|
13
|
+
* its file and the reason, and nothing is recorded: the hash of nothing would vouch for no shape. `docs --check` fails while a declared version is not recorded.
|
|
12
14
|
*/
|
|
13
15
|
export function writeStoredEventsLock(ws, config, contexts) {
|
|
14
16
|
const declared = declaredStoredEvents(ws, config, contexts);
|
|
17
|
+
refuseUnreadableStoredEvents(declared);
|
|
15
18
|
const recorded = readStoredEventsLock(ws.root);
|
|
16
19
|
const exists = ws.exists(STORED_EVENTS_LOCK);
|
|
17
20
|
if (declared.length === 0 && !exists) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-stored-events-lock.js","sourceRoot":"","sources":["../../src/docs/write-stored-events-lock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAGrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"write-stored-events-lock.js","sourceRoot":"","sources":["../../src/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"file":"move-files.d.ts","sourceRoot":"","sources":["../../src/file-moves/move-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"move-files.d.ts","sourceRoot":"","sources":["../../src/file-moves/move-files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAK5C,iCAAiC;AACjC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,CAqC9F"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { aliasRoots } from '../alias/index.js';
|
|
2
|
+
import { movedBaselineText } from '../check/baseline/moved-baseline-text.js';
|
|
3
|
+
import { BASELINE_FILE } from '../check/baseline/read-baseline.js';
|
|
2
4
|
import { withMovedImports } from '../platform-folders/with-moved-imports.js';
|
|
3
5
|
import { projectSources } from '../refusals/project-sources.js';
|
|
4
6
|
const EXTENSION = /\.(?:ts|tsx|mts)$/;
|
|
@@ -32,6 +34,14 @@ export function moveFiles(ws, config, moved) {
|
|
|
32
34
|
ws.writeAsIs(file, next);
|
|
33
35
|
return [file];
|
|
34
36
|
});
|
|
37
|
+
followInBaseline(ws, moved);
|
|
35
38
|
return { moved, rewritten: [...rewrittenMoved, ...rewrittenOthers] };
|
|
36
39
|
}
|
|
40
|
+
/** The errors the baseline of the project records for a moved file follow it to its new path. */
|
|
41
|
+
function followInBaseline(ws, moved) {
|
|
42
|
+
const baseline = movedBaselineText(ws.read(BASELINE_FILE), moved);
|
|
43
|
+
if (baseline !== undefined) {
|
|
44
|
+
ws.writeAsIs(BASELINE_FILE, baseline);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
37
47
|
//# sourceMappingURL=move-files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"move-files.js","sourceRoot":"","sources":["../../src/file-moves/move-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"move-files.js","sourceRoot":"","sources":["../../src/file-moves/move-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAI7D,MAAM,SAAS,GAAG,mBAAmB,CAAC;AACtC,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAS9C;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EAAa,EAAE,MAAc,EAAE,KAA0B;IACjF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAEvE,MAAM,UAAU,GAAG;QACjB,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;QACzB,KAAK,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,C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,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;IAEL,gBAAgB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAE5B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,eAAe,CAAC,EAAE,CAAC;AACvE,CAAC;AAED,iGAAiG;AACjG,SAAS,gBAAgB,CAAC,EAAa,EAAE,KAA0B;IACjE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,CAAC;IAElE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,EAAE,CAAC,SAAS,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
|
package/dist/generate/kind.d.ts
CHANGED
|
@@ -79,6 +79,8 @@ export interface KindFlags {
|
|
|
79
79
|
readonly cache?: string;
|
|
80
80
|
/** An aggregate keeps its state as the stream of its events. */
|
|
81
81
|
readonly eventSourced: boolean;
|
|
82
|
+
/** The fact an event-sourced aggregate is born with, as `--birth <Fact>`; `Created` when absent. */
|
|
83
|
+
readonly birth?: string;
|
|
82
84
|
/** The module of the model of the context the files of its layers and their specs are written in. */
|
|
83
85
|
readonly module?: string;
|
|
84
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../src/generate/kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,qEAAqE;IACrE,QAAQ,CAA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AC/B,oGAAoG;IACpG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,qGAAqG;IACrG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,2GAA2G;IAC3G,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,4FAA4F;IAC5F,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjD,8KAA8K;IAC9K,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,+GAA+G;IAC/G,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/aggregate-kind.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aggregate-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/aggregate-kind.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAOpC,eAAO,MAAM,aAAa,EAAE,IAqC3B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CliError } from '../../cli-error.js';
|
|
1
2
|
import { refreshContextDoc } from '../../docs/refresh-context-doc.js';
|
|
2
3
|
import { concept } from '../concept.js';
|
|
3
4
|
import { emit } from '../emit.js';
|
|
@@ -9,14 +10,17 @@ import { writeEventSourcedAggregate } from './write-event-sourced-aggregate.js';
|
|
|
9
10
|
export const aggregateKind = {
|
|
10
11
|
name: 'aggregate',
|
|
11
12
|
aliases: [],
|
|
12
|
-
usage: 'aggregate <context> <Name> [--event-sourced] [--term "<Term>=<meaning>"]...',
|
|
13
|
-
summary: 'An aggregate root with create and rehydrate factories, its test data builder and its spec; with --event-sourced, its state is the replay of its events, with its birth event and the codec of its stored events.',
|
|
13
|
+
usage: 'aggregate <context> <Name> [--event-sourced [--birth <Event>]] [--term "<Term>=<meaning>"]...',
|
|
14
|
+
summary: 'An aggregate root with create and rehydrate factories, its test data builder and its spec; with --event-sourced, its state is the replay of its events, with its birth event (Created, or the fact --birth names) and the codec of its stored events.',
|
|
14
15
|
positionals: ['context', 'Name'],
|
|
15
16
|
writesShared: false,
|
|
16
17
|
run: (request) => {
|
|
17
18
|
const scope = openScope(request);
|
|
18
19
|
learnTerms(scope);
|
|
19
20
|
const name = concept(scope, request.args[1] ?? '', { what: 'aggregate', strip: ['aggregate'] });
|
|
21
|
+
if (scope.flags.birth !== undefined && !scope.flags.eventSourced) {
|
|
22
|
+
throw new CliError('--birth names the birth event of an event-sourced aggregate.', 'Add --event-sourced, or drop --birth: a plain aggregate has no birth event.');
|
|
23
|
+
}
|
|
20
24
|
if (scope.flags.eventSourced) {
|
|
21
25
|
writeEventSourcedAggregate(scope, name);
|
|
22
26
|
refreshContextDoc(scope.ws, scope.config, scope.context.kebab);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/aggregate-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,EAAE;IACX,KAAK,EAAE
|
|
1
|
+
{"version":3,"file":"aggregate-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/aggregate-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,+FAA+F;IACtG,OAAO,EACL,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AAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Scope } from '../scope.js';
|
|
2
|
+
/** An event-sourced aggregate is loaded and saved through the stores `init --event-sourcing on` wires: without them it could not run. */
|
|
3
|
+
export declare function assertEventStore(scope: Scope): void;
|
|
4
|
+
//# sourceMappingURL=assert-event-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-event-store.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/assert-event-store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,yIAAyI;AACzI,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CASnD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CliError } from '../../cli-error.js';
|
|
2
|
+
import { CONFIG_FILE } from '../../config/index.js';
|
|
3
|
+
/** An event-sourced aggregate is loaded and saved through the stores `init --event-sourcing on` wires: without them it could not run. */
|
|
4
|
+
export function assertEventStore(scope) {
|
|
5
|
+
if (scope.config.stack.eventSourcing === 'on') {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
throw new CliError('This project has no event store (stack.eventSourcing is "off").', `Run \`ddd-ts-kit init --force --event-sourcing on\` to wire the event store in ${CONFIG_FILE} and src/platform/event-sourcing/ (the tables of the event_store schema, the stores, the keys of the data subjects and the cipher), then generate the aggregate again.`);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=assert-event-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-event-store.js","sourceRoot":"","sources":["../../../src/generate/kinds/assert-event-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,yIAAyI;AACzI,MAAM,UAAU,gBAAgB,CAAC,KAAY;IAC3C,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,iEAAiE,EACjE,kFAAkF,WAAW,wKAAwK,CACtQ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Scope } from '../../scope.js';
|
|
2
|
+
import type { ControllerPlan } from '../route/controller-plan.js';
|
|
3
|
+
/**
|
|
4
|
+
* Writes the Nest controller of an upload in its folder, its group when it is new, and its spec:
|
|
5
|
+
* `@Upload()` hands its method the file the kit streams, and the generated list of the context
|
|
6
|
+
* names it for Nest to build.
|
|
7
|
+
*/
|
|
8
|
+
export declare function writeNestUploadController(scope: Scope, plan: ControllerPlan): void;
|
|
9
|
+
//# sourceMappingURL=write-nest-upload-controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-nest-upload-controller.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/file-upload/write-nest-upload-controller.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI/D;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,GAAG,IAAI,CA8BlF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { emit } from '../../emit.js';
|
|
2
|
+
import { named } from '../../named.js';
|
|
3
|
+
import { vars } from '../../vars.js';
|
|
4
|
+
import { controllerImports } from '../route/controller-imports.js';
|
|
5
|
+
import { groupVars } from '../route/group-vars.js';
|
|
6
|
+
import { nestControllerVars } from '../route/nest-controller-vars.js';
|
|
7
|
+
/**
|
|
8
|
+
* Writes the Nest controller of an upload in its folder, its group when it is new, and its spec:
|
|
9
|
+
* `@Upload()` hands its method the file the kit streams, and the generated list of the context
|
|
10
|
+
* names it for Nest to build.
|
|
11
|
+
*/
|
|
12
|
+
export function writeNestUploadController(scope, plan) {
|
|
13
|
+
const { name, group, folder } = plan;
|
|
14
|
+
const route = nestControllerVars(scope, { ...plan, withMapper: false, withSerializer: false });
|
|
15
|
+
// The file is the request: no class of params, body or answer stands next to the controller.
|
|
16
|
+
const { message, group: groupImport } = controllerImports(scope, plan);
|
|
17
|
+
const context = vars(scope, {
|
|
18
|
+
name: named(name),
|
|
19
|
+
route: { ...route, imports: [message, ...groupImport].join('\n') },
|
|
20
|
+
upload: uploadVars(plan),
|
|
21
|
+
...(group === undefined
|
|
22
|
+
? {}
|
|
23
|
+
: {
|
|
24
|
+
group: groupVars({
|
|
25
|
+
name: group.name,
|
|
26
|
+
prefix: group.prefix,
|
|
27
|
+
tag: scope.context.kebab,
|
|
28
|
+
access: 'authenticated',
|
|
29
|
+
}),
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
const outputs = [
|
|
33
|
+
...(group === undefined || group.exists ? [] : [['controller/group.ts.tpl', `${group.file}.ts`]]),
|
|
34
|
+
['nest-controller/upload.ts.tpl', `${folder}/${name.kebab}.controller.ts`],
|
|
35
|
+
['nest-controller/upload.spec.ts.tpl', `test/unit/${name.kebab}.controller.spec.ts`],
|
|
36
|
+
];
|
|
37
|
+
emit(scope, context, outputs);
|
|
38
|
+
}
|
|
39
|
+
/** The imports of the controller, and the parameters of its method: the file, and the caller of a protected use case. */
|
|
40
|
+
function uploadVars({ group, useCase }) {
|
|
41
|
+
return {
|
|
42
|
+
kitImports: [...(group === undefined ? ['Public'] : []), 'type IncomingFile'].join(', '),
|
|
43
|
+
bridgeImports: [...(useCase.isProtected ? ['CurrentActor'] : []), 'KitRoute', 'KitRoutes', 'Upload'].join(', '),
|
|
44
|
+
kernelImports: useCase.isProtected ? 'CommandBus, type Actor' : 'CommandBus',
|
|
45
|
+
parameters: ['@Upload() file: IncomingFile', ...(useCase.isProtected ? ['@CurrentActor() actor: Actor'] : [])].join(', '),
|
|
46
|
+
arguments: useCase.isProtected ? 'actor, file' : 'file',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=write-nest-upload-controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-nest-upload-controller.js","sourceRoot":"","sources":["../../../../src/generate/kinds/file-upload/write-nest-upload-controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAY,EAAE,IAAoB;IAC1E,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrC,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;IAE/F,6FAA6F;IAC7F,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAEvE,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE;QAC1B,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC;QACjB,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC,OAAO,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AAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC/G,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,YAAY;QAC5E,UAAU,EAAE,CAAC,8BAA8B,EAAE,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CACjH,IAAI,CACL;QACD,SAAS,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM;KACxD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/file-upload-kind.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"file-upload-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/file-upload-kind.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAcpC,eAAO,MAAM,cAAc,EAAE,IA4C5B,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { openScope } from '../open-scope.js';
|
|
|
9
9
|
import { specVars } from '../spec-vars.js';
|
|
10
10
|
import { vars } from '../vars.js';
|
|
11
11
|
import { wire } from '../wire.js';
|
|
12
|
+
import { writeNestUploadController } from './file-upload/write-nest-upload-controller.js';
|
|
12
13
|
import { writeUploadController } from './file-upload/write-upload-controller.js';
|
|
13
14
|
import { findUseCase } from './route/find-use-case.js';
|
|
14
15
|
import { parseEndpoint } from './route/parse-endpoint.js';
|
|
@@ -17,7 +18,7 @@ export const fileUploadKind = {
|
|
|
17
18
|
name: 'file-upload',
|
|
18
19
|
aliases: [],
|
|
19
20
|
usage: 'file-upload <context> <UseCaseName> --path <path> (--permission <aggregate>.<action> [--grant <role>] | --public) [--method <POST|PUT>] [--group <Name>]',
|
|
20
|
-
summary: 'An upload: a controller that declares the file it receives (size and media types in the contract, checked as it streams), the command that carries it as a FileUpload (staged by the command bus before the transaction), the handler that records it and promotes it with the commit, and their specs. Needs "stack.storage".',
|
|
21
|
+
summary: 'An upload: a controller that declares the file it receives (`@Upload()` of a Nest controller; size and media types in the contract, checked as it streams), the command that carries it as a FileUpload (staged by the command bus before the transaction), the handler that records it and promotes it with the commit, and their specs. Needs "stack.storage".',
|
|
21
22
|
positionals: ['context', 'UseCaseName'],
|
|
22
23
|
writesShared: true,
|
|
23
24
|
run: (request) => {
|
|
@@ -40,7 +41,13 @@ export const fileUploadKind = {
|
|
|
40
41
|
const flags = { ...request.flags, method: request.flags.method ?? 'POST', command: true, query: false };
|
|
41
42
|
const endpoint = parseEndpoint(flags);
|
|
42
43
|
const useCase = findUseCase(scope, name, flags);
|
|
43
|
-
|
|
44
|
+
const plan = planController(scope, { name, endpoint, useCase });
|
|
45
|
+
if (scope.config.stack.routes === 'nest') {
|
|
46
|
+
writeNestUploadController(scope, plan);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
writeUploadController(scope, plan);
|
|
50
|
+
}
|
|
44
51
|
},
|
|
45
52
|
};
|
|
46
53
|
function assertFileStack(scope) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/file-upload-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAg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QAC1D,CAAC,CAAC,wDAAwD,EAC5D,2GAA2G,WAAW,oDAAoD,CAC3K,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/form-kind.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"form-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/form-kind.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAMpC,eAAO,MAAM,QAAQ,EAAE,IA2CtB,CAAC"}
|
|
@@ -4,35 +4,39 @@ import { label } from '../label.js';
|
|
|
4
4
|
import { openScope } from '../open-scope.js';
|
|
5
5
|
import { controllerOf } from './presentation/controller-of.js';
|
|
6
6
|
import { controllerSource } from './presentation/controller-source.js';
|
|
7
|
-
const HINTS = `/** How the body of the route is entered, served as a form at GET /forms/<operationId> for the caller who asks. */
|
|
8
|
-
const form = defineForm<Infer<typeof body>>({
|
|
9
|
-
// TODO(domain): name the permission of the use case as its @Requires does (requires: { permission, subject, context }), so that only who may run it reads the form.
|
|
10
|
-
// TODO(domain): group the fields (groups), and say per field what the schema cannot: its widget, the GET route its options come from (lookup), when it shows (visibleWhen) and when it is required (requiredWhen).
|
|
11
|
-
});
|
|
12
|
-
`;
|
|
13
7
|
export const formKind = {
|
|
14
8
|
name: 'form',
|
|
15
9
|
aliases: [],
|
|
16
10
|
usage: 'form <context> <UseCase>',
|
|
17
|
-
summary: 'The form of a controller that receives a body: `defineForm` hints next to its schemas, named in `@Controller` as `form`, served at GET /forms/<operationId> when "stack.forms" is "on". Fields, constraints and options come from the body schema, read-only and hidden fields from its field access.',
|
|
11
|
+
summary: 'The form of a controller that receives a body: `defineForm` hints next to its schemas, named in `@Controller` (`@KitRoute` of a Nest controller) as `form`, served at GET /forms/<operationId> when "stack.forms" is "on". Fields, constraints and options come from the body schema, read-only and hidden fields from its field access.',
|
|
18
12
|
positionals: ['context', 'UseCase'],
|
|
19
13
|
writesShared: false,
|
|
20
14
|
run: (request) => {
|
|
21
15
|
const scope = openScope(request);
|
|
22
16
|
const useCase = label(scope, request.args[1] ?? '', { what: 'use case', strip: ['controller'] });
|
|
23
17
|
const { file, source } = controllerOf(scope, useCase);
|
|
24
|
-
|
|
18
|
+
const nestBody = controllerSource.nestBody(source);
|
|
19
|
+
if (nestBody === undefined && !/^\s*body[,:]/m.test(source)) {
|
|
25
20
|
throw new CliError(`${useCase.pascal}Controller receives no body.`, 'A form describes the body of a route: give the controller a body schema first.');
|
|
26
21
|
}
|
|
27
22
|
if (/\bconst form = defineForm\b/.test(source)) {
|
|
28
23
|
throw new CliError(`${useCase.pascal}Controller already declares its form.`, 'Edit its hints in the controller.');
|
|
29
24
|
}
|
|
30
|
-
const hinted = controllerSource.withOption(controllerSource.beforeController(source,
|
|
31
|
-
const
|
|
32
|
-
scope.ws.update(file,
|
|
25
|
+
const hinted = controllerSource.withOption(controllerSource.beforeController(source, hints(nestBody ?? 'Infer<typeof body>')), 'form,');
|
|
26
|
+
const withForm = controllerSource.withImport(hinted, 'defineForm', '@ddd-ts-kit/http');
|
|
27
|
+
scope.ws.update(file, nestBody === undefined ? controllerSource.withImport(withForm, 'type Infer', '@ddd-ts-kit/validation') : withForm);
|
|
33
28
|
if (scope.config.stack.forms !== 'on') {
|
|
34
29
|
scope.ws.note(`The form is served once "stack.forms" is "on" in ${CONFIG_FILE}: run \`ddd-ts-kit init --force --forms on\`.`);
|
|
35
30
|
}
|
|
36
31
|
},
|
|
37
32
|
};
|
|
33
|
+
/** The hints of the form, typed by the shape of the body: `Infer<typeof body>` of a schema, or the DTO class a Nest controller takes. */
|
|
34
|
+
function hints(shape) {
|
|
35
|
+
return `/** How the body of the route is entered, served as a form at GET /forms/<operationId> for the caller who asks. */
|
|
36
|
+
const form = defineForm<${shape}>({
|
|
37
|
+
// TODO(domain): name the permission of the use case as its @Requires does (requires: { permission, subject, context }), so that only who may run it reads the form.
|
|
38
|
+
// TODO(domain): group the fields (groups), and say per field what the schema cannot: its widget, the GET route its options come from (lookup), when it shows (visibleWhen) and when it is required (requiredWhen).
|
|
39
|
+
});
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
38
42
|
//# sourceMappingURL=form-kind.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/form-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,MAAM,
|
|
1
|
+
{"version":3,"file":"form-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/form-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,MAAM,CAAC,MAAM,QAAQ,GAAS;IAC5B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,0BAA0B;IACjC,OAAO,EACL,0UAA0U;IAC5U,WAAW,EAAE,CAAC,SAAS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Y,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC,QAAQ,CAClH,CAAC;QAEF,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACtC,KAAK,CAAC,EAAE,CAAC,IAAI,CACX,oDAAoD,WAAW,+CAA+C,CAC/G,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC;AAEF,yIAAyI;AACzI,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO;0BACiB,KAAK;;;;CAI9B,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Name } from '../../naming/index.js';
|
|
2
|
+
import type { RenderContext } from '../../templating/index.js';
|
|
3
|
+
import type { Scope } from '../scope.js';
|
|
4
|
+
/**
|
|
5
|
+
* The repository of an event-sourced aggregate: the port, an adapter that delegates to
|
|
6
|
+
* `EventSourcedRepository` of the kernel over the `EventStore` and the cipher the platform binds
|
|
7
|
+
* with the codec of the stored events, the fake that is that adapter over the in-memory stores,
|
|
8
|
+
* and the contract suite run on both. No table and no row mapper: the events are the storage.
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateEventSourcedRepository(scope: Scope, aggregate: Name): RenderContext;
|
|
11
|
+
//# sourceMappingURL=generate-event-sourced-repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-event-sourced-repository.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/generate-event-sourced-repository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAKtC;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,GAAG,aAAa,CA2B3F"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CliError } from '../../cli-error.js';
|
|
2
|
+
import { emit } from '../emit.js';
|
|
3
|
+
import { named } from '../named.js';
|
|
4
|
+
import { vars } from '../vars.js';
|
|
5
|
+
import { wire } from '../wire.js';
|
|
6
|
+
import { assertEventStore } from './assert-event-store.js';
|
|
7
|
+
/**
|
|
8
|
+
* The repository of an event-sourced aggregate: the port, an adapter that delegates to
|
|
9
|
+
* `EventSourcedRepository` of the kernel over the `EventStore` and the cipher the platform binds
|
|
10
|
+
* with the codec of the stored events, the fake that is that adapter over the in-memory stores,
|
|
11
|
+
* and the contract suite run on both. No table and no row mapper: the events are the storage.
|
|
12
|
+
*/
|
|
13
|
+
export function generateEventSourcedRepository(scope, aggregate) {
|
|
14
|
+
assertEventStore(scope);
|
|
15
|
+
assertCodec(scope, aggregate);
|
|
16
|
+
assertNoColumns(scope);
|
|
17
|
+
const context = vars(scope, { aggregate: named(aggregate) });
|
|
18
|
+
emit(scope, context, [
|
|
19
|
+
['repository/repository.ts.tpl', `domain/repositories/${aggregate.kebab}.repository.ts`],
|
|
20
|
+
[
|
|
21
|
+
'repository/event-sourced/repository.ts.tpl',
|
|
22
|
+
`infrastructure/persistence/event-store-${aggregate.kebab}.repository.ts`,
|
|
23
|
+
],
|
|
24
|
+
['repository/event-sourced/fake.ts.tpl', `test/fakes/${aggregate.kebab}.repository.fake.ts`],
|
|
25
|
+
[
|
|
26
|
+
'repository/event-sourced/contract.spec.ts.tpl',
|
|
27
|
+
`test/integration/${aggregate.kebab}.repository.contract.spec.ts`,
|
|
28
|
+
],
|
|
29
|
+
]);
|
|
30
|
+
wire(scope, 'repository/event-sourced', context);
|
|
31
|
+
scope.ws.note(`${aggregate.pascal} is event-sourced: EventStore${aggregate.pascal}Repository delegates to EventSourcedRepository over the EventStore the platform binds, with the codec of infrastructure/persistence/${aggregate.kebab}-events.mapper.ts; there is no table. Fake${aggregate.pascal}Repository is that adapter over the in-memory event store, and the repository contract (test/integration) runs on both once its \`mutate\` records an event. The event store keeps no tenant: a stream is \`${scope.context.kebab}.${aggregate.kebab}-<id>\`, so decide who may load an id in the application layer.`);
|
|
32
|
+
return context;
|
|
33
|
+
}
|
|
34
|
+
function assertCodec(scope, aggregate) {
|
|
35
|
+
const codec = `${scope.dir}/infrastructure/persistence/${aggregate.kebab}-events.mapper.ts`;
|
|
36
|
+
if (scope.ws.exists(codec)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
throw new CliError(`${aggregate.pascal} is event-sourced but the codec of its stored events is missing (${codec}).`, `Write it (it exports \`${aggregate.camel}Events\`, a StoredEventTypes with one defineStoredEvent per event, as \`ddd-ts-kit generate aggregate ${scope.context.kebab} ${aggregate.pascal} --event-sourced\` writes it), then generate the repository again.`);
|
|
40
|
+
}
|
|
41
|
+
/** The columns of a table are rows: an event-sourced aggregate has none, its personal values are sealed in its events. */
|
|
42
|
+
function assertNoColumns(scope) {
|
|
43
|
+
if (scope.flags.personal === undefined) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
throw new CliError('--personal declares columns of a table, and an event-sourced aggregate has none.', 'Write the personal values of its events with `personalData(subjectId, value)` in the codec of its stored events (docs/concepts/event-sourcing.md of ddd-ts-kit, "Personal data").');
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=generate-event-sourced-repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-event-sourced-repository.js","sourceRoot":"","sources":["../../../src/generate/kinds/generate-event-sourced-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE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,IAAI,QAAQ,CAChB,GAAG,SAAS,CAAC,MAAM,oEAAoE,KAAK,IAAI,EAChG,0BAA0B,SAAS,CAAC,KAAK,yGAAyG,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,SAAS,CAAC,MAAM,oEAAoE,CAC9P,CAAC;AACJ,CAAC;AAED,0HAA0H;AAC1H,SAAS,eAAe,CAAC,KAAY;IACnC,IAAI,KAAK,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QACvC,OAAO;IACT,CAAC;IAED,MAAM,IAAI,QAAQ,CAChB,kFAAkF,EAClF,mLAAmL,CACpL,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-repository.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/generate-repository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"generate-repository.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/generate-repository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAUtC,4HAA4H;AAC5H,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,GAAG,aAAa,CA6B/E"}
|
|
@@ -2,12 +2,17 @@ import { emit } from '../emit.js';
|
|
|
2
2
|
import { named } from '../named.js';
|
|
3
3
|
import { vars } from '../vars.js';
|
|
4
4
|
import { wire } from '../wire.js';
|
|
5
|
+
import { generateEventSourcedRepository } from './generate-event-sourced-repository.js';
|
|
6
|
+
import { isEventSourced } from './is-event-sourced.js';
|
|
5
7
|
import { declareStorage } from './declare-storage.js';
|
|
6
8
|
import { personalVars } from './personal-data/personal-vars.js';
|
|
7
9
|
import { REPOSITORY_ADAPTERS } from './repository-adapter.js';
|
|
8
10
|
import { repositoryPrefix } from './repository-prefix.js';
|
|
9
11
|
/** The port of the repository of an aggregate, the adapter of the ORM of the stack, the fake and the contract both pass. */
|
|
10
12
|
export function generateRepository(scope, aggregate) {
|
|
13
|
+
if (isEventSourced(scope, aggregate)) {
|
|
14
|
+
return generateEventSourcedRepository(scope, aggregate);
|
|
15
|
+
}
|
|
11
16
|
const adapter = REPOSITORY_ADAPTERS[scope.config.stack.orm];
|
|
12
17
|
const context = vars(scope, {
|
|
13
18
|
aggregate: named(aggregate),
|