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
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,480 @@ What each version changes for someone who uses the kit. The packages of `package
|
|
|
4
4
|
together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
|
|
5
5
|
list the pull requests behind it.
|
|
6
6
|
|
|
7
|
+
## 0.92.0
|
|
8
|
+
|
|
9
|
+
**What a method of a Nest controller takes is its signature too: `@Body() body: IssueInvoiceBody` is read into the generated `<context>.controllers.ts`, and `@KitRoute` no longer gives `request`.**
|
|
10
|
+
`withAnswers` of `@ddd-ts-kit/http/nest` becomes `withSignatures(controller, { method: { params,
|
|
11
|
+
query, headers, body, answer } })`: the DTO class of each part of the request a parameter takes
|
|
12
|
+
whole, as `ddd-ts-kit` reads it from the source, and the answer. The bridge validates each part by
|
|
13
|
+
that class, so a route no longer depends on `emitDecoratorMetadata`, which tsx and esbuild do not
|
|
14
|
+
write: `npm run dev` serves the same validation as the build. A generated Nest controller no longer
|
|
15
|
+
builds `paramsSchema` nor `bodySchema`, and its `@KitRoute` holds the refusal codes alone.
|
|
16
|
+
`nest/controllers-current` also reports a part taken whole by a type the kit cannot read (an inline
|
|
17
|
+
type, an interface, a `Record`) that `request` of `@KitRoute` does not give.
|
|
18
|
+
|
|
19
|
+
To move: replace `withAnswers(Controller, { method: X })` by `withSignatures(Controller, { method:
|
|
20
|
+
{ answer: X } })` where it was written by hand; a project on `--routes nest` runs `npx ddd-ts-kit
|
|
21
|
+
docs`, then drops `request` and the schemas it built from its generated controllers.
|
|
22
|
+
|
|
23
|
+
**Under `"stack.routes": "nest"`, every route generator writes the Nest form: a search, an upload, a form and a representation.**
|
|
24
|
+
`generate route` writes a search as a Nest controller, its page given in `@KitRoute` (`request:
|
|
25
|
+
{ query }`, `response.body: pageSchemaOf(line)`), where it used to refuse. `generate file-upload`
|
|
26
|
+
writes a Nest controller whose method takes `@Upload() file: IncomingFile`, the new parameter
|
|
27
|
+
decorator of `@ddd-ts-kit/http/nest`: the kit streams the file and checks it against the `upload`
|
|
28
|
+
of `@KitRoute`, which now takes `upload` and `form` as `@Controller` of the kit does; a method that
|
|
29
|
+
takes `@Upload()` with no `upload` declared is refused when the routes are built. `generate form`
|
|
30
|
+
and `generate representation` write their options at the top of `@KitRoute`, the form typed by the
|
|
31
|
+
body class. `nest/no-parallel-pipeline` points `@UploadedFile()` and `ParseFilePipe` at `@Upload()`.
|
|
32
|
+
`nest/controllers-current` reads `request: { query }` written short.
|
|
33
|
+
|
|
34
|
+
**The identity preset is written for Nest controllers too: `init --preset identity --http nest --routes nest`.**
|
|
35
|
+
Under `"stack.routes": "nest"`, its twelve routes are Nest controllers built by Nest with the buses it
|
|
36
|
+
injects: their parts and their answers read from their signatures into the generated
|
|
37
|
+
`identity.controllers.ts`, their summaries, descriptions and refusal codes in `@KitRoute`, the shared
|
|
38
|
+
invitation token documented once as before. The module of the context lists those controllers, and
|
|
39
|
+
its spec mounts them through the pipeline of the kit, as the spec of each controller does. A
|
|
40
|
+
project on `--routes controllers` gets the controllers of the kit as before.
|
|
41
|
+
|
|
42
|
+
**A Nest project validates with class-validator and writes its routes as Nest controllers, by default.**
|
|
43
|
+
`init --http nest` now records `"validation": "class-validator"`, as Nest validates, and
|
|
44
|
+
`"routes": "nest"`: `generate route`, `file-upload`, `form` and `representation` write Nest
|
|
45
|
+
controllers built by Nest and served by the kit, their parts and answers read from their
|
|
46
|
+
signatures. `--validation zod` (or another library) keeps the controllers of the kit, and
|
|
47
|
+
`--routes controllers` asks for them on class-validator too. `describe`, `generate e2e` and every
|
|
48
|
+
reading of the routes of a context now read the route methods of Nest controllers, and the
|
|
49
|
+
generated list of a context holds the Nest controllers of its modules, which it left out.
|
|
50
|
+
|
|
51
|
+
To move: nothing for a recorded project, which keeps the stack its config says, `init --force`
|
|
52
|
+
included. A new Nest project that wants the controllers of the kit passes `--routes controllers`.
|
|
53
|
+
|
|
54
|
+
**A strategy of Passport authenticates the calls of the kit: `passportPrincipal` of `@ddd-ts-kit/auth/passport`.**
|
|
55
|
+
`passportPrincipal(strategy, { actorOf })` runs a strategy of Passport on each request, as
|
|
56
|
+
`passport.authenticate` does, and answers the session `resolvePrincipal` hands the pipeline: the
|
|
57
|
+
guards of the routes and the permissions of the use cases decide as with any authenticator, on
|
|
58
|
+
every door. A strategy of `passport-jwt` or a class of `@nestjs/passport` (given lazily, once Nest
|
|
59
|
+
has built it) works as it is; `actorOf` reads the user its verify callback or its `validate`
|
|
60
|
+
answered. It fails closed: a credential the strategy fails is a 401, an error, a redirect (a
|
|
61
|
+
sign-in flow) or a strategy silent past `timeoutMs` refuses the request, and only a request
|
|
62
|
+
without credential, or one the strategy passes, goes on anonymous. The entry imports nothing of
|
|
63
|
+
Passport. `nest/no-parallel-pipeline` now points `@nestjs/passport` in a context at it.
|
|
64
|
+
|
|
65
|
+
**On Drizzle, Prisma and TypeORM, `npm run db:generate` makes the audit trail append-only in the migration that creates it: no statement to paste by hand any more.**
|
|
66
|
+
|
|
67
|
+
The tools of these ORM write no trigger, so a project with `--audit on` had a `TODO(platform)` asking to copy the statements `npm run db:audit-guard` prints into a migration of its own. `ddd-ts-kit drizzle-generate` now adds them to the migration that creates `audit_entries`, once, and two commands do the same around the tool of the other ORM: `ddd-ts-kit prisma-generate --name <what-it-does>` (`prisma migrate dev --create-only`) and `ddd-ts-kit typeorm-generate <folder>/<what-it-does>` (`typeorm migration:generate` on the compiled data source). A project whose migrations hold the guard already, or without an audit trail, gets the tool of its ORM as before.
|
|
68
|
+
|
|
69
|
+
Generating and applying a first migration on a real PostgreSQL, which no test did before, found three more things, fixed here: on Drizzle, the platform schemas (`messaging`, `audit`, `event_store`) were never created, so a first migration failed on a new database without a word from drizzle-kit (they are now exported with `pgSchema`); on TypeORM, the migrations were never compiled into the `dist/migrations` the data source reads, so `db:migrate` answered `No migrations are pending` (`tsconfig.json` includes `migrations`, `typeorm-generate` imports its types as types and formats the file, ESLint leaves the migrations a tool writes alone), and TypeORM writes no `CREATE SCHEMA`, which `typeorm-generate` adds at the start of `up`; and the `CREATE SCHEMA` drizzle-kit writes is made `IF NOT EXISTS`, so that a migration applies to a database that has the schema already. A job of the night and of the release now generates, guards and applies the first migration of each of the three ORM on a real PostgreSQL, every gate of the project then run.
|
|
70
|
+
|
|
71
|
+
To move:
|
|
72
|
+
|
|
73
|
+
- **A TypeORM project generated before: `npm run db:migrate` never applied any migration.** It answered `No migrations are pending`, since nothing compiled `migrations/` into `dist/migrations`; a database that only `db:migrate` built has none of the tables. Run `init --force` (it writes `tsconfig.json` with `migrations` in `include`, `eslint.config.mjs` that leaves `migrations/**` to the tool, and `db:generate` through `ddd-ts-kit typeorm-generate`); then, in each migration written before, make the import `import type { MigrationInterface, QueryRunner } from 'typeorm';`, add `await queryRunner.query('CREATE SCHEMA IF NOT EXISTS "<schema>"');` at the start of `up` for each schema its tables use (`messaging`, `audit`, the schema of each context), and with an audit trail the statements `npm run db:audit-guard` prints after the creation of `audit_entries`; `npm run build && npm run db:migrate` then applies them. A database built by `synchronize` or by hand is to compare with the migrations before migrating it.
|
|
74
|
+
- **A Drizzle project generated before: a first migration failed on a new database** (`messaging`, `audit` and `event_store` never created). Run `init --force`, or add to `schema.ts` `export const messaging = pgSchema(MESSAGING_SCHEMA);` and the same for `AUDIT_SCHEMA` and `EVENT_STORE_SCHEMA`, then `npm run db:generate add-platform-schemas`: `drizzle-generate` now writes every `CREATE SCHEMA` as `CREATE SCHEMA IF NOT EXISTS`, so this migration also applies to a database whose schemas were created by hand; with an audit trail and no guard yet, paste what `npm run db:audit-guard` prints into a custom migration (`npm run db:generate -- audit-guard --custom`).
|
|
75
|
+
- **A Prisma project generated before:** set `db:generate` to `ddd-ts-kit prisma-generate --name` (`init --force` writes it); with an audit trail and no guard yet, `npm run db:generate audit-guard` writes an empty migration to paste what `npm run db:audit-guard` prints into.
|
|
76
|
+
- A migration that already holds the guard by hand is recognised and left alone by the three commands.
|
|
77
|
+
|
|
78
|
+
**`init --authn passport` verifies the bearer tokens with a strategy of Passport, and the identity preset runs on it.**
|
|
79
|
+
The platform gets `bearer-strategy.ts`, a strategy of `passport-jwt` on the key set the issuer
|
|
80
|
+
publishes (`jwks-rsa`, `AUTH_JWKS_URI`), its issuer and its audience, and `actor-of-token.ts`,
|
|
81
|
+
which reads the payload with `actorOfClaims`; `create-authenticator.ts` puts them behind the
|
|
82
|
+
`Authenticator` port with `passportAuthenticator`, new in `@ddd-ts-kit/auth/passport`, so that the
|
|
83
|
+
HTTP boundary, the procedures and the end-to-end tests (credentials signed for the strategy)
|
|
84
|
+
authenticate through it. `actorOfClaims`, the reading of claims of `JwtAuthenticator`, is now
|
|
85
|
+
exported by `@ddd-ts-kit/auth` without `jose`. The identity preset accepts `--authn passport`.
|
|
86
|
+
The option verifies bearer tokens, as `--authn jwt`, with the strategy in the code of the project:
|
|
87
|
+
a strategy that reads a cookie or a session is wired by hand with `passportPrincipal`.
|
|
88
|
+
|
|
89
|
+
**A controller answers response headers.** `response` of `@Controller` (and of `@KitRoute` on a Nest controller) takes `headers`, a map of the header name to what it holds: the contract lists them under `responses.<status>.headers`, and `handle` returns `{ body, headers }` (`{ headers }` with no body), typed from the declaration so a declared header left out does not compile. Express, Fastify, Hono and Nest write them. A response that declares none keeps returning the body alone. A `Location` on a `201`, an `ETag`, a `Content-Disposition` on an export or a `Retry-After` on a `202` no longer need a function route.
|
|
90
|
+
|
|
91
|
+
**The guard lets `generate module` through on the trunk, and the skills name modules, the authorization model and the preset's glossary.**
|
|
92
|
+
`generate module` writes the config and the `CONTEXT.md` of the context, not code, so the guard no longer refuses it on the main checkout
|
|
93
|
+
under `"worktrees": "required"`, as it already did for `generate context`. The `bootstrap` skill declares each module of a context
|
|
94
|
+
right after its `generate context`, with its `--term`. `plan-slices` gives every row of a context with modules a `--module`, and leaves
|
|
95
|
+
`--grant` out on a `rebac` or `abac` project, where the generator refuses it. `glossary` takes the terms of a preset (today `identity`,
|
|
96
|
+
`packages/cli/src/presets/identity-terms.ts`) as the draft of a context the preset writes, and adds only the business terms beyond them.
|
|
97
|
+
|
|
98
|
+
**`ddd-ts-kit acceptance <story> --lock` writes the lock in the layout the formatter of the project prints.**
|
|
99
|
+
The lock was written with `JSON.stringify` in two spaces, which the Biome of the project then refused at the commit (the format hook asked for `biome format --write` on every lock and every relock). It is written through the JSON layout the kit uses for its other generated files, the one `biome format` prints at a width of 120, so the format hook passes on it untouched.
|
|
100
|
+
|
|
101
|
+
To move: nothing; a lock already written is reformatted by the next `acceptance <story> --lock`, or by `biome format --write test/acceptance/*.acceptance.lock.json`.
|
|
102
|
+
|
|
103
|
+
**The agent denies the secret files of a project by name, and reads `.env.example` again.**
|
|
104
|
+
`init` denied `Read(./.env.*)` with the negation `Read(!./.env.example)` to keep the example readable. The sandbox of Claude Code ignores the negation and masks `.env.example` with `/dev/null`, which breaks git in the session. The deny list names `.env`, `.env.local`, `.env.*.local`, `.env.production`, `.env.development` and `.env.test`, and no rule carries a `!`.
|
|
105
|
+
|
|
106
|
+
To move: a project written before this change keeps the glob and its negation in `.claude/settings.json`; replace them by the six rules above (`init` adds the missing ones and says so, but does not remove the old pair).
|
|
107
|
+
|
|
108
|
+
**The `biome.json` of a project no longer ignores the worktrees of its own checkout.**
|
|
109
|
+
`init` wrote `"!**/.worktrees"` in `files.includes`: inside a worktree under `.worktrees/`, Biome then ignored every file, and `format` of `verify` failed in every story and worker. The entry is `"!.worktrees"`, anchored at the root of the configuration: the main checkout still skips its worktrees, and a worktree formats its own files.
|
|
110
|
+
|
|
111
|
+
To move: a project written before this change keeps `"!**/.worktrees"` in its `biome.json`; replace it with `"!.worktrees"` (or run `init --force`, which rewrites the file).
|
|
112
|
+
|
|
113
|
+
**`merge-trunk` and `verify-merge` no longer report as lost the lines the trunk itself removed or replaced.** A line of the branch in a file the branch did not touch since it left the trunk (the file is the same on the branch and at `git merge-base`) cannot be a loss of the merge: what the trunk changed there since the base is the trunk's change. It happened when the branch had taken lines from the trunk with an earlier merge and the base of the new merge was older, which stopped the merge on `the merge lost N line(s)` and taught workers to pass `--accept-lost` blind. A line of a file the branch touched, dropped by the merge, is still reported.
|
|
114
|
+
|
|
115
|
+
**A controller declares a raw body.** `@Controller({ rawBody: true })` (and `@KitRoute({ rawBody: true })` on a Nest controller) leaves the body unparsed and unvalidated: `handle` reads the bytes in `context.stream` and the headers as they arrived in `context.rawHeaders`, to verify an HMAC signed over them before parsing anything. The contract describes the body as `application/octet-stream`, and `rawBody` is refused with `body`, `upload` or `consumes`. Express, Fastify, Hono and Nest (over Express and over Fastify) serve it; a signed webhook no longer needs a function route outside the closed presentation tree.
|
|
116
|
+
|
|
117
|
+
To move: a project generated by `init` from now on has it. An existing project adds it by hand: on Express, keep the bytes of a JSON body the parser reads before the routes (`express.json({ verify })` writing `request.rawBody`), and create a Nest application with `rawBody: true`, or a JSON webhook reaches the controller empty.
|
|
118
|
+
|
|
119
|
+
**The repository contract asks for a change of state: `mutate` is optional, and a `mutate` that changes nothing fails the stale-save case with a message that says so.** The case `refuses to overwrite a change it has not seen` waited for a conflict that never came on an event-sourced adapter when `mutate` changed nothing, because an event store appends nothing for no pending event. The contract now changes the stale copy too before saving it, so a table adapter and an event store both refuse it, and a `mutate` that changes nothing fails with `mutate changed nothing: give the contract a change of state`. Without a `mutate`, the case is registered as pending (`it.todo`) with the reason `give the contract a mutate that records a change of state`, so a freshly generated repository is green and the case shows in `ddd-ts-kit todo`. The fakes and the adapters do not change: a table adapter and an event store may differ on a save without a change, which the contract does not judge.
|
|
120
|
+
|
|
121
|
+
To move: add a `mutate` that records a change to each contract spec; the case stays pending until then.
|
|
122
|
+
|
|
123
|
+
**`generate aggregate --event-sourced --birth <Event>` names the birth event after the business.**
|
|
124
|
+
The birth event of an event-sourced aggregate was always `<Name>Created`, and the generator refused
|
|
125
|
+
until `Created` was a term of the glossary, so an agent defined a word the business never says.
|
|
126
|
+
`--birth Triggered` writes `IncidentTriggered` (`incidents.incident.triggered`) for the event class,
|
|
127
|
+
its type, the codec of the stored events, the builder and the specs, checked against the glossary
|
|
128
|
+
and as a past fact like any event name. `Created` stays the default. `--birth` without
|
|
129
|
+
`--event-sourced` is refused. The `scaffold` skill says to pass it with the word of the glossary.
|
|
130
|
+
|
|
131
|
+
**`generate repository` on an event-sourced aggregate writes the adapter over `EventSourcedRepository`, not a table.**
|
|
132
|
+
When the class of the aggregate extends `EventSourcedAggregate`, `generate repository` (and the
|
|
133
|
+
first `generate command --aggregate` that needs one) writes `event-store-<name>.repository.ts`,
|
|
134
|
+
which delegates to `EventSourcedRepository` of the kernel over the `EventStore` and the
|
|
135
|
+
`PersonalDataCipher` the platform binds, with the codec of `<name>-events.mapper.ts` and its
|
|
136
|
+
snapshot policy left as a `TODO(domain)`; no table, no row mapper. The fake is that adapter over
|
|
137
|
+
the in-memory stores, and the repository contract runs on the fake and on the adapter over
|
|
138
|
+
`InMemoryEventStore`, its stale-save case pending until a `mutate` that records an event is added. It is bound where the project
|
|
139
|
+
binds its adapters (the declarations, the module of the context, or the hand-written platform).
|
|
140
|
+
The event store keeps no tenant, so `--tenant-scoped` changes nothing and the note says who
|
|
141
|
+
decides who may load an id; `--personal` is refused, the personal values being sealed in the
|
|
142
|
+
events. A project that deleted the table adapter and wrote this one by hand can regenerate it
|
|
143
|
+
and compare.
|
|
144
|
+
|
|
145
|
+
**`@ddd-ts-kit/tracing` runs on the OpenTelemetry JS SDK 3.0.** `@opentelemetry/sdk-node` 0.300 no
|
|
146
|
+
longer exports the `resources` and `tracing` namespaces, so `initTracing` imports the resource
|
|
147
|
+
from `@opentelemetry/resources` and the samplers and span processors from `@opentelemetry/sdk-trace`,
|
|
148
|
+
the package that replaces `@opentelemetry/sdk-trace-base`. The test harness of
|
|
149
|
+
`@ddd-ts-kit/tracing/testing` uses its `TracerProvider`, the former `BasicTracerProvider`. The peer
|
|
150
|
+
ranges ask for `@opentelemetry/sdk-node` and `@opentelemetry/exporter-trace-otlp-http` 0.300,
|
|
151
|
+
`@opentelemetry/auto-instrumentations-node` 0.82, `@opentelemetry/sdk-trace`,
|
|
152
|
+
`@opentelemetry/resources` and `@opentelemetry/context-async-hooks` 3.0, and `@opentelemetry/api`
|
|
153
|
+
1.10: the former ranges let a fresh install pull 0.300, which the previous `initTracing` could not
|
|
154
|
+
start with. `init` writes these versions.
|
|
155
|
+
|
|
156
|
+
To move: `npm i @opentelemetry/sdk-node@^0.300.0 @opentelemetry/exporter-trace-otlp-http@^0.300.0
|
|
157
|
+
@opentelemetry/auto-instrumentations-node@^0.82.0 @opentelemetry/resources@^3.0.0
|
|
158
|
+
@opentelemetry/api@^1.10.0`, then `npm uninstall @opentelemetry/sdk-trace-base` and
|
|
159
|
+
`npm i -D @opentelemetry/sdk-trace@^3.0.0 @opentelemetry/context-async-hooks@^3.0.0`; an import of
|
|
160
|
+
`@opentelemetry/sdk-trace-base` becomes `@opentelemetry/sdk-trace`, `BasicTracerProvider`
|
|
161
|
+
becomes `TracerProvider`, and a span processor takes its exporter as an option:
|
|
162
|
+
`new SimpleSpanProcessor({ exporter })`.
|
|
163
|
+
|
|
164
|
+
**RabbitMQ rejects a publication the broker does not confirm in time, as NATS and Kafka do; the Redis Streams bus no longer takes a `scope` of its own.**
|
|
165
|
+
|
|
166
|
+
`RabbitMqEventBus` gains `publishTimeoutMs` (default 30000): `publish` waited for the confirmation of the broker with no timer, so a broker stalled (a full disk, a reply lost) held the outbox relay forever; it now rejects with `PUBLISH_NOT_CONFIRMED` and the relay retries. `close()` waits as long at most for each answer of the broker (the confirmations in flight, the cancel of the consumers, the close of the channels), so that a broker that stopped answering no longer holds the stop of the application. `RedisStreamsEventBus` loses its `scope` option, which no other bus had: the consumers of the kit (`on` of `@ddd-ts-kit/events`, the consumer of `@ddd-ts-kit/di`) run a handler in the execution context of its event above any bus, and the option ran it in that context a second time when given. Found by the parity check of the brokers (`pipeline/monorepo/families.mjs`).
|
|
167
|
+
|
|
168
|
+
To move: a bus built with `scope` drops it and wraps its handler with `inEventScope(scope, { consumer }, handler)` of `@ddd-ts-kit/kernel`, which the consumers of the kit already do; nothing generated by `init` passes it.
|
|
169
|
+
|
|
170
|
+
**`ddd-ts-kit docs --stored-events` reads the codecs of the modules of a context too, and refuses a shape it cannot read instead of recording the hash of nothing.**
|
|
171
|
+
|
|
172
|
+
A context divided into modules keeps its codecs in `<context>/<module>/infrastructure/persistence/` (where `generate aggregate --module <module> --event-sourced` writes them): `docs --stored-events`, `docs --check` and the unrecorded versions it lists read only `<context>/infrastructure/persistence/`, so nothing of a module was ever recorded. They now read the folder of the context and the one of each module of its model. A codec whose data type is not declared in its file, or declares no member, was recorded as `sha256:e3b0c44298fc1c14`, the hash of empty input, so that the lock vouched for no shape: `docs --stored-events` now stops with a non-zero exit code, names the codec file, the line and the reason, and writes nothing. `docs --check` reports an entry of the lock that holds the hash of nothing (`recorded empty`, and `emptilyRecorded` in `--json`).
|
|
173
|
+
|
|
174
|
+
To move: a lock that holds `sha256:e3b0c44298fc1c14` records nothing. Declare the fields of the data type in the codec, remove the entry from `stored-events.lock.json` (the version was not stored with a guarantee yet) and run `ddd-ts-kit docs --stored-events`. The placeholder `interface <Event>Data {}` a generator writes has to get its fields before its version is recorded.
|
|
175
|
+
|
|
176
|
+
**The sandbox guide says what the deny rules of the generated contracts cost an agent session, and what to do.** `Edit(./openapi/**)` and the other deny rules `init` writes for the generated contracts become read-only mounts under the sandbox of Claude Code: a merge of a branch that regenerated them and `docs:generate` in the main checkout fail inside the sandbox. The rules stay (the Edit tool must not touch a generated contract); `docs/guides/agent-sandbox.md` says to do those two gestures outside the sandbox, or to run the session with `--setting-sources local`, the guard of the plugin still refusing a hand edit of a generated file.
|
|
177
|
+
|
|
178
|
+
**The module of a context on `--di manual` keeps each function short as the context grows: one function per role.** `<context>.module.ts` registered everything in one function, which went past the 100 lines no function may exceed (`clean/function-size`) once a few use cases were scaffolded. It now holds `registerHandlers` (the repositories and readers with the command and query handlers), `registerReactions` (the handlers of events, the publishers of integration events, the integration handlers), `registerJobs`, `declaredUseCases` and `routesOf`, called by the module; the generators insert into the right one (`ddd-ts-kit:handlers`, `reactions`, `jobs`, `authorization` and `routes` regions replace `registrations`).
|
|
179
|
+
|
|
180
|
+
To move: a module written by an earlier version keeps its `registrations` region and its one function; move the lines by hand into the function of their role if it outgrows the limit.
|
|
181
|
+
|
|
182
|
+
**`init` writes the error mapper of the platform in one file, `platform/composition/platform-error-mapper.ts`, and the test platform binds it like the platform does.** A route spec through the test application used to see the default mapper (a refusal of the authenticator answered 422 where the running application answered 401) because `platform-test.module.ts` bound no `ErrorMapper`. `platformErrorMapper()` is bound by `platform.module.ts` and by `platform-test.module.ts` on tsyringe, and read by `compose-application.ts` on manual DI and Nest. Nothing is written without HTTP.
|
|
183
|
+
|
|
184
|
+
To move: a project that maps its own errors in `platform.module.ts` moves the mapping into `platformErrorMapper()` and binds it in `platform-test.module.ts`.
|
|
185
|
+
|
|
186
|
+
**The event store keeps the tenant of each stream, so an event-sourced aggregate is isolated under shared-table tenancy.** Given the execution scope (`InMemoryEventStore(scope)`, or `scope` in the options of `createKnexEventSourcing`, `createDrizzleEventSourcing`, `createPrismaEventSourcing` and `createTypeOrmEventSourcing`), the store records the tenant of the work at the first append of a stream in a nullable `tenant_id` column of the events, gives it on each `StoredEvent.tenantId`, and refuses a read or an append of a stream of another tenant with an `EventStreamTenantError` (platform staff elevated by `acrossTenants` may read, never append). Work that names no tenant is not scoped, and a store given no scope neither reads nor writes the column. `CatchUpSubscription` and `EventStoreProjectionRebuild` take the same `scope` and apply each event in the tenant of its stream. `eventStoreContract` gains `createTenantStore`, held by the in-memory store and the four ORM. `eventStoreTablesSql`, `eventStoreTables` (Drizzle), `eventStoreEntities` (TypeORM) and the Prisma model carry the column. Under a tenancy, `init` hands the execution scope to the event store: `persistence.eventSourcing` becomes a function of the scope, and `createEventSourcing(persistence, scope)` (or with the audit source) calls it.
|
|
187
|
+
|
|
188
|
+
To move: a generated project edits its `persistence-over` and `createEventSourcing` the same way (`eventSourcing: (scope) => createKnexEventSourcing(unitOfWork, { schema, scope })`), and a project under shared-table tenancy passes `scope` to its event store, and a project whose event store already exists adds the column in a migration: `addEventStoreTenantColumn(knex, { schema, tenantOfExistingStreams: '<tenant>' })` on Knex (or `eventStoreTenantColumnSql`), and the migration of the tooling of the ORM on Drizzle, Prisma and TypeORM (`tenant_id text`, nullable) followed by `update stored_events set tenant_id = '<tenant>'` for the streams already there; a stream without a tenant is refused to every tenant. A Prisma project copies the new `tenantId String? @map("tenant_id")` line into its `StoredEvent` model.
|
|
189
|
+
|
|
190
|
+
**A `context-builder` agent returns its report as its final message, and a `SubagentStop` hook of the plugin writes it to `.ddd-ts-kit/report.md` of its worktree.**
|
|
191
|
+
|
|
192
|
+
Claude Code refuses a sub-agent the write of a report file ("Subagents should return findings as text, not write report files."), so the report that `worker-scope --resume` and the guard read was never there. The agent is no longer asked to write it; the guard takes its last message (from the hook input, else from the transcript the input names) and writes the file in the worktree of the worker, failing open. The briefing of `worker-scope` and its resume message say the same. The `parallel-work` and `story` skills tell the conductor to write the file from the worker's final message when it is missing after the worker returns.
|
|
193
|
+
|
|
194
|
+
The guard no longer asks an agent that stops to rewrite a report older than its last commit; it still keeps it going once when a slice that passed `verify-slice` is left uncommitted.
|
|
195
|
+
|
|
196
|
+
## 0.91.0
|
|
197
|
+
|
|
198
|
+
**The background jobs and the process instances go to the database by default on every ORM of
|
|
199
|
+
the kit and with every container: `TypeOrmJobStore` and `TypeOrmProcessStore`, and one rule for
|
|
200
|
+
`init --queue`.** `@ddd-ts-kit/typeorm` gains the job store and the process store, with their
|
|
201
|
+
tables `jobEntity()` and `processEntity()`, held to `jobStoreContract` and `processStoreContract`
|
|
202
|
+
on PGlite and on PostgreSQL: a job enqueued by a command is written by its transaction, a claim
|
|
203
|
+
takes the due rows `FOR UPDATE SKIP LOCKED`, an idempotency key is unique per job name and tenant,
|
|
204
|
+
a step of a process manager saves its instance in its unit of work. `init --orm typeorm` now
|
|
205
|
+
accepts `--queue database` and writes the two entities in the `messaging` schema. And the default
|
|
206
|
+
of `--queue` no longer depends on the container: `database` on Knex, Drizzle, Prisma and TypeORM
|
|
207
|
+
with tsyringe, Nest or a platform wired by hand, `memory` with a custom persistence or none. Until
|
|
208
|
+
now a project under Nest or wired by hand kept its jobs in memory unless it asked otherwise.
|
|
209
|
+
|
|
210
|
+
To move: nothing for an existing project, whose `stack.queue` is kept. A new project under Nest or
|
|
211
|
+
wired by hand that wants its jobs in memory passes `--queue memory`.
|
|
212
|
+
|
|
213
|
+
**The identity preset is written on Prisma: `init --orm prisma --preset identity`.** The context
|
|
214
|
+
comes with its Prisma adapters (the repositories of the five aggregates, the search reader of the
|
|
215
|
+
members, their mappers over the generated client, the declarations of the personal fields), and
|
|
216
|
+
its models and enums laid out in `prisma/schema.prisma` in place of the ones the generators start:
|
|
217
|
+
the closed vocabularies (the role of a member, the status of an account and of an invitation) are
|
|
218
|
+
enums of the schema, the token of an invitation is unique, and one current membership per account
|
|
219
|
+
and organisation is a partial unique index, `where: { removedAt: null }`, for which the preset
|
|
220
|
+
turns on the `partialIndexes` preview feature of the client generator: a preview feature, which
|
|
221
|
+
Prisma may change without a major version, so after an upgrade of Prisma check that
|
|
222
|
+
`generated/schema.sql` still ends `members_current_idx` with `WHERE ("removed_at" IS NULL)`. The tables belong to no
|
|
223
|
+
tenant, as on Knex and Drizzle. The preset is still refused on TypeORM, the explicit style and
|
|
224
|
+
NestJS.
|
|
225
|
+
|
|
226
|
+
To move: nothing for an existing project. A project on Prisma that wants the context runs
|
|
227
|
+
`ddd-ts-kit generate context identity --preset identity`, then `npm run db:client` and
|
|
228
|
+
`npm run db:generate identity`.
|
|
229
|
+
|
|
230
|
+
**A route is served as an oRPC procedure too, for a typed TypeScript client: `orpcRouter` of `@ddd-ts-kit/http/orpc`.**
|
|
231
|
+
`orpcRouter(routes, options)` turns each route into an oRPC procedure named by its `operationId`,
|
|
232
|
+
for `RPCHandler` of `@orpc/server` (1.15 or later, a new optional peer of `@ddd-ts-kit/http`),
|
|
233
|
+
mounted next to the routes under a prefix such as `/rpc`. Each call runs through `executeRoute`
|
|
234
|
+
with the options of the HTTP adapter: the same guards, principal, tenant, validation,
|
|
235
|
+
permissions, `onError` and `around`. A refusal is an `ORPCError` with the code and the status of
|
|
236
|
+
its problem document, which it carries as its data, and a code the route declares (its own, its
|
|
237
|
+
guards', `VALIDATION_FAILED`, the preconditions) is a defined error for the client. What only HTTP
|
|
238
|
+
carries stays with the routes: an answer has no headers (no `ETag`, no cache policy), JSON is the
|
|
239
|
+
only representation, a route that receives a file or a raw body is not a procedure, and a file or
|
|
240
|
+
a list streamed as it is read is refused with 406 and closed.
|
|
241
|
+
|
|
242
|
+
A list read as it comes and closed before its end now closes its cursor: the pipeline read its
|
|
243
|
+
first item in advance, and stopping the list, as a client that goes away does, left the cursor
|
|
244
|
+
open until it was collected.
|
|
245
|
+
|
|
246
|
+
**`init --rpc orpc` serves the routes of the contexts under `/rpc` as oRPC procedures, and `ddd-ts-kit sdk` gives each client its oRPC contract at `./orpc`.**
|
|
247
|
+
The new key `stack.rpc` (`none`, `orpc`) has `start-http-server.ts` mount `orpcRouter` of
|
|
248
|
+
`@ddd-ts-kit/http/orpc` under `/rpc` on Express, Fastify, Hono and NestJS, with the options of the
|
|
249
|
+
HTTP boundary, and adds `@orpc/server`; it needs an HTTP framework. `ddd-ts-kit sdk` then writes
|
|
250
|
+
`src/orpc.ts` in each client: the oRPC contract of its document (`contract`, `createRpcClient`),
|
|
251
|
+
each procedure named by its `operationId`, its input and answer the types of the HTTP client, its
|
|
252
|
+
refusals the codes of `x-error-codes` with their status, so that `isDefinedError` narrows them.
|
|
253
|
+
`@orpc/client` and `@orpc/contract` become the only dependencies of the client, whose root entry
|
|
254
|
+
still has none; setting the key back to `none` takes them and `src/orpc.ts` away. The kit no longer
|
|
255
|
+
documents oRPC as set aside: it is a second door to the routes, not a pair of the contract.
|
|
256
|
+
|
|
257
|
+
To move: a project that wants the procedures runs `init --force --rpc orpc` on a clean tree (it
|
|
258
|
+
records the key, rewrites `start-http-server.ts` and adds `@orpc/server`), then
|
|
259
|
+
`npx ddd-ts-kit sdk` when it has clients.
|
|
260
|
+
|
|
261
|
+
**The identity preset is written in the explicit style and under NestJS: `init --di manual --preset
|
|
262
|
+
identity` and `init --http nest --di nest --preset identity`.** The classes of the context are written
|
|
263
|
+
without the declarations of the kernel, a policy carrying its name and its permission, and the preset
|
|
264
|
+
lays out `identity.module.ts` whole once the generators ran: its adapters, its use cases with the
|
|
265
|
+
permission each requires, the publishers of its facts, the consumers that keep the identity provider
|
|
266
|
+
in line (each with its consumer name, the processed-event store and the unit of work), and its
|
|
267
|
+
routes, in short functions named after what they wire, the regions of the generators kept. Its
|
|
268
|
+
policies join `access-policies.ts` of the platform, and the world of its specs wires the fakes the
|
|
269
|
+
way the module wires the adapters; `test/unit/identity.module.spec.ts` holds the module itself to its
|
|
270
|
+
use cases, on the platform: each command and query has its handler and its permission, and each
|
|
271
|
+
route is mounted. Under NestJS the routes are mounted with those of the other
|
|
272
|
+
contexts by the app module of the platform. The explicit style stays refused on tsyringe, which
|
|
273
|
+
reads the declarations, and `--dependencies signature` is asked of the declared style only.
|
|
274
|
+
|
|
275
|
+
To move: nothing for an existing project.
|
|
276
|
+
|
|
277
|
+
**A project generated on Jest is green from its first minute, and the kit now runs it: Jest is
|
|
278
|
+
installed in the workspace and one Jest stack joins the stacks its end-to-end suite runs.** Running
|
|
279
|
+
it found what a type check could not: a Jest project listed `@vitest/coverage-v8`, which knip
|
|
280
|
+
refused as unused; knip entered its fakes and worlds through top-level patterns, reported as
|
|
281
|
+
matching nothing before the first context, instead of a `jest` section beside the `vitest` one of
|
|
282
|
+
a Vitest project; the extractability spec of `test/architecture/` gave `it.each` an empty table,
|
|
283
|
+
which Jest refuses, before the first context (it now waits with an `it.todo`); an import of a
|
|
284
|
+
directory (`@/contexts/<context>/published-language`) did not resolve, each alias now mapping to the
|
|
285
|
+
source then to the barrel of the directory; the modules of the Prisma client, written with `.js`,
|
|
286
|
+
did not resolve, now mapped back to their sources; and a hook opening the test database outlasted
|
|
287
|
+
the 5 seconds of Jest, now 60 as on Vitest. The identity preset is held green on NestJS,
|
|
288
|
+
class-validator, Prisma, shared tables and Jest, the stack of the spend management example.
|
|
289
|
+
|
|
290
|
+
To move: in `jest.config.js`, write each alias of `moduleNameMapper` as
|
|
291
|
+
`['<rootDir>/src/$1.ts', '<rootDir>/src/$1/index.ts']` (the check asks for it), add
|
|
292
|
+
`testTimeout: 60_000`, and on Prisma `'^(\\.{1,2}/.*)\\.js$': '$1'`; in `knip.json`, move the
|
|
293
|
+
entries of the fakes and the worlds into a `jest` section with `"config": ["jest.config.js",
|
|
294
|
+
"jest.e2e.config.js", "jest.mutation.config.js"]`; drop `@vitest/coverage-v8` from the dev
|
|
295
|
+
dependencies.
|
|
296
|
+
|
|
297
|
+
**A route is served as a tRPC procedure too: `trpcRouter` of `@ddd-ts-kit/http/trpc`.**
|
|
298
|
+
`trpcRouter(routes, options)` turns each route into a tRPC procedure named by its `operationId`, a
|
|
299
|
+
query for a `GET` route and a mutation for the other methods, for the adapters of `@trpc/server`
|
|
300
|
+
(11.10 or later, a new optional peer of `@ddd-ts-kit/http`), mounted next to the routes under an
|
|
301
|
+
endpoint such as `/trpc`. Each call runs through `executeRoute` with the options of the HTTP
|
|
302
|
+
adapter, as a call of `orpcRouter` does. A refusal is a `TRPCError` of the code tRPC has for its
|
|
303
|
+
status (`UNAUTHORIZED` for 401, `CONFLICT` for 409), with the problem document of the route in
|
|
304
|
+
`data.problem`, whose `code` is the one of the kit: tRPC has a fixed set of codes of its own. What
|
|
305
|
+
only HTTP carries stays with the routes, as over oRPC, and a binary body is refused with 406 too,
|
|
306
|
+
as tRPC answers JSON only.
|
|
307
|
+
|
|
308
|
+
Over oRPC, a file or a streamed list refused with 406 now carries its problem document as `data`,
|
|
309
|
+
as every other refusal does.
|
|
310
|
+
|
|
311
|
+
**`init --rpc trpc` serves the routes of the contexts under `/trpc` as tRPC procedures, and `ddd-ts-kit sdk` gives each client the type of their router at `./trpc`.**
|
|
312
|
+
`stack.rpc` takes a third value, `trpc`: `start-http-server.ts` mounts `trpcRouter` of
|
|
313
|
+
`@ddd-ts-kit/http/trpc` under `/trpc` on Express, Fastify, Hono and NestJS, with the options of
|
|
314
|
+
the HTTP boundary, and adds `@trpc/server`; it needs an HTTP framework, as `orpc` does. `ddd-ts-kit
|
|
315
|
+
sdk` then writes `src/trpc.ts` in each client: `AppRouter`, the type of the router written from
|
|
316
|
+
its document, a query for each `GET` operation and a mutation for the others, their input and
|
|
317
|
+
answer the types of the HTTP client, a refusal carrying its problem document in `data.problem`;
|
|
318
|
+
`createRpcClient` and `isRpcRefusal` call it. A front end imports the client, never the code of
|
|
319
|
+
the server. `@trpc/client` and `@trpc/server` become the only dependencies of the client; moving
|
|
320
|
+
to another value takes them and `src/trpc.ts` away.
|
|
321
|
+
|
|
322
|
+
To move: a project that wants the procedures runs `init --force --rpc trpc` on a clean tree (it
|
|
323
|
+
records the key, rewrites `start-http-server.ts` and adds `@trpc/server`), then
|
|
324
|
+
`npx ddd-ts-kit sdk` when it has clients. A project that served oRPC removes `@orpc/server` from
|
|
325
|
+
its `package.json`: `init` adds the dependencies of a stack, it does not take back those of the
|
|
326
|
+
previous one.
|
|
327
|
+
|
|
328
|
+
**`init` on an existing project names each dependency of its `package.json` the stack about to be written contradicts.** The first `init` of a project that already has a `package.json`, a dry run included, adds a note per key its direct dependencies answer otherwise than the flags (`package.json depends on fastify, and the project is written for --http express: pass --http fastify to keep it.`), for the HTTP framework, the validation library, the injection, the test runner, the ORM, the database, the broker, the authentication, the logger, the error reporter and the storage. Two dependencies that answer one key differently are left to the owner, and said; the rights model is never read from a dependency. Nothing is written by these notes, and an initialised project is not read again. The `bootstrap` skill puts them to the owner.
|
|
329
|
+
|
|
330
|
+
**The instances of the process managers are kept in the tenant of the work on Knex, Drizzle, Prisma and TypeORM alike, under a key that includes the tenant.**
|
|
331
|
+
|
|
332
|
+
`KnexProcessStore`, `DrizzleProcessStore`, `PrismaProcessStore` and `TypeOrmProcessStore` take `tenant` (the `ExecutionScope`): a step loads and changes the instances of its own tenant only, and work that names no tenant is refused with `NoCurrentTenantError`. The table of each package (`createProcessTable`, `processesTable`, the `ProcessInstance` model, `processEntity`) always has `tenant_id`, the empty text outside any tenant, and its primary key is `(tenant_id, name, id)`: two tenants may run an instance under the same correlation key, a month or an invoice number, where the first save of the second was refused before. `processStoreContract` proves it with `storeInTenant`, on the four packages. A project generated with `--tenancy` gives the scope to its process store: `Persistence.processes` is now `(scope) => ProcessStore`.
|
|
333
|
+
|
|
334
|
+
To move: drop `tenant: true` from `createProcessTable` (the option is gone, the column always there); `DrizzleProcessStore` takes its table as `{ table }`. A database created before needs a migration that adds `tenant_id` (`''` for the rows of no tenant, `addTenantColumn` of `@ddd-ts-kit/knex` for those of a tenant) and makes `(tenant_id, name, id)` the primary key; on Prisma, `prisma migrate dev` writes it from the model. In a generated project, `persistence.processes` is called with the execution scope (`persistence.processes(scope)`), as `init` now writes it.
|
|
335
|
+
|
|
336
|
+
**A renamed `operationId` is a breaking change of the API when the routes are served as procedures, and the architecture reviewer says so.**
|
|
337
|
+
With `stack.rpc` set to `orpc` or `trpc`, a procedure is named by the `operationId` of its route
|
|
338
|
+
and called at that name: renaming it, giving a `GET` route another method (a tRPC query becomes a
|
|
339
|
+
mutation) or having a route receive a file breaks a front end already deployed, which answers
|
|
340
|
+
404 or calls it the wrong way. The table "Breaking or not" of the `document` skill lists these
|
|
341
|
+
three changes, the client SDK guide says it, and the `architecture-reviewer` agent reports them
|
|
342
|
+
from the diff of `openapi/`, blocking unless the change says its consumers move with it.
|
|
343
|
+
|
|
344
|
+
**`generate property <context> <ValueObject>` writes the laws of a value object as a spec on generated values.** The spec lands beside the spec of the value object (`test/unit/<name>.vo.properties.spec.ts`), with an arbitrary built on its factory (`any<Name>()`), a first law (the value is equal to the one created again from its own value) and one planned rule per kind of law (an invariant after each operation, a symmetry, a round trip), under Vitest and Jest, for value objects that throw or return a `Result`. `fast-check` joins the development dependencies when the project does not have it yet; that write is a shared one, so a worker confined to its context runs the kind with `--local-only` once fast-check is there. The value object must exist: the refusal names the command that creates it.
|
|
345
|
+
|
|
346
|
+
**`ddd-ts-kit check --baseline write` records the errors an existing codebase already has, and `check` then reports only new ones.** The errors of the checker are counted by file and by rule in `ddd-ts-kit-baseline.json`, the shape of `eslint-suppressions.json`. While a file has no more errors of a rule than the baseline records, `check` and `check-file` (the hook of the agent) leave them quiet; once it has more, all of them are reported. A recorded count the project no longer reaches fails `check` until `check --baseline prune` lowers it, so the baseline only shrinks. Warnings are not recorded. Writing it is a decision of the project owner, who runs the command in a terminal: the guard of the plugin refuses `check --baseline write` and any direct edit of the file to an agent, under Claude Code, Codex and Copilot alike, and the permissions `init` writes ask before both for an agent without the plugin. `check --baseline prune` is free.
|
|
347
|
+
|
|
348
|
+
To move: in a project initialised before this version, run `npx ddd-ts-kit init` again: it adds the two permissions to `.claude/settings.json` and names them.
|
|
349
|
+
|
|
350
|
+
**`ddd-ts-kit check` refuses in a context the tools of Nest that the kit does its own way, and says which tool of the kit to use instead (`nest/no-parallel-pipeline`).**
|
|
351
|
+
The routes of the kit are mounted under Nest, not through its pipeline: a Nest guard, pipe,
|
|
352
|
+
exception filter or interceptor never sees them, and a Nest controller written in a context was
|
|
353
|
+
a route the checker let through, with no declared security, no problem codes and no place in the
|
|
354
|
+
contract (`authz/declared` judged the controllers of the kit only). The new rule, an error,
|
|
355
|
+
reports in `presentation/`, `infrastructure/` and the module file of a context, tests apart: a
|
|
356
|
+
controller and its decorators, a guard, a pipe, an exception filter or an `HttpException`, an
|
|
357
|
+
interceptor or the `Logger` of `@nestjs/common`, and `@nestjs/core`, `@nestjs/swagger`,
|
|
358
|
+
`@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/jwt`, `@nestjs/schedule`, `@nestjs/bull(mq)`,
|
|
359
|
+
`@nestjs/config`, `@nestjs/throttler`, `@nestjs/cache-manager`, `@nestjs/event-emitter`, the ORM
|
|
360
|
+
modules of Nest and `@nestjs/terminus`. Each finding names the tool of the kit in its place. The
|
|
361
|
+
container of Nest (`@Injectable()`, `@Inject()` on an adapter bound as a provider), its WebSocket,
|
|
362
|
+
GraphQL, microservice and testing packages, and everything in the platform are left alone. The
|
|
363
|
+
HTTP frameworks guide gains "Where each tool of Nest goes", and the `wiring` skill `nest.md`.
|
|
364
|
+
|
|
365
|
+
To move: a project with Nest code in a context runs `npx ddd-ts-kit check` and replaces each
|
|
366
|
+
finding by the tool its message names (a Nest controller by `generate route`, a role guard by the
|
|
367
|
+
permission of the use case, an `HttpException` by a refusal of the code list), or moves what is
|
|
368
|
+
not a use case to the platform.
|
|
369
|
+
|
|
370
|
+
**A file that moves keeps the errors `ddd-ts-kit-baseline.json` records for it.** Adopting the kit is made of moving code into the canonical tree: `move-to-module`, `context-layout` and `platform-folders` now carry the entry of each file they move to its new path, and `check --baseline prune`, which an agent may run, follows the renames git sees since the baseline was committed (a `git mv`) before it lowers the counts. A count follows its file and is never raised, so a move silences nothing new. A file moved otherwise (a plain `mv` git does not see as a rename) still reports its errors at its new path, and its old entry fails until the owner writes the baseline again.
|
|
371
|
+
|
|
372
|
+
**A Nest controller is a route of the kit: `@KitRoute` on its method, `createControllersModule` of `@ddd-ts-kit/http/nest` to serve it.**
|
|
373
|
+
A project on NestJS writes its controllers as Nest does (`@Controller`, `@Get`, `@Post`,
|
|
374
|
+
`@Param`, `@Query`, `@Headers`, `@Body` with a DTO class, `@HttpCode`, injection by constructor),
|
|
375
|
+
and adds `@KitRoute({ operationId, summary, guards, errors, response })` to each method,
|
|
376
|
+
`@KitRoutes({ guards, tags, errors })` to the class for what its routes share. The kit, not Nest's
|
|
377
|
+
router, serves the method, through the pipeline of every route: guards, validation of the DTO
|
|
378
|
+
(`schemaOfClass: classSchema`), problem documents, tracing, the contract, and a procedure over
|
|
379
|
+
`/rpc` and `/trpc`. `@CurrentActor()` hands the method the caller the authentication resolved;
|
|
380
|
+
`@RouteContext()` the context of the request. `nestControllerRoutes` gives the same routes without
|
|
381
|
+
Nest's container, for the contract and the procedures. What the kit's pipeline would not run is
|
|
382
|
+
refused when the routes are built: `@UseGuards`, `@UsePipes`, `@UseInterceptors`, `@UseFilters`,
|
|
383
|
+
`@Header`, `@Redirect`, `@Render`, `@Sse`, `@Version`, pipes on a parameter, `@Req`, `@Res`; a
|
|
384
|
+
route with no guard is refused; a controller also among the `controllers` of a Nest module stops
|
|
385
|
+
the start. The metadata Nest's decorators record is read in one place, checked on each read, and
|
|
386
|
+
held by a test on the Nest the kit is released with.
|
|
387
|
+
|
|
388
|
+
**`nest/no-parallel-pipeline` lets a Nest controller the kit serves declare its routes with Nest's decorators, and refuses anywhere a controller Nest serves that reaches a use case.**
|
|
389
|
+
In a context, a file that imports `KitRoute` of `@ddd-ts-kit/http/nest` may use `@Controller`,
|
|
390
|
+
`@Get`, `@Post` and the other methods, `@Param`, `@Query`, `@Headers`, `@Body` and `@HttpCode` of
|
|
391
|
+
Nest: the kit reads them and serves the route through its own pipeline. The raw request and answer
|
|
392
|
+
(`@Req`, `@Res`, `@Header`, `@Redirect`, `@Render`, `@Sse`, uploads), guards, pipes, filters and
|
|
393
|
+
interceptors of Nest stay refused there. Outside the contexts, under the source root and outside
|
|
394
|
+
the tests, a file that imports `Controller` of `@nestjs/common`, not `KitRoute`, and names
|
|
395
|
+
`CommandBus` or `QueryBus` or imports a file of a context is reported: a controller Nest serves
|
|
396
|
+
that reaches a use case has no declared security, no problem codes and no place in the contract,
|
|
397
|
+
and moving it to the platform no longer hides it. A controller of the platform that reaches no
|
|
398
|
+
use case (health, metrics) is left alone.
|
|
399
|
+
|
|
400
|
+
To move: a Nest controller of the platform that sends commands or queries gets `@KitRoute` on each
|
|
401
|
+
method and moves to `createControllersModule`, or becomes a route of the context.
|
|
402
|
+
|
|
403
|
+
**A method of a Nest controller the kit serves that returns a value without `response.body` is refused, instead of answering an empty body.**
|
|
404
|
+
In Nest, what a method returns is the body of the answer; under `@KitRoute` the kit answers the
|
|
405
|
+
body its `response.body` declares, as the contract does, and dropped what an undeclared method
|
|
406
|
+
returned without a word. The routes are now refused when they are built if TypeScript recorded
|
|
407
|
+
that the method returns a value (`design:returntype`, under `emitDecoratorMetadata`), and an
|
|
408
|
+
`async` method, whose recorded type is only `Promise`, is refused at the call: a 500, the reason
|
|
409
|
+
told to `onError`.
|
|
410
|
+
|
|
411
|
+
To move: give `response: { body }` to each `@KitRoute` whose method returns what the caller reads,
|
|
412
|
+
or return nothing.
|
|
413
|
+
|
|
414
|
+
**The guard of the plugin finds the CLI a workspace hoisted to a parent directory.** It looked for `node_modules/.bin/ddd-ts-kit` in the project only, so in a project of an npm or pnpm workspace, whose install lands at the root of the monorepo, it found none and skipped, without a word, every check that needs the CLI: the check of each written file, the refusal to stop while errors remain, the gates of a story. It now looks where Node would, from the project up to the root of the filesystem.
|
|
415
|
+
|
|
416
|
+
To move: in a project of a workspace, the guard now runs those checks. Run `npx ddd-ts-kit check` before updating the plugin: an error it reports would otherwise first appear as a refusal to end a session.
|
|
417
|
+
|
|
418
|
+
**A project generated on an ORM holds the stores of the kit, as its platform wires them, to their contracts; and the test database of a Drizzle project has its unique indexes.**
|
|
419
|
+
|
|
420
|
+
`init` writes `src/platform/database/persistence.contract.spec.ts` on Knex, Drizzle, Prisma and TypeORM: the outbox, processed-event, job and process stores of `Persistence`, on the database of `open-test-database.ts`, run the contracts of `@ddd-ts-kit/testing` with what the stack turns on (`carriesTenant` and `storeInTenant` under `--tenancy`, the unit of work of a step with `--queue database`), and the event store with its snapshots, checkpoints and keys under `--event-sourcing on`. A store bound without the tenant the stack asks for now fails a spec of the project. On Drizzle, `table-statements.ts` creates the unique indexes and constraints of `schema.ts` too: the in-process database of the tests lacked the one of `background_jobs`, so a job enqueued in a spec failed with `there is no unique or exclusion constraint matching the ON CONFLICT specification`.
|
|
421
|
+
|
|
422
|
+
Run for real at night on Prisma (NestJS, Jest, Kafka, shared tables, the jobs in the database) and on TypeORM, installed from the packed kit, three more things came out, now fixed: under Jest, a port that a module file wiring by hand never loads counted as uncovered code and dropped the domain under its floor from the first use case, so the ports (abstract members only, `ports/abstract-class`) are no longer measured, under Vitest or Jest; knip reported `prisma/schema.prisma` as outside the project on Prisma, and `data-source.ts`, which only the TypeORM CLI loads, as unused on TypeORM.
|
|
423
|
+
|
|
424
|
+
To move: on a project generated before, `init --force` writes the spec and the new `table-statements.ts`; a Drizzle project that copied `table-statements.ts` by hand adds `uniqueIndexStatements` from the new template; `knip.json` gets `"prisma/**/*.prisma"` in `project` on Prisma, and the data source in `entry` on TypeORM.
|
|
425
|
+
|
|
426
|
+
**`init --routes nest` makes a Nest controller what `generate route` writes: Nest builds it with the bus it injects, the kit serves it.**
|
|
427
|
+
A new form of `stack.routes`, `nest`, for a project on `--http nest` with class-validator. `generate
|
|
428
|
+
route` writes `<use-case>.controller.ts` with Nest's `@Controller()`, `@Post` or `@Get`, `@Param`,
|
|
429
|
+
`@Body` typed by the DTO classes beside it, `@CurrentActor()` for the caller, the bus injected by
|
|
430
|
+
Nest (`@Inject(CommandBus)`), and `@KitRoute` and `@KitRoutes({ group })` of
|
|
431
|
+
`@ddd-ts-kit/http/nest`; the module of the context lists it under `controllers`, the application
|
|
432
|
+
composes its routes with the others (`nestControllers`), and the Nest module of the platform builds
|
|
433
|
+
it with the buses of the platform (`provideControllers`). The routes keep the guarantees of every
|
|
434
|
+
route: the guards of the group, validation, problem documents, the contract, and the procedures
|
|
435
|
+
over `/rpc` and `/trpc`. A search stays a controller of the kit (`generate controller`), and
|
|
436
|
+
`--mapper` and `--serializer` are left out: the method maps its input and its answer itself.
|
|
437
|
+
|
|
438
|
+
`@ddd-ts-kit/http/nest` gains `nestControllers`, `provideControllers` and `nestControllerRoute`,
|
|
439
|
+
and `@KitRoutes` a `group`, a route group of the kit whose prefix, tags, guards and codes come first.
|
|
440
|
+
|
|
441
|
+
To move: a new Nest project passes `--routes nest`; an existing one keeps its routes, and a context
|
|
442
|
+
that gets Nest controllers needs the `controllers` list of the module file and the composition of
|
|
443
|
+
the platform that `init --force --routes nest` writes.
|
|
444
|
+
|
|
445
|
+
**On trial, `"dependenciesBeforeWrite": true` has the guard of the plugin refuse, before the write, a new import that breaks a dependency rule.** The lines a session is about to add to a TypeScript file (the content of a `Write`, the replacements of an `Edit`, the added lines of a Codex patch), less those the file already held, are judged by `layer/domain-purity`, `layer/application-inward`, `layer/infrastructure-no-presentation`, `layer/presentation-no-infrastructure` and `context/published-language-only`, and the write is refused with the message of the checker, under Claude Code, Codex and Copilot; the file never reaches the disk with the import. The other rules stay after the write. The key is off by default. `ddd-ts-kit check-file` gains `--content-from <file>`, which judges a given text as the content of the path, and `--rule <id>`. Each judged write is recorded, on the machine only, in `.git/ddd-ts-kit/before-write.jsonl` of the repository (the file, the rules refused, the time the check took), so that the trial can be decided on what it did; the example application runs it.
|
|
446
|
+
|
|
447
|
+
**`@KitRoute` is optional: each method of a Nest controller the kit serves that carries a route decorator of Nest is a route, named after the method.**
|
|
448
|
+
`@Post`, `@Get` and the other route decorators of Nest are enough: the route is named by the
|
|
449
|
+
method (`issueInvoice`), summed up by its name as a sentence (`Issue invoice`), behind the guards
|
|
450
|
+
of `@KitRoutes` on the class. `@KitRoute` says only what Nest does not: another name, guards of its
|
|
451
|
+
own, the refusals it answers, the body it answers (a method that returns a value without it is
|
|
452
|
+
still refused, never answered empty). `generate route` under `"stack.routes": "nest"` no longer
|
|
453
|
+
writes the name and the summary, and `nest/no-parallel-pipeline` takes a file that imports
|
|
454
|
+
`KitRoutes` alone for a controller the kit serves. The docs say that a generated controller
|
|
455
|
+
injects the buses only, the providers the platform gives Nest.
|
|
456
|
+
|
|
457
|
+
**A project without a database (`--orm custom` or `none`) and with `--cache redis` compiles again: its outbox relay is woken by its own store alone.**
|
|
458
|
+
|
|
459
|
+
`main.ts` (and the `main.ts` of each extracted service) gave the relay two `wakeOn` keys, the signal of the in-memory persistence and the Redis signal, which TypeScript refuses (`An object literal cannot have multiple properties with the same name`). An outbox kept in the memory of the process is relayed by that process alone, so the Redis signal, which wakes the relay of another process, is no longer created there; with a database it stays. Found by the stacks that now meet every pair of capability values, generated and type-checked at night and before a release.
|
|
460
|
+
|
|
461
|
+
To move: on such a project, `init --force` writes `main.ts` and the Redis services again; by hand, remove `wakeOn: redis.relaySignal` from `main.ts`.
|
|
462
|
+
|
|
463
|
+
**A criterion of a story that states a law over every value of a value object becomes a property.** In the design review of the `story` skill, such a criterion ("never negative", "the total equals the sum of its lines", "overlaps the other in both directions or in none") gets a `Laws: <ValueObject>: <law>` line in the section of its row, and the build of the row states it with `generate property`, the law its title; the criterion keeps its scenarios in the acceptance. Measured on the example before its specs were hardened: the property of symmetry of `Range.overlaps` kills a mutant of a bound (`<` to `<=`) that its examples let through.
|
|
464
|
+
|
|
465
|
+
**What a method of a Nest controller answers is its signature: the kit reads it into a generated `<context>.controllers.ts`, and `@KitRoute` no longer says it.**
|
|
466
|
+
Under `"stack.routes": "nest"`, `ddd-ts-kit generate`, `docs` and the `dev` script write
|
|
467
|
+
`<context>.controllers.ts` at the root of each context: its Nest controllers, each with what its
|
|
468
|
+
route methods answer as their signatures say it (`Promise<IssuedInvoice>` a DTO class,
|
|
469
|
+
`Promise<Accepted>` an identifier, `Promise<void>` nothing), through `withAnswers` of
|
|
470
|
+
`@ddd-ts-kit/http/nest`. The module of the context lists them from that file, so `generate route`
|
|
471
|
+
no longer touches it, and the generated controller declares in `@KitRoute` its validation and its
|
|
472
|
+
refusal codes only, its status through `@HttpCode` of Nest when Nest would answer another. The
|
|
473
|
+
check `nest/controllers-current` keeps the file current and reports a route method whose answer
|
|
474
|
+
the kit cannot read into a schema (an array, an inline type, an interface, no type) and whose
|
|
475
|
+
`@KitRoute` declares no `response`. A DTO without a decorated field accepts the empty object
|
|
476
|
+
alone, as `whitelist` and `forbidNonWhitelisted` refuse any field.
|
|
477
|
+
|
|
478
|
+
To move: a project on `--routes nest` runs `npx ddd-ts-kit docs` once, and its context modules
|
|
479
|
+
list `<context>Controllers` from the generated file in place of their `controllers` list.
|
|
480
|
+
|
|
7
481
|
## 0.90.0
|
|
8
482
|
|
|
9
483
|
**A generated project forces qs `^6.16.0`, and multer `^2.5.0` on Nest, where its stack still pins the vulnerable versions; one on Fastify asks for `fastify` `^5.12.7`.** Stryker 10.1 asks for `typed-rest-client` 2.3, which asks for qs 6.15.1 exactly (three denials of service, moderate), and `@nestjs/platform-express`, up to 12.2.0, asks for multer 2.4.0 exactly (a denial of service through a pending `fileFilter`, high). `init` forces the fixed versions in `overrides` of `package.json` under npm, and of `pnpm-workspace.yaml` under pnpm, which reads nothing of `package.json`. An override the project already sets for one of them is kept, and said, unless `--force`. Fastify 5.12.2 to 5.12.5 let a request header go around the validation of a schema whose `propertyNames` reads it by case (low).
|