ddd-ts-kit 0.88.0 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +626 -0
- package/README.fr.md +86 -31
- package/README.md +81 -28
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +4 -1
- package/dist/check/canonical/roles.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +12 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/catalogue/default-severities.d.ts.map +1 -1
- package/dist/check/catalogue/default-severities.js +5 -0
- package/dist/check/catalogue/default-severities.js.map +1 -1
- package/dist/check/catalogue/delegated-rules.js +1 -1
- package/dist/check/catalogue/delegated-rules.js.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.js +24 -0
- package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
- package/dist/check/configuration/config-inspection.d.ts +2 -2
- package/dist/check/configuration/config-inspection.d.ts.map +1 -1
- package/dist/check/configuration/config-inspection.js +5 -4
- package/dist/check/configuration/config-inspection.js.map +1 -1
- package/dist/check/configuration/measure-settings.d.ts +10 -0
- package/dist/check/configuration/measure-settings.d.ts.map +1 -0
- package/dist/check/configuration/measure-settings.js +17 -0
- package/dist/check/configuration/measure-settings.js.map +1 -0
- package/dist/check/explain/privacy-docs.d.ts +3 -0
- package/dist/check/explain/privacy-docs.d.ts.map +1 -0
- package/dist/check/explain/privacy-docs.js +52 -0
- package/dist/check/explain/privacy-docs.js.map +1 -0
- package/dist/check/explain/rule-docs.d.ts.map +1 -1
- package/dist/check/explain/rule-docs.js +2 -0
- package/dist/check/explain/rule-docs.js.map +1 -1
- package/dist/check/explain/tenancy-docs.d.ts.map +1 -1
- package/dist/check/explain/tenancy-docs.js +13 -3
- package/dist/check/explain/tenancy-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +11 -0
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.js +1 -1
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/budget-fixtures.d.ts +3 -0
- package/dist/check/fixtures/budget-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/budget-fixtures.js +43 -0
- package/dist/check/fixtures/budget-fixtures.js.map +1 -0
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +17 -3
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +6 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/mutation-fixtures.d.ts +3 -0
- package/dist/check/fixtures/mutation-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/mutation-fixtures.js +81 -0
- package/dist/check/fixtures/mutation-fixtures.js.map +1 -0
- package/dist/check/fixtures/privacy-fixtures.d.ts +3 -0
- package/dist/check/fixtures/privacy-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/privacy-fixtures.js +198 -0
- package/dist/check/fixtures/privacy-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-bypass.d.ts +24 -0
- package/dist/check/fixtures/tenancy-bypass.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-bypass.js +22 -0
- package/dist/check/fixtures/tenancy-bypass.js.map +1 -0
- package/dist/check/fixtures/tenancy-config.d.ts +3 -0
- package/dist/check/fixtures/tenancy-config.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-config.js +7 -0
- package/dist/check/fixtures/tenancy-config.js.map +1 -0
- package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-fixtures.js +31 -41
- package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
- package/dist/check/fixtures/tenancy-prisma-fixtures.d.ts +4 -0
- package/dist/check/fixtures/tenancy-prisma-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-prisma-fixtures.js +73 -0
- package/dist/check/fixtures/tenancy-prisma-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.d.ts +4 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.js +88 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.js.map +1 -0
- package/dist/check/mutation/stryker-settings.d.ts +8 -0
- package/dist/check/mutation/stryker-settings.d.ts.map +1 -0
- package/dist/check/mutation/stryker-settings.js +74 -0
- package/dist/check/mutation/stryker-settings.js.map +1 -0
- package/dist/check/privacy/column-definitions-in.d.ts +15 -0
- package/dist/check/privacy/column-definitions-in.d.ts.map +1 -0
- package/dist/check/privacy/column-definitions-in.js +32 -0
- package/dist/check/privacy/column-definitions-in.js.map +1 -0
- package/dist/check/privacy/declares-name.d.ts +4 -0
- package/dist/check/privacy/declares-name.d.ts.map +1 -0
- package/dist/check/privacy/declares-name.js +7 -0
- package/dist/check/privacy/declares-name.js.map +1 -0
- package/dist/check/privacy/personal-declarations-of.d.ts +15 -0
- package/dist/check/privacy/personal-declarations-of.d.ts.map +1 -0
- package/dist/check/privacy/personal-declarations-of.js +33 -0
- package/dist/check/privacy/personal-declarations-of.js.map +1 -0
- package/dist/check/privacy/personal-term-of.d.ts +3 -0
- package/dist/check/privacy/personal-term-of.d.ts.map +1 -0
- package/dist/check/privacy/personal-term-of.js +10 -0
- package/dist/check/privacy/personal-term-of.js.map +1 -0
- package/dist/check/privacy/personal-vocabulary.d.ts +9 -0
- package/dist/check/privacy/personal-vocabulary.d.ts.map +1 -0
- package/dist/check/privacy/personal-vocabulary.js +37 -0
- package/dist/check/privacy/personal-vocabulary.js.map +1 -0
- package/dist/check/privacy/prisma-columns-of.d.ts +17 -0
- package/dist/check/privacy/prisma-columns-of.d.ts.map +1 -0
- package/dist/check/privacy/prisma-columns-of.js +58 -0
- package/dist/check/privacy/prisma-columns-of.js.map +1 -0
- package/dist/check/privacy/privacy-judged.d.ts +8 -0
- package/dist/check/privacy/privacy-judged.d.ts.map +1 -0
- package/dist/check/privacy/privacy-judged.js +9 -0
- package/dist/check/privacy/privacy-judged.js.map +1 -0
- package/dist/check/privacy/published-events-of.d.ts +29 -0
- package/dist/check/privacy/published-events-of.d.ts.map +1 -0
- package/dist/check/privacy/published-events-of.js +80 -0
- package/dist/check/privacy/published-events-of.js.map +1 -0
- package/dist/check/privacy/same-name.d.ts +3 -0
- package/dist/check/privacy/same-name.d.ts.map +1 -0
- package/dist/check/privacy/same-name.js +6 -0
- package/dist/check/privacy/same-name.js.map +1 -0
- package/dist/check/privacy/vocabulary-of.d.ts +4 -0
- package/dist/check/privacy/vocabulary-of.d.ts.map +1 -0
- package/dist/check/privacy/vocabulary-of.js +10 -0
- package/dist/check/privacy/vocabulary-of.js.map +1 -0
- package/dist/check/privacy/words-of-name.d.ts +3 -0
- package/dist/check/privacy/words-of-name.d.ts.map +1 -0
- package/dist/check/privacy/words-of-name.js +9 -0
- package/dist/check/privacy/words-of-name.js.map +1 -0
- package/dist/check/rules/config-valid.js +1 -1
- package/dist/check/rules/config-valid.js.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.js +21 -2
- package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -1
- package/dist/check/rules/governance-recorded-deviation.d.ts.map +1 -1
- package/dist/check/rules/governance-recorded-deviation.js +20 -2
- package/dist/check/rules/governance-recorded-deviation.js.map +1 -1
- package/dist/check/rules/privacy-declared-field.d.ts +11 -0
- package/dist/check/rules/privacy-declared-field.d.ts.map +1 -0
- package/dist/check/rules/privacy-declared-field.js +63 -0
- package/dist/check/rules/privacy-declared-field.js.map +1 -0
- package/dist/check/rules/privacy-erasure-reaches-copies.d.ts +10 -0
- package/dist/check/rules/privacy-erasure-reaches-copies.d.ts.map +1 -0
- package/dist/check/rules/privacy-erasure-reaches-copies.js +46 -0
- package/dist/check/rules/privacy-erasure-reaches-copies.js.map +1 -0
- package/dist/check/rules/privacy-event-payload-declared.d.ts +10 -0
- package/dist/check/rules/privacy-event-payload-declared.d.ts.map +1 -0
- package/dist/check/rules/privacy-event-payload-declared.js +39 -0
- package/dist/check/rules/privacy-event-payload-declared.js.map +1 -0
- package/dist/check/rules/privacy-no-personal-data-in-logs.d.ts +12 -0
- package/dist/check/rules/privacy-no-personal-data-in-logs.d.ts.map +1 -0
- package/dist/check/rules/privacy-no-personal-data-in-logs.js +57 -0
- package/dist/check/rules/privacy-no-personal-data-in-logs.js.map +1 -0
- package/dist/check/rules/privacy-subject-is-opaque.d.ts +9 -0
- package/dist/check/rules/privacy-subject-is-opaque.d.ts.map +1 -0
- package/dist/check/rules/privacy-subject-is-opaque.js +50 -0
- package/dist/check/rules/privacy-subject-is-opaque.js.map +1 -0
- package/dist/check/rules/tenancy-scoped-statement.d.ts.map +1 -1
- package/dist/check/rules/tenancy-scoped-statement.js +6 -2
- package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
- package/dist/check/rules/test-mutation-governed.d.ts +3 -0
- package/dist/check/rules/test-mutation-governed.d.ts.map +1 -0
- package/dist/check/rules/test-mutation-governed.js +12 -0
- package/dist/check/rules/test-mutation-governed.js.map +1 -0
- package/dist/check/tenancy/accessor-uses.d.ts +13 -0
- package/dist/check/tenancy/accessor-uses.d.ts.map +1 -0
- package/dist/check/tenancy/accessor-uses.js +19 -0
- package/dist/check/tenancy/accessor-uses.js.map +1 -0
- package/dist/check/tenancy/declaration-of.d.ts +7 -0
- package/dist/check/tenancy/declaration-of.d.ts.map +1 -0
- package/dist/check/tenancy/declaration-of.js +11 -0
- package/dist/check/tenancy/declaration-of.js.map +1 -0
- package/dist/check/tenancy/declared-in-arguments.d.ts +13 -0
- package/dist/check/tenancy/declared-in-arguments.d.ts.map +1 -0
- package/dist/check/tenancy/declared-in-arguments.js +25 -0
- package/dist/check/tenancy/declared-in-arguments.js.map +1 -0
- package/dist/check/tenancy/declared-with.d.ts +3 -1
- package/dist/check/tenancy/declared-with.d.ts.map +1 -1
- package/dist/check/tenancy/declared-with.js +4 -3
- package/dist/check/tenancy/declared-with.js.map +1 -1
- package/dist/check/tenancy/drizzle-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/drizzle-unscoped.js +4 -3
- package/dist/check/tenancy/drizzle-unscoped.js.map +1 -1
- package/dist/check/tenancy/executor-uses.d.ts +3 -10
- package/dist/check/tenancy/executor-uses.d.ts.map +1 -1
- package/dist/check/tenancy/executor-uses.js +3 -11
- package/dist/check/tenancy/executor-uses.js.map +1 -1
- package/dist/check/tenancy/prisma-unscoped.d.ts +7 -0
- package/dist/check/tenancy/prisma-unscoped.d.ts.map +1 -0
- package/dist/check/tenancy/prisma-unscoped.js +60 -0
- package/dist/check/tenancy/prisma-unscoped.js.map +1 -0
- package/dist/check/tenancy/typeorm-unscoped.d.ts +7 -0
- package/dist/check/tenancy/typeorm-unscoped.d.ts.map +1 -0
- package/dist/check/tenancy/typeorm-unscoped.js +103 -0
- package/dist/check/tenancy/typeorm-unscoped.js.map +1 -0
- package/dist/check/tenancy/unscoped-read-models.js +2 -2
- package/dist/check/tenancy/unscoped-read-models.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +23 -1
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +4 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/generate.js +9 -1
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +4 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.d.ts +3 -2
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +16 -4
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/mutation.d.ts +14 -0
- package/dist/commands/mutation.d.ts.map +1 -0
- package/dist/commands/mutation.js +62 -0
- package/dist/commands/mutation.js.map +1 -0
- package/dist/config/budget-levels.d.ts +3 -0
- package/dist/config/budget-levels.d.ts.map +1 -0
- package/dist/config/budget-levels.js +3 -0
- package/dist/config/budget-levels.js.map +1 -0
- package/dist/config/budget-problems.d.ts +10 -0
- package/dist/config/budget-problems.d.ts.map +1 -0
- package/dist/config/budget-problems.js +61 -0
- package/dist/config/budget-problems.js.map +1 -0
- package/dist/config/budget.d.ts +10 -0
- package/dist/config/budget.d.ts.map +1 -0
- package/dist/config/budget.js +2 -0
- package/dist/config/budget.js.map +1 -0
- package/dist/config/config.d.ts +16 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/index.d.ts +7 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +7 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/is-duration.d.ts +3 -0
- package/dist/config/is-duration.d.ts.map +1 -0
- package/dist/config/is-duration.js +5 -0
- package/dist/config/is-duration.js.map +1 -0
- package/dist/config/is-reference-budget.d.ts +4 -0
- package/dist/config/is-reference-budget.d.ts.map +1 -0
- package/dist/config/is-reference-budget.js +8 -0
- package/dist/config/is-reference-budget.js.map +1 -0
- package/dist/config/is-reference-mutation.d.ts +4 -0
- package/dist/config/is-reference-mutation.d.ts.map +1 -0
- package/dist/config/is-reference-mutation.js +7 -0
- package/dist/config/is-reference-mutation.js.map +1 -0
- package/dist/config/mutation-layers.d.ts +3 -0
- package/dist/config/mutation-layers.d.ts.map +1 -0
- package/dist/config/mutation-layers.js +3 -0
- package/dist/config/mutation-layers.js.map +1 -0
- package/dist/config/mutation-problems.d.ts +10 -0
- package/dist/config/mutation-problems.d.ts.map +1 -0
- package/dist/config/mutation-problems.js +46 -0
- package/dist/config/mutation-problems.js.map +1 -0
- package/dist/config/mutation.d.ts +4 -0
- package/dist/config/mutation.d.ts.map +1 -0
- package/dist/config/mutation.js +2 -0
- package/dist/config/mutation.js.map +1 -0
- package/dist/config/parse-budget.d.ts +4 -0
- package/dist/config/parse-budget.d.ts.map +1 -0
- package/dist/config/parse-budget.js +17 -0
- package/dist/config/parse-budget.js.map +1 -0
- package/dist/config/parse-config.d.ts.map +1 -1
- package/dist/config/parse-config.js +6 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/parse-mutation.d.ts +4 -0
- package/dist/config/parse-mutation.d.ts.map +1 -0
- package/dist/config/parse-mutation.js +16 -0
- package/dist/config/parse-mutation.js.map +1 -0
- package/dist/config/parse-privacy.d.ts +4 -0
- package/dist/config/parse-privacy.d.ts.map +1 -0
- package/dist/config/parse-privacy.js +12 -0
- package/dist/config/parse-privacy.js.map +1 -0
- package/dist/config/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +4 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/reference-budget.d.ts +8 -0
- package/dist/config/reference-budget.d.ts.map +1 -0
- package/dist/config/reference-budget.js +7 -0
- package/dist/config/reference-budget.js.map +1 -0
- package/dist/config/reference-mutation.d.ts +10 -0
- package/dist/config/reference-mutation.d.ts.map +1 -0
- package/dist/config/reference-mutation.js +9 -0
- package/dist/config/reference-mutation.js.map +1 -0
- package/dist/config/serialize-config.d.ts.map +1 -1
- package/dist/config/serialize-config.js +13 -1
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +17 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +2 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/docs/behaviour-page.d.ts +8 -0
- package/dist/docs/behaviour-page.d.ts.map +1 -0
- package/dist/docs/behaviour-page.js +83 -0
- package/dist/docs/behaviour-page.js.map +1 -0
- package/dist/docs/context-facts.d.ts +8 -0
- package/dist/docs/context-facts.d.ts.map +1 -1
- package/dist/docs/counts-of.d.ts +10 -0
- package/dist/docs/counts-of.d.ts.map +1 -0
- package/dist/docs/counts-of.js +14 -0
- package/dist/docs/counts-of.js.map +1 -0
- package/dist/docs/declared-table-of.d.ts +14 -0
- package/dist/docs/declared-table-of.d.ts.map +1 -0
- package/dist/docs/declared-table-of.js +39 -0
- package/dist/docs/declared-table-of.js.map +1 -0
- package/dist/docs/ensure-personal-data-region.d.ts +7 -0
- package/dist/docs/ensure-personal-data-region.d.ts.map +1 -0
- package/dist/docs/ensure-personal-data-region.js +21 -0
- package/dist/docs/ensure-personal-data-region.js.map +1 -0
- package/dist/docs/page-section.d.ts +12 -0
- package/dist/docs/page-section.d.ts.map +1 -0
- package/dist/docs/page-section.js +2 -0
- package/dist/docs/page-section.js.map +1 -0
- package/dist/docs/personal-data-lines.d.ts +7 -0
- package/dist/docs/personal-data-lines.d.ts.map +1 -0
- package/dist/docs/personal-data-lines.js +29 -0
- package/dist/docs/personal-data-lines.js.map +1 -0
- package/dist/docs/personal-declarations-in.d.ts +13 -0
- package/dist/docs/personal-declarations-in.d.ts.map +1 -0
- package/dist/docs/personal-declarations-in.js +66 -0
- package/dist/docs/personal-declarations-in.js.map +1 -0
- package/dist/docs/personal-table-cells.d.ts +12 -0
- package/dist/docs/personal-table-cells.d.ts.map +1 -0
- package/dist/docs/personal-table-cells.js +13 -0
- package/dist/docs/personal-table-cells.js.map +1 -0
- package/dist/docs/personal-table-facts.d.ts +17 -0
- package/dist/docs/personal-table-facts.d.ts.map +1 -0
- package/dist/docs/personal-table-facts.js +2 -0
- package/dist/docs/personal-table-facts.js.map +1 -0
- package/dist/docs/privacy-register-lines.d.ts +7 -0
- package/dist/docs/privacy-register-lines.d.ts.map +1 -0
- package/dist/docs/privacy-register-lines.js +34 -0
- package/dist/docs/privacy-register-lines.js.map +1 -0
- package/dist/docs/read-context.d.ts.map +1 -1
- package/dist/docs/read-context.js +17 -1
- package/dist/docs/read-context.js.map +1 -1
- package/dist/docs/read-personal-data.d.ts +12 -0
- package/dist/docs/read-personal-data.d.ts.map +1 -0
- package/dist/docs/read-personal-data.js +22 -0
- package/dist/docs/read-personal-data.js.map +1 -0
- package/dist/docs/refresh-context-doc.d.ts.map +1 -1
- package/dist/docs/refresh-context-doc.js +9 -1
- package/dist/docs/refresh-context-doc.js.map +1 -1
- package/dist/docs/rules-in.d.ts +25 -0
- package/dist/docs/rules-in.d.ts.map +1 -0
- package/dist/docs/rules-in.js +83 -0
- package/dist/docs/rules-in.js.map +1 -0
- package/dist/docs/write-behaviour.d.ts +10 -0
- package/dist/docs/write-behaviour.d.ts.map +1 -0
- package/dist/docs/write-behaviour.js +97 -0
- package/dist/docs/write-behaviour.js.map +1 -0
- package/dist/docs/write-docs.d.ts +12 -2
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +8 -2
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/docs/write-privacy-register.d.ts +9 -0
- package/dist/docs/write-privacy-register.d.ts.map +1 -0
- package/dist/docs/write-privacy-register.js +26 -0
- package/dist/docs/write-privacy-register.js.map +1 -0
- package/dist/doctor/diagnose.d.ts +2 -1
- package/dist/doctor/diagnose.d.ts.map +1 -1
- package/dist/doctor/diagnose.js +4 -1
- package/dist/doctor/diagnose.js.map +1 -1
- package/dist/doctor/doctor-finding.d.ts +3 -2
- package/dist/doctor/doctor-finding.d.ts.map +1 -1
- package/dist/doctor/format-diagnosis.js +4 -1
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/override-findings.d.ts +10 -0
- package/dist/doctor/override-findings.d.ts.map +1 -0
- package/dist/doctor/override-findings.js +87 -0
- package/dist/doctor/override-findings.js.map +1 -0
- package/dist/generate/kind.d.ts +14 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/acceptance-kind.js +5 -1
- package/dist/generate/kinds/acceptance-kind.js.map +1 -1
- package/dist/generate/kinds/background/spec-family.d.ts +8 -0
- package/dist/generate/kinds/background/spec-family.d.ts.map +1 -0
- package/dist/generate/kinds/background/spec-family.js +9 -0
- package/dist/generate/kinds/background/spec-family.js.map +1 -0
- package/dist/generate/kinds/background-job-kind.d.ts.map +1 -1
- package/dist/generate/kinds/background-job-kind.js +6 -4
- package/dist/generate/kinds/background-job-kind.js.map +1 -1
- package/dist/generate/kinds/command-kind.d.ts.map +1 -1
- package/dist/generate/kinds/command-kind.js +4 -0
- package/dist/generate/kinds/command-kind.js.map +1 -1
- package/dist/generate/kinds/erasure-handler-kind.d.ts +3 -0
- package/dist/generate/kinds/erasure-handler-kind.d.ts.map +1 -0
- package/dist/generate/kinds/erasure-handler-kind.js +46 -0
- package/dist/generate/kinds/erasure-handler-kind.js.map +1 -0
- package/dist/generate/kinds/generate-repository.d.ts +2 -1
- package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
- package/dist/generate/kinds/generate-repository.js +14 -11
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/personal-data/class-header.d.ts +3 -0
- package/dist/generate/kinds/personal-data/class-header.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/class-header.js +7 -0
- package/dist/generate/kinds/personal-data/class-header.js.map +1 -0
- package/dist/generate/kinds/personal-data/column-lines.d.ts +4 -0
- package/dist/generate/kinds/personal-data/column-lines.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/column-lines.js +5 -0
- package/dist/generate/kinds/personal-data/column-lines.js.map +1 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.d.ts +12 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.js +73 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.js.map +1 -0
- package/dist/generate/kinds/personal-data/fields-line.d.ts +3 -0
- package/dist/generate/kinds/personal-data/fields-line.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/fields-line.js +7 -0
- package/dist/generate/kinds/personal-data/fields-line.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-column.d.ts +7 -0
- package/dist/generate/kinds/personal-data/personal-column.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-column.js +5 -0
- package/dist/generate/kinds/personal-data/personal-column.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-names.d.ts +21 -0
- package/dist/generate/kinds/personal-data/personal-names.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-names.js +41 -0
- package/dist/generate/kinds/personal-data/personal-names.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-request-of.d.ts +18 -0
- package/dist/generate/kinds/personal-data/personal-request-of.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-request-of.js +109 -0
- package/dist/generate/kinds/personal-data/personal-request-of.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-vars.d.ts +9 -0
- package/dist/generate/kinds/personal-data/personal-vars.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-vars.js +107 -0
- package/dist/generate/kinds/personal-data/personal-vars.js.map +1 -0
- package/dist/generate/kinds/personal-data/property-of.d.ts +3 -0
- package/dist/generate/kinds/personal-data/property-of.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/property-of.js +5 -0
- package/dist/generate/kinds/personal-data/property-of.js.map +1 -0
- package/dist/generate/kinds/personal-data/row-object.d.ts +3 -0
- package/dist/generate/kinds/personal-data/row-object.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/row-object.js +5 -0
- package/dist/generate/kinds/personal-data/row-object.js.map +1 -0
- package/dist/generate/kinds/process-kind.d.ts.map +1 -1
- package/dist/generate/kinds/process-kind.js +5 -3
- package/dist/generate/kinds/process-kind.js.map +1 -1
- package/dist/generate/kinds/repository-kind.d.ts.map +1 -1
- package/dist/generate/kinds/repository-kind.js +6 -3
- package/dist/generate/kinds/repository-kind.js.map +1 -1
- package/dist/generate/kinds/repository-prefix.d.ts +5 -0
- package/dist/generate/kinds/repository-prefix.d.ts.map +1 -0
- package/dist/generate/kinds/repository-prefix.js +11 -0
- package/dist/generate/kinds/repository-prefix.js.map +1 -0
- package/dist/generate/kinds/state-machine/state-machine-vars.js +3 -1
- package/dist/generate/kinds/state-machine/state-machine-vars.js.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts +10 -0
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -0
- package/dist/generate/kinds/wire-repository-on-first-use.js +14 -0
- package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -0
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts +2 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js +13 -2
- package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/refresh-docs.d.ts +2 -1
- package/dist/generate/refresh-docs.d.ts.map +1 -1
- package/dist/generate/refresh-docs.js +2 -2
- package/dist/generate/refresh-docs.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +19 -1
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +4 -3
- package/dist/help/usage.js.map +1 -1
- package/dist/init/files/event-sourcing-files.d.ts +9 -0
- package/dist/init/files/event-sourcing-files.d.ts.map +1 -0
- package/dist/init/files/event-sourcing-files.js +18 -0
- package/dist/init/files/event-sourcing-files.js.map +1 -0
- package/dist/init/files/init-files.d.ts.map +1 -1
- package/dist/init/files/init-files.js +4 -0
- package/dist/init/files/init-files.js.map +1 -1
- package/dist/init/files/platform-files.js +6 -1
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/files/privacy-files.d.ts +10 -0
- package/dist/init/files/privacy-files.d.ts.map +1 -0
- package/dist/init/files/privacy-files.js +24 -0
- package/dist/init/files/privacy-files.js.map +1 -0
- package/dist/init/files/project-files.d.ts.map +1 -1
- package/dist/init/files/project-files.js +5 -0
- package/dist/init/files/project-files.js.map +1 -1
- package/dist/init/files/script-files.d.ts +1 -0
- package/dist/init/files/script-files.d.ts.map +1 -1
- package/dist/init/files/script-files.js +8 -0
- package/dist/init/files/script-files.js.map +1 -1
- package/dist/init/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +1 -0
- package/dist/init/knip-vars.js.map +1 -1
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +9 -3
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +6 -2
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/overrides-for.d.ts +7 -0
- package/dist/init/manifest/overrides-for.d.ts.map +1 -0
- package/dist/init/manifest/overrides-for.js +9 -0
- package/dist/init/manifest/overrides-for.js.map +1 -0
- package/dist/init/manifest/pinned-below-a-fix.d.ts +14 -0
- package/dist/init/manifest/pinned-below-a-fix.d.ts.map +1 -0
- package/dist/init/manifest/pinned-below-a-fix.js +20 -0
- package/dist/init/manifest/pinned-below-a-fix.js.map +1 -0
- package/dist/init/manifest/scripts-for.js +17 -0
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/test-scripts.d.ts.map +1 -1
- package/dist/init/manifest/test-scripts.js +3 -0
- package/dist/init/manifest/test-scripts.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +28 -25
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/manifest/write-overrides.d.ts +9 -0
- package/dist/init/manifest/write-overrides.d.ts.map +1 -0
- package/dist/init/manifest/write-overrides.js +56 -0
- package/dist/init/manifest/write-overrides.js.map +1 -0
- package/dist/init/rewire-personal-data.d.ts +10 -0
- package/dist/init/rewire-personal-data.d.ts.map +1 -0
- package/dist/init/rewire-personal-data.js +32 -0
- package/dist/init/rewire-personal-data.js.map +1 -0
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +8 -3
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-personal-data.d.ts +10 -0
- package/dist/init/stack/resolve-personal-data.d.ts.map +1 -0
- package/dist/init/stack/resolve-personal-data.js +22 -0
- package/dist/init/stack/resolve-personal-data.js.map +1 -0
- package/dist/init/stack/resolve-queue.d.ts +4 -3
- package/dist/init/stack/resolve-queue.d.ts.map +1 -1
- package/dist/init/stack/resolve-queue.js +6 -8
- package/dist/init/stack/resolve-queue.js.map +1 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +2 -0
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/resolve-tenancy.d.ts +3 -3
- package/dist/init/stack/resolve-tenancy.js +5 -5
- package/dist/init/stack/resolve-tenancy.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +4 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/write-contracts.d.ts +2 -1
- package/dist/init/write-contracts.d.ts.map +1 -1
- package/dist/init/write-contracts.js +6 -3
- package/dist/init/write-contracts.js.map +1 -1
- package/dist/lint/eslint-in-project.d.ts +3 -2
- package/dist/lint/eslint-in-project.d.ts.map +1 -1
- package/dist/lint/eslint-in-project.js +5 -3
- package/dist/lint/eslint-in-project.js.map +1 -1
- package/dist/lint/lint-cache-of.d.ts +7 -0
- package/dist/lint/lint-cache-of.d.ts.map +1 -0
- package/dist/lint/lint-cache-of.js +47 -0
- package/dist/lint/lint-cache-of.js.map +1 -0
- package/dist/lint/lint-run.d.ts +2 -0
- package/dist/lint/lint-run.d.ts.map +1 -1
- package/dist/mutation/changed-files.d.ts +7 -0
- package/dist/mutation/changed-files.d.ts.map +1 -0
- package/dist/mutation/changed-files.js +15 -0
- package/dist/mutation/changed-files.js.map +1 -0
- package/dist/mutation/format-mutation.d.ts +4 -0
- package/dist/mutation/format-mutation.d.ts.map +1 -0
- package/dist/mutation/format-mutation.js +29 -0
- package/dist/mutation/format-mutation.js.map +1 -0
- package/dist/mutation/format-survivors.d.ts +8 -0
- package/dist/mutation/format-survivors.d.ts.map +1 -0
- package/dist/mutation/format-survivors.js +19 -0
- package/dist/mutation/format-survivors.js.map +1 -0
- package/dist/mutation/mutation-report-file.d.ts +3 -0
- package/dist/mutation/mutation-report-file.d.ts.map +1 -0
- package/dist/mutation/mutation-report-file.js +3 -0
- package/dist/mutation/mutation-report-file.js.map +1 -0
- package/dist/mutation/mutation-scores.d.ts +35 -0
- package/dist/mutation/mutation-scores.d.ts.map +1 -0
- package/dist/mutation/mutation-scores.js +55 -0
- package/dist/mutation/mutation-scores.js.map +1 -0
- package/dist/mutation/read-mutation-report.d.ts +16 -0
- package/dist/mutation/read-mutation-report.d.ts.map +1 -0
- package/dist/mutation/read-mutation-report.js +38 -0
- package/dist/mutation/read-mutation-report.js.map +1 -0
- package/dist/mutation/survivors.d.ts +19 -0
- package/dist/mutation/survivors.d.ts.map +1 -0
- package/dist/mutation/survivors.js +24 -0
- package/dist/mutation/survivors.js.map +1 -0
- package/dist/platform-layout/platform-layout.d.ts +2 -0
- package/dist/platform-layout/platform-layout.d.ts.map +1 -1
- package/dist/platform-layout/platform-layout.js +2 -0
- package/dist/platform-layout/platform-layout.js.map +1 -1
- package/dist/presets/apply-preset.js +2 -1
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-preset.d.ts.map +1 -1
- package/dist/presets/identity-preset.js +17 -1
- package/dist/presets/identity-preset.js.map +1 -1
- package/dist/presets/preset-files.d.ts.map +1 -1
- package/dist/presets/preset-files.js +1 -0
- package/dist/presets/preset-files.js.map +1 -1
- package/dist/presets/preset-step.d.ts +3 -1
- package/dist/presets/preset-step.d.ts.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -0
- package/dist/run.js.map +1 -1
- package/dist/stack/audit-vars.d.ts +1 -1
- package/dist/stack/audit-vars.d.ts.map +1 -1
- package/dist/stack/audit-vars.js +26 -8
- package/dist/stack/audit-vars.js.map +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +45 -3
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -2
- package/templates/background-job/background-job.spec.buses.ts.tpl +57 -0
- package/templates/background-job/wiring.manual.tpl +4 -0
- package/templates/context/CONTEXT.md.tpl +5 -0
- package/templates/controller/guard.spec.ts.tpl +2 -2
- package/templates/docs/asyncapi.privacy.json.tpl +100 -0
- package/templates/docs/event-catalog.privacy.md +18 -0
- package/templates/docs/privacy-register.md.tpl +25 -0
- package/templates/erasure-handler/erasure-handler.declared.ts.tpl +22 -0
- package/templates/erasure-handler/erasure-handler.spec.ts.tpl +36 -0
- package/templates/erasure-handler/erasure-handler.ts.tpl +20 -0
- package/templates/erasure-handler/wiring.manual.tpl +23 -0
- package/templates/erasure-handler/wiring.tsyringe.tpl +6 -0
- package/templates/init/README.md.tpl +43 -3
- package/templates/init/gitignore.tpl +3 -0
- package/templates/init/jest.config.js.tpl +2 -0
- package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +19 -1
- package/templates/init/platform/audit/create-audit.ts.tpl +28 -6
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +64 -6
- package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +12 -0
- package/templates/init/platform/composition/create-platform.manual.ts.tpl +7 -3
- package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +14 -2
- package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +17 -1
- package/templates/init/platform/composition/platform-options.manual.ts.tpl +4 -1
- package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +36 -0
- package/templates/init/platform/composition/platform.manual.ts.tpl +16 -0
- package/templates/init/platform/database/open-persistence.memory.ts.tpl +20 -0
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +13 -2
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +21 -1
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +17 -1
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +20 -1
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +45 -1
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +14 -1
- package/templates/init/platform/database/persistence.memory.ts.tpl +9 -0
- package/templates/init/platform/database/persistence.orm.ts.tpl +9 -1
- package/templates/init/platform/database/schema.drizzle.ts.tpl +18 -3
- package/templates/init/platform/database/schema.knex.ts.tpl +8 -1
- package/templates/init/platform/database/schema.prisma.tpl +182 -1
- package/templates/init/platform/database/schema.typeorm.ts.tpl +32 -1
- package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +36 -0
- package/templates/init/platform/event-sourcing/event-sourcing.module.ts.tpl +22 -0
- package/templates/init/platform/jobs/background-jobs.ts.tpl +21 -0
- package/templates/init/platform/jobs/create-background-work.ts.tpl +147 -0
- package/templates/init/platform/jobs/job-settings.ts.tpl +11 -0
- package/templates/init/platform/privacy/data-subject-copies.manual.ts.tpl +14 -0
- package/templates/init/platform/privacy/data-subject-copies.tsyringe.ts.tpl +13 -0
- package/templates/init/platform/privacy/data-subject-exports.manual.ts.tpl +14 -0
- package/templates/init/platform/privacy/data-subject-exports.tsyringe.ts.tpl +13 -0
- package/templates/init/platform/privacy/privacy.module.tsyringe.ts.tpl +20 -0
- package/templates/init/platform/privacy/run-erasure.manual.ts.tpl +100 -0
- package/templates/init/platform/privacy/run-erasure.tsyringe.ts.tpl +104 -0
- package/templates/init/platform/privacy/run-export.manual.ts.tpl +64 -0
- package/templates/init/platform/privacy/run-export.tsyringe.ts.tpl +71 -0
- package/templates/init/platform/privacy/run-purge.manual.ts.tpl +39 -0
- package/templates/init/platform/privacy/run-purge.tsyringe.ts.tpl +45 -0
- package/templates/init/rules/infrastructure.md.tpl +1 -1
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/init/scripts/events.ts.tpl +12 -0
- package/templates/init/scripts/privacy-erase.manual.ts.tpl +78 -0
- package/templates/init/scripts/privacy-erase.tsyringe.ts.tpl +78 -0
- package/templates/init/scripts/privacy-export.manual.ts.tpl +79 -0
- package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +79 -0
- package/templates/init/scripts/privacy-purge.manual.ts.tpl +48 -0
- package/templates/init/scripts/privacy-purge.tsyringe.ts.tpl +48 -0
- package/templates/personal-data/adapter-field.tpl +4 -0
- package/templates/personal-data/copies.manual.tpl +4 -0
- package/templates/personal-data/copies.tsyringe.tpl +4 -0
- package/templates/personal-data/declaration.drizzle.ts.tpl +22 -0
- package/templates/personal-data/declaration.knex.ts.tpl +24 -0
- package/templates/personal-data/declaration.prisma.ts.tpl +24 -0
- package/templates/personal-data/declaration.typeorm.ts.tpl +21 -0
- package/templates/personal-data/erasure.drizzle.ts.tpl +43 -0
- package/templates/personal-data/erasure.knex.ts.tpl +41 -0
- package/templates/personal-data/erasure.prisma.ts.tpl +43 -0
- package/templates/personal-data/erasure.typeorm.ts.tpl +41 -0
- package/templates/personal-data/export-fake.ts.tpl +24 -0
- package/templates/personal-data/export-port.ts.tpl +8 -0
- package/templates/personal-data/export.drizzle.ts.tpl +43 -0
- package/templates/personal-data/export.knex.ts.tpl +41 -0
- package/templates/personal-data/export.prisma.ts.tpl +43 -0
- package/templates/personal-data/export.typeorm.ts.tpl +41 -0
- package/templates/personal-data/exports.manual.tpl +4 -0
- package/templates/personal-data/exports.tsyringe.tpl +4 -0
- package/templates/personal-data/fake.ts.tpl +26 -0
- package/templates/personal-data/port.ts.tpl +8 -0
- package/templates/personal-data/spec.ts.tpl +280 -0
- package/templates/personal-data/wiring.tsyringe.tpl +12 -0
- package/templates/pipeline/github/workflows/ci.yml.tpl +62 -0
- package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +64 -2
- package/templates/pipeline/jest.mutation.config.js.tpl +8 -0
- package/templates/pipeline/knip.json.tpl +1 -1
- package/templates/pipeline/lefthook.yml +6 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/pipeline/stryker.config.mjs.tpl +25 -0
- package/templates/pipeline/vitest.config.ts.tpl +2 -0
- package/templates/pipeline/vitest.mutation.config.ts.tpl +29 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.drizzle.ts.tpl +17 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.knex.ts.tpl +19 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.drizzle.ts.tpl +18 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.knex.ts.tpl +20 -0
- package/templates/presets/identity/context/test/unit/account-deactivated.integration-handler.spec.ts.tpl +4 -2
- package/templates/presets/identity/context/test/unit/deactivate-account.handler.spec.ts.tpl +7 -5
- package/templates/presets/identity/context/test/unit/environment-identity-provider-connection.adapter.spec.ts.tpl +7 -3
- package/templates/presets/identity/context/test/unit/invite-member.handler.spec.ts.tpl +7 -7
- package/templates/presets/identity/context/test/unit/member-joined.integration-handler.spec.ts.tpl +4 -2
- package/templates/presets/identity/context/test/unit/member-removed.integration-handler.spec.ts.tpl +5 -3
- package/templates/presets/identity/context/test/unit/organisation-opened.integration-handler.spec.ts.tpl +4 -2
- package/templates/presets/identity/context/test/unit/revoke-invitation.handler.spec.ts.tpl +7 -5
- package/templates/process/process.spec.ts.tpl +6 -3
- package/templates/process/timeout-job.spec.buses.ts.tpl +42 -0
- package/templates/process/timeout-job.wiring.manual.tpl +4 -0
- package/templates/repository/drizzle/mapper.ts.tpl +10 -0
- package/templates/repository/drizzle/table.tpl +6 -0
- package/templates/repository/knex/mapper.ts.tpl +10 -0
- package/templates/repository/knex/row.ts.tpl +3 -0
- package/templates/repository/knex/table.tpl +3 -0
- package/templates/repository/prisma/mapper.ts.tpl +16 -1
- package/templates/repository/prisma/model.tpl +9 -0
- package/templates/repository/prisma/repository.ts.tpl +55 -0
- package/templates/repository/typeorm/mapper.ts.tpl +10 -0
- package/templates/repository/typeorm/repository.ts.tpl +48 -0
- package/templates/repository/typeorm/row.ts.tpl +9 -1
- package/templates/repository/typeorm/table.tpl +27 -0
- package/templates/value-object/value-object.spec.ts.tpl +1 -0
- package/dist/generate/kinds/background/require-container.d.ts +0 -7
- package/dist/generate/kinds/background/require-container.d.ts.map +0 -1
- package/dist/generate/kinds/background/require-container.js +0 -13
- package/dist/generate/kinds/background/require-container.js.map +0 -1
- /package/templates/background-job/{background-job.spec.ts.tpl → background-job.spec.tsyringe.ts.tpl} +0 -0
- /package/templates/process/{timeout-job.spec.ts.tpl → timeout-job.spec.tsyringe.ts.tpl} +0 -0
- /package/templates/repository/{wiring.manual.tpl → first-use.wiring.manual.tpl} +0 -0
|
@@ -11,6 +11,9 @@ import { subscribeAll } from '@ddd-ts-kit/events';
|
|
|
11
11
|
{{#if http.any}}
|
|
12
12
|
import { createErrorMapper, defineRoutes, type Route } from '@ddd-ts-kit/http';
|
|
13
13
|
{{/if}}
|
|
14
|
+
{{#if audit.archive}}
|
|
15
|
+
import { ArchiveAuditEntries } from '@ddd-ts-kit/audit';
|
|
16
|
+
{{/if}}
|
|
14
17
|
{{#if files.any}}
|
|
15
18
|
import { PurgeStagedFiles } from '@ddd-ts-kit/kernel';
|
|
16
19
|
{{/if}}
|
|
@@ -42,6 +45,9 @@ import { fileRoutes } from '{{alias.platform}}/files/file-routes{{alias.ext}}';
|
|
|
42
45
|
{{/if}}
|
|
43
46
|
import type { Platform } from '{{alias.platform}}/composition/platform{{alias.ext}}';
|
|
44
47
|
import type { PlatformOptions } from '{{alias.platform}}/composition/platform-options{{alias.ext}}';
|
|
48
|
+
{{#if privacy.on}}
|
|
49
|
+
import { runPurge } from '{{alias.platform}}/privacy/run-purge{{alias.ext}}';
|
|
50
|
+
{{/if}}
|
|
45
51
|
// ddd-ts-kit:imports
|
|
46
52
|
// /ddd-ts-kit:imports
|
|
47
53
|
|
|
@@ -118,8 +124,8 @@ export function composeApplication(
|
|
|
118
124
|
const { logger, metrics, cache, clock } = platform;
|
|
119
125
|
|
|
120
126
|
installAspectRuntime({ logger, metrics, cache, clock });
|
|
121
|
-
{{#if
|
|
122
|
-
|
|
127
|
+
{{#if platformJobs.any}}
|
|
128
|
+
registerPlatformJobs(platform);
|
|
123
129
|
{{/if}}
|
|
124
130
|
|
|
125
131
|
{{#if audit.route}}
|
|
@@ -188,7 +194,11 @@ export function composeApplication(
|
|
|
188
194
|
};
|
|
189
195
|
}
|
|
190
196
|
|
|
191
|
-
/**
|
|
197
|
+
/**
|
|
198
|
+
* The consumers first, then the jobs: a job sends commands whose events must find their handlers.
|
|
199
|
+
* The worker of the background jobs runs in the process that runs the jobs{{#if queue.memory}}, and in every
|
|
200
|
+
* process while the queue is kept in its memory: no other process would see what this one enqueues{{/if}}.
|
|
201
|
+
*/
|
|
192
202
|
async function start(platform: Platform, options: ApplicationOptions): Promise<void> {
|
|
193
203
|
{{#if authz.rebac}}
|
|
194
204
|
await relateSystemActors();
|
|
@@ -207,22 +217,45 @@ async function start(platform: Platform, options: ApplicationOptions): Promise<v
|
|
|
207
217
|
|
|
208
218
|
if (options.jobs?.start === true) {
|
|
209
219
|
await platform.jobs.start();
|
|
220
|
+
{{#unless queue.memory}}
|
|
221
|
+
await platform.backgroundJobs.start();
|
|
222
|
+
{{/unless}}
|
|
210
223
|
}
|
|
224
|
+
{{#if queue.memory}}
|
|
225
|
+
|
|
226
|
+
await platform.backgroundJobs.start();
|
|
227
|
+
{{/if}}
|
|
211
228
|
}
|
|
212
229
|
|
|
213
230
|
/**
|
|
214
|
-
* The jobs first, then the provider{{#if errors.sentry}}; what failed on the
|
|
215
|
-
* tracker{{/if}}; the logger last, flushed by hand since nothing here
|
|
216
|
-
* before, and nothing may log after `stop()` returned.
|
|
231
|
+
* The jobs first, the worker next (a job may still enqueue), then the provider{{#if errors.sentry}}; what failed on the
|
|
232
|
+
* way is given two seconds to reach the tracker{{/if}}; the logger last, flushed by hand since nothing here
|
|
233
|
+
* does it: whatever logs has closed before, and nothing may log after `stop()` returned.
|
|
217
234
|
*/
|
|
218
235
|
async function stop(platform: Platform, options: ApplicationOptions): Promise<void> {
|
|
219
236
|
await platform.jobs.stop();
|
|
237
|
+
await platform.backgroundJobs.stop();
|
|
220
238
|
await options.events.close();
|
|
221
239
|
{{#if errors.sentry}}
|
|
222
240
|
await platform.errors.flush(2_000);
|
|
223
241
|
{{/if}}
|
|
224
242
|
await platform.logger.flush();
|
|
225
243
|
}
|
|
244
|
+
{{#if platformJobs.any}}
|
|
245
|
+
|
|
246
|
+
/** The jobs of the platform itself, run by the process that runs the jobs. */
|
|
247
|
+
function registerPlatformJobs(platform: Platform): void {
|
|
248
|
+
{{#if files.any}}
|
|
249
|
+
purgeStagedFiles(platform);
|
|
250
|
+
{{/if}}
|
|
251
|
+
{{#if audit.archive}}
|
|
252
|
+
archiveAuditEntries(platform);
|
|
253
|
+
{{/if}}
|
|
254
|
+
{{#if privacy.on}}
|
|
255
|
+
purgeExpiredEveryNight(platform);
|
|
256
|
+
{{/if}}
|
|
257
|
+
}
|
|
258
|
+
{{/if}}
|
|
226
259
|
{{#if files.any}}
|
|
227
260
|
|
|
228
261
|
/** What rolled-back commands left in `staging/`, removed every hour by the process that runs the jobs. */
|
|
@@ -232,3 +265,28 @@ function purgeStagedFiles(platform: Platform): void {
|
|
|
232
265
|
platform.jobs.register({ name: 'files.purge-staged', schedule: { every: '1h' }, run: () => purge.run() });
|
|
233
266
|
}
|
|
234
267
|
{{/if}}
|
|
268
|
+
{{#if audit.archive}}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* The entries of the audit trail older than the twelve whole months it keeps online, moved to the
|
|
272
|
+
* storage on the first day of every month at 04:00 UTC, verified and anchored.
|
|
273
|
+
*/
|
|
274
|
+
function archiveAuditEntries(platform: Platform): void {
|
|
275
|
+
const archive = new ArchiveAuditEntries(platform.audit.trail, platform.files.storage, platform.clock);
|
|
276
|
+
|
|
277
|
+
platform.jobs.register({ name: 'audit.archive', schedule: { cron: '0 4 1 * *' }, run: () => archive.run() });
|
|
278
|
+
}
|
|
279
|
+
{{/if}}
|
|
280
|
+
{{#if privacy.on}}
|
|
281
|
+
|
|
282
|
+
/** What outlived the retention its declaration gives, purged every night at 03:00 UTC by the process that runs the jobs. */
|
|
283
|
+
function purgeExpiredEveryNight(platform: Platform): void {
|
|
284
|
+
platform.jobs.register({
|
|
285
|
+
name: 'privacy.purge-expired',
|
|
286
|
+
schedule: { cron: '0 3 * * *' },
|
|
287
|
+
run: async () => {
|
|
288
|
+
await runPurge(platform);
|
|
289
|
+
},
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
{{/if}}
|
|
@@ -103,12 +103,18 @@ import { relateSystemActors } from '{{alias.platform}}/auth/relationships/relate
|
|
|
103
103
|
import { createCommandBus } from '{{alias.platform}}/buses/create-command-bus{{alias.ext}}';
|
|
104
104
|
import { createQueryBus } from '{{alias.platform}}/buses/create-query-bus{{alias.ext}}';
|
|
105
105
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
106
|
+
{{#if eventSourcing.on}}
|
|
107
|
+
import { eventSourcingModule } from '{{alias.platform}}/event-sourcing/event-sourcing.module{{alias.ext}}';
|
|
108
|
+
{{/if}}
|
|
106
109
|
{{#if files.http}}
|
|
107
110
|
import { fileRoutes } from '{{alias.platform}}/files/file-routes{{alias.ext}}';
|
|
108
111
|
{{/if}}
|
|
109
112
|
{{#if files.any}}
|
|
110
113
|
import { filesModule } from '{{alias.platform}}/files/files.module{{alias.ext}}';
|
|
111
114
|
{{/if}}
|
|
115
|
+
{{#if privacy.on}}
|
|
116
|
+
import { privacyModule } from '{{alias.platform}}/privacy/privacy.module{{alias.ext}}';
|
|
117
|
+
{{/if}}
|
|
112
118
|
import { layFoundations, type Foundations } from '{{alias.platform}}/composition/lay-foundations{{alias.ext}}';
|
|
113
119
|
import { platformModule, type PlatformOptions } from '{{alias.platform}}/composition/platform.module{{alias.ext}}';
|
|
114
120
|
// ddd-ts-kit:imports
|
|
@@ -198,12 +204,18 @@ export function composeApplication(
|
|
|
198
204
|
modules: [
|
|
199
205
|
kernel(foundations, persistence, options),
|
|
200
206
|
platformModule(persistence, options),
|
|
207
|
+
{{#if eventSourcing.on}}
|
|
208
|
+
eventSourcingModule(foundations.eventSourcing),
|
|
209
|
+
{{/if}}
|
|
201
210
|
guard,
|
|
202
211
|
{{#if audit.on}}
|
|
203
212
|
auditModule(foundations.audit),
|
|
204
213
|
{{/if}}
|
|
205
214
|
{{#if files.any}}
|
|
206
215
|
filesModule(options.files ?? new InMemoryFileStorage()),
|
|
216
|
+
{{/if}}
|
|
217
|
+
{{#if privacy.on}}
|
|
218
|
+
privacyModule(),
|
|
207
219
|
{{/if}}
|
|
208
220
|
...contexts.modules,
|
|
209
221
|
],
|
|
@@ -31,6 +31,7 @@ import { platformEvents } from '{{alias.platform}}/events/platform-events{{alias
|
|
|
31
31
|
{{#if files.any}}
|
|
32
32
|
import { createFiles, type Files } from '{{alias.platform}}/files/create-files{{alias.ext}}';
|
|
33
33
|
{{/if}}
|
|
34
|
+
import { createBackgroundWork } from '{{alias.platform}}/jobs/create-background-work{{alias.ext}}';
|
|
34
35
|
import { defaultPolicy } from '{{alias.platform}}/resilience/default-policy{{alias.ext}}';
|
|
35
36
|
import { defaultResilienceSettings } from '{{alias.platform}}/resilience/default-resilience-settings{{alias.ext}}';
|
|
36
37
|
import { ownPolicy } from '{{alias.platform}}/resilience/own-policy{{alias.ext}}';
|
|
@@ -38,8 +39,8 @@ import type { ResilienceSettings } from '{{alias.platform}}/resilience/resilienc
|
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* The platform, assembled: the foundations, the domain events, the guard of the use cases, the
|
|
41
|
-
* two buses, the event ports{{#if files.any}}, the files{{/if}} and what every adapter is wrapped in.
|
|
42
|
-
* (another broker, another clock) happens here and nowhere else.
|
|
42
|
+
* two buses, the event ports, the background work{{#if files.any}}, the files{{/if}} and what every adapter is wrapped in.
|
|
43
|
+
* Replacing a provider (another broker, another clock) happens here and nowhere else.
|
|
43
44
|
*/
|
|
44
45
|
export function createPlatform(persistence: Persistence, options: PlatformOptions): Platform {
|
|
45
46
|
const foundations = layFoundations(persistence, options);
|
|
@@ -65,11 +66,14 @@ export function createPlatform(persistence: Persistence, options: PlatformOption
|
|
|
65
66
|
{{#if files.any}}
|
|
66
67
|
const files = filesOf(options, foundations);
|
|
67
68
|
{{/if}}
|
|
69
|
+
const commands = createCommandBus(foundations, { guard: protection.guard, persistence{{#if files.any}}, files{{/if}}{{#if cache.relaySignal}}, redis: options.redis{{/if}} });
|
|
68
70
|
|
|
69
71
|
return {
|
|
70
72
|
...founded,
|
|
71
73
|
...platformEvents(persistence, options, foundations),
|
|
72
|
-
|
|
74
|
+
// The queue, its worker and the runner of the process managers: a timeout is a command the runner sends on the bus.
|
|
75
|
+
...createBackgroundWork({ persistence, options, foundations, commands }),
|
|
76
|
+
commands,
|
|
73
77
|
queries: createQueryBus(foundations, protection.guard),
|
|
74
78
|
domainEvents,
|
|
75
79
|
persistence,
|
|
@@ -31,11 +31,14 @@ import { logDecisions } from '{{alias.platform}}/auth/authorization/log-decision
|
|
|
31
31
|
import type { Platform } from '{{alias.platform}}/composition/platform{{alias.ext}}';
|
|
32
32
|
import type { PlatformOptions } from '{{alias.platform}}/composition/platform-options{{alias.ext}}';
|
|
33
33
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
34
|
+
{{#if eventSourcing.on}}
|
|
35
|
+
import { createEventSourcing } from '{{alias.platform}}/event-sourcing/create-event-sourcing{{alias.ext}}';
|
|
36
|
+
{{/if}}
|
|
34
37
|
import { ConfiguredJobScheduler } from '{{alias.platform}}/jobs/configured-job-scheduler{{alias.ext}}';
|
|
35
38
|
import { createLogger } from '{{alias.platform}}/observability/create-logger{{alias.ext}}';
|
|
36
39
|
import { createMetrics } from '{{alias.platform}}/observability/create-metrics{{alias.ext}}';
|
|
37
40
|
|
|
38
|
-
|
|
41
|
+
{{foundations.founded}}
|
|
39
42
|
|
|
40
43
|
/**
|
|
41
44
|
* What exists before anything else: one execution scope, one clock and one generator for the
|
|
@@ -72,6 +75,9 @@ export function layFoundations(persistence: Persistence, options: PlatformOption
|
|
|
72
75
|
// TODO(platform): this lock excludes inside one process only. Before running several instances, give the scheduler a lock between processes (`RedisLock` of @ddd-ts-kit/redis), or each instance runs every job.
|
|
73
76
|
const lock = new InMemoryLock(clock);
|
|
74
77
|
{{/unless}}
|
|
78
|
+
{{#if audit.on}}
|
|
79
|
+
const audit = createAudit(persistence, { scope, clock, ids });
|
|
80
|
+
{{/if}}
|
|
75
81
|
|
|
76
82
|
return {
|
|
77
83
|
traced,
|
|
@@ -100,10 +106,16 @@ export function layFoundations(persistence: Persistence, options: PlatformOption
|
|
|
100
106
|
jobs: schedulerOf(options, traced, { clock, lock, scope, ids, logger, metrics, onRun: reportFailedRuns(errors) }),
|
|
101
107
|
{{/if}}
|
|
102
108
|
{{#if audit.on}}
|
|
103
|
-
audit
|
|
109
|
+
audit,
|
|
110
|
+
{{#if eventSourcing.on}}
|
|
111
|
+
eventSourcing: createEventSourcing(persistence, audit, { scope, clock, ids }),
|
|
112
|
+
{{/if}}
|
|
104
113
|
{{/if}}
|
|
105
114
|
{{#unless audit.on}}
|
|
106
115
|
decisions: logDecisions(logger),
|
|
116
|
+
{{#if eventSourcing.on}}
|
|
117
|
+
eventSourcing: createEventSourcing(persistence),
|
|
118
|
+
{{/if}}
|
|
107
119
|
{{/unless}}
|
|
108
120
|
};
|
|
109
121
|
}
|
|
@@ -19,6 +19,9 @@ import { createAudit, type Audit } from '{{alias.platform}}/audit/create-audit{{
|
|
|
19
19
|
import { logDecisions } from '{{alias.platform}}/auth/authorization/log-decisions{{alias.ext}}';
|
|
20
20
|
{{/unless}}
|
|
21
21
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
22
|
+
{{#if eventSourcing.on}}
|
|
23
|
+
import { createEventSourcing, type EventSourcing } from '{{alias.platform}}/event-sourcing/create-event-sourcing{{alias.ext}}';
|
|
24
|
+
{{/if}}
|
|
22
25
|
import { createLogger, type LogSettings } from '{{alias.platform}}/observability/create-logger{{alias.ext}}';
|
|
23
26
|
import { createMetrics } from '{{alias.platform}}/observability/create-metrics{{alias.ext}}';
|
|
24
27
|
|
|
@@ -42,6 +45,10 @@ export interface Foundations {
|
|
|
42
45
|
/** What every authorization decision is told to: the log, since the audit trail is off. */
|
|
43
46
|
readonly decisions: OnDecision;
|
|
44
47
|
{{/unless}}
|
|
48
|
+
{{#if eventSourcing.on}}
|
|
49
|
+
/** The event store, the keys of the data subjects{{#if audit.on}}, audited,{{/if}} and the cipher of the personal values of the stored events. */
|
|
50
|
+
readonly eventSourcing: EventSourcing;
|
|
51
|
+
{{/if}}
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
interface Observed {
|
|
@@ -56,6 +63,9 @@ export function layFoundations(persistence: Persistence, options: Observed): Fou
|
|
|
56
63
|
const clock = new SystemClock();
|
|
57
64
|
const ids = new UuidGenerator();
|
|
58
65
|
const logger = createLogger(scope, options.log);
|
|
66
|
+
{{#if audit.on}}
|
|
67
|
+
const audit = createAudit(persistence, { scope, clock, ids });
|
|
68
|
+
{{/if}}
|
|
59
69
|
|
|
60
70
|
return {
|
|
61
71
|
scope,
|
|
@@ -65,10 +75,16 @@ export function layFoundations(persistence: Persistence, options: Observed): Fou
|
|
|
65
75
|
metrics: createMetrics(),
|
|
66
76
|
traced: traceApplication({ consumers: options.traceConsumers ?? 'continue' }),
|
|
67
77
|
{{#if audit.on}}
|
|
68
|
-
audit
|
|
78
|
+
audit,
|
|
79
|
+
{{#if eventSourcing.on}}
|
|
80
|
+
eventSourcing: createEventSourcing(persistence, audit, { scope, clock, ids }),
|
|
81
|
+
{{/if}}
|
|
69
82
|
{{/if}}
|
|
70
83
|
{{#unless audit.on}}
|
|
71
84
|
decisions: logDecisions(logger),
|
|
85
|
+
{{#if eventSourcing.on}}
|
|
86
|
+
eventSourcing: createEventSourcing(persistence),
|
|
87
|
+
{{/if}}
|
|
72
88
|
{{/unless}}
|
|
73
89
|
};
|
|
74
90
|
}
|
|
@@ -14,6 +14,7 @@ import type { FileStorage, JobSettings } from '@ddd-ts-kit/kernel';
|
|
|
14
14
|
import type { JobSettings } from '@ddd-ts-kit/kernel';
|
|
15
15
|
{{/unless}}
|
|
16
16
|
{{/unless}}
|
|
17
|
+
import type { QueueWorkerOptions } from '@ddd-ts-kit/scheduling';
|
|
17
18
|
import type { ConsumerTrace } from '@ddd-ts-kit/tracing';
|
|
18
19
|
import type { EventProvider } from '{{alias.platform}}/events/event-provider{{alias.ext}}';
|
|
19
20
|
import type { LogSettings } from '{{alias.platform}}/observability/create-logger{{alias.ext}}';
|
|
@@ -40,8 +41,10 @@ export interface PlatformOptions {
|
|
|
40
41
|
{{/if}}
|
|
41
42
|
/** The policy around every adapter that leaves the process; left out, `resilience/default-resilience-settings.ts`. */
|
|
42
43
|
readonly resilience?: ResilienceSettings;
|
|
43
|
-
/** Whether this process runs the scheduled jobs, and
|
|
44
|
+
/** Whether this process runs the scheduled jobs and consumes the background jobs, and the settings of the scheduled ones; left out (the tools, the tests), no job runs by time. */
|
|
44
45
|
readonly jobs?: JobsOptions;
|
|
46
|
+
/** Concurrency per queue, polling interval and grace period of the worker of the background jobs; left out, one attempt at a time per queue. */
|
|
47
|
+
readonly queues?: Pick<QueueWorkerOptions, 'concurrency' | 'pollIntervalMs' | 'graceMs'>;
|
|
45
48
|
/** Whether a consumed event continues the trace of its publication (the default) or starts one linked to it. */
|
|
46
49
|
readonly traceConsumers?: ConsumerTrace;
|
|
47
50
|
{{#if cache.redis}}
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
+
{{#if eventSourcing.on}}
|
|
2
|
+
import { defineContextModule, type ModuleBuilder } from '@ddd-ts-kit/di';
|
|
3
|
+
import {
|
|
4
|
+
CheckpointStore,
|
|
5
|
+
EventStore,
|
|
6
|
+
InMemoryCheckpointStore,
|
|
7
|
+
InMemoryEventStore,
|
|
8
|
+
{{#if files.any}}
|
|
9
|
+
InMemoryFileStorage,
|
|
10
|
+
{{/if}}
|
|
11
|
+
InMemorySnapshotStore,
|
|
12
|
+
InMemorySubjectKeyStore,
|
|
13
|
+
PersonalDataCipher,
|
|
14
|
+
SnapshotStore,
|
|
15
|
+
SubjectKeyStore,
|
|
16
|
+
} from '@ddd-ts-kit/kernel';
|
|
17
|
+
{{/if}}
|
|
18
|
+
{{#unless eventSourcing.on}}
|
|
1
19
|
import { defineContextModule } from '@ddd-ts-kit/di';
|
|
2
20
|
{{#if files.any}}
|
|
3
21
|
import { InMemoryFileStorage } from '@ddd-ts-kit/kernel';
|
|
4
22
|
{{/if}}
|
|
23
|
+
{{/unless}}
|
|
5
24
|
{{#if persistence.packagedToken}}
|
|
6
25
|
import { {{persistence.token}} } from '{{persistence.tokenPackage}}';
|
|
7
26
|
{{/if}}
|
|
@@ -28,8 +47,25 @@ export const platformTestModule = defineContextModule({
|
|
|
28
47
|
// The files a handler spec stores stay in the memory of the test.
|
|
29
48
|
bindFiles(builder, new InMemoryFileStorage());
|
|
30
49
|
|
|
50
|
+
{{/if}}
|
|
51
|
+
{{#if eventSourcing.on}}
|
|
52
|
+
// The stored events, the snapshots, the checkpoints and the keys of a handler spec stay in the memory of the test: an event-sourced aggregate needs no fake.
|
|
53
|
+
bindEventSourcing(builder);
|
|
54
|
+
|
|
31
55
|
{{/if}}
|
|
32
56
|
// ddd-ts-kit:test-bindings
|
|
33
57
|
// /ddd-ts-kit:test-bindings
|
|
34
58
|
},
|
|
35
59
|
});
|
|
60
|
+
{{#if eventSourcing.on}}
|
|
61
|
+
|
|
62
|
+
function bindEventSourcing(builder: ModuleBuilder): void {
|
|
63
|
+
const subjectKeys = new InMemorySubjectKeyStore();
|
|
64
|
+
|
|
65
|
+
builder.bind(EventStore).toValue(new InMemoryEventStore());
|
|
66
|
+
builder.bind(SnapshotStore).toValue(new InMemorySnapshotStore());
|
|
67
|
+
builder.bind(CheckpointStore).toValue(new InMemoryCheckpointStore());
|
|
68
|
+
builder.bind(SubjectKeyStore).toValue(subjectKeys);
|
|
69
|
+
builder.bind(PersonalDataCipher).toValue(new PersonalDataCipher(subjectKeys));
|
|
70
|
+
}
|
|
71
|
+
{{/if}}
|
|
@@ -17,9 +17,11 @@ import type {
|
|
|
17
17
|
InMemoryQueryBus,
|
|
18
18
|
IntegrationEventPublisher,
|
|
19
19
|
IntegrationEventSubscriber,
|
|
20
|
+
JobQueue,
|
|
20
21
|
JobScheduler,
|
|
21
22
|
Logger,
|
|
22
23
|
Metrics,
|
|
24
|
+
ProcessRunner,
|
|
23
25
|
{{#if cache.rateLimit}}
|
|
24
26
|
RateLimiter,
|
|
25
27
|
{{/if}}
|
|
@@ -29,9 +31,13 @@ import type { Audit } from '{{alias.platform}}/audit/create-audit{{alias.ext}}';
|
|
|
29
31
|
{{/if}}
|
|
30
32
|
import type { UseCaseProtection } from '{{alias.platform}}/auth/authorization/use-case-protection{{alias.ext}}';
|
|
31
33
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
34
|
+
{{#if eventSourcing.on}}
|
|
35
|
+
import type { EventSourcing } from '{{alias.platform}}/event-sourcing/create-event-sourcing{{alias.ext}}';
|
|
36
|
+
{{/if}}
|
|
32
37
|
{{#if files.any}}
|
|
33
38
|
import type { Files } from '{{alias.platform}}/files/create-files{{alias.ext}}';
|
|
34
39
|
{{/if}}
|
|
40
|
+
import type { BackgroundJobs } from '{{alias.platform}}/jobs/background-jobs{{alias.ext}}';
|
|
35
41
|
|
|
36
42
|
/** Wraps an adapter from outside: a span for its kind and, for what leaves the process, the default policy unless it states its own. */
|
|
37
43
|
type Adapt = <T extends object>(instance: T, info: AspectInfo) => T;
|
|
@@ -81,6 +87,12 @@ export interface Platform {
|
|
|
81
87
|
{{/if}}
|
|
82
88
|
/** Where a context registers its scheduled jobs; the application starts it when this process runs the jobs. */
|
|
83
89
|
readonly jobs: JobScheduler;
|
|
90
|
+
/** What a use case enqueues through: a background job is written with its command and run later by the worker, as the actor that enqueued it. */
|
|
91
|
+
readonly jobQueue: JobQueue;
|
|
92
|
+
/** Where a context registers its background jobs; the application starts it when this process runs the jobs. */
|
|
93
|
+
readonly backgroundJobs: BackgroundJobs;
|
|
94
|
+
/** Runs the steps of the process managers, in the unit of work of the step, and delivers their timeouts through the queue. */
|
|
95
|
+
readonly processes: ProcessRunner;
|
|
84
96
|
readonly adapter: Adapt;
|
|
85
97
|
/** The same, for an adapter that states its own policy, as aspects or as decorators on its class. */
|
|
86
98
|
readonly selfGoverned: Adapt;
|
|
@@ -88,6 +100,10 @@ export interface Platform {
|
|
|
88
100
|
{{#if audit.on}}
|
|
89
101
|
readonly audit: Audit;
|
|
90
102
|
{{/if}}
|
|
103
|
+
{{#if eventSourcing.on}}
|
|
104
|
+
/** The event store, the keys of the data subjects{{#if audit.on}}, audited,{{/if}} and the cipher of the personal values of the stored events: what an event-sourced repository adapter loads, saves and seals through{{#if privacy.on}}, and whose keys `scripts/privacy-erase.ts` destroys{{/if}}. */
|
|
105
|
+
readonly eventSourcing: EventSourcing;
|
|
106
|
+
{{/if}}
|
|
91
107
|
{{#if files.any}}
|
|
92
108
|
/** Where files live, the keys they are stored under and the staging that keeps them consistent with the database: never their content in a table. */
|
|
93
109
|
readonly files: Files;
|
|
@@ -4,7 +4,19 @@ import { InMemoryOutboxStore, InMemoryRelaySignal } from '@ddd-ts-kit/events';
|
|
|
4
4
|
{{#unless persistence.signals}}
|
|
5
5
|
import { InMemoryOutboxStore } from '@ddd-ts-kit/events';
|
|
6
6
|
{{/unless}}
|
|
7
|
+
{{#if eventSourcing.on}}
|
|
8
|
+
import {
|
|
9
|
+
InMemoryCheckpointStore,
|
|
10
|
+
InMemoryEventStore,
|
|
11
|
+
InMemoryProcessedEventStore,
|
|
12
|
+
InMemorySnapshotStore,
|
|
13
|
+
InMemorySubjectKeyStore,
|
|
14
|
+
InMemoryUnitOfWork,
|
|
15
|
+
} from '@ddd-ts-kit/kernel';
|
|
16
|
+
{{/if}}
|
|
17
|
+
{{#unless eventSourcing.on}}
|
|
7
18
|
import { InMemoryProcessedEventStore, InMemoryUnitOfWork } from '@ddd-ts-kit/kernel';
|
|
19
|
+
{{/unless}}
|
|
8
20
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
9
21
|
|
|
10
22
|
{{#if orm.custom}}
|
|
@@ -30,6 +42,14 @@ export function openPersistence(): Persistence {
|
|
|
30
42
|
outbox: new InMemoryOutboxStore(),
|
|
31
43
|
{{/unless}}
|
|
32
44
|
processedEvents: new InMemoryProcessedEventStore(),
|
|
45
|
+
{{#if eventSourcing.on}}
|
|
46
|
+
eventSourcing: {
|
|
47
|
+
events: new InMemoryEventStore(),
|
|
48
|
+
snapshots: new InMemorySnapshotStore(),
|
|
49
|
+
checkpoints: new InMemoryCheckpointStore(),
|
|
50
|
+
subjectKeys: new InMemorySubjectKeyStore(),
|
|
51
|
+
},
|
|
52
|
+
{{/if}}
|
|
33
53
|
close: () => Promise.resolve(),
|
|
34
54
|
};
|
|
35
55
|
}
|
|
@@ -4,6 +4,9 @@ import { openAsBlob } from 'node:fs';
|
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
5
|
import { PGlite } from '@electric-sql/pglite';
|
|
6
6
|
import { PGLiteSocketServer } from '@electric-sql/pglite-socket';
|
|
7
|
+
{{#if audit.on}}
|
|
8
|
+
import { auditGuardStatements } from '@ddd-ts-kit/audit/prisma';
|
|
9
|
+
{{/if}}
|
|
7
10
|
import pg from 'pg';
|
|
8
11
|
import type { PrismaClient } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
9
12
|
import { createClient } from '{{alias.platform}}/database/create-client{{alias.ext}}';
|
|
@@ -13,7 +16,7 @@ import type { Persistence } from '{{alias.platform}}/database/persistence{{alias
|
|
|
13
16
|
export interface TestDatabase {
|
|
14
17
|
readonly persistence: Persistence;
|
|
15
18
|
|
|
16
|
-
/** Empties every table: call it before each test. */
|
|
19
|
+
/** Empties every table{{#if audit.on}} but the audit trail, which is append-only whoever asks{{/if}}: call it before each test. */
|
|
17
20
|
reset(): Promise<void>;
|
|
18
21
|
|
|
19
22
|
close(): Promise<void>;
|
|
@@ -75,6 +78,14 @@ async function createTables(url: string): Promise<void> {
|
|
|
75
78
|
|
|
76
79
|
await connection.connect();
|
|
77
80
|
await connection.query(await readFile('generated/schema.sql', 'utf8'));
|
|
81
|
+
{{#if audit.on}}
|
|
82
|
+
|
|
83
|
+
// The guard a migration of the project holds: the trail refuses to be rewritten in the tests as in production.
|
|
84
|
+
for (const statement of auditGuardStatements('audit')) {
|
|
85
|
+
await connection.query(statement);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
{{/if}}
|
|
78
89
|
await connection.end();
|
|
79
90
|
}
|
|
80
91
|
|
|
@@ -86,7 +97,7 @@ interface TableName {
|
|
|
86
97
|
async function emptyTables(client: PrismaClient): Promise<void> {
|
|
87
98
|
const tables = await client.$queryRaw<TableName[]>`
|
|
88
99
|
select table_schema, table_name from information_schema.tables
|
|
89
|
-
where table_type = 'BASE TABLE' and table_schema not in ('pg_catalog', 'information_schema') and table_name <> '_prisma_migrations'`;
|
|
100
|
+
where table_type = 'BASE TABLE' and table_schema not in ('pg_catalog', 'information_schema'{{#if audit.on}}, 'audit'{{/if}}) and table_name <> '_prisma_migrations'`;
|
|
90
101
|
|
|
91
102
|
if (tables.length === 0) {
|
|
92
103
|
return;
|
|
@@ -3,15 +3,21 @@ import { openAsBlob } from 'node:fs';
|
|
|
3
3
|
{{/if}}
|
|
4
4
|
import { PGlite } from '@electric-sql/pglite';
|
|
5
5
|
import { PGLiteSocketServer } from '@electric-sql/pglite-socket';
|
|
6
|
+
{{#if audit.on}}
|
|
7
|
+
import { auditGuardStatements } from '@ddd-ts-kit/audit/typeorm';
|
|
8
|
+
{{/if}}
|
|
6
9
|
import type { DataSource } from 'typeorm';
|
|
7
10
|
import { createDataSource } from '{{alias.platform}}/database/create-data-source{{alias.ext}}';
|
|
8
11
|
import { persistenceOver } from '{{alias.platform}}/database/persistence-over{{alias.ext}}';
|
|
9
12
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
13
|
+
{{#if audit.on}}
|
|
14
|
+
import { AUDIT_SCHEMA } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
15
|
+
{{/if}}
|
|
10
16
|
|
|
11
17
|
export interface TestDatabase {
|
|
12
18
|
readonly persistence: Persistence;
|
|
13
19
|
|
|
14
|
-
/** Empties every table: call it before each test. */
|
|
20
|
+
/** Empties every table{{#if audit.on}} but the audit trail, which is append-only whoever asks{{/if}}: call it before each test. */
|
|
15
21
|
reset(): Promise<void>;
|
|
16
22
|
|
|
17
23
|
close(): Promise<void>;
|
|
@@ -83,12 +89,26 @@ async function createTables(dataSource: DataSource): Promise<void> {
|
|
|
83
89
|
}
|
|
84
90
|
|
|
85
91
|
await dataSource.synchronize();
|
|
92
|
+
{{#if audit.on}}
|
|
93
|
+
|
|
94
|
+
// The guard a migration of the project holds: the trail refuses to be rewritten in the tests as in production.
|
|
95
|
+
for (const statement of auditGuardStatements(AUDIT_SCHEMA)) {
|
|
96
|
+
await dataSource.query(statement);
|
|
97
|
+
}
|
|
98
|
+
{{/if}}
|
|
86
99
|
}
|
|
87
100
|
|
|
88
101
|
async function emptyTables(dataSource: DataSource): Promise<void> {
|
|
102
|
+
{{#if audit.on}}
|
|
103
|
+
const names = dataSource.entityMetadatas
|
|
104
|
+
.filter((table) => table.schema !== AUDIT_SCHEMA)
|
|
105
|
+
.map((table) => (table.schema === undefined ? '' : '"' + table.schema + '".') + '"' + table.tableName + '"');
|
|
106
|
+
{{/if}}
|
|
107
|
+
{{#unless audit.on}}
|
|
89
108
|
const names = dataSource.entityMetadatas.map(
|
|
90
109
|
(table) => (table.schema === undefined ? '' : '"' + table.schema + '".') + '"' + table.tableName + '"',
|
|
91
110
|
);
|
|
111
|
+
{{/unless}}
|
|
92
112
|
|
|
93
113
|
await dataSource.query('truncate table ' + names.join(', ') + ' restart identity');
|
|
94
114
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
{{#if queue.processTable}}
|
|
2
2
|
import {
|
|
3
|
+
{{#if eventSourcing.on}}
|
|
4
|
+
createDrizzleEventSourcing,
|
|
5
|
+
{{/if}}
|
|
3
6
|
createDrizzleUnitOfWork,
|
|
4
7
|
{{#if queue.database}}
|
|
5
8
|
DrizzleJobStore,
|
|
@@ -10,11 +13,21 @@ import {
|
|
|
10
13
|
} from '@ddd-ts-kit/drizzle/postgres';
|
|
11
14
|
{{/if}}
|
|
12
15
|
{{#unless queue.processTable}}
|
|
16
|
+
{{#if eventSourcing.on}}
|
|
17
|
+
import {
|
|
18
|
+
createDrizzleEventSourcing,
|
|
19
|
+
createDrizzleUnitOfWork,
|
|
20
|
+
DrizzleOutboxStore,
|
|
21
|
+
DrizzleProcessedEventStore,
|
|
22
|
+
} from '@ddd-ts-kit/drizzle/postgres';
|
|
23
|
+
{{/if}}
|
|
24
|
+
{{#unless eventSourcing.on}}
|
|
13
25
|
import { createDrizzleUnitOfWork, DrizzleOutboxStore, DrizzleProcessedEventStore } from '@ddd-ts-kit/drizzle/postgres';
|
|
14
26
|
{{/unless}}
|
|
27
|
+
{{/unless}}
|
|
15
28
|
import type { DatabaseConnection } from '{{alias.platform}}/database/connect-to-database{{alias.ext}}';
|
|
16
29
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
17
|
-
import { {{#if queue.database}}jobs, {{/if}}outbox, processedEvents{{#if queue.processTable}}, processes{{/if}} } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
30
|
+
import { {{#if eventSourcing.on}}EVENT_STORE_SCHEMA, {{/if}}{{#if queue.database}}jobs, {{/if}}outbox, processedEvents{{#if queue.processTable}}, processes{{/if}} } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
18
31
|
|
|
19
32
|
/** One object is the unit of work and what repositories query through; the stores write in its transaction. */
|
|
20
33
|
export function persistenceOver(connection: DatabaseConnection): Persistence {
|
|
@@ -31,6 +44,9 @@ export function persistenceOver(connection: DatabaseConnection): Persistence {
|
|
|
31
44
|
{{#if queue.processTable}}
|
|
32
45
|
processes: new DrizzleProcessStore(unitOfWork, processes),
|
|
33
46
|
{{/if}}
|
|
47
|
+
{{#if eventSourcing.on}}
|
|
48
|
+
eventSourcing: createDrizzleEventSourcing(unitOfWork, { schema: EVENT_STORE_SCHEMA }),
|
|
49
|
+
{{/if}}
|
|
34
50
|
close: () => connection.close(),
|
|
35
51
|
};
|
|
36
52
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
{{#if queue.database}}
|
|
2
2
|
import {
|
|
3
|
+
{{#if eventSourcing.on}}
|
|
4
|
+
createKnexEventSourcing,
|
|
5
|
+
{{/if}}
|
|
3
6
|
createKnexUnitOfWork,
|
|
4
7
|
KnexJobStore,
|
|
5
8
|
KnexOutboxStore,
|
|
@@ -8,11 +11,24 @@ import {
|
|
|
8
11
|
} from '@ddd-ts-kit/knex';
|
|
9
12
|
{{/if}}
|
|
10
13
|
{{#unless queue.database}}
|
|
14
|
+
{{#if eventSourcing.on}}
|
|
15
|
+
import {
|
|
16
|
+
createKnexEventSourcing,
|
|
17
|
+
createKnexUnitOfWork,
|
|
18
|
+
KnexOutboxStore,
|
|
19
|
+
KnexProcessedEventStore,
|
|
20
|
+
{{#if queue.processTable}}
|
|
21
|
+
KnexProcessStore,
|
|
22
|
+
{{/if}}
|
|
23
|
+
} from '@ddd-ts-kit/knex';
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{#unless eventSourcing.on}}
|
|
11
26
|
import { createKnexUnitOfWork, KnexOutboxStore, KnexProcessedEventStore{{#if queue.processTable}}, KnexProcessStore{{/if}} } from '@ddd-ts-kit/knex';
|
|
12
27
|
{{/unless}}
|
|
28
|
+
{{/unless}}
|
|
13
29
|
import type { DatabaseConnection } from '{{alias.platform}}/database/connect-to-database{{alias.ext}}';
|
|
14
30
|
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
15
|
-
import { MESSAGING_SCHEMA } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
31
|
+
import { {{#if eventSourcing.on}}EVENT_STORE_SCHEMA, {{/if}}MESSAGING_SCHEMA } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
16
32
|
|
|
17
33
|
/** One object is the unit of work and what repositories query through; the stores write in its transaction. */
|
|
18
34
|
export function persistenceOver(connection: DatabaseConnection): Persistence {
|
|
@@ -34,6 +50,9 @@ export function persistenceOver(connection: DatabaseConnection): Persistence {
|
|
|
34
50
|
{{#if queue.processTable}}
|
|
35
51
|
processes: new KnexProcessStore(unitOfWork, { schema: MESSAGING_SCHEMA }),
|
|
36
52
|
{{/if}}
|
|
53
|
+
{{#if eventSourcing.on}}
|
|
54
|
+
eventSourcing: createKnexEventSourcing(unitOfWork, { schema: EVENT_STORE_SCHEMA }),
|
|
55
|
+
{{/if}}
|
|
37
56
|
close: () => connection.close(),
|
|
38
57
|
};
|
|
39
58
|
}
|