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
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
{{#if http.any}}
|
|
5
|
+
import { offlineAuthenticator } from '{{alias.platform}}/auth/authentication/offline-authenticator{{alias.ext}}';
|
|
6
|
+
{{/if}}
|
|
7
|
+
import { composeApplication } from '{{alias.platform}}/composition/compose-application{{alias.ext}}';
|
|
8
|
+
{{#if persistence.needsUrl}}
|
|
9
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
12
|
+
import { inProcessEvents } from '{{alias.platform}}/events/in-process-events{{alias.ext}}';
|
|
13
|
+
import { runExport } from '{{alias.platform}}/privacy/run-export{{alias.ext}}';
|
|
14
|
+
|
|
15
|
+
// The right of access and to portability of one data subject (GDPR, articles 15 and 20), from the
|
|
16
|
+
// command line:
|
|
17
|
+
// npm run privacy:export -- <subject-id> [--operator <who-asks>] > export.json
|
|
18
|
+
// One JSON document on the standard output (`format`, `subject`, `exportedAt`, `records`): every
|
|
19
|
+
// record each context declared in src/platform/privacy/data-subject-exports.ts keeps of the
|
|
20
|
+
// person{{#if tenancy.any}}, in each tenant of TENANTS (comma separated){{/if}}, as plain data. Hand it over to the person, then delete
|
|
21
|
+
// the file{{#if audit.on}}; the audit trail keeps the entry of each export, never the values. Every run is a
|
|
22
|
+
// handover and leaves its entry, a trial included: try it on a test subject, never on a real person{{/if}}.
|
|
23
|
+
{{#if eventSourcing.on}}
|
|
24
|
+
// What this script cannot reach: the stored events (read them through the aggregate), backups,
|
|
25
|
+
// logs and the copies no context declared.
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{#unless eventSourcing.on}}
|
|
28
|
+
// What this script cannot reach: backups, logs and the copies no context declared.
|
|
29
|
+
{{/unless}}
|
|
30
|
+
const { positionals, values } = parseArgs({
|
|
31
|
+
allowPositionals: true,
|
|
32
|
+
options: { operator: { type: 'string', default: os.userInfo().username } },
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const [subject] = positionals;
|
|
36
|
+
|
|
37
|
+
if (subject === undefined || positionals.length > 1) {
|
|
38
|
+
console.error('Usage: npm run privacy:export -- <subject-id> [--operator <who-asks>]');
|
|
39
|
+
process.exit(2);
|
|
40
|
+
}
|
|
41
|
+
{{#if tenancy.any}}
|
|
42
|
+
|
|
43
|
+
const tenants = (process.env['TENANTS'] ?? '').split(',').map((tenant) => tenant.trim()).filter((tenant) => tenant !== '');
|
|
44
|
+
|
|
45
|
+
if (tenants.length === 0) {
|
|
46
|
+
console.error('TENANTS names the tenants the records are gathered in, comma separated.');
|
|
47
|
+
process.exit(2);
|
|
48
|
+
}
|
|
49
|
+
{{/if}}
|
|
50
|
+
|
|
51
|
+
{{#if persistence.needsUrl}}
|
|
52
|
+
const persistence = {{persistence.await}}openPersistence(loadConfig(process.env));
|
|
53
|
+
{{/if}}
|
|
54
|
+
{{#unless persistence.needsUrl}}
|
|
55
|
+
const persistence = openPersistence();
|
|
56
|
+
{{/unless}}
|
|
57
|
+
|
|
58
|
+
const application = composeApplication(persistence, {
|
|
59
|
+
events: inProcessEvents(),
|
|
60
|
+
{{#if http.any}}
|
|
61
|
+
authenticator: offlineAuthenticator,
|
|
62
|
+
{{/if}}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const document = await runExport(subject, {
|
|
67
|
+
platform: application.platform,
|
|
68
|
+
operator: values.operator,
|
|
69
|
+
correlationId: randomUUID(),
|
|
70
|
+
{{#if tenancy.any}}
|
|
71
|
+
tenants,
|
|
72
|
+
{{/if}}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
console.log(JSON.stringify(document, null, 2));
|
|
76
|
+
} finally {
|
|
77
|
+
await application.stop();
|
|
78
|
+
await persistence.close();
|
|
79
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
{{#if http.any}}
|
|
5
|
+
import { offlineAuthenticator } from '{{alias.platform}}/auth/authentication/offline-authenticator{{alias.ext}}';
|
|
6
|
+
{{/if}}
|
|
7
|
+
import { composeApplication } from '{{alias.platform}}/composition/compose-application{{alias.ext}}';
|
|
8
|
+
{{#if persistence.needsUrl}}
|
|
9
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
12
|
+
import { inProcessEvents } from '{{alias.platform}}/events/in-process-events{{alias.ext}}';
|
|
13
|
+
import { runExport } from '{{alias.platform}}/privacy/run-export{{alias.ext}}';
|
|
14
|
+
|
|
15
|
+
// The right of access and to portability of one data subject (GDPR, articles 15 and 20), from the
|
|
16
|
+
// command line:
|
|
17
|
+
// npm run privacy:export -- <subject-id> [--operator <who-asks>] > export.json
|
|
18
|
+
// One JSON document on the standard output (`format`, `subject`, `exportedAt`, `records`): every
|
|
19
|
+
// record each context declared in src/platform/privacy/data-subject-exports.ts keeps of the
|
|
20
|
+
// person{{#if tenancy.any}}, in each tenant of TENANTS (comma separated){{/if}}, as plain data. Hand it over to the person, then delete
|
|
21
|
+
// the file{{#if audit.on}}; the audit trail keeps the entry of each export, never the values. Every run is a
|
|
22
|
+
// handover and leaves its entry, a trial included: try it on a test subject, never on a real person{{/if}}.
|
|
23
|
+
{{#if eventSourcing.on}}
|
|
24
|
+
// What this script cannot reach: the stored events (read them through the aggregate), backups,
|
|
25
|
+
// logs and the copies no context declared.
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{#unless eventSourcing.on}}
|
|
28
|
+
// What this script cannot reach: backups, logs and the copies no context declared.
|
|
29
|
+
{{/unless}}
|
|
30
|
+
const { positionals, values } = parseArgs({
|
|
31
|
+
allowPositionals: true,
|
|
32
|
+
options: { operator: { type: 'string', default: os.userInfo().username } },
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const [subject] = positionals;
|
|
36
|
+
|
|
37
|
+
if (subject === undefined || positionals.length > 1) {
|
|
38
|
+
console.error('Usage: npm run privacy:export -- <subject-id> [--operator <who-asks>]');
|
|
39
|
+
process.exit(2);
|
|
40
|
+
}
|
|
41
|
+
{{#if tenancy.any}}
|
|
42
|
+
|
|
43
|
+
const tenants = (process.env['TENANTS'] ?? '').split(',').map((tenant) => tenant.trim()).filter((tenant) => tenant !== '');
|
|
44
|
+
|
|
45
|
+
if (tenants.length === 0) {
|
|
46
|
+
console.error('TENANTS names the tenants the records are gathered in, comma separated.');
|
|
47
|
+
process.exit(2);
|
|
48
|
+
}
|
|
49
|
+
{{/if}}
|
|
50
|
+
|
|
51
|
+
{{#if persistence.needsUrl}}
|
|
52
|
+
const persistence = {{persistence.await}}openPersistence(loadConfig(process.env));
|
|
53
|
+
{{/if}}
|
|
54
|
+
{{#unless persistence.needsUrl}}
|
|
55
|
+
const persistence = openPersistence();
|
|
56
|
+
{{/unless}}
|
|
57
|
+
|
|
58
|
+
const application = composeApplication(persistence, {
|
|
59
|
+
events: inProcessEvents(),
|
|
60
|
+
{{#if http.any}}
|
|
61
|
+
authenticator: offlineAuthenticator,
|
|
62
|
+
{{/if}}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const document = await runExport(subject, {
|
|
67
|
+
container: application.container,
|
|
68
|
+
operator: values.operator,
|
|
69
|
+
correlationId: randomUUID(),
|
|
70
|
+
{{#if tenancy.any}}
|
|
71
|
+
tenants,
|
|
72
|
+
{{/if}}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
console.log(JSON.stringify(document, null, 2));
|
|
76
|
+
} finally {
|
|
77
|
+
await application.stop();
|
|
78
|
+
await persistence.close();
|
|
79
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
import { executionContext, type Actor } from '@ddd-ts-kit/kernel';
|
|
5
|
+
{{#if http.any}}
|
|
6
|
+
import { offlineAuthenticator } from '{{alias.platform}}/auth/authentication/offline-authenticator{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
import { composeApplication } from '{{alias.platform}}/composition/compose-application{{alias.ext}}';
|
|
9
|
+
{{#if persistence.needsUrl}}
|
|
10
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
11
|
+
{{/if}}
|
|
12
|
+
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
13
|
+
import { inProcessEvents } from '{{alias.platform}}/events/in-process-events{{alias.ext}}';
|
|
14
|
+
import { runPurge } from '{{alias.platform}}/privacy/run-purge{{alias.ext}}';
|
|
15
|
+
|
|
16
|
+
// The storage limitation (GDPR, article 5(1)(e)), from the command line, as the job
|
|
17
|
+
// `privacy.purge-expired` runs it every night:
|
|
18
|
+
// npm run privacy:purge [-- --operator <who-runs-it>]
|
|
19
|
+
// Every copy listed in src/platform/privacy/data-subject-copies.ts erases the rows that outlived the
|
|
20
|
+
// retention their declaration gives, as it says{{#if tenancy.any}}, in every tenant{{/if}}. The report says the rows each
|
|
21
|
+
// context reached; run again, a purge reaches nothing{{#if audit.on}}, and every run leaves its entry in the audit trail{{/if}}.
|
|
22
|
+
const { values } = parseArgs({ options: { operator: { type: 'string', default: os.userInfo().username } } });
|
|
23
|
+
|
|
24
|
+
{{#if persistence.needsUrl}}
|
|
25
|
+
const persistence = {{persistence.await}}openPersistence(loadConfig(process.env));
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{#unless persistence.needsUrl}}
|
|
28
|
+
const persistence = openPersistence();
|
|
29
|
+
{{/unless}}
|
|
30
|
+
|
|
31
|
+
const application = composeApplication(persistence, {
|
|
32
|
+
events: inProcessEvents(),
|
|
33
|
+
{{#if http.any}}
|
|
34
|
+
authenticator: offlineAuthenticator,
|
|
35
|
+
{{/if}}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const actor: Actor = { id: values.operator, type: 'user', roles: [], attributes: {} };
|
|
39
|
+
const context = executionContext({ correlationId: randomUUID(), actor, origin: 'cli' });
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const report = await application.platform.scope.run(context, () => runPurge(application.platform));
|
|
43
|
+
|
|
44
|
+
console.log(JSON.stringify(report, null, 2));
|
|
45
|
+
} finally {
|
|
46
|
+
await application.stop();
|
|
47
|
+
await persistence.close();
|
|
48
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import { parseArgs } from 'node:util';
|
|
4
|
+
import { ExecutionScope, executionContext, type Actor } from '@ddd-ts-kit/kernel';
|
|
5
|
+
{{#if http.any}}
|
|
6
|
+
import { offlineAuthenticator } from '{{alias.platform}}/auth/authentication/offline-authenticator{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
8
|
+
import { composeApplication } from '{{alias.platform}}/composition/compose-application{{alias.ext}}';
|
|
9
|
+
{{#if persistence.needsUrl}}
|
|
10
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
11
|
+
{{/if}}
|
|
12
|
+
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
13
|
+
import { inProcessEvents } from '{{alias.platform}}/events/in-process-events{{alias.ext}}';
|
|
14
|
+
import { runPurge } from '{{alias.platform}}/privacy/run-purge{{alias.ext}}';
|
|
15
|
+
|
|
16
|
+
// The storage limitation (GDPR, article 5(1)(e)), from the command line, as the job
|
|
17
|
+
// `privacy.purge-expired` runs it every night:
|
|
18
|
+
// npm run privacy:purge [-- --operator <who-runs-it>]
|
|
19
|
+
// Every copy listed in src/platform/privacy/data-subject-copies.ts erases the rows that outlived the
|
|
20
|
+
// retention their declaration gives, as it says{{#if tenancy.any}}, in every tenant{{/if}}. The report says the rows each
|
|
21
|
+
// context reached; run again, a purge reaches nothing{{#if audit.on}}, and every run leaves its entry in the audit trail{{/if}}.
|
|
22
|
+
const { values } = parseArgs({ options: { operator: { type: 'string', default: os.userInfo().username } } });
|
|
23
|
+
|
|
24
|
+
{{#if persistence.needsUrl}}
|
|
25
|
+
const persistence = {{persistence.await}}openPersistence(loadConfig(process.env));
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{#unless persistence.needsUrl}}
|
|
28
|
+
const persistence = openPersistence();
|
|
29
|
+
{{/unless}}
|
|
30
|
+
|
|
31
|
+
const application = composeApplication(persistence, {
|
|
32
|
+
events: inProcessEvents(),
|
|
33
|
+
{{#if http.any}}
|
|
34
|
+
authenticator: offlineAuthenticator,
|
|
35
|
+
{{/if}}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const actor: Actor = { id: values.operator, type: 'user', roles: [], attributes: {} };
|
|
39
|
+
const context = executionContext({ correlationId: randomUUID(), actor, origin: 'cli' });
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const report = await application.container.resolve(ExecutionScope).run(context, () => runPurge(application.container.resolve));
|
|
43
|
+
|
|
44
|
+
console.log(JSON.stringify(report, null, 2));
|
|
45
|
+
} finally {
|
|
46
|
+
await application.stop();
|
|
47
|
+
await persistence.close();
|
|
48
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
@@imports
|
|
2
|
+
import { {{personal.names.adapter}} } from '{{alias.context}}/infrastructure/persistence/{{personal.names.adapterKebab}}.repository{{alias.ext}}';
|
|
3
|
+
@@copies
|
|
4
|
+
(platform) => platform.adapter(new {{personal.names.adapter}}(platform.persistence.database{{#if tenant.scoped}}, platform.scope{{/if}}), { kind: 'repository', context: '{{context.kebab}}', token: '{{personal.names.port}}' }),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { personalFields, type PersonalFieldsOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{aggregate.tableCamel}} } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
type {{aggregate.pascal}}Row = typeof {{aggregate.tableCamel}}.$inferSelect;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What `{{aggregate.table}}` keeps of a person in clear, and whose it is: the columns below belong to the person
|
|
8
|
+
* `{{personal.subject}}` names{{#if personal.pseudonymise}}, and each reads `[erased]` once that person is erased{{/if}}{{#if personal.row}}, and their row is deleted once that person is erased{{/if}}.
|
|
9
|
+
* Read by {{personal.names.adapter}}, which `npm run privacy:erase` runs; a column added later that holds
|
|
10
|
+
* personal data is declared here too, and its mapper writes it.
|
|
11
|
+
*/
|
|
12
|
+
const declaration: PersonalFieldsOptions<{{aggregate.pascal}}Row> = {
|
|
13
|
+
subject: '{{personal.subject}}',
|
|
14
|
+
{{personal.fields}}
|
|
15
|
+
erasure: '{{personal.erasure}}',
|
|
16
|
+
{{#if personal.retains}}
|
|
17
|
+
// TODO(domain): the mapper writes {{personal.retentionColumn}} empty: write the date the relation with the person ended (the contract closed, the account deleted), or these rows never expire. Never count from the registration.
|
|
18
|
+
retention: {{personal.retention}},
|
|
19
|
+
{{/if}}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const {{aggregate.pascal}}PersonalFields = personalFields({{aggregate.tableCamel}}, declaration);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { personalFields, type PersonalFieldsOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.constant}}_SCHEMA } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
3
|
+
import type { {{aggregate.pascal}}Row } from '{{alias.context}}/infrastructure/persistence/{{aggregate.kebab}}-row.schema{{alias.ext}}';
|
|
4
|
+
|
|
5
|
+
/** The table as the erasure reaches it: its statements are written on the table{{#if tenant.scoped}}, confined to the tenant of the work{{/if}}. */
|
|
6
|
+
const TABLE = { schema: {{context.constant}}_SCHEMA, table: '{{aggregate.table}}' };
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* What `{{aggregate.table}}` keeps of a person in clear, and whose it is: the columns below belong to the person
|
|
10
|
+
* `{{personal.subject}}` names{{#if personal.pseudonymise}}, and each reads `[erased]` once that person is erased{{/if}}{{#if personal.row}}, and their row is deleted once that person is erased{{/if}}.
|
|
11
|
+
* Read by {{personal.names.adapter}}, which `npm run privacy:erase` runs; a column added later that holds
|
|
12
|
+
* personal data is declared here too, and its mapper writes it.
|
|
13
|
+
*/
|
|
14
|
+
const declaration: PersonalFieldsOptions<{{aggregate.pascal}}Row> = {
|
|
15
|
+
subject: '{{personal.subject}}',
|
|
16
|
+
{{personal.fields}}
|
|
17
|
+
erasure: '{{personal.erasure}}',
|
|
18
|
+
{{#if personal.retains}}
|
|
19
|
+
// TODO(domain): the mapper writes {{personal.retentionColumn}} empty: write the date the relation with the person ended (the contract closed, the account deleted), or these rows never expire. Never count from the registration.
|
|
20
|
+
retention: {{personal.retention}},
|
|
21
|
+
{{/if}}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const {{aggregate.pascal}}PersonalFields = personalFields(TABLE, declaration);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { personalFields, type PersonalFieldsOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import type { PrismaPersonalTable } from '@ddd-ts-kit/prisma';
|
|
3
|
+
|
|
4
|
+
/** The table as the erasure reaches it, by the names `@@schema` and `@@map` give it: its statements are written on the table, not through the model. */
|
|
5
|
+
const TABLE: PrismaPersonalTable = { schema: '{{context.schema}}', table: '{{aggregate.table}}' };
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* What `{{aggregate.table}}` keeps of a person in clear, and whose it is: the columns below belong to the person
|
|
9
|
+
* `{{personal.subject}}` names{{#if personal.pseudonymise}}, and each reads `[erased]` once that person is erased{{/if}}{{#if personal.row}}, and their row is deleted once that person is erased{{/if}}.
|
|
10
|
+
* Read by {{personal.names.adapter}}, which `npm run privacy:erase` runs; a column added later that holds
|
|
11
|
+
* personal data is declared here too, and its mapper writes it.
|
|
12
|
+
*/
|
|
13
|
+
// The columns are named as the database spells them (`@map`), since the erasure writes SQL on the table.
|
|
14
|
+
const declaration: PersonalFieldsOptions<Record<string, unknown>> = {
|
|
15
|
+
subject: '{{personal.subject}}',
|
|
16
|
+
{{personal.fields}}
|
|
17
|
+
erasure: '{{personal.erasure}}',
|
|
18
|
+
{{#if personal.retains}}
|
|
19
|
+
// TODO(domain): the mapper writes {{personal.retentionColumn}} empty: write the date the relation with the person ended (the contract closed, the account deleted), or these rows never expire. Never count from the registration.
|
|
20
|
+
retention: {{personal.retention}},
|
|
21
|
+
{{/if}}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const {{aggregate.pascal}}PersonalFields = personalFields(TABLE, declaration);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { personalFields, type PersonalFieldsOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{aggregate.tableCamel}} } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
3
|
+
import type { {{aggregate.pascal}}Row } from '{{alias.context}}/infrastructure/persistence/{{aggregate.kebab}}-row.schema{{alias.ext}}';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* What `{{aggregate.table}}` keeps of a person in clear, and whose it is: the columns below belong to the person
|
|
7
|
+
* `{{personal.subject}}` names{{#if personal.pseudonymise}}, and each reads `[erased]` once that person is erased{{/if}}{{#if personal.row}}, and their row is deleted once that person is erased{{/if}}.
|
|
8
|
+
* Read by {{personal.names.adapter}}, which `npm run privacy:erase` runs; a column added later that holds
|
|
9
|
+
* personal data is declared here too, and its mapper writes it.
|
|
10
|
+
*/
|
|
11
|
+
const declaration: PersonalFieldsOptions<{{aggregate.pascal}}Row> = {
|
|
12
|
+
subject: '{{personal.subject}}',
|
|
13
|
+
{{personal.fields}}
|
|
14
|
+
erasure: '{{personal.erasure}}',
|
|
15
|
+
{{#if personal.retains}}
|
|
16
|
+
// TODO(domain): the mapper writes {{personal.retentionColumn}} empty: write the date the relation with the person ended (the contract closed, the account deleted), or these rows never expire. Never count from the registration.
|
|
17
|
+
retention: {{personal.retention}},
|
|
18
|
+
{{/if}}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const {{aggregate.pascal}}PersonalFields = personalFields({{aggregate.tableCamel}}, declaration);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
2
|
+
import { DrizzlePersonalDataErasure } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
|
+
{{#if tenant.scoped}}
|
|
4
|
+
import type { ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#if style.declared}}
|
|
7
|
+
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if style.declared}}
|
|
10
|
+
import { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{#unless style.declared}}
|
|
13
|
+
import type { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
14
|
+
{{/unless}}
|
|
15
|
+
{{storage.adapterImport}}
|
|
16
|
+
// ddd-ts-kit:imports
|
|
17
|
+
import { {{aggregate.pascal}}PersonalFields } from '{{alias.context}}/infrastructure/persistence/{{aggregate.kebab}}.personal-fields{{alias.ext}}';
|
|
18
|
+
// /ddd-ts-kit:imports
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* What {{context.kebab}} keeps of a person in clear, erased from every table declared below as its
|
|
22
|
+
* declaration says: the rows of the person deleted, or their personal columns pseudonymised, the files
|
|
23
|
+
* they name deleted first. Run by `npm run privacy:erase` with the copies of the other contexts, never
|
|
24
|
+
* by a use case{{#if tenant.scoped}}; every statement is confined to the tenant of the work{{/if}}.
|
|
25
|
+
*/
|
|
26
|
+
{{#if style.declared}}
|
|
27
|
+
@Repository({{personal.names.port}})
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{personal.header}}
|
|
30
|
+
constructor(database: {{storage.token}}{{#if tenant.scoped}}, scope: ExecutionScope{{/if}}) {
|
|
31
|
+
super(database, {
|
|
32
|
+
name: '{{context.kebab}}',
|
|
33
|
+
declarations: [
|
|
34
|
+
// ddd-ts-kit:personal-fields
|
|
35
|
+
{{aggregate.pascal}}PersonalFields,
|
|
36
|
+
// /ddd-ts-kit:personal-fields
|
|
37
|
+
],
|
|
38
|
+
{{#if tenant.scoped}}
|
|
39
|
+
tenant: { scope },
|
|
40
|
+
{{/if}}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{{#if tenant.scoped}}
|
|
2
|
+
import type { ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{/if}}
|
|
4
|
+
{{#if style.declared}}
|
|
5
|
+
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
6
|
+
{{/if}}
|
|
7
|
+
import { KnexPersonalDataErasure, type KnexContext } from '@ddd-ts-kit/knex';
|
|
8
|
+
{{#if style.declared}}
|
|
9
|
+
import { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
14
|
+
// ddd-ts-kit:imports
|
|
15
|
+
import { {{aggregate.pascal}}PersonalFields } from '{{alias.context}}/infrastructure/persistence/{{aggregate.kebab}}.personal-fields{{alias.ext}}';
|
|
16
|
+
// /ddd-ts-kit:imports
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* What {{context.kebab}} keeps of a person in clear, erased from every table declared below as its
|
|
20
|
+
* declaration says: the rows of the person deleted, or their personal columns pseudonymised, the files
|
|
21
|
+
* they name deleted first. Run by `npm run privacy:erase` with the copies of the other contexts, never
|
|
22
|
+
* by a use case{{#if tenant.scoped}}; every statement is confined to the tenant of the work{{/if}}.
|
|
23
|
+
*/
|
|
24
|
+
{{#if style.declared}}
|
|
25
|
+
@Repository({{personal.names.port}})
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{personal.header}}
|
|
28
|
+
constructor(database: {{storage.token}}{{#if tenant.scoped}}, scope: ExecutionScope{{/if}}) {
|
|
29
|
+
super(database, {
|
|
30
|
+
name: '{{context.kebab}}',
|
|
31
|
+
declarations: [
|
|
32
|
+
// ddd-ts-kit:personal-fields
|
|
33
|
+
{{aggregate.pascal}}PersonalFields,
|
|
34
|
+
// /ddd-ts-kit:personal-fields
|
|
35
|
+
],
|
|
36
|
+
{{#if tenant.scoped}}
|
|
37
|
+
tenant: scope,
|
|
38
|
+
{{/if}}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{{#if tenant.scoped}}
|
|
2
|
+
import type { ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{/if}}
|
|
4
|
+
{{#if style.declared}}
|
|
5
|
+
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
6
|
+
{{/if}}
|
|
7
|
+
import { PrismaPersonalDataErasure } from '@ddd-ts-kit/prisma';
|
|
8
|
+
{{#if style.declared}}
|
|
9
|
+
import { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
14
|
+
import type { Prisma } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
15
|
+
{{storage.adapterImport}}
|
|
16
|
+
// ddd-ts-kit:imports
|
|
17
|
+
import { {{aggregate.pascal}}PersonalFields } from '{{alias.context}}/infrastructure/persistence/{{aggregate.kebab}}.personal-fields{{alias.ext}}';
|
|
18
|
+
// /ddd-ts-kit:imports
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* What {{context.kebab}} keeps of a person in clear, erased from every table declared below as its
|
|
22
|
+
* declaration says: the rows of the person deleted, or their personal columns pseudonymised, the files
|
|
23
|
+
* they name deleted first. Run by `npm run privacy:erase` with the copies of the other contexts, never
|
|
24
|
+
* by a use case{{#if tenant.scoped}}; every statement is confined to the tenant of the work{{/if}}.
|
|
25
|
+
*/
|
|
26
|
+
{{#if style.declared}}
|
|
27
|
+
@Repository({{personal.names.port}})
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{personal.header}}
|
|
30
|
+
constructor(database: {{storage.token}}{{#if tenant.scoped}}, scope: ExecutionScope{{/if}}) {
|
|
31
|
+
super(database, {
|
|
32
|
+
name: '{{context.kebab}}',
|
|
33
|
+
declarations: [
|
|
34
|
+
// ddd-ts-kit:personal-fields
|
|
35
|
+
{{aggregate.pascal}}PersonalFields,
|
|
36
|
+
// /ddd-ts-kit:personal-fields
|
|
37
|
+
],
|
|
38
|
+
{{#if tenant.scoped}}
|
|
39
|
+
tenant: { scope },
|
|
40
|
+
{{/if}}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{{#if tenant.scoped}}
|
|
2
|
+
import type { ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
|
+
{{/if}}
|
|
4
|
+
{{#if style.declared}}
|
|
5
|
+
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
6
|
+
{{/if}}
|
|
7
|
+
import { TypeOrmPersonalDataErasure, type TypeOrmContext } from '@ddd-ts-kit/typeorm';
|
|
8
|
+
{{#if style.declared}}
|
|
9
|
+
import { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
10
|
+
{{/if}}
|
|
11
|
+
{{#unless style.declared}}
|
|
12
|
+
import type { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
13
|
+
{{/unless}}
|
|
14
|
+
// ddd-ts-kit:imports
|
|
15
|
+
import { {{aggregate.pascal}}PersonalFields } from '{{alias.context}}/infrastructure/persistence/{{aggregate.kebab}}.personal-fields{{alias.ext}}';
|
|
16
|
+
// /ddd-ts-kit:imports
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* What {{context.kebab}} keeps of a person in clear, erased from every table declared below as its
|
|
20
|
+
* declaration says: the rows of the person deleted, or their personal columns pseudonymised, the files
|
|
21
|
+
* they name deleted first. Run by `npm run privacy:erase` with the copies of the other contexts, never
|
|
22
|
+
* by a use case{{#if tenant.scoped}}; every statement is confined to the tenant of the work{{/if}}.
|
|
23
|
+
*/
|
|
24
|
+
{{#if style.declared}}
|
|
25
|
+
@Repository({{personal.names.port}})
|
|
26
|
+
{{/if}}
|
|
27
|
+
{{personal.header}}
|
|
28
|
+
constructor(database: {{storage.token}}{{#if tenant.scoped}}, scope: ExecutionScope{{/if}}) {
|
|
29
|
+
super(database, {
|
|
30
|
+
name: '{{context.kebab}}',
|
|
31
|
+
declarations: [
|
|
32
|
+
// ddd-ts-kit:personal-fields
|
|
33
|
+
{{aggregate.pascal}}PersonalFields,
|
|
34
|
+
// /ddd-ts-kit:personal-fields
|
|
35
|
+
],
|
|
36
|
+
{{#if tenant.scoped}}
|
|
37
|
+
tenant: { scope },
|
|
38
|
+
{{/if}}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PersonalDataRecord } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import type { {{personal.names.exportPort}} } from '{{alias.context}}/application/ports/{{personal.names.exportPortKebab}}.port{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
/** Hands over the records a test gave it of each person, and remembers who was asked. */
|
|
5
|
+
export class {{personal.names.exportFake}} implements {{personal.names.exportPort}} {
|
|
6
|
+
readonly name = '{{context.kebab}}';
|
|
7
|
+
|
|
8
|
+
readonly asked: string[] = [];
|
|
9
|
+
|
|
10
|
+
private readonly records = new Map<string, PersonalDataRecord[]>();
|
|
11
|
+
|
|
12
|
+
/** What the export of this person hands over, as the test arranges it. */
|
|
13
|
+
holds(subject: string, ...records: readonly PersonalDataRecord[]): this {
|
|
14
|
+
this.records.set(subject, [...(this.records.get(subject) ?? []), ...records]);
|
|
15
|
+
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async exportOf(subject: string): Promise<readonly PersonalDataRecord[]> {
|
|
20
|
+
this.asked.push(subject);
|
|
21
|
+
|
|
22
|
+
return this.records.get(subject) ?? [];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PersonalDataExport } from '@ddd-ts-kit/kernel';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The right of access and to portability, for what {{context.kebab}} keeps of a person in clear: the columns its
|
|
5
|
+
* tables declare with `personalFields`, handed over as plain data, one record per row. Run by the platform
|
|
6
|
+
* (`npm run privacy:export`) with the exports of the other contexts, never by a use case.
|
|
7
|
+
*/
|
|
8
|
+
export abstract class {{personal.names.exportPort}} extends PersonalDataExport {}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
2
|
+
import { DrizzlePersonalDataExport } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
|
+
{{#if tenant.scoped}}
|
|
4
|
+
import type { ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#if style.declared}}
|
|
7
|
+
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if style.declared}}
|
|
10
|
+
import { {{personal.names.exportPort}} } from '{{alias.context}}/application/ports/{{personal.names.exportPortKebab}}.port{{alias.ext}}';
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{#unless style.declared}}
|
|
13
|
+
import type { {{personal.names.exportPort}} } from '{{alias.context}}/application/ports/{{personal.names.exportPortKebab}}.port{{alias.ext}}';
|
|
14
|
+
{{/unless}}
|
|
15
|
+
{{storage.adapterImport}}
|
|
16
|
+
// ddd-ts-kit:imports
|
|
17
|
+
import { {{aggregate.pascal}}PersonalFields } from '{{alias.context}}/infrastructure/persistence/{{aggregate.kebab}}.personal-fields{{alias.ext}}';
|
|
18
|
+
// /ddd-ts-kit:imports
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* What {{context.kebab}} keeps of a person in clear, handed over from every table declared below as
|
|
22
|
+
* plain data: one record per row about the person, under `{{context.kebab}}.<table>`, the personal columns
|
|
23
|
+
* alone. Run by `npm run privacy:export` with the exports of the other contexts, never by a use
|
|
24
|
+
* case{{#if tenant.scoped}}; every statement is confined to the tenant of the work{{/if}}.
|
|
25
|
+
*/
|
|
26
|
+
{{#if style.declared}}
|
|
27
|
+
@Repository({{personal.names.exportPort}})
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{personal.exportHeader}}
|
|
30
|
+
constructor(database: {{storage.token}}{{#if tenant.scoped}}, scope: ExecutionScope{{/if}}) {
|
|
31
|
+
super(database, {
|
|
32
|
+
name: '{{context.kebab}}',
|
|
33
|
+
declarations: [
|
|
34
|
+
// ddd-ts-kit:personal-fields
|
|
35
|
+
{{aggregate.pascal}}PersonalFields,
|
|
36
|
+
// /ddd-ts-kit:personal-fields
|
|
37
|
+
],
|
|
38
|
+
{{#if tenant.scoped}}
|
|
39
|
+
tenant: { scope },
|
|
40
|
+
{{/if}}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|