ddd-ts-kit 0.91.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 +189 -0
- package/README.fr.md +16 -12
- package/README.md +15 -10
- 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/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/fixtures/nest-controllers-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/nest-controllers-fixtures.js +21 -3
- package/dist/check/fixtures/nest-controllers-fixtures.js.map +1 -1
- package/dist/check/nest/nest-equivalents-of.d.ts.map +1 -1
- package/dist/check/nest/nest-equivalents-of.js +7 -2
- package/dist/check/nest/nest-equivalents-of.js.map +1 -1
- package/dist/check/rules/nest-controllers-current.d.ts.map +1 -1
- package/dist/check/rules/nest-controllers-current.js +13 -2
- package/dist/check/rules/nest-controllers-current.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/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/stack.d.ts +1 -1
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +1 -1
- 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/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-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/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/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 +2 -2
- package/dist/generate/kinds/route/nest-controller-vars.js +3 -9
- package/dist/generate/kinds/route/nest-controller-vars.js.map +1 -1
- 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/write-nest-controller.d.ts.map +1 -1
- package/dist/generate/kinds/route/write-nest-controller.js +6 -8
- package/dist/generate/kinds/route/write-nest-controller.js.map +1 -1
- package/dist/generate/kinds/route-kind.js +1 -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/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 +3 -1
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.js +10 -6
- package/dist/init/agent-permissions.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/platform-files.js +1 -0
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/knip-vars.js +4 -3
- 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.map +1 -1
- package/dist/init/manifest/dependencies-against-stack.js +5 -1
- package/dist/init/manifest/dependencies-against-stack.js.map +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +7 -1
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +34 -30
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/stack/resolve-stack.js +9 -7
- package/dist/init/stack/resolve-stack.js.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/nest-answer.d.ts +2 -10
- package/dist/nest-controllers/nest-answer.d.ts.map +1 -1
- package/dist/nest-controllers/nest-controller-entry.d.ts +4 -2
- package/dist/nest-controllers/nest-controller-entry.d.ts.map +1 -1
- 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 +6 -9
- package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -1
- package/dist/nest-controllers/read-nest-controllers.js +10 -82
- package/dist/nest-controllers/read-nest-controllers.js.map +1 -1
- package/dist/nest-controllers/render-controllers-file.d.ts +4 -3
- package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -1
- package/dist/nest-controllers/render-controllers-file.js +45 -29
- package/dist/nest-controllers/render-controllers-file.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/identity-refusal.js +3 -3
- package/dist/presets/identity-refusal.js.map +1 -1
- package/dist/presets/preset-files.d.ts.map +1 -1
- package/dist/presets/preset-files.js +3 -1
- package/dist/presets/preset-files.js.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/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/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/background-job/wiring.manual.tpl +1 -1
- package/templates/command/wiring.manual.tpl +1 -1
- package/templates/context/module.manual.ts.tpl +41 -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/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 +5 -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 +5 -2
- 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 +5 -0
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +5 -0
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +5 -0
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +5 -0
- package/templates/init/platform/database/persistence.contract.spec.ts.tpl +18 -0
- package/templates/init/platform/database/persistence.memory.ts.tpl +7 -1
- package/templates/init/platform/database/persistence.orm.ts.tpl +9 -1
- package/templates/init/platform/database/schema.drizzle.ts.tpl +11 -1
- package/templates/init/platform/database/schema.prisma.tpl +2 -1
- package/templates/init/platform/database/schema.typeorm.ts.tpl +1 -1
- package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +18 -6
- package/templates/init/platform/http/start-http-server.express.ts.tpl +10 -1
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +6 -1
- package/templates/init/rules/presentation.md.tpl +1 -1
- 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.ts.tpl +1 -17
- 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/package-scripts.json +2 -2
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +17 -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/organisation.repository.contract.spec.ts.tpl +1 -1
- package/templates/presets/identity/context/test/unit/__context__.module.spec.explicit.ts.tpl +13 -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/process/timeout-job.wiring.manual.tpl +1 -1
- 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/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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,195 @@ 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
|
+
|
|
7
196
|
## 0.91.0
|
|
8
197
|
|
|
9
198
|
**The background jobs and the process instances go to the database by default on every ORM of
|
package/README.fr.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](README.md) · **Français**
|
|
2
|
-
<!-- translation-of: README.md sha256:
|
|
2
|
+
<!-- translation-of: README.md sha256:f9728c17b021be67 -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit
|
|
5
5
|
|
|
@@ -61,14 +61,14 @@ ddd-ts-kit init [--http express|fastify|hono|nest|none]
|
|
|
61
61
|
[--database postgres|mysql|sqlite|none]
|
|
62
62
|
[--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]
|
|
63
63
|
[--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]
|
|
64
|
-
[--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]
|
|
64
|
+
[--authn jwt|keycloak|passport|none] [--authz rbac|abac|rebac|custom]
|
|
65
65
|
[--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis]
|
|
66
66
|
[--http-cache none|varnish] [--storage local|s3|none] [--audit on|off]
|
|
67
67
|
[--event-sourcing on|off] [--privacy on|off]
|
|
68
68
|
[--errors none|sentry] [--logger stdout|pino|winston]
|
|
69
69
|
[--style declared|explicit] [--assembly barrel|discovery]
|
|
70
70
|
[--dependencies signature|listed] [--refusals named|factories|classes]
|
|
71
|
-
[--routes controllers|functions] [--value-objects throwing|result]
|
|
71
|
+
[--routes controllers|functions|nest] [--value-objects throwing|result]
|
|
72
72
|
[--literals named|free] [--values classes|free] [--tenancy none|shared-table]
|
|
73
73
|
[--queue database|redis|memory]
|
|
74
74
|
[--schemas shared|per-route]
|
|
@@ -124,8 +124,9 @@ Un import d'un fichier du projet s'écrit sans extension
|
|
|
124
124
|
émis. Une configuration sans cette clé se lit comme `js`, si bien qu'un projet généré avant
|
|
125
125
|
l'existence de la clé garde son écriture. Voir [docs/CONFIG.fr.md](../../docs/CONFIG.fr.md).
|
|
126
126
|
|
|
127
|
-
Valeurs par défaut : `express`, `zod
|
|
128
|
-
|
|
127
|
+
Valeurs par défaut : `express`, `zod` (`class-validator` avec `--http nest`, comme Nest valide),
|
|
128
|
+
`tsyringe` (`nest` avec `--http nest`, et seulement alors), des routes écrites en contrôleurs du
|
|
129
|
+
kit (des contrôleurs Nest avec `--http nest` sur class-validator, `--routes nest`), `vitest`, `drizzle` sur `postgres`, `outbox` quand il y a un ORM, `swagger`, `github`,
|
|
129
130
|
`jwt`, `rbac`, aucun *broker*, le cache dans le processus, les fichiers dans un répertoire local
|
|
130
131
|
(`--storage local`), le journal d'audit `on` quand il y a un ORM, les demandes d'une personne concernée traitées (`--privacy on`) quand il y a un ORM, pas d'event store (`--event-sourcing off`), les échecs inattendus remontés
|
|
131
132
|
nulle part (`--errors none`), des lignes JSON sur la sortie standard (`--logger stdout`), et le
|
|
@@ -562,11 +563,11 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
|
|
|
562
563
|
| traçage | câblé une fois, par la plateforme (`tracing/platform-only`) : pas de *hook* `decorate`, pas de `decorate-bindings.ts`. `tracing.ts` démarre `initTracing` de `@ddd-ts-kit/tracing/node` avant tout autre module, sur ce que valide `config/read-tracing.ts` : `OTEL_EXPORTER_OTLP_ENDPOINT` (une URL ; absente, aucun *span* ne sort du processus), `TRACE_SAMPLE_RATIO` (de 0 à 1) et `TRACE_CONSUMERS` (`continue`, par défaut : un événement consommé reste dans la trace de sa publication ; `link` : chaque livraison démarre une trace liée à elle). Avec `--di tsyringe` : `lay-foundations.ts` construit `traceApplication({ consumers })`, `compose-application.ts` la remet à `kernelModule({ instrumentation })` (un *span* par cas d'usage, appel de *repository*, événement du domaine, publication, consommateur et *job*) et donne au relais de l'outbox `tracedPublisher(bus)`. En câblage manuel : `create-platform.ts` applique lui-même les membres de `traceApplication()` (`useCase` sur les deux bus, `domainEvents`, `publisher`, `binding` autour de chaque adaptateur, `job`, `executionScope`, `errorReporter`), avec `tracedSubscriber` et `tracedPublisher` autour du fournisseur. Avec une *stack* HTTP, dans les deux familles, `auth/authentication/http-boundary.ts` pose `around: tracedRoutes()` : un *span* `SERVER` par requête HTTP, nommé d'après sa route |
|
|
563
564
|
| `--logger` | `src/platform/observability/create-logger.ts`, un par choix : `stdout` (par défaut) est le `StdoutLogger` de `@ddd-ts-kit/aspects`, des lignes JSON, identifiants de connexion non masqués ; `pino` est `createPinoLogger` de `@ddd-ts-kit/pino` (dépendances `pino` et `pino-pretty`) ; `winston` est `createWinstonLogger` de `@ddd-ts-kit/winston` ; ces deux-là masquent les clés d'identifiants de connexion du kernel. Chaque entrée porte `traceLogFields(scope)` : l'identifiant de corrélation, l'origine, l'acteur et le *tenant* du travail en cours, et les identifiants de la trace active. `LOG_LEVEL`, `LOG_FORMAT` (`json`, par défaut, ou `pretty` ; avec `stdout`, qui n'a pas de format lisible, `pretty` est refusé au chargement de la configuration) et `LOG_SCRUB_MESSAGES` (`[message removed]` à la place du message d'une erreur journalisée qui n'est pas une `DomainError`) sont validés dans `config/load-config.ts`. L'arrêt de l'application vide le tampon du *reporter* d'erreurs, puis celui du *logger*, en dernier : `container.stop()` le fait sur tsyringe, `compose-application.ts` le fait explicitement en câblage manuel. Les outils et les tests composent l'application sans `log` et n'écrivent rien |
|
|
564
565
|
| `src/platform/auth/` | un dossier par question : `authentication/` (qui appelle), `authorization/` (ce qu'il peut faire, quel que soit le modèle) et le dossier du modèle que nomme `stack.authz` (`roles/`, `attributes/`, `relationships/` ou `custom/`). Un projet généré avant les dossiers garde ses fichiers à plat : les générateurs les y lisent, `npx ddd-ts-kit doctor` le signale et `npx ddd-ts-kit platform-folders` les déplace avec chaque import |
|
|
565
|
-
| `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt` : `JwtAuthenticator` sur `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI` ; `--authn keycloak` : `keycloakAuthenticator` sur `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` et l'optionnel `KEYCLOAK_CLIENT_ID` ; `--authn none` : `development-header-authenticator.ts` et `development-actor-header.ts`, qui lisent `x-development-actor` et lèvent une erreur en production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` qui répond une `Session`, `executionScope`, `errorMapper` et `onError`, étalés dans les options de montage : chaque requête HTTP s'exécute dans la portée d'exécution, avec son identifiant de corrélation). Sans *stack* HTTP, il n'y a ni authentificateur ni frontière, ni dossier |
|
|
566
|
+
| `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt` : `JwtAuthenticator` sur `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI` ; `--authn keycloak` : `keycloakAuthenticator` sur `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` et l'optionnel `KEYCLOAK_CLIENT_ID` ; `--authn passport` : `passportAuthenticator` de `@ddd-ts-kit/auth/passport` sur `bearer-strategy.ts`, la stratégie de `passport-jwt` sur le jeu de clés que publie `AUTH_JWKS_URI` (`jwks-rsa`), `AUTH_ISSUER` et `AUTH_AUDIENCE`, et `actor-of-token.ts`, qui lit sa charge utile avec `actorOfClaims` ; `--authn none` : `development-header-authenticator.ts` et `development-actor-header.ts`, qui lisent `x-development-actor` et lèvent une erreur en production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` qui répond une `Session`, `executionScope`, `errorMapper` et `onError`, étalés dans les options de montage : chaque requête HTTP s'exécute dans la portée d'exécution, avec son identifiant de corrélation). Sans *stack* HTTP, il n'y a ni authentificateur ni frontière, ni dossier |
|
|
566
567
|
| `src/platform/auth/authorization/` | `create-authorizer.ts`, `authorization.ts` (`authorizationModule` avec tsyringe) ou `use-case-protection.ts` (la garde des bus câblés à la main), `access-policies.ts`, `role.ts` (les rôles que porte un identifiant, avec des rôles ou des attributs, ou dès qu'une garde en nomme un), `permissions.ts` (le registre de toutes les permissions, avec des relations ou un authorizer à vous), `signed-in-grants.ts` dès qu'un *preset* de contexte accorde à toute personne connectée, et avec `--audit off` `log-decisions.ts` (une entrée de journal par décision, identifiants et codes seulement) |
|
|
567
568
|
| `src/platform/auth/<modèle>/` | `roles/roles.ts` (avec le rôle `system` que détient chaque acteur système) ; `attributes/attribute-policies.ts` ; `relationships/` : `relationship-schema.ts`, `create-tuple-store.ts` et sa *spec* de contrat, `relation-tuples.ts`, `relate-system-actors.ts` ; `custom/` : `custom-authorizer.ts` et sa *spec* `authorizerContract` |
|
|
568
569
|
| `--representations negotiated`, `--forms on` | `src/platform/http/presentation-of.ts` (`Representations.standard()` avec `negotiated`, et `fieldDeciderOf` sur l'`Access` de l'application), décomposé dans la frontière HTTP et donné au script du contrat ; avec `--forms on`, `src/platform/http/with-forms.ts` ajoute `formRoutes` aux routes et `scripts/openapi.ts` écrit `openapi/forms/<operationId>.json`. Les deux sont la valeur par défaut avec une *stack* HTTP ; `json` et `off` les laissent de côté ([docs/CONFIG.fr.md](../../docs/CONFIG.fr.md)) |
|
|
569
|
-
| `--audit on` | `src/platform/audit/` : `create-audit.ts` (le journal, le `onDecision` de l'autorisation, les refus des gardes à la frontière remis à la frontière HTTP comme `onGuardRefusal`, le *middleware* avant l'unité de travail, les événements d'intégration abonnés sous le nom de consommateur `audit`), `audited-events.ts` (le registre auquel `generate integration-event` ajoute), `audit.module.ts`, et avec une *stack* HTTP le côté lecture : `audit.permissions.ts` (`audit:trail.read`), puis dans `search-audit-entries/` : `search-audit-entries.query.ts`, son gestionnaire, `search-audit-entries.route.ts` ou `.controller.ts` (`GET /audit/entries` : pages par curseur, filtres `actorId`, `action`, `outcome`, `correlationId`), qui commence par le point d'entrée et prend ce qu'il reçoit et répond dans `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` et `audit-outcomes.ts`. C'est une capacité de la plateforme, pas un contexte délimité : pas de modèle, une requête protégée sur le port `AuditReader`, bornée par le *tenant* de l'acteur (avec `--tenancy shared-table`, par le *tenant* du travail au moyen de `TenantAuditReader` : le personnel de la plateforme ne lit à travers les *tenants* qu'à l'intérieur de `acrossTenants`). Les refus d'un appelant sans identifiant de connexion ne sont pas enregistrés. Un *job* planifié est audité comme une requête HTTP : origine `schedule`, acteur `system:<context>.<job>`. Avec knex, les deux tables et leurs déclencheurs en ajout seul sont créés par la première migration ; avec drizzle, les tables sont dans `schema.ts` et `npm run db:
|
|
570
|
+
| `--audit on` | `src/platform/audit/` : `create-audit.ts` (le journal, le `onDecision` de l'autorisation, les refus des gardes à la frontière remis à la frontière HTTP comme `onGuardRefusal`, le *middleware* avant l'unité de travail, les événements d'intégration abonnés sous le nom de consommateur `audit`), `audited-events.ts` (le registre auquel `generate integration-event` ajoute), `audit.module.ts`, et avec une *stack* HTTP le côté lecture : `audit.permissions.ts` (`audit:trail.read`), puis dans `search-audit-entries/` : `search-audit-entries.query.ts`, son gestionnaire, `search-audit-entries.route.ts` ou `.controller.ts` (`GET /audit/entries` : pages par curseur, filtres `actorId`, `action`, `outcome`, `correlationId`), qui commence par le point d'entrée et prend ce qu'il reçoit et répond dans `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` et `audit-outcomes.ts`. C'est une capacité de la plateforme, pas un contexte délimité : pas de modèle, une requête protégée sur le port `AuditReader`, bornée par le *tenant* de l'acteur (avec `--tenancy shared-table`, par le *tenant* du travail au moyen de `TenantAuditReader` : le personnel de la plateforme ne lit à travers les *tenants* qu'à l'intérieur de `acrossTenants`). Les refus d'un appelant sans identifiant de connexion ne sont pas enregistrés. Un *job* planifié est audité comme une requête HTTP : origine `schedule`, acteur `system:<context>.<job>`. Avec knex, les deux tables et leurs déclencheurs en ajout seul sont créés par la première migration ; avec drizzle, les tables sont dans `schema.ts` et `npm run db:generate` ajoute les instructions des déclencheurs à la migration qui crée les tables (`npm run db:audit-guard` les affiche pour une migration écrite à la main) ; avec prisma et typeorm, les tables sont des modèles de `prisma/schema.prisma` ou des entités de `schema.ts` (`auditPrismaModels`, `auditEntities` de `@ddd-ts-kit/audit`), écrites par `PrismaAuditTrail` et `TypeOrmAuditTrail`, et `npm run db:generate` (par `ddd-ts-kit prisma-generate` ou `typeorm-generate`) ajoute les instructions des déclencheurs à la migration qui crée les tables, `npm run db:audit-guard` les affichant pour une migration écrite à la main ; les bases de test installent ce garde ; avec `custom` ou sans ORM, le journal est un `InMemoryAuditTrail` derrière un `TODO(platform)`. Les bases de test laissent le schéma d'audit hors de `reset()`. Avec le journal en base et `--storage local` ou `s3`, `audit.module.ts` (ou la composition câblée à la main) enregistre `audit.archive` le premier jour de chaque mois à 04:00 UTC : les entrées de plus de douze mois entiers partent dans le stockage sous `audit-archives/`, vérifiées, relues et ancrées (`ArchiveAuditEntries`) ; avec `s3` il tourne sauf `JOB_AUDIT_ARCHIVE_ENABLED=false`, avec `local` seulement avec `JOB_AUDIT_ARCHIVE_ENABLED=true`, puisque l'archive supprime les entrées de la base et que le disque du serveur peut ne pas durer |
|
|
570
571
|
| `--event-sourcing on` | enregistré comme `stack.eventSourcing`, `off` sauf demande : `Persistence` gagne `eventSourcing` (`create<Orm>EventSourcing` dans le schéma `event_store`, dont le fichier de schéma déclare les cinq tables ; les stores en mémoire avec `--orm none`), et `src/platform/event-sourcing/` : `create-event-sourcing.ts` (`EventSourcing` : les stores, le `SubjectKeyStore` enveloppé par `auditedSubjectKeys` avec `--audit on`, et le `PersonalDataCipher` par-dessus) et, avec tsyringe, `event-sourcing.module.ts` (lie `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` et `PersonalDataCipher`, pour qu'un adaptateur de *repository* *event-sourced* les nomme dans son constructeur ; la `Platform` câblée à la main les porte comme `platform.eventSourcing`) ; `platform-test.module.ts` lie les stores en mémoire, pour qu'une *spec* de gestionnaire d'un agrégat *event-sourced* n'ait besoin d'aucun *fake*. `generate aggregate --event-sourced` est refusé sans lui, avec le `init --force --event-sourcing on` à lancer. Refusé avec `--orm custom` : l'event store du kit tourne sur PostgreSQL par les quatre paquets d'ORM |
|
|
571
572
|
| `--privacy on` | enregistré comme `stack.privacy`, `on` quand il y a un ORM : `src/platform/privacy/`, avec `data-subject-copies.ts` et `data-subject-exports.ts` (les ports, ou les adaptateurs à la main, des contextes qui étendent `PersonalDataErasure` et `PersonalDataExport`, entre marqueurs ; `generate repository --personal` y liste l'effacement et l'export d'un contexte), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, tenants? })` : un contexte d'exécution d'origine `cli` avec l'opérateur pour acteur, la clé de la personne quand le projet a un event store, puis `eraseDataSubject` du kernel sur les copies, `inEachTenant` avec `--tenancy shared-table`, puis `privacy.data-subject.erased` publié par l'outbox, une fois par *tenant*) et `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })` : `exportDataSubject` du kernel sur les exports, chacun enveloppé par `auditedPersonalDataExport` avec `--audit on`, `recordsInEachTenant` avec `--tenancy shared-table`, un `PersonalDataExportDocument` daté), et les deux scripts ci-dessous. `docs/privacy/register.md`, le registre des données personnelles que `ddd-ts-kit docs` tient (voir `docs` plus bas). Un projet sans donnée personnelle prend `--privacy off` et ne paie rien. Aucune commande HTTP n'efface encore : les deux scripts sont les points d'entrée |
|
|
572
573
|
| `--tenancy shared-table` | enregistré comme `stack.tenancy` ; les quatre ORM. Chaque `generate repository` est cloisonné par *tenant* (comme `--tenant-scoped`), au moyen de `tenantTable` et `ownTenantTable` (Knex), de `tenantCondition` et `ownTenantCondition` (Drizzle), de `tenantWhere` et `ownTenantWhere` (Prisma, TypeORM) ; l'outbox garde le *tenant* de chaque événement (`createOutboxTables(knex, { tenant: true })` et le `tenant: true` de `KnexOutboxStore`, `tenantOutboxTable`, le champ `tenantId` du modèle Prisma et le `tenant: true` de `PrismaOutboxStore`, `outboxEntity({ tenant: true })`), si bien que les consommateurs s'exécutent dans ce *tenant* ; `tenancy/scoped-statement` juge les adaptateurs. La sécurité au niveau des lignes, un schéma par *tenant* et une base par *tenant* sont refusés, avec ce qu'il faut câbler à la main ([Multitenance](../../docs/concepts/multitenancy.fr.md)) |
|
|
@@ -670,7 +671,7 @@ quoi que dise `--authz` : l'attribution `'identity:*'` de `platform/auth/authori
|
|
|
670
671
|
le *preset* écrit, et avec `--authn keycloak` l'authentificateur lit le *claim* `organization`
|
|
671
672
|
comme les *tenants* de la personne (un autre authentificateur reçoit une étape suivante qui dit
|
|
672
673
|
quoi faire correspondre). Le *preset* est écrit pour `declared` avec les dépendances `signature`,
|
|
673
|
-
`factories`, les objets-valeurs `throwing`, `controllers
|
|
674
|
+
`factories`, les objets-valeurs `throwing`, les routes `controllers` ou `nest` (des contrôleurs Nest, lus dans leurs signatures, sur un projet Nest), Knex ou Drizzle sur PostgreSQL, Zod ou
|
|
674
675
|
class-validator, Express ou Fastify, et un vérificateur de jeton (`jwt` ou `keycloak`) ; une
|
|
675
676
|
autre *stack* est refusée avec ce qu'il faut changer, de même qu'un second contexte écrit depuis
|
|
676
677
|
le même *preset*. Pourquoi, et quels autres contextes en méritent un :
|
|
@@ -718,7 +719,7 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
718
719
|
| Genre | Arguments | Écrit |
|
|
719
720
|
|---|---|---|
|
|
720
721
|
| `context` | `<name> --classification <c> [--purpose "<two sentences>"] [--term ...]... [--upstream <ctx>[:relationship]]... [--preset identity]` | `CONTEXT.md` avec son glossaire, `published-language/index.ts`, l'entrée de configuration, l'enregistrement dans `platform/composition/compose-application.ts` et dans `test/architecture/extractable.spec.ts` ; sur tsyringe, avec HTTP, `presentation/http/<name>.routes.ts` (une fonction des deux bus, dans les deux styles) ; déclaré : le barrel `<name>.declarations.ts` ; explicite et câblage manuel : `<name>.module.ts`. `<name>.permissions.ts`, à la racine du contexte, naît avec la première permission, ou tout de suite quand `platform/auth/authorization/permissions.ts` liste les ensembles de permissions (rebac, custom). Avec `--preset`, le contexte est ensuite écrit en entier depuis ce *preset*, sa classification et son objet étant ceux du *preset* sauf si les options disent autre chose ([Presets](#presets)) |
|
|
721
|
-
| `aggregate` | `<context> <Name> [--event-sourced]` | agrégat, *builder*, *spec* sur le modèle étant donné / quand / alors ; avec `--event-sourced`, un agrégat sur `EventSourcedAggregate` dont l'état est le rejeu de ses événements, né avec son événement du domaine `Created
|
|
722
|
+
| `aggregate` | `<context> <Name> [--event-sourced [--birth <Event>]]` | agrégat, *builder*, *spec* sur le modèle étant donné / quand / alors ; avec `--event-sourced`, un agrégat sur `EventSourcedAggregate` dont l'état est le rejeu de ses événements, né avec son événement du domaine `Created` (ou le fait que nomme `--birth <Event>`, vérifié contre le glossaire), le codec de ses événements stockés dans `infrastructure/persistence/<name>-events.mapper.ts`, un *builder* qui rejoue un historique et une *spec* à partir d'événements donnés, et une note qui nomme le `EventSourcedRepository` auquel délègue son adaptateur de *repository* ; refusé tant que `stack.eventSourcing` est `off`, avec le `init --force --event-sourcing on` à lancer |
|
|
722
723
|
| `builder` | `<context> <Aggregate>` | `test/builders/<name>.builder.ts`, une classe qui étend `Builder` |
|
|
723
724
|
| `test-world` | `<context> [Name]` | `test/worlds/<name>.world.ts` (le nom est par défaut celui du contexte) : `a<Name>World({ now, idPrefix, given })`, la mise en place que partagent plusieurs *specs* du contexte. Il lit les *fakes* de `test/fakes/` et le port que chacun implémente, les construit, les passe à `given` pour que la *spec* enregistre ce dont elle part, puis à l'application de test (avec `modules`, l'autorisation de la *spec*) ou, câblé à la main, enveloppe les *repositories* des bus de `createTestBuses` par `dispatching` ; il rend chaque *fake* sous le nom de son port. Un *fake* qui attend des arguments de constructeur, ou, avec un conteneur, celui d'un port que rien ne lie ni n'utilise encore, est laissé de côté avec une note |
|
|
724
725
|
| `entity` | `<context> <Name>` | entité, *spec* |
|
|
@@ -729,7 +730,7 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
729
730
|
| `domain-error` | `<context> <Name> [--code CODE]` | une classe par erreur avec un code stable, *spec* : la forme d'un projet dont la configuration dit `"stack.refusals": "classes"` ou rien. Refusé sous `named` et `factories`, avec la commande `generate error` à lancer à la place |
|
|
730
731
|
| `domain-service` | `<context> <Name>` | service, *spec* |
|
|
731
732
|
| `state-machine` | `<context> <Aggregate> [--value <state>]... [--transition "<intention>:<from>[,<from>]...[><to>]"]...` | le vocabulaire `<Aggregate>Status` (créé depuis `--value`, deux états au moins, ou complété des valeurs qui lui manquent), `domain/state-machines/<aggregate>.state-machine.ts` (`<aggregate>Lifecycle` : chaque valeur un état, la première initiale, les transitions demandées, un `TODO(domain)` pour le refus de l'erreur du concept) et `test/unit/<aggregate>.state-machine.spec.ts` (chaque transition là où elle mène, un refus depuis un état qu'elle ne quitte pas) ; c'est à l'agrégat de l'utiliser |
|
|
732
|
-
| `repository` | `<context> <Aggregate> [--tenant-scoped] [--personal <colonne>,... [--subject <colonne>] [--erasure pseudonymise\|row] [--retention <colonne>:<n><d\|m\|y>]]` | le port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), l'adaptateur de l'ORM du projet (qui `implements` le port) avec son *mapper* et sa table (ou son modèle), un *fake*, une *spec* `repositoryContract` exécutée sur les deux, l'enregistrement. Avec `--personal`, les colonnes de la table qui tiennent des données personnelles : ajoutées au stockage et au type de ligne en texte nullable (le *mapper* les écrit vides tant que l'agrégat ne les porte pas), déclarées à côté du *mapper* dans `<name>.personal-fields.ts` (`personalFields` du kernel : la colonne du sujet, `id` sauf si `--subject` nomme la colonne qui tient l'id de la personne, les champs, `pseudonymise` sauf `--erasure row`), épelées comme l'effacement de l'ORM les lit (noms SQL sur Knex et Prisma, propriétés sur Drizzle et TypeORM) ; et, une fois par contexte, son effacement : le port `application/ports/<context>-personal-data-erasure.port.ts` (`extends PersonalDataErasure`), l'adaptateur `<orm>-<context>-personal-data-erasure.repository.ts` sur `<Orm>PersonalDataErasure` du paquet d'ORM (confiné au *tenant* du travail avec `--tenant-scoped`), son *fake*, lié là où le contexte lie ses adaptateurs et listé dans `src/platform/privacy/data-subject-copies.ts`, pour que `npm run privacy:erase` l'atteigne ; et son export : le port `<context>-personal-data-export.port.ts` (`extends PersonalDataExport`), l'adaptateur `<orm>-<context>-personal-data-export.repository.ts` sur `<Orm>PersonalDataExport`, son *fake*, lié de même et listé dans `data-subject-exports.ts`, pour que `npm run privacy:export` le remette ; une seule *spec*, `test/integration/<context>-personal-data.spec.ts`, prouve les deux sur la base de test. Avec `--retention <colonne>:<n><d|m|y>`, la déclaration gagne `retention`, comptée depuis une colonne qui date la fin de la relation et rejoint le stockage en horodatage nullable, vide tant qu'elle dure (une colonne que la table garde pour elle, `registered_at` d'abord, est refusée : comptée depuis l'inscription, la purge effacerait des personnes encore clientes) et la *spec* prouve la purge de ce qui l'a dépassée. Une deuxième table du contexte rejoint les déclarations des deux adaptateurs. Refusé sans `stack.privacy` à `on` (`init --force --privacy on`), avec `--orm none` ou `custom`, et avant d'écrire quoi que ce soit pour une colonne qui n'en est pas une, une colonne que la table garde pour elle, un sujet listé comme personnel ou un mode qui n'existe pas |
|
|
733
|
+
| `repository` | `<context> <Aggregate> [--tenant-scoped] [--personal <colonne>,... [--subject <colonne>] [--erasure pseudonymise\|row] [--retention <colonne>:<n><d\|m\|y>]]` | le port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), l'adaptateur de l'ORM du projet (qui `implements` le port) avec son *mapper* et sa table (ou son modèle), un *fake*, une *spec* `repositoryContract` exécutée sur les deux, l'enregistrement. Sur un agrégat *event-sourced* (sa classe étend `EventSourcedAggregate`), ni table ni *mapper* : `event-store-<name>.repository.ts` délègue à `EventSourcedRepository` du kernel au-dessus de l'`EventStore` et du `PersonalDataCipher` que lie la plateforme, avec le codec de `<name>-events.mapper.ts` (la politique de *snapshot* laissée en `TODO(domain)`), le *fake* est cet adaptateur sur les stores en mémoire, et la suite de contrat s'exécute sur les deux (son cas de sauvegarde périmée en attente tant qu'un `mutate` qui enregistre un événement n'est pas ajouté) ; `--personal` y est refusé, les valeurs personnelles étant scellées dans les événements. Avec `--personal`, les colonnes de la table qui tiennent des données personnelles : ajoutées au stockage et au type de ligne en texte nullable (le *mapper* les écrit vides tant que l'agrégat ne les porte pas), déclarées à côté du *mapper* dans `<name>.personal-fields.ts` (`personalFields` du kernel : la colonne du sujet, `id` sauf si `--subject` nomme la colonne qui tient l'id de la personne, les champs, `pseudonymise` sauf `--erasure row`), épelées comme l'effacement de l'ORM les lit (noms SQL sur Knex et Prisma, propriétés sur Drizzle et TypeORM) ; et, une fois par contexte, son effacement : le port `application/ports/<context>-personal-data-erasure.port.ts` (`extends PersonalDataErasure`), l'adaptateur `<orm>-<context>-personal-data-erasure.repository.ts` sur `<Orm>PersonalDataErasure` du paquet d'ORM (confiné au *tenant* du travail avec `--tenant-scoped`), son *fake*, lié là où le contexte lie ses adaptateurs et listé dans `src/platform/privacy/data-subject-copies.ts`, pour que `npm run privacy:erase` l'atteigne ; et son export : le port `<context>-personal-data-export.port.ts` (`extends PersonalDataExport`), l'adaptateur `<orm>-<context>-personal-data-export.repository.ts` sur `<Orm>PersonalDataExport`, son *fake*, lié de même et listé dans `data-subject-exports.ts`, pour que `npm run privacy:export` le remette ; une seule *spec*, `test/integration/<context>-personal-data.spec.ts`, prouve les deux sur la base de test. Avec `--retention <colonne>:<n><d|m|y>`, la déclaration gagne `retention`, comptée depuis une colonne qui date la fin de la relation et rejoint le stockage en horodatage nullable, vide tant qu'elle dure (une colonne que la table garde pour elle, `registered_at` d'abord, est refusée : comptée depuis l'inscription, la purge effacerait des personnes encore clientes) et la *spec* prouve la purge de ce qui l'a dépassée. Une deuxième table du contexte rejoint les déclarations des deux adaptateurs. Refusé sans `stack.privacy` à `on` (`init --force --privacy on`), avec `--orm none` ou `custom`, et avant d'écrire quoi que ce soit pour une colonne qui n'en est pas une, une colonne que la table garde pour elle, un sujet listé comme personnel ou un mode qui n'existe pas |
|
|
733
734
|
| `command` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--aggregate <Name>]` | `<use-case>.command.ts` sur `AuthorizedCommand` (simple `Command` quand elle est publique), `<use-case>.handler.ts` (il construit l'agrégat, le sauvegarde et répond : les événements partent avec la sauvegarde), une *spec* par le bus avec le refus d'un acteur à qui manque la permission, l'enregistrement avec `.requires(...)` ou `.public()` (et le *repository* s'il manque). Une commande générée répond `void` ou l'identifiant de son agrégat, si bien qu'aucun `<use-case>.result.ts` n'est écrit |
|
|
734
735
|
| `query` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--search]` | `<use-case>.query.ts` sur `AuthorizedQuery` (simple `Query` quand elle est publique), `<use-case>.result.ts`, `<use-case>.handler.ts`, le port de lecture `application/ports/<use-case>-reader.port.ts` (une classe abstraite), son adaptateur en mémoire, un *fake*, une *spec*, l'enregistrement sur le bus de requêtes. Avec `--search` (demande `--permission`) : une `PageRequest` du kernel dans la requête, l'élément, le tri et `Page<Item>` dans le fichier de résultat, un gestionnaire qui demande `Access.scope` et remet le périmètre au port de lecture, un lecteur en mémoire qui pagine par décalage ou par curseur |
|
|
735
736
|
| `port` | `<context> <Name>` | `application/ports/<name>.port.ts`, une classe abstraite, et son *fake* |
|
|
@@ -1854,7 +1855,10 @@ Une ligne insérée entre des lignes de la base que l'autre côté n'a pas touch
|
|
|
1854
1855
|
même quand l'autre côté a inséré au même endroit : perdre l'une de deux nouvelles méthodes est la
|
|
1855
1856
|
perte que le contrôle cherche. De même pour une réécriture qui a perdu plus de lignes que les
|
|
1856
1857
|
lignes de la base ou que la réécriture de l'autre côté qu'elle concurrençait (une modification
|
|
1857
|
-
suivie d'une nouvelle méthode). Ce qu'un côté a supprimé, ou rouvert, n'est jamais signalé. Une
|
|
1858
|
+
suivie d'une nouvelle méthode). Ce qu'un côté a supprimé, ou rouvert, n'est jamais signalé. Une ligne de la branche dans un fichier
|
|
1859
|
+
que la branche n'a pas touché depuis sa bifurcation de la branche principale (le fichier est le même sur
|
|
1860
|
+
la branche et à `git merge-base`) ne l'est pas non plus : ce que la branche principale y a supprimé ou
|
|
1861
|
+
remplacé depuis est son propre changement, quelle que soit la base du calcul de la fusion. Une
|
|
1858
1862
|
suppression voulue se consigne dans le *commit* de fusion par un *trailer*
|
|
1859
1863
|
`Lost-Accepted: <file:line>,...` (un fichier seul accepte toutes ses lignes) : ces constats sont
|
|
1860
1864
|
listés et ne font jamais échouer. Pour une fusion plus ancienne que HEAD, un constat que HEAD ne
|
|
@@ -2220,7 +2224,7 @@ règle.
|
|
|
2220
2224
|
| `aspects/outside-in` | un import de `@ddd-ts-kit/aspects/decorators` hors de `infrastructure/` d'un contexte et du répertoire de la plateforme : `presentation/`, le fichier de module, `published-language/`, le noyau partagé, `main.ts`, toute autre source (`domain/` et `application/` sont signalés par les deux règles `layer/*` à la place) |
|
|
2221
2225
|
| `tracing/platform-only` | un import de `@ddd-ts-kit/tracing` ou d'un *package* `@opentelemetry/*` hors du répertoire de la plateforme, de `main.ts` et de `apps/`, tests compris |
|
|
2222
2226
|
| `nest/no-parallel-pipeline` | dans `presentation/`, `infrastructure/` ou le fichier de module d'un contexte, tests à part : un import d'un contrôleur que Nest sert (ses décorateurs de route et de paramètres, sauf si le fichier importe `KitRoute` ou `KitRoutes` de `@ddd-ts-kit/http/nest`), de la requête ou de la réponse brutes, d'un *guard*, d'un *pipe*, d'un filtre d'exceptions ou d'une `HttpException`, d'un intercepteur ou du `Logger` de `@nestjs/common`, un import sans nom de celui-ci, ou un import d'un *package* de Nest dont le kit fait le travail (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` et les autres de la section 3 d'ARCHITECTURE.md) ; le message dit ce que le kit fait à sa place ; sous la racine des sources hors des contextes, tests à part : un fichier qui importe `Controller` de `@nestjs/common`, ni `KitRoute` ni `KitRoutes`, et nomme `CommandBus` ou `QueryBus` ou importe un fichier d'un contexte |
|
|
2223
|
-
| `nest/controllers-current` | avec `"stack.routes": "nest"` : un `<context>.controllers.ts` qui diffère de ce que donnent les contrôleurs Nest du contexte et les signatures de leurs méthodes, ou absent ; une méthode de route qui ne répond ni une classe DTO, ni `Accepted`, ni `void`, et ne déclare pas de `response` dans `@KitRoute` |
|
|
2227
|
+
| `nest/controllers-current` | avec `"stack.routes": "nest"` : un `<context>.controllers.ts` qui diffère de ce que donnent les contrôleurs Nest du contexte et les signatures de leurs méthodes, ou absent ; une partie de la requête prise entière par aucune classe DTO et que `request` de `@KitRoute` ne donne pas ; une méthode de route qui ne répond ni une classe DTO, ni `Accepted`, ni `void`, et ne déclare pas de `response` dans `@KitRoute` |
|
|
2224
2228
|
| `tenancy/scoped-statement` | avec `stack.tenancy` autre que `none`, dans `infrastructure/` d'un contexte, tests mis à part : sur Knex, l'exécuteur utilisé autrement que comme argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) et tout `.raw(` ; sur Drizzle, instruction par instruction, une lecture, une mise à jour ou une suppression sur l'exécuteur dont le where n'a ni `tenantCondition(` ni `ownTenantCondition(` (en ligne ou dans la variable locale qu'il reçoit), une insertion dont la ligne n'a pas de `tenantScopeOf(`, une requête relationnelle (`executor().query`), un `execute(` brut, ou l'exécuteur gardé dans une variable ; sur Prisma, instruction par instruction sur le client, une lecture (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) dont le where ne décompose pas `tenantWhere(`, une mise à jour ou une suppression dont le where ne décompose pas `ownTenantWhere(`, une création dont les données ne décomposent pas `tenantScopeOf(` (en ligne ou dans une variable locale que les arguments nomment), `findUnique(`, `upsert(`, une requête brute (`$queryRaw`, `$executeRaw`), ou le client gardé dans une variable ; sur TypeORM, la même chose sur le *manager* (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, la ligne confiée à `insertIgnoringConflict(`, un *query builder* dont le where ne porte aucune condition, `save(`, `upsert(`, `query(`) ; sur les quatre, un magasin de modèle de lecture construit sans son option `tenant`. Un where construit par une autre fonction n'est pas suivi |
|
|
2225
2229
|
| `standard/no-parallel-interface` | une classe, une interface ou un alias de type déclaré comme `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (hors de `presentation/` et de la plateforme), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `CacheInvalidator`, `CacheInvalidationService`, `CachePurgeService`, `CdnPurger`, `I` suivi d'un nom standard (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) ou un nom de `standardInterfaces` ; une classe qui implémente ou étend l'interface standard est un adaptateur et n'est pas signalée |
|
|
2226
2230
|
| `events/outbox-required` | `stack.events` autre que `outbox` avec un ORM et sans dérogation `stack.events` ; dans `domain/` et `application/`, l'import d'un client de *broker* ou d'une implémentation de bus ou de relais ; un *publisher* qui dépend de plus que `IntegrationEventPublisher` ; un module de la plateforme qui distribue un *publisher* et ne nomme jamais `OutboxPublisher` |
|
package/README.md
CHANGED
|
@@ -56,14 +56,14 @@ ddd-ts-kit init [--http express|fastify|hono|nest|none]
|
|
|
56
56
|
[--database postgres|mysql|sqlite|none]
|
|
57
57
|
[--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]
|
|
58
58
|
[--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]
|
|
59
|
-
[--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]
|
|
59
|
+
[--authn jwt|keycloak|passport|none] [--authz rbac|abac|rebac|custom]
|
|
60
60
|
[--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis]
|
|
61
61
|
[--http-cache none|varnish] [--storage local|s3|none] [--audit on|off]
|
|
62
62
|
[--event-sourcing on|off] [--privacy on|off]
|
|
63
63
|
[--errors none|sentry] [--logger stdout|pino|winston]
|
|
64
64
|
[--style declared|explicit] [--assembly barrel|discovery]
|
|
65
65
|
[--dependencies signature|listed] [--refusals named|factories|classes]
|
|
66
|
-
[--routes controllers|functions] [--value-objects throwing|result]
|
|
66
|
+
[--routes controllers|functions|nest] [--value-objects throwing|result]
|
|
67
67
|
[--literals named|free] [--values classes|free] [--tenancy none|shared-table]
|
|
68
68
|
[--queue database|redis|memory]
|
|
69
69
|
[--schemas shared|per-route]
|
|
@@ -116,7 +116,9 @@ An import of a file of the project is written without an extension
|
|
|
116
116
|
instead. A config without the key is read as `js`, so a project generated before the key
|
|
117
117
|
existed keeps its spelling. See [docs/CONFIG.md](../../docs/CONFIG.md).
|
|
118
118
|
|
|
119
|
-
Defaults: `express`, `zod
|
|
119
|
+
Defaults: `express`, `zod` (`class-validator` with `--http nest`, as Nest validates), `tsyringe` (`nest` with
|
|
120
|
+
`--http nest`, and only then), routes written as controllers of the kit (Nest controllers with `--http nest`
|
|
121
|
+
on class-validator, `--routes nest`), `vitest`,
|
|
120
122
|
`drizzle` on `postgres`, `outbox` when there is an ORM, `swagger`, `github`, `jwt`, `rbac`, no broker,
|
|
121
123
|
the cache in the process, files in a local directory (`--storage local`), the audit trail `on` when there is an ORM, the requests of a data subject answered (`--privacy on`) when there is an ORM, no event store (`--event-sourcing off`), unexpected failures reported
|
|
122
124
|
nowhere (`--errors none`), JSON lines on the standard output (`--logger stdout`), and the
|
|
@@ -541,11 +543,11 @@ config, `docsUi`, `ci` and `logger` included.
|
|
|
541
543
|
| tracing | wired once, by the platform (`tracing/platform-only`): no `decorate` hook, no `decorate-bindings.ts`. `tracing.ts` starts `initTracing` of `@ddd-ts-kit/tracing/node` before any other module, on what `config/read-tracing.ts` validates: `OTEL_EXPORTER_OTLP_ENDPOINT` (a URL; left out, no span leaves the process), `TRACE_SAMPLE_RATIO` (0 to 1) and `TRACE_CONSUMERS` (`continue`, the default: a consumed event stays in the trace of its publication; `link`: each delivery starts a trace linked to it). With `--di tsyringe`: `lay-foundations.ts` builds `traceApplication({ consumers })`, `compose-application.ts` hands it to `kernelModule({ instrumentation })` (one span per use case, repository call, domain event, publication, consumer and job) and gives the outbox relay `tracedPublisher(bus)`. With hand wiring: `create-platform.ts` applies the members of `traceApplication()` itself (`useCase` on both buses, `domainEvents`, `publisher`, `binding` around every adapter, `job`, `executionScope`, `errorReporter`), with `tracedSubscriber` and `tracedPublisher` around the provider. With an HTTP stack, in both families, `auth/authentication/http-boundary.ts` sets `around: tracedRoutes()`: one `SERVER` span per request, named by its route |
|
|
542
544
|
| `--logger` | `src/platform/observability/create-logger.ts`, one per choice: `stdout` (the default) is the `StdoutLogger` of `@ddd-ts-kit/aspects`, JSON lines, credentials not redacted; `pino` is `createPinoLogger` of `@ddd-ts-kit/pino` (dependencies `pino` and `pino-pretty`); `winston` is `createWinstonLogger` of `@ddd-ts-kit/winston`; these two redact the credential keys of the kernel. Every entry carries `traceLogFields(scope)`: the correlation id, origin, actor and tenant of the work in progress and the ids of the active trace. `LOG_LEVEL`, `LOG_FORMAT` (`json`, the default, or `pretty`; with `stdout`, which has no pretty format, `pretty` is refused when the configuration is loaded) and `LOG_SCRUB_MESSAGES` (`[message removed]` in place of the message of a logged error that is not a `DomainError`) are validated in `config/load-config.ts`. Stopping the application flushes the error reporter, then the logger, last: `container.stop()` does it on tsyringe, `compose-application.ts` flushes explicitly with hand wiring. The tools and the tests compose the application without `log` and write nothing |
|
|
543
545
|
| `src/platform/auth/` | one folder per question: `authentication/` (who is calling), `authorization/` (what they may do, whatever the model) and the folder of the model `stack.authz` names (`roles/`, `attributes/`, `relationships/` or `custom/`). A project generated before the folders keeps its files flat: the generators read them there, `npx ddd-ts-kit doctor` says so and `npx ddd-ts-kit platform-folders` moves them with every import |
|
|
544
|
-
| `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt`: `JwtAuthenticator` on `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI`; `--authn keycloak`: `keycloakAuthenticator` on `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` and the optional `KEYCLOAK_CLIENT_ID`; `--authn none`: `development-header-authenticator.ts` and `development-actor-header.ts`, which read `x-development-actor` and throw in production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` answering a `Session`, `executionScope`, `errorMapper` and `onError`, spread into the mount options: every request runs inside the execution scope, with its correlation id). Without an HTTP stack there is no authenticator and no boundary, and no folder |
|
|
546
|
+
| `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt`: `JwtAuthenticator` on `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI`; `--authn keycloak`: `keycloakAuthenticator` on `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` and the optional `KEYCLOAK_CLIENT_ID`; `--authn passport`: `passportAuthenticator` of `@ddd-ts-kit/auth/passport` over `bearer-strategy.ts`, the strategy of `passport-jwt` on the key set `AUTH_JWKS_URI` publishes (`jwks-rsa`), `AUTH_ISSUER` and `AUTH_AUDIENCE`, and `actor-of-token.ts`, which reads its payload with `actorOfClaims`; `--authn none`: `development-header-authenticator.ts` and `development-actor-header.ts`, which read `x-development-actor` and throw in production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` answering a `Session`, `executionScope`, `errorMapper` and `onError`, spread into the mount options: every request runs inside the execution scope, with its correlation id). Without an HTTP stack there is no authenticator and no boundary, and no folder |
|
|
545
547
|
| `src/platform/auth/authorization/` | `create-authorizer.ts`, `authorization.ts` (`authorizationModule` with tsyringe) or `use-case-protection.ts` (the guard of the hand-wired buses), `access-policies.ts`, `role.ts` (the roles a credential carries, with roles or attributes, or once a guard names one), `permissions.ts` (the registry of every permission, with relationships or an authorizer of your own), `signed-in-grants.ts` once a context preset grants every signed-in person, and with `--audit off` `log-decisions.ts` (one log entry per decision, ids and codes only) |
|
|
546
548
|
| `src/platform/auth/<model>/` | `roles/roles.ts` (with the role `system` every system actor holds); `attributes/attribute-policies.ts`; `relationships/`: `relationship-schema.ts`, `create-tuple-store.ts` and its contract spec, `relation-tuples.ts`, `relate-system-actors.ts`; `custom/`: `custom-authorizer.ts` and its `authorizerContract` spec |
|
|
547
549
|
| `--representations negotiated`, `--forms on` | `src/platform/http/presentation-of.ts` (`Representations.standard()` with `negotiated`, and `fieldDeciderOf` over the `Access` of the application), spread into the HTTP boundary and given to the contract script; with `--forms on`, `src/platform/http/with-forms.ts` adds `formRoutes` to the routes and `scripts/openapi.ts` writes `openapi/forms/<operationId>.json`. Both are the default with an HTTP stack; `json` and `off` leave them out ([docs/CONFIG.md](../../docs/CONFIG.md)) |
|
|
548
|
-
| `--audit on` | `src/platform/audit/`: `create-audit.ts` (the trail, the `onDecision` of the authorization, the refusals of the guards at the edge given to the HTTP boundary as `onGuardRefusal`, the middleware before the unit of work, the integration events subscribed under the consumer name `audit`), `audited-events.ts` (the registry `generate integration-event` adds to), `audit.module.ts`, and with an HTTP stack the read side: `audit.permissions.ts` (`audit:trail.read`), then in `search-audit-entries/`: `search-audit-entries.query.ts`, its handler, `search-audit-entries.route.ts` or `.controller.ts` (`GET /audit/entries`: cursor pages, filters `actorId`, `action`, `outcome`, `correlationId`), which starts with the endpoint and takes what it receives and answers from `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` and `audit-outcomes.ts`. It is a capability of the platform, not a bounded context: no model, one protected query over the `AuditReader` port, bounded by the tenant of the actor (with `--tenancy shared-table`, by the tenant of the work through `TenantAuditReader`: platform staff read across tenants only inside `acrossTenants`). The refusals of a caller without a credential are not recorded. A scheduled job is audited like a request: origin `schedule`, actor `system:<context>.<job>`. With knex the two tables and their append-only triggers are created by the first migration; with drizzle the tables are in `schema.ts` and `npm run db:
|
|
550
|
+
| `--audit on` | `src/platform/audit/`: `create-audit.ts` (the trail, the `onDecision` of the authorization, the refusals of the guards at the edge given to the HTTP boundary as `onGuardRefusal`, the middleware before the unit of work, the integration events subscribed under the consumer name `audit`), `audited-events.ts` (the registry `generate integration-event` adds to), `audit.module.ts`, and with an HTTP stack the read side: `audit.permissions.ts` (`audit:trail.read`), then in `search-audit-entries/`: `search-audit-entries.query.ts`, its handler, `search-audit-entries.route.ts` or `.controller.ts` (`GET /audit/entries`: cursor pages, filters `actorId`, `action`, `outcome`, `correlationId`), which starts with the endpoint and takes what it receives and answers from `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` and `audit-outcomes.ts`. It is a capability of the platform, not a bounded context: no model, one protected query over the `AuditReader` port, bounded by the tenant of the actor (with `--tenancy shared-table`, by the tenant of the work through `TenantAuditReader`: platform staff read across tenants only inside `acrossTenants`). The refusals of a caller without a credential are not recorded. A scheduled job is audited like a request: origin `schedule`, actor `system:<context>.<job>`. With knex the two tables and their append-only triggers are created by the first migration; with drizzle the tables are in `schema.ts` and `npm run db:generate` adds the trigger statements to the migration that creates the tables (`npm run db:audit-guard` prints them for a migration by hand); with prisma and typeorm the tables are models of `prisma/schema.prisma` or entities of `schema.ts` (`auditPrismaModels`, `auditEntities` of `@ddd-ts-kit/audit`), written by `PrismaAuditTrail` and `TypeOrmAuditTrail`, and `npm run db:generate` (through `ddd-ts-kit prisma-generate` or `typeorm-generate`) adds the trigger statements to the migration that creates the tables, `npm run db:audit-guard` printing them for a migration by hand; the test databases install that guard; with `custom` or no ORM the trail is an `InMemoryAuditTrail` behind a `TODO(platform)`. The test databases leave the audit schema out of `reset()`. With the trail in a database and `--storage local` or `s3`, `audit.module.ts` (or the hand-wired composition) registers `audit.archive` on the first day of every month at 04:00 UTC: the entries older than twelve whole months move to the storage under `audit-archives/`, verified, read back and anchored (`ArchiveAuditEntries`); with `s3` it runs unless `JOB_AUDIT_ARCHIVE_ENABLED=false`, with `local` only with `JOB_AUDIT_ARCHIVE_ENABLED=true`, since the archive removes the entries from the database and the disk of the server may not last |
|
|
549
551
|
| `--event-sourcing on` | recorded as `stack.eventSourcing`, `off` unless asked: `Persistence` gains `eventSourcing` (`create<Orm>EventSourcing` in the `event_store` schema, whose five tables the schema file declares; the in-memory stores with `--orm none`), and `src/platform/event-sourcing/`: `create-event-sourcing.ts` (`EventSourcing`: the stores, the `SubjectKeyStore` wrapped by `auditedSubjectKeys` with `--audit on`, and the `PersonalDataCipher` over it) and, on tsyringe, `event-sourcing.module.ts` (binds `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` and `PersonalDataCipher`, so an event-sourced repository adapter names them in its constructor; the hand-wired `Platform` carries them as `platform.eventSourcing`); `platform-test.module.ts` binds the in-memory stores, so a handler spec of an event-sourced aggregate needs no fake. `generate aggregate --event-sourced` is refused without it, with the `init --force --event-sourcing on` to run. Refused with `--orm custom`: the event store of the kit runs on PostgreSQL through the four ORM packages |
|
|
550
552
|
| `--privacy on` | recorded as `stack.privacy`, `on` when there is an ORM: `src/platform/privacy/`, with `data-subject-copies.ts` and `data-subject-exports.ts` (the ports, or the adapters by hand, of the contexts that extend `PersonalDataErasure` and `PersonalDataExport`, between markers; `generate repository --personal` lists the erasure and the export of a context there), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, tenants? })`: an execution context of origin `cli` with the operator as actor, the key of the subject when the project has an event store, then `eraseDataSubject` of the kernel over the copies, `inEachTenant` with `--tenancy shared-table`, then `privacy.data-subject.erased` published through the outbox, once per tenant) and `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })`: `exportDataSubject` of the kernel over the exports, each wrapped by `auditedPersonalDataExport` with `--audit on`, `recordsInEachTenant` with `--tenancy shared-table`, one dated `PersonalDataExportDocument`), and the two scripts below. `docs/privacy/register.md`, the register of personal data `ddd-ts-kit docs` keeps (see `docs` below). A project without personal data takes `--privacy off` and pays nothing. No HTTP command erases yet: the two scripts are the entry points |
|
|
551
553
|
| `--tenancy shared-table` | recorded as `stack.tenancy`; the four ORMs. Every `generate repository` is tenant-scoped (as `--tenant-scoped`), through `tenantTable` and `ownTenantTable` (Knex), `tenantCondition` and `ownTenantCondition` (Drizzle), `tenantWhere` and `ownTenantWhere` (Prisma, TypeORM); the outbox keeps the tenant of each event (`createOutboxTables(knex, { tenant: true })` and `KnexOutboxStore`'s `tenant: true`, `tenantOutboxTable`, the `tenantId` field of the Prisma model and `PrismaOutboxStore`'s `tenant: true`, `outboxEntity({ tenant: true })`), so consumers run in it; `tenancy/scoped-statement` judges the adapters. Row-level security, schema per tenant and database per tenant are refused, with what to wire by hand ([Multitenancy](../../docs/concepts/multitenancy.md)) |
|
|
@@ -643,7 +645,8 @@ the grant `'identity:*'` of `platform/auth/authorization/signed-in-grants.ts`, a
|
|
|
643
645
|
the context belong to none, under a decision record the preset writes, and with `--authn
|
|
644
646
|
keycloak` the authenticator reads the `organization` claim as the tenants of the person
|
|
645
647
|
(another authenticator gets a next step saying what to map). The preset is written for
|
|
646
|
-
`declared` with `signature` dependencies, `factories`, `throwing` value objects, `controllers
|
|
648
|
+
`declared` with `signature` dependencies, `factories`, `throwing` value objects, `controllers` or `nest` routes (Nest controllers, read from their
|
|
649
|
+
signatures, on a Nest project),
|
|
647
650
|
Knex or Drizzle on PostgreSQL, Zod or class-validator, Express or Fastify, and a token verifier
|
|
648
651
|
(`jwt` or `keycloak`); another stack is refused with what to change, and so is a second context
|
|
649
652
|
written from the same preset. Why, and which other contexts deserve one:
|
|
@@ -691,7 +694,7 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
691
694
|
| Kind | Arguments | Writes |
|
|
692
695
|
|---|---|---|
|
|
693
696
|
| `context` | `<name> --classification <c> [--purpose "<two sentences>"] [--term ...]... [--upstream <ctx>[:relationship]]... [--preset identity]` | `CONTEXT.md` with its glossary, `published-language/index.ts`, config entry, registration in `platform/composition/compose-application.ts` and in `test/architecture/extractable.spec.ts`; on tsyringe, with HTTP, `presentation/http/<name>.routes.ts` (a function of the two buses, in both styles); declared: the barrel `<name>.declarations.ts`; explicit and hand wiring: `<name>.module.ts`. `<name>.permissions.ts`, at the root of the context, is born with the first permission, or at once when `platform/auth/authorization/permissions.ts` lists the permission sets (rebac, custom). With `--preset`, the context is then written whole from that preset, its classification and purpose those of the preset unless the flags say otherwise ([Presets](#presets)) |
|
|
694
|
-
| `aggregate` | `<context> <Name> [--event-sourced]` | aggregate, builder, spec in given / when / then; with `--event-sourced`, an aggregate on `EventSourcedAggregate` whose state is the replay of its events, born with its `Created` domain event, the codec of its stored events in `infrastructure/persistence/<name>-events.mapper.ts`, a builder that replays a history and a spec given events, and a note naming the `EventSourcedRepository` its repository adapter delegates to; refused while `stack.eventSourcing` is `off`, with the `init --force --event-sourcing on` to run |
|
|
697
|
+
| `aggregate` | `<context> <Name> [--event-sourced [--birth <Event>]]` | aggregate, builder, spec in given / when / then; with `--event-sourced`, an aggregate on `EventSourcedAggregate` whose state is the replay of its events, born with its `Created` domain event (or the fact `--birth <Event>` names, checked against the glossary), the codec of its stored events in `infrastructure/persistence/<name>-events.mapper.ts`, a builder that replays a history and a spec given events, and a note naming the `EventSourcedRepository` its repository adapter delegates to; refused while `stack.eventSourcing` is `off`, with the `init --force --event-sourcing on` to run |
|
|
695
698
|
| `builder` | `<context> <Aggregate>` | `test/builders/<name>.builder.ts`, a class extending `Builder` |
|
|
696
699
|
| `test-world` | `<context> [Name]` | `test/worlds/<name>.world.ts` (the name defaults to the context): `a<Name>World({ now, idPrefix, given })`, the arrangement several specs of the context share. It reads the fakes of `test/fakes/` and the port each one implements, builds them, hands them to `given` so that the spec stores what it starts from, then to the test application (with `modules`, the authorization of the spec) or, wired by hand, wraps the repositories of the buses of `createTestBuses` with `dispatching`; it returns every fake under the name of its port. A fake that needs constructor arguments, or, under a container, stands for a port nothing binds or depends on yet, is left out with a note |
|
|
697
700
|
| `entity` | `<context> <Name>` | entity, spec |
|
|
@@ -702,7 +705,7 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
702
705
|
| `domain-error` | `<context> <Name> [--code CODE]` | one class per error with a stable code, spec: the form of a project whose config says `"stack.refusals": "classes"` or nothing. Refused under `named` and `factories`, with the `generate error` command to run instead |
|
|
703
706
|
| `domain-service` | `<context> <Name>` | service, spec |
|
|
704
707
|
| `state-machine` | `<context> <Aggregate> [--value <state>]... [--transition "<intention>:<from>[,<from>]...[><to>]"]...` | the vocabulary `<Aggregate>Status` (created from `--value`, two states at least, or given the values it misses), `domain/state-machines/<aggregate>.state-machine.ts` (`<aggregate>Lifecycle`: every value a state, the first one initial, the transitions asked, a `TODO(domain)` for the refusal of the concept error) and `test/unit/<aggregate>.state-machine.spec.ts` (each transition where it leads, a refusal from a state it does not leave); the aggregate is left to use it |
|
|
705
|
-
| `repository` | `<context> <Aggregate> [--tenant-scoped] [--personal <column>,... [--subject <column>] [--erasure pseudonymise\|row] [--retention <column>:<n><d\|m\|y>]]` | the port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), the adapter of the project's ORM (`implements` the port) with its mapper and table (or model), a fake, one `repositoryContract` spec run on both, registration. With `--personal`, the columns of the table that hold personal data: added to the storage and to the row type as nullable text (the mapper writes them empty until the aggregate carries them), declared next to the mapper in `<name>.personal-fields.ts` (`personalFields` of the kernel: the subject column, `id` unless `--subject` names the column that holds the id of the person, the fields, `pseudonymise` unless `--erasure row`), spelled as the erasure of the ORM reads them (SQL names on Knex and Prisma, properties on Drizzle and TypeORM); and, once per context, its erasure: the port `application/ports/<context>-personal-data-erasure.port.ts` (`extends PersonalDataErasure`), the adapter `<orm>-<context>-personal-data-erasure.repository.ts` over `<Orm>PersonalDataErasure` of the ORM package (confined to the tenant of the work with `--tenant-scoped`), its fake, bound where the context binds its adapters and listed in `src/platform/privacy/data-subject-copies.ts`, so that `npm run privacy:erase` reaches it; and its export: the port `<context>-personal-data-export.port.ts` (`extends PersonalDataExport`), the adapter `<orm>-<context>-personal-data-export.repository.ts` over `<Orm>PersonalDataExport`, its fake, bound the same way and listed in `data-subject-exports.ts`, so that `npm run privacy:export` hands it over; one spec, `test/integration/<context>-personal-data.spec.ts`, proves both on the test database. With `--retention <column>:<n><d|m|y>`, the declaration gains `retention`, counted from a column that dates the end of the relation and joins the storage as a nullable timestamp, empty while it lasts (a column the table keeps for itself, `registered_at` first, is refused: counted from the registration, the purge would erase people who are still customers) and the spec proves the purge of what outlived it. A second table of the context joins the declarations of both adapters. Refused without `stack.privacy` on (`init --force --privacy on`), with `--orm none` or `custom`, and before anything is written for a column that is not one, a column the table keeps for itself, a subject listed as personal or a mode that does not exist |
|
|
708
|
+
| `repository` | `<context> <Aggregate> [--tenant-scoped] [--personal <column>,... [--subject <column>] [--erasure pseudonymise\|row] [--retention <column>:<n><d\|m\|y>]]` | the port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), the adapter of the project's ORM (`implements` the port) with its mapper and table (or model), a fake, one `repositoryContract` spec run on both, registration. On an event-sourced aggregate (its class extends `EventSourcedAggregate`) there is no table nor mapper: `event-store-<name>.repository.ts` delegates to `EventSourcedRepository` of the kernel over the `EventStore` and the `PersonalDataCipher` the platform binds, with the codec of `<name>-events.mapper.ts` (the snapshot policy left as a `TODO(domain)`), the fake is that adapter over the in-memory stores, and the contract suite runs on both (its stale-save case pending until a `mutate` that records an event is added); `--personal` is refused there, the personal values being sealed in the events. With `--personal`, the columns of the table that hold personal data: added to the storage and to the row type as nullable text (the mapper writes them empty until the aggregate carries them), declared next to the mapper in `<name>.personal-fields.ts` (`personalFields` of the kernel: the subject column, `id` unless `--subject` names the column that holds the id of the person, the fields, `pseudonymise` unless `--erasure row`), spelled as the erasure of the ORM reads them (SQL names on Knex and Prisma, properties on Drizzle and TypeORM); and, once per context, its erasure: the port `application/ports/<context>-personal-data-erasure.port.ts` (`extends PersonalDataErasure`), the adapter `<orm>-<context>-personal-data-erasure.repository.ts` over `<Orm>PersonalDataErasure` of the ORM package (confined to the tenant of the work with `--tenant-scoped`), its fake, bound where the context binds its adapters and listed in `src/platform/privacy/data-subject-copies.ts`, so that `npm run privacy:erase` reaches it; and its export: the port `<context>-personal-data-export.port.ts` (`extends PersonalDataExport`), the adapter `<orm>-<context>-personal-data-export.repository.ts` over `<Orm>PersonalDataExport`, its fake, bound the same way and listed in `data-subject-exports.ts`, so that `npm run privacy:export` hands it over; one spec, `test/integration/<context>-personal-data.spec.ts`, proves both on the test database. With `--retention <column>:<n><d|m|y>`, the declaration gains `retention`, counted from a column that dates the end of the relation and joins the storage as a nullable timestamp, empty while it lasts (a column the table keeps for itself, `registered_at` first, is refused: counted from the registration, the purge would erase people who are still customers) and the spec proves the purge of what outlived it. A second table of the context joins the declarations of both adapters. Refused without `stack.privacy` on (`init --force --privacy on`), with `--orm none` or `custom`, and before anything is written for a column that is not one, a column the table keeps for itself, a subject listed as personal or a mode that does not exist |
|
|
706
709
|
| `command` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--aggregate <Name>]` | `<use-case>.command.ts` on `AuthorizedCommand` (plain `Command` when public), `<use-case>.handler.ts` (it builds the aggregate, saves it and answers: the events leave with the save), spec through the bus with the refusal of an actor who lacks the permission, registration with `.requires(...)` or `.public()` (and the repository when missing). A generated command answers `void` or the identifier of its aggregate, so no `<use-case>.result.ts` is written |
|
|
707
710
|
| `query` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--search]` | `<use-case>.query.ts` on `AuthorizedQuery` (plain `Query` when public), `<use-case>.result.ts`, `<use-case>.handler.ts`, the read port `application/ports/<use-case>-reader.port.ts` (an abstract class), its in-memory adapter, fake, spec, registration on the query bus. With `--search` (needs `--permission`): a kernel `PageRequest` in the query, the item, the sort and `Page<Item>` in the result file, a handler that asks `Access.scope` and hands the scope to the read port, an in-memory reader paging by offset or cursor |
|
|
708
711
|
| `port` | `<context> <Name>` | `application/ports/<name>.port.ts`, one abstract class, and its fake |
|
|
@@ -1749,7 +1752,9 @@ A line inserted between base lines the other side left alone stays an error even
|
|
|
1749
1752
|
side inserted at the same place: dropping one of two new methods is the loss the check exists
|
|
1750
1753
|
for. So does a rewrite that lost more lines than the base lines or the other side's rewrite it
|
|
1751
1754
|
competed with (an edit with a new method under it). What one side deleted, or reopened, is never
|
|
1752
|
-
reported.
|
|
1755
|
+
reported. Nor is a line of the branch in a file the branch did not touch since its fork from the trunk
|
|
1756
|
+
(the file is the same on the branch and at `git merge-base`): what the trunk removed or replaced
|
|
1757
|
+
there since is the trunk's change, whatever base the merge is computed from. A removal decided on purpose is recorded in the merge commit as a trailer
|
|
1753
1758
|
`Lost-Accepted: <file:line>,...` (a file alone accepts all of its lines): those findings are
|
|
1754
1759
|
listed and never fail. For a merge older than HEAD, a finding HEAD no longer shows was repaired
|
|
1755
1760
|
by a later commit: listed too.
|
|
@@ -2091,7 +2096,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
|
|
|
2091
2096
|
| `aspects/outside-in` | an import of `@ddd-ts-kit/aspects/decorators` outside `infrastructure/` of a context and the platform directory: `presentation/`, the module file, `published-language/`, the shared kernel, `main.ts`, any other source (`domain/` and `application/` are reported by the two `layer/*` rules instead) |
|
|
2092
2097
|
| `tracing/platform-only` | an import of `@ddd-ts-kit/tracing` or of an `@opentelemetry/*` package outside the platform directory, `main.ts` and `apps/`, tests included |
|
|
2093
2098
|
| `nest/no-parallel-pipeline` | in `presentation/`, `infrastructure/` or the module file of a context, tests apart: an import of a controller Nest serves (its route and parameter decorators, unless the file imports `KitRoute` or `KitRoutes` of `@ddd-ts-kit/http/nest`), the raw request or answer, a guard, a pipe, an exception filter or an `HttpException`, an interceptor or the `Logger` of `@nestjs/common`, a bare import of it, or an import of a package of Nest whose work the kit does (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` and the others of section 3 of ARCHITECTURE.md); the message names what the kit does in its place; under the source root outside the contexts, tests apart: a file that imports `Controller` of `@nestjs/common`, neither `KitRoute` nor `KitRoutes`, and names `CommandBus` or `QueryBus` or imports a file of a context |
|
|
2094
|
-
| `nest/controllers-current` | with `"stack.routes": "nest"`: a `<context>.controllers.ts` that differs from what the Nest controllers of the context and the signatures of their methods give, or is missing; a route method that answers no DTO class, `Accepted` or `void` and declares no `response` in `@KitRoute` |
|
|
2099
|
+
| `nest/controllers-current` | with `"stack.routes": "nest"`: a `<context>.controllers.ts` that differs from what the Nest controllers of the context and the signatures of their methods give, or is missing; a part of the request taken whole by no DTO class that `request` of `@KitRoute` does not give; a route method that answers no DTO class, `Accepted` or `void` and declares no `response` in `@KitRoute` |
|
|
2095
2100
|
| `tenancy/scoped-statement` | with `stack.tenancy` other than `none`, in `infrastructure/` of a context, tests aside: on Knex the executor used other than as an argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) and any `.raw(`; on Drizzle, statement by statement, a read, update or delete on the executor whose where has no `tenantCondition(` nor `ownTenantCondition(` (inline or in the local it is given), an insert whose row has no `tenantScopeOf(`, a relational query (`executor().query`), a raw `execute(`, or the executor held in a variable; on Prisma, statement by statement on the client, a read (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) whose where spreads no `tenantWhere(`, an update or a delete whose where spreads no `ownTenantWhere(`, a create whose data spreads no `tenantScopeOf(` (inline or in a local the arguments name), `findUnique(`, `upsert(`, a raw query (`$queryRaw`, `$executeRaw`), or the client held in a variable; on TypeORM the same on the manager (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, the row handed to `insertIgnoringConflict(`, a query builder whose where carries no condition, `save(`, `upsert(`, `query(`); on the four, a read model store built without its `tenant` option. A where built by another function is not followed |
|
|
2096
2101
|
| `standard/no-parallel-interface` | a class, interface or type alias declared as `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (outside `presentation/` and the platform), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `CacheInvalidator`, `CacheInvalidationService`, `CachePurgeService`, `CdnPurger`, `I` followed by a standard name (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) or a name of `standardInterfaces`; a class that implements or extends the standard interface is an adapter and is not reported |
|
|
2097
2102
|
| `events/outbox-required` | `stack.events` other than `outbox` with an ORM and no `stack.events` deviation; in `domain/` and `application/`, the import of a broker client or of a bus or relay implementation; a publisher depending on more than `IntegrationEventPublisher`; a platform module that hands out a publisher and never names `OutboxPublisher` |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-acceptance.d.ts","sourceRoot":"","sources":["../../src/acceptance/lock-acceptance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lock-acceptance.d.ts","sourceRoot":"","sources":["../../src/acceptance/lock-acceptance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAkB,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAQ/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAM1D,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,gHAAgH;AAChH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAuB1E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CliError } from '../cli-error.js';
|
|
2
|
+
import { formatJson } from '../json/format-json.js';
|
|
2
3
|
import { countsFor } from './counts-for.js';
|
|
3
4
|
import { driftOf } from './drift.js';
|
|
4
5
|
import { lockFileOf } from './lock-file-of.js';
|
|
@@ -32,7 +33,7 @@ export function lockAcceptance(ws, request) {
|
|
|
32
33
|
amendments: [...(previous?.amendments ?? []), ...amendments],
|
|
33
34
|
};
|
|
34
35
|
const file = lockFileOf(story.story);
|
|
35
|
-
ws.update(file,
|
|
36
|
+
ws.update(file, formatJson(lock));
|
|
36
37
|
return { file, scenarios: written.length, tests: tests.length, amendments };
|
|
37
38
|
}
|
|
38
39
|
/** The regression tests of a fix as the lock records them: each written test of each listed spec. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock-acceptance.js","sourceRoot":"","sources":["../../src/acceptance/lock-acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"lock-acceptance.js","sourceRoot":"","sources":["../../src/acceptance/lock-acceptance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,qFAAqF;AACrF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;AAiBxE;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,EAAa,EAAE,OAAoB;IAChE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAE1B,cAAc,CAAC,KAAK,CAAC,CAAC;IAEtB,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,UAAU,GAAG,YAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,CAAC,CAAC;IACjG,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAEjC,MAAM,IAAI,GAAmB;QAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;QAC5F,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;QAChG,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,IAAI,EAAE,CAAC,EAAE,GAAG,UAAU,CAAC;KAC7D,CAAC;IAEF,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAErC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;IAElC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC;AAC9E,CAAC;AAED,qGAAqG;AACrG,SAAS,WAAW,CAAC,KAAsB;IACzC,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAC/C,IAAI,CAAC,KAAK;SACP,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,QAAQ,CAAC;SAChE,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAC9E,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAsB;IAC5C,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CACpC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAClF,CAAC;IAEF,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACnC,iBAAiB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAEnC,OAAO;IACT,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,QAAQ,CAChB,qBAAqB,KAAK,CAAC,KAAK,yBAAyB,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EACtI,gEAAgE,KAAK,CAAC,KAAK,uCAAuC,CACnH,CAAC;IACJ,CAAC;AACH,CAAC;AAED,iGAAiG;AACjG,SAAS,iBAAiB,CAAC,KAAsB,EAAE,QAAsC;IACvF,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3D,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GACR,QAAQ,CAAC,MAAM,KAAK,CAAC;QACnB,CAAC,CAAC,+BAA+B,KAAK,CAAC,KAAK,4CAA4C;QACxF,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElF,MAAM,IAAI,QAAQ,CAChB,qBAAqB,KAAK,CAAC,KAAK,yBAAyB,IAAI,EAAE,EAC/D,qHAAqH,KAAK,CAAC,KAAK,uCAAuC,CACxK,CAAC;AACJ,CAAC;AAED,mGAAmG;AACnG,SAAS,YAAY,CAAC,EAAa,EAAE,QAAoC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAe;IACnG,MAAM,OAAO,GACX,QAAQ,KAAK,SAAS;QACpB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC;YACE,GAAG,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO;YAC7D,GAAG,iBAAiB,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,OAAO;SAC1E,CAAC;IAER,MAAM,QAAQ,GAAG,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC;IAE9F,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,QAAQ,CAChB,kEAAkE,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,OAAO,iBAAiB,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EACjK,8OAA8O,CAC/O,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAa,EAAE;QACvC,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAE5C,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,MAAM,EAAE,OAAO,EAAE,MAAM,IAAI,EAAE;YAC7B,OAAO,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE;YAC5B,EAAE;SACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Scan } from '../scan/scan.js';
|
|
2
2
|
import type { StoredShape } from './stored-shape.js';
|
|
3
|
+
/** The fingerprint of a shape of no member: the hash of empty input, which vouches for nothing. */
|
|
4
|
+
export declare const EMPTY_SHAPE_FINGERPRINT: string;
|
|
3
5
|
/**
|
|
4
6
|
* The shape a type declares in the file, with the shapes of the named types it reaches that the
|
|
5
7
|
* same file declares: members of each body, comments left out, whitespace outside literals
|