ddd-ts-kit 0.101.0 → 0.103.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 +320 -0
- package/README.fr.md +11 -12
- package/README.md +10 -11
- package/dist/acceptance/check-locked-files.d.ts.map +1 -1
- package/dist/acceptance/check-locked-files.js +6 -3
- package/dist/acceptance/check-locked-files.js.map +1 -1
- package/dist/build/emitted-place.d.ts +1 -2
- package/dist/build/emitted-place.d.ts.map +1 -1
- package/dist/build/emitted-specifier.d.ts +7 -1
- package/dist/build/emitted-specifier.d.ts.map +1 -1
- package/dist/build/emitted-specifier.js +5 -6
- package/dist/build/emitted-specifier.js.map +1 -1
- package/dist/build/emitted-target.d.ts +6 -5
- package/dist/build/emitted-target.d.ts.map +1 -1
- package/dist/build/emitted-target.js +5 -9
- package/dist/build/emitted-target.js.map +1 -1
- package/dist/build/rewrite-aliases.d.ts.map +1 -1
- package/dist/build/rewrite-aliases.js +7 -5
- package/dist/build/rewrite-aliases.js.map +1 -1
- package/dist/build/rewrite-specifiers.d.ts +7 -6
- package/dist/build/rewrite-specifiers.d.ts.map +1 -1
- package/dist/build/rewrite-specifiers.js +6 -4
- package/dist/build/rewrite-specifiers.js.map +1 -1
- package/dist/build/unresolved-problem.d.ts +2 -1
- package/dist/build/unresolved-problem.d.ts.map +1 -1
- package/dist/build/unresolved-problem.js +2 -2
- package/dist/build/unresolved-problem.js.map +1 -1
- package/dist/check/baseline/write-baseline.d.ts.map +1 -1
- package/dist/check/baseline/write-baseline.js +2 -3
- package/dist/check/baseline/write-baseline.js.map +1 -1
- package/dist/check/business-names/parameter-lists.js +1 -3
- package/dist/check/business-names/parameter-lists.js.map +1 -1
- package/dist/check/engine/run-check.d.ts +3 -0
- package/dist/check/engine/run-check.d.ts.map +1 -1
- package/dist/check/engine/run-check.js +1 -1
- package/dist/check/engine/run-check.js.map +1 -1
- package/dist/check/errors/kit-error-codes.d.ts.map +1 -1
- package/dist/check/errors/kit-error-codes.js +1 -0
- package/dist/check/errors/kit-error-codes.js.map +1 -1
- package/dist/check/explain/authz-docs.js +1 -1
- package/dist/check/explain/authz-docs.js.map +1 -1
- package/dist/check/explain/errors-docs.js +1 -1
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/tenancy-docs.d.ts.map +1 -1
- package/dist/check/explain/tenancy-docs.js +13 -3
- package/dist/check/explain/tenancy-docs.js.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.js +13 -1
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
- package/dist/check/fixtures/conjunct-cases.d.ts +11 -0
- package/dist/check/fixtures/conjunct-cases.d.ts.map +1 -0
- package/dist/check/fixtures/conjunct-cases.js +19 -0
- package/dist/check/fixtures/conjunct-cases.js.map +1 -0
- package/dist/check/fixtures/run-fixture.d.ts +3 -2
- package/dist/check/fixtures/run-fixture.d.ts.map +1 -1
- package/dist/check/fixtures/run-fixture.js +3 -3
- package/dist/check/fixtures/run-fixture.js.map +1 -1
- package/dist/check/fixtures/run-self-check.js +1 -1
- package/dist/check/fixtures/run-self-check.js.map +1 -1
- package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.d.ts +3 -0
- package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.js +33 -0
- package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-fixtures.d.ts +4 -0
- package/dist/check/fixtures/tenancy-conjunct-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-fixtures.js +12 -0
- package/dist/check/fixtures/tenancy-conjunct-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.d.ts +3 -0
- package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.js +49 -0
- package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.d.ts +3 -0
- package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.js +32 -0
- package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.d.ts +3 -0
- package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.js +34 -0
- package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-fixtures.js +2 -0
- package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
- package/dist/check/rules/authz-policy-asked.d.ts.map +1 -1
- package/dist/check/rules/authz-policy-asked.js +45 -6
- package/dist/check/rules/authz-policy-asked.js.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.js +1 -0
- package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
- package/dist/check/rules/schema-no-duplicate-shape.js +1 -3
- package/dist/check/rules/schema-no-duplicate-shape.js.map +1 -1
- package/dist/check/rules/tenancy-scoped-statement.js +2 -2
- package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
- package/dist/check/rules/test-spec-required.d.ts.map +1 -1
- package/dist/check/rules/test-spec-required.js +3 -1
- package/dist/check/rules/test-spec-required.js.map +1 -1
- package/dist/check/scan/named-outside-imports.d.ts +3 -0
- package/dist/check/scan/named-outside-imports.d.ts.map +1 -0
- package/dist/check/scan/named-outside-imports.js +8 -0
- package/dist/check/scan/named-outside-imports.js.map +1 -0
- package/dist/check/scan/star-exports-of.d.ts +3 -0
- package/dist/check/scan/star-exports-of.d.ts.map +1 -0
- package/dist/check/scan/star-exports-of.js +8 -0
- package/dist/check/scan/star-exports-of.js.map +1 -0
- package/dist/check/scan/string-at.d.ts +3 -0
- package/dist/check/scan/string-at.d.ts.map +1 -0
- package/dist/check/scan/string-at.js +5 -0
- package/dist/check/scan/string-at.js.map +1 -0
- package/dist/check/tenancy/arguments-of-call.d.ts +3 -0
- package/dist/check/tenancy/arguments-of-call.d.ts.map +1 -0
- package/dist/check/tenancy/arguments-of-call.js +11 -0
- package/dist/check/tenancy/arguments-of-call.js.map +1 -0
- package/dist/check/tenancy/bare-expression.d.ts +3 -0
- package/dist/check/tenancy/bare-expression.d.ts.map +1 -0
- package/dist/check/tenancy/bare-expression.js +9 -0
- package/dist/check/tenancy/bare-expression.js.map +1 -0
- package/dist/check/tenancy/bracket-depth.d.ts +3 -0
- package/dist/check/tenancy/bracket-depth.d.ts.map +1 -0
- package/dist/check/tenancy/bracket-depth.js +10 -0
- package/dist/check/tenancy/bracket-depth.js.map +1 -0
- package/dist/check/tenancy/chain-links.d.ts +17 -0
- package/dist/check/tenancy/chain-links.d.ts.map +1 -0
- package/dist/check/tenancy/chain-links.js +24 -0
- package/dist/check/tenancy/chain-links.js.map +1 -0
- package/dist/check/tenancy/choice-branches.d.ts +3 -0
- package/dist/check/tenancy/choice-branches.d.ts.map +1 -0
- package/dist/check/tenancy/choice-branches.js +39 -0
- package/dist/check/tenancy/choice-branches.js.map +1 -0
- package/dist/check/tenancy/declaration-before.d.ts +12 -0
- package/dist/check/tenancy/declaration-before.d.ts.map +1 -0
- package/dist/check/tenancy/declaration-before.js +11 -0
- package/dist/check/tenancy/declaration-before.js.map +1 -0
- package/dist/check/tenancy/declaration-of.d.ts +1 -5
- package/dist/check/tenancy/declaration-of.d.ts.map +1 -1
- package/dist/check/tenancy/declaration-of.js +3 -8
- package/dist/check/tenancy/declaration-of.js.map +1 -1
- package/dist/check/tenancy/drizzle-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/drizzle-unscoped.js +16 -3
- package/dist/check/tenancy/drizzle-unscoped.js.map +1 -1
- package/dist/check/tenancy/enclosed-by.d.ts +3 -0
- package/dist/check/tenancy/enclosed-by.d.ts.map +1 -0
- package/dist/check/tenancy/enclosed-by.js +6 -0
- package/dist/check/tenancy/enclosed-by.js.map +1 -0
- package/dist/check/tenancy/end-of-enclosing.d.ts +7 -0
- package/dist/check/tenancy/end-of-enclosing.d.ts.map +1 -0
- package/dist/check/tenancy/end-of-enclosing.js +18 -0
- package/dist/check/tenancy/end-of-enclosing.js.map +1 -0
- package/dist/check/tenancy/holds-condition.d.ts +14 -0
- package/dist/check/tenancy/holds-condition.d.ts.map +1 -0
- package/dist/check/tenancy/holds-condition.js +26 -0
- package/dist/check/tenancy/holds-condition.js.map +1 -0
- package/dist/check/tenancy/is-conjunct.d.ts +8 -0
- package/dist/check/tenancy/is-conjunct.d.ts.map +1 -0
- package/dist/check/tenancy/is-conjunct.js +17 -0
- package/dist/check/tenancy/is-conjunct.js.map +1 -0
- package/dist/check/tenancy/is-or-link.d.ts +4 -0
- package/dist/check/tenancy/is-or-link.d.ts.map +1 -0
- package/dist/check/tenancy/is-or-link.js +7 -0
- package/dist/check/tenancy/is-or-link.js.map +1 -0
- package/dist/check/tenancy/knex-links-outside-condition.d.ts +11 -0
- package/dist/check/tenancy/knex-links-outside-condition.d.ts.map +1 -0
- package/dist/check/tenancy/knex-links-outside-condition.js +108 -0
- package/dist/check/tenancy/knex-links-outside-condition.js.map +1 -0
- package/dist/check/tenancy/knex-unscoped.d.ts +3 -1
- package/dist/check/tenancy/knex-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/knex-unscoped.js +12 -2
- package/dist/check/tenancy/knex-unscoped.js.map +1 -1
- package/dist/check/tenancy/prisma-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/prisma-unscoped.js +15 -10
- package/dist/check/tenancy/prisma-unscoped.js.map +1 -1
- package/dist/check/tenancy/spreads-at-top.d.ts +9 -0
- package/dist/check/tenancy/spreads-at-top.d.ts.map +1 -0
- package/dist/check/tenancy/spreads-at-top.js +49 -0
- package/dist/check/tenancy/spreads-at-top.js.map +1 -0
- package/dist/check/tenancy/top-level-parts.d.ts +3 -0
- package/dist/check/tenancy/top-level-parts.d.ts.map +1 -0
- package/dist/check/tenancy/top-level-parts.js +13 -0
- package/dist/check/tenancy/top-level-parts.js.map +1 -0
- package/dist/check/tenancy/typeorm-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/typeorm-unscoped.js +30 -16
- package/dist/check/tenancy/typeorm-unscoped.js.map +1 -1
- package/dist/check/tenancy/unconfined-where.d.ts +11 -0
- package/dist/check/tenancy/unconfined-where.d.ts.map +1 -0
- package/dist/check/tenancy/unconfined-where.js +18 -0
- package/dist/check/tenancy/unconfined-where.js.map +1 -0
- package/dist/check/text/closing-bracket.d.ts +6 -0
- package/dist/check/text/closing-bracket.d.ts.map +1 -0
- package/dist/check/text/closing-bracket.js +24 -0
- package/dist/check/text/closing-bracket.js.map +1 -0
- package/dist/commands/depcruise-config.d.ts.map +1 -1
- package/dist/commands/depcruise-config.js +4 -0
- package/dist/commands/depcruise-config.js.map +1 -1
- package/dist/commands/drizzle-generate.d.ts +3 -2
- package/dist/commands/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +14 -6
- package/dist/commands/drizzle-generate.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +3 -2
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/knex-generate.d.ts +10 -0
- package/dist/commands/knex-generate.d.ts.map +1 -0
- package/dist/commands/knex-generate.js +74 -0
- package/dist/commands/knex-generate.js.map +1 -0
- package/dist/commands/lint.js +15 -0
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/move-to-module.d.ts.map +1 -1
- package/dist/commands/move-to-module.js +3 -0
- package/dist/commands/move-to-module.js.map +1 -1
- package/dist/commands/mutation.js +1 -1
- package/dist/commands/mutation.js.map +1 -1
- package/dist/commands/parse-migration-arguments.d.ts +11 -0
- package/dist/commands/parse-migration-arguments.d.ts.map +1 -0
- package/dist/commands/parse-migration-arguments.js +17 -0
- package/dist/commands/parse-migration-arguments.js.map +1 -0
- package/dist/commands/prisma-generate.d.ts.map +1 -1
- package/dist/commands/prisma-generate.js +5 -11
- package/dist/commands/prisma-generate.js.map +1 -1
- package/dist/commands/typeorm-generate.d.ts +2 -1
- package/dist/commands/typeorm-generate.d.ts.map +1 -1
- package/dist/commands/typeorm-generate.js +5 -2
- package/dist/commands/typeorm-generate.js.map +1 -1
- package/dist/config/read-config.d.ts.map +1 -1
- package/dist/config/read-config.js +20 -0
- package/dist/config/read-config.js.map +1 -1
- package/dist/declared/render-declarations.js +1 -3
- package/dist/declared/render-declarations.js.map +1 -1
- package/dist/describe/read-controllers.d.ts.map +1 -1
- package/dist/describe/read-controllers.js +18 -2
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/schema-class-of.js +8 -1
- package/dist/describe/schema-class-of.js.map +1 -1
- package/dist/digest/tree-at.d.ts.map +1 -1
- package/dist/digest/tree-at.js +2 -0
- package/dist/digest/tree-at.js.map +1 -1
- package/dist/docs/context-sections.js +3 -7
- package/dist/docs/context-sections.js.map +1 -1
- package/dist/docs/personal-event-lines.d.ts +7 -0
- package/dist/docs/personal-event-lines.d.ts.map +1 -0
- package/dist/docs/personal-event-lines.js +34 -0
- package/dist/docs/personal-event-lines.js.map +1 -0
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +2 -0
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/docs/write-personal-events.d.ts +11 -0
- package/dist/docs/write-personal-events.d.ts.map +1 -0
- package/dist/docs/write-personal-events.js +28 -0
- package/dist/docs/write-personal-events.js.map +1 -0
- package/dist/doctor/permission-findings.d.ts.map +1 -1
- package/dist/doctor/permission-findings.js +68 -4
- package/dist/doctor/permission-findings.js.map +1 -1
- package/dist/generate/concept-role.d.ts +10 -0
- package/dist/generate/concept-role.d.ts.map +1 -1
- package/dist/generate/concept.d.ts.map +1 -1
- package/dist/generate/concept.js +5 -1
- package/dist/generate/concept.js.map +1 -1
- package/dist/generate/emit.d.ts +5 -2
- package/dist/generate/emit.d.ts.map +1 -1
- package/dist/generate/emit.js +5 -4
- package/dist/generate/emit.js.map +1 -1
- package/dist/generate/event-names.d.ts.map +1 -1
- package/dist/generate/event-names.js.map +1 -1
- package/dist/generate/files-without-modules.d.ts +8 -0
- package/dist/generate/files-without-modules.d.ts.map +1 -0
- package/dist/generate/files-without-modules.js +12 -0
- package/dist/generate/files-without-modules.js.map +1 -0
- package/dist/generate/grant-permission.js +2 -2
- package/dist/generate/grant-permission.js.map +1 -1
- package/dist/generate/kinds/aggregate-kind.js +4 -4
- package/dist/generate/kinds/aggregate-kind.js.map +1 -1
- package/dist/generate/kinds/assert-event-store.d.ts +5 -1
- package/dist/generate/kinds/assert-event-store.d.ts.map +1 -1
- package/dist/generate/kinds/assert-event-store.js +11 -5
- package/dist/generate/kinds/assert-event-store.js.map +1 -1
- package/dist/generate/kinds/background/background-job-vars.js +4 -2
- package/dist/generate/kinds/background/background-job-vars.js.map +1 -1
- package/dist/generate/kinds/command-kind.d.ts.map +1 -1
- package/dist/generate/kinds/command-kind.js +6 -1
- package/dist/generate/kinds/command-kind.js.map +1 -1
- package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
- package/dist/generate/kinds/declare-storage.js +4 -10
- package/dist/generate/kinds/declare-storage.js.map +1 -1
- package/dist/generate/kinds/domain-event-kind.d.ts.map +1 -1
- package/dist/generate/kinds/domain-event-kind.js +3 -1
- package/dist/generate/kinds/domain-event-kind.js.map +1 -1
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +8 -1
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/kinds/ensure-domain-event.d.ts.map +1 -1
- package/dist/generate/kinds/ensure-domain-event.js +2 -0
- package/dist/generate/kinds/ensure-domain-event.js.map +1 -1
- package/dist/generate/kinds/extraction/add-compose-service.js +1 -1
- package/dist/generate/kinds/extraction/add-compose-service.js.map +1 -1
- package/dist/generate/kinds/extraction/compose-service-of.d.ts +5 -0
- package/dist/generate/kinds/extraction/compose-service-of.d.ts.map +1 -0
- package/dist/generate/kinds/extraction/compose-service-of.js +8 -0
- package/dist/generate/kinds/extraction/compose-service-of.js.map +1 -0
- package/dist/generate/kinds/gateway-kind.js +9 -0
- package/dist/generate/kinds/gateway-kind.js.map +1 -1
- package/dist/generate/kinds/generate-context.d.ts.map +1 -1
- package/dist/generate/kinds/generate-context.js +36 -0
- package/dist/generate/kinds/generate-context.js.map +1 -1
- package/dist/generate/kinds/generate-event-sourced-repository.js +8 -1
- package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -1
- package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
- package/dist/generate/kinds/generate-repository.js +13 -0
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/query-kind.d.ts.map +1 -1
- package/dist/generate/kinds/query-kind.js +24 -2
- package/dist/generate/kinds/query-kind.js.map +1 -1
- package/dist/generate/kinds/route/controller-vars.js +1 -1
- package/dist/generate/kinds/route/controller-vars.js.map +1 -1
- package/dist/generate/kinds/route/find-use-case.js +1 -1
- package/dist/generate/kinds/route/find-use-case.js.map +1 -1
- package/dist/generate/kinds/route/message-call.d.ts +6 -2
- package/dist/generate/kinds/route/message-call.d.ts.map +1 -1
- package/dist/generate/kinds/route/message-call.js +2 -1
- package/dist/generate/kinds/route/message-call.js.map +1 -1
- package/dist/generate/kinds/route/standard-schema-of.d.ts +2 -1
- package/dist/generate/kinds/route/standard-schema-of.d.ts.map +1 -1
- package/dist/generate/kinds/route/standard-schema-of.js +2 -4
- package/dist/generate/kinds/route/standard-schema-of.js.map +1 -1
- package/dist/generate/kinds/service-kind.d.ts.map +1 -1
- package/dist/generate/kinds/service-kind.js +4 -3
- package/dist/generate/kinds/service-kind.js.map +1 -1
- package/dist/generate/kinds/tables-files.d.ts +3 -0
- package/dist/generate/kinds/tables-files.d.ts.map +1 -0
- package/dist/generate/kinds/tables-files.js +7 -0
- package/dist/generate/kinds/tables-files.js.map +1 -0
- package/dist/generate/kinds/worker-kind.d.ts.map +1 -1
- package/dist/generate/kinds/worker-kind.js +12 -0
- package/dist/generate/kinds/worker-kind.js.map +1 -1
- package/dist/generate/kinds/write-birth.d.ts +8 -0
- package/dist/generate/kinds/write-birth.d.ts.map +1 -0
- package/dist/generate/kinds/write-birth.js +13 -0
- package/dist/generate/kinds/write-birth.js.map +1 -0
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js +8 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/mark-policy-questions.js +2 -2
- package/dist/generate/mark-policy-questions.js.map +1 -1
- package/dist/generate/permission-name.d.ts +3 -0
- package/dist/generate/permission-name.d.ts.map +1 -0
- package/dist/generate/permission-name.js +3 -0
- package/dist/generate/permission-name.js.map +1 -0
- package/dist/generate/permission-named.d.ts.map +1 -1
- package/dist/generate/permission-named.js +1 -1
- package/dist/generate/permission-named.js.map +1 -1
- package/dist/generate/permission-words.d.ts +7 -0
- package/dist/generate/permission-words.d.ts.map +1 -0
- package/dist/generate/permission-words.js +11 -0
- package/dist/generate/permission-words.js.map +1 -0
- package/dist/generate/refined-by-policy.js +2 -2
- package/dist/generate/refined-by-policy.js.map +1 -1
- package/dist/generate/refuse-stuttering-event.d.ts +8 -0
- package/dist/generate/refuse-stuttering-event.d.ts.map +1 -0
- package/dist/generate/refuse-stuttering-event.js +14 -0
- package/dist/generate/refuse-stuttering-event.js.map +1 -0
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +1 -0
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/generate/spoken-in-language.d.ts +11 -2
- package/dist/generate/spoken-in-language.d.ts.map +1 -1
- package/dist/generate/spoken-in-language.js +27 -12
- package/dist/generate/spoken-in-language.js.map +1 -1
- package/dist/generator-lock/unreadable-lock-refusal.d.ts +4 -0
- package/dist/generator-lock/unreadable-lock-refusal.d.ts.map +1 -0
- package/dist/generator-lock/unreadable-lock-refusal.js +7 -0
- package/dist/generator-lock/unreadable-lock-refusal.js.map +1 -0
- package/dist/generator-lock/with-generator-lock.d.ts.map +1 -1
- package/dist/generator-lock/with-generator-lock.js +8 -7
- package/dist/generator-lock/with-generator-lock.js.map +1 -1
- package/dist/help/flag-notes.d.ts.map +1 -1
- package/dist/help/flag-notes.js +5 -1
- package/dist/help/flag-notes.js.map +1 -1
- package/dist/help/tool-notes.d.ts.map +1 -1
- package/dist/help/tool-notes.js +16 -0
- package/dist/help/tool-notes.js.map +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +1 -0
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.d.ts.map +1 -1
- package/dist/init/agent-permissions.js +18 -3
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/files/audit-files.d.ts.map +1 -1
- package/dist/init/files/audit-files.js +1 -0
- package/dist/init/files/audit-files.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +2 -1
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/platform-files.d.ts.map +1 -1
- package/dist/init/files/platform-files.js +14 -0
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/files/privacy-files.d.ts +2 -2
- package/dist/init/files/privacy-files.d.ts.map +1 -1
- package/dist/init/files/privacy-files.js +3 -2
- package/dist/init/files/privacy-files.js.map +1 -1
- package/dist/init/files/script-files.d.ts +4 -1
- package/dist/init/files/script-files.d.ts.map +1 -1
- package/dist/init/files/script-files.js +6 -1
- package/dist/init/files/script-files.js.map +1 -1
- package/dist/init/is-team-file.d.ts +2 -2
- package/dist/init/is-team-file.d.ts.map +1 -1
- package/dist/init/is-team-file.js +5 -3
- package/dist/init/is-team-file.js.map +1 -1
- package/dist/init/keep-regions.d.ts +21 -0
- package/dist/init/keep-regions.d.ts.map +1 -0
- package/dist/init/keep-regions.js +63 -0
- package/dist/init/keep-regions.js.map +1 -0
- package/dist/init/kept-combination-notes.d.ts.map +1 -1
- package/dist/init/kept-combination-notes.js +6 -2
- package/dist/init/kept-combination-notes.js.map +1 -1
- package/dist/init/kept-compose-services.d.ts +6 -0
- package/dist/init/kept-compose-services.d.ts.map +1 -0
- package/dist/init/kept-compose-services.js +42 -0
- package/dist/init/kept-compose-services.js.map +1 -0
- package/dist/init/kept-role-vocabulary.d.ts +3 -0
- package/dist/init/kept-role-vocabulary.d.ts.map +1 -0
- package/dist/init/kept-role-vocabulary.js +7 -0
- package/dist/init/kept-role-vocabulary.js.map +1 -0
- package/dist/init/kept-roles.d.ts +12 -0
- package/dist/init/kept-roles.d.ts.map +1 -0
- package/dist/init/kept-roles.js +29 -0
- package/dist/init/kept-roles.js.map +1 -0
- package/dist/init/kept-wiring.d.ts +22 -0
- package/dist/init/kept-wiring.d.ts.map +1 -0
- package/dist/init/kept-wiring.js +91 -0
- package/dist/init/kept-wiring.js.map +1 -0
- package/dist/init/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +5 -1
- 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 +5 -3
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/scripts-for.d.ts.map +1 -1
- package/dist/init/manifest/scripts-for.js +8 -0
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/orphaned-wiring-notes.d.ts +13 -0
- package/dist/init/orphaned-wiring-notes.d.ts.map +1 -0
- package/dist/init/orphaned-wiring-notes.js +42 -0
- package/dist/init/orphaned-wiring-notes.js.map +1 -0
- package/dist/init/profile-hooks.js +1 -1
- package/dist/init/profile-hooks.js.map +1 -1
- package/dist/init/repositories-left-behind.d.ts +12 -0
- package/dist/init/repositories-left-behind.d.ts.map +1 -0
- package/dist/init/repositories-left-behind.js +26 -0
- package/dist/init/repositories-left-behind.js.map +1 -0
- package/dist/init/rewire-audited-events.d.ts +10 -0
- package/dist/init/rewire-audited-events.d.ts.map +1 -0
- package/dist/init/rewire-audited-events.js +32 -0
- package/dist/init/rewire-audited-events.js.map +1 -0
- package/dist/init/rewire-contexts.d.ts +15 -0
- package/dist/init/rewire-contexts.d.ts.map +1 -0
- package/dist/init/rewire-contexts.js +41 -0
- package/dist/init/rewire-contexts.js.map +1 -0
- package/dist/init/rewire-preset.d.ts +9 -0
- package/dist/init/rewire-preset.d.ts.map +1 -0
- package/dist/init/rewire-preset.js +29 -0
- package/dist/init/rewire-preset.js.map +1 -0
- package/dist/init/rewire-tables.d.ts +10 -0
- package/dist/init/rewire-tables.d.ts.map +1 -0
- package/dist/init/rewire-tables.js +54 -0
- package/dist/init/rewire-tables.js.map +1 -0
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +28 -28
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/kept-flag-notes.d.ts +7 -0
- package/dist/init/stack/kept-flag-notes.d.ts.map +1 -0
- package/dist/init/stack/kept-flag-notes.js +24 -0
- package/dist/init/stack/kept-flag-notes.js.map +1 -0
- package/dist/init/stack/refuse-unused-no-outbox.d.ts +4 -0
- package/dist/init/stack/refuse-unused-no-outbox.d.ts.map +1 -0
- package/dist/init/stack/refuse-unused-no-outbox.js +9 -0
- package/dist/init/stack/refuse-unused-no-outbox.js.map +1 -0
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +10 -0
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack-before.d.ts +4 -0
- package/dist/init/stack-before.d.ts.map +1 -0
- package/dist/init/stack-before.js +11 -0
- package/dist/init/stack-before.js.map +1 -0
- package/dist/init/wiring-notes.d.ts +9 -0
- package/dist/init/wiring-notes.d.ts.map +1 -0
- package/dist/init/wiring-notes.js +22 -0
- package/dist/init/wiring-notes.js.map +1 -0
- package/dist/init/with-named-imports.d.ts +8 -0
- package/dist/init/with-named-imports.d.ts.map +1 -0
- package/dist/init/with-named-imports.js +69 -0
- package/dist/init/with-named-imports.js.map +1 -0
- package/dist/init/with-system-grants.d.ts +7 -0
- package/dist/init/with-system-grants.d.ts.map +1 -0
- package/dist/init/with-system-grants.js +26 -0
- package/dist/init/with-system-grants.js.map +1 -0
- package/dist/init/write-local-environment.d.ts +8 -0
- package/dist/init/write-local-environment.d.ts.map +1 -0
- package/dist/init/write-local-environment.js +18 -0
- package/dist/init/write-local-environment.js.map +1 -0
- 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 +11 -2
- package/dist/lint/eslint-in-project.js.map +1 -1
- package/dist/markers/index.d.ts +3 -0
- package/dist/markers/index.d.ts.map +1 -1
- package/dist/markers/index.js +3 -0
- package/dist/markers/index.js.map +1 -1
- package/dist/markers/region-marker.d.ts +3 -0
- package/dist/markers/region-marker.d.ts.map +1 -0
- package/dist/markers/region-marker.js +3 -0
- package/dist/markers/region-marker.js.map +1 -0
- package/dist/markers/regions-of.d.ts +9 -0
- package/dist/markers/regions-of.d.ts.map +1 -0
- package/dist/markers/regions-of.js +20 -0
- package/dist/markers/regions-of.js.map +1 -0
- package/dist/markers/unpaired-markers.d.ts +3 -0
- package/dist/markers/unpaired-markers.d.ts.map +1 -0
- package/dist/markers/unpaired-markers.js +13 -0
- package/dist/markers/unpaired-markers.js.map +1 -0
- package/dist/measures/timeline-of.js +1 -0
- package/dist/measures/timeline-of.js.map +1 -1
- package/dist/merge/apply-resolutions.d.ts.map +1 -1
- package/dist/merge/apply-resolutions.js +6 -4
- package/dist/merge/apply-resolutions.js.map +1 -1
- package/dist/merge/continue-merge.d.ts.map +1 -1
- package/dist/merge/continue-merge.js +1 -0
- package/dist/merge/continue-merge.js.map +1 -1
- package/dist/merge/ensure-mergeable.js +1 -1
- package/dist/merge/ensure-mergeable.js.map +1 -1
- package/dist/merge/lost/verify-merges.d.ts.map +1 -1
- package/dist/merge/lost/verify-merges.js +4 -0
- package/dist/merge/lost/verify-merges.js.map +1 -1
- package/dist/merge/merge-state.d.ts.map +1 -1
- package/dist/merge/merge-state.js +2 -2
- package/dist/merge/merge-state.js.map +1 -1
- package/dist/merge/merge-trunk.d.ts.map +1 -1
- package/dist/merge/merge-trunk.js +4 -0
- package/dist/merge/merge-trunk.js.map +1 -1
- package/dist/merge/refuse-shallow-history.d.ts +10 -0
- package/dist/merge/refuse-shallow-history.d.ts.map +1 -0
- package/dist/merge/refuse-shallow-history.js +15 -0
- package/dist/merge/refuse-shallow-history.js.map +1 -0
- package/dist/merge/resume-merge.js +2 -2
- package/dist/merge/resume-merge.js.map +1 -1
- package/dist/merge/settle-regions.d.ts.map +1 -1
- package/dist/merge/settle-regions.js +3 -4
- package/dist/merge/settle-regions.js.map +1 -1
- package/dist/migration/audit-guard/append-audit-guard.d.ts +4 -2
- package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -1
- package/dist/migration/audit-guard/append-audit-guard.js +18 -3
- package/dist/migration/audit-guard/append-audit-guard.js.map +1 -1
- package/dist/migration/declared-tables.d.ts +8 -0
- package/dist/migration/declared-tables.d.ts.map +1 -0
- package/dist/migration/declared-tables.js +13 -0
- package/dist/migration/declared-tables.js.map +1 -0
- package/dist/migration/find-project-formatter.d.ts.map +1 -1
- package/dist/migration/find-project-formatter.js +2 -1
- package/dist/migration/find-project-formatter.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/migration/knex-migration-text.d.ts +4 -0
- package/dist/migration/knex-migration-text.d.ts.map +1 -0
- package/dist/migration/knex-migration-text.js +24 -0
- package/dist/migration/knex-migration-text.js.map +1 -0
- package/dist/migration/knex-schema-difference.d.ts +12 -0
- package/dist/migration/knex-schema-difference.d.ts.map +1 -0
- package/dist/migration/knex-schema-difference.js +165 -0
- package/dist/migration/knex-schema-difference.js.map +1 -0
- package/dist/migration/listed-in-index.d.ts +6 -0
- package/dist/migration/listed-in-index.d.ts.map +1 -0
- package/dist/migration/listed-in-index.js +8 -0
- package/dist/migration/listed-in-index.js.map +1 -0
- package/dist/migration/refuse-other-orm.d.ts +8 -0
- package/dist/migration/refuse-other-orm.d.ts.map +1 -0
- package/dist/migration/refuse-other-orm.js +34 -0
- package/dist/migration/refuse-other-orm.js.map +1 -0
- package/dist/migration/required-migration-name.d.ts +3 -0
- package/dist/migration/required-migration-name.d.ts.map +1 -0
- package/dist/migration/required-migration-name.js +11 -0
- package/dist/migration/required-migration-name.js.map +1 -0
- package/dist/migration/warn-dropped-context-tables.d.ts +12 -0
- package/dist/migration/warn-dropped-context-tables.d.ts.map +1 -0
- package/dist/migration/warn-dropped-context-tables.js +88 -0
- package/dist/migration/warn-dropped-context-tables.js.map +1 -0
- package/dist/package-manager/dialects.js +1 -1
- package/dist/package-manager/dialects.js.map +1 -1
- package/dist/package-manager/in-project-dialect.d.ts +8 -0
- package/dist/package-manager/in-project-dialect.d.ts.map +1 -0
- package/dist/package-manager/in-project-dialect.js +22 -0
- package/dist/package-manager/in-project-dialect.js.map +1 -0
- package/dist/presets/adapter-of.d.ts +5 -0
- package/dist/presets/adapter-of.d.ts.map +1 -0
- package/dist/presets/adapter-of.js +6 -0
- package/dist/presets/adapter-of.js.map +1 -0
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +1 -5
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/grant-to-signed-in.d.ts.map +1 -1
- package/dist/presets/grant-to-signed-in.js +1 -24
- package/dist/presets/grant-to-signed-in.js.map +1 -1
- package/dist/presets/identity-terms.d.ts.map +1 -1
- package/dist/presets/identity-terms.js +4 -0
- package/dist/presets/identity-terms.js.map +1 -1
- package/dist/presets/lay-out-prisma-models.js +1 -19
- package/dist/presets/lay-out-prisma-models.js.map +1 -1
- package/dist/presets/organisations-as-tenants.d.ts +2 -2
- package/dist/presets/organisations-as-tenants.d.ts.map +1 -1
- package/dist/presets/organisations-as-tenants.js +46 -2
- package/dist/presets/organisations-as-tenants.js.map +1 -1
- package/dist/presets/preset-named.d.ts +2 -0
- package/dist/presets/preset-named.d.ts.map +1 -1
- package/dist/presets/preset-named.js +1 -1
- package/dist/presets/preset-named.js.map +1 -1
- package/dist/presets/wrap-authorizer.d.ts +4 -0
- package/dist/presets/wrap-authorizer.d.ts.map +1 -0
- package/dist/presets/wrap-authorizer.js +25 -0
- package/dist/presets/wrap-authorizer.js.map +1 -0
- package/dist/prisma-schema/datasource-schemas.d.ts +3 -0
- package/dist/prisma-schema/datasource-schemas.d.ts.map +1 -0
- package/dist/prisma-schema/datasource-schemas.js +5 -0
- package/dist/prisma-schema/datasource-schemas.js.map +1 -0
- package/dist/prisma-schema/index.d.ts +4 -0
- package/dist/prisma-schema/index.d.ts.map +1 -1
- package/dist/prisma-schema/index.js +4 -0
- package/dist/prisma-schema/index.js.map +1 -1
- package/dist/prisma-schema/preview-features-of.d.ts +3 -0
- package/dist/prisma-schema/preview-features-of.d.ts.map +1 -0
- package/dist/prisma-schema/preview-features-of.js +7 -0
- package/dist/prisma-schema/preview-features-of.js.map +1 -0
- package/dist/prisma-schema/with-datasource-schema.d.ts +3 -0
- package/dist/prisma-schema/with-datasource-schema.d.ts.map +1 -0
- package/dist/prisma-schema/with-datasource-schema.js +9 -0
- package/dist/prisma-schema/with-datasource-schema.js.map +1 -0
- package/dist/prisma-schema/with-preview-feature.d.ts +3 -0
- package/dist/prisma-schema/with-preview-feature.d.ts.map +1 -0
- package/dist/prisma-schema/with-preview-feature.js +19 -0
- package/dist/prisma-schema/with-preview-feature.js.map +1 -0
- package/dist/progress/format-progress.js +1 -0
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +10 -1
- package/dist/run.js.map +1 -1
- package/dist/sdk/planned-clients.d.ts +2 -2
- package/dist/sdk/planned-clients.d.ts.map +1 -1
- package/dist/sdk/planned-clients.js +2 -6
- package/dist/sdk/planned-clients.js.map +1 -1
- package/dist/sdk/render-client.js +1 -1
- package/dist/sdk/render-client.js.map +1 -1
- package/dist/sdk/set-up-sdk.d.ts.map +1 -1
- package/dist/sdk/set-up-sdk.js +3 -2
- package/dist/sdk/set-up-sdk.js.map +1 -1
- package/dist/slice/record-verification.d.ts.map +1 -1
- package/dist/slice/record-verification.js +2 -5
- package/dist/slice/record-verification.js.map +1 -1
- package/dist/stack/stack-vars.js +16 -3
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/stories/forecast-merge.js +1 -0
- package/dist/stories/forecast-merge.js.map +1 -1
- package/dist/stories/open-story-scope.d.ts.map +1 -1
- package/dist/stories/open-story-scope.js +2 -4
- package/dist/stories/open-story-scope.js.map +1 -1
- package/dist/story/change-gated.d.ts +3 -3
- package/dist/story/change-gated.d.ts.map +1 -1
- package/dist/story/change-gated.js +13 -7
- package/dist/story/change-gated.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/format-resume.d.ts.map +1 -1
- package/dist/worker/format-resume.js +5 -0
- package/dist/worker/format-resume.js.map +1 -1
- package/dist/worker/format-workers.js +5 -0
- package/dist/worker/format-workers.js.map +1 -1
- package/dist/worker/open-worker-scope.d.ts.map +1 -1
- package/dist/worker/open-worker-scope.js +2 -3
- package/dist/worker/open-worker-scope.js.map +1 -1
- package/dist/worker/progress-of.d.ts +8 -3
- package/dist/worker/progress-of.d.ts.map +1 -1
- package/dist/worker/progress-of.js +2 -16
- package/dist/worker/progress-of.js.map +1 -1
- package/dist/worker/read-agent-record.d.ts.map +1 -1
- package/dist/worker/read-agent-record.js +15 -3
- package/dist/worker/read-agent-record.js.map +1 -1
- package/dist/worker/read-workers.js +2 -2
- package/dist/worker/read-workers.js.map +1 -1
- package/dist/worker/readable-progress.d.ts +5 -0
- package/dist/worker/readable-progress.d.ts.map +1 -0
- package/dist/worker/readable-progress.js +16 -0
- package/dist/worker/readable-progress.js.map +1 -0
- package/dist/worker/resume-worker.d.ts.map +1 -1
- package/dist/worker/resume-worker.js +4 -5
- package/dist/worker/resume-worker.js.map +1 -1
- package/dist/worker/worker-progress.d.ts +2 -1
- package/dist/worker/worker-progress.d.ts.map +1 -1
- package/dist/workspace/real-path-of.d.ts +2 -2
- package/dist/workspace/real-path-of.d.ts.map +1 -1
- package/dist/workspace/real-path-of.js +15 -10
- package/dist/workspace/real-path-of.js.map +1 -1
- package/dist/workspace/write-inside-project.d.ts +8 -0
- package/dist/workspace/write-inside-project.d.ts.map +1 -0
- package/dist/workspace/write-inside-project.js +17 -0
- package/dist/workspace/write-inside-project.js.map +1 -0
- package/package.json +5 -5
- package/templates/aggregate/event-sourced.events.mapper.ts.tpl +5 -1
- package/templates/command/handler.declared.ts.tpl +4 -12
- package/templates/command/handler.ts.tpl +4 -12
- package/templates/docs/privacy-register.md.tpl +2 -0
- package/templates/e2e/e2e.spec.ts.tpl +2 -2
- package/templates/init/README.md.tpl +42 -9
- package/templates/init/docker/docker-compose.yml.tpl +5 -2
- package/templates/init/docker/dockerignore.tpl +1 -0
- package/templates/init/docker/env.example.tpl +16 -1
- package/templates/init/gitignore.tpl +1 -0
- package/templates/init/hooks/change-reference.mjs +96 -17
- package/templates/init/hooks/production-gate.mjs +65 -11
- package/templates/init/jest.config.js.tpl +4 -1
- package/templates/init/main.ts.tpl +3 -0
- package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +25 -8
- package/templates/init/platform/audit/create-audit-trail.ts.tpl +59 -0
- package/templates/init/platform/audit/create-audit.ts.tpl +13 -52
- package/templates/init/platform/auth/authentication/development-header-authenticator.ts.tpl +7 -3
- package/templates/init/platform/auth/relationships/relationship-schema.ts.tpl +5 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +58 -7
- package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +9 -4
- 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-options.manual.ts.tpl +7 -0
- package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
- package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +7 -0
- package/templates/init/platform/config/app-config.ts.tpl +16 -0
- package/templates/init/platform/config/load-config.ts.tpl +46 -0
- package/templates/init/platform/database/data-source.typeorm.ts.tpl +6 -0
- package/templates/init/platform/database/gitkeep +0 -0
- package/templates/init/platform/database/knexfile.js.tpl +10 -3
- package/templates/init/platform/database/open-persistence.prisma.ts.tpl +5 -2
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +11 -3
- package/templates/init/platform/database/persistence.contract.spec.ts.tpl +14 -3
- package/templates/init/platform/database/prisma.config.ts.tpl +6 -0
- package/templates/init/platform/database/schema.knex.ts.tpl +4 -3
- package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +5 -1
- package/templates/init/platform/http/start-http-server.express.ts.tpl +9 -6
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +5 -2
- package/templates/init/platform/http/start-http-server.hono.ts.tpl +5 -2
- package/templates/init/platform/jobs/create-background-work.ts.tpl +12 -0
- package/templates/init/platform/jobs/days-before.ts.tpl +8 -0
- package/templates/init/platform/jobs/housekeeping.module.tsyringe.ts.tpl +46 -0
- package/templates/init/platform/jobs/housekeeping.ts.tpl +24 -0
- package/templates/init/platform/jobs/job-settings.ts.tpl +9 -0
- package/templates/init/platform/privacy/personal-events.ts.tpl +11 -0
- package/templates/init/platform/privacy/run-erasure.manual.ts.tpl +69 -19
- package/templates/init/platform/privacy/run-erasure.tsyringe.ts.tpl +69 -8
- package/templates/init/platform/privacy/run-export.manual.ts.tpl +26 -4
- package/templates/init/platform/privacy/run-export.tsyringe.ts.tpl +34 -3
- package/templates/init/platform/privacy/run-purge.manual.ts.tpl +3 -2
- package/templates/init/platform/privacy/run-purge.tsyringe.ts.tpl +4 -2
- package/templates/init/rules/infrastructure.md.tpl +1 -1
- package/templates/init/scripts/audit-verify.ts.tpl +35 -0
- package/templates/init/scripts/privacy-erase.manual.ts.tpl +52 -7
- package/templates/init/scripts/privacy-erase.tsyringe.ts.tpl +52 -7
- package/templates/init/scripts/privacy-export.manual.ts.tpl +5 -7
- package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +5 -7
- package/templates/init/scripts/privacy-purge.manual.ts.tpl +4 -0
- package/templates/init/scripts/privacy-purge.tsyringe.ts.tpl +4 -0
- package/templates/pipeline/github/dependabot.yml +6 -0
- package/templates/pipeline/github/workflows/ci.yml.tpl +26 -1
- package/templates/pipeline/github/workflows/claude-review.yml +3 -2
- package/templates/pipeline/github/workflows/claude-triage.yml +1 -1
- package/templates/pipeline/github/workflows/codeql.yml +2 -0
- package/templates/pipeline/github/workflows/copilot-setup-steps.yml +2 -0
- package/templates/pipeline/github/workflows/intent-to-spec.yml +12 -4
- package/templates/pipeline/github/workflows/pr-title.yml +2 -0
- package/templates/pipeline/gitlab/claude-review.gitlab-ci.yml.tpl +1 -1
- package/templates/pipeline/knip.json.tpl +1 -4
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/pipeline/renovate.json +11 -0
- package/templates/pipeline/stryker.config.mjs.tpl +4 -0
- package/templates/pipeline/vitest.config.ts.tpl +3 -2
- package/templates/presets/identity/context/__context__.codes.named.ts.tpl +1 -0
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +28 -1
- package/templates/presets/identity/context/domain/aggregates/invitation.aggregate.ts.tpl +13 -1
- package/templates/presets/identity/context/domain/aggregates/member.aggregate.ts.tpl +6 -1
- package/templates/presets/identity/context/domain/errors/invitation-withdrawn.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/invitation.error.factories.ts.tpl +8 -0
- package/templates/presets/identity/context/domain/services/role-rights.service.ts.tpl +23 -1
- package/templates/presets/identity/context/infrastructure/persistence/__context__.schema.drizzle.ts.tpl +1 -0
- package/templates/presets/identity/context/infrastructure/persistence/create-__context__-tables.schema.knex.ts.tpl +1 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/invitation-row.schema.knex.ts.tpl +1 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.drizzle.ts.tpl +2 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.knex.ts.tpl +2 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +2 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.kit-routes.ts.tpl +1 -0
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +1 -0
- package/templates/presets/identity/context/test/builders/invitation.builder.ts.tpl +15 -2
- package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +10 -0
- package/templates/presets/identity/context/test/unit/accept-invitation.handler.spec.ts.tpl +114 -4
- package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +1 -1
- package/templates/presets/identity/design.md.tpl +3 -1
- package/templates/presets/identity/prisma/models.prisma.tpl +1 -0
- package/templates/query/reader.fake.ts.tpl +4 -6
- package/templates/query/reader.in-memory.ts.tpl +1 -1
- package/templates/repository/drizzle/repository.ts.tpl +4 -3
- package/templates/repository/knex/table.tpl +1 -1
- package/templates/repository/prisma/repository.ts.tpl +24 -18
- package/templates/state-machine/state-machine.spec.ts.tpl +5 -0
- package/templates/worker/main.ts.tpl +3 -0
- package/templates/init/platform/database/migration.knex.js.tpl +0 -8
|
@@ -18,8 +18,13 @@ import { CommandBus, QueryBus } from '@ddd-ts-kit/kernel';
|
|
|
18
18
|
import { classSchema } from '@ddd-ts-kit/validation/class-validator';
|
|
19
19
|
{{/if}}
|
|
20
20
|
{{#if audit.archive}}
|
|
21
|
-
import { ArchiveAuditEntries } from '@ddd-ts-kit/audit';
|
|
21
|
+
import { ArchiveAuditEntries, VerifyAuditTrail } from '@ddd-ts-kit/audit';
|
|
22
22
|
{{/if}}
|
|
23
|
+
{{#unless audit.archive}}
|
|
24
|
+
{{#if audit.sql}}
|
|
25
|
+
import { VerifyAuditTrail } from '@ddd-ts-kit/audit';
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{/unless}}
|
|
23
28
|
{{#if files.any}}
|
|
24
29
|
import { PurgeStagedFiles } from '@ddd-ts-kit/kernel';
|
|
25
30
|
{{/if}}
|
|
@@ -60,6 +65,10 @@ import { fileRoutes } from '{{alias.platform}}/files/file-routes{{alias.ext}}';
|
|
|
60
65
|
{{/if}}
|
|
61
66
|
import type { Platform } from '{{alias.platform}}/composition/platform{{alias.ext}}';
|
|
62
67
|
import type { PlatformOptions } from '{{alias.platform}}/composition/platform-options{{alias.ext}}';
|
|
68
|
+
{{#if housekeeping.any}}
|
|
69
|
+
import { daysBefore } from '{{alias.platform}}/jobs/days-before{{alias.ext}}';
|
|
70
|
+
import { DEFAULT_HOUSEKEEPING } from '{{alias.platform}}/jobs/housekeeping{{alias.ext}}';
|
|
71
|
+
{{/if}}
|
|
63
72
|
{{#if privacy.on}}
|
|
64
73
|
import { runPurge } from '{{alias.platform}}/privacy/run-purge{{alias.ext}}';
|
|
65
74
|
{{/if}}
|
|
@@ -318,12 +327,18 @@ function registerPlatformJobs(platform: Platform, options: ApplicationOptions):
|
|
|
318
327
|
{{#if files.any}}
|
|
319
328
|
purgeStagedFiles(platform);
|
|
320
329
|
{{/if}}
|
|
321
|
-
{{#if audit.
|
|
322
|
-
|
|
330
|
+
{{#if audit.sql}}
|
|
331
|
+
auditJobs(platform);
|
|
323
332
|
{{/if}}
|
|
324
333
|
{{#if privacy.on}}
|
|
325
334
|
purgeExpiredEveryNight(platform);
|
|
326
335
|
{{/if}}
|
|
336
|
+
{{#if events.outbox}}
|
|
337
|
+
purgePublishedEvents(platform, options);
|
|
338
|
+
{{/if}}
|
|
339
|
+
{{#if queue.stored}}
|
|
340
|
+
purgeFinishedJobs(platform, options);
|
|
341
|
+
{{/if}}
|
|
327
342
|
}
|
|
328
343
|
{{/if}}
|
|
329
344
|
{{#if files.any}}
|
|
@@ -335,16 +350,26 @@ function purgeStagedFiles(platform: Platform): void {
|
|
|
335
350
|
platform.jobs.register({ name: 'files.purge-staged', schedule: { every: '1h' }, run: () => purge.run() });
|
|
336
351
|
}
|
|
337
352
|
{{/if}}
|
|
338
|
-
{{#if audit.
|
|
353
|
+
{{#if audit.sql}}
|
|
339
354
|
|
|
340
355
|
/**
|
|
341
|
-
*
|
|
342
|
-
* storage on the first day of every month at 04:00 UTC,
|
|
356
|
+
* Every chain of the audit trail verified every night at 04:30 UTC, from its last archive{{#if audit.archive}}, proved against its file,{{/if}} to its head{{#if audit.archive}}; and the entries
|
|
357
|
+
* older than the twelve whole months it keeps online moved to the storage on the first day of every month at 04:00 UTC,
|
|
358
|
+
* verified and anchored{{/if}}.
|
|
343
359
|
*/
|
|
344
|
-
function
|
|
360
|
+
function auditJobs(platform: Platform): void {
|
|
361
|
+
{{#if audit.archive}}
|
|
362
|
+
const verify = new VerifyAuditTrail(platform.audit.trail, platform.files.storage);
|
|
345
363
|
const archive = new ArchiveAuditEntries(platform.audit.trail, platform.files.storage, platform.clock);
|
|
364
|
+
{{/if}}
|
|
365
|
+
{{#unless audit.archive}}
|
|
366
|
+
const verify = new VerifyAuditTrail(platform.audit.trail);
|
|
367
|
+
{{/unless}}
|
|
346
368
|
|
|
369
|
+
platform.jobs.register({ name: 'audit.verify', schedule: { cron: '30 4 * * *' }, run: () => verify.run() });
|
|
370
|
+
{{#if audit.archive}}
|
|
347
371
|
platform.jobs.register({ name: 'audit.archive', schedule: { cron: '0 4 1 * *' }, run: () => archive.run() });
|
|
372
|
+
{{/if}}
|
|
348
373
|
}
|
|
349
374
|
{{/if}}
|
|
350
375
|
{{#if privacy.on}}
|
|
@@ -360,6 +385,32 @@ function purgeExpiredEveryNight(platform: Platform): void {
|
|
|
360
385
|
});
|
|
361
386
|
}
|
|
362
387
|
{{/if}}
|
|
388
|
+
{{#if events.outbox}}
|
|
389
|
+
|
|
390
|
+
/** The records of what was published, their payload with them, dropped every night at 03:30 UTC past the days they are kept. */
|
|
391
|
+
function purgePublishedEvents(platform: Platform, { housekeeping = DEFAULT_HOUSEKEEPING }: ApplicationOptions): void {
|
|
392
|
+
platform.jobs.register({
|
|
393
|
+
name: 'events.purge-published',
|
|
394
|
+
schedule: { cron: '30 3 * * *' },
|
|
395
|
+
run: async () => {
|
|
396
|
+
await platform.persistence.outbox.purgePublished(daysBefore(platform.clock, housekeeping.publishedEventsDays));
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
{{/if}}
|
|
401
|
+
{{#if queue.stored}}
|
|
402
|
+
|
|
403
|
+
/** The jobs that succeeded or were cancelled, their payload with them, dropped every night at 03:45 UTC past the days they are kept. */
|
|
404
|
+
function purgeFinishedJobs(platform: Platform, { housekeeping = DEFAULT_HOUSEKEEPING }: ApplicationOptions): void {
|
|
405
|
+
platform.jobs.register({
|
|
406
|
+
name: 'jobs.purge-finished',
|
|
407
|
+
schedule: { cron: '45 3 * * *' },
|
|
408
|
+
run: async () => {
|
|
409
|
+
await platform.jobStore.purgeFinished(daysBefore(platform.clock, housekeeping.finishedJobsDays));
|
|
410
|
+
},
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
{{/if}}
|
|
363
414
|
{{#if routes.nest}}
|
|
364
415
|
|
|
365
416
|
/** The Nest controllers of the contexts: their routes now, their instances built by Nest when the server starts, with the buses of the platform. */
|
|
@@ -90,6 +90,10 @@ import { fileRoutes } from '{{alias.platform}}/files/file-routes{{alias.ext}}';
|
|
|
90
90
|
{{#if files.any}}
|
|
91
91
|
import { filesModule } from '{{alias.platform}}/files/files.module{{alias.ext}}';
|
|
92
92
|
{{/if}}
|
|
93
|
+
{{#if housekeeping.any}}
|
|
94
|
+
import { DEFAULT_HOUSEKEEPING } from '{{alias.platform}}/jobs/housekeeping{{alias.ext}}';
|
|
95
|
+
import { housekeepingModule } from '{{alias.platform}}/jobs/housekeeping.module{{alias.ext}}';
|
|
96
|
+
{{/if}}
|
|
93
97
|
{{#if privacy.on}}
|
|
94
98
|
import { privacyModule } from '{{alias.platform}}/privacy/privacy.module{{alias.ext}}';
|
|
95
99
|
{{/if}}
|
|
@@ -213,19 +217,20 @@ export function composeApplication(
|
|
|
213
217
|
eventSourcingModule(foundations.eventSourcing),
|
|
214
218
|
{{/if}}
|
|
215
219
|
guard,
|
|
216
|
-
{{#if audit.
|
|
217
|
-
{{#if audit.archive}}
|
|
220
|
+
{{#if audit.sql}}
|
|
218
221
|
auditModule(foundations.audit, { jobs: options.platformJobs !== false }),
|
|
219
222
|
{{/if}}
|
|
220
|
-
{{#
|
|
223
|
+
{{#if audit.memory}}
|
|
221
224
|
auditModule(foundations.audit),
|
|
222
|
-
{{/unless}}
|
|
223
225
|
{{/if}}
|
|
224
226
|
{{#if files.any}}
|
|
225
227
|
filesModule(options.files ?? new InMemoryFileStorage(), { jobs: options.platformJobs !== false }),
|
|
226
228
|
{{/if}}
|
|
227
229
|
{{#if privacy.on}}
|
|
228
230
|
privacyModule({ jobs: options.platformJobs !== false }),
|
|
231
|
+
{{/if}}
|
|
232
|
+
{{#if housekeeping.any}}
|
|
233
|
+
housekeepingModule(options.housekeeping ?? DEFAULT_HOUSEKEEPING, { jobs: options.platformJobs !== false }),
|
|
229
234
|
{{/if}}
|
|
230
235
|
...contexts.modules,
|
|
231
236
|
],
|
|
@@ -79,7 +79,7 @@ export function layFoundations(persistence: Persistence, options: PlatformOption
|
|
|
79
79
|
const lock = new InMemoryLock(clock);
|
|
80
80
|
{{/unless}}
|
|
81
81
|
{{#if audit.on}}
|
|
82
|
-
const audit = createAudit(persistence, { scope, clock, ids });
|
|
82
|
+
const audit = createAudit(persistence, { scope, clock, ids }, logger);
|
|
83
83
|
{{/if}}
|
|
84
84
|
|
|
85
85
|
{{#if tenancy.any}}
|
|
@@ -64,7 +64,7 @@ export function layFoundations(persistence: Persistence, options: Observed): Fou
|
|
|
64
64
|
const ids = new UuidGenerator();
|
|
65
65
|
const logger = createLogger(scope, options.log);
|
|
66
66
|
{{#if audit.on}}
|
|
67
|
-
const audit = createAudit(persistence, { scope, clock, ids });
|
|
67
|
+
const audit = createAudit(persistence, { scope, clock, ids }, logger);
|
|
68
68
|
{{/if}}
|
|
69
69
|
|
|
70
70
|
return {
|
|
@@ -17,6 +17,9 @@ import type { JobSettings } from '@ddd-ts-kit/kernel';
|
|
|
17
17
|
import type { QueueWorkerOptions } from '@ddd-ts-kit/scheduling';
|
|
18
18
|
import type { ConsumerTrace } from '@ddd-ts-kit/tracing';
|
|
19
19
|
import type { EventProvider } from '{{alias.platform}}/events/event-provider{{alias.ext}}';
|
|
20
|
+
{{#if housekeeping.any}}
|
|
21
|
+
import type { Housekeeping } from '{{alias.platform}}/jobs/housekeeping{{alias.ext}}';
|
|
22
|
+
{{/if}}
|
|
20
23
|
import type { LogSettings } from '{{alias.platform}}/observability/create-logger{{alias.ext}}';
|
|
21
24
|
{{#if cache.redis}}
|
|
22
25
|
import type { RedisServices } from '{{alias.platform}}/redis/open-redis{{alias.ext}}';
|
|
@@ -35,6 +38,10 @@ export interface PlatformOptions {
|
|
|
35
38
|
readonly events: EventProvider;
|
|
36
39
|
/** Where log entries go; left out, the application writes nothing. */
|
|
37
40
|
readonly log?: LogSettings;
|
|
41
|
+
{{#if housekeeping.any}}
|
|
42
|
+
/** How long the platform keeps what it is done with, in days: the configuration in `main.ts`; left out (the tools, the tests), thirty. */
|
|
43
|
+
readonly housekeeping?: Housekeeping;
|
|
44
|
+
{{/if}}
|
|
38
45
|
{{#if errors.sentry}}
|
|
39
46
|
/** Where unexpected failures are reported: the reporter of `errors.ts` in `main.ts`; left out (the tools, the tests), nowhere. */
|
|
40
47
|
readonly errors?: ErrorReporter;
|
|
@@ -26,6 +26,9 @@ import type {
|
|
|
26
26
|
RateLimiter,
|
|
27
27
|
{{/if}}
|
|
28
28
|
} from '@ddd-ts-kit/kernel';
|
|
29
|
+
{{#if queue.stored}}
|
|
30
|
+
import type { JobStore } from '@ddd-ts-kit/scheduling';
|
|
31
|
+
{{/if}}
|
|
29
32
|
{{#if audit.on}}
|
|
30
33
|
import type { Audit } from '{{alias.platform}}/audit/create-audit{{alias.ext}}';
|
|
31
34
|
{{/if}}
|
|
@@ -89,6 +92,10 @@ export interface Platform {
|
|
|
89
92
|
readonly jobs: JobScheduler;
|
|
90
93
|
/** What a use case enqueues through: a background job is written with its command and run later by the worker, as the actor that enqueued it. */
|
|
91
94
|
readonly jobQueue: JobQueue;
|
|
95
|
+
{{#if queue.stored}}
|
|
96
|
+
/** Where the jobs wait: what the purge of what finished and the erasure of a person reach. */
|
|
97
|
+
readonly jobStore: JobStore;
|
|
98
|
+
{{/if}}
|
|
92
99
|
/** Where a context registers its background jobs; the application starts it when this process runs the jobs. */
|
|
93
100
|
readonly backgroundJobs: BackgroundJobs;
|
|
94
101
|
/** Runs the steps of the process managers, in the unit of work of the step, and delivers their timeouts through the queue. */
|
|
@@ -83,6 +83,9 @@ import type { Persistence } from '{{alias.platform}}/database/persistence{{alias
|
|
|
83
83
|
import { platformErrorMapper } from '{{alias.platform}}/composition/platform-error-mapper{{alias.ext}}';
|
|
84
84
|
{{/if}}
|
|
85
85
|
import type { EventProvider } from '{{alias.platform}}/events/event-provider{{alias.ext}}';
|
|
86
|
+
{{#if housekeeping.any}}
|
|
87
|
+
import type { Housekeeping } from '{{alias.platform}}/jobs/housekeeping{{alias.ext}}';
|
|
88
|
+
{{/if}}
|
|
86
89
|
import type { LogSettings } from '{{alias.platform}}/observability/create-logger{{alias.ext}}';
|
|
87
90
|
{{#if cache.redis}}
|
|
88
91
|
import type { RedisServices } from '{{alias.platform}}/redis/open-redis{{alias.ext}}';
|
|
@@ -105,6 +108,10 @@ export interface PlatformOptions {
|
|
|
105
108
|
{{/if}}
|
|
106
109
|
/** Where log entries go; left out, the application writes nothing. */
|
|
107
110
|
readonly log?: LogSettings;
|
|
111
|
+
{{#if housekeeping.any}}
|
|
112
|
+
/** How long the platform keeps what it is done with, in days: the configuration in `main.ts`; left out (the tools, the tests), thirty. */
|
|
113
|
+
readonly housekeeping?: Housekeeping;
|
|
114
|
+
{{/if}}
|
|
108
115
|
/** The policy around every adapter that leaves the process; left out, `resilience/default-resilience-settings.ts`. */
|
|
109
116
|
readonly resilience?: ResilienceSettings;
|
|
110
117
|
/** Whether a consumed event continues the trace of its publication (the default) or starts one linked to it. */
|
|
@@ -9,6 +9,9 @@ import type { ResilienceSettings } from '{{alias.platform}}/resilience/resilienc
|
|
|
9
9
|
import type { FilesConfig } from '{{alias.platform}}/config/read-files{{alias.ext}}';
|
|
10
10
|
{{/if}}
|
|
11
11
|
import type { TracingConfig } from '{{alias.platform}}/config/read-tracing{{alias.ext}}';
|
|
12
|
+
{{#if housekeeping.any}}
|
|
13
|
+
import type { Housekeeping } from '{{alias.platform}}/jobs/housekeeping{{alias.ext}}';
|
|
14
|
+
{{/if}}
|
|
12
15
|
|
|
13
16
|
/** The validated configuration of the process: `loadConfig` is the only reader of the environment. */
|
|
14
17
|
export interface AppConfig {
|
|
@@ -33,9 +36,22 @@ export interface AppConfig {
|
|
|
33
36
|
{{#if persistence.needsUrl}}
|
|
34
37
|
readonly databaseUrl: string;
|
|
35
38
|
{{/if}}
|
|
39
|
+
{{#if orm.prisma}}
|
|
40
|
+
/**
|
|
41
|
+
* How long a unit of work waits for its transaction, every connection being busy
|
|
42
|
+
* (`DATABASE_TRANSACTION_WAIT_MS`), and how long the transaction may run
|
|
43
|
+
* (`DATABASE_TRANSACTION_TIMEOUT_MS`): Prisma bounds both, beyond which the unit of work is
|
|
44
|
+
* answered 503.
|
|
45
|
+
*/
|
|
46
|
+
readonly databaseTransaction: { readonly waitMs: number; readonly timeoutMs: number };
|
|
47
|
+
{{/if}}
|
|
36
48
|
{{#if events.outbox}}
|
|
37
49
|
readonly outboxRelayIntervalMs: number;
|
|
38
50
|
{{/if}}
|
|
51
|
+
{{#if housekeeping.any}}
|
|
52
|
+
/** How long the platform keeps what it is done with, in days (`OUTBOX_RETENTION_DAYS`, `BACKGROUND_JOBS_RETENTION_DAYS`). */
|
|
53
|
+
readonly housekeeping: Housekeeping;
|
|
54
|
+
{{/if}}
|
|
39
55
|
{{#if docs.any}}
|
|
40
56
|
readonly docsEnabled: boolean;
|
|
41
57
|
{{/if}}
|
|
@@ -15,6 +15,9 @@ import { Environment, type Variables } from '{{alias.platform}}/config/environme
|
|
|
15
15
|
import { readFiles } from '{{alias.platform}}/config/read-files{{alias.ext}}';
|
|
16
16
|
{{/if}}
|
|
17
17
|
import { readTracing } from '{{alias.platform}}/config/read-tracing{{alias.ext}}';
|
|
18
|
+
{{#if housekeeping.any}}
|
|
19
|
+
import { DEFAULT_HOUSEKEEPING, type Housekeeping } from '{{alias.platform}}/jobs/housekeeping{{alias.ext}}';
|
|
20
|
+
{{/if}}
|
|
18
21
|
|
|
19
22
|
const environments = ['development', 'test', 'production'] as const;
|
|
20
23
|
{{#if http.any}}
|
|
@@ -42,6 +45,13 @@ const runJobsByDefault = false;
|
|
|
42
45
|
export function loadConfig(variables: Variables): AppConfig {
|
|
43
46
|
const env = new Environment(variables);
|
|
44
47
|
const environment = env.oneOf('NODE_ENV', environments, 'development');
|
|
48
|
+
{{#if authn.none}}
|
|
49
|
+
|
|
50
|
+
// The development header is believed where NODE_ENV says so, never by default.
|
|
51
|
+
if (env.optional('NODE_ENV') === undefined) {
|
|
52
|
+
env.problem('NODE_ENV must be development or test: the development header is believed there only');
|
|
53
|
+
}
|
|
54
|
+
{{/if}}
|
|
45
55
|
|
|
46
56
|
const config: AppConfig = {
|
|
47
57
|
serviceName: env.optional('OTEL_SERVICE_NAME') ?? '{{project.name}}',
|
|
@@ -59,9 +69,15 @@ export function loadConfig(variables: Variables): AppConfig {
|
|
|
59
69
|
{{#if persistence.needsUrl}}
|
|
60
70
|
databaseUrl: env.url('DATABASE_URL'),
|
|
61
71
|
{{/if}}
|
|
72
|
+
{{#if orm.prisma}}
|
|
73
|
+
databaseTransaction: readDatabaseTransaction(env),
|
|
74
|
+
{{/if}}
|
|
62
75
|
{{#if events.outbox}}
|
|
63
76
|
outboxRelayIntervalMs: env.integer('OUTBOX_RELAY_INTERVAL_MS', { fallback: 500, min: 10, max: 60000 }),
|
|
64
77
|
{{/if}}
|
|
78
|
+
{{#if housekeeping.any}}
|
|
79
|
+
housekeeping: readHousekeeping(env),
|
|
80
|
+
{{/if}}
|
|
65
81
|
{{#if docs.any}}
|
|
66
82
|
docsEnabled: env.flag('API_DOCS', environment !== 'production'),
|
|
67
83
|
{{/if}}
|
|
@@ -110,6 +126,36 @@ export function loadConfig(variables: Variables): AppConfig {
|
|
|
110
126
|
return config;
|
|
111
127
|
}
|
|
112
128
|
|
|
129
|
+
{{#if housekeeping.any}}
|
|
130
|
+
/** How long the platform keeps what it is done with, in days; past that, the nightly purges drop it. */
|
|
131
|
+
function readHousekeeping(env: Environment): Housekeeping {
|
|
132
|
+
const days = (name: string, fallback: number): number => env.integer(name, { fallback, min: 1, max: 3650 });
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
{{#if events.outbox}}
|
|
136
|
+
publishedEventsDays: days('OUTBOX_RETENTION_DAYS', DEFAULT_HOUSEKEEPING.publishedEventsDays),
|
|
137
|
+
{{/if}}
|
|
138
|
+
{{#if queue.stored}}
|
|
139
|
+
finishedJobsDays: days('BACKGROUND_JOBS_RETENTION_DAYS', DEFAULT_HOUSEKEEPING.finishedJobsDays),
|
|
140
|
+
{{/if}}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
{{/if}}
|
|
145
|
+
{{#if orm.prisma}}
|
|
146
|
+
/**
|
|
147
|
+
* The limits of an interactive transaction of Prisma: 10 seconds of waiting for a connection and
|
|
148
|
+
* 30 of work by default, where Prisma gives up after 2 and 5. Not more: a caller gives up near 30
|
|
149
|
+
* seconds, and a connection held longer for an answer nobody reads sheds no load.
|
|
150
|
+
*/
|
|
151
|
+
function readDatabaseTransaction(env: Environment): AppConfig['databaseTransaction'] {
|
|
152
|
+
return {
|
|
153
|
+
waitMs: env.integer('DATABASE_TRANSACTION_WAIT_MS', { fallback: 10_000, min: 1, max: 3_600_000 }),
|
|
154
|
+
timeoutMs: env.integer('DATABASE_TRANSACTION_TIMEOUT_MS', { fallback: 30_000, min: 1, max: 3_600_000 }),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
{{/if}}
|
|
113
159
|
{{#if tenancy.any}}
|
|
114
160
|
/** `TENANTS=acme,globex`: each id in the grammar of a tenant id. */
|
|
115
161
|
function readTenants(env: Environment): readonly string[] {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
1
2
|
import { DataSource } from 'typeorm';
|
|
2
3
|
import { entities } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
3
4
|
|
|
5
|
+
// The TypeORM CLI reads no .env: `npm run db:migrate` finds DATABASE_URL there, and what the shell sets wins.
|
|
6
|
+
if (existsSync('.env')) {
|
|
7
|
+
process.loadEnvFile('.env');
|
|
8
|
+
}
|
|
9
|
+
|
|
4
10
|
// Read by the TypeORM CLI only (`npm run db:generate migrations/<what-it-does>`, `npm run db:migrate`), once compiled.
|
|
5
11
|
export default new DataSource({
|
|
6
12
|
type: 'postgres',
|
|
File without changes
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
1
2
|
import { createRequire } from 'node:module';
|
|
2
3
|
import process from 'node:process';
|
|
3
4
|
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
// The knex CLI reads no .env: `npm run db:migrate` finds DATABASE_URL there, and what the shell sets wins.
|
|
6
|
+
if (existsSync('.env')) {
|
|
7
|
+
process.loadEnvFile('.env');
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Read by the knex CLI (`npm run db:migrate`) and by `npm run db:generate <what-it-does>`, which
|
|
11
|
+
// writes `<timestamp>_<what-it-does>.js`, its SQL held in the file: a migration calls nothing of the
|
|
12
|
+
// application, so that it builds the same tables whatever the schema becomes. With `--custom`, the
|
|
13
|
+
// file is the ES module stub of knex (the project is ESM), to fill by hand.
|
|
7
14
|
export default {
|
|
8
15
|
client: 'pg',
|
|
9
16
|
connection: process.env.DATABASE_URL,
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
|
|
1
2
|
import { createClient } from '{{alias.platform}}/database/create-client{{alias.ext}}';
|
|
2
3
|
import { persistenceOver } from '{{alias.platform}}/database/persistence-over{{alias.ext}}';
|
|
3
4
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
4
5
|
|
|
5
|
-
export async function openPersistence(
|
|
6
|
+
export async function openPersistence(
|
|
7
|
+
config: Pick<AppConfig, 'databaseUrl' | 'databaseTransaction'>,
|
|
8
|
+
): Promise<Persistence> {
|
|
6
9
|
const client = createClient(config.databaseUrl);
|
|
7
10
|
|
|
8
11
|
await client.$connect();
|
|
9
12
|
|
|
10
|
-
return persistenceOver(client);
|
|
13
|
+
return persistenceOver(client, config.databaseTransaction);
|
|
11
14
|
}
|
|
@@ -26,6 +26,7 @@ import { createPrismaUnitOfWork, PrismaOutboxStore, PrismaProcessedEventStore }
|
|
|
26
26
|
{{/unless}}
|
|
27
27
|
{{/unless}}
|
|
28
28
|
import type { PrismaClient } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
29
|
+
import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
|
|
29
30
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
30
31
|
|
|
31
32
|
/** The schema of the messaging tables{{#if queue.processTable}} and of the background work{{/if}}, as prisma/schema/schema.prisma names it. */
|
|
@@ -35,9 +36,16 @@ const MESSAGING_SCHEMA = 'messaging';
|
|
|
35
36
|
const EVENT_STORE_SCHEMA = 'event_store';
|
|
36
37
|
{{/if}}
|
|
37
38
|
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
/**
|
|
40
|
+
* One object is the unit of work and what repositories query through; the stores are told how to reach their model.
|
|
41
|
+
* `transaction` bounds the wait and the run of each transaction (`maxWait`, `timeout`); left out, the defaults of
|
|
42
|
+
* Prisma apply (2 and 5 seconds), as in the tests.
|
|
43
|
+
*/
|
|
44
|
+
export function persistenceOver(client: PrismaClient, transaction?: AppConfig['databaseTransaction']): Persistence {
|
|
45
|
+
const unitOfWork = createPrismaUnitOfWork(
|
|
46
|
+
client,
|
|
47
|
+
transaction === undefined ? undefined : { maxWait: transaction.waitMs, timeout: transaction.timeoutMs },
|
|
48
|
+
);
|
|
41
49
|
|
|
42
50
|
return {
|
|
43
51
|
unitOfWork,
|
|
@@ -5,7 +5,7 @@ import { FixedExecutionScope, executionContext, systemActor } from '@ddd-ts-kit/
|
|
|
5
5
|
{{#unless queue.processTable}}
|
|
6
6
|
{{#if tenancy.any}}
|
|
7
7
|
{{#if eventSourcing.on}}
|
|
8
|
-
import { FixedExecutionScope } from '@ddd-ts-kit/kernel';
|
|
8
|
+
import { FixedExecutionScope, executionContext, systemActor } from '@ddd-ts-kit/kernel';
|
|
9
9
|
{{/if}}
|
|
10
10
|
{{/if}}
|
|
11
11
|
{{/unless}}
|
|
@@ -74,8 +74,8 @@ processedEventStoreContract(runner, {
|
|
|
74
74
|
eventStoreContract(runner, {
|
|
75
75
|
name: 'The event store of the platform',
|
|
76
76
|
{{#if tenancy.any}}
|
|
77
|
-
createStore: async () => (await emptied()).eventSourcing(
|
|
78
|
-
createCompanions: async () => (await emptied()).eventSourcing(
|
|
77
|
+
createStore: async () => (await emptied()).eventSourcing(inOneTenant()).events,
|
|
78
|
+
createCompanions: async () => (await emptied()).eventSourcing(inOneTenant()),
|
|
79
79
|
createTenantStore: async () => {
|
|
80
80
|
const scope = new FixedExecutionScope();
|
|
81
81
|
|
|
@@ -129,3 +129,14 @@ async function emptied(): Promise<Persistence> {
|
|
|
129
129
|
|
|
130
130
|
return database.persistence;
|
|
131
131
|
}
|
|
132
|
+
{{#if tenancy.any}}
|
|
133
|
+
{{#if eventSourcing.on}}
|
|
134
|
+
|
|
135
|
+
/** A scope in one tenant: the event store refuses work that names none, and its stream suites run in this one. */
|
|
136
|
+
function inOneTenant(): FixedExecutionScope {
|
|
137
|
+
return new FixedExecutionScope(
|
|
138
|
+
executionContext({ correlationId: 'contract', actor: systemActor('contract'), origin: 'test', tenantId: 'acme' }),
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
{{/if}}
|
|
142
|
+
{{/if}}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
1
2
|
import { defineConfig } from 'prisma/config';
|
|
2
3
|
|
|
4
|
+
// The Prisma CLI reads no .env: `npm run db:migrate` finds DATABASE_URL there, and what the shell sets wins.
|
|
5
|
+
if (existsSync('.env')) {
|
|
6
|
+
process.loadEnvFile('.env');
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
export default defineConfig({
|
|
4
10
|
// Every .prisma file of the folder: schema.prisma (the client, the datasource, the platform) and one file per context.
|
|
5
11
|
schema: './prisma/schema',
|
|
@@ -18,9 +18,10 @@ export const AUDIT_SCHEMA = 'audit';
|
|
|
18
18
|
{{/if}}
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Every table of the application
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* Every table of the application: what the in-process database of the tests runs, and what
|
|
22
|
+
* `npm run db:generate <what-it-does>` compares with the migrations, to write the difference into a
|
|
23
|
+
* new one. No migration calls it: a migration holds its SQL, and builds the same tables whatever
|
|
24
|
+
* this function becomes.
|
|
24
25
|
*/
|
|
25
26
|
export const createTables = async (knex: Knex): Promise<void> => {
|
|
26
27
|
{{#if tenancy.any}}
|
|
@@ -28,7 +28,11 @@ export function createEventSourcing(persistence: Persistence, audit: Audit, sour
|
|
|
28
28
|
{{#unless tenancy.any}}
|
|
29
29
|
const stores = persistence.eventSourcing;
|
|
30
30
|
{{/unless}}
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
const subjectKeys = auditedSubjectKeys(stores.subjectKeys, audit.trail, {
|
|
33
|
+
...source,
|
|
34
|
+
onLostRecord: audit.onLostRecord,
|
|
35
|
+
});
|
|
32
36
|
|
|
33
37
|
return { ...stores, subjectKeys, cipher: new PersonalDataCipher(subjectKeys) };
|
|
34
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Server } from 'node:http';
|
|
2
2
|
import type { AddressInfo } from 'node:net';
|
|
3
3
|
import express from 'express';
|
|
4
|
-
import { mountExpress, problemErrorHandler } from '@ddd-ts-kit/http/express';
|
|
4
|
+
import { mountExpress, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/express';
|
|
5
5
|
{{#if rpc.orpc}}
|
|
6
6
|
import { orpcRouter } from '@ddd-ts-kit/http/orpc';
|
|
7
7
|
import { RPCHandler } from '@orpc/server/node';
|
|
@@ -33,8 +33,8 @@ type Served = Pick<Application, 'routes' | 'boundary' | 'logger'{{#if cache.rate
|
|
|
33
33
|
* Serves, in this order: the readiness probe and the limit of each caller (with a Redis protocol
|
|
34
34
|
* server), the signed file links before any body parser (with a storage the application serves),
|
|
35
35
|
* the routes of the contexts, then the pages of the contract (with documentation on), and last the
|
|
36
|
-
* problem of a request refused before its route: a body that is not
|
|
37
|
-
* middleware.{{#if rpc.orpc}} The same
|
|
36
|
+
* problem of a path no route serves and of a request refused before its route: a body that is not
|
|
37
|
+
* JSON or too large, a failed middleware.{{#if rpc.orpc}} The same
|
|
38
38
|
* routes are served as oRPC procedures under /rpc, for the typed client of the contract.{{/if}}{{#if rpc.trpc}} The same
|
|
39
39
|
* routes are served as tRPC procedures under /trpc, for the typed client of the contract.{{/if}}
|
|
40
40
|
*/
|
|
@@ -71,7 +71,9 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
71
71
|
{{#unless docs.any}}
|
|
72
72
|
mountExpress(app, served.routes, served.boundary);
|
|
73
73
|
{{/unless}}
|
|
74
|
-
// Instead of the final handler of Express, which answers HTML
|
|
74
|
+
// Instead of the final handler of Express, which answers HTML: a path no route serves, then an error, the
|
|
75
|
+
// one written to stderr with the body it quotes.
|
|
76
|
+
app.use(problemNotFoundHandler({ logger: served.logger }));
|
|
75
77
|
app.use(problemErrorHandler({ logger: served.logger }));
|
|
76
78
|
|
|
77
79
|
const server = await listen(app, config.port);
|
|
@@ -138,8 +140,9 @@ function serveProcedures(app: express.Express, served: Served): void {
|
|
|
138
140
|
{{/if}}
|
|
139
141
|
|
|
140
142
|
function listen(app: express.Express, port: number): Promise<Server> {
|
|
141
|
-
return new Promise<Server>((resolve) => {
|
|
142
|
-
|
|
143
|
+
return new Promise<Server>((resolve, reject) => {
|
|
144
|
+
// Express 5 hands the error of listen to this callback, a port in use among them: the start fails with it.
|
|
145
|
+
const server = app.listen(port, (error) => (error === undefined ? resolve(server) : reject(error)));
|
|
143
146
|
});
|
|
144
147
|
}
|
|
145
148
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Fastify{{#if cache.rateLimit}}, { type FastifyInstance }{{/if}}{{#unless cache.rateLimit}}{{#unless rpc.none}}, { type FastifyInstance }{{/unless}}{{/unless}} from 'fastify';
|
|
2
|
-
import { mountFastify, problemErrorHandler } from '@ddd-ts-kit/http/fastify';
|
|
2
|
+
import { mountFastify, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/fastify';
|
|
3
3
|
{{#if rpc.orpc}}
|
|
4
4
|
import { orpcRouter } from '@ddd-ts-kit/http/orpc';
|
|
5
5
|
import { RPCHandler } from '@orpc/server/fastify';
|
|
@@ -30,7 +30,8 @@ type Served = Pick<Application, 'routes' | 'boundary' | 'logger'{{#if cache.rate
|
|
|
30
30
|
/**
|
|
31
31
|
* Serves, in this order: the readiness probe and the limit of each caller (with a Redis protocol
|
|
32
32
|
* server), the signed file links (with a storage the application serves), the routes of the
|
|
33
|
-
* contexts, then the pages of the contract (with documentation on)
|
|
33
|
+
* contexts, then the pages of the contract (with documentation on), and last the problem of a
|
|
34
|
+
* path no route serves.{{#if rpc.orpc}} The same routes are served
|
|
34
35
|
* as oRPC procedures under /rpc, for the typed client of the contract.{{/if}}{{#if rpc.trpc}} The same routes are served
|
|
35
36
|
* as tRPC procedures under /trpc, for the typed client of the contract.{{/if}}
|
|
36
37
|
*/
|
|
@@ -40,6 +41,8 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
40
41
|
|
|
41
42
|
// Before any route: a body Fastify refuses and a failed hook are answered as problems, not with their message.
|
|
42
43
|
app.setErrorHandler(problemErrorHandler({ logger: served.logger }));
|
|
44
|
+
// A path no route serves is answered 404 as a problem, not as `{ message, error, statusCode }`.
|
|
45
|
+
app.setNotFoundHandler(problemNotFoundHandler({ logger: served.logger }));
|
|
43
46
|
|
|
44
47
|
{{#if cache.rateLimit}}
|
|
45
48
|
answerReadiness(app, served);
|
|
@@ -4,7 +4,7 @@ import { serve, type ServerType } from '@hono/node-server';
|
|
|
4
4
|
import { getConnInfo } from '@hono/node-server/conninfo';
|
|
5
5
|
{{/if}}
|
|
6
6
|
import { Hono } from 'hono';
|
|
7
|
-
import { mountHono, problemErrorHandler } from '@ddd-ts-kit/http/hono';
|
|
7
|
+
import { mountHono, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/hono';
|
|
8
8
|
{{#if rpc.orpc}}
|
|
9
9
|
import { orpcRouter } from '@ddd-ts-kit/http/orpc';
|
|
10
10
|
import { RPCHandler } from '@orpc/server/fetch';
|
|
@@ -35,7 +35,8 @@ type Served = Pick<Application, 'routes' | 'boundary' | 'logger'{{#if cache.rate
|
|
|
35
35
|
/**
|
|
36
36
|
* Serves, in this order: the readiness probe and the limit of each caller (with a Redis protocol
|
|
37
37
|
* server), the signed file links (with a storage the application serves), the routes of the
|
|
38
|
-
* contexts, then the pages of the contract (with documentation on)
|
|
38
|
+
* contexts, then the pages of the contract (with documentation on), and last the problem of a
|
|
39
|
+
* path no route serves.{{#if rpc.orpc}} The same routes are served
|
|
39
40
|
* as oRPC procedures under /rpc, for the typed client of the contract.{{/if}}{{#if rpc.trpc}} The same routes are served
|
|
40
41
|
* as tRPC procedures under /trpc, for the typed client of the contract.{{/if}}
|
|
41
42
|
*/
|
|
@@ -44,6 +45,8 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
|
|
|
44
45
|
|
|
45
46
|
// A failed middleware is answered as a problem, not as a text with the error written to stderr.
|
|
46
47
|
app.onError(problemErrorHandler({ logger: served.logger }));
|
|
48
|
+
// A path no route serves is answered 404 as a problem, not as the text of Hono.
|
|
49
|
+
app.notFound(problemNotFoundHandler({ logger: served.logger }));
|
|
47
50
|
|
|
48
51
|
{{#if cache.rateLimit}}
|
|
49
52
|
answerReadiness(app, served);
|
|
@@ -40,6 +40,10 @@ import type { BackgroundJobs } from '{{alias.platform}}/jobs/background-jobs{{al
|
|
|
40
40
|
export interface BackgroundWork {
|
|
41
41
|
/** What a use case enqueues through, in the transaction of its command when the store shares it. */
|
|
42
42
|
readonly jobQueue: JobQueue;
|
|
43
|
+
{{#if queue.stored}}
|
|
44
|
+
/** Where the jobs wait: what the purge of what finished and the erasure of a person reach. */
|
|
45
|
+
readonly jobStore: JobStore;
|
|
46
|
+
{{/if}}
|
|
43
47
|
readonly backgroundJobs: BackgroundJobs;
|
|
44
48
|
/** Runs the steps of the process managers and delivers their timeouts. */
|
|
45
49
|
readonly processes: ProcessRunner;
|
|
@@ -82,10 +86,18 @@ export function createBackgroundWork({
|
|
|
82
86
|
{{#if queue.memory}}
|
|
83
87
|
const store = new InMemoryJobStore();
|
|
84
88
|
{{/if}}
|
|
89
|
+
{{#if tenancy.any}}
|
|
90
|
+
const jobQueue = new StoredJobQueue({ store, clock, ids, scope, tenant: true, traceparent: traced.traceparent });
|
|
91
|
+
{{/if}}
|
|
92
|
+
{{#unless tenancy.any}}
|
|
85
93
|
const jobQueue = new StoredJobQueue({ store, clock, ids, scope, traceparent: traced.traceparent });
|
|
94
|
+
{{/unless}}
|
|
86
95
|
|
|
87
96
|
return {
|
|
88
97
|
jobQueue,
|
|
98
|
+
{{#if queue.stored}}
|
|
99
|
+
jobStore: store,
|
|
100
|
+
{{/if}}
|
|
89
101
|
backgroundJobs: backgroundJobsOn(workerOn(store, options, foundations), traced),
|
|
90
102
|
processes: new StoredProcessRunner({
|
|
91
103
|
{{#if queue.processTable}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Clock } from '@ddd-ts-kit/kernel';
|
|
2
|
+
|
|
3
|
+
const DAY_MS = 86_400_000;
|
|
4
|
+
|
|
5
|
+
/** The instant before which a purge reaches what finished. */
|
|
6
|
+
export function daysBefore(clock: Clock, days: number): Date {
|
|
7
|
+
return new Date(clock.now().getTime() - days * DAY_MS);
|
|
8
|
+
}
|