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
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkerFile } from './worker-file.js';
|
|
2
|
+
import type { WorkerProgress } from './worker-progress.js';
|
|
3
|
+
/** Where the worker at `project` stands; undefined when its config cannot be read. */
|
|
4
|
+
export declare function readableProgress(project: string, scope: WorkerFile): WorkerProgress | undefined;
|
|
5
|
+
//# sourceMappingURL=readable-progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readable-progress.d.ts","sourceRoot":"","sources":["../../src/worker/readable-progress.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,CAI/F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { readConfig } from '../config/index.js';
|
|
2
|
+
import { progressOf } from './progress-of.js';
|
|
3
|
+
/** Where the worker at `project` stands; undefined when its config cannot be read. */
|
|
4
|
+
export function readableProgress(project, scope) {
|
|
5
|
+
const config = configOf(project);
|
|
6
|
+
return config === undefined ? undefined : progressOf({ project, config }, scope);
|
|
7
|
+
}
|
|
8
|
+
function configOf(project) {
|
|
9
|
+
try {
|
|
10
|
+
return readConfig(project).config;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=readable-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readable-progress.js","sourceRoot":"","sources":["../../src/worker/readable-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,KAAiB;IACjE,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAEjC,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,QAAQ,CAAC,OAAe;IAC/B,IAAI,CAAC;QACH,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume-worker.d.ts","sourceRoot":"","sources":["../../src/worker/resume-worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resume-worker.d.ts","sourceRoot":"","sources":["../../src/worker/resume-worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAI9D,OAAO,KAAK,EAAe,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE/E,uDAAuD;AACvD,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,gGAAgG;AAChG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,kEAAkE;IAClE,QAAQ,CAAC,WAAW,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC/E,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAKD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,YAAY,CA4B/E"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { CliError } from '../cli-error.js';
|
|
3
2
|
import { readConfig } from '../config/index.js';
|
|
4
3
|
import { findWorker } from './find-worker.js';
|
|
5
4
|
import { progressOf } from './progress-of.js';
|
|
@@ -16,10 +15,10 @@ const RECENT_MINUTES = 3;
|
|
|
16
15
|
export function resumeWorker(root, request) {
|
|
17
16
|
const worker = findWorker(root, request);
|
|
18
17
|
const config = readConfig(worker.project).config;
|
|
19
|
-
const progress = progressOf(worker.project, worker.scope, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
18
|
+
const progress = progressOf({ project: worker.project, config }, worker.scope, {
|
|
19
|
+
stopped: true,
|
|
20
|
+
fresh: request.fresh,
|
|
21
|
+
});
|
|
23
22
|
const { next, agent } = progress;
|
|
24
23
|
const base = worker.scope.base ?? 'origin/main';
|
|
25
24
|
const message = resumeMessage(progress, { context: request.context, project: worker.project, base });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume-worker.js","sourceRoot":"","sources":["../../src/worker/resume-worker.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"resume-worker.js","sourceRoot":"","sources":["../../src/worker/resume-worker.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,UAAU,EAAqB,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA0BjD,8FAA8F;AAC9F,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,OAAsB;IAC/D,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IAEjD,MAAM,QAAQ,GAAG,UAAU,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE;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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE5E,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,cAAc,GAAG,MAAM,IAAI,OAAO,GAAG,IAAI,CAAC;AACvE,CAAC"}
|
|
@@ -64,10 +64,11 @@ export interface AgentRecord {
|
|
|
64
64
|
readonly toolCalls: number;
|
|
65
65
|
/** The tool calls counted for each row it committed, by id. */
|
|
66
66
|
readonly rowCosts: Readonly<Record<string, number>>;
|
|
67
|
-
/** When it last stopped on its own,
|
|
67
|
+
/** When it last stopped on its own, whether its report was current then, and what the guard found left outside its scope. */
|
|
68
68
|
readonly lastStop: {
|
|
69
69
|
readonly at: string;
|
|
70
70
|
readonly reportCurrent: boolean;
|
|
71
|
+
readonly outside?: string;
|
|
71
72
|
} | null;
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-progress.d.ts","sourceRoot":"","sources":["../../src/worker/worker-progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC,oGAAoG;IACpG,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,QAAQ,CAAC,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IACvC,QAAQ,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AC,SAAS,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,6HAA6H;IAC7H,QAAQ,CAAC,QAAQ,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/G;AAED;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAChB;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** A folder above the target, or the target of a link, that is no folder nor file: the write fails there, and is reported unwritable. */
|
|
2
2
|
export declare const BLOCKED: unique symbol;
|
|
3
|
-
/** What `realPathOf` answers: the real path, `BLOCKED`, or undefined
|
|
3
|
+
/** What `realPathOf` answers: the real path, `BLOCKED`, or undefined past the links it follows. */
|
|
4
4
|
export type RealPath = string | typeof BLOCKED | undefined;
|
|
5
5
|
/**
|
|
6
6
|
* The real path `absolute` is written at: a link in its place followed to where it points, then
|
|
7
7
|
* the real path of the deepest part that exists, the parts below it appended as they are;
|
|
8
8
|
* `BLOCKED` when what stands there is no folder above the target, or no file nor folder at the
|
|
9
|
-
* end of a link; undefined
|
|
9
|
+
* end of a link; undefined past the links it follows, which a loop of links never ends.
|
|
10
10
|
*/
|
|
11
11
|
export declare function realPathOf(absolute: string, hops?: number): RealPath;
|
|
12
12
|
//# sourceMappingURL=real-path-of.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real-path-of.d.ts","sourceRoot":"","sources":["../../src/workspace/real-path-of.ts"],"names":[],"mappings":"AAGA,yIAAyI;AACzI,eAAO,MAAM,OAAO,eAAoB,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"real-path-of.d.ts","sourceRoot":"","sources":["../../src/workspace/real-path-of.ts"],"names":[],"mappings":"AAGA,yIAAyI;AACzI,eAAO,MAAM,OAAO,eAAoB,CAAC;AAEzC,mGAAmG;AACnG,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,OAAO,GAAG,SAAS,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,SAAI,GAAG,QAAQ,CAS/D"}
|
|
@@ -6,16 +6,26 @@ export const BLOCKED = Symbol('blocked');
|
|
|
6
6
|
* The real path `absolute` is written at: a link in its place followed to where it points, then
|
|
7
7
|
* the real path of the deepest part that exists, the parts below it appended as they are;
|
|
8
8
|
* `BLOCKED` when what stands there is no folder above the target, or no file nor folder at the
|
|
9
|
-
* end of a link; undefined
|
|
9
|
+
* end of a link; undefined past the links it follows, which a loop of links never ends.
|
|
10
10
|
*/
|
|
11
11
|
export function realPathOf(absolute, hops = 0) {
|
|
12
12
|
const at = path.resolve(absolute);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const link = linkAt(at);
|
|
14
|
+
if (link !== undefined) {
|
|
15
|
+
return hops > 32 ? undefined : linkedPathOf(at, link, hops);
|
|
15
16
|
}
|
|
16
17
|
return existingRealPathOf(at);
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
/** Where the link at `absolute` points; undefined when what stands there is no link. */
|
|
20
|
+
function linkAt(absolute) {
|
|
21
|
+
try {
|
|
22
|
+
return fs.readlinkSync(absolute);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function linkedPathOf(at, link, hops) {
|
|
19
29
|
try {
|
|
20
30
|
const target = fs.statSync(at);
|
|
21
31
|
if (!target.isFile() && !target.isDirectory()) {
|
|
@@ -25,12 +35,7 @@ function linkedPathOf(at, hops) {
|
|
|
25
35
|
}
|
|
26
36
|
catch {
|
|
27
37
|
// A link to nothing: the write creates its target, wherever it points.
|
|
28
|
-
|
|
29
|
-
return realPathOf(path.resolve(path.dirname(at), fs.readlinkSync(at)), hops + 1);
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
38
|
+
return realPathOf(path.resolve(path.dirname(at), link), hops + 1);
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
function existingRealPathOf(absolute) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"real-path-of.js","sourceRoot":"","sources":["../../src/workspace/real-path-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,yIAAyI;AACzI,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAKzC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,IAAI,GAAG,CAAC;IACnD,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"real-path-of.js","sourceRoot":"","sources":["../../src/workspace/real-path-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,yIAAyI;AACzI,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAKzC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,QAAgB,EAAE,IAAI,GAAG,CAAC;IACnD,M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,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC;QAC5D,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACnC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAEjC,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,OAAO,CAAC,CAAC;IACxG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,QAAgB;IAC/B,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RealPath } from './real-path-of.js';
|
|
2
|
+
/**
|
|
3
|
+
* Writes one state or scope file of a command, whole or not at all, and only inside the project: a
|
|
4
|
+
* symbolic link in its place or above it that leads out of `root` refuses the command, the path
|
|
5
|
+
* named, before anything is written.
|
|
6
|
+
*/
|
|
7
|
+
export declare function writeInsideProject(root: string, file: string, content: string, real?: RealPath): void;
|
|
8
|
+
//# sourceMappingURL=write-inside-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-inside-project.d.ts","sourceRoot":"","sources":["../../src/workspace/write-inside-project.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAUrG"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { CliError } from '../cli-error.js';
|
|
3
|
+
import { refuseLeaving } from './refuse-leaving.js';
|
|
4
|
+
import { writeIfAllowed } from './write-if-allowed.js';
|
|
5
|
+
/**
|
|
6
|
+
* Writes one state or scope file of a command, whole or not at all, and only inside the project: a
|
|
7
|
+
* symbolic link in its place or above it that leads out of `root` refuses the command, the path
|
|
8
|
+
* named, before anything is written.
|
|
9
|
+
*/
|
|
10
|
+
export function writeInsideProject(root, file, content, real) {
|
|
11
|
+
const absolute = path.resolve(root, file);
|
|
12
|
+
const where = real ?? refuseLeaving(root, [file], () => absolute).get(file);
|
|
13
|
+
if (!writeIfAllowed(absolute, content, { real: where })) {
|
|
14
|
+
throw new CliError(`${file} could not be written: it is read-only, denied to this process, or a folder or a device stands in its place.`, `Make ${file} a file this process may write (or remove what stands there), then run again.`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=write-inside-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-inside-project.js","sourceRoot":"","sources":["../../src/workspace/write-inside-project.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,IAAY,EAAE,OAAe,EAAE,IAAe;IAC7F,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE5E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,QAAQ,CAChB,GAAG,IAAI,8GAA8G,EACrH,QAAQ,IAAI,+EAA+E,CAC5F,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ddd-ts-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.103.0",
|
|
4
4
|
"description": "Bootstrap, scaffold and verify Domain-Driven Design (DDD), Clean Architecture and hexagonal TypeScript backends on Node.js: project and code generators, architecture checks, OpenAPI and AsyncAPI documents, for developers and AI coding agents (Claude Code, Codex, GitHub Copilot).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@ddd-ts-kit/audit": "^0.
|
|
56
|
-
"@ddd-ts-kit/auth": "^0.
|
|
57
|
-
"@ddd-ts-kit/events": "^0.
|
|
58
|
-
"@ddd-ts-kit/kernel": "^0.
|
|
55
|
+
"@ddd-ts-kit/audit": "^0.103.0",
|
|
56
|
+
"@ddd-ts-kit/auth": "^0.103.0",
|
|
57
|
+
"@ddd-ts-kit/events": "^0.103.0",
|
|
58
|
+
"@ddd-ts-kit/kernel": "^0.103.0",
|
|
59
59
|
"@types/pg": "^8.23.1",
|
|
60
60
|
"pg": "^8.23.1"
|
|
61
61
|
}
|
|
@@ -2,7 +2,11 @@ import { defineStoredEvent, type StoredEventTypes } from '@ddd-ts-kit/kernel';
|
|
|
2
2
|
import type { {{name.pascal}}Event } from '{{alias.context}}/domain/aggregates/{{name.kebab}}.aggregate{{alias.ext}}';
|
|
3
3
|
import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
|
|
4
4
|
|
|
5
|
-
// TODO(domain): an event that carries nothing keeps `Record<string, never>`; for one that carries fields beyond its id
|
|
5
|
+
// TODO(domain): an event that carries nothing keeps `Record<string, never>`; for one that carries fields beyond its id
|
|
6
|
+
// and instant, write the type as an `interface` with them, in plain data (texts, numbers, ISO dates); personal data is
|
|
7
|
+
// written `personalData(subjectId, value)` and read `data.personalText(field)`, `data.personalInstant(field)` or
|
|
8
|
+
// `data.personal(field, ValueObject.of)`, which answer `undefined` once the subject is erased. A type stored once never
|
|
9
|
+
// changes: a change is a new version with its upcaster (event-sourcing/upcaster-required).
|
|
6
10
|
type {{event.pascal}}Data = Record<string, never>;
|
|
7
11
|
|
|
8
12
|
/** How the events of {{name.pascal}} are kept in its stream: one entry per event, read back by `decode`. */
|
|
@@ -28,15 +28,7 @@ export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Com
|
|
|
28
28
|
await this.access.authorize(command.actor, {{access.reference}}, command);
|
|
29
29
|
|
|
30
30
|
{{/if}}
|
|
31
|
-
{{
|
|
32
|
-
// TODO(domain): decide what "{{name.words}}" does to {{aggregate.article}} {{aggregate.pascal}}: either it gives birth to one (keep `create`, pass the facts of `command` as value objects), or it changes an existing one (load it with `findById`, throw its refusal when there is none, `Unknown{{aggregate.pascal}}.for{{aggregate.pascal}}(id)` (`ddd-ts-kit generate error {{context.kebab}} Unknown{{aggregate.pascal}} for{{aggregate.pascal}}`), call ONE intention method). The events it records leave with the save: nothing else to do here.
|
|
33
|
-
{{/if}}
|
|
34
|
-
{{#if refusals.factories}}
|
|
35
|
-
// TODO(domain): decide what "{{name.words}}" does to {{aggregate.article}} {{aggregate.pascal}}: either it gives birth to one (keep `create`, pass the facts of `command` as value objects), or it changes an existing one (load it with `findById`, throw its not-found refusal, `{{aggregate.pascal}}Error.notFound(id)` (`ddd-ts-kit generate error {{context.kebab}} {{aggregate.pascal}} notFound`), call ONE intention method). The events it records leave with the save: nothing else to do here.
|
|
36
|
-
{{/if}}
|
|
37
|
-
{{#if refusals.classes}}
|
|
38
|
-
// TODO(domain): decide what "{{name.words}}" does to {{aggregate.article}} {{aggregate.pascal}}: either it gives birth to one (keep `create`, pass the facts of `command` as value objects), or it changes an existing one (load it with `findById`, throw a not-found DomainError, call ONE intention method). The events it records leave with the save: nothing else to do here.
|
|
39
|
-
{{/if}}
|
|
31
|
+
// TODO(domain): decide what "{{name.words}}" does to {{aggregate.article}} {{aggregate.pascal}}: keep `create` and pass the facts of `command` as value objects. The events it records leave with the save: nothing else to do here.
|
|
40
32
|
const {{aggregate.camel}} = {{aggregate.pascal}}.create(this.ids.next(), this.clock.now());
|
|
41
33
|
|
|
42
34
|
await this.{{aggregate.camel}}Repository.save({{aggregate.camel}});
|
|
@@ -75,13 +67,13 @@ export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Com
|
|
|
75
67
|
|
|
76
68
|
{{/if}}
|
|
77
69
|
{{#if refusals.named}}
|
|
78
|
-
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw its refusal when there is none, `Unknown{{aggregate.pascal}}.for{{aggregate.pascal}}(id)` (`ddd-ts-kit generate error {{context.kebab}} Unknown{{aggregate.pascal}} for{{aggregate.pascal}}`), call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
70
|
+
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw its refusal when there is none, `Unknown{{aggregate.pascal}}.for{{aggregate.pascal}}(id)` (`ddd-ts-kit generate error {{context.kebab}} Unknown{{aggregate.pascal}} for{{aggregate.pascal}}`), call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
79
71
|
{{/if}}
|
|
80
72
|
{{#if refusals.factories}}
|
|
81
|
-
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw its not-found refusal, `{{aggregate.pascal}}Error.notFound(id)` (`ddd-ts-kit generate error {{context.kebab}} {{aggregate.pascal}} notFound`), call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
73
|
+
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw its not-found refusal, `{{aggregate.pascal}}Error.notFound(id)` (`ddd-ts-kit generate error {{context.kebab}} {{aggregate.pascal}} notFound`), call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
82
74
|
{{/if}}
|
|
83
75
|
{{#if refusals.classes}}
|
|
84
|
-
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw a not-found DomainError, call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
76
|
+
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw a not-found DomainError, call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
85
77
|
{{/if}}
|
|
86
78
|
}
|
|
87
79
|
}
|
|
@@ -26,15 +26,7 @@ export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Com
|
|
|
26
26
|
await this.access.authorize(command.actor, {{access.reference}}, command);
|
|
27
27
|
|
|
28
28
|
{{/if}}
|
|
29
|
-
{{
|
|
30
|
-
// TODO(domain): decide what "{{name.words}}" does to {{aggregate.article}} {{aggregate.pascal}}: either it gives birth to one (keep `create`, pass the facts of `command` as value objects), or it changes an existing one (load it with `findById`, throw its refusal when there is none, `Unknown{{aggregate.pascal}}.for{{aggregate.pascal}}(id)` (`ddd-ts-kit generate error {{context.kebab}} Unknown{{aggregate.pascal}} for{{aggregate.pascal}}`), call ONE intention method). The events it records leave with the save: nothing else to do here.
|
|
31
|
-
{{/if}}
|
|
32
|
-
{{#if refusals.factories}}
|
|
33
|
-
// TODO(domain): decide what "{{name.words}}" does to {{aggregate.article}} {{aggregate.pascal}}: either it gives birth to one (keep `create`, pass the facts of `command` as value objects), or it changes an existing one (load it with `findById`, throw its not-found refusal, `{{aggregate.pascal}}Error.notFound(id)` (`ddd-ts-kit generate error {{context.kebab}} {{aggregate.pascal}} notFound`), call ONE intention method). The events it records leave with the save: nothing else to do here.
|
|
34
|
-
{{/if}}
|
|
35
|
-
{{#if refusals.classes}}
|
|
36
|
-
// TODO(domain): decide what "{{name.words}}" does to {{aggregate.article}} {{aggregate.pascal}}: either it gives birth to one (keep `create`, pass the facts of `command` as value objects), or it changes an existing one (load it with `findById`, throw a not-found DomainError, call ONE intention method). The events it records leave with the save: nothing else to do here.
|
|
37
|
-
{{/if}}
|
|
29
|
+
// TODO(domain): decide what "{{name.words}}" does to {{aggregate.article}} {{aggregate.pascal}}: keep `create` and pass the facts of `command` as value objects. The events it records leave with the save: nothing else to do here.
|
|
38
30
|
const {{aggregate.camel}} = {{aggregate.pascal}}.create(this.ids.next(), this.clock.now());
|
|
39
31
|
|
|
40
32
|
await this.{{aggregate.camel}}Repository.save({{aggregate.camel}});
|
|
@@ -72,13 +64,13 @@ export class {{name.pascal}}Handler implements CommandHandler<{{name.pascal}}Com
|
|
|
72
64
|
|
|
73
65
|
{{/if}}
|
|
74
66
|
{{#if refusals.named}}
|
|
75
|
-
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw its refusal when there is none, `Unknown{{aggregate.pascal}}.for{{aggregate.pascal}}(id)` (`ddd-ts-kit generate error {{context.kebab}} Unknown{{aggregate.pascal}} for{{aggregate.pascal}}`), call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
67
|
+
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw its refusal when there is none, `Unknown{{aggregate.pascal}}.for{{aggregate.pascal}}(id)` (`ddd-ts-kit generate error {{context.kebab}} Unknown{{aggregate.pascal}} for{{aggregate.pascal}}`), call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
76
68
|
{{/if}}
|
|
77
69
|
{{#if refusals.factories}}
|
|
78
|
-
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw its not-found refusal, `{{aggregate.pascal}}Error.notFound(id)` (`ddd-ts-kit generate error {{context.kebab}} {{aggregate.pascal}} notFound`), call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
70
|
+
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw its not-found refusal, `{{aggregate.pascal}}Error.notFound(id)` (`ddd-ts-kit generate error {{context.kebab}} {{aggregate.pascal}} notFound`), call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
79
71
|
{{/if}}
|
|
80
72
|
{{#if refusals.classes}}
|
|
81
|
-
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw a not-found DomainError, call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
73
|
+
// TODO(domain): "{{name.words}}" changes {{aggregate.pascal}}s that exist and writes nothing until you decide how: load the one `command` names with `this.{{aggregate.camel}}Repository.findById`, throw a not-found DomainError, call ONE intention method of the aggregate, then `save` it (its events leave with the save).
|
|
82
74
|
{{/if}}
|
|
83
75
|
}
|
|
84
76
|
}
|
|
@@ -22,4 +22,6 @@ TODO(domain): the processors and the third parties that receive personal data (m
|
|
|
22
22
|
|
|
23
23
|
## What the code does not purge
|
|
24
24
|
|
|
25
|
+
`npm run privacy:erase` reaches the declared copies, the records of the outbox of the events listed above and the jobs enqueued with the person as `subject`. It does not reach what the code cannot name: a message already delivered to a broker or a consumer, a field of a payload that no `personal` option lists, a job that holds a person in its payload and names no `subject`. The jobs `events.purge-published` and `jobs.purge-finished` drop what the platform is done with past `OUTBOX_RETENTION_DAYS` and `BACKGROUND_JOBS_RETENTION_DAYS`; dead events and dead jobs wait for an operator.
|
|
26
|
+
|
|
25
27
|
TODO(domain): how long the backups, the logs, the files and the archives of the audit trail keep personal data, and who deletes them.
|
|
@@ -63,7 +63,7 @@ describe('{{name.title}}, end to end', () => {
|
|
|
63
63
|
{{#if authz.rebac}}
|
|
64
64
|
await application.relate({ object: 'context:{{context.kebab}}', relation: 'operator', subject: 'user:ada' });
|
|
65
65
|
{{/if}}
|
|
66
|
-
const ada = await application.as({ id: 'ada', roles: ['admin'] });
|
|
66
|
+
const ada = await application.as({ id: 'ada', roles: ['admin']{{e2e.tenant}} });
|
|
67
67
|
|
|
68
68
|
const trace = await tracing.traceOf(async () => {
|
|
69
69
|
expectStatus(await ada.{{e2e.call}}('{{e2e.samplePath}}'{{e2e.body}}), {{e2e.status}});
|
|
@@ -88,7 +88,7 @@ describe('{{name.title}}, end to end', () => {
|
|
|
88
88
|
{{#if authz.rebac}}
|
|
89
89
|
await application.relate({ object: 'context:{{context.kebab}}', relation: 'operator', subject: 'user:ada' });
|
|
90
90
|
{{/if}}
|
|
91
|
-
const ada = await application.as({ id: 'ada', roles: ['admin'] });
|
|
91
|
+
const ada = await application.as({ id: 'ada', roles: ['admin']{{e2e.tenant}} });
|
|
92
92
|
|
|
93
93
|
const response = await ada.{{e2e.call}}('{{e2e.samplePath}}'{{e2e.body}});
|
|
94
94
|
{{/if}}
|
|
@@ -8,16 +8,17 @@ The rules are in `AGENTS.md`, which every coding agent reads, and by layer in `.
|
|
|
8
8
|
```bash
|
|
9
9
|
npm install
|
|
10
10
|
npm run verify # every gate of the pipeline: green before the first line of business code
|
|
11
|
-
cp .env.example .env
|
|
11
|
+
cp -n .env.example .env # init wrote .env already; a fresh clone of the repository copies it
|
|
12
12
|
{{#if database.server}}
|
|
13
|
-
npm run infra:up # the database, in Docker;
|
|
13
|
+
npm run infra:up # the database, in Docker; for Jaeger: docker compose --profile observability up -d --wait
|
|
14
14
|
{{/if}}
|
|
15
15
|
{{#if orm.drizzle}}
|
|
16
16
|
npm run db:generate initial # migrations/<timestamp>_initial.sql, from the Drizzle schema
|
|
17
17
|
npm run db:migrate
|
|
18
18
|
{{/if}}
|
|
19
19
|
{{#if orm.knex}}
|
|
20
|
-
npm run db:
|
|
20
|
+
npm run db:generate initial # migrations/<timestamp>_initial.js, from `createTables` of {{config.platformDir}}/database/schema.ts
|
|
21
|
+
npm run db:migrate
|
|
21
22
|
{{/if}}
|
|
22
23
|
{{#if orm.prisma}}
|
|
23
24
|
npm run db:client # the Prisma client and the schema of the tests, from the files of prisma/schema/
|
|
@@ -26,7 +27,7 @@ npm run db:migrate
|
|
|
26
27
|
{{/if}}
|
|
27
28
|
{{#if orm.typeorm}}
|
|
28
29
|
npm run build && npm run db:generate migrations/initial # migrations/<timestamp>-initial.ts, from the entity schemas
|
|
29
|
-
npm run db:migrate
|
|
30
|
+
npm run db:migrate # builds, then applies migrations/
|
|
30
31
|
{{/if}}
|
|
31
32
|
npm run dev
|
|
32
33
|
```
|
|
@@ -186,6 +187,29 @@ and `execution.scheduledAt` says which period the work is for.
|
|
|
186
187
|
on the API), or initialise the project with `--cache redis`, which binds `RedisLock`, or bind a
|
|
187
188
|
lock between processes of your own to `Lock` in the platform.
|
|
188
189
|
{{/unless}}
|
|
190
|
+
{{#if audit.on}}
|
|
191
|
+
|
|
192
|
+
## Audit trail
|
|
193
|
+
|
|
194
|
+
Who did what, on what, when and with what outcome is recorded around the use cases in
|
|
195
|
+
`{{config.platformDir}}/audit/`, each entry linked to the one before it by a hash, chain by chain (one per tenant).{{#if audit.memory}}
|
|
196
|
+
The entries live in the memory of the process until `{{config.platformDir}}/audit/create-audit-trail.ts` answers its TODO
|
|
197
|
+
with a store of your storage: nothing verifies them by night, and a restart loses them.{{/if}}{{#if audit.sql}}
|
|
198
|
+
Every night at 04:30 UTC the job `audit.verify` verifies every chain from its last archive{{#if audit.archive}}, every archive read
|
|
199
|
+
back from the storage and proved against its row,{{/if}} to its head: an entry
|
|
200
|
+
changed, removed, reordered or cut from the end of its chain fails the run, and the log names the chain and the
|
|
201
|
+
sequence (`AuditTrailBrokenError`). `JOB_AUDIT_VERIFY_ENABLED=false` switches it off in one environment.{{/if}}{{#if audit.archive}}
|
|
202
|
+
On the first day of every month at 04:00 UTC, `audit.archive` moves the entries older than twelve whole months to the
|
|
203
|
+
storage of files, verified and anchored.{{/if}}{{#if audit.sql}}
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npm run audit:verify # the same verification, by hand: exit code 1 on a break
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
This project runs its migrations and the application with one database role, which owns the tables of the trail and
|
|
210
|
+
can drop their guard. In production, migrate with an owner role and give the application the grants of the README of
|
|
211
|
+
`@ddd-ts-kit/audit` ("Append-only in the database too"){{#if audit.archive}}, and the archive a role of its own{{/if}}.{{/if}}
|
|
212
|
+
{{/if}}
|
|
189
213
|
{{#if files.any}}
|
|
190
214
|
|
|
191
215
|
## Files
|
|
@@ -289,8 +313,8 @@ and their lines here. Two scripts answer the requests of a person, on the source
|
|
|
289
313
|
variables of `.env`:
|
|
290
314
|
|
|
291
315
|
```bash
|
|
292
|
-
npm run privacy:erase -- <subject-id> --operator <who-asks> # {{#if eventSourcing.on}}the key, then {{/if}}every declared copy{{#if tenancy.any}}, in each tenant of TENANTS{{/if}}
|
|
293
|
-
npm run privacy:export -- <subject-id> > export.json # one dated document of every declared record{{#if audit.on}}, audited{{/if}}
|
|
316
|
+
npm run privacy:erase -- <subject-id> --operator <who-asks> # {{#if eventSourcing.on}}the key, then {{/if}}every declared copy{{#if tenancy.any}}, in each tenant of TENANTS{{/if}}{{#if housekeeping.any}}, then what the platform keeps of the person{{/if}}
|
|
317
|
+
npm run privacy:export -- <subject-id> > export.json # one dated document of every declared record{{#if eventSourcing.on}} and every value the event store keeps sealed for the person{{/if}}{{#if audit.on}}, audited{{/if}}
|
|
294
318
|
npm run privacy:purge # what outlived its retention, as the nightly job does
|
|
295
319
|
```
|
|
296
320
|
|
|
@@ -298,9 +322,18 @@ A declaration with `retention` (`generate repository ... --retention ended_at:36
|
|
|
298
322
|
03:00 UTC by the job `privacy.purge-expired`{{#if audit.on}}, each purge recorded in the audit trail{{/if}}; `JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false`
|
|
299
323
|
switches it off in one environment. How long is your decision: write it in your register with its reason.
|
|
300
324
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
325
|
+
An erasure that reached nothing is refused with exit code 1 and announced to nobody: a mistyped id{{#if tenancy.any}}, a tenant
|
|
326
|
+
`TENANTS` does not list{{/if}}, or a person already erased. `--rerun` says it is expected, and announces the erasure again, which
|
|
327
|
+
completes one that failed half way.{{#if audit.on}} Every run of either script is recorded in the audit trail, operator
|
|
328
|
+
included, a trial too: try them on a test subject, never on a real person.{{/if}}
|
|
329
|
+
{{#if housekeeping.any}}
|
|
330
|
+
The platform keeps its own traces of a person for a while: {{#if events.outbox}}a record of the outbox holds its payload for `OUTBOX_RETENTION_DAYS` once
|
|
331
|
+
published (`events.purge-published`, every night){{/if}}{{#if events.outbox}}{{#if queue.stored}}, {{/if}}{{/if}}{{#if queue.stored}}a finished job for `BACKGROUND_JOBS_RETENTION_DAYS` (`jobs.purge-finished`){{/if}}. An erasure reaches them earlier:
|
|
332
|
+
{{#if events.outbox}}the fields the `personal` option of an event lists, in `{{config.platformDir}}/privacy/personal-events.ts`, which `ddd-ts-kit docs` writes{{/if}}{{#if events.outbox}}{{#if queue.stored}}, and {{/if}}{{/if}}{{#if queue.stored}}the jobs enqueued with
|
|
333
|
+
the person as `subject`{{/if}}.
|
|
334
|
+
|
|
335
|
+
{{/if}}
|
|
336
|
+
Neither script reaches backups, logs, exports or a copy no context declared{{#if housekeeping.any}}, nor a message already delivered, an event with no `personal` option or a job enqueued without `subject`{{/if}}: say so in your register{{#if eventSourcing.on}}, and keep the keys in a
|
|
304
337
|
store of their own in production, with a shorter backup retention than the events
|
|
305
338
|
(docs/concepts/event-sourcing.md of ddd-ts-kit, "Personal data"){{/if}}.
|
|
306
339
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
# Local infrastructure. `npm run infra:up` starts it and waits until it is healthy
|
|
2
|
-
#
|
|
1
|
+
# Local infrastructure. `npm run infra:up` starts it and waits until it is healthy. A profile starts more, and the flag goes before `up`:
|
|
2
|
+
# docker compose --profile observability up -d --wait # Jaeger{{#if authn.keycloak}}
|
|
3
|
+
# docker compose --profile identity up -d --wait # Keycloak{{/if}}{{#if errors.sentry}}
|
|
4
|
+
# docker compose --profile errors up -d --wait # GlitchTip{{/if}}
|
|
5
|
+
# Ports come from .env (see .env.example).
|
|
3
6
|
# Every port is published on 127.0.0.1 only: the credentials below are for this machine. To reach a service from another
|
|
4
7
|
# machine on purpose, write the address to listen on in its entry ("0.0.0.0:5432:5432"), never with these credentials.
|
|
5
8
|
name: {{project.name}}
|
|
@@ -29,6 +29,14 @@ LOG_LEVEL=info
|
|
|
29
29
|
{{#if worker.on}}
|
|
30
30
|
# RUN_JOBS=false
|
|
31
31
|
{{/if}}
|
|
32
|
+
{{#if events.outbox}}
|
|
33
|
+
# Days a published event stays in the outbox, its payload with it, before the job events.purge-published drops it.
|
|
34
|
+
# OUTBOX_RETENTION_DAYS=30
|
|
35
|
+
{{/if}}
|
|
36
|
+
{{#if queue.stored}}
|
|
37
|
+
# Days a job that succeeded or was cancelled stays in its store, before the job jobs.purge-finished drops it.
|
|
38
|
+
# BACKGROUND_JOBS_RETENTION_DAYS=30
|
|
39
|
+
{{/if}}
|
|
32
40
|
{{#if database.postgres}}
|
|
33
41
|
|
|
34
42
|
POSTGRES_USER=app
|
|
@@ -54,6 +62,13 @@ DATABASE_URL=mysql://app:app@localhost:3306/app
|
|
|
54
62
|
DATABASE_URL=file:./data/app.sqlite
|
|
55
63
|
{{/if}}
|
|
56
64
|
{{/if}}
|
|
65
|
+
{{#if orm.prisma}}
|
|
66
|
+
# How long a unit of work waits for its transaction, and how long the transaction may run, beyond
|
|
67
|
+
# which it is answered 503. Not more: a caller gives up near 30 s, and a connection held for an
|
|
68
|
+
# answer nobody reads sheds no load.
|
|
69
|
+
DATABASE_TRANSACTION_WAIT_MS=10000
|
|
70
|
+
DATABASE_TRANSACTION_TIMEOUT_MS=30000
|
|
71
|
+
{{/if}}
|
|
57
72
|
{{#if events.outbox}}
|
|
58
73
|
OUTBOX_RELAY_INTERVAL_MS=500
|
|
59
74
|
{{/if}}
|
|
@@ -136,7 +151,7 @@ KEYCLOAK_AUDIENCE={{project.name}}-api
|
|
|
136
151
|
{{/if}}
|
|
137
152
|
{{#if authn.none}}
|
|
138
153
|
|
|
139
|
-
# Authentication is the development header (x-development-actor: <id>;roles=<a>,<b>): the application
|
|
154
|
+
# Authentication is the development header (x-development-actor: <id>;roles=<a>,<b>): the application starts with NODE_ENV=development or test only, never without it.
|
|
140
155
|
{{/if}}
|
|
141
156
|
{{#if errors.sentry}}
|
|
142
157
|
|