ddd-ts-kit 0.88.0 → 0.90.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 +626 -0
- package/README.fr.md +86 -31
- package/README.md +81 -28
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +4 -1
- package/dist/check/canonical/roles.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +12 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/catalogue/default-severities.d.ts.map +1 -1
- package/dist/check/catalogue/default-severities.js +5 -0
- package/dist/check/catalogue/default-severities.js.map +1 -1
- package/dist/check/catalogue/delegated-rules.js +1 -1
- package/dist/check/catalogue/delegated-rules.js.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.js +24 -0
- package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
- package/dist/check/configuration/config-inspection.d.ts +2 -2
- package/dist/check/configuration/config-inspection.d.ts.map +1 -1
- package/dist/check/configuration/config-inspection.js +5 -4
- package/dist/check/configuration/config-inspection.js.map +1 -1
- package/dist/check/configuration/measure-settings.d.ts +10 -0
- package/dist/check/configuration/measure-settings.d.ts.map +1 -0
- package/dist/check/configuration/measure-settings.js +17 -0
- package/dist/check/configuration/measure-settings.js.map +1 -0
- package/dist/check/explain/privacy-docs.d.ts +3 -0
- package/dist/check/explain/privacy-docs.d.ts.map +1 -0
- package/dist/check/explain/privacy-docs.js +52 -0
- package/dist/check/explain/privacy-docs.js.map +1 -0
- package/dist/check/explain/rule-docs.d.ts.map +1 -1
- package/dist/check/explain/rule-docs.js +2 -0
- package/dist/check/explain/rule-docs.js.map +1 -1
- package/dist/check/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/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +11 -0
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.js +1 -1
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/budget-fixtures.d.ts +3 -0
- package/dist/check/fixtures/budget-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/budget-fixtures.js +43 -0
- package/dist/check/fixtures/budget-fixtures.js.map +1 -0
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +17 -3
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +6 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/mutation-fixtures.d.ts +3 -0
- package/dist/check/fixtures/mutation-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/mutation-fixtures.js +81 -0
- package/dist/check/fixtures/mutation-fixtures.js.map +1 -0
- package/dist/check/fixtures/privacy-fixtures.d.ts +3 -0
- package/dist/check/fixtures/privacy-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/privacy-fixtures.js +198 -0
- package/dist/check/fixtures/privacy-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-bypass.d.ts +24 -0
- package/dist/check/fixtures/tenancy-bypass.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-bypass.js +22 -0
- package/dist/check/fixtures/tenancy-bypass.js.map +1 -0
- package/dist/check/fixtures/tenancy-config.d.ts +3 -0
- package/dist/check/fixtures/tenancy-config.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-config.js +7 -0
- package/dist/check/fixtures/tenancy-config.js.map +1 -0
- package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-fixtures.js +31 -41
- package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
- package/dist/check/fixtures/tenancy-prisma-fixtures.d.ts +4 -0
- package/dist/check/fixtures/tenancy-prisma-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-prisma-fixtures.js +73 -0
- package/dist/check/fixtures/tenancy-prisma-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.d.ts +4 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.js +88 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.js.map +1 -0
- package/dist/check/mutation/stryker-settings.d.ts +8 -0
- package/dist/check/mutation/stryker-settings.d.ts.map +1 -0
- package/dist/check/mutation/stryker-settings.js +74 -0
- package/dist/check/mutation/stryker-settings.js.map +1 -0
- package/dist/check/privacy/column-definitions-in.d.ts +15 -0
- package/dist/check/privacy/column-definitions-in.d.ts.map +1 -0
- package/dist/check/privacy/column-definitions-in.js +32 -0
- package/dist/check/privacy/column-definitions-in.js.map +1 -0
- package/dist/check/privacy/declares-name.d.ts +4 -0
- package/dist/check/privacy/declares-name.d.ts.map +1 -0
- package/dist/check/privacy/declares-name.js +7 -0
- package/dist/check/privacy/declares-name.js.map +1 -0
- package/dist/check/privacy/personal-declarations-of.d.ts +15 -0
- package/dist/check/privacy/personal-declarations-of.d.ts.map +1 -0
- package/dist/check/privacy/personal-declarations-of.js +33 -0
- package/dist/check/privacy/personal-declarations-of.js.map +1 -0
- package/dist/check/privacy/personal-term-of.d.ts +3 -0
- package/dist/check/privacy/personal-term-of.d.ts.map +1 -0
- package/dist/check/privacy/personal-term-of.js +10 -0
- package/dist/check/privacy/personal-term-of.js.map +1 -0
- package/dist/check/privacy/personal-vocabulary.d.ts +9 -0
- package/dist/check/privacy/personal-vocabulary.d.ts.map +1 -0
- package/dist/check/privacy/personal-vocabulary.js +37 -0
- package/dist/check/privacy/personal-vocabulary.js.map +1 -0
- package/dist/check/privacy/prisma-columns-of.d.ts +17 -0
- package/dist/check/privacy/prisma-columns-of.d.ts.map +1 -0
- package/dist/check/privacy/prisma-columns-of.js +58 -0
- package/dist/check/privacy/prisma-columns-of.js.map +1 -0
- package/dist/check/privacy/privacy-judged.d.ts +8 -0
- package/dist/check/privacy/privacy-judged.d.ts.map +1 -0
- package/dist/check/privacy/privacy-judged.js +9 -0
- package/dist/check/privacy/privacy-judged.js.map +1 -0
- package/dist/check/privacy/published-events-of.d.ts +29 -0
- package/dist/check/privacy/published-events-of.d.ts.map +1 -0
- package/dist/check/privacy/published-events-of.js +80 -0
- package/dist/check/privacy/published-events-of.js.map +1 -0
- package/dist/check/privacy/same-name.d.ts +3 -0
- package/dist/check/privacy/same-name.d.ts.map +1 -0
- package/dist/check/privacy/same-name.js +6 -0
- package/dist/check/privacy/same-name.js.map +1 -0
- package/dist/check/privacy/vocabulary-of.d.ts +4 -0
- package/dist/check/privacy/vocabulary-of.d.ts.map +1 -0
- package/dist/check/privacy/vocabulary-of.js +10 -0
- package/dist/check/privacy/vocabulary-of.js.map +1 -0
- package/dist/check/privacy/words-of-name.d.ts +3 -0
- package/dist/check/privacy/words-of-name.d.ts.map +1 -0
- package/dist/check/privacy/words-of-name.js +9 -0
- package/dist/check/privacy/words-of-name.js.map +1 -0
- package/dist/check/rules/config-valid.js +1 -1
- package/dist/check/rules/config-valid.js.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.js +21 -2
- package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -1
- package/dist/check/rules/governance-recorded-deviation.d.ts.map +1 -1
- package/dist/check/rules/governance-recorded-deviation.js +20 -2
- package/dist/check/rules/governance-recorded-deviation.js.map +1 -1
- package/dist/check/rules/privacy-declared-field.d.ts +11 -0
- package/dist/check/rules/privacy-declared-field.d.ts.map +1 -0
- package/dist/check/rules/privacy-declared-field.js +63 -0
- package/dist/check/rules/privacy-declared-field.js.map +1 -0
- package/dist/check/rules/privacy-erasure-reaches-copies.d.ts +10 -0
- package/dist/check/rules/privacy-erasure-reaches-copies.d.ts.map +1 -0
- package/dist/check/rules/privacy-erasure-reaches-copies.js +46 -0
- package/dist/check/rules/privacy-erasure-reaches-copies.js.map +1 -0
- package/dist/check/rules/privacy-event-payload-declared.d.ts +10 -0
- package/dist/check/rules/privacy-event-payload-declared.d.ts.map +1 -0
- package/dist/check/rules/privacy-event-payload-declared.js +39 -0
- package/dist/check/rules/privacy-event-payload-declared.js.map +1 -0
- package/dist/check/rules/privacy-no-personal-data-in-logs.d.ts +12 -0
- package/dist/check/rules/privacy-no-personal-data-in-logs.d.ts.map +1 -0
- package/dist/check/rules/privacy-no-personal-data-in-logs.js +57 -0
- package/dist/check/rules/privacy-no-personal-data-in-logs.js.map +1 -0
- package/dist/check/rules/privacy-subject-is-opaque.d.ts +9 -0
- package/dist/check/rules/privacy-subject-is-opaque.d.ts.map +1 -0
- package/dist/check/rules/privacy-subject-is-opaque.js +50 -0
- package/dist/check/rules/privacy-subject-is-opaque.js.map +1 -0
- package/dist/check/rules/tenancy-scoped-statement.d.ts.map +1 -1
- package/dist/check/rules/tenancy-scoped-statement.js +6 -2
- package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
- package/dist/check/rules/test-mutation-governed.d.ts +3 -0
- package/dist/check/rules/test-mutation-governed.d.ts.map +1 -0
- package/dist/check/rules/test-mutation-governed.js +12 -0
- package/dist/check/rules/test-mutation-governed.js.map +1 -0
- package/dist/check/tenancy/accessor-uses.d.ts +13 -0
- package/dist/check/tenancy/accessor-uses.d.ts.map +1 -0
- package/dist/check/tenancy/accessor-uses.js +19 -0
- package/dist/check/tenancy/accessor-uses.js.map +1 -0
- package/dist/check/tenancy/declaration-of.d.ts +7 -0
- package/dist/check/tenancy/declaration-of.d.ts.map +1 -0
- package/dist/check/tenancy/declaration-of.js +11 -0
- package/dist/check/tenancy/declaration-of.js.map +1 -0
- package/dist/check/tenancy/declared-in-arguments.d.ts +13 -0
- package/dist/check/tenancy/declared-in-arguments.d.ts.map +1 -0
- package/dist/check/tenancy/declared-in-arguments.js +25 -0
- package/dist/check/tenancy/declared-in-arguments.js.map +1 -0
- package/dist/check/tenancy/declared-with.d.ts +3 -1
- package/dist/check/tenancy/declared-with.d.ts.map +1 -1
- package/dist/check/tenancy/declared-with.js +4 -3
- package/dist/check/tenancy/declared-with.js.map +1 -1
- package/dist/check/tenancy/drizzle-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/drizzle-unscoped.js +4 -3
- package/dist/check/tenancy/drizzle-unscoped.js.map +1 -1
- package/dist/check/tenancy/executor-uses.d.ts +3 -10
- package/dist/check/tenancy/executor-uses.d.ts.map +1 -1
- package/dist/check/tenancy/executor-uses.js +3 -11
- package/dist/check/tenancy/executor-uses.js.map +1 -1
- package/dist/check/tenancy/prisma-unscoped.d.ts +7 -0
- package/dist/check/tenancy/prisma-unscoped.d.ts.map +1 -0
- package/dist/check/tenancy/prisma-unscoped.js +60 -0
- package/dist/check/tenancy/prisma-unscoped.js.map +1 -0
- package/dist/check/tenancy/typeorm-unscoped.d.ts +7 -0
- package/dist/check/tenancy/typeorm-unscoped.d.ts.map +1 -0
- package/dist/check/tenancy/typeorm-unscoped.js +103 -0
- package/dist/check/tenancy/typeorm-unscoped.js.map +1 -0
- package/dist/check/tenancy/unscoped-read-models.js +2 -2
- package/dist/check/tenancy/unscoped-read-models.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +23 -1
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +4 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/generate.js +9 -1
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +4 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.d.ts +3 -2
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +16 -4
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/mutation.d.ts +14 -0
- package/dist/commands/mutation.d.ts.map +1 -0
- package/dist/commands/mutation.js +62 -0
- package/dist/commands/mutation.js.map +1 -0
- package/dist/config/budget-levels.d.ts +3 -0
- package/dist/config/budget-levels.d.ts.map +1 -0
- package/dist/config/budget-levels.js +3 -0
- package/dist/config/budget-levels.js.map +1 -0
- package/dist/config/budget-problems.d.ts +10 -0
- package/dist/config/budget-problems.d.ts.map +1 -0
- package/dist/config/budget-problems.js +61 -0
- package/dist/config/budget-problems.js.map +1 -0
- package/dist/config/budget.d.ts +10 -0
- package/dist/config/budget.d.ts.map +1 -0
- package/dist/config/budget.js +2 -0
- package/dist/config/budget.js.map +1 -0
- package/dist/config/config.d.ts +16 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/index.d.ts +7 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +7 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/is-duration.d.ts +3 -0
- package/dist/config/is-duration.d.ts.map +1 -0
- package/dist/config/is-duration.js +5 -0
- package/dist/config/is-duration.js.map +1 -0
- package/dist/config/is-reference-budget.d.ts +4 -0
- package/dist/config/is-reference-budget.d.ts.map +1 -0
- package/dist/config/is-reference-budget.js +8 -0
- package/dist/config/is-reference-budget.js.map +1 -0
- package/dist/config/is-reference-mutation.d.ts +4 -0
- package/dist/config/is-reference-mutation.d.ts.map +1 -0
- package/dist/config/is-reference-mutation.js +7 -0
- package/dist/config/is-reference-mutation.js.map +1 -0
- package/dist/config/mutation-layers.d.ts +3 -0
- package/dist/config/mutation-layers.d.ts.map +1 -0
- package/dist/config/mutation-layers.js +3 -0
- package/dist/config/mutation-layers.js.map +1 -0
- package/dist/config/mutation-problems.d.ts +10 -0
- package/dist/config/mutation-problems.d.ts.map +1 -0
- package/dist/config/mutation-problems.js +46 -0
- package/dist/config/mutation-problems.js.map +1 -0
- package/dist/config/mutation.d.ts +4 -0
- package/dist/config/mutation.d.ts.map +1 -0
- package/dist/config/mutation.js +2 -0
- package/dist/config/mutation.js.map +1 -0
- package/dist/config/parse-budget.d.ts +4 -0
- package/dist/config/parse-budget.d.ts.map +1 -0
- package/dist/config/parse-budget.js +17 -0
- package/dist/config/parse-budget.js.map +1 -0
- package/dist/config/parse-config.d.ts.map +1 -1
- package/dist/config/parse-config.js +6 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/parse-mutation.d.ts +4 -0
- package/dist/config/parse-mutation.d.ts.map +1 -0
- package/dist/config/parse-mutation.js +16 -0
- package/dist/config/parse-mutation.js.map +1 -0
- package/dist/config/parse-privacy.d.ts +4 -0
- package/dist/config/parse-privacy.d.ts.map +1 -0
- package/dist/config/parse-privacy.js +12 -0
- package/dist/config/parse-privacy.js.map +1 -0
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +4 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/reference-budget.d.ts +8 -0
- package/dist/config/reference-budget.d.ts.map +1 -0
- package/dist/config/reference-budget.js +7 -0
- package/dist/config/reference-budget.js.map +1 -0
- package/dist/config/reference-mutation.d.ts +10 -0
- package/dist/config/reference-mutation.d.ts.map +1 -0
- package/dist/config/reference-mutation.js +9 -0
- package/dist/config/reference-mutation.js.map +1 -0
- package/dist/config/serialize-config.d.ts.map +1 -1
- package/dist/config/serialize-config.js +13 -1
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +17 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +2 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/docs/behaviour-page.d.ts +8 -0
- package/dist/docs/behaviour-page.d.ts.map +1 -0
- package/dist/docs/behaviour-page.js +83 -0
- package/dist/docs/behaviour-page.js.map +1 -0
- package/dist/docs/context-facts.d.ts +8 -0
- package/dist/docs/context-facts.d.ts.map +1 -1
- package/dist/docs/counts-of.d.ts +10 -0
- package/dist/docs/counts-of.d.ts.map +1 -0
- package/dist/docs/counts-of.js +14 -0
- package/dist/docs/counts-of.js.map +1 -0
- package/dist/docs/declared-table-of.d.ts +14 -0
- package/dist/docs/declared-table-of.d.ts.map +1 -0
- package/dist/docs/declared-table-of.js +39 -0
- package/dist/docs/declared-table-of.js.map +1 -0
- package/dist/docs/ensure-personal-data-region.d.ts +7 -0
- package/dist/docs/ensure-personal-data-region.d.ts.map +1 -0
- package/dist/docs/ensure-personal-data-region.js +21 -0
- package/dist/docs/ensure-personal-data-region.js.map +1 -0
- package/dist/docs/page-section.d.ts +12 -0
- package/dist/docs/page-section.d.ts.map +1 -0
- package/dist/docs/page-section.js +2 -0
- package/dist/docs/page-section.js.map +1 -0
- package/dist/docs/personal-data-lines.d.ts +7 -0
- package/dist/docs/personal-data-lines.d.ts.map +1 -0
- package/dist/docs/personal-data-lines.js +29 -0
- package/dist/docs/personal-data-lines.js.map +1 -0
- package/dist/docs/personal-declarations-in.d.ts +13 -0
- package/dist/docs/personal-declarations-in.d.ts.map +1 -0
- package/dist/docs/personal-declarations-in.js +66 -0
- package/dist/docs/personal-declarations-in.js.map +1 -0
- package/dist/docs/personal-table-cells.d.ts +12 -0
- package/dist/docs/personal-table-cells.d.ts.map +1 -0
- package/dist/docs/personal-table-cells.js +13 -0
- package/dist/docs/personal-table-cells.js.map +1 -0
- package/dist/docs/personal-table-facts.d.ts +17 -0
- package/dist/docs/personal-table-facts.d.ts.map +1 -0
- package/dist/docs/personal-table-facts.js +2 -0
- package/dist/docs/personal-table-facts.js.map +1 -0
- package/dist/docs/privacy-register-lines.d.ts +7 -0
- package/dist/docs/privacy-register-lines.d.ts.map +1 -0
- package/dist/docs/privacy-register-lines.js +34 -0
- package/dist/docs/privacy-register-lines.js.map +1 -0
- package/dist/docs/read-context.d.ts.map +1 -1
- package/dist/docs/read-context.js +17 -1
- package/dist/docs/read-context.js.map +1 -1
- package/dist/docs/read-personal-data.d.ts +12 -0
- package/dist/docs/read-personal-data.d.ts.map +1 -0
- package/dist/docs/read-personal-data.js +22 -0
- package/dist/docs/read-personal-data.js.map +1 -0
- package/dist/docs/refresh-context-doc.d.ts.map +1 -1
- package/dist/docs/refresh-context-doc.js +9 -1
- package/dist/docs/refresh-context-doc.js.map +1 -1
- package/dist/docs/rules-in.d.ts +25 -0
- package/dist/docs/rules-in.d.ts.map +1 -0
- package/dist/docs/rules-in.js +83 -0
- package/dist/docs/rules-in.js.map +1 -0
- package/dist/docs/write-behaviour.d.ts +10 -0
- package/dist/docs/write-behaviour.d.ts.map +1 -0
- package/dist/docs/write-behaviour.js +97 -0
- package/dist/docs/write-behaviour.js.map +1 -0
- package/dist/docs/write-docs.d.ts +12 -2
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +8 -2
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/docs/write-privacy-register.d.ts +9 -0
- package/dist/docs/write-privacy-register.d.ts.map +1 -0
- package/dist/docs/write-privacy-register.js +26 -0
- package/dist/docs/write-privacy-register.js.map +1 -0
- package/dist/doctor/diagnose.d.ts +2 -1
- package/dist/doctor/diagnose.d.ts.map +1 -1
- package/dist/doctor/diagnose.js +4 -1
- package/dist/doctor/diagnose.js.map +1 -1
- package/dist/doctor/doctor-finding.d.ts +3 -2
- package/dist/doctor/doctor-finding.d.ts.map +1 -1
- package/dist/doctor/format-diagnosis.js +4 -1
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/override-findings.d.ts +10 -0
- package/dist/doctor/override-findings.d.ts.map +1 -0
- package/dist/doctor/override-findings.js +87 -0
- package/dist/doctor/override-findings.js.map +1 -0
- package/dist/generate/kind.d.ts +14 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/acceptance-kind.js +5 -1
- package/dist/generate/kinds/acceptance-kind.js.map +1 -1
- package/dist/generate/kinds/background/spec-family.d.ts +8 -0
- package/dist/generate/kinds/background/spec-family.d.ts.map +1 -0
- package/dist/generate/kinds/background/spec-family.js +9 -0
- package/dist/generate/kinds/background/spec-family.js.map +1 -0
- package/dist/generate/kinds/background-job-kind.d.ts.map +1 -1
- package/dist/generate/kinds/background-job-kind.js +6 -4
- package/dist/generate/kinds/background-job-kind.js.map +1 -1
- package/dist/generate/kinds/command-kind.d.ts.map +1 -1
- package/dist/generate/kinds/command-kind.js +4 -0
- package/dist/generate/kinds/command-kind.js.map +1 -1
- package/dist/generate/kinds/erasure-handler-kind.d.ts +3 -0
- package/dist/generate/kinds/erasure-handler-kind.d.ts.map +1 -0
- package/dist/generate/kinds/erasure-handler-kind.js +46 -0
- package/dist/generate/kinds/erasure-handler-kind.js.map +1 -0
- package/dist/generate/kinds/generate-repository.d.ts +2 -1
- package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
- package/dist/generate/kinds/generate-repository.js +14 -11
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/personal-data/class-header.d.ts +3 -0
- package/dist/generate/kinds/personal-data/class-header.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/class-header.js +7 -0
- package/dist/generate/kinds/personal-data/class-header.js.map +1 -0
- package/dist/generate/kinds/personal-data/column-lines.d.ts +4 -0
- package/dist/generate/kinds/personal-data/column-lines.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/column-lines.js +5 -0
- package/dist/generate/kinds/personal-data/column-lines.js.map +1 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.d.ts +12 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.js +73 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.js.map +1 -0
- package/dist/generate/kinds/personal-data/fields-line.d.ts +3 -0
- package/dist/generate/kinds/personal-data/fields-line.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/fields-line.js +7 -0
- package/dist/generate/kinds/personal-data/fields-line.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-column.d.ts +7 -0
- package/dist/generate/kinds/personal-data/personal-column.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-column.js +5 -0
- package/dist/generate/kinds/personal-data/personal-column.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-names.d.ts +21 -0
- package/dist/generate/kinds/personal-data/personal-names.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-names.js +41 -0
- package/dist/generate/kinds/personal-data/personal-names.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-request-of.d.ts +18 -0
- package/dist/generate/kinds/personal-data/personal-request-of.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-request-of.js +109 -0
- package/dist/generate/kinds/personal-data/personal-request-of.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-vars.d.ts +9 -0
- package/dist/generate/kinds/personal-data/personal-vars.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-vars.js +107 -0
- package/dist/generate/kinds/personal-data/personal-vars.js.map +1 -0
- package/dist/generate/kinds/personal-data/property-of.d.ts +3 -0
- package/dist/generate/kinds/personal-data/property-of.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/property-of.js +5 -0
- package/dist/generate/kinds/personal-data/property-of.js.map +1 -0
- package/dist/generate/kinds/personal-data/row-object.d.ts +3 -0
- package/dist/generate/kinds/personal-data/row-object.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/row-object.js +5 -0
- package/dist/generate/kinds/personal-data/row-object.js.map +1 -0
- package/dist/generate/kinds/process-kind.d.ts.map +1 -1
- package/dist/generate/kinds/process-kind.js +5 -3
- package/dist/generate/kinds/process-kind.js.map +1 -1
- package/dist/generate/kinds/repository-kind.d.ts.map +1 -1
- package/dist/generate/kinds/repository-kind.js +6 -3
- package/dist/generate/kinds/repository-kind.js.map +1 -1
- package/dist/generate/kinds/repository-prefix.d.ts +5 -0
- package/dist/generate/kinds/repository-prefix.d.ts.map +1 -0
- package/dist/generate/kinds/repository-prefix.js +11 -0
- package/dist/generate/kinds/repository-prefix.js.map +1 -0
- package/dist/generate/kinds/state-machine/state-machine-vars.js +3 -1
- package/dist/generate/kinds/state-machine/state-machine-vars.js.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts +10 -0
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -0
- package/dist/generate/kinds/wire-repository-on-first-use.js +14 -0
- package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -0
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts +2 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js +13 -2
- package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/refresh-docs.d.ts +2 -1
- package/dist/generate/refresh-docs.d.ts.map +1 -1
- package/dist/generate/refresh-docs.js +2 -2
- package/dist/generate/refresh-docs.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +19 -1
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +4 -3
- package/dist/help/usage.js.map +1 -1
- package/dist/init/files/event-sourcing-files.d.ts +9 -0
- package/dist/init/files/event-sourcing-files.d.ts.map +1 -0
- package/dist/init/files/event-sourcing-files.js +18 -0
- package/dist/init/files/event-sourcing-files.js.map +1 -0
- package/dist/init/files/init-files.d.ts.map +1 -1
- package/dist/init/files/init-files.js +4 -0
- package/dist/init/files/init-files.js.map +1 -1
- package/dist/init/files/platform-files.js +6 -1
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/files/privacy-files.d.ts +10 -0
- package/dist/init/files/privacy-files.d.ts.map +1 -0
- package/dist/init/files/privacy-files.js +24 -0
- package/dist/init/files/privacy-files.js.map +1 -0
- package/dist/init/files/project-files.d.ts.map +1 -1
- package/dist/init/files/project-files.js +5 -0
- package/dist/init/files/project-files.js.map +1 -1
- package/dist/init/files/script-files.d.ts +1 -0
- package/dist/init/files/script-files.d.ts.map +1 -1
- package/dist/init/files/script-files.js +8 -0
- package/dist/init/files/script-files.js.map +1 -1
- package/dist/init/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +1 -0
- 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 +9 -3
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +6 -2
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/overrides-for.d.ts +7 -0
- package/dist/init/manifest/overrides-for.d.ts.map +1 -0
- package/dist/init/manifest/overrides-for.js +9 -0
- package/dist/init/manifest/overrides-for.js.map +1 -0
- package/dist/init/manifest/pinned-below-a-fix.d.ts +14 -0
- package/dist/init/manifest/pinned-below-a-fix.d.ts.map +1 -0
- package/dist/init/manifest/pinned-below-a-fix.js +20 -0
- package/dist/init/manifest/pinned-below-a-fix.js.map +1 -0
- package/dist/init/manifest/scripts-for.js +17 -0
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/test-scripts.d.ts.map +1 -1
- package/dist/init/manifest/test-scripts.js +3 -0
- package/dist/init/manifest/test-scripts.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +28 -25
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/manifest/write-overrides.d.ts +9 -0
- package/dist/init/manifest/write-overrides.d.ts.map +1 -0
- package/dist/init/manifest/write-overrides.js +56 -0
- package/dist/init/manifest/write-overrides.js.map +1 -0
- package/dist/init/rewire-personal-data.d.ts +10 -0
- package/dist/init/rewire-personal-data.d.ts.map +1 -0
- package/dist/init/rewire-personal-data.js +32 -0
- package/dist/init/rewire-personal-data.js.map +1 -0
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +8 -3
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-personal-data.d.ts +10 -0
- package/dist/init/stack/resolve-personal-data.d.ts.map +1 -0
- package/dist/init/stack/resolve-personal-data.js +22 -0
- package/dist/init/stack/resolve-personal-data.js.map +1 -0
- package/dist/init/stack/resolve-queue.d.ts +4 -3
- package/dist/init/stack/resolve-queue.d.ts.map +1 -1
- package/dist/init/stack/resolve-queue.js +6 -8
- package/dist/init/stack/resolve-queue.js.map +1 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +2 -0
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/resolve-tenancy.d.ts +3 -3
- package/dist/init/stack/resolve-tenancy.js +5 -5
- package/dist/init/stack/resolve-tenancy.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +4 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/write-contracts.d.ts +2 -1
- package/dist/init/write-contracts.d.ts.map +1 -1
- package/dist/init/write-contracts.js +6 -3
- package/dist/init/write-contracts.js.map +1 -1
- package/dist/lint/eslint-in-project.d.ts +3 -2
- package/dist/lint/eslint-in-project.d.ts.map +1 -1
- package/dist/lint/eslint-in-project.js +5 -3
- package/dist/lint/eslint-in-project.js.map +1 -1
- package/dist/lint/lint-cache-of.d.ts +7 -0
- package/dist/lint/lint-cache-of.d.ts.map +1 -0
- package/dist/lint/lint-cache-of.js +47 -0
- package/dist/lint/lint-cache-of.js.map +1 -0
- package/dist/lint/lint-run.d.ts +2 -0
- package/dist/lint/lint-run.d.ts.map +1 -1
- package/dist/mutation/changed-files.d.ts +7 -0
- package/dist/mutation/changed-files.d.ts.map +1 -0
- package/dist/mutation/changed-files.js +15 -0
- package/dist/mutation/changed-files.js.map +1 -0
- package/dist/mutation/format-mutation.d.ts +4 -0
- package/dist/mutation/format-mutation.d.ts.map +1 -0
- package/dist/mutation/format-mutation.js +29 -0
- package/dist/mutation/format-mutation.js.map +1 -0
- package/dist/mutation/format-survivors.d.ts +8 -0
- package/dist/mutation/format-survivors.d.ts.map +1 -0
- package/dist/mutation/format-survivors.js +19 -0
- package/dist/mutation/format-survivors.js.map +1 -0
- package/dist/mutation/mutation-report-file.d.ts +3 -0
- package/dist/mutation/mutation-report-file.d.ts.map +1 -0
- package/dist/mutation/mutation-report-file.js +3 -0
- package/dist/mutation/mutation-report-file.js.map +1 -0
- package/dist/mutation/mutation-scores.d.ts +35 -0
- package/dist/mutation/mutation-scores.d.ts.map +1 -0
- package/dist/mutation/mutation-scores.js +55 -0
- package/dist/mutation/mutation-scores.js.map +1 -0
- package/dist/mutation/read-mutation-report.d.ts +16 -0
- package/dist/mutation/read-mutation-report.d.ts.map +1 -0
- package/dist/mutation/read-mutation-report.js +38 -0
- package/dist/mutation/read-mutation-report.js.map +1 -0
- package/dist/mutation/survivors.d.ts +19 -0
- package/dist/mutation/survivors.d.ts.map +1 -0
- package/dist/mutation/survivors.js +24 -0
- package/dist/mutation/survivors.js.map +1 -0
- package/dist/platform-layout/platform-layout.d.ts +2 -0
- package/dist/platform-layout/platform-layout.d.ts.map +1 -1
- package/dist/platform-layout/platform-layout.js +2 -0
- package/dist/platform-layout/platform-layout.js.map +1 -1
- package/dist/presets/apply-preset.js +2 -1
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-preset.d.ts.map +1 -1
- package/dist/presets/identity-preset.js +17 -1
- package/dist/presets/identity-preset.js.map +1 -1
- package/dist/presets/preset-files.d.ts.map +1 -1
- package/dist/presets/preset-files.js +1 -0
- package/dist/presets/preset-files.js.map +1 -1
- package/dist/presets/preset-step.d.ts +3 -1
- package/dist/presets/preset-step.d.ts.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -0
- package/dist/run.js.map +1 -1
- package/dist/stack/audit-vars.d.ts +1 -1
- package/dist/stack/audit-vars.d.ts.map +1 -1
- package/dist/stack/audit-vars.js +26 -8
- package/dist/stack/audit-vars.js.map +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +45 -3
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -2
- package/templates/background-job/background-job.spec.buses.ts.tpl +57 -0
- package/templates/background-job/wiring.manual.tpl +4 -0
- package/templates/context/CONTEXT.md.tpl +5 -0
- package/templates/controller/guard.spec.ts.tpl +2 -2
- package/templates/docs/asyncapi.privacy.json.tpl +100 -0
- package/templates/docs/event-catalog.privacy.md +18 -0
- package/templates/docs/privacy-register.md.tpl +25 -0
- package/templates/erasure-handler/erasure-handler.declared.ts.tpl +22 -0
- package/templates/erasure-handler/erasure-handler.spec.ts.tpl +36 -0
- package/templates/erasure-handler/erasure-handler.ts.tpl +20 -0
- package/templates/erasure-handler/wiring.manual.tpl +23 -0
- package/templates/erasure-handler/wiring.tsyringe.tpl +6 -0
- package/templates/init/README.md.tpl +43 -3
- package/templates/init/gitignore.tpl +3 -0
- package/templates/init/jest.config.js.tpl +2 -0
- package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +19 -1
- package/templates/init/platform/audit/create-audit.ts.tpl +28 -6
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +64 -6
- package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +12 -0
- package/templates/init/platform/composition/create-platform.manual.ts.tpl +7 -3
- package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +14 -2
- package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +17 -1
- package/templates/init/platform/composition/platform-options.manual.ts.tpl +4 -1
- package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +36 -0
- package/templates/init/platform/composition/platform.manual.ts.tpl +16 -0
- package/templates/init/platform/database/open-persistence.memory.ts.tpl +20 -0
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +13 -2
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +21 -1
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +17 -1
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +20 -1
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +45 -1
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +14 -1
- package/templates/init/platform/database/persistence.memory.ts.tpl +9 -0
- package/templates/init/platform/database/persistence.orm.ts.tpl +9 -1
- package/templates/init/platform/database/schema.drizzle.ts.tpl +18 -3
- package/templates/init/platform/database/schema.knex.ts.tpl +8 -1
- package/templates/init/platform/database/schema.prisma.tpl +182 -1
- package/templates/init/platform/database/schema.typeorm.ts.tpl +32 -1
- package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +36 -0
- package/templates/init/platform/event-sourcing/event-sourcing.module.ts.tpl +22 -0
- package/templates/init/platform/jobs/background-jobs.ts.tpl +21 -0
- package/templates/init/platform/jobs/create-background-work.ts.tpl +147 -0
- package/templates/init/platform/jobs/job-settings.ts.tpl +11 -0
- package/templates/init/platform/privacy/data-subject-copies.manual.ts.tpl +14 -0
- package/templates/init/platform/privacy/data-subject-copies.tsyringe.ts.tpl +13 -0
- package/templates/init/platform/privacy/data-subject-exports.manual.ts.tpl +14 -0
- package/templates/init/platform/privacy/data-subject-exports.tsyringe.ts.tpl +13 -0
- package/templates/init/platform/privacy/privacy.module.tsyringe.ts.tpl +20 -0
- package/templates/init/platform/privacy/run-erasure.manual.ts.tpl +100 -0
- package/templates/init/platform/privacy/run-erasure.tsyringe.ts.tpl +104 -0
- package/templates/init/platform/privacy/run-export.manual.ts.tpl +64 -0
- package/templates/init/platform/privacy/run-export.tsyringe.ts.tpl +71 -0
- package/templates/init/platform/privacy/run-purge.manual.ts.tpl +39 -0
- package/templates/init/platform/privacy/run-purge.tsyringe.ts.tpl +45 -0
- package/templates/init/rules/infrastructure.md.tpl +1 -1
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/init/scripts/events.ts.tpl +12 -0
- package/templates/init/scripts/privacy-erase.manual.ts.tpl +78 -0
- package/templates/init/scripts/privacy-erase.tsyringe.ts.tpl +78 -0
- package/templates/init/scripts/privacy-export.manual.ts.tpl +79 -0
- package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +79 -0
- package/templates/init/scripts/privacy-purge.manual.ts.tpl +48 -0
- package/templates/init/scripts/privacy-purge.tsyringe.ts.tpl +48 -0
- package/templates/personal-data/adapter-field.tpl +4 -0
- package/templates/personal-data/copies.manual.tpl +4 -0
- package/templates/personal-data/copies.tsyringe.tpl +4 -0
- package/templates/personal-data/declaration.drizzle.ts.tpl +22 -0
- package/templates/personal-data/declaration.knex.ts.tpl +24 -0
- package/templates/personal-data/declaration.prisma.ts.tpl +24 -0
- package/templates/personal-data/declaration.typeorm.ts.tpl +21 -0
- package/templates/personal-data/erasure.drizzle.ts.tpl +43 -0
- package/templates/personal-data/erasure.knex.ts.tpl +41 -0
- package/templates/personal-data/erasure.prisma.ts.tpl +43 -0
- package/templates/personal-data/erasure.typeorm.ts.tpl +41 -0
- package/templates/personal-data/export-fake.ts.tpl +24 -0
- package/templates/personal-data/export-port.ts.tpl +8 -0
- package/templates/personal-data/export.drizzle.ts.tpl +43 -0
- package/templates/personal-data/export.knex.ts.tpl +41 -0
- package/templates/personal-data/export.prisma.ts.tpl +43 -0
- package/templates/personal-data/export.typeorm.ts.tpl +41 -0
- package/templates/personal-data/exports.manual.tpl +4 -0
- package/templates/personal-data/exports.tsyringe.tpl +4 -0
- package/templates/personal-data/fake.ts.tpl +26 -0
- package/templates/personal-data/port.ts.tpl +8 -0
- package/templates/personal-data/spec.ts.tpl +280 -0
- package/templates/personal-data/wiring.tsyringe.tpl +12 -0
- package/templates/pipeline/github/workflows/ci.yml.tpl +62 -0
- package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +64 -2
- package/templates/pipeline/jest.mutation.config.js.tpl +8 -0
- package/templates/pipeline/knip.json.tpl +1 -1
- package/templates/pipeline/lefthook.yml +6 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/pipeline/stryker.config.mjs.tpl +25 -0
- package/templates/pipeline/vitest.config.ts.tpl +2 -0
- package/templates/pipeline/vitest.mutation.config.ts.tpl +29 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.drizzle.ts.tpl +17 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.knex.ts.tpl +19 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.drizzle.ts.tpl +18 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.knex.ts.tpl +20 -0
- package/templates/presets/identity/context/test/unit/account-deactivated.integration-handler.spec.ts.tpl +4 -2
- package/templates/presets/identity/context/test/unit/deactivate-account.handler.spec.ts.tpl +7 -5
- package/templates/presets/identity/context/test/unit/environment-identity-provider-connection.adapter.spec.ts.tpl +7 -3
- package/templates/presets/identity/context/test/unit/invite-member.handler.spec.ts.tpl +7 -7
- package/templates/presets/identity/context/test/unit/member-joined.integration-handler.spec.ts.tpl +4 -2
- package/templates/presets/identity/context/test/unit/member-removed.integration-handler.spec.ts.tpl +5 -3
- package/templates/presets/identity/context/test/unit/organisation-opened.integration-handler.spec.ts.tpl +4 -2
- package/templates/presets/identity/context/test/unit/revoke-invitation.handler.spec.ts.tpl +7 -5
- package/templates/process/process.spec.ts.tpl +6 -3
- package/templates/process/timeout-job.spec.buses.ts.tpl +42 -0
- package/templates/process/timeout-job.wiring.manual.tpl +4 -0
- package/templates/repository/drizzle/mapper.ts.tpl +10 -0
- package/templates/repository/drizzle/table.tpl +6 -0
- package/templates/repository/knex/mapper.ts.tpl +10 -0
- package/templates/repository/knex/row.ts.tpl +3 -0
- package/templates/repository/knex/table.tpl +3 -0
- package/templates/repository/prisma/mapper.ts.tpl +16 -1
- package/templates/repository/prisma/model.tpl +9 -0
- package/templates/repository/prisma/repository.ts.tpl +55 -0
- package/templates/repository/typeorm/mapper.ts.tpl +10 -0
- package/templates/repository/typeorm/repository.ts.tpl +48 -0
- package/templates/repository/typeorm/row.ts.tpl +9 -1
- package/templates/repository/typeorm/table.tpl +27 -0
- package/templates/value-object/value-object.spec.ts.tpl +1 -0
- package/dist/generate/kinds/background/require-container.d.ts +0 -7
- package/dist/generate/kinds/background/require-container.d.ts.map +0 -1
- package/dist/generate/kinds/background/require-container.js +0 -13
- package/dist/generate/kinds/background/require-container.js.map +0 -1
- /package/templates/background-job/{background-job.spec.ts.tpl → background-job.spec.tsyringe.ts.tpl} +0 -0
- /package/templates/process/{timeout-job.spec.ts.tpl → timeout-job.spec.tsyringe.ts.tpl} +0 -0
- /package/templates/repository/{wiring.manual.tpl → first-use.wiring.manual.tpl} +0 -0
|
@@ -1,9 +1,39 @@
|
|
|
1
|
+
{{#if queue.processTable}}
|
|
2
|
+
import {
|
|
3
|
+
{{#if eventSourcing.on}}
|
|
4
|
+
createPrismaEventSourcing,
|
|
5
|
+
{{/if}}
|
|
6
|
+
createPrismaUnitOfWork,
|
|
7
|
+
{{#if queue.database}}
|
|
8
|
+
PrismaJobStore,
|
|
9
|
+
{{/if}}
|
|
10
|
+
PrismaOutboxStore,
|
|
11
|
+
PrismaProcessedEventStore,
|
|
12
|
+
PrismaProcessStore,
|
|
13
|
+
} from '@ddd-ts-kit/prisma';
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{#unless queue.processTable}}
|
|
16
|
+
{{#if eventSourcing.on}}
|
|
17
|
+
import {
|
|
18
|
+
createPrismaEventSourcing,
|
|
19
|
+
createPrismaUnitOfWork,
|
|
20
|
+
PrismaOutboxStore,
|
|
21
|
+
PrismaProcessedEventStore,
|
|
22
|
+
} from '@ddd-ts-kit/prisma';
|
|
23
|
+
{{/if}}
|
|
24
|
+
{{#unless eventSourcing.on}}
|
|
1
25
|
import { createPrismaUnitOfWork, PrismaOutboxStore, PrismaProcessedEventStore } from '@ddd-ts-kit/prisma';
|
|
26
|
+
{{/unless}}
|
|
27
|
+
{{/unless}}
|
|
2
28
|
import type { PrismaClient } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
3
29
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
4
30
|
|
|
5
|
-
/** The schema of the
|
|
31
|
+
/** The schema of the messaging tables{{#if queue.processTable}} and of the background work{{/if}}, as prisma/schema.prisma names it. */
|
|
6
32
|
const MESSAGING_SCHEMA = 'messaging';
|
|
33
|
+
{{#if eventSourcing.on}}
|
|
34
|
+
/** The schema of the event store, as prisma/schema.prisma names it. */
|
|
35
|
+
const EVENT_STORE_SCHEMA = 'event_store';
|
|
36
|
+
{{/if}}
|
|
7
37
|
|
|
8
38
|
/** One object is the unit of work and what repositories query through; the stores are told how to reach their model. */
|
|
9
39
|
export function persistenceOver(client: PrismaClient): Persistence {
|
|
@@ -16,8 +46,22 @@ export function persistenceOver(client: PrismaClient): Persistence {
|
|
|
16
46
|
delegate: (current) => current.outboxRecord,
|
|
17
47
|
// Prisma Client has no row locking: the claim is the one raw statement of the store.
|
|
18
48
|
claim: { strategy: 'skip-locked', dialect: 'postgresql', schema: MESSAGING_SCHEMA, raw: (current) => current },
|
|
49
|
+
{{#if tenancy.any}}
|
|
50
|
+
// The tenant of each event, so that its consumers run in that tenant.
|
|
51
|
+
tenant: true,
|
|
52
|
+
{{/if}}
|
|
19
53
|
}),
|
|
20
54
|
processedEvents: new PrismaProcessedEventStore(unitOfWork, { delegate: (current) => current.processedEvent }),
|
|
55
|
+
{{#if queue.database}}
|
|
56
|
+
// The claim of the jobs is a raw statement: it names the schema of the table.
|
|
57
|
+
jobs: new PrismaJobStore(unitOfWork, { delegate: (current) => current.backgroundJob, schema: MESSAGING_SCHEMA }),
|
|
58
|
+
{{/if}}
|
|
59
|
+
{{#if queue.processTable}}
|
|
60
|
+
processes: new PrismaProcessStore(unitOfWork, { delegate: (current) => current.processInstance }),
|
|
61
|
+
{{/if}}
|
|
62
|
+
{{#if eventSourcing.on}}
|
|
63
|
+
eventSourcing: createPrismaEventSourcing(unitOfWork, { schema: EVENT_STORE_SCHEMA }),
|
|
64
|
+
{{/if}}
|
|
21
65
|
close: () => client.$disconnect(),
|
|
22
66
|
};
|
|
23
67
|
}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import type { DataSource } from 'typeorm';
|
|
2
|
+
{{#if eventSourcing.on}}
|
|
3
|
+
import {
|
|
4
|
+
createTypeOrmEventSourcing,
|
|
5
|
+
createTypeOrmUnitOfWork,
|
|
6
|
+
TypeOrmOutboxStore,
|
|
7
|
+
TypeOrmProcessedEventStore,
|
|
8
|
+
} from '@ddd-ts-kit/typeorm';
|
|
9
|
+
{{/if}}
|
|
10
|
+
{{#unless eventSourcing.on}}
|
|
2
11
|
import { createTypeOrmUnitOfWork, TypeOrmOutboxStore, TypeOrmProcessedEventStore } from '@ddd-ts-kit/typeorm';
|
|
12
|
+
{{/unless}}
|
|
3
13
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
4
|
-
import { outbox, processedEvents } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
14
|
+
import { {{#if eventSourcing.on}}EVENT_STORE_SCHEMA, {{/if}}outbox, processedEvents } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
5
15
|
|
|
6
16
|
/** One object is the unit of work and what repositories query through; the stores write through its manager. */
|
|
7
17
|
export function persistenceOver(dataSource: DataSource): Persistence {
|
|
@@ -12,6 +22,9 @@ export function persistenceOver(dataSource: DataSource): Persistence {
|
|
|
12
22
|
database: unitOfWork,
|
|
13
23
|
outbox: new TypeOrmOutboxStore(unitOfWork, { entity: outbox }),
|
|
14
24
|
processedEvents: new TypeOrmProcessedEventStore(unitOfWork, { entity: processedEvents }),
|
|
25
|
+
{{#if eventSourcing.on}}
|
|
26
|
+
eventSourcing: createTypeOrmEventSourcing(unitOfWork, { schema: EVENT_STORE_SCHEMA }),
|
|
27
|
+
{{/if}}
|
|
15
28
|
close: async () => {
|
|
16
29
|
if (dataSource.isInitialized) {
|
|
17
30
|
await dataSource.destroy();
|
|
@@ -4,7 +4,12 @@ import type { OutboxStore, RelaySignal } from '@ddd-ts-kit/events';
|
|
|
4
4
|
{{#unless persistence.signals}}
|
|
5
5
|
import type { OutboxStore } from '@ddd-ts-kit/events';
|
|
6
6
|
{{/unless}}
|
|
7
|
+
{{#if eventSourcing.on}}
|
|
8
|
+
import type { EventSourcingStores, ProcessedEventStore, UnitOfWork } from '@ddd-ts-kit/kernel';
|
|
9
|
+
{{/if}}
|
|
10
|
+
{{#unless eventSourcing.on}}
|
|
7
11
|
import type { ProcessedEventStore, UnitOfWork } from '@ddd-ts-kit/kernel';
|
|
12
|
+
{{/unless}}
|
|
8
13
|
|
|
9
14
|
/** Where state lives and how a command is made atomic. The composition root binds each member to its port. */
|
|
10
15
|
export interface Persistence {
|
|
@@ -15,6 +20,10 @@ export interface Persistence {
|
|
|
15
20
|
readonly relaySignal: RelaySignal;
|
|
16
21
|
{{/if}}
|
|
17
22
|
readonly processedEvents: ProcessedEventStore;
|
|
23
|
+
{{#if eventSourcing.on}}
|
|
24
|
+
/** The event store, the snapshots, the checkpoints and the keys of the data subjects: what an event-sourced aggregate is saved through, and what seals its personal values. */
|
|
25
|
+
readonly eventSourcing: EventSourcingStores;
|
|
26
|
+
{{/if}}
|
|
18
27
|
|
|
19
28
|
close(): Promise<void>;
|
|
20
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OutboxStore } from '@ddd-ts-kit/events';
|
|
2
|
-
import type { ProcessedEventStore, {{#if queue.processTable}}ProcessStore, {{/if}}UnitOfWork } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import type { {{#if eventSourcing.on}}EventSourcingStores, {{/if}}ProcessedEventStore, {{#if queue.processTable}}ProcessStore, {{/if}}UnitOfWork } from '@ddd-ts-kit/kernel';
|
|
3
3
|
{{#if queue.database}}
|
|
4
4
|
import type { JobStore } from '@ddd-ts-kit/scheduling';
|
|
5
5
|
{{/if}}
|
|
@@ -25,6 +25,14 @@ export interface Persistence {
|
|
|
25
25
|
{{/if}}
|
|
26
26
|
/** What repositories query through: the transaction of the current unit of work, or the database. */
|
|
27
27
|
readonly database: {{persistence.token}};
|
|
28
|
+
{{#if eventSourcing.on}}
|
|
29
|
+
/**
|
|
30
|
+
* The event store, the snapshots, the checkpoints of the projections it feeds and the keys of the
|
|
31
|
+
* data subjects, in the `event_store` schema: what an event-sourced aggregate is loaded and saved
|
|
32
|
+
* through, and what seals its personal values. The platform binds each store to its port.
|
|
33
|
+
*/
|
|
34
|
+
readonly eventSourcing: EventSourcingStores;
|
|
35
|
+
{{/if}}
|
|
28
36
|
|
|
29
37
|
close(): Promise<void>;
|
|
30
38
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{{#if audit.on}}
|
|
2
|
-
import { auditChainsTable, auditEntriesTable } from '@ddd-ts-kit/audit/drizzle';
|
|
2
|
+
import { auditArchivesTable, auditChainsTable, auditEntriesTable } from '@ddd-ts-kit/audit/drizzle';
|
|
3
3
|
{{/if}}
|
|
4
4
|
{{#if tenancy.any}}
|
|
5
|
-
import { {{#if queue.database}}jobsTable, {{/if}}processedEventsTable{{#if queue.processTable}}, processesTable{{/if}}, tenantOutboxTable } from '@ddd-ts-kit/drizzle/postgres';
|
|
5
|
+
import { {{#if eventSourcing.on}}eventStoreTables, {{/if}}{{#if queue.database}}jobsTable, {{/if}}processedEventsTable{{#if queue.processTable}}, processesTable{{/if}}, tenantOutboxTable } from '@ddd-ts-kit/drizzle/postgres';
|
|
6
6
|
{{/if}}
|
|
7
7
|
{{#unless tenancy.any}}
|
|
8
|
-
import { {{#if queue.database}}jobsTable, {{/if}}outboxTable, processedEventsTable{{#if queue.processTable}}, processesTable{{/if}} } from '@ddd-ts-kit/drizzle/postgres';
|
|
8
|
+
import { {{#if eventSourcing.on}}eventStoreTables, {{/if}}{{#if queue.database}}jobsTable, {{/if}}outboxTable, processedEventsTable{{#if queue.processTable}}, processesTable{{/if}} } from '@ddd-ts-kit/drizzle/postgres';
|
|
9
9
|
{{/unless}}
|
|
10
10
|
|
|
11
11
|
/** The schema of what the kit stores for the application: the outbox and the processed events{{#if queue.database}}, the background jobs{{/if}}{{#if queue.processTable}}, the process instances{{/if}}. */
|
|
@@ -37,6 +37,21 @@ export const AUDIT_SCHEMA = 'audit';
|
|
|
37
37
|
// TODO(platform): drizzle-kit writes no trigger. After the first `npm run db:generate <name>`, add a custom migration (`npm run db:generate -- audit-guard --custom`) holding the statements `npm run db:audit-guard` prints: they make the entries refuse UPDATE, DELETE and TRUNCATE.
|
|
38
38
|
export const auditEntries = auditEntriesTable(AUDIT_SCHEMA);
|
|
39
39
|
export const auditChains = auditChainsTable(AUDIT_SCHEMA);
|
|
40
|
+
/** One row per range of a chain moved to the storage of files: the anchor the chain goes on from. */
|
|
41
|
+
export const auditArchives = auditArchivesTable(AUDIT_SCHEMA);
|
|
42
|
+
{{/if}}
|
|
43
|
+
{{#if eventSourcing.on}}
|
|
44
|
+
|
|
45
|
+
/** The schema of the event store: the events, the snapshots, the checkpoints and the keys of the data subjects. It records no tenant. */
|
|
46
|
+
export const EVENT_STORE_SCHEMA = 'event_store';
|
|
47
|
+
|
|
48
|
+
const eventStore = eventStoreTables(EVENT_STORE_SCHEMA);
|
|
49
|
+
|
|
50
|
+
export const storedEventsHead = eventStore.head;
|
|
51
|
+
export const storedEvents = eventStore.events;
|
|
52
|
+
export const streamSnapshots = eventStore.snapshots;
|
|
53
|
+
export const subscriptionCheckpoints = eventStore.checkpoints;
|
|
54
|
+
export const subjectKeys = eventStore.subjectKeys;
|
|
40
55
|
{{/if}}
|
|
41
56
|
|
|
42
57
|
// ddd-ts-kit:schemas
|
|
@@ -2,12 +2,16 @@ import type { Knex } from 'knex';
|
|
|
2
2
|
{{#if audit.on}}
|
|
3
3
|
import { createAuditTables } from '@ddd-ts-kit/audit/knex';
|
|
4
4
|
{{/if}}
|
|
5
|
-
import { {{#if queue.database}}createJobTable, {{/if}}createOutboxTables{{#if queue.processTable}}, createProcessTable{{/if}} } from '@ddd-ts-kit/knex';
|
|
5
|
+
import { {{#if eventSourcing.on}}createEventStoreTables, {{/if}}{{#if queue.database}}createJobTable, {{/if}}createOutboxTables{{#if queue.processTable}}, createProcessTable{{/if}} } from '@ddd-ts-kit/knex';
|
|
6
6
|
// ddd-ts-kit:imports
|
|
7
7
|
// /ddd-ts-kit:imports
|
|
8
8
|
|
|
9
9
|
/** The schema of what the kit stores for the application: the outbox and the processed events{{#if queue.database}}, the background jobs{{/if}}{{#if queue.processTable}}, the process instances{{/if}}. */
|
|
10
10
|
export const MESSAGING_SCHEMA = 'messaging';
|
|
11
|
+
{{#if eventSourcing.on}}
|
|
12
|
+
/** The schema of the event store: the events, the snapshots, the checkpoints and the keys of the data subjects. It records no tenant. */
|
|
13
|
+
export const EVENT_STORE_SCHEMA = 'event_store';
|
|
14
|
+
{{/if}}
|
|
11
15
|
{{#if audit.on}}
|
|
12
16
|
/** The schema of the audit trail: two tables, and the triggers that keep the entries append-only. */
|
|
13
17
|
export const AUDIT_SCHEMA = 'audit';
|
|
@@ -35,6 +39,9 @@ export const createTables = async (knex: Knex): Promise<void> => {
|
|
|
35
39
|
{{#if audit.on}}
|
|
36
40
|
await createAuditTables(knex, { schema: AUDIT_SCHEMA });
|
|
37
41
|
{{/if}}
|
|
42
|
+
{{#if eventSourcing.on}}
|
|
43
|
+
await createEventStoreTables(knex, { schema: EVENT_STORE_SCHEMA });
|
|
44
|
+
{{/if}}
|
|
38
45
|
// ddd-ts-kit:schemas
|
|
39
46
|
// /ddd-ts-kit:schemas
|
|
40
47
|
};
|
|
@@ -7,7 +7,7 @@ generator client {
|
|
|
7
7
|
|
|
8
8
|
datasource db {
|
|
9
9
|
provider = "postgresql"
|
|
10
|
-
schemas = ["messaging"]
|
|
10
|
+
schemas = ["messaging"{{#if eventSourcing.on}}, "event_store"{{/if}}{{#if audit.on}}, "audit"{{/if}}]
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// The outbox and the idempotency table, from @ddd-ts-kit/prisma. Keep the field names: the
|
|
@@ -21,6 +21,10 @@ model OutboxRecord {
|
|
|
21
21
|
payload Json?
|
|
22
22
|
traceparent String?
|
|
23
23
|
correlationId String? @map("correlation_id")
|
|
24
|
+
{{#if tenancy.any}}
|
|
25
|
+
/// The tenant of the event, so that its consumers run in that tenant.
|
|
26
|
+
tenantId String? @map("tenant_id")
|
|
27
|
+
{{/if}}
|
|
24
28
|
status String @default("pending")
|
|
25
29
|
attempts Int @default(0)
|
|
26
30
|
nextAttemptAt DateTime @map("next_attempt_at") @db.Timestamptz(3)
|
|
@@ -42,7 +46,184 @@ model ProcessedEvent {
|
|
|
42
46
|
@@map("processed_events")
|
|
43
47
|
@@schema("messaging")
|
|
44
48
|
}
|
|
49
|
+
{{#if queue.database}}
|
|
50
|
+
|
|
51
|
+
// The background jobs, from @ddd-ts-kit/prisma, enqueued in the transaction of the command. Keep
|
|
52
|
+
// the field, table and column names: the claim selects the due rows by name.
|
|
53
|
+
model BackgroundJob {
|
|
54
|
+
id String @id
|
|
55
|
+
/// Insertion order, the tie-breaker of the claim.
|
|
56
|
+
sequence BigInt @unique @default(autoincrement())
|
|
57
|
+
name String
|
|
58
|
+
queue String
|
|
59
|
+
payload Json?
|
|
60
|
+
enqueuedBy Json @map("enqueued_by")
|
|
61
|
+
idempotencyKey String? @map("idempotency_key")
|
|
62
|
+
/// The empty text outside any tenant: a null would make every such key distinct.
|
|
63
|
+
tenantId String @default("") @map("tenant_id")
|
|
64
|
+
subject String?
|
|
65
|
+
status String @default("waiting")
|
|
66
|
+
attempts Int @default(0)
|
|
67
|
+
runAt DateTime @map("run_at") @db.Timestamptz(3)
|
|
68
|
+
leaseUntil DateTime? @map("lease_until") @db.Timestamptz(3)
|
|
69
|
+
progress Json?
|
|
70
|
+
/// JSON as text: a worker may clear it.
|
|
71
|
+
checkpoint String?
|
|
72
|
+
lastErrorCode String? @map("last_error_code")
|
|
73
|
+
enqueuedAt DateTime @map("enqueued_at") @db.Timestamptz(3)
|
|
74
|
+
finishedAt DateTime? @map("finished_at") @db.Timestamptz(3)
|
|
75
|
+
|
|
76
|
+
@@unique([name, tenantId, idempotencyKey], map: "background_jobs_idempotency_key")
|
|
77
|
+
@@index([queue, runAt, sequence], map: "background_jobs_due_idx")
|
|
78
|
+
@@map("background_jobs")
|
|
79
|
+
@@schema("messaging")
|
|
80
|
+
}
|
|
81
|
+
{{/if}}
|
|
82
|
+
{{#if queue.processTable}}
|
|
83
|
+
|
|
84
|
+
// The instances of the process managers, from @ddd-ts-kit/prisma, saved in the transaction of each step.
|
|
85
|
+
model ProcessInstance {
|
|
86
|
+
name String
|
|
87
|
+
id String
|
|
88
|
+
/// JSON as text: a state may be null.
|
|
89
|
+
state String
|
|
90
|
+
version Int
|
|
91
|
+
ended Boolean @default(false)
|
|
92
|
+
timeouts Json
|
|
93
|
+
updatedAt DateTime @default(now()) @map("updated_at") @db.Timestamptz(3)
|
|
94
|
+
|
|
95
|
+
@@id([name, id])
|
|
96
|
+
@@map("process_instances")
|
|
97
|
+
@@schema("messaging")
|
|
98
|
+
}
|
|
99
|
+
{{/if}}
|
|
45
100
|
|
|
46
101
|
// One schema per bounded context, no relation across contexts.
|
|
47
102
|
// ddd-ts-kit:models
|
|
48
103
|
// /ddd-ts-kit:models
|
|
104
|
+
{{#if eventSourcing.on}}
|
|
105
|
+
|
|
106
|
+
// The event store of @ddd-ts-kit/prisma: the events, the snapshots, the checkpoints and the
|
|
107
|
+
// keys of the data subjects. Keep the table and column names: the stores run raw statements
|
|
108
|
+
// against them. It records no tenant.
|
|
109
|
+
model StoredEventsHead {
|
|
110
|
+
id Int @id @db.SmallInt
|
|
111
|
+
position BigInt
|
|
112
|
+
|
|
113
|
+
@@map("stored_events_head")
|
|
114
|
+
@@schema("event_store")
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
model StoredEvent {
|
|
118
|
+
position BigInt @id
|
|
119
|
+
stream String
|
|
120
|
+
version Int
|
|
121
|
+
eventId String @unique @map("event_id")
|
|
122
|
+
type String
|
|
123
|
+
schemaVersion Int @map("schema_version")
|
|
124
|
+
data Json
|
|
125
|
+
metadata Json
|
|
126
|
+
occurredAt DateTime @map("occurred_at") @db.Timestamptz(3)
|
|
127
|
+
recordedAt DateTime @default(now()) @map("recorded_at") @db.Timestamptz(3)
|
|
128
|
+
|
|
129
|
+
@@unique([stream, version])
|
|
130
|
+
@@map("stored_events")
|
|
131
|
+
@@schema("event_store")
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
model StreamSnapshot {
|
|
135
|
+
stream String @id
|
|
136
|
+
version Int
|
|
137
|
+
schemaVersion Int @map("schema_version")
|
|
138
|
+
data Json
|
|
139
|
+
takenAt DateTime @default(now()) @map("taken_at") @db.Timestamptz(3)
|
|
140
|
+
|
|
141
|
+
@@map("stream_snapshots")
|
|
142
|
+
@@schema("event_store")
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
model SubscriptionCheckpoint {
|
|
146
|
+
subscriber String @id
|
|
147
|
+
position BigInt
|
|
148
|
+
updatedAt DateTime @default(now()) @map("updated_at") @db.Timestamptz(3)
|
|
149
|
+
|
|
150
|
+
@@map("subscription_checkpoints")
|
|
151
|
+
@@schema("event_store")
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/// One key per data subject: erasing the subject deletes its row.
|
|
155
|
+
model SubjectKey {
|
|
156
|
+
subject String @id
|
|
157
|
+
keyId String @unique @map("key_id")
|
|
158
|
+
material String
|
|
159
|
+
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3)
|
|
160
|
+
|
|
161
|
+
@@map("subject_keys")
|
|
162
|
+
@@schema("event_store")
|
|
163
|
+
}
|
|
164
|
+
{{/if}}
|
|
165
|
+
{{#if audit.on}}
|
|
166
|
+
|
|
167
|
+
// TODO(platform): Prisma writes no trigger. After the first `npm run db:generate <name>`, add a migration (`npm run db:generate audit-guard`) holding the statements `npm run db:audit-guard` prints: they make the entries refuse UPDATE, DELETE and TRUNCATE.
|
|
168
|
+
/// The audit trail of @ddd-ts-kit/audit: written by PrismaAuditTrail with raw statements, append-only once the guard is migrated.
|
|
169
|
+
model AuditEntry {
|
|
170
|
+
id String @unique
|
|
171
|
+
chain String
|
|
172
|
+
sequence BigInt
|
|
173
|
+
occurredAt DateTime @map("occurred_at") @db.Timestamptz(3)
|
|
174
|
+
category String
|
|
175
|
+
action String
|
|
176
|
+
outcome String
|
|
177
|
+
reason String?
|
|
178
|
+
actorId String @map("actor_id")
|
|
179
|
+
actorType String @map("actor_type")
|
|
180
|
+
actorTenantId String? @map("actor_tenant_id")
|
|
181
|
+
tenantId String? @map("tenant_id")
|
|
182
|
+
impersonatedBy String? @map("impersonated_by")
|
|
183
|
+
sessionId String? @map("session_id")
|
|
184
|
+
resourceType String? @map("resource_type")
|
|
185
|
+
resourceId String? @map("resource_id")
|
|
186
|
+
context String?
|
|
187
|
+
correlationId String @map("correlation_id")
|
|
188
|
+
causationId String? @map("causation_id")
|
|
189
|
+
origin String
|
|
190
|
+
changes Json?
|
|
191
|
+
extensions Json @default("{}")
|
|
192
|
+
previousHash String @map("previous_hash")
|
|
193
|
+
hash String
|
|
194
|
+
|
|
195
|
+
@@id([chain, sequence])
|
|
196
|
+
@@index([occurredAt, chain, sequence], map: "audit_entries_occurred_idx")
|
|
197
|
+
@@index([actorId, occurredAt], map: "audit_entries_actor_idx")
|
|
198
|
+
@@index([resourceType, resourceId], map: "audit_entries_resource_idx")
|
|
199
|
+
@@index([correlationId], map: "audit_entries_correlation_idx")
|
|
200
|
+
@@map("audit_entries")
|
|
201
|
+
@@schema("audit")
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/// The archives of the audit trail: one row per range of a chain written to the file storage, append-only, read by the guard.
|
|
205
|
+
model AuditArchive {
|
|
206
|
+
chain String
|
|
207
|
+
fromSequence BigInt @map("from_sequence")
|
|
208
|
+
toSequence BigInt @map("to_sequence")
|
|
209
|
+
lastHash String @map("last_hash")
|
|
210
|
+
entries Int
|
|
211
|
+
fileKey String @map("file_key")
|
|
212
|
+
fileDigest String @map("file_digest")
|
|
213
|
+
archivedAt DateTime @map("archived_at") @db.Timestamptz(3)
|
|
214
|
+
|
|
215
|
+
@@id([chain, toSequence])
|
|
216
|
+
@@map("audit_archives")
|
|
217
|
+
@@schema("audit")
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/// The head of each chain of the audit trail: the row an append locks.
|
|
221
|
+
model AuditChain {
|
|
222
|
+
chain String @id
|
|
223
|
+
sequence BigInt
|
|
224
|
+
hash String
|
|
225
|
+
|
|
226
|
+
@@map("audit_chains")
|
|
227
|
+
@@schema("audit")
|
|
228
|
+
}
|
|
229
|
+
{{/if}}
|
|
@@ -1,18 +1,49 @@
|
|
|
1
|
+
{{#if audit.on}}
|
|
2
|
+
import { auditEntities } from '@ddd-ts-kit/audit/typeorm';
|
|
3
|
+
{{/if}}
|
|
1
4
|
import type { EntitySchema } from 'typeorm';
|
|
2
|
-
import { outboxEntity, processedEventEntity } from '@ddd-ts-kit/typeorm';
|
|
5
|
+
import { {{#if eventSourcing.on}}eventStoreEntities, {{/if}}outboxEntity, processedEventEntity } from '@ddd-ts-kit/typeorm';
|
|
3
6
|
// ddd-ts-kit:imports
|
|
4
7
|
// /ddd-ts-kit:imports
|
|
5
8
|
|
|
6
9
|
/** The schema of what the kit stores for the application: the outbox and the processed events. */
|
|
7
10
|
export const MESSAGING_SCHEMA = 'messaging';
|
|
8
11
|
|
|
12
|
+
{{#if tenancy.any}}
|
|
13
|
+
// The tenant of each event, so that its consumers run in that tenant.
|
|
14
|
+
export const outbox = outboxEntity({ schema: MESSAGING_SCHEMA, tenant: true });
|
|
15
|
+
{{/if}}
|
|
16
|
+
{{#unless tenancy.any}}
|
|
9
17
|
export const outbox = outboxEntity({ schema: MESSAGING_SCHEMA });
|
|
18
|
+
{{/unless}}
|
|
10
19
|
export const processedEvents = processedEventEntity({ schema: MESSAGING_SCHEMA });
|
|
11
20
|
|
|
21
|
+
{{#if eventSourcing.on}}
|
|
22
|
+
/** The schema of the event store: the events, the snapshots, the checkpoints and the keys of the data subjects. It records no tenant. */
|
|
23
|
+
export const EVENT_STORE_SCHEMA = 'event_store';
|
|
24
|
+
|
|
25
|
+
/** The five tables of the event store, registered with the data source and migrated like the others. */
|
|
26
|
+
export const eventStore = eventStoreEntities({ schema: EVENT_STORE_SCHEMA });
|
|
27
|
+
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{#if audit.on}}
|
|
30
|
+
/** The schema of the audit trail. */
|
|
31
|
+
export const AUDIT_SCHEMA = 'audit';
|
|
32
|
+
|
|
33
|
+
// TODO(platform): TypeORM generates no trigger. After the first `npm run db:generate migrations/<name>`, add a migration of your own that runs the statements `npm run db:audit-guard` prints: they make the entries refuse UPDATE, DELETE and TRUNCATE.
|
|
34
|
+
export const auditTrail = auditEntities({ schema: AUDIT_SCHEMA });
|
|
35
|
+
|
|
36
|
+
{{/if}}
|
|
12
37
|
/** Every table of the application: what the data source registers and what migrations are generated from. */
|
|
13
38
|
export const entities: readonly EntitySchema[] = [
|
|
14
39
|
outbox,
|
|
15
40
|
processedEvents,
|
|
41
|
+
{{#if eventSourcing.on}}
|
|
42
|
+
...eventStore,
|
|
43
|
+
{{/if}}
|
|
44
|
+
{{#if audit.on}}
|
|
45
|
+
...auditTrail,
|
|
46
|
+
{{/if}}
|
|
16
47
|
// ddd-ts-kit:schemas
|
|
17
48
|
// /ddd-ts-kit:schemas
|
|
18
49
|
];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{{#if audit.on}}
|
|
2
|
+
import { auditedSubjectKeys, type AuditSource } from '@ddd-ts-kit/audit';
|
|
3
|
+
{{/if}}
|
|
4
|
+
import { PersonalDataCipher, type EventSourcingStores } from '@ddd-ts-kit/kernel';
|
|
5
|
+
{{#if audit.on}}
|
|
6
|
+
import type { Audit } from '{{alias.platform}}/audit/create-audit{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The event store as the platform hands it on: the stores an event-sourced repository adapter is
|
|
12
|
+
* given (the events, the snapshots, the checkpoints of the projections the store feeds), the keys
|
|
13
|
+
* of the data subjects and the cipher that seals a personal value of a stored event with the key
|
|
14
|
+
* of its subject. An erasure destroys the key{{#if audit.on}}, and every erasure leaves a dated entry in the audit
|
|
15
|
+
* trail, whoever asks for it{{/if}}. The keys live in the `subject_keys` table of the event store: a
|
|
16
|
+
* deployment that promises erasure keeps them in a store of their own, with a shorter backup
|
|
17
|
+
* retention than the events (docs/concepts/event-sourcing.md of ddd-ts-kit, "Personal data").
|
|
18
|
+
*/
|
|
19
|
+
export interface EventSourcing extends EventSourcingStores {
|
|
20
|
+
readonly cipher: PersonalDataCipher;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
{{#if audit.on}}
|
|
24
|
+
export function createEventSourcing(persistence: Persistence, audit: Audit, source: AuditSource): EventSourcing {
|
|
25
|
+
const subjectKeys = auditedSubjectKeys(persistence.eventSourcing.subjectKeys, audit.trail, source);
|
|
26
|
+
|
|
27
|
+
return { ...persistence.eventSourcing, subjectKeys, cipher: new PersonalDataCipher(subjectKeys) };
|
|
28
|
+
}
|
|
29
|
+
{{/if}}
|
|
30
|
+
{{#unless audit.on}}
|
|
31
|
+
export function createEventSourcing(persistence: Persistence): EventSourcing {
|
|
32
|
+
const { subjectKeys } = persistence.eventSourcing;
|
|
33
|
+
|
|
34
|
+
return { ...persistence.eventSourcing, cipher: new PersonalDataCipher(subjectKeys) };
|
|
35
|
+
}
|
|
36
|
+
{{/unless}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineContextModule, type ContextModule } from '@ddd-ts-kit/di';
|
|
2
|
+
import { CheckpointStore, EventStore, PersonalDataCipher, SnapshotStore, SubjectKeyStore } from '@ddd-ts-kit/kernel';
|
|
3
|
+
import type { EventSourcing } from '{{alias.platform}}/event-sourcing/create-event-sourcing{{alias.ext}}';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The event store as a capability of the platform, not a bounded context: the stores an
|
|
7
|
+
* event-sourced repository adapter names in its constructor (`EventStore`, `SnapshotStore`,
|
|
8
|
+
* `CheckpointStore`), the keys of the data subjects{{#if audit.on}}, audited,{{/if}} and the cipher that seals a personal
|
|
9
|
+
* value of a stored event (`PersonalDataCipher`).
|
|
10
|
+
*/
|
|
11
|
+
export function eventSourcingModule(eventSourcing: EventSourcing): ContextModule {
|
|
12
|
+
return defineContextModule({
|
|
13
|
+
name: 'event-sourcing',
|
|
14
|
+
register(builder) {
|
|
15
|
+
builder.bind(EventStore).toValue(eventSourcing.events);
|
|
16
|
+
builder.bind(SnapshotStore).toValue(eventSourcing.snapshots);
|
|
17
|
+
builder.bind(CheckpointStore).toValue(eventSourcing.checkpoints);
|
|
18
|
+
builder.bind(SubjectKeyStore).toValue(eventSourcing.subjectKeys);
|
|
19
|
+
builder.bind(PersonalDataCipher).toValue(eventSourcing.cipher);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BackgroundJob, BackgroundJobOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
|
|
3
|
+
/** A background job class: named by its static `jobName`, built from what its constructor takes. */
|
|
4
|
+
export interface BackgroundJobClass<Deps extends readonly unknown[]> {
|
|
5
|
+
readonly jobName: string;
|
|
6
|
+
new (...deps: Deps): BackgroundJob<unknown>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/** Where a context registers its background jobs; the application starts it when this process runs the jobs. */
|
|
10
|
+
export interface BackgroundJobs {
|
|
11
|
+
/** Registers a job under its static `jobName`, built once from its dependencies; each attempt is observed from outside (its span), named after the job and its context. */
|
|
12
|
+
register<const Deps extends readonly unknown[]>(
|
|
13
|
+
job: BackgroundJobClass<Deps>,
|
|
14
|
+
deps: Deps,
|
|
15
|
+
options?: BackgroundJobOptions,
|
|
16
|
+
): void;
|
|
17
|
+
|
|
18
|
+
start(): Promise<void>;
|
|
19
|
+
|
|
20
|
+
stop(): Promise<void>;
|
|
21
|
+
}
|