ddd-ts-kit 0.104.0 → 0.106.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 +122 -6
- package/README.fr.md +33 -25
- package/README.md +30 -23
- package/dist/check/baseline/renamed-files.d.ts.map +1 -1
- package/dist/check/baseline/renamed-files.js +2 -1
- package/dist/check/baseline/renamed-files.js.map +1 -1
- package/dist/check/canonical/earlier-context-file.d.ts +1 -6
- package/dist/check/canonical/earlier-context-file.d.ts.map +1 -1
- package/dist/check/canonical/earlier-context-file.js +4 -10
- package/dist/check/canonical/earlier-context-file.js.map +1 -1
- package/dist/check/commands/changed-files.d.ts.map +1 -1
- package/dist/check/commands/changed-files.js +2 -1
- package/dist/check/commands/changed-files.js.map +1 -1
- package/dist/check/events/domain-event-names.d.ts +1 -1
- package/dist/check/events/domain-event-names.js +1 -1
- package/dist/check/explain/errors-docs.d.ts.map +1 -1
- package/dist/check/explain/errors-docs.js +10 -18
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/module-docs.js +1 -1
- package/dist/check/explain/module-docs.js.map +1 -1
- package/dist/check/explain/standard-docs.js +2 -2
- package/dist/check/explain/standard-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.js +1 -1
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/context-file-fixtures.d.ts +1 -1
- package/dist/check/fixtures/context-file-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/context-file-fixtures.js +4 -6
- package/dist/check/fixtures/context-file-fixtures.js.map +1 -1
- package/dist/check/fixtures/earlier-declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/earlier-declarations-fixtures.js +2 -4
- package/dist/check/fixtures/earlier-declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/module-fixtures.js +2 -2
- package/dist/check/fixtures/module-fixtures.js.map +1 -1
- package/dist/check/project/git-ignored.d.ts.map +1 -1
- package/dist/check/project/git-ignored.js +2 -1
- package/dist/check/project/git-ignored.js.map +1 -1
- package/dist/check/rules/authz-declared.d.ts.map +1 -1
- package/dist/check/rules/authz-declared.js +2 -1
- package/dist/check/rules/authz-declared.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +3 -12
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/module-complete.d.ts.map +1 -1
- package/dist/check/rules/module-complete.js +6 -2
- package/dist/check/rules/module-complete.js.map +1 -1
- package/dist/check/rules/tree-closed.d.ts.map +1 -1
- package/dist/check/rules/tree-closed.js +1 -2
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +9 -16
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +6 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/json-report.d.ts +8 -0
- package/dist/commands/json-report.d.ts.map +1 -0
- package/dist/commands/json-report.js +42 -0
- package/dist/commands/json-report.js.map +1 -0
- package/dist/commands/lint.d.ts +2 -3
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +2 -4
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/plan-waves.d.ts +2 -1
- package/dist/commands/plan-waves.d.ts.map +1 -1
- package/dist/commands/plan-waves.js +6 -3
- package/dist/commands/plan-waves.js.map +1 -1
- package/dist/commands/print-report.d.ts.map +1 -1
- package/dist/commands/print-report.js +2 -1
- package/dist/commands/print-report.js.map +1 -1
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +16 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/commit/git-arguments.d.ts +9 -0
- package/dist/commit/git-arguments.d.ts.map +1 -0
- package/dist/commit/git-arguments.js +46 -0
- package/dist/commit/git-arguments.js.map +1 -0
- package/dist/commit/run-git.d.ts.map +1 -1
- package/dist/commit/run-git.js +2 -1
- package/dist/commit/run-git.js.map +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/kit-container.d.ts +6 -0
- package/dist/config/kit-container.d.ts.map +1 -0
- package/dist/config/kit-container.js +10 -0
- package/dist/config/kit-container.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/context-files/context-file.d.ts +1 -1
- package/dist/declared/earlier-layout-notice.d.ts +1 -1
- package/dist/declared/earlier-layout-notice.js +1 -1
- package/dist/declared/earlier-layout-notice.js.map +1 -1
- package/dist/declared/keeps-role-folder-files.d.ts +1 -2
- package/dist/declared/keeps-role-folder-files.d.ts.map +1 -1
- package/dist/declared/keeps-role-folder-files.js +1 -2
- package/dist/declared/keeps-role-folder-files.js.map +1 -1
- package/dist/declared/keeps-single-file.d.ts +2 -3
- package/dist/declared/keeps-single-file.d.ts.map +1 -1
- package/dist/declared/keeps-single-file.js +2 -3
- package/dist/declared/keeps-single-file.js.map +1 -1
- package/dist/docs/spec-heading.d.ts +5 -1
- package/dist/docs/spec-heading.d.ts.map +1 -1
- package/dist/docs/spec-heading.js +8 -2
- package/dist/docs/spec-heading.js.map +1 -1
- package/dist/doctor/format-diagnosis.js +3 -0
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/hook-findings.d.ts +2 -1
- package/dist/doctor/hook-findings.d.ts.map +1 -1
- package/dist/doctor/hook-findings.js +10 -2
- package/dist/doctor/hook-findings.js.map +1 -1
- package/dist/doctor/permission-findings.js +1 -0
- package/dist/doctor/permission-findings.js.map +1 -1
- package/dist/generate/di-entry.d.ts +4 -0
- package/dist/generate/di-entry.d.ts.map +1 -0
- package/dist/generate/di-entry.js +5 -0
- package/dist/generate/di-entry.js.map +1 -0
- package/dist/generate/di-imports.d.ts +4 -0
- package/dist/generate/di-imports.d.ts.map +1 -0
- package/dist/generate/di-imports.js +12 -0
- package/dist/generate/di-imports.js.map +1 -0
- package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.js +3 -2
- package/dist/generate/kinds/adapter-kind.js.map +1 -1
- package/dist/generate/kinds/background/spec-family.d.ts +1 -1
- package/dist/generate/kinds/background/spec-family.d.ts.map +1 -1
- package/dist/generate/kinds/background/spec-family.js +2 -1
- package/dist/generate/kinds/background/spec-family.js.map +1 -1
- package/dist/generate/kinds/background-job-kind.d.ts.map +1 -1
- package/dist/generate/kinds/background-job-kind.js +8 -1
- package/dist/generate/kinds/background-job-kind.js.map +1 -1
- package/dist/generate/kinds/command-outputs.d.ts.map +1 -1
- package/dist/generate/kinds/command-outputs.js +2 -1
- package/dist/generate/kinds/command-outputs.js.map +1 -1
- package/dist/generate/kinds/extraction/service-selection.d.ts.map +1 -1
- package/dist/generate/kinds/extraction/service-selection.js +2 -1
- package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
- package/dist/generate/kinds/gateway-kind.js +1 -1
- package/dist/generate/kinds/gateway-kind.js.map +1 -1
- package/dist/generate/kinds/import-assembler.d.ts.map +1 -1
- package/dist/generate/kinds/import-assembler.js +11 -2
- package/dist/generate/kinds/import-assembler.js.map +1 -1
- package/dist/generate/kinds/job/grant-system-actor.d.ts.map +1 -1
- package/dist/generate/kinds/job/grant-system-actor.js +8 -4
- package/dist/generate/kinds/job/grant-system-actor.js.map +1 -1
- package/dist/generate/kinds/job-kind.d.ts.map +1 -1
- package/dist/generate/kinds/job-kind.js +2 -1
- package/dist/generate/kinds/job-kind.js.map +1 -1
- package/dist/generate/kinds/personal-data/declare-personal-data.js +1 -1
- package/dist/generate/kinds/personal-data/declare-personal-data.js.map +1 -1
- package/dist/generate/kinds/process-kind.d.ts.map +1 -1
- package/dist/generate/kinds/process-kind.js +8 -1
- package/dist/generate/kinds/process-kind.js.map +1 -1
- package/dist/generate/kinds/query-outputs.d.ts.map +1 -1
- package/dist/generate/kinds/query-outputs.js +2 -1
- package/dist/generate/kinds/query-outputs.js.map +1 -1
- package/dist/generate/kinds/test-world-kind.d.ts.map +1 -1
- package/dist/generate/kinds/test-world-kind.js +3 -2
- package/dist/generate/kinds/test-world-kind.js.map +1 -1
- package/dist/generate/kinds/world/context-fakes.d.ts.map +1 -1
- package/dist/generate/kinds/world/context-fakes.js +2 -1
- package/dist/generate/kinds/world/context-fakes.js.map +1 -1
- package/dist/generate/kinds/world/world-arrangement.d.ts.map +1 -1
- package/dist/generate/kinds/world/world-arrangement.js +2 -1
- package/dist/generate/kinds/world/world-arrangement.js.map +1 -1
- package/dist/generate/kinds/world/world-vars.d.ts.map +1 -1
- package/dist/generate/kinds/world/world-vars.js +2 -1
- package/dist/generate/kinds/world/world-vars.js.map +1 -1
- package/dist/generate/spec-vars.d.ts.map +1 -1
- package/dist/generate/spec-vars.js +2 -1
- package/dist/generate/spec-vars.js.map +1 -1
- package/dist/generate/wiring-family.d.ts +1 -1
- package/dist/generate/wiring-family.d.ts.map +1 -1
- package/dist/generate/wiring-family.js +2 -1
- package/dist/generate/wiring-family.js.map +1 -1
- package/dist/generate/wirings.js +2 -2
- package/dist/generate/wirings.js.map +1 -1
- package/dist/help/flag-notes.d.ts.map +1 -1
- package/dist/help/flag-notes.js +8 -0
- package/dist/help/flag-notes.js.map +1 -1
- package/dist/help/reading-notes.d.ts.map +1 -1
- package/dist/help/reading-notes.js +4 -2
- package/dist/help/reading-notes.js.map +1 -1
- package/dist/help/tool-notes.d.ts.map +1 -1
- package/dist/help/tool-notes.js +1 -2
- package/dist/help/tool-notes.js.map +1 -1
- package/dist/help/usage.js +4 -4
- package/dist/init/add-presets.d.ts +8 -0
- package/dist/init/add-presets.d.ts.map +1 -0
- package/dist/init/add-presets.js +17 -0
- package/dist/init/add-presets.js.map +1 -0
- package/dist/init/agent-permissions.js +2 -0
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/files/audit-files.js +1 -1
- package/dist/init/files/audit-files.js.map +1 -1
- package/dist/init/files/auth-files.js +2 -2
- package/dist/init/files/auth-files.js.map +1 -1
- package/dist/init/files/event-sourcing-files.js +1 -1
- package/dist/init/files/event-sourcing-files.js.map +1 -1
- package/dist/init/files/family-of.d.ts +1 -1
- package/dist/init/files/family-of.d.ts.map +1 -1
- package/dist/init/files/family-of.js +2 -1
- package/dist/init/files/family-of.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +2 -1
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/platform-files.js +2 -2
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/files/privacy-files.js +1 -1
- package/dist/init/files/privacy-files.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 +4 -0
- 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 +28 -24
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/manifest/write-manifest.js +1 -1
- package/dist/init/manifest/write-manifest.js.map +1 -1
- package/dist/init/regulated-sandbox.d.ts +5 -3
- package/dist/init/regulated-sandbox.d.ts.map +1 -1
- package/dist/init/regulated-sandbox.js +6 -3
- package/dist/init/regulated-sandbox.js.map +1 -1
- package/dist/init/rewire-personal-data.js +1 -1
- package/dist/init/rewire-personal-data.js.map +1 -1
- package/dist/init/rewire-preset.d.ts +1 -1
- package/dist/init/rewire-preset.d.ts.map +1 -1
- package/dist/init/rewire-preset.js +5 -2
- package/dist/init/rewire-preset.js.map +1 -1
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +7 -7
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-stack.js +1 -1
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/resolve-style.d.ts +1 -1
- package/dist/init/stack/resolve-style.js +4 -4
- package/dist/init/stack/resolve-style.js.map +1 -1
- package/dist/init/validation-dependencies.d.ts.map +1 -1
- package/dist/init/validation-dependencies.js +3 -1
- package/dist/init/validation-dependencies.js.map +1 -1
- package/dist/layout/fit-statement.js +16 -2
- package/dist/layout/fit-statement.js.map +1 -1
- package/dist/lint/eslint-in-project.d.ts +1 -1
- package/dist/lint/eslint-in-project.d.ts.map +1 -1
- package/dist/lint/eslint-in-project.js +1 -6
- package/dist/lint/eslint-in-project.js.map +1 -1
- package/dist/lint/format-verdict.d.ts +2 -2
- package/dist/lint/format-verdict.d.ts.map +1 -1
- package/dist/lint/format-verdict.js +3 -4
- package/dist/lint/format-verdict.js.map +1 -1
- package/dist/lint/lint-verdict.d.ts +2 -13
- package/dist/lint/lint-verdict.d.ts.map +1 -1
- package/dist/lint/lint-verdict.js +4 -22
- package/dist/lint/lint-verdict.js.map +1 -1
- package/dist/lint/parse-lint-answer.d.ts +1 -3
- package/dist/lint/parse-lint-answer.d.ts.map +1 -1
- package/dist/lint/parse-lint-answer.js +0 -2
- package/dist/lint/parse-lint-answer.js.map +1 -1
- package/dist/merge/git-process.d.ts.map +1 -1
- package/dist/merge/git-process.js +2 -1
- package/dist/merge/git-process.js.map +1 -1
- package/dist/merge/lost/revision-files.d.ts.map +1 -1
- package/dist/merge/lost/revision-files.js +6 -1
- package/dist/merge/lost/revision-files.js.map +1 -1
- package/dist/merge/lost/side-hunks.d.ts.map +1 -1
- package/dist/merge/lost/side-hunks.js +2 -1
- package/dist/merge/lost/side-hunks.js.map +1 -1
- package/dist/merge/merge-in-progress.d.ts +7 -0
- package/dist/merge/merge-in-progress.d.ts.map +1 -0
- package/dist/merge/merge-in-progress.js +22 -0
- package/dist/merge/merge-in-progress.js.map +1 -0
- package/dist/merge/object-bytes.d.ts.map +1 -1
- package/dist/merge/object-bytes.js +2 -1
- package/dist/merge/object-bytes.js.map +1 -1
- package/dist/model-modules/module-layers.d.ts +1 -1
- package/dist/model-modules/module-layers.d.ts.map +1 -1
- package/dist/model-modules/module-layers.js +1 -1
- package/dist/model-modules/module-layers.js.map +1 -1
- package/dist/model-modules/role-folders-of.js +1 -1
- package/dist/model-modules/role-folders-of.js.map +1 -1
- package/dist/package-manager/package-manager-vars.d.ts +1 -1
- package/dist/package-manager/package-manager-vars.js +2 -2
- package/dist/package-manager/package-manager-vars.js.map +1 -1
- package/dist/package-manager/pinned-package-managers.d.ts +2 -2
- package/dist/package-manager/pinned-package-managers.js +2 -2
- package/dist/plan/copy-of-project.d.ts.map +1 -1
- package/dist/plan/copy-of-project.js +2 -1
- package/dist/plan/copy-of-project.js.map +1 -1
- package/dist/plan/format-plan.d.ts.map +1 -1
- package/dist/plan/format-plan.js +12 -2
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/plan/ready-now.d.ts +8 -0
- package/dist/plan/ready-now.d.ts.map +1 -0
- package/dist/plan/ready-now.js +25 -0
- package/dist/plan/ready-now.js.map +1 -0
- package/dist/plan/wave-plan.d.ts +8 -0
- package/dist/plan/wave-plan.d.ts.map +1 -1
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +2 -0
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-refusal.d.ts.map +1 -1
- package/dist/presets/identity-refusal.js +4 -3
- package/dist/presets/identity-refusal.js.map +1 -1
- package/dist/presets/organisations-as-audit-chains.d.ts +10 -0
- package/dist/presets/organisations-as-audit-chains.d.ts.map +1 -0
- package/dist/presets/organisations-as-audit-chains.js +30 -0
- package/dist/presets/organisations-as-audit-chains.js.map +1 -0
- package/dist/progress/format-progress.js +10 -1
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/progress/progress.d.ts +2 -0
- package/dist/progress/progress.d.ts.map +1 -1
- package/dist/progress/ready-rows.d.ts +7 -0
- package/dist/progress/ready-rows.d.ts.map +1 -0
- package/dist/progress/ready-rows.js +14 -0
- package/dist/progress/ready-rows.js.map +1 -0
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +7 -2
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -5
- package/templates/acl/translator.spec.ts.tpl +3 -3
- package/templates/adapter/adapter.spec.ts.tpl +2 -7
- package/templates/adapter/simulated.spec.ts.tpl +1 -1
- package/templates/aggregate/aggregate.spec.ts.tpl +1 -9
- package/templates/architecture/{extractable.tsyringe.spec.ts.tpl → extractable.container.spec.ts.tpl} +2 -1
- package/templates/architecture/extractable.declared.spec.ts.tpl +2 -1
- package/templates/background-job/background-job.spec.buses.ts.tpl +19 -3
- package/templates/background-job/{background-job.spec.tsyringe.ts.tpl → background-job.spec.container.ts.tpl} +42 -12
- package/templates/controller/guard.spec.ts.tpl +22 -17
- package/templates/controller/guard.ts.tpl +3 -5
- package/templates/domain-service/domain-service.spec.ts.tpl +2 -2
- package/templates/init/README.md.tpl +8 -6
- package/templates/init/docker/Dockerfile.tpl +7 -7
- package/templates/init/docker/env.example.tpl +2 -0
- package/templates/init/e2e/start-application.database.ts.tpl +5 -5
- package/templates/init/e2e/start-application.memory.ts.tpl +5 -5
- package/templates/init/main.ts.tpl +1 -0
- package/templates/init/platform/composition/{compose-application.tsyringe.ts.tpl → compose-application.container.ts.tpl} +4 -7
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +2 -0
- package/templates/init/platform/events/start-outbox-relay.ts.tpl +5 -1
- package/templates/init/platform/observability/create-logger.stdout.ts.tpl +2 -2
- package/templates/init/platform/observability/create-metrics.ts.tpl +6 -3
- package/templates/init/platform/resilience/adapters-with-own-policy.ts.tpl +1 -1
- package/templates/init/platform/resilience/default-policy.ts.tpl +1 -1
- package/templates/init/rules/application.md.tpl +2 -0
- package/templates/init/rules/domain.md.tpl +2 -0
- package/templates/init/rules/infrastructure.md.tpl +2 -0
- package/templates/init/rules/platform.md.tpl +3 -3
- package/templates/init/rules/tests.md.tpl +2 -2
- package/templates/pipeline/biome.json.tpl +1 -1
- package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -2
- package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +2 -2
- package/templates/pipeline/lefthook.yml +4 -0
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/pipeline/vitest.config.ts.tpl +2 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +6 -4
- package/templates/presets/identity/context/test/integration/organisation-tenant-directory.spec.ts.tpl +7 -6
- package/templates/presets/identity/context/test/worlds/__context__.world.declared.ts.tpl +2 -1
- package/templates/presets/identity/design.md.tpl +4 -2
- package/templates/presets/identity/e2e/support.wiring.tpl +4 -4
- package/templates/presets/identity/platform/organisation-of-command.ts.tpl +36 -0
- package/templates/process/timeout-job.spec.buses.ts.tpl +15 -2
- package/templates/process/{timeout-job.spec.tsyringe.ts.tpl → timeout-job.spec.container.ts.tpl} +21 -2
- package/templates/query/search.reader.spec.ts.tpl +1 -1
- package/templates/repository/knex/mapper.ts.tpl +1 -1
- package/templates/service/main.ts.tpl +1 -0
- package/templates/value-object/value-object.spec.ts.tpl +1 -5
- /package/templates/adapter/{simulated.wiring.tsyringe.tpl → simulated.wiring.container.tpl} +0 -0
- /package/templates/adapter/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/architecture/{hosting.tsyringe.spec.ts.tpl → hosting.container.spec.ts.tpl} +0 -0
- /package/templates/architecture/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/background-job/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/command/{handler.spec.tsyringe.ts.tpl → handler.spec.container.ts.tpl} +0 -0
- /package/templates/command/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/context/{module.tsyringe.ts.tpl → module.container.ts.tpl} +0 -0
- /package/templates/context/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/controller/{routes.tsyringe.tpl → routes.container.tpl} +0 -0
- /package/templates/erasure-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/event-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/file-upload/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/gateway/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/init/platform/audit/{audit.module.tsyringe.ts.tpl → audit.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/auth/authorization/{authorization.tsyringe.ts.tpl → authorization.container.ts.tpl} +0 -0
- /package/templates/init/platform/buses/{create-command-bus.tsyringe.ts.tpl → create-command-bus.container.ts.tpl} +0 -0
- /package/templates/init/platform/buses/{create-query-bus.tsyringe.ts.tpl → create-query-bus.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{context-selection.tsyringe.ts.tpl → context-selection.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{lay-foundations.tsyringe.ts.tpl → lay-foundations.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{platform-test.module.tsyringe.ts.tpl → platform-test.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{platform.module.tsyringe.ts.tpl → platform.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/composition/{routes-of.tsyringe.ts.tpl → routes-of.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{bind-files.tsyringe.ts.tpl → bind-files.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{files.module.tsyringe.ts.tpl → files.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/files/{staging-uploads.tsyringe.ts.tpl → staging-uploads.container.ts.tpl} +0 -0
- /package/templates/init/platform/jobs/{housekeeping.module.tsyringe.ts.tpl → housekeeping.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{data-subject-copies.tsyringe.ts.tpl → data-subject-copies.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{data-subject-exports.tsyringe.ts.tpl → data-subject-exports.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{privacy.module.tsyringe.ts.tpl → privacy.module.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-erasure.tsyringe.ts.tpl → run-erasure.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-export.tsyringe.ts.tpl → run-export.container.ts.tpl} +0 -0
- /package/templates/init/platform/privacy/{run-purge.tsyringe.ts.tpl → run-purge.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-erase.tsyringe.ts.tpl → privacy-erase.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-export.tsyringe.ts.tpl → privacy-export.container.ts.tpl} +0 -0
- /package/templates/init/scripts/{privacy-purge.tsyringe.ts.tpl → privacy-purge.container.ts.tpl} +0 -0
- /package/templates/integration-event/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/integration-handler/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/job/{job.spec.tsyringe.ts.tpl → job.spec.container.ts.tpl} +0 -0
- /package/templates/job/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/module/{module-file.tsyringe.ts.tpl → module-file.container.ts.tpl} +0 -0
- /package/templates/module/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/personal-data/{copies.tsyringe.tpl → copies.container.tpl} +0 -0
- /package/templates/personal-data/{exports.tsyringe.tpl → exports.container.tpl} +0 -0
- /package/templates/personal-data/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/process/{timeout-job.wiring.tsyringe.tpl → timeout-job.wiring.container.tpl} +0 -0
- /package/templates/projection/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/query/{handler.spec.tsyringe.ts.tpl → handler.spec.container.ts.tpl} +0 -0
- /package/templates/query/{search.handler.spec.tsyringe.ts.tpl → search.handler.spec.container.ts.tpl} +0 -0
- /package/templates/query/{search.wiring.tsyringe.tpl → search.wiring.container.tpl} +0 -0
- /package/templates/query/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/repository/{event-sourced.wiring.tsyringe.tpl → event-sourced.wiring.container.tpl} +0 -0
- /package/templates/repository/{wiring.tsyringe.tpl → wiring.container.tpl} +0 -0
- /package/templates/route/{routes.on-tsyringe.tpl → routes.on-container.tpl} +0 -0
- /package/templates/service/{extracted.tsyringe.tpl → extracted.container.tpl} +0 -0
- /package/templates/test-world/{world.tsyringe.ts.tpl → world.container.ts.tpl} +0 -0
|
@@ -13,18 +13,18 @@ import {
|
|
|
13
13
|
{{#unless httpCache.varnish}}
|
|
14
14
|
import type { IntegrationEvent, IntegrationEventSubscriber, JobScheduler } from '@ddd-ts-kit/kernel';
|
|
15
15
|
{{/unless}}
|
|
16
|
-
{{#if di.
|
|
16
|
+
{{#if di.container}}
|
|
17
17
|
import { defineContextModule } from '@ddd-ts-kit/di';
|
|
18
18
|
{{/if}}
|
|
19
19
|
import { createHttpClient, settled, type HttpClient, type SettledOptions } from '@ddd-ts-kit/testing/e2e';
|
|
20
20
|
{{#if authz.rebac}}
|
|
21
21
|
import { relationTuples } from '{{alias.platform}}/auth/relationships/relation-tuples{{alias.ext}}';
|
|
22
22
|
{{/if}}
|
|
23
|
-
{{#if di.
|
|
23
|
+
{{#if di.container}}
|
|
24
24
|
import { composeApplication, everyContext } from '{{alias.platform}}/composition/compose-application{{alias.ext}}';
|
|
25
25
|
import type { ContextSelection } from '{{alias.platform}}/composition/context-selection{{alias.ext}}';
|
|
26
26
|
{{/if}}
|
|
27
|
-
{{#unless di.
|
|
27
|
+
{{#unless di.container}}
|
|
28
28
|
import { composeApplication, everyContext } from '{{alias.platform}}/composition/compose-application{{alias.ext}}';
|
|
29
29
|
{{/unless}}
|
|
30
30
|
{{#if broker.provided}}
|
|
@@ -258,7 +258,7 @@ function eventsOf(config: AppConfig): EventProvider {
|
|
|
258
258
|
* (an identity provider, a payment service) is answered by its fake of `test/fakes/` here, where
|
|
259
259
|
* the preset or the person who adds it binds it, so that its handlers settle instead of retrying.
|
|
260
260
|
*/
|
|
261
|
-
{{#if di.
|
|
261
|
+
{{#if di.container}}
|
|
262
262
|
function contextsOfTheRun(): ContextSelection {
|
|
263
263
|
const fakes = defineContextModule({
|
|
264
264
|
name: 'end-to-end-fakes',
|
|
@@ -271,7 +271,7 @@ function contextsOfTheRun(): ContextSelection {
|
|
|
271
271
|
return { ...everyContext, modules: [...everyContext.modules, fakes] };
|
|
272
272
|
}
|
|
273
273
|
{{/if}}
|
|
274
|
-
{{#unless di.
|
|
274
|
+
{{#unless di.container}}
|
|
275
275
|
function contextsOfTheRun(): typeof everyContext {
|
|
276
276
|
return everyContext.map((module): (typeof everyContext)[number] => {
|
|
277
277
|
// ddd-ts-kit:e2e-fakes
|
|
@@ -7,13 +7,8 @@ import { Access, Authenticator } from '@ddd-ts-kit/auth';
|
|
|
7
7
|
import { Authenticator } from '@ddd-ts-kit/auth';
|
|
8
8
|
{{/unless}}
|
|
9
9
|
{{/if}}
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
kernelModule,
|
|
13
|
-
type Application as Container,
|
|
14
|
-
type ContextModule,
|
|
15
|
-
type JobsOptions,
|
|
16
|
-
} from '@ddd-ts-kit/di';
|
|
10
|
+
import { kernelModule, type Application as Container, type ContextModule, type JobsOptions } from '@ddd-ts-kit/di';
|
|
11
|
+
import { createApplication } from '{{di.entry}}';
|
|
17
12
|
{{#if events.outbox}}
|
|
18
13
|
import { OutboxPublisher } from '@ddd-ts-kit/events';
|
|
19
14
|
{{/if}}
|
|
@@ -142,6 +137,7 @@ export interface Application {
|
|
|
142
137
|
/** Where another context, or a test, listens to what this application publishes. */
|
|
143
138
|
readonly eventSubscriber: IntegrationEventSubscriber;
|
|
144
139
|
readonly logger: Logger;
|
|
140
|
+
readonly metrics: Metrics;
|
|
145
141
|
/** Runs a job at once, for a test: `jobs.runNow('<context>.<job>')`. */
|
|
146
142
|
readonly jobs: JobScheduler;
|
|
147
143
|
{{#if cache.rateLimit}}
|
|
@@ -372,6 +368,7 @@ function running({ container, options, contexts }: Composed): Application {
|
|
|
372
368
|
eventSubscriber: container.resolve(IntegrationEventSubscriber),
|
|
373
369
|
{{/unless}}
|
|
374
370
|
logger,
|
|
371
|
+
metrics: container.resolve(Metrics),
|
|
375
372
|
jobs: container.resolve(JobScheduler),
|
|
376
373
|
{{#if cache.rateLimit}}
|
|
377
374
|
rateLimiter: container.resolve(RateLimiter),
|
|
@@ -146,6 +146,7 @@ export interface Application {
|
|
|
146
146
|
/** Where another context, or a test, listens to what this application publishes. */
|
|
147
147
|
readonly eventSubscriber: IntegrationEventSubscriber;
|
|
148
148
|
readonly logger: Logger;
|
|
149
|
+
readonly metrics: Platform['metrics'];
|
|
149
150
|
/** Runs a job at once, for a test: `jobs.runNow('<context>.<job>')`. */
|
|
150
151
|
readonly jobs: JobScheduler;
|
|
151
152
|
{{#if cache.rateLimit}}
|
|
@@ -234,6 +235,7 @@ export function composeApplication(
|
|
|
234
235
|
eventSubscriber: platform.subscriber,
|
|
235
236
|
{{/unless}}
|
|
236
237
|
logger,
|
|
238
|
+
metrics,
|
|
237
239
|
jobs: platform.jobs,
|
|
238
240
|
{{#if cache.rateLimit}}
|
|
239
241
|
rateLimiter: platform.rateLimiter,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OutboxRelay, type OutboxStore{{#if events.wakeable}}, type RelaySignal{{/if}} } from '@ddd-ts-kit/events';
|
|
2
2
|
{{#if errors.none}}
|
|
3
|
-
import { SystemClock, type IntegrationEventPublisher, type Logger } from '@ddd-ts-kit/kernel';
|
|
3
|
+
import { SystemClock, type IntegrationEventPublisher, type Logger, type Metrics } from '@ddd-ts-kit/kernel';
|
|
4
4
|
{{/if}}
|
|
5
5
|
{{#if errors.sentry}}
|
|
6
6
|
import {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type ErrorReporter,
|
|
11
11
|
type IntegrationEventPublisher,
|
|
12
12
|
type Logger,
|
|
13
|
+
type Metrics,
|
|
13
14
|
} from '@ddd-ts-kit/kernel';
|
|
14
15
|
{{/if}}
|
|
15
16
|
{{#if broker.kafka}}
|
|
@@ -24,6 +25,8 @@ export interface OutboxRelayOptions {
|
|
|
24
25
|
/** How many times a publication is tried before its record is declared dead; left out, the default of the relay. */
|
|
25
26
|
readonly maxAttempts?: number;
|
|
26
27
|
readonly logger: Logger;
|
|
28
|
+
/** Where the depth of the outbox goes after each tick (`outbox_pending`, `outbox_failed`, `outbox_dead`); left out (the tests), nowhere. */
|
|
29
|
+
readonly metrics?: Metrics;
|
|
27
30
|
{{#if errors.sentry}}
|
|
28
31
|
/** Where an event whose publication the relay declares dead is reported; left out (the tests), nowhere. */
|
|
29
32
|
readonly errors?: ErrorReporter;
|
|
@@ -48,6 +51,7 @@ export function startOutboxRelay(options: OutboxRelayOptions): RunningRelay {
|
|
|
48
51
|
publisher: options.publisher,
|
|
49
52
|
clock: new SystemClock(),
|
|
50
53
|
...(options.maxAttempts === undefined ? {} : { maxAttempts: options.maxAttempts }),
|
|
54
|
+
...(options.metrics === undefined ? {} : { metrics: options.metrics }),
|
|
51
55
|
{{#if broker.kafka}}
|
|
52
56
|
// The events of one aggregate leave in the order they were stored, under the key Kafka orders them by: it takes a single running relay.
|
|
53
57
|
ordering: 'per-key',
|
|
@@ -14,8 +14,8 @@ export interface LogSettings {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* JSON lines on the standard output,
|
|
18
|
-
*
|
|
17
|
+
* JSON lines on the standard output, the credential keys of the kernel redacted whatever
|
|
18
|
+
* their case (`init --logger pino` or `--logger winston` has a pretty format). Every entry carries
|
|
19
19
|
* what the execution scope knows of the work in progress (correlation id, origin, actor,
|
|
20
20
|
* tenant) and the ids of the active trace, so a request is followed from its log lines to its
|
|
21
21
|
* spans and to its audit entries. `stop()` of the application flushes it, last.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Metrics } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { openTelemetryMetrics } from '@ddd-ts-kit/tracing';
|
|
2
3
|
|
|
3
|
-
//
|
|
4
|
+
// On the meter provider `initTracing` registered (`tracing.ts`, imported first by main.ts): the
|
|
5
|
+
// series leave by OTLP with the spans when `OTEL_EXPORTER_OTLP_ENDPOINT` is set, and are measured
|
|
6
|
+
// by nothing when it is not, nor in the tests.
|
|
4
7
|
export function createMetrics(): Metrics {
|
|
5
|
-
return
|
|
8
|
+
return openTelemetryMetrics({ meterName: '{{project.name}}' });
|
|
6
9
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The adapters that state their own policy: filled by `ownPolicy` (`own-policy.ts`, which
|
|
3
|
-
* `generate adapter` writes on
|
|
3
|
+
* `generate adapter` writes on a container of the kit), read by `defaultPolicy`, which leaves them alone. The
|
|
4
4
|
* default policy wraps outside the own one, so it finds here the very instance `ownPolicy` returned.
|
|
5
5
|
*/
|
|
6
6
|
export const adaptersWithOwnPolicy = new WeakSet<object>();
|
|
@@ -5,7 +5,7 @@ import type { ResilienceSettings } from '{{alias.platform}}/resilience/resilienc
|
|
|
5
5
|
/**
|
|
6
6
|
* What goes around every adapter that leaves the process (`external`, `gateway`) and states no
|
|
7
7
|
* policy of its own: retries with backoff, and a time limit for each attempt. `forKinds` is the
|
|
8
|
-
* filter: a platform wired by hand gives every adapter to it, the
|
|
8
|
+
* filter: a platform wired by hand gives every adapter to it, the module of the platform only those two kinds.
|
|
9
9
|
*/
|
|
10
10
|
export function defaultPolicy(settings: ResilienceSettings): Aspect {
|
|
11
11
|
const policy = when(
|
|
@@ -9,7 +9,9 @@ paths:
|
|
|
9
9
|
- Imports `domain/`, `application/`, published languages, `@ddd-ts-kit/kernel` and `@ddd-ts-kit/auth` only (`layer/application-inward`): never `infrastructure/`, `presentation/`, a framework or a driver. A background job, and no other file here, also imports `@ddd-ts-kit/validation` and the validation library of the stack, for the schema of its payload.
|
|
10
10
|
- One use case per folder, `commands/<use-case>/` or `queries/<use-case>/`: the message, its handler, a `*.result.ts` when the answer has a shape of its own. The handler has one public method, `execute` (`application/handler-shape`): it loads or builds, calls ONE intention method, `await repository.save(aggregate)`, and returns at most an identifier. Each binding is named after the concept it holds, `const invoice = await this.invoiceRepository.findById(command.invoiceId)`, `for (const reminder of dueReminders)`, never `target`, `data` or `item` (`naming/business-name`).
|
|
11
11
|
- Events leave with the save: never `pullEvents()`, never a `DomainEventDispatcher` here (`domain-events/dispatched-on-save`). A reaction is a class of `event-handlers/` or a publisher of `integration/publishers/`. It runs at the end of the unit of work, before the commit, and depends only on what the transaction covers (`domain-events/transactional-before-commit`): repositories, the integration event publisher, the command bus. An effect outside the database is a handler of the `after-commit` phase (`generate event-handler ... --phase after-commit`: at most once, never saves, sends a command) or, when it must not be lost, the handler of an integration event.
|
|
12
|
+
{{#if eventSourcing.on}}
|
|
12
13
|
- Nothing here reads the event store: an event-sourced aggregate is loaded and saved through its repository port like any other (`event-sourcing/store-behind-repository`). A projection writes its read model and never a stream (`event-sourcing/projection-never-appends`); one fed by the store is declared `@Projection(name, { feed: 'event-store' })`.
|
|
14
|
+
{{/if}}
|
|
13
15
|
{{#if style.declared}}
|
|
14
16
|
- Every command and query carries `@Requires(permission)` or `@Public()` (`authz/declared`), and the actor is in the message (`authz/actor-explicit`). Permissions live in `<context>.permissions.ts` at the root of the context, rules that need loaded state in `application/authorization/*.policy.ts`.{{#if authz.rbac}} A role holds each permission by name in the roles of the platform (`--grant <role>` when generating it): the super-admin `*` alone refuses everybody else (`authz/granted`).{{/if}}
|
|
15
17
|
- The decorator is the registration (`declarations/role-declared`): `@CommandHandler(Message)`, `@QueryHandler(Message)`, `@DomainEventHandler(Event)` (the name is the static `eventName` of the event class), `@IntegrationEventHandler(definition, { consumer })`, `@Scheduled('<context>.<job>', schedule)`, `@Background(options)` (the name is the static `jobName`), `@Projection('<context>.<name>')`, `@Policy(permission, { name })`. Names are string literals.
|
|
@@ -34,7 +34,9 @@ paths:
|
|
|
34
34
|
- A value object returns its refusals in the `Result` of `create`{{#if refusals.named}}: `err(InvalidEmail.forAddress(raw))`{{/if}}{{#if refusals.factories}}: `err(PersonError.invalidEmail(raw))`{{/if}}; the caller unwraps it with `unwrap(..)` of the kernel. `npx ddd-ts-kit value-objects` moves the project to factories that throw.
|
|
35
35
|
{{/if}}
|
|
36
36
|
- Domain events are named in the past tense, `<context>.<aggregate>.<fact>` (`events/name-format`), declared once on the class, `static readonly eventName`, which `readonly name` reads (`events/name-declared-once`), and recorded by the aggregate (`this.record(...)`). They leave with the save: nothing here dispatches them.
|
|
37
|
+
{{#if eventSourcing.on}}
|
|
37
38
|
- An aggregate whose history is the business can be event-sourced, chosen per aggregate (`generate aggregate <context> <Name> --event-sourced`): it extends `EventSourcedAggregate`, a command checks the invariants then `this.record(...)`, and only its `apply<Fact>` methods (and `restore`, for a snapshot) change the state (`event-sourcing/state-in-apply`). Its events are named in the past tense (`event-sourcing/past-tense`). The other aggregates keep their state in tables.
|
|
39
|
+
{{/if}}
|
|
38
40
|
- A repository here is a port: an abstract class extending the kernel `Repository<Aggregate>`, abstract members only (`ports/abstract-class`). A domain service is stateless.
|
|
39
41
|
- Time and identifiers come in as parameters (`purity/*`); nothing here knows the acting user or its rights (`authz/in-application`).
|
|
40
42
|
- One concept per file, with the suffix of its role: `.aggregate.ts`, `.entity.ts`, `.vo.ts`, `.vocabulary.ts`, `.event.ts`, `.error.ts`, `.repository.ts`, `.service.ts` (`naming/suffix`, `naming/one-concept-per-file`).
|
|
@@ -31,7 +31,9 @@ paths:
|
|
|
31
31
|
- Retry, timeout and cache go on the binding (`ownPolicy(retry(...), timeout(...))`) or, when the policy is part of what the adapter is, as decorators of `@ddd-ts-kit/aspects/decorators` (`aspects/outside-in`). Kinds `external` and `gateway` get the default policy of the platform otherwise. `ownPolicy` is the helper of `{{alias.platform}}/resilience/own-policy{{alias.ext}}`, which `generate adapter` writes when the platform does not have it yet.
|
|
32
32
|
{{/if}}
|
|
33
33
|
- A repository only persists: no `pullEvents()`, no dispatcher (`domain-events/dispatched-on-save`). A removal that announces an event takes the aggregate, not its id.
|
|
34
|
+
{{#if eventSourcing.on}}
|
|
34
35
|
- The repository adapter of an event-sourced aggregate delegates to `EventSourcedRepository` of the kernel. Its stored events are declared in `persistence/<aggregate>-events.mapper.ts` with `defineStoredEvent` and a named type of their data; a change of that type is a new version with its upcaster, never an edit (`event-sourcing/upcaster-required`, against `stored-events.lock.json`, which `ddd-ts-kit docs --stored-events` writes once the shape of a version is final; `docs --check` fails while a version is unrecorded). Every named type the data reaches is declared in the codec file too.
|
|
36
|
+
{{/if}}
|
|
35
37
|
- Infrastructure faults are plain errors (a 5xx, reported from outside); business refusals are `DomainError`s raised by the domain.
|
|
36
38
|
- Every adapter passes the contract suite of the fake of its port (`test/integration/*.contract.spec.ts`).
|
|
37
39
|
- Method: `/ddd-ts-kit:persistence`. Create with `npx ddd-ts-kit generate repository|adapter|gateway|acl ... --json`.
|
|
@@ -13,16 +13,16 @@ paths:
|
|
|
13
13
|
- One folder per concern, no file at the root: `composition/` turns the platform and the contexts into an application, `auth/` holds `authentication/` (who is calling), `authorization/` (what they may do, whatever the model) and the folder of the model, `observability/` the traces, logs, measures{{#if errors.sentry}} and error reports{{/if}}, `jobs/` the settings of the scheduled jobs{{#if audit.route}}, `audit/search-audit-entries/` the read side of the trail{{/if}}. A new file joins the folder of what it answers.
|
|
14
14
|
- `main.ts`, and each `apps/*/main.ts`, imports `platform/observability/tracing.ts` first{{#if errors.sentry}}, `platform/observability/errors.ts` second{{/if}}, then composes the application: nothing else belongs in an entry point.
|
|
15
15
|
- Contexts, routes and registries are added by the generator between `// ddd-ts-kit:` markers: never edit between them, never remove one.
|
|
16
|
-
{{#if di.
|
|
16
|
+
{{#if di.container}}
|
|
17
17
|
- Ports and values are bound by class: `bind(Port).toClass(...)`, `toValue(...)`, or `rebind(Port)` over a default of the kernel module. No token helper, no injection constant; one exported class, interface or function per file.
|
|
18
18
|
- Cross-cutting behaviour lives here: spans through `kernelModule({ instrumentation })` (`composition/lay-foundations.ts`), `around: tracedRoutes()` at the HTTP boundary and `tracedPublisher` for the outbox relay; logs, measures, permissions and audit as bus middlewares (`buses/`); the policy of outbound adapters in `resilience/`.
|
|
19
19
|
{{/if}}
|
|
20
|
-
{{#unless di.
|
|
20
|
+
{{#unless di.container}}
|
|
21
21
|
- One `Platform` is built in `composition/create-platform.ts` and handed to each context; a port or a value is typed by an abstract class. No token helper, no injection constant; one exported class, interface or function per file.
|
|
22
22
|
- Cross-cutting behaviour lives here: spans through the members of `traceApplication()` (`composition/lay-foundations.ts`, handed to the buses and to every adapter by `composition/create-platform.ts`), `around: tracedRoutes()` at the HTTP boundary and `tracedPublisher` for the outbox relay; logs, measures, permissions and audit as bus middlewares (`buses/`); the policy of outbound adapters in `resilience/`.
|
|
23
23
|
{{/unless}}
|
|
24
24
|
{{#if files.any}}
|
|
25
|
-
- Files: `files/open-files.ts` opens the connector of `stack.storage` from `config/read-files.ts`{{#if di.
|
|
25
|
+
- Files: `files/open-files.ts` opens the connector of `stack.storage` from `config/read-files.ts`{{#if di.container}}, `files/files.module.ts` binds the ports and the hourly purge of staged files, `files/staging-uploads.ts` stages the file a command carries on the command bus, before the transaction{{/if}}{{#unless di.container}}, `files/create-files.ts` builds them, `composition/compose-application.ts` registers the hourly purge of staged files and `buses/create-command-bus.ts` stages the file a command carries on the command bus, before the transaction{{/unless}}; the tools and the tests keep files in memory. A scanner of your own (an antivirus) is bound here, never called from a use case.
|
|
26
26
|
{{/if}}
|
|
27
27
|
- `@ddd-ts-kit/tracing` and `@opentelemetry/*` are imported here and nowhere else (`tracing/platform-only`).
|
|
28
28
|
- Logs, spans and error reports carry identifiers and codes only: never arguments, payloads, error messages, nor anything personal beyond the id of the actor.
|
|
@@ -8,11 +8,11 @@ paths:
|
|
|
8
8
|
# Tests
|
|
9
9
|
|
|
10
10
|
- `test/unit/`: aggregates, value objects and domain services without any double, given / when / then on the recorded facts; handlers with the fakes of `test/fakes/`.
|
|
11
|
-
{{#if di.
|
|
11
|
+
{{#if di.container}}
|
|
12
12
|
- A handler spec goes through the test application, `createTestApplication({ modules, fakes: [fake(Port, aFake)] })`: it asserts the stored state, the facts announced with the save and heard at the end of the command (`application.domainEvents`), `application.eventBus.published`, and the refusal (`FORBIDDEN`) of an actor without the permission.
|
|
13
13
|
- A job spec runs the job by its name, `await application.jobs.runNow('<context>.<job>')`, and asserts the command it sent as its system actor.
|
|
14
14
|
{{/if}}
|
|
15
|
-
{{#unless di.
|
|
15
|
+
{{#unless di.container}}
|
|
16
16
|
- A handler spec goes through the buses of `createTestBuses()`, the fake repository wrapped by `dispatching(...)`: it asserts the stored state, the facts announced with the save and heard at the end of the command (`domainEvents`), `publishedEvents()`, and the refusal (`FORBIDDEN`) of an actor without the permission.
|
|
17
17
|
- A job spec runs the job with an occurrence, `await job.run(occurrence)`, and asserts the command it sent as its system actor.
|
|
18
18
|
{{/unless}}
|
|
@@ -15,10 +15,11 @@ runs:
|
|
|
15
15
|
# The newest patch of the release line, not the one the image of the runner holds: a security
|
|
16
16
|
# release of Node reaches the next run.
|
|
17
17
|
check-latest: true
|
|
18
|
-
{{#if pm.
|
|
18
|
+
{{#if pm.pinned}}
|
|
19
19
|
- name: The package manager package.json pins
|
|
20
20
|
shell: bash
|
|
21
|
-
run:
|
|
21
|
+
run: |
|
|
22
|
+
npm install --global "$(node -p "require('./package.json').packageManager")"
|
|
22
23
|
{{/if}}
|
|
23
24
|
# One install per lockfile, shared by every job and every run. The key holds the lockfile and
|
|
24
25
|
# package.json: a hit is what a fresh install of that lockfile gives, and a manifest that left
|
|
@@ -75,8 +75,8 @@ default:
|
|
|
75
75
|
- node_modules/
|
|
76
76
|
policy: pull
|
|
77
77
|
before_script:
|
|
78
|
-
{{#if pm.
|
|
79
|
-
-
|
|
78
|
+
{{#if pm.pinned}}
|
|
79
|
+
- npm install --global "$(node -p "require('./package.json').packageManager")"
|
|
80
80
|
{{/if}}
|
|
81
81
|
- test -d node_modules || npm ci
|
|
82
82
|
{{#if orm.prisma}}
|
|
@@ -3,6 +3,10 @@ min_version: 2.0.0
|
|
|
3
3
|
# without its dependencies fails the commit instead of skipping the checks.
|
|
4
4
|
lefthook: node_modules/.bin/lefthook
|
|
5
5
|
|
|
6
|
+
# A hook that passes says nothing: a job prints its output only when it fails.
|
|
7
|
+
output:
|
|
8
|
+
- failure
|
|
9
|
+
|
|
6
10
|
pre-commit:
|
|
7
11
|
parallel: true
|
|
8
12
|
jobs:
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"ci:build": "npm run build"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@biomejs/biome": "2.6.
|
|
23
|
+
"@biomejs/biome": "2.6.3",
|
|
24
24
|
"@commitlint/cli": "^21.2.3",
|
|
25
25
|
"@commitlint/config-conventional": "^21.2.3",
|
|
26
|
-
"@ddd-ts-kit/eslint-plugin": "^0.
|
|
26
|
+
"@ddd-ts-kit/eslint-plugin": "^0.106.0",
|
|
27
27
|
"@eslint/js": "^10.0.1",
|
|
28
28
|
"@typescript/native": "npm:typescript@~7.0.2",
|
|
29
29
|
"@vitest/coverage-v8": "^5.0.3",
|
|
@@ -20,6 +20,8 @@ const UNIT_PROJECT: TestProjectInlineConfiguration = {
|
|
|
20
20
|
name: 'unit',
|
|
21
21
|
include: ['{{config.sourceRoot}}/**/*.spec.ts', 'test/architecture/**/*.spec.ts'],
|
|
22
22
|
exclude: [INTEGRATION_SPECS, ...NOT_AFFECTED],
|
|
23
|
+
// The unit specs share no state: each worker runs them in one module graph, the declarations of a context evaluated once rather than once per spec file. `isolate: true` gives each file its own graph again.
|
|
24
|
+
isolate: false,
|
|
23
25
|
},
|
|
24
26
|
};
|
|
25
27
|
|
|
@@ -39,10 +39,12 @@ export class DeactivateAccountHandler implements CommandHandler<DeactivateAccoun
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* A person deactivates their own account, which leaves every organisation it belongs to and ends
|
|
42
|
-
* every delegation it gave or received there, in the same unit of work
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* the
|
|
42
|
+
* every delegation it gave or received there, in the same unit of work. This context refuses the
|
|
43
|
+
* account at once; the other contexts read the token, so they refuse it at its next token: a
|
|
44
|
+
* token already issued lives until it expires (300 s in the realm of the kit). A project that
|
|
45
|
+
* wants no window checks the account at the edge. The last owner of an organisation is refused:
|
|
46
|
+
* they appoint another owner first. The provider is asked to disable the person once it is
|
|
47
|
+
* committed (`application/integration/handlers/`).
|
|
46
48
|
*/
|
|
47
49
|
async execute({ actor }: DeactivateAccountCommand): Promise<string> {
|
|
48
50
|
const account = await this.accountRepository.findById(actor.id);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from '{{tests.module}}';
|
|
2
|
-
{{#if di.
|
|
3
|
-
import { contextModule,
|
|
2
|
+
{{#if di.container}}
|
|
3
|
+
import { contextModule, kernelModule } from '@ddd-ts-kit/di';
|
|
4
|
+
import { createApplication } from '{{di.entry}}';
|
|
4
5
|
{{/if}}
|
|
5
|
-
{{#if di.
|
|
6
|
+
{{#if di.container}}
|
|
6
7
|
import {
|
|
7
8
|
FixedClock,
|
|
8
9
|
FixedExecutionScope,
|
|
@@ -13,10 +14,10 @@ import {
|
|
|
13
14
|
type ScheduledJob,
|
|
14
15
|
} from '@ddd-ts-kit/kernel';
|
|
15
16
|
{{/if}}
|
|
16
|
-
{{#unless di.
|
|
17
|
+
{{#unless di.container}}
|
|
17
18
|
import { FixedClock, FixedExecutionScope, executionContext, type Actor } from '@ddd-ts-kit/kernel';
|
|
18
19
|
{{/unless}}
|
|
19
|
-
{{#if di.
|
|
20
|
+
{{#if di.container}}
|
|
20
21
|
import { Scheduled } from '@ddd-ts-kit/kernel/declarations';
|
|
21
22
|
{{/if}}
|
|
22
23
|
import { {{preset.adapter.pascal}}OrganisationRepository } from '{{alias.context}}/infrastructure/persistence/{{preset.adapter.kebab}}-organisation.repository{{alias.ext}}';
|
|
@@ -67,7 +68,7 @@ describe('{{preset.adapter.pascal}}OrganisationTenantDirectory', () => {
|
|
|
67
68
|
await organisations.save(anOrganisation().identifiedBy('globex').build());
|
|
68
69
|
expect(await directory.tenants()).toEqual(['acme', 'globex']);
|
|
69
70
|
});
|
|
70
|
-
{{#if di.
|
|
71
|
+
{{#if di.container}}
|
|
71
72
|
|
|
72
73
|
it('gives an organisation opened after the boot its run of a per-tenant job', async () => {
|
|
73
74
|
const { organisations, directory } = arrange();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RoleBasedAuthorizer } from '@ddd-ts-kit/auth';
|
|
2
2
|
import { authorizationModule } from '@ddd-ts-kit/auth/di';
|
|
3
3
|
import { anActor } from '@ddd-ts-kit/auth/testing';
|
|
4
|
-
import { contextModule,
|
|
4
|
+
import { contextModule, fake } from '@ddd-ts-kit/di';
|
|
5
|
+
import { createTestApplication } from '{{di.entry}}';
|
|
5
6
|
import type { Actor } from '@ddd-ts-kit/kernel';
|
|
6
7
|
import * as {{context.camel}}Declarations from '{{alias.context}}/{{context.kebab}}.declarations{{alias.ext}}';
|
|
7
8
|
import { platformTestModule } from '{{alias.platform}}/composition/platform-test.module{{alias.ext}}';
|
|
@@ -9,8 +9,10 @@ what their token says (`PUT /accounts/me`) and refreshed at each later one. No p
|
|
|
9
9
|
of the provider is stored here. The email address of an account is always the one of the token,
|
|
10
10
|
never one a client sends, and one the provider verified (`email_verified`): an invitation is
|
|
11
11
|
matched on it. A deactivated account leaves every organisation and ends every delegation in the
|
|
12
|
-
same unit of work
|
|
13
|
-
|
|
12
|
+
same unit of work; the last owner of an organisation appoints another owner before deactivating.
|
|
13
|
+
This context refuses the account at once, the other contexts at its next token: they read the
|
|
14
|
+
token, and a token already issued lives until it expires (300 s in the realm of the kit). A
|
|
15
|
+
project that wants no window checks the account at the edge.
|
|
14
16
|
|
|
15
17
|
**Organisations, members and roles.** An organisation is opened under its slug, which is its
|
|
16
18
|
identity for good, and its opener is its first owner. A member holds one role, `owner`, `admin`
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
@@imports
|
|
2
|
-
{{#if di.
|
|
2
|
+
{{#if di.container}}
|
|
3
3
|
import { IdentityProviderAdmin } from '{{alias.context}}/application/ports/identity-provider-admin.port{{alias.ext}}';
|
|
4
4
|
{{/if}}
|
|
5
|
-
{{#unless di.
|
|
5
|
+
{{#unless di.container}}
|
|
6
6
|
import { {{context.camel}}Module } from '{{alias.context}}/{{context.kebab}}.module{{alias.ext}}';
|
|
7
7
|
{{/unless}}
|
|
8
8
|
import { FakeIdentityProviderAdmin } from '{{alias.context}}/test/fakes/identity-provider-admin.fake{{alias.ext}}';
|
|
9
9
|
@@e2e-fakes
|
|
10
|
-
{{#if di.
|
|
10
|
+
{{#if di.container}}
|
|
11
11
|
builder.rebind(IdentityProviderAdmin).toValue(new FakeIdentityProviderAdmin());
|
|
12
12
|
{{/if}}
|
|
13
|
-
{{#unless di.
|
|
13
|
+
{{#unless di.container}}
|
|
14
14
|
if (module === {{context.camel}}Module) {
|
|
15
15
|
return (platform) => {{context.camel}}Module(platform, { identityProvider: new FakeIdentityProviderAdmin() });
|
|
16
16
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Message } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { ChangeMemberRoleCommand } from '{{alias.context}}/application/commands/change-member-role/change-member-role.command{{alias.ext}}';
|
|
3
|
+
import { GrantDelegationCommand } from '{{alias.context}}/application/commands/grant-delegation/grant-delegation.command{{alias.ext}}';
|
|
4
|
+
import { InviteMemberCommand } from '{{alias.context}}/application/commands/invite-member/invite-member.command{{alias.ext}}';
|
|
5
|
+
import { OpenOrganisationCommand } from '{{alias.context}}/application/commands/open-organisation/open-organisation.command{{alias.ext}}';
|
|
6
|
+
import { RemoveMemberCommand } from '{{alias.context}}/application/commands/remove-member/remove-member.command{{alias.ext}}';
|
|
7
|
+
import { RevokeDelegationCommand } from '{{alias.context}}/application/commands/revoke-delegation/revoke-delegation.command{{alias.ext}}';
|
|
8
|
+
import { RevokeInvitationCommand } from '{{alias.context}}/application/commands/revoke-invitation/revoke-invitation.command{{alias.ext}}';
|
|
9
|
+
import { OrganisationSlug } from '{{alias.context}}/domain/value-objects/organisation-slug.vo{{alias.ext}}';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The organisation a command of the {{context.kebab}} context acts on, whose audit chain receives its
|
|
13
|
+
* entry once it succeeded, whatever organisation the token of its sender names: the owner of an
|
|
14
|
+
* organisation reads there who opened it, invited, removed, changed a role or lent a right in it.
|
|
15
|
+
* The entry of a failure, and the decision of the authorization, stay in the tenant of the token,
|
|
16
|
+
* since they record what the sender asked. Accepting or declining an invitation names its token
|
|
17
|
+
* only: the organisation it joins reads `{{context.kebab}}.member.joined` in its own chain.
|
|
18
|
+
*/
|
|
19
|
+
export function organisationOfCommand(message: Message): string | undefined {
|
|
20
|
+
if (message instanceof OpenOrganisationCommand) {
|
|
21
|
+
return OrganisationSlug.create(message.organisation.slug).value;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (
|
|
25
|
+
message instanceof ChangeMemberRoleCommand ||
|
|
26
|
+
message instanceof GrantDelegationCommand ||
|
|
27
|
+
message instanceof InviteMemberCommand ||
|
|
28
|
+
message instanceof RemoveMemberCommand ||
|
|
29
|
+
message instanceof RevokeDelegationCommand ||
|
|
30
|
+
message instanceof RevokeInvitationCommand
|
|
31
|
+
) {
|
|
32
|
+
return message.organisationId;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
2
|
import { InMemoryProcessStore, type BackgroundJob } from '@ddd-ts-kit/kernel';
|
|
3
3
|
import { InMemoryJobStore, QueueWorker, StoredJobQueue, StoredProcessRunner } from '@ddd-ts-kit/scheduling';
|
|
4
|
+
{{#unless world.through}}
|
|
4
5
|
import { createTestBuses } from '@ddd-ts-kit/testing';
|
|
6
|
+
{{/unless}}
|
|
5
7
|
import { {{name.pascal}}TimeoutBackgroundJob } from '{{alias.context}}/application/background/{{name.kebab}}-timeout.background-job{{alias.ext}}';
|
|
6
8
|
import { {{name.pascal}}Process } from '{{alias.context}}/application/processes/{{name.kebab}}.process{{alias.ext}}';
|
|
9
|
+
{{#if world.through}}
|
|
10
|
+
{{world.import}}
|
|
11
|
+
{{/if}}
|
|
7
12
|
|
|
8
13
|
const HOUR = 3_600_000;
|
|
9
14
|
|
|
10
15
|
describe('The timeout of {{name.words}}, when its job runs', () => {
|
|
11
16
|
it('runs the step of the deadline once it is due, and not before', async () => {
|
|
12
|
-
const { clock, processes, runner, worker } = arrange();
|
|
17
|
+
const { clock, processes, runner, worker } = {{world.await}}arrange();
|
|
13
18
|
const deadline = new Date(clock.now().getTime() + HOUR);
|
|
14
19
|
const process = new {{name.pascal}}Process();
|
|
15
20
|
const id = '{{name.kebab}}-1';
|
|
@@ -26,9 +31,17 @@ describe('The timeout of {{name.words}}, when its job runs', () => {
|
|
|
26
31
|
});
|
|
27
32
|
});
|
|
28
33
|
|
|
34
|
+
{{#unless world.through}}
|
|
35
|
+
{{world.comment}}
|
|
36
|
+
{{/unless}}
|
|
29
37
|
/** The runner, the queue of its timeouts and the worker in memory, on the clock, the buses and the unit of work of the test buses. */
|
|
30
|
-
function arrange() {
|
|
38
|
+
{{world.async}}function arrange() {
|
|
39
|
+
{{#if world.through}}
|
|
40
|
+
const { commandBus, clock, ids, executionScope, unitOfWork } = await {{world.builder}}();
|
|
41
|
+
{{/if}}
|
|
42
|
+
{{#unless world.through}}
|
|
31
43
|
const { commandBus, clock, ids, executionScope, unitOfWork } = createTestBuses();
|
|
44
|
+
{{/unless}}
|
|
32
45
|
const store = new InMemoryJobStore();
|
|
33
46
|
const processes = new InMemoryProcessStore();
|
|
34
47
|
const jobQueue = new StoredJobQueue({ store, clock, ids, scope: executionScope });
|
package/templates/process/{timeout-job.spec.tsyringe.ts.tpl → timeout-job.spec.container.ts.tpl}
RENAMED
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
{{#unless world.through}}
|
|
2
3
|
import { RoleBasedAuthorizer } from '@ddd-ts-kit/auth';
|
|
3
4
|
import { authorizationModule } from '@ddd-ts-kit/auth/di';
|
|
4
5
|
{{spec.diPlain}}
|
|
5
6
|
{{spec.contextImports}}
|
|
7
|
+
{{/unless}}
|
|
6
8
|
import { ProcessRunner } from '@ddd-ts-kit/kernel';
|
|
9
|
+
{{#unless world.through}}
|
|
7
10
|
import { platformTestModule } from '{{alias.platform}}/composition/platform-test.module{{alias.ext}}';
|
|
11
|
+
{{/unless}}
|
|
8
12
|
import { {{name.pascal}}Process } from '{{alias.context}}/application/processes/{{name.kebab}}.process{{alias.ext}}';
|
|
13
|
+
{{#if world.through}}
|
|
14
|
+
{{world.import}}
|
|
15
|
+
{{/if}}
|
|
9
16
|
|
|
10
17
|
const HOUR = 3_600_000;
|
|
18
|
+
{{#unless world.through}}
|
|
11
19
|
|
|
12
20
|
const authorization = authorizationModule({ authorizer: new RoleBasedAuthorizer({ roles: {} }) });
|
|
21
|
+
{{/unless}}
|
|
13
22
|
|
|
14
23
|
describe('The timeout of {{name.words}}, when its job runs', () => {
|
|
15
24
|
it('runs the step of the deadline once it is due, and not before', async () => {
|
|
16
|
-
const application = {{
|
|
25
|
+
const application = {{world.await}}arrange();
|
|
17
26
|
const deadline = new Date(application.clock.now().getTime() + HOUR);
|
|
18
27
|
const process = new {{name.pascal}}Process();
|
|
19
28
|
const id = '{{name.kebab}}-1';
|
|
@@ -32,7 +41,16 @@ describe('The timeout of {{name.words}}, when its job runs', () => {
|
|
|
32
41
|
});
|
|
33
42
|
});
|
|
34
43
|
|
|
35
|
-
{{
|
|
44
|
+
{{#unless world.through}}
|
|
45
|
+
{{world.comment}}
|
|
46
|
+
{{/unless}}
|
|
47
|
+
{{world.async}}function arrange() {
|
|
48
|
+
{{#if world.through}}
|
|
49
|
+
const { application } = await {{world.builder}}();
|
|
50
|
+
|
|
51
|
+
return application;
|
|
52
|
+
{{/if}}
|
|
53
|
+
{{#unless world.through}}
|
|
36
54
|
{{#if spec.assembles}}
|
|
37
55
|
const context = {{spec.context}};
|
|
38
56
|
|
|
@@ -40,4 +58,5 @@ describe('The timeout of {{name.words}}, when its job runs', () => {
|
|
|
40
58
|
return createTestApplication({
|
|
41
59
|
modules: [{{spec.modules}}],
|
|
42
60
|
});
|
|
61
|
+
{{/unless}}
|
|
43
62
|
}
|
|
@@ -6,7 +6,7 @@ import { Fake{{name.pascal}}Reader } from '{{alias.context}}/test/fakes/{{name.k
|
|
|
6
6
|
const LINES = [{ id: '{{name.kebab}}-1' }, { id: '{{name.kebab}}-2' }, { id: '{{name.kebab}}-3' }];
|
|
7
7
|
const [first, second, third] = LINES;
|
|
8
8
|
|
|
9
|
-
describe('
|
|
9
|
+
describe('The reader of {{name.words}}', () => {
|
|
10
10
|
it('shows only what the access scope covers: everything, nothing, some identifiers, a filter', async () => {
|
|
11
11
|
const reader = new Fake{{name.pascal}}Reader(LINES);
|
|
12
12
|
const some = await reader.search({ kind: 'ids', ids: ['{{name.kebab}}-2'] }, offsetPage());
|
|
@@ -12,7 +12,7 @@ export const {{aggregate.pascal}}Mapper = {
|
|
|
12
12
|
},
|
|
13
13
|
|
|
14
14
|
toRow(saved: {{aggregate.pascal}}): {{aggregate.pascal}}Columns {
|
|
15
|
-
// TODO(domain): flatten each value object of {{aggregate.pascal}}State into its columns; nothing of the row type leaves this file.
|
|
15
|
+
// TODO(domain): flatten each value object of {{aggregate.pascal}}State into its columns; nothing of the row type leaves this file. A `jsonb` column holding an array or a string takes `jsonColumn(value)` of `@ddd-ts-kit/knex` on Knex, where the other ORM serialize it.
|
|
16
16
|
{{#if personal.any}}
|
|
17
17
|
return {
|
|
18
18
|
id: saved.id,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
-
{{#if valueObjects.throwing}}
|
|
3
2
|
import { expectRefusal } from '@ddd-ts-kit/testing';
|
|
4
|
-
{{/if}}
|
|
5
3
|
{{#if valueObjects.result}}
|
|
6
4
|
import { unwrap } from '@ddd-ts-kit/kernel';
|
|
7
5
|
{{/if}}
|
|
@@ -27,9 +25,7 @@ describe('{{name.title}}', () => {
|
|
|
27
25
|
expectRefusal(() => {{name.pascal}}.create(' '), 'INVARIANT_VIOLATION');
|
|
28
26
|
{{/if}}
|
|
29
27
|
{{#if valueObjects.result}}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
expect(result.ok).toBe(false);
|
|
28
|
+
expectRefusal({{name.pascal}}.create(' '), 'INVARIANT_VIOLATION');
|
|
33
29
|
{{/if}}
|
|
34
30
|
});
|
|
35
31
|
|
|
File without changes
|
|
File without changes
|
/package/templates/architecture/{hosting.tsyringe.spec.ts.tpl → hosting.container.spec.ts.tpl}
RENAMED
|
File without changes
|
|
File without changes
|