ddd-ts-kit 0.88.0 → 0.89.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 +593 -0
- package/README.fr.md +67 -26
- package/README.md +62 -23
- 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 +9 -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/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/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 +16 -0
- 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/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 +27 -24
- package/dist/init/manifest/versions.js.map +1 -1
- 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 +3 -1
- 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 +4 -6
- 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 +44 -2
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +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 +21 -0
- 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 +131 -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
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,599 @@ What each version changes for someone who uses the kit. The packages of `package
|
|
|
4
4
|
together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
|
|
5
5
|
list the pull requests behind it.
|
|
6
6
|
|
|
7
|
+
## 0.89.0
|
|
8
|
+
|
|
9
|
+
**`clean/one-export-per-file` runs under the JS plugin API of Oxlint.** The rule walked the
|
|
10
|
+
tree of a file through a node a parser may leave null (the body of a declaration without one),
|
|
11
|
+
which the parser of ESLint never does and the one of Oxlint does: under Oxlint the rule stopped
|
|
12
|
+
on 2,494 of the files of the kit with `Cannot convert undefined or null to object`. The walker
|
|
13
|
+
now walks nothing for what is not a node. The plugin as a whole runs under
|
|
14
|
+
`oxlint --type-aware` with `jsPlugins` set to `@ddd-ts-kit/eslint-plugin`, which stays a trial:
|
|
15
|
+
the API is alpha, and `no-redeclare` of Oxlint contradicts the compiler on a class and an
|
|
16
|
+
interface of one name.
|
|
17
|
+
|
|
18
|
+
**`clean/stepdown` reports on a JavaScript file too.** The rule kept the references of a function
|
|
19
|
+
that the scope manager of typescript-eslint marks as values; the scope manager of the default
|
|
20
|
+
parser of ESLint, which lints a `.mjs`, `.cjs` or `.js` file, marks nothing, so on such a file the
|
|
21
|
+
rule found no caller and reported nothing. A reference the parser does not qualify is a value
|
|
22
|
+
now. The preset of the kit applies the rule to TypeScript sources only; a project that applies it
|
|
23
|
+
to its scripts as well sees what it reports there from this version on.
|
|
24
|
+
|
|
25
|
+
**`ddd-ts-kit lint` keeps the cache of ESLint, and the pipeline of a project restores it.** The
|
|
26
|
+
command lints with the cache of ESLint keyed by the content of each file (`.eslintcache/`, ignored
|
|
27
|
+
by git): a second run on a tree that did not change lints the files that changed since, in a
|
|
28
|
+
second or two instead of the whole project. The cache keys on the files and the config, not on the
|
|
29
|
+
rules as installed, so the command drops it when the lockfile, `eslint.config.mjs` or
|
|
30
|
+
`ddd-ts-kit.config.json` changed since it was written. The lint job of the pipeline `init` writes
|
|
31
|
+
restores, on a pull request or a merge request, the cache the default branch wrote last for the
|
|
32
|
+
same lockfile and config, and the default branch and the night lint everything and write it: a
|
|
33
|
+
type changed in another file is seen there. `ddd-ts-kit lint --no-cache` lints every file again.
|
|
34
|
+
|
|
35
|
+
To move, by hand, not with `init --force`, which rewrites far more than the pipeline: add
|
|
36
|
+
`.eslintcache/` to `.gitignore`; in `.github/workflows/ci.yml`, give the lint job the two steps of
|
|
37
|
+
the template (`actions/cache/restore` of `.eslintcache/` before the lint, on a pull request only,
|
|
38
|
+
keyed by the lockfile, `eslint.config.mjs` and `ddd-ts-kit.config.json` with a prefix fallback;
|
|
39
|
+
`actions/cache/save` after it, on the default branch and the night only), as
|
|
40
|
+
`node_modules/ddd-ts-kit/templates/pipeline/github/workflows/ci.yml.tpl` writes them; in
|
|
41
|
+
`.gitlab-ci.yml`, add the second `cache:` entry of the lint job (`.eslintcache/`, keyed by the
|
|
42
|
+
lockfile and `eslint.config.mjs`, `policy: $LINT_CACHE_POLICY`) and the `LINT_CACHE_POLICY` variable
|
|
43
|
+
of each workflow rule (`pull` on a merge request, `pull-push` on the default branch and the night),
|
|
44
|
+
as `templates/pipeline/gitlab/gitlab-ci.yml.tpl` writes them.
|
|
45
|
+
|
|
46
|
+
**A proposal page says what privacy by design asks of the kit beyond event sourcing, and the
|
|
47
|
+
pull requests that build it.** `docs/proposals/privacy-by-design.md` verifies what the kit
|
|
48
|
+
erases today (the personal values of stored events, by crypto-shredding, with a dated audit
|
|
49
|
+
entry) and what nothing of the kit erases, exports, retains or inventories: the aggregates kept
|
|
50
|
+
as rows on the four ORMs, the read models, the copies a person leaves in the contexts that
|
|
51
|
+
consumed its events, the masks of the audit trail. It designs one declaration of the personal
|
|
52
|
+
fields, read by ports with an adapter per ORM, by generators, by a generated register and by
|
|
53
|
+
`privacy/*` rules, nothing of it mandatory for a project without personal data; cuts the work
|
|
54
|
+
into pull requests in merge order, the example first; and says what a tool can never guarantee,
|
|
55
|
+
with the wording that follows for the README. The glossary of the translations gains the terms
|
|
56
|
+
of the page. Nothing of the code changes.
|
|
57
|
+
|
|
58
|
+
**The scheduling example erases a person from every copy the contexts keep, not from the sealed
|
|
59
|
+
words alone.** `npm run erase:patient` destroyed the key the words of a patient were sealed with
|
|
60
|
+
and rebuilt the projections, and left the person named and reachable in the tables: the person of
|
|
61
|
+
`identity` (name and address), the contact of `notification`, the notes the staff wrote on their
|
|
62
|
+
appointments, the reasons of their cancellations, the documents attached to those appointments and
|
|
63
|
+
the name the practitioner directory of `scheduling` copied. The erasure now reaches each of them,
|
|
64
|
+
network by network (`NETWORKS`), after the key and before the rebuilds: `identity` forgets the
|
|
65
|
+
person (`PersonRepository.erase`), `notification` deletes the contact, `scheduling` replaces the
|
|
66
|
+
notes and the reasons by `[erased]` and deletes the documents from the file storage
|
|
67
|
+
(`KnexPatientErasure`). The report of the script counts the rows each copy reached; a copy that
|
|
68
|
+
fails does not stop the others and running the script again completes the erasure; a run again
|
|
69
|
+
once nothing is left is refused and recorded. The README of the example says what an erasure does
|
|
70
|
+
not reach: the events published before it, the backups, the opaque ids of the audit trail. The
|
|
71
|
+
first part of the proposal [privacy by design](../docs/proposals/privacy-by-design.md) built; the
|
|
72
|
+
hand-written steps are the specification of the erasure port the next parts bring to the kit.
|
|
73
|
+
|
|
74
|
+
**A proposal specifies a second example, spend management on the most popular stack.** `docs/proposals/spend-management-example.md` runs the stack NestJS, class-validator, Jest, Prisma, Kafka, Redis, S3, shared-table tenancy, Keycloak, ABAC, Winston, Scalar through `init --dry-run` and lists what the kit refuses today on it: the queue and the processes on `--di nest`, the shared-table tenancy, the jobs table and the SQL audit trail on Prisma, the identity preset on Nest, Prisma and the explicit style. It specifies those fixes first, then the example (seven bounded contexts on expense reports, corporate cards, approvals, budgets, reimbursements and the ledger), then what the repository gains; MySQL is left out with the list of what it would take. Nothing is built by this change.
|
|
75
|
+
|
|
76
|
+
**The kernel declares the personal fields of a table and erases a data subject end to end: the
|
|
77
|
+
key, every copy in every tenant, the rebuilds.** `personalFields(table, { subject, fields,
|
|
78
|
+
erasure, files? })` says, next to the mapper, which columns of a table are personal, whose they
|
|
79
|
+
are and how the rows of a subject are erased, `row` deleted or `pseudonymise` read as `[erased]`,
|
|
80
|
+
the files they name deleted from the storage. Two ports a context extends and names, as it extends
|
|
81
|
+
`Repository`: `PersonalDataErasure` (`erase(subject)` answers the rows reached, none the second
|
|
82
|
+
time) and `PersonalDataExport` (`exportOf(subject)` answers one `PersonalDataRecord` per row,
|
|
83
|
+
each personal column as plain data). `eraseDataSubject`, lifted from the scheduling example,
|
|
84
|
+
destroys the key, erases every copy in every tenant (`inEachTenant` runs a copy in the context of
|
|
85
|
+
the work given each tenant, since a write of tenant data is never widened), rebuilds the
|
|
86
|
+
projections fed by the store, and reports `{ erased, copies, rebuilt }`; a copy that fails does
|
|
87
|
+
not stop the others, and running the erasure again completes it; a subject that is not an opaque
|
|
88
|
+
identifier is refused before any key is touched, and an id nothing is left of is refused before
|
|
89
|
+
the rebuilds; `keys` may be left out, as in a project whose aggregates are rows and seal nothing:
|
|
90
|
+
the copies alone are erased, and the report says no key was destroyed. `InMemoryPersonalData` implements both ports over one declaration, and
|
|
91
|
+
`personalDataErasureContract` and `personalDataExportContract` of `@ddd-ts-kit/testing` hold it
|
|
92
|
+
and every adapter to the same behaviour. The adapters of the persistence packages, the platform
|
|
93
|
+
folder `init` writes and the register come with the next parts of
|
|
94
|
+
[privacy by design](../docs/proposals/privacy-by-design.md). The persistence skill says it.
|
|
95
|
+
|
|
96
|
+
**The audit trail masks a personal value under the key of the person it belongs to, so that
|
|
97
|
+
erasing the person makes its masks meaningless.** `subjectMasker(keys)` of `@ddd-ts-kit/audit` is
|
|
98
|
+
an `AuditMasker` over the `SubjectKeyStore` of the kernel, the same keys that seal the personal
|
|
99
|
+
values of the stored events: each mask is an HMAC under a key derived from the key of the data
|
|
100
|
+
subject (HKDF, labelled for the trail), written `<keyId>:<hex>`; `SubjectKeyStore.erase` destroys
|
|
101
|
+
the key, and the masks made with it become tokens nobody can recompute while the entries and the
|
|
102
|
+
chain stay as they are. A masked field says whose its value is, `masked('patientEmail', { subject:
|
|
103
|
+
'patientId' })` or `subjectOf: (command) => ...`; `auditMiddleware` refuses, at wiring time, a
|
|
104
|
+
masked field that names none when the masker is keyed per data subject
|
|
105
|
+
(`MissingDataSubjectError`), and the masker refuses a subject that is not an opaque identifier
|
|
106
|
+
before any key is created (`MaskingSubjectNotAnIdError`): a name or an email named as the subject
|
|
107
|
+
would be written into the key store in clear. `hmacMasker` under one secret stays as it was.
|
|
108
|
+
|
|
109
|
+
What a masker or a declaration written by hand sees: `MaskingSubject` gains `dataSubject`, set
|
|
110
|
+
only for a masked field declared with `subject` or `subjectOf`; `AuditProjection` gains
|
|
111
|
+
`subjects`, the data subject of each masked value by field, which `auditedFields` fills and a
|
|
112
|
+
projection of your own may fill; `AuditedMessage` gains `subjectless`, optional, the masked fields
|
|
113
|
+
that name no subject, which `auditedFields` lists and a declaration of your own may leave out;
|
|
114
|
+
`AuditMasker` gains `requiresDataSubject`, optional, which a masker keyed per person sets so that
|
|
115
|
+
the middleware checks the declarations at wiring time. Nothing existing changes shape or meaning.
|
|
116
|
+
Part 2 of [privacy by design](../docs/proposals/privacy-by-design.md).
|
|
117
|
+
|
|
118
|
+
**`init` writes `src/platform/privacy/` with `--privacy on`, the default with an ORM, and wires the
|
|
119
|
+
event store with `--event-sourcing on`: a generated project erases and exports a data subject from
|
|
120
|
+
its first minute, and pays no table it did not ask for.** Two choices of the stack, recorded as
|
|
121
|
+
`stack.privacy` and `stack.eventSourcing`, each changed later by `init --force`.
|
|
122
|
+
|
|
123
|
+
`--privacy on` writes `src/platform/privacy/`: a context that erases or exports what it keeps of a
|
|
124
|
+
person lists its port in `data-subject-copies.ts` or `data-subject-exports.ts`; `run-erasure.ts`
|
|
125
|
+
opens an execution context of origin `cli` with the operator as actor and runs `eraseDataSubject`
|
|
126
|
+
of the kernel over the copies, in every tenant with `--tenancy shared-table` (`inEachTenant`);
|
|
127
|
+
`run-export.ts` gathers every record. Two scripts answer the requests: `npm run privacy:erase --
|
|
128
|
+
<subject-id> [--operator <who-asks>]` and `npm run privacy:export -- <subject-id>`, on the sources
|
|
129
|
+
with the variables of `.env`, the tenants named by `TENANTS`. What they cannot reach is said where
|
|
130
|
+
they are written: backups, logs, exports and a copy no context declared. No HTTP command erases yet.
|
|
131
|
+
A project without personal data takes `--privacy off` and gets none of it.
|
|
132
|
+
|
|
133
|
+
`--event-sourcing on`, off unless asked, since keeping an aggregate as its events is a choice made
|
|
134
|
+
per aggregate: `Persistence` gains `eventSourcing` (`create<Orm>EventSourcing` in the `event_store`
|
|
135
|
+
schema, whose five tables the schema file of Knex, Drizzle, Prisma and TypeORM then declares; the
|
|
136
|
+
in-memory stores without a database), and `src/platform/event-sourcing/` holds the `SubjectKeyStore`
|
|
137
|
+
of that store, wrapped by `auditedSubjectKeys` of `@ddd-ts-kit/audit` when the audit trail is on, so
|
|
138
|
+
that every erasure leaves a dated entry, and the `PersonalDataCipher` over it; `event-sourcing.module.ts`
|
|
139
|
+
binds `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` and `PersonalDataCipher`
|
|
140
|
+
on tsyringe, the hand-wired `Platform` carries them as `platform.eventSourcing`, and
|
|
141
|
+
`platform-test.module.ts` binds the in-memory stores, so a handler spec of an event-sourced
|
|
142
|
+
aggregate needs no fake. With both choices on, the erasure destroys the key first. The event store
|
|
143
|
+
of the kit runs on PostgreSQL through the four ORM packages: `--event-sourcing on` is refused with
|
|
144
|
+
`--orm custom`, with what to bind instead, and `generate aggregate --event-sourced` is refused
|
|
145
|
+
while the project has no event store, with the `init --force --event-sourcing on` to run. The
|
|
146
|
+
architecture reference (section 2), the CLI README, the config reference, the event sourcing page,
|
|
147
|
+
the persistence skill and the stack criteria say it.
|
|
148
|
+
|
|
149
|
+
To move: a project generated before this version keeps its platform as it is; `npx ddd-ts-kit init
|
|
150
|
+
--force --privacy on` writes the privacy folder and the two scripts, `npx ddd-ts-kit init --force
|
|
151
|
+
--event-sourcing on` the event store, then a migration creates the tables of the `event_store`
|
|
152
|
+
schema (`npm run db:generate event-store`).
|
|
153
|
+
|
|
154
|
+
**The erasure of a data subject from the tables of a context exists on the four ORMs, from the
|
|
155
|
+
`personalFields` declarations.** `KnexPersonalDataErasure`, `DrizzlePersonalDataErasure`,
|
|
156
|
+
`PrismaPersonalDataErasure` and `TypeOrmPersonalDataErasure` implement the `PersonalDataErasure`
|
|
157
|
+
port of the kernel over the unit of work of their package: the files the rows name are deleted
|
|
158
|
+
from the storage first, then the rows of the subject are deleted (`row`) or pseudonymised
|
|
159
|
+
(`pseudonymise`: a text column reads `[erased]`, a column of any other type nothing, a file column
|
|
160
|
+
nothing), and the rows reached are counted, none the second time. With the `tenant` option every
|
|
161
|
+
statement is confined to the tenant of the work and never widened by an elevation. A subject that
|
|
162
|
+
is not an opaque identifier is refused before any statement; a declaration that names file columns
|
|
163
|
+
without a file storage is refused when the adapter is built, and one that names a column or a
|
|
164
|
+
property the table does not have is refused before any file or row is touched. The types of the columns decide how a
|
|
165
|
+
column is pseudonymised (`pseudonymisedValueOf` of the kernel, the one rule the four follow), read
|
|
166
|
+
from the database on Knex and Prisma, from the table definition on Drizzle, from the entity on
|
|
167
|
+
TypeORM: a personal column that is not a text has to accept null, and a declaration that would
|
|
168
|
+
pseudonymise one that does not is refused before any file or row is touched
|
|
169
|
+
(`NotNullablePersonalColumnError`), so that an erasure never deletes the files of a person and
|
|
170
|
+
leaves their rows in clear. The four pass
|
|
171
|
+
`personalDataErasureContract` of `@ddd-ts-kit/testing`, on PGlite and PostgreSQL. Part 3 of
|
|
172
|
+
[privacy by design](../docs/proposals/privacy-by-design.md); the generator writes the declarations
|
|
173
|
+
in part 5, and the example adopts the adapter in part 11.
|
|
174
|
+
|
|
175
|
+
**The background jobs and the process managers run on a platform wired by hand: NestJS and `--di manual` gain `--queue database|redis`, `generate background-job` and `generate process`.** The platform of a project whose contexts are wired in a module file gains `src/platform/jobs/create-background-work.ts`, which builds the queue a use case enqueues through (`platform.jobQueue`), the worker that consumes it (`platform.backgroundJobs`) and the runner of the process managers (`platform.processes`) on the store `stack.queue` names: the jobs table of Knex or Drizzle, the server of the cache with Redis, the memory of the process otherwise, each job traced and its failures reported as on tsyringe. `init --queue database` and `--queue redis` are accepted with every container (the default stays `database` on Knex or Drizzle with tsyringe, `memory` otherwise), the application starts and stops the worker with its jobs, and `generate background-job` and `generate process` register the job in `<context>.module.ts` (`platform.backgroundJobs.register(..)`) with a spec built on the test buses of `@ddd-ts-kit/testing`, where they were refused before. The generated matrix runs background work on every stack, Nest with the jobs in the database and on Redis among them.
|
|
176
|
+
|
|
177
|
+
To move: a project on Nest or wired by hand that initialised before this version keeps its queue in memory; `init --force --queue database` (Knex or Drizzle) or `--queue redis` (with `--cache redis`) writes `create-background-work.ts` and the stores, then `generate background-job` works as on tsyringe. `PlatformOptions` gains `queues` (concurrency per queue, polling interval, grace period of the worker).
|
|
178
|
+
|
|
179
|
+
**The shared-table tenancy reaches Prisma and TypeORM: `init --tenancy shared-table` and `generate repository --tenant-scoped` work on the four ORMs, and `tenancy/scoped-statement` judges their adapters.** `@ddd-ts-kit/prisma` and `@ddd-ts-kit/typeorm` gain `tenantWhere(scope)`, spread into the where of every read (the tenant of the work, or the tenants an elevation of platform staff reaches), and `ownTenantWhere(scope)`, spread into the where of every update and delete (the one tenant of the work, which an elevation never widens); an inserted row spreads `tenantScopeOf`. Their outbox keeps the tenant of each event so that its consumers run in that tenant: `tenant: true` on `PrismaOutboxStore`, with the `tenantId` field the shipped fragment leaves commented out, and `outboxEntity({ tenant: true })` on TypeORM. Their read model stores take the `tenant` option of the Knex and Drizzle ones: every row written in the tenant of the work, every read, search and write confined to it, the copy of a rebuild included. Both repositories pass `tenantIsolationContract` of `@ddd-ts-kit/testing`, both outboxes the outbox contract with the tenant. `init` accepts `--tenancy shared-table` with `--orm prisma` and `--orm typeorm`: the generated repositories read with `findFirst` or `findOneBy` and `tenantWhere`, write with `ownTenantWhere`, name the tenant on the insert, declare `tenant_id` and an index that starts with it (the Prisma model, `tenantColumn()` on TypeORM), and the generated outbox keeps the tenant. The rule `tenancy/scoped-statement` reads a Prisma statement on the client (a read without `tenantWhere`, a write without `ownTenantWhere`, a create without `tenantScopeOf`, `findUnique` and `upsert`, raw SQL, the client held in a variable) and a TypeORM statement on the manager (the same, `save` and `upsert`, a query builder without the condition, a row handed to `insertIgnoringConflict` that names no tenant, `query`), and a read model store of the four ORMs built without its `tenant`. The generated matrix gains a Prisma and a TypeORM stack on shared tables.
|
|
180
|
+
|
|
181
|
+
To move: a Prisma or TypeORM project that confined its statements by hand with `tenantScopeOf` keeps working; `tenantWhere` in the where of its reads lets an elevation of platform staff read across tenants, and the rule asks for it once the project records `"stack.tenancy": "shared-table"`. A multi-tenant project on Prisma adds `tenantId String? @map("tenant_id")` to its outbox model, migrates, and gives `PrismaOutboxStore` `tenant: true`; on TypeORM it builds its outbox with `outboxEntity({ schema, tenant: true })` and generates the migration that adds the column.
|
|
182
|
+
|
|
183
|
+
**`generate repository --personal <column>,...` declares what a table keeps of a person, and writes the
|
|
184
|
+
erasure of its context: one command, and `npm run privacy:erase` reaches the new copy.** The named
|
|
185
|
+
columns join the storage and the row type of the aggregate as nullable text (the mapper writes them
|
|
186
|
+
empty until the aggregate carries them), and `<aggregate>.personal-fields.ts` declares them next to
|
|
187
|
+
the mapper with `personalFields` of the kernel: the subject column, `id` unless `--subject` names the
|
|
188
|
+
column that holds the id of the person, the fields, and `pseudonymise` unless `--erasure row` asks for
|
|
189
|
+
the row to be deleted; the declaration is spelled as the erasure of the ORM reads it, SQL names on
|
|
190
|
+
Knex and Prisma, properties on Drizzle and TypeORM. The first table of a context that declares
|
|
191
|
+
personal data brings the erasure of the context: the port
|
|
192
|
+
`application/ports/<context>-personal-data-erasure.port.ts` (`extends PersonalDataErasure`), the
|
|
193
|
+
adapter `<orm>-<context>-personal-data-erasure.repository.ts` over `<Orm>PersonalDataErasure` of the
|
|
194
|
+
ORM package (confined to the tenant of the work on a tenant-scoped repository), its fake, a spec that
|
|
195
|
+
saves two people through the repository and proves the erasure on the test database, the binding
|
|
196
|
+
where the context binds its adapters (the decorator in the declared style, the module file otherwise,
|
|
197
|
+
the factory of the hand-wired platform wrapped like any other adapter) and its line in
|
|
198
|
+
`src/platform/privacy/data-subject-copies.ts`. A second table of the same context joins the
|
|
199
|
+
declarations of that adapter. `*.personal-fields.ts` is a file of `infrastructure/persistence/` the
|
|
200
|
+
`naming/suffix` rule knows. Refused before anything is written: a project whose `stack.privacy` is
|
|
201
|
+
off (`init --force --privacy on`), `--orm none` or `custom` (no erasure adapter of the kit reads the
|
|
202
|
+
declaration), a column that is not one, a column the table keeps for itself, a subject listed as
|
|
203
|
+
personal, a mode that does not exist, `--subject` or `--erasure` without `--personal`. The CLI README,
|
|
204
|
+
the scaffold and persistence skills, the architecture reference and the proposal say it; a projection
|
|
205
|
+
keeps its rows in a read model store, not in a table of its own, so its declaration waits for the
|
|
206
|
+
register.
|
|
207
|
+
|
|
208
|
+
Proven end to end on generated projects: through the composed application (the container of
|
|
209
|
+
tsyringe, the platform wired by hand under Nest), two contexts and three tables, one person erased
|
|
210
|
+
from all of them in one run, in every tenant of a multi-tenant project or in the tenants given, the
|
|
211
|
+
key of the event store first when the project has one. That run uncovered a fault of the Knex erasure
|
|
212
|
+
adapter the direct tests could not see: bound in an application, every method of an adapter is
|
|
213
|
+
wrapped by tracing and by the aspects, and a helper that answered a query builder was awaited and its
|
|
214
|
+
chain broken; the helper is a function now, and the Knex spec runs the adapter wrapped the way the
|
|
215
|
+
platform binds it. `init --force`, which rewrites `data-subject-copies.ts`, lists the erasure of each
|
|
216
|
+
context again, as the port or as the factory of the hand-wired platform. The new concept page
|
|
217
|
+
[Personal data in a generated project](../docs/concepts/personal-data.md) draws the erasure end to
|
|
218
|
+
end, what stays out of reach and what the tool does not decide, in both languages.
|
|
219
|
+
|
|
220
|
+
**Mutation testing runs on a project of the kit, with Stryker 10.1.1 and its Vitest runner.** The
|
|
221
|
+
documentation said it did not: Stryker 10.0 executed no test per mutant under Vitest 5. Measured
|
|
222
|
+
on 2026-10-24 on the example application, 10.1.1 runs the tests per mutant and kills 1347 of the
|
|
223
|
+
1441 mutants of the domain layer of its four contexts in 8 minutes, a score of 94.5%; the
|
|
224
|
+
pipeline README holds the measure, the configuration to run it by hand (no checker, the unit
|
|
225
|
+
specs alone, the domain layer as `mutate`) and what shipping it as a scheduled job with a floor
|
|
226
|
+
per context would take. The kit ships no gate yet.
|
|
227
|
+
|
|
228
|
+
**The right of access and to portability comes built in: `KnexPersonalDataExport`,
|
|
229
|
+
`DrizzlePersonalDataExport`, `PrismaPersonalDataExport` and `TypeOrmPersonalDataExport` read the same
|
|
230
|
+
`personalFields` declarations as the erasure, `exportDataSubject` of the kernel gathers every export
|
|
231
|
+
into one dated document, `auditedPersonalDataExport` of the audit package leaves the entry of each
|
|
232
|
+
handover, and `generate repository --personal` writes the export of a context beside its erasure.**
|
|
233
|
+
Each adapter answers one `PersonalDataRecord` per row about the subject in every declared table, under
|
|
234
|
+
`<name>.<table>`, with the personal columns and the keys of the files as plain data, no other column
|
|
235
|
+
and nothing of anyone else; the same `tenant` option confines every statement to the tenant of the
|
|
236
|
+
work, a subject that is not an opaque identifier is refused before any statement, and each passes
|
|
237
|
+
`personalDataExportContract`, whose `source` now reads the name of the exporter alone or followed by
|
|
238
|
+
the table. `exportDataSubject(subject, { exports, inEveryTenant, clock, isKnown })` answers a
|
|
239
|
+
`PersonalDataExportDocument`: `format` (`ddd-ts-kit/personal-data-export@1`), `subject`, `exportedAt`,
|
|
240
|
+
`records`; the exports run in the order listed and one that fails stops the gathering, a mistyped id
|
|
241
|
+
is refused when `isKnown` denies it rather than answered with an empty document, and
|
|
242
|
+
`recordsInEachTenant(scope, tenants)` reaches every tenant as `inEachTenant` does for an erasure
|
|
243
|
+
(both over `eachTenant`). `auditedPersonalDataExport(port, trail, { scope, clock, ids })` wraps a
|
|
244
|
+
port so that every `exportOf` writes an entry of category `data-access` and action
|
|
245
|
+
`personal-data:export` (`PERSONAL_DATA_EXPORT_ACTION`), with the subject as resource, the context,
|
|
246
|
+
the number of records and never the values, before the records are handed over: when the entry
|
|
247
|
+
cannot be written, nothing is handed over. In a generated project, `src/platform/privacy/run-export.ts`
|
|
248
|
+
runs `exportDataSubject` over the exports, each wrapped when the trail is on, and
|
|
249
|
+
`scripts/privacy-export.ts` prints the document as JSON; `generate repository <ctx> <Aggregate>
|
|
250
|
+
--personal <column>,...` writes, once per context, the export port (`extends PersonalDataExport`),
|
|
251
|
+
the adapter over `<Orm>PersonalDataExport`, its fake and its line in `data-subject-exports.ts`, bound
|
|
252
|
+
where the context binds its adapters, and one spec `test/integration/<context>-personal-data.spec.ts`
|
|
253
|
+
proves the erasure and the export; a second table joins the declarations of both adapters, and
|
|
254
|
+
`init --force` lists the exports again. The concept page draws the export end to end with its
|
|
255
|
+
diagram, in both languages, and the kernel, audit, ORM and CLI READMEs, the audit trail page, the
|
|
256
|
+
proposal and the skills say it.
|
|
257
|
+
|
|
258
|
+
**Mutation testing of the domain layer runs every night, each context held to a floor.** `init`
|
|
259
|
+
writes `stryker.config.mjs`, which spreads `governedMutation()` of `@ddd-ts-kit/testing/mutation`:
|
|
260
|
+
the domain layer of every context mutated, at its level and in the modules of its model, the
|
|
261
|
+
texts of refusals left out by an ignorer the kit ships, since a refusal is asserted by its code and
|
|
262
|
+
never by its text, every other string measured, the static mutants ignored, those of code that runs
|
|
263
|
+
once when the module loads, the floor as
|
|
264
|
+
`thresholds`; and `vitest.mutation.config.ts`, the unit specs alone. `npm run test:mutation` runs
|
|
265
|
+
Stryker, then `ddd-ts-kit mutation`, a new command that reads `reports/mutation/mutation.json` and
|
|
266
|
+
holds the domain of each context to the `mutation` floor of `ddd-ts-kit.config.json`, 80 by the
|
|
267
|
+
reference (a lower floor is a recorded deviation, `"what": "mutation.domain"`), and exits 1 under
|
|
268
|
+
it; the ignored mutants of each context are shown beside its score, since a rule written as a
|
|
269
|
+
declaration is never mutated and its test is its only proof. The pipelines of GitHub and GitLab get a
|
|
270
|
+
`mutation` job that runs it when the schedule fires, never on a pull or merge request, and keeps
|
|
271
|
+
the report as an artifact. A new rule, `test/mutation-governed`, refuses a `mutate`,
|
|
272
|
+
`mutator`, `ignorers`, `ignoreStatic` or `thresholds` written by hand in a Stryker config, and a
|
|
273
|
+
Stryker config that does not read the kit. The example application and the pipeline of the kit run
|
|
274
|
+
the same job. On both runners: a project on Jest gets `jest.mutation.config.js` in place of the
|
|
275
|
+
Vitest one, and its Stryker config passes the ES modules flag to the processes that run the specs.
|
|
276
|
+
|
|
277
|
+
To move: `npm i -D @stryker-mutator/core @stryker-mutator/vitest-runner` (`jest-runner` on Jest),
|
|
278
|
+
copy `stryker.config.mjs` and `vitest.mutation.config.ts` or `jest.mutation.config.js` from a
|
|
279
|
+
freshly initialised project (or run `init --force` on a copy and take the two files and the
|
|
280
|
+
`test:mutation` script), add the
|
|
281
|
+
`mutation` job to your pipeline from `pipeline/github/workflows/ci.yml` or
|
|
282
|
+
`pipeline/gitlab/.gitlab-ci.yml`, list `vitest.mutation.config.ts` under `vitest.config` of
|
|
283
|
+
`knip.json`, and add `.stryker-tmp/` and `/reports/mutation/` to `.gitignore`. Run
|
|
284
|
+
`npm run test:mutation` once: a context under 80 names the rules its tests do not state.
|
|
285
|
+
|
|
286
|
+
**Six rules of `@ddd-ts-kit/eslint-plugin` hold the shape of a test.** The testing skill asked
|
|
287
|
+
for it and nothing checked it: a test is named after the rule it proves, holds no logic, asserts an
|
|
288
|
+
outcome, asserts a refusal by its code, never by a snapshot, and every test runs. Each is a rule
|
|
289
|
+
of the architecture reference now, on every test file of the project (`*.spec.ts`, `*.test.ts`,
|
|
290
|
+
the `test/` of a context), read by ESLint alone: `test/no-only-no-skip` (no `.only`, `.skip`, `fit`,
|
|
291
|
+
`xit`, `xdescribe`, no `.skipIf` or `.runIf` on a constant), `test/title-states-a-rule` (the title of an `it`
|
|
292
|
+
in lower case, what the subject does, after the rows and the criterion it cites, never `should`,
|
|
293
|
+
`test`, `works` nor a method or a class; a `describe` named after the unit),
|
|
294
|
+
`test/no-logic` (no `if`, `switch`, ternary, loop or `try` in a test), `test/assertion-present`
|
|
295
|
+
(an `expect`, an `expect...` or `assert...` helper, or `thenEvents`, `thenError`, `thenState` in
|
|
296
|
+
every test; `it('title')` without a body written `it.todo`), `test/refusal-by-code` (`toThrow`
|
|
297
|
+
with a message, a regular expression, a class or nothing reported in the specs of the model and of
|
|
298
|
+
the application, not in those of the adapters and of the platform; `thenError`, `expectRefusal`,
|
|
299
|
+
`rejects.toMatchObject({ code })` and `expectProblem` instead, and `rejects.toBe(outage)` for a
|
|
300
|
+
failure the test injected) and
|
|
301
|
+
`test/no-snapshot`. `ddd-ts-kit rules` lists them as checked by the plugin, `ddd-ts-kit explain`
|
|
302
|
+
explains each, the config sets their severity under `rules`. The `it.todo` left in a spec was
|
|
303
|
+
already a marker `ddd-ts-kit todo` lists and `story --gate close` refuses while it belongs to the
|
|
304
|
+
story: the testing strategy and the skill now say so. The example application and the templates
|
|
305
|
+
follow the six rules; the rules of the agents on tests (`.claude/rules/tests.md`,
|
|
306
|
+
`.github/instructions/tests.instructions.md`) name them.
|
|
307
|
+
|
|
308
|
+
To move: run `npm run lint`. `test/no-only-no-skip` and `test/no-snapshot` are errors, as nothing
|
|
309
|
+
legitimate trips them; the four rules that read what a test says, `test/title-states-a-rule`,
|
|
310
|
+
`test/no-logic`, `test/assertion-present` and `test/refusal-by-code`, are warnings until 0.90.0,
|
|
311
|
+
listed by `ddd-ts-kit lint` after its report without failing it. Rename a title that says
|
|
312
|
+
`should` or names a method, move a loop to an `it.each` and a decision to a builder or a fake,
|
|
313
|
+
replace a `toThrow('message')` by the code of the refusal, and write `it.todo` where a test has
|
|
314
|
+
no body. A project that wants none of a rule sets it to `off` under `rules` of
|
|
315
|
+
`ddd-ts-kit.config.json`.
|
|
316
|
+
|
|
317
|
+
**A pull request gets a reading of its mutation score, the night keeps the whole measure.** The
|
|
318
|
+
pipelines of GitHub and GitLab get a `mutation-changed` job on a pull or merge request: it reuses
|
|
319
|
+
the report of the last night for what the change leaves alone (Stryker's incremental mode, turned
|
|
320
|
+
on by `governedMutation()` when `DDD_TS_KIT_MUTATION_SINCE` names the merge base of the change,
|
|
321
|
+
the results kept in `reports/mutation/incremental.json` beside the report), runs everything again
|
|
322
|
+
when the change touches code the tests lean on and Stryker does not diff (a fake, a builder, a
|
|
323
|
+
world, the platform, a dependency), and lists the survivors of the files the change touched:
|
|
324
|
+
`ddd-ts-kit mutation` reads the same variable (`--changed <ref>` says it by hand) and exits 0
|
|
325
|
+
whatever the scores, a reading and never a gate, so that `npm run test:mutation` is the one script
|
|
326
|
+
of the night and of a pull request. `ddd-ts-kit mutation --survivors` lists every survivor of the
|
|
327
|
+
report, where, what mutator and what the code became. `test/mutation-governed` also refuses `incremental` and `force` written by
|
|
328
|
+
hand.
|
|
329
|
+
|
|
330
|
+
To move: add the `mutation-changed` job to your pipeline from `pipeline/github/workflows/ci.yml` or
|
|
331
|
+
`pipeline/gitlab/.gitlab-ci.yml`; nothing else changes, the Stryker config spreads
|
|
332
|
+
`governedMutation()` already.
|
|
333
|
+
|
|
334
|
+
**The invariants of a value object are stated as properties, with fast-check.** `fast-check` joins
|
|
335
|
+
the development dependencies with the first property (`npm i -D fast-check`, under Vitest as under
|
|
336
|
+
Jest: a project without a property carries no dead dependency); `fc.assert(fc.property(..))` is an
|
|
337
|
+
assertion for `test/assertion-present`; and the spec `generate value-object` writes ends with a
|
|
338
|
+
planned rule, `keeps its invariants for any value a generator can produce, as a property`, to remind
|
|
339
|
+
of it. A property states a law of the model once and checks it on generated values, the failing one
|
|
340
|
+
printed with its seed and shrunk to the smallest: two ranges overlap in both directions or in none,
|
|
341
|
+
a slot is held at least until it ends, a parse then a format gives the value back. The example
|
|
342
|
+
states four on its ranges and slots. A property is for a law, an invariant, a symmetry, a round trip,
|
|
343
|
+
an idempotence; the orchestration of a use case is stated by its scenarios. The testing skill and
|
|
344
|
+
the testing strategy say when and how.
|
|
345
|
+
|
|
346
|
+
To move: `npm i -D fast-check`, then state the first law a value object of yours holds for every
|
|
347
|
+
value.
|
|
348
|
+
|
|
349
|
+
**An erasure now reaches beyond the database the platform holds: `privacy:erase` announces
|
|
350
|
+
`privacy.data-subject.erased` through the outbox once every copy is erased, `generate
|
|
351
|
+
erasure-handler <context>` writes the idempotent handler of a context that erases its own copy, and
|
|
352
|
+
an integration event says which fields of its payload are personal, and whose.** The event is
|
|
353
|
+
`dataSubjectErasedV1` of `@ddd-ts-kit/kernel`, version 1, `{ subjectId, erasedAt }`:
|
|
354
|
+
the id of the person and nobody else, the operator staying in the audit trail that the correlation id
|
|
355
|
+
of the event leads to, a name or an email refused at `create` (`InvalidDataSubjectErasedError`). It lives
|
|
356
|
+
in the kernel because the application layer of every context handles it, and it is shaped as a
|
|
357
|
+
definition of `@ddd-ts-kit/events`, so that the registry, the catalog, AsyncAPI, `on`, `consume`,
|
|
358
|
+
`@IntegrationEventHandler` and the container take it as any other. A generated project with
|
|
359
|
+
`--privacy on` publishes it at the end of `runErasure`, once per tenant with shared tables, never
|
|
360
|
+
after a failed erasure, and lists it in its event catalog and AsyncAPI document with the contexts
|
|
361
|
+
that consume it. `generate erasure-handler <context>` writes
|
|
362
|
+
`application/integration/handlers/data-subject-erased.integration-handler.ts` over the
|
|
363
|
+
`<Context>PersonalDataErasure` of the context, its spec on the fake, and its subscription under the
|
|
364
|
+
consumer name `<context>.data-subject-erased`: the decorator in the declared style, the module file
|
|
365
|
+
of an explicit context, the hand-wired platform with the adapter wrapped as any other (in a
|
|
366
|
+
transaction behind a broker); it refuses a context that has no erasure yet. `defineIntegrationEvent`
|
|
367
|
+
takes `personal: { subject, fields }`, checked against the fields the payload schema documents (no
|
|
368
|
+
field, a field twice, a personal subject or an unknown path is refused), written by the catalog
|
|
369
|
+
under the payload and by AsyncAPI as `x-personal-data` on the message. The events, kernel and CLI
|
|
370
|
+
READMEs, the concept page and its diagram, the proposal and the persistence and integration event
|
|
371
|
+
skills say it, in English and in French.
|
|
372
|
+
|
|
373
|
+
**The mutation score holds the application layer too, at a floor of its own.** `governedMutation()`
|
|
374
|
+
mutates the application layer of every context beside its domain, at its level and in the modules
|
|
375
|
+
of its model, and `ddd-ts-kit mutation` scores each layer of each context against its floor: the
|
|
376
|
+
`mutation` key of `ddd-ts-kit.config.json` takes `"application"` beside `"domain"`, 75 by the
|
|
377
|
+
reference, five below the domain as the coverage reference steps down from one layer to the next,
|
|
378
|
+
and lowering it is a recorded deviation (`"what": "mutation.application"`). The use cases hold
|
|
379
|
+
rules the domain does not: the permission a command requires, the idempotence of a handler, the
|
|
380
|
+
event it publishes, the refusal it relays; a survivor there is a rule no test states as much as in
|
|
381
|
+
an aggregate. On the example the application layer scores 95.7, its lowest context 93.5, and the
|
|
382
|
+
run grows by twenty seconds: the initial test run is what the night pays for, not the mutants.
|
|
383
|
+
|
|
384
|
+
To move: nothing, unless a context sits under 75 on its application layer: `npm run test:mutation`
|
|
385
|
+
names the survivors to read, a test to write for each rule, or a deviation to record.
|
|
386
|
+
|
|
387
|
+
**The audit trail of a generated project on Prisma or TypeORM is kept in its database, no longer in
|
|
388
|
+
the memory of the process: `@ddd-ts-kit/audit/prisma` and `@ddd-ts-kit/audit/typeorm` give
|
|
389
|
+
`PrismaAuditTrail` and `TypeOrmAuditTrail`, held to the same contract as the Knex and Drizzle
|
|
390
|
+
stores.** Until now `--orm prisma` and `--orm typeorm` started on an `InMemoryAuditTrail` behind a
|
|
391
|
+
`TODO(platform)`, so the proof of every command, decision, erasure, export and purge was lost when
|
|
392
|
+
the process stopped. The four stores share one PostgreSQL implementation (the hash chain, the head
|
|
393
|
+
locked per chain, the entries written at the commit of the unit of work). `auditPrismaModels(schema)`
|
|
394
|
+
gives the two Prisma models and `auditEntities({ schema })` the two TypeORM entities; their specs
|
|
395
|
+
prove that, created by the migrations of a project, they give the columns, the keys and the
|
|
396
|
+
indexes of `createAuditTables`. On Prisma the statements are raw ones on the client of the unit of
|
|
397
|
+
work, an append inside a transaction takes a savepoint, a failure of the database comes back with
|
|
398
|
+
its SQLSTATE as `code`, and the reader asks PostgreSQL for the instant in UTC, since the adapter of
|
|
399
|
+
pg reads a `timestamptz` without the offset of the session (the shared reader does so for every
|
|
400
|
+
store). `init --audit on` with Prisma or TypeORM writes the models in `prisma/schema.prisma` (the
|
|
401
|
+
`audit` schema added to the datasource) or the entities in `schema.ts`, binds the store in
|
|
402
|
+
`create-audit.ts`, adds `npm run db:audit-guard` for the append-only guard to paste in a
|
|
403
|
+
migration, and the test databases install that guard and leave the trail out of `reset()`.
|
|
404
|
+
|
|
405
|
+
To move: a project on Prisma or TypeORM with `--audit on` runs `init --force` to get the store, then
|
|
406
|
+
generates a migration for the two tables and adds one holding what `npm run db:audit-guard`
|
|
407
|
+
prints.
|
|
408
|
+
|
|
409
|
+
**Each spec file is held to the time budget of its level.** The reporter of the test runner the kit
|
|
410
|
+
ships, `@ddd-ts-kit/testing/budget/vitest` and `@ddd-ts-kit/testing/budget/jest`, named in the runner
|
|
411
|
+
config `init` writes and passed with `--reporter` where the pipeline names its reporters, reads the
|
|
412
|
+
`budget` key of `ddd-ts-kit.config.json`, five seconds for a unit spec file and thirty for an
|
|
413
|
+
integration spec file by the reference, names the slowest spec of each level at the end of every run,
|
|
414
|
+
and warns when a spec file took more than its budget, its tests and hooks timed, the loading of its modules left out; `"enforce": true` under `budget` makes it fail the run, once the measures of a project are stable, since a duration depends on the load of the machine as much as on the spec. A unit
|
|
415
|
+
spec of a context runs the model and the use cases on fakes; an integration spec of a context, and a
|
|
416
|
+
spec of the platform, opens a database or reaches a server; the specs of the application outside the
|
|
417
|
+
contexts (end to end, acceptance, architecture) are not held. A slow spec hides a world rebuilt per
|
|
418
|
+
test, I/O behind a fake, or a wait: lowering a budget is free, raising one above the reference is a
|
|
419
|
+
recorded deviation (`"what": "budget.unit"`), and a budget that is no duration is reported by
|
|
420
|
+
`config/valid`. On the example, the slowest unit spec takes 1.6 seconds and the slowest integration
|
|
421
|
+
spec 11, under load.
|
|
422
|
+
|
|
423
|
+
To move: name the reporter in your runner config, `reporters: ['default', '@ddd-ts-kit/testing/budget/vitest']`
|
|
424
|
+
(or `budget/jest`), and in the commands of your pipeline that pass `--reporter`.
|
|
425
|
+
|
|
426
|
+
**The oldest entries of the audit trail leave the database for the file storage, verified and
|
|
427
|
+
anchored: `archiveBefore(date, { files, clock })` on the four SQL stores and on
|
|
428
|
+
`InMemoryAuditTrail`, and a generated project archives every month what is older than the twelve
|
|
429
|
+
whole months it keeps online.** Each entry keeps the identifiers of a person, and a trail grows
|
|
430
|
+
for as long as the system lives (GDPR article 5(1)(e)). For each chain, in one transaction
|
|
431
|
+
holding its head, the entries after the last archive and older than the date are verified from
|
|
432
|
+
the anchor of the archive before them, written to one file (`audit-archives/<chain>/<from>-<to>.ndjson`,
|
|
433
|
+
one canonical JSON per line), recorded in the new `audit_archives` table with their last hash
|
|
434
|
+
and the SHA-256 of the file, then deleted: the guard of the trail lets a `DELETE` through only
|
|
435
|
+
for entries an archive covers, and refuses any change to the archives. A chain that does not
|
|
436
|
+
verify is refused (`AuditArchiveRefusedError`) and keeps every entry. `archivesOf(chain)` lists
|
|
437
|
+
the archives, `verifyArchive(text, archive, previous)` checks a file again, and `verifyChain`
|
|
438
|
+
takes `after`, the anchor the entries left in the database start from. `ArchiveAuditEntries` is
|
|
439
|
+
the scheduled job; `init` registers it as `audit.archive` (first day of the month, 04:00 UTC,
|
|
440
|
+
`JOB_AUDIT_ARCHIVE_ENABLED=false` switches it off) when the trail is in a database and the
|
|
441
|
+
project keeps files in a storage, and declares the archives with the rest of the trail on the
|
|
442
|
+
four ORMs. Archiving moves, it does not erase: how long the files are kept is the controller's
|
|
443
|
+
decision.
|
|
444
|
+
|
|
445
|
+
To move: a trail created before this version adds the archives once, in a migration:
|
|
446
|
+
`addAuditArchives(knex, { schema: 'audit' })` on Knex; on Drizzle, Prisma and TypeORM, `init
|
|
447
|
+
--force` declares the table, the migration of the ORM creates it, and a migration of your own
|
|
448
|
+
runs the statements of `auditArchiveUpgradeStatements('audit')` (the guard that lets archived
|
|
449
|
+
entries go, and the guard of the archives). Until then, `archiveBefore` fails on the missing
|
|
450
|
+
table and the job reports the failed run.
|
|
451
|
+
|
|
452
|
+
**In a context wired by hand (`--di manual`, `--di nest`), `generate repository` no longer creates
|
|
453
|
+
the repository in the module file: the first `generate command --aggregate` that needs it does, and
|
|
454
|
+
the next one finds it there.** Until now the module file of a context with a repository and no
|
|
455
|
+
command yet held a constant nothing read, and its import, which the lint of the project refused
|
|
456
|
+
(`no-unused-vars`). `declarations/port-adapter-wired` agrees: an adapter whose port no class needs
|
|
457
|
+
yet (no file outside the infrastructure and the tests names it, but the one that declares it) is not
|
|
458
|
+
reported, since nothing misses it at run time.
|
|
459
|
+
|
|
460
|
+
To move: nothing. A module file written by an earlier version keeps its constant; the next command
|
|
461
|
+
on the same aggregate finds it and adds nothing.
|
|
462
|
+
|
|
463
|
+
**What a table keeps of a person can now be kept for a set time: `personalFields` takes a
|
|
464
|
+
`retention`, the erasure adapters of the four ORMs purge what outlived it, and a generated project
|
|
465
|
+
runs that purge every night, audited.** `retention: { after, days | months | years }` counts the
|
|
466
|
+
period from a date column of the row that is not personal data, one positive unit (refused
|
|
467
|
+
otherwise); a row whose date is empty never expires. The kernel adds the port
|
|
468
|
+
`PersonalDataRetention` (`purgeExpired(now)`), `purgeExpiredPersonalData(now, retentions)`, which
|
|
469
|
+
runs every copy at one instant and answers the rows each reached, `expiredBefore` and
|
|
470
|
+
`isPersonalDataRetention`; `InMemoryPersonalData` implements it, and
|
|
471
|
+
`personalDataRetentionContract` of `@ddd-ts-kit/testing` holds every adapter to it. The erasure
|
|
472
|
+
adapters of Knex, Drizzle, Prisma and TypeORM implement `purgeExpired` from the same declarations,
|
|
473
|
+
as the declaration says, files first, in the tenant of the work or in every tenant when the work
|
|
474
|
+
names none: the one write of the kit across tenants, chosen because a tenant left out of a list
|
|
475
|
+
would keep what it should not, bounded to an erasure by the date of the row, and written in the
|
|
476
|
+
multitenancy page. `auditedPersonalDataRetention` of `@ddd-ts-kit/audit` records each purge (`data-access`,
|
|
477
|
+
`personal-data:purge`, the context, `changes: { rows }`, no person). `generate repository ...
|
|
478
|
+
--personal ... --retention <column>:<n><d|m|y>` writes the retention in the declaration, adds a
|
|
479
|
+
column that dates the end of the relation to the storage as a nullable timestamp, empty while it
|
|
480
|
+
lasts (it refuses `registered_at` and the other columns the table keeps for itself: counted from the
|
|
481
|
+
registration, the purge would erase people who are still customers), and proves the purge in the
|
|
482
|
+
generated spec. `init --privacy on` writes `src/platform/privacy/run-purge.ts`, schedules
|
|
483
|
+
`privacy.purge-expired` every night at 03:00 UTC (the privacy module on tsyringe, the platform wired
|
|
484
|
+
by hand), switched off by `JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false`, and the script `privacy:purge`.
|
|
485
|
+
The concept page, the kernel, audit, ORM and CLI READMEs, the proposal and the skills say it, in
|
|
486
|
+
English and in French.
|
|
487
|
+
|
|
488
|
+
To move: `init --force` on a project with `--privacy on` writes the purge runner, the job and the
|
|
489
|
+
script; a declaration without `retention` purges nothing.
|
|
490
|
+
|
|
491
|
+
**`ddd-ts-kit docs` writes the register of personal data from the code: a Personal data section in
|
|
492
|
+
each `CONTEXT.md`, and with `--privacy on` the file `docs/privacy/register.md`, held to the code by
|
|
493
|
+
`docs --check`.** It reads every `personalFields` call of `infrastructure/persistence/*.personal-fields.ts`,
|
|
494
|
+
the one `generate repository --personal` writes or one written by hand (several per file), and the
|
|
495
|
+
`personal` option of the integration events. Each table is one row: the column that names the
|
|
496
|
+
person, the personal columns and files, what an erasure does (`pseudonymised`, `row deleted`), how
|
|
497
|
+
long the rows are kept (`36 months after ended_at`, or `until erased`); the columns are named as the
|
|
498
|
+
database names them on the four ORMs, a Drizzle or TypeORM declaration read back through the table it
|
|
499
|
+
names. The register adds the integration events that carry personal data and the contexts
|
|
500
|
+
downstream of their producer. It is not the record of processing activities of GDPR article 30:
|
|
501
|
+
the purposes, the lawful basis, the recipients outside the system and what the code does not purge
|
|
502
|
+
are sections around the markers that the controller writes and `docs` keeps.
|
|
503
|
+
|
|
504
|
+
To move: nothing to do. The next `npx ddd-ts-kit docs` (or `generate`) of a project with
|
|
505
|
+
`stack.privacy: "on"` creates `docs/privacy/register.md`, and adds the Personal data section to the
|
|
506
|
+
`CONTEXT.md` of each context that declares personal data; commit both, `docs --check` holds them
|
|
507
|
+
from then on.
|
|
508
|
+
|
|
509
|
+
**`ddd-ts-kit check` holds a project whose `stack.privacy` is `on` to its declarations of personal
|
|
510
|
+
data, with five new rules, all warnings: `privacy/declared-field`, `privacy/event-payload-declared`,
|
|
511
|
+
`privacy/erasure-reaches-copies`, `privacy/subject-is-opaque` and `privacy/no-personal-data-in-logs`.**
|
|
512
|
+
The erasure, the export, the retention and the register read the `personalFields` declarations and
|
|
513
|
+
the `personal` option of the integration events, never the columns: a copy of a person nobody
|
|
514
|
+
declared is a copy nobody erases, and nothing failed until now.
|
|
515
|
+
|
|
516
|
+
- `privacy/declared-field`: a column of a table of a context (Knex, Drizzle, TypeORM, and the Prisma
|
|
517
|
+
models in the schema of the context) whose name holds a word of the personal vocabulary and that
|
|
518
|
+
no declaration of its context names.
|
|
519
|
+
- `privacy/event-payload-declared`: a field of the payload of an integration event named like
|
|
520
|
+
personal data that its `personal` option does not list.
|
|
521
|
+
- `privacy/erasure-reaches-copies`: a context that consumes an event carrying personal data (a
|
|
522
|
+
handler, a projection, a process manager) and declares no `PersonalDataErasure` and handles no
|
|
523
|
+
`privacy.data-subject.erased`.
|
|
524
|
+
- `privacy/subject-is-opaque`: the subject of a declaration or of an event that is personal data
|
|
525
|
+
itself, or one of its personal fields.
|
|
526
|
+
- `privacy/no-personal-data-in-logs`: a call to the logger or to the metrics that names a declared
|
|
527
|
+
personal field.
|
|
528
|
+
|
|
529
|
+
The identity preset declares what it keeps of people when `stack.privacy` is `on`: the address and
|
|
530
|
+
the name of an account (pseudonymised when the person is erased) and the address an invitation was
|
|
531
|
+
sent to (the row deleted thirty days after the invitation expired, by the nightly purge), with the
|
|
532
|
+
erasure and the export of the context written and listed in the platform, not confined to a tenant
|
|
533
|
+
since its tables belong to none.
|
|
534
|
+
|
|
535
|
+
The vocabulary is the one of the kit (`email`, `phone`, `first_name`, `birth_date`, `address`,
|
|
536
|
+
`iban`, `ip_address` and the others listed in the configuration reference); the new config key
|
|
537
|
+
`privacy`, `{ "vocabulary": [...], "allow": [...] }`, adds the words of the business and removes a
|
|
538
|
+
word that never names a person in the project. A project with `stack.privacy` off, or whose config
|
|
539
|
+
predates the choice, is not judged.
|
|
540
|
+
|
|
541
|
+
To move: nothing blocks. `npx ddd-ts-kit check --rule privacy/declared-field` (and the four others)
|
|
542
|
+
lists what to take up: declare the column (`generate repository ... --personal`), list the field in
|
|
543
|
+
`personal: { subject, fields }`, erase the copy (`generate erasure-handler` for a service of its own),
|
|
544
|
+
or record a column that holds nothing of a person, `// ddd-ts-kit-disable-next-line
|
|
545
|
+
privacy/declared-field -- ADR-NNNN: <why>` or a word of `privacy.allow`. The rules stay warnings:
|
|
546
|
+
they read names, never contents, so a column `address` of a warehouse is reported as well as the
|
|
547
|
+
address of a person; no later version turns them into errors. A team that wants them blocking sets
|
|
548
|
+
`"rules": { "privacy/declared-field": "error" }` in ddd-ts-kit.config.json, rule by rule.
|
|
549
|
+
|
|
550
|
+
**The monthly archive of the audit trail runs by default only when the files of the project are in
|
|
551
|
+
an object store, and no entry leaves the database before its file reads back from the storage as it
|
|
552
|
+
was written.** An archive removes the entries from the database; with `--storage local`, the default
|
|
553
|
+
of `init`, the files are on the disk of the server, which a redeployment may wipe and a backup may
|
|
554
|
+
not reach, and the proof of who did what would be lost a year after going live. A generated project
|
|
555
|
+
with `--storage s3` keeps the job on (`JOB_AUDIT_ARCHIVE_ENABLED=false` switches it off); one with
|
|
556
|
+
`--storage local` writes it off, and `JOB_AUDIT_ARCHIVE_ENABLED=true` switches it on once that disk
|
|
557
|
+
is durable and backed up, which `job-settings.ts` says next to the line. `archiveBefore` of the
|
|
558
|
+
four SQL stores and of `InMemoryAuditTrail` reads each file back and checks its digest before the
|
|
559
|
+
entries are removed: a storage that did not keep it is refused with the new
|
|
560
|
+
`AuditArchiveNotStoredError`, and the trail keeps every entry.
|
|
561
|
+
|
|
562
|
+
To move: a project generated with `--storage local` by the previous version has the job on; change
|
|
563
|
+
its line of `src/platform/jobs/job-settings.ts` to
|
|
564
|
+
`'audit.archive': { enabled: environment['JOB_AUDIT_ARCHIVE_ENABLED'] === 'true' }`, or keep it on
|
|
565
|
+
where the files already land on a durable, backed-up disk.
|
|
566
|
+
|
|
567
|
+
**The scheduling example declares what it keeps of people and erases and exports it through the
|
|
568
|
+
ports of the kit: `personalFields` in each context, a `PersonalDataErasure` and a
|
|
569
|
+
`PersonalDataExport` per context over the adapters of `@ddd-ts-kit/knex`, `eraseDataSubject` and
|
|
570
|
+
`exportDataSubject` of the kernel, and the register and the privacy rules on.** The persons of
|
|
571
|
+
identity and the contacts of notification are deleted, the notes, the cancellation reasons, the
|
|
572
|
+
documents and the copied names of scheduling pseudonymised; notification keeps its own erasure,
|
|
573
|
+
which deletes a contact under a stamp so that a redelivered announcement does not bring the address
|
|
574
|
+
back. The hand-written erasure engine of the example is gone, its platform folder is
|
|
575
|
+
`src/platform/privacy/`, `npm run erase:patient` becomes `npm run privacy:erase`, and `npm run
|
|
576
|
+
privacy:export` hands over one dated document of what every context keeps of a person, every
|
|
577
|
+
handover audited. `identity.person.registered` and `identity.practice.member-added` declare their
|
|
578
|
+
personal fields, so the event catalog and AsyncAPI say so; `docs/privacy/register.md` is generated,
|
|
579
|
+
with the sections a controller writes filled in as an illustration.
|
|
580
|
+
|
|
581
|
+
To move: nothing for a project. For a reader of the example: run `npm run privacy:erase` where
|
|
582
|
+
`npm run erase:patient` was run; the report names each copy by its context (`identity`,
|
|
583
|
+
`notification`, `scheduling`) and counts the rows reached.
|
|
584
|
+
|
|
585
|
+
**The tests are read back as a document: `ddd-ts-kit docs` writes `docs/behaviour/`, one page per
|
|
586
|
+
context of what its tests state.** Each page lists, in the words of the test titles, the rules of
|
|
587
|
+
the context grouped as the specs group them (`describe` and `it`, a table of cases as one rule), with
|
|
588
|
+
the role of each spec (`slot (value object), in calendars`), a planned rule (`it.todo`) and a spec
|
|
589
|
+
put aside said so, and the counts; `docs/behaviour/application.md` does the same for the specs
|
|
590
|
+
outside the contexts (end to end, acceptance, architecture) and `docs/behaviour/README.md` indexes
|
|
591
|
+
them. `npm run docs:generate` writes them with the other generated documents, the pre-commit hook `init` writes regenerates and adds them when a spec is staged, with `ddd-ts-kit docs --behaviour`, which writes those pages alone, and `docs --check` holds them
|
|
592
|
+
current, so a spec whose title changed never reaches the trunk without its page. This
|
|
593
|
+
is the reading the business asks of Gherkin, without a second language to keep in step: the title of
|
|
594
|
+
a test, which `test/title-states-a-rule` makes a rule, is the sentence. Under `generate --local-only`
|
|
595
|
+
the pages are left to the trunk, as every shared file is.
|
|
596
|
+
|
|
597
|
+
To move: run `npm run docs:generate` once and commit `docs/behaviour/`; add the `behaviour pages`
|
|
598
|
+
job to the `pre-commit` of your `lefthook.yml` from `pipeline/lefthook.yml`.
|
|
599
|
+
|
|
7
600
|
## 0.88.0
|
|
8
601
|
|
|
9
602
|
**The code list and the permission set of a context sit at its root: `<context>.codes.ts` and `<context>.permissions.ts`.** They are one per context, whatever its modules, so they now sit next to `CONTEXT.md` and `<context>.declarations.ts` instead of `domain/errors/codes.ts` and `application/authorization/<context>.permissions.ts`. `domain/errors/` holds the refusal classes, `application/authorization/` the policies, and a folder that held the code list or the permission set alone is gone. In a context divided into modules, `domain/` and `application/` now hold nothing but their modules. Every rule reads the two files as it read them in their role folder: `<context>.codes.ts` is the code list of the domain for `errors/*`, `naming/suffix` and the layer rules, `<context>.permissions.ts` the permission set of the application for `authz/*`. `ddd-ts-kit check`, the ESLint plugin and the generated `.dependency-cruiser.cjs` follow (the domain may import the code list of its context, the application both files). The generators, the templates, the identity preset and `error-factories` write them at the root, and knip is told of the code types as `src/contexts/*/*.codes.ts`, and also where 0.86 and 0.87 kept them as long as one context still holds its list there (`init`, `generate` and `context-layout` keep the two patterns in step with the tree). `ddd-ts-kit context-layout [<context>...] [--dry-run]` is new: it moves the two files of every context, or of the ones named, from where 0.86 and 0.87 wrote them to the root, rewrites every import of them under the source root, `test/` and `scripts/`, removes a role folder the move leaves empty, writes again what derives from the tree (`.dependency-cruiser.cjs`, the generated declarations) and tells knip of the code lists where they now are; it says each file it wrote, `--dry-run` included.
|