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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@@imports
|
|
2
|
+
{{#if tenant.scoped}}
|
|
3
|
+
import { ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
|
+
{{/if}}
|
|
5
|
+
{{storage.moduleImport}}
|
|
6
|
+
import { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
|
|
7
|
+
import { {{personal.names.exportPort}} } from '{{alias.context}}/application/ports/{{personal.names.exportPortKebab}}.port{{alias.ext}}';
|
|
8
|
+
import { {{personal.names.adapter}} } from '{{alias.context}}/infrastructure/persistence/{{personal.names.adapterKebab}}.repository{{alias.ext}}';
|
|
9
|
+
import { {{personal.names.exportAdapter}} } from '{{alias.context}}/infrastructure/persistence/{{personal.names.exportAdapterKebab}}.repository{{alias.ext}}';
|
|
10
|
+
@@registrations
|
|
11
|
+
builder.bind({{personal.names.port}}).toClass({{personal.names.adapter}}, [{{storage.token}}{{#if tenant.scoped}}, ExecutionScope{{/if}}]).as('repository');
|
|
12
|
+
builder.bind({{personal.names.exportPort}}).toClass({{personal.names.exportAdapter}}, [{{storage.token}}{{#if tenant.scoped}}, ExecutionScope{{/if}}]).as('repository');
|
|
@@ -56,11 +56,27 @@ jobs:
|
|
|
56
56
|
steps:
|
|
57
57
|
- uses: actions/checkout@v7
|
|
58
58
|
- uses: ./.github/actions/setup
|
|
59
|
+
# The cache of ESLint (`ddd-ts-kit lint` keys it by the content of each file): a pull request restores the one the
|
|
60
|
+
# default branch wrote last for this lockfile and this config, and lints the files that changed since; the default
|
|
61
|
+
# branch and the night restore nothing, lint everything, which also sees a type changed in another file, and write it.
|
|
62
|
+
- name: The cache of ESLint, as the default branch wrote it last
|
|
63
|
+
if: ${{ github.event_name == 'pull_request' }}
|
|
64
|
+
uses: actions/cache/restore@v6
|
|
65
|
+
with:
|
|
66
|
+
path: .eslintcache/
|
|
67
|
+
key: eslint-${{ runner.os }}-${{ hashFiles('package-lock.json', 'eslint.config.mjs', 'ddd-ts-kit.config.json') }}-${{ github.sha }}
|
|
68
|
+
restore-keys: eslint-${{ runner.os }}-${{ hashFiles('package-lock.json', 'eslint.config.mjs', 'ddd-ts-kit.config.json') }}-
|
|
59
69
|
- run: npm run ci:format
|
|
60
70
|
- name: Lint (the contexts a pull request does not reach are left to the default branch)
|
|
61
71
|
env:
|
|
62
72
|
LINT: ${{ needs.install.outputs.lint }}
|
|
63
73
|
run: npm run ci:lint -- $LINT
|
|
74
|
+
- name: The cache of ESLint, for the pull requests that follow
|
|
75
|
+
if: ${{ github.event_name != 'pull_request' }}
|
|
76
|
+
uses: actions/cache/save@v6
|
|
77
|
+
with:
|
|
78
|
+
path: .eslintcache/
|
|
79
|
+
key: eslint-${{ runner.os }}-${{ hashFiles('package-lock.json', 'eslint.config.mjs', 'ddd-ts-kit.config.json') }}-${{ github.sha }}
|
|
64
80
|
|
|
65
81
|
architecture:
|
|
66
82
|
name: Architecture
|
|
@@ -201,6 +217,52 @@ jobs:
|
|
|
201
217
|
cache-from: type=gha
|
|
202
218
|
cache-to: type=gha,mode=max
|
|
203
219
|
|
|
220
|
+
mutation:
|
|
221
|
+
name: Mutation score of the domain
|
|
222
|
+
needs: install
|
|
223
|
+
# The night only: minutes per hundred files is too long for the loop of a pull request, and nothing of this run is read before a merge.
|
|
224
|
+
if: ${{ github.event_name == 'schedule' }}
|
|
225
|
+
runs-on: ubuntu-26.04
|
|
226
|
+
timeout-minutes: 60
|
|
227
|
+
steps:
|
|
228
|
+
- uses: actions/checkout@v7
|
|
229
|
+
- uses: ./.github/actions/setup
|
|
230
|
+
- name: Stryker on the domain and application layers of every context, each layer held to its "mutation" floor of ddd-ts-kit.config.json
|
|
231
|
+
run: npm run test:mutation
|
|
232
|
+
- uses: actions/upload-artifact@v7
|
|
233
|
+
if: ${{ !cancelled() }}
|
|
234
|
+
with:
|
|
235
|
+
name: mutation
|
|
236
|
+
path: reports/mutation
|
|
237
|
+
if-no-files-found: ignore
|
|
238
|
+
retention-days: 30
|
|
239
|
+
|
|
240
|
+
mutation-changed:
|
|
241
|
+
name: Mutation score of the change
|
|
242
|
+
needs: install
|
|
243
|
+
# A pull request: the report of the last night is reused for what the change leaves alone, and the survivors of the files it touched are listed. A reading, not a gate: the floor is held by the night.
|
|
244
|
+
if: ${{ github.event_name == 'pull_request' }}
|
|
245
|
+
runs-on: ubuntu-26.04
|
|
246
|
+
timeout-minutes: 30
|
|
247
|
+
steps:
|
|
248
|
+
- uses: actions/checkout@v7
|
|
249
|
+
with:
|
|
250
|
+
# The whole history: the files of the change are those since its merge base with the base branch.
|
|
251
|
+
fetch-depth: 0
|
|
252
|
+
- uses: ./.github/actions/setup
|
|
253
|
+
- name: The report of the last night, when there is one
|
|
254
|
+
env:
|
|
255
|
+
GH_TOKEN: ${{ github.token }}
|
|
256
|
+
run: |
|
|
257
|
+
run=$(gh run list --workflow "${{ github.workflow }}" --event schedule --branch "${{ github.event.repository.default_branch }}" --status success --limit 1 --json databaseId --jq '.[0].databaseId')
|
|
258
|
+
if [ -n "$run" ]; then gh run download "$run" --name mutation --dir reports/mutation || echo "The last night kept no report: a full run."; fi
|
|
259
|
+
- name: Stryker on what the change touches, then the survivors of its files
|
|
260
|
+
run: |
|
|
261
|
+
mkdir -p reports/mutation
|
|
262
|
+
base=$(git merge-base "origin/${{ github.base_ref }}" HEAD)
|
|
263
|
+
DDD_TS_KIT_MUTATION_SINCE="$base" npm run --silent test:mutation | tee reports/mutation/changed.txt
|
|
264
|
+
{ echo '```'; cat reports/mutation/changed.txt; echo '```'; } >> "$GITHUB_STEP_SUMMARY"
|
|
265
|
+
|
|
204
266
|
gate:
|
|
205
267
|
name: gate
|
|
206
268
|
if: ${{ always() }}
|
|
@@ -2,10 +2,17 @@ workflow:
|
|
|
2
2
|
auto_cancel:
|
|
3
3
|
on_new_commit: interruptible
|
|
4
4
|
rules:
|
|
5
|
+
# A merge request reads the cache of ESLint the default branch wrote; the default branch and the night write it.
|
|
5
6
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
7
|
+
variables:
|
|
8
|
+
LINT_CACHE_POLICY: pull
|
|
6
9
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
10
|
+
variables:
|
|
11
|
+
LINT_CACHE_POLICY: pull-push
|
|
7
12
|
# A pipeline schedule (Build > Pipeline schedules, every night on the default branch) runs everything.
|
|
8
13
|
- if: $CI_PIPELINE_SOURCE == "schedule"
|
|
14
|
+
variables:
|
|
15
|
+
LINT_CACHE_POLICY: pull-push
|
|
9
16
|
|
|
10
17
|
{{#if extras.gitlabInclude}}
|
|
11
18
|
{{#if extras.gitlabSecurity}}
|
|
@@ -136,6 +143,24 @@ lint:
|
|
|
136
143
|
extends: .node
|
|
137
144
|
stage: test
|
|
138
145
|
needs: [install]
|
|
146
|
+
cache:
|
|
147
|
+
- key:
|
|
148
|
+
files:
|
|
149
|
+
- package-lock.json
|
|
150
|
+
- package.json
|
|
151
|
+
paths:
|
|
152
|
+
- node_modules/
|
|
153
|
+
policy: pull
|
|
154
|
+
# The cache of ESLint (`ddd-ts-kit lint` keys it by the content of each file): a merge request reads the one the
|
|
155
|
+
# default branch wrote last for this lockfile and this config; the default branch and the night lint everything,
|
|
156
|
+
# which also sees a type changed in another file, and write it.
|
|
157
|
+
- key:
|
|
158
|
+
files:
|
|
159
|
+
- package-lock.json
|
|
160
|
+
- eslint.config.mjs
|
|
161
|
+
paths:
|
|
162
|
+
- .eslintcache/
|
|
163
|
+
policy: $LINT_CACHE_POLICY
|
|
139
164
|
variables:
|
|
140
165
|
ESLINT_CODE_QUALITY_REPORT: reports/gl-code-quality-eslint.json
|
|
141
166
|
script:
|
|
@@ -177,7 +202,7 @@ unit:
|
|
|
177
202
|
script:
|
|
178
203
|
- if [ "$AFFECTED_SCOPE" = "none" ]; then echo "Only documents changed, no spec to run."; exit 0; fi
|
|
179
204
|
- export DDD_TS_KIT_AFFECTED="$AFFECTED_CONTEXTS"
|
|
180
|
-
- npm run ci:test:unit -- --reporter=default --reporter=junit --outputFile.junit=reports/junit.xml $AFFECTED_ARGS
|
|
205
|
+
- npm run ci:test:unit -- --reporter=default --reporter=junit --reporter=@ddd-ts-kit/testing/budget/vitest --outputFile.junit=reports/junit.xml $AFFECTED_ARGS
|
|
181
206
|
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
|
|
182
207
|
artifacts:
|
|
183
208
|
when: always
|
|
@@ -196,7 +221,7 @@ integration:
|
|
|
196
221
|
- if [ "$AFFECTED_SCOPE" = "none" ]; then echo "Only documents changed, no spec to run."; exit 0; fi
|
|
197
222
|
- export DDD_TS_KIT_AFFECTED="$AFFECTED_CONTEXTS"
|
|
198
223
|
- npm run db:migrate
|
|
199
|
-
- npm run ci:test:integration -- --reporter=default --reporter=junit --outputFile.junit=reports/junit.xml $AFFECTED_ARGS
|
|
224
|
+
- npm run ci:test:integration -- --reporter=default --reporter=junit --reporter=@ddd-ts-kit/testing/budget/vitest --outputFile.junit=reports/junit.xml $AFFECTED_ARGS
|
|
200
225
|
|
|
201
226
|
e2e:
|
|
202
227
|
extends: [.node, .postgres, .junit]
|
|
@@ -208,6 +233,43 @@ e2e:
|
|
|
208
233
|
# The whole application, whatever the contexts a change reaches.
|
|
209
234
|
- npm run ci:test:e2e -- --reporter=default --reporter=junit --outputFile.junit=reports/junit.xml
|
|
210
235
|
|
|
236
|
+
mutation:
|
|
237
|
+
extends: .node
|
|
238
|
+
stage: test
|
|
239
|
+
needs: [install]
|
|
240
|
+
# The pipeline schedule only (Build > Pipeline schedules, every night on the default branch): too long for a merge request, read by nobody before a merge.
|
|
241
|
+
rules:
|
|
242
|
+
- if: $CI_PIPELINE_SOURCE == "schedule"
|
|
243
|
+
script:
|
|
244
|
+
# Stryker on the domain and application layers of every context, each layer held to its "mutation" floor of ddd-ts-kit.config.json.
|
|
245
|
+
- npm run test:mutation
|
|
246
|
+
artifacts:
|
|
247
|
+
when: always
|
|
248
|
+
expire_in: 30 days
|
|
249
|
+
paths:
|
|
250
|
+
- reports/mutation
|
|
251
|
+
|
|
252
|
+
mutation_changed:
|
|
253
|
+
extends: .node
|
|
254
|
+
stage: test
|
|
255
|
+
needs: [install]
|
|
256
|
+
# A merge request: the report of the last night is reused for what the change leaves alone, and the survivors of the files it touched are listed. A reading, not a gate: the floor is held by the night.
|
|
257
|
+
rules:
|
|
258
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
259
|
+
variables:
|
|
260
|
+
# The whole history: the files of the change are those since its merge base with the target branch.
|
|
261
|
+
GIT_DEPTH: 0
|
|
262
|
+
script:
|
|
263
|
+
- 'curl --silent --fail --location --output night.zip --header "JOB-TOKEN: $CI_JOB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_DEFAULT_BRANCH/download?job=mutation" && unzip -q -o night.zip && rm night.zip || echo "The last night kept no report: a full run."'
|
|
264
|
+
- git fetch --quiet origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
|
|
265
|
+
- base=$(git merge-base "origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" HEAD)
|
|
266
|
+
- DDD_TS_KIT_MUTATION_SINCE="$base" npm run test:mutation
|
|
267
|
+
artifacts:
|
|
268
|
+
when: always
|
|
269
|
+
expire_in: 7 days
|
|
270
|
+
paths:
|
|
271
|
+
- reports/mutation
|
|
272
|
+
|
|
211
273
|
build:
|
|
212
274
|
extends: .node
|
|
213
275
|
stage: test
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import base from './jest.config.js';
|
|
2
|
+
|
|
3
|
+
// The specs Stryker runs against each mutant of the domain or of the application: the unit specs, which need no database and answer in milliseconds; the integration specs would pay a database per mutant for nothing a unit spec does not already notice.
|
|
4
|
+
export default {
|
|
5
|
+
...base,
|
|
6
|
+
testMatch: ['<rootDir>/{{config.sourceRoot}}/**/*.spec.ts'],
|
|
7
|
+
testPathIgnorePatterns: [...base.testPathIgnorePatterns, '/{{config.contextsDir}}/[^/]+/test/integration/'],
|
|
8
|
+
};
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
{{/if}}
|
|
23
23
|
"vitest": {
|
|
24
|
-
"config": ["vitest.config.ts"{{knip.e2eConfig}}],
|
|
24
|
+
"config": ["vitest.config.ts"{{knip.e2eConfig}}{{knip.mutationConfig}}],
|
|
25
25
|
"entry": [
|
|
26
26
|
"{{config.sourceRoot}}/**/*.spec.ts",
|
|
27
27
|
"{{config.contextsDir}}/*/test/fakes/*.ts",
|
|
@@ -15,6 +15,12 @@ pre-commit:
|
|
|
15
15
|
- name: architecture
|
|
16
16
|
glob: 'src/**/*.{ts,mts,cts}'
|
|
17
17
|
run: npx --no -- ddd-ts-kit check {staged_files}
|
|
18
|
+
- name: behaviour pages
|
|
19
|
+
glob: '**/*.spec.ts'
|
|
20
|
+
# A spec in the commit changes what the tests state: the pages of docs/behaviour/, and nothing else, are
|
|
21
|
+
# regenerated and join the commit, so that docs --check has nothing to say. A worker confined to its context (.ddd-ts-kit/worker.json)
|
|
22
|
+
# leaves them to the trunk, as every shared file.
|
|
23
|
+
run: 'if [ -f .ddd-ts-kit/worker.json ]; then echo "behaviour pages: left to the trunk, as every shared file of a worker."; else npx --no -- ddd-ts-kit docs --behaviour && git add docs/behaviour; fi'
|
|
18
24
|
- name: commit size
|
|
19
25
|
run: npx --no -- ddd-ts-kit check --commit-size --staged
|
|
20
26
|
- name: secrets
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@biomejs/biome": "2.5.15",
|
|
24
24
|
"@commitlint/cli": "^21.2.3",
|
|
25
25
|
"@commitlint/config-conventional": "^21.2.3",
|
|
26
|
-
"@ddd-ts-kit/eslint-plugin": "^0.
|
|
26
|
+
"@ddd-ts-kit/eslint-plugin": "^0.90.0",
|
|
27
27
|
"@eslint/js": "^10.0.1",
|
|
28
28
|
"@typescript/native": "npm:typescript@~7.0.2",
|
|
29
29
|
"@vitest/coverage-v8": "5.0.3",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { governedMutation } from '@ddd-ts-kit/testing/mutation';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
{{#if tests.vitest}}
|
|
5
|
+
testRunner: 'vitest',
|
|
6
|
+
// The unit specs alone: a mutant of the domain or of the application is noticed by a spec of the domain or of the application, in milliseconds.
|
|
7
|
+
vitest: { configFile: 'vitest.mutation.config.ts' },
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if tests.jest}}
|
|
10
|
+
testRunner: 'jest',
|
|
11
|
+
// The specs are ES modules and run under the flag the "test" script passes to Jest: Stryker passes it to the processes it runs Jest in.
|
|
12
|
+
testRunnerNodeArgs: ['--experimental-vm-modules'],
|
|
13
|
+
// The unit specs alone: a mutant of the domain or of the application is noticed by a spec of the domain or of the application, in milliseconds; Jest runs the specs that import the mutated file.
|
|
14
|
+
jest: { projectType: 'custom', configFile: 'jest.mutation.config.js', enableFindRelatedTests: true },
|
|
15
|
+
{{/if}}
|
|
16
|
+
// The compiler is not asked to check each mutant: a mutant the types refuse is one the tests refuse too, for less.
|
|
17
|
+
checkers: [],
|
|
18
|
+
coverageAnalysis: 'perTest',
|
|
19
|
+
reporters: ['clear-text', 'progress', 'json', 'html'],
|
|
20
|
+
jsonReporter: { fileName: 'reports/mutation/mutation.json' },
|
|
21
|
+
htmlReporter: { fileName: 'reports/mutation/index.html' },
|
|
22
|
+
tempDirName: '.stryker-tmp',
|
|
23
|
+
// What is mutated, what is left out and the floor come from "mutation" in ddd-ts-kit.config.json, the reference when it is absent: the floor is written nowhere else.
|
|
24
|
+
...governedMutation(),
|
|
25
|
+
};
|
|
@@ -55,6 +55,8 @@ export default defineConfig(({ mode }) => ({
|
|
|
55
55
|
// The integration project has no spec before the first repository or adapter of the project: its run passes until then.
|
|
56
56
|
passWithNoTests: mode === INTEGRATION_MODE,
|
|
57
57
|
...WORKERS,
|
|
58
|
+
// Each spec file is held to the time budget of its level ("budget" in ddd-ts-kit.config.json, the reference when it is absent): the slowest named at the end of the run, a file over its budget fails it.
|
|
59
|
+
reporters: ['default', '@ddd-ts-kit/testing/budget/vitest'],
|
|
58
60
|
{{#if assembly.discovery}}
|
|
59
61
|
// Discovery imports the role files of a context itself: inlined, the package loads them through the runner, which compiles them.
|
|
60
62
|
server: { deps: { inline: ['@ddd-ts-kit/di'] } },
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{{#if decorators.standard}}
|
|
2
|
+
import { decorators } from '@ddd-ts-kit/testing/vitest';
|
|
3
|
+
{{/if}}
|
|
4
|
+
{{#if decorators.legacy}}
|
|
5
|
+
import { decoratorCoverage } from '@ddd-ts-kit/testing/vitest';
|
|
6
|
+
{{/if}}
|
|
7
|
+
import { defineConfig } from 'vitest/config';
|
|
8
|
+
|
|
9
|
+
// The specs Stryker runs against each mutant of the domain or of the application: the unit specs, which need no database and answer in milliseconds; the integration specs would pay a database per mutant for nothing a unit spec does not already notice.
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
{{#if decorators.standard}}
|
|
12
|
+
// Vitest does not lower standard (TC39) decorators, which every class of a declared context carries: the compiler the project builds with does.
|
|
13
|
+
plugins: [decorators({ compiler: '@typescript/native' })],
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{#if decorators.legacy}}
|
|
16
|
+
// Under `emitDecoratorMetadata` the transform guards every type a decorated class names with a branch no test can take: the statements that apply decorators are kept out of the measure.
|
|
17
|
+
plugins: [decoratorCoverage()],
|
|
18
|
+
{{/if}}
|
|
19
|
+
// An import alias is resolved from the "paths" of tsconfig.json, which name the sources.
|
|
20
|
+
resolve: { tsconfigPaths: true },
|
|
21
|
+
test: {
|
|
22
|
+
include: ['{{config.sourceRoot}}/**/*.spec.ts'],
|
|
23
|
+
exclude: ['{{config.contextsDir}}/*/test/integration/**'],
|
|
24
|
+
{{#if assembly.discovery}}
|
|
25
|
+
// Discovery imports the role files of a context itself: inlined, the package loads them through the runner, which compiles them.
|
|
26
|
+
server: { deps: { inline: ['@ddd-ts-kit/di'] } },
|
|
27
|
+
{{/if}}
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { personalFields, type PersonalFieldsOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { accounts } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
type AccountRow = typeof accounts.$inferSelect;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What an account keeps of the person it is, named by the subject the identity provider gives
|
|
8
|
+
* them: the address and the name read `[erased]` once that person is erased, and the account stays,
|
|
9
|
+
* deactivated or not, for the members and the delegations that name it.
|
|
10
|
+
*/
|
|
11
|
+
const declaration: PersonalFieldsOptions<AccountRow> = {
|
|
12
|
+
subject: 'id',
|
|
13
|
+
fields: ['email', 'displayName'],
|
|
14
|
+
erasure: 'pseudonymise',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const AccountPersonalFields = personalFields(accounts, declaration);
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { AccountRow } from '{{alias.context}}/infrastructure/persistence/account-row.schema{{alias.ext}}';
|
|
4
|
+
|
|
5
|
+
/** The table as the erasure reaches it: its statements are written on the table. */
|
|
6
|
+
const TABLE = { schema: {{context.constant}}_SCHEMA, table: 'accounts' };
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* What an account keeps of the person it is, named by the subject the identity provider gives
|
|
10
|
+
* them: the address and the name read `[erased]` once that person is erased, and the account stays,
|
|
11
|
+
* deactivated or not, for the members and the delegations that name it.
|
|
12
|
+
*/
|
|
13
|
+
const declaration: PersonalFieldsOptions<AccountRow> = {
|
|
14
|
+
subject: 'id',
|
|
15
|
+
fields: ['email', 'display_name'],
|
|
16
|
+
erasure: 'pseudonymise',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const AccountPersonalFields = personalFields(TABLE, declaration);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { personalFields, type PersonalFieldsOptions } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { invitations } from '{{alias.context}}/infrastructure/persistence/{{context.kebab}}.schema{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
type InvitationRow = typeof invitations.$inferSelect;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What an invitation keeps of the person invited, who has no account yet and is named by the
|
|
8
|
+
* invitation alone: the address it was sent to. The row leaves thirty days after the invitation
|
|
9
|
+
* expired, answered or not, by the nightly purge of the platform.
|
|
10
|
+
*/
|
|
11
|
+
const declaration: PersonalFieldsOptions<InvitationRow> = {
|
|
12
|
+
subject: 'id',
|
|
13
|
+
fields: ['email'],
|
|
14
|
+
erasure: 'row',
|
|
15
|
+
retention: { after: 'expiresAt', days: 30 },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const InvitationPersonalFields = personalFields(invitations, declaration);
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { InvitationRow } from '{{alias.context}}/infrastructure/persistence/invitation-row.schema{{alias.ext}}';
|
|
4
|
+
|
|
5
|
+
/** The table as the erasure reaches it: its statements are written on the table. */
|
|
6
|
+
const TABLE = { schema: {{context.constant}}_SCHEMA, table: 'invitations' };
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* What an invitation keeps of the person invited, who has no account yet and is named by the
|
|
10
|
+
* invitation alone: the address it was sent to. The row leaves thirty days after the invitation
|
|
11
|
+
* expired, answered or not, by the nightly purge of the platform.
|
|
12
|
+
*/
|
|
13
|
+
const declaration: PersonalFieldsOptions<InvitationRow> = {
|
|
14
|
+
subject: 'id',
|
|
15
|
+
fields: ['email'],
|
|
16
|
+
erasure: 'row',
|
|
17
|
+
retention: { after: 'expires_at', days: 30 },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const InvitationPersonalFields = personalFields(TABLE, declaration);
|
|
@@ -11,9 +11,11 @@ describe('When an account is deactivated, the identity provider follows', () =>
|
|
|
11
11
|
it('disables the person once, asked again after a failure until it answers: a deactivation is never lost', async () => {
|
|
12
12
|
const { application, identityProvider } = await startedIdentity();
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const outage = new Error('provider unreachable');
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
identityProvider.failWith(outage);
|
|
17
|
+
|
|
18
|
+
await expect(application.eventBus.publish([deactivation])).rejects.toBe(outage);
|
|
17
19
|
|
|
18
20
|
identityProvider.answerAgain();
|
|
19
21
|
await application.eventBus.publish([deactivation]);
|
|
@@ -35,11 +35,13 @@ describe('Deactivate account', () => {
|
|
|
35
35
|
|
|
36
36
|
await accounts.save(anAccount().identifiedBy('subject-grace').build());
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
await Promise.all(
|
|
39
|
+
['acme', 'globex'].flatMap((slug) => [
|
|
40
|
+
organisations.save(anOrganisation().identifiedBy(slug).build()),
|
|
41
|
+
members.save(aMember().of(slug, 'subject-ada').as(MemberRole.Owner).build()),
|
|
42
|
+
members.save(aMember().of(slug, 'subject-grace').as(MemberRole.Admin).build()),
|
|
43
|
+
]),
|
|
44
|
+
);
|
|
43
45
|
|
|
44
46
|
await delegations.save(
|
|
45
47
|
aDelegation()
|
|
@@ -32,10 +32,14 @@ describe('EnvironmentIdentityProviderConnection', () => {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it('names the variable that is missing, never a value', async () => {
|
|
35
|
-
|
|
36
|
-
Reflect.deleteProperty(process.env, name);
|
|
37
|
-
}
|
|
35
|
+
withoutTheVariables();
|
|
38
36
|
|
|
39
37
|
await expect(new EnvironmentIdentityProviderConnection().settings()).rejects.toThrow('KEYCLOAK_URL is not set');
|
|
40
38
|
});
|
|
41
39
|
});
|
|
40
|
+
|
|
41
|
+
function withoutTheVariables(): void {
|
|
42
|
+
for (const name of VARIABLES) {
|
|
43
|
+
Reflect.deleteProperty(process.env, name);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -85,13 +85,13 @@ describe('Invite member', () => {
|
|
|
85
85
|
|
|
86
86
|
await members.save(aMember().of('acme', 'subject-alan').as(MemberRole.Member).build());
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
)
|
|
94
|
-
}
|
|
88
|
+
await expect(
|
|
89
|
+
application.commandBus.execute(new InviteMemberCommand(as('subject-alan'), 'acme', grace)),
|
|
90
|
+
).rejects.toMatchObject({ code: 'FORBIDDEN' });
|
|
91
|
+
|
|
92
|
+
await expect(
|
|
93
|
+
application.commandBus.execute(new InviteMemberCommand(as('subject-mallory'), 'acme', grace)),
|
|
94
|
+
).rejects.toMatchObject({ code: 'FORBIDDEN' });
|
|
95
95
|
|
|
96
96
|
expect(invitations.all()).toEqual([]);
|
|
97
97
|
});
|
package/templates/presets/identity/context/test/unit/member-joined.integration-handler.spec.ts.tpl
CHANGED
|
@@ -15,9 +15,11 @@ describe('When a member joins, the identity provider follows', () => {
|
|
|
15
15
|
|
|
16
16
|
await members.save(aMember().of('acme', 'subject-grace').build());
|
|
17
17
|
await application.start();
|
|
18
|
-
|
|
18
|
+
const outage = new Error('provider unreachable');
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
identityProvider.failWith(outage);
|
|
21
|
+
|
|
22
|
+
await expect(application.eventBus.publish([joining])).rejects.toBe(outage);
|
|
21
23
|
|
|
22
24
|
identityProvider.answerAgain();
|
|
23
25
|
await application.eventBus.publish([joining]);
|
package/templates/presets/identity/context/test/unit/member-removed.integration-handler.spec.ts.tpl
CHANGED
|
@@ -21,11 +21,13 @@ describe('When a member is removed, the identity provider follows', () => {
|
|
|
21
21
|
it('is asked again after a failure, until the provider is in line: the revocation is never lost', async () => {
|
|
22
22
|
const { application, identityProvider } = await startedIdentity();
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const outage = new Error('provider unreachable');
|
|
25
|
+
|
|
26
|
+
identityProvider.failWith(outage);
|
|
25
27
|
|
|
26
28
|
// The failure goes back to who delivered the fact (the outbox relay, the broker), which delivers it again later.
|
|
27
|
-
await expect(application.eventBus.publish([removal])).rejects.
|
|
28
|
-
await expect(application.eventBus.publish([removal])).rejects.
|
|
29
|
+
await expect(application.eventBus.publish([removal])).rejects.toBe(outage);
|
|
30
|
+
await expect(application.eventBus.publish([removal])).rejects.toBe(outage);
|
|
29
31
|
|
|
30
32
|
identityProvider.answerAgain();
|
|
31
33
|
await application.eventBus.publish([removal]);
|
|
@@ -11,9 +11,11 @@ describe('When an organisation is opened, the identity provider follows', () =>
|
|
|
11
11
|
it('learns the organisation under its slug once, asked again after a failure until it answers', async () => {
|
|
12
12
|
const { application, identityProvider } = await startedIdentity();
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const outage = new Error('provider unreachable');
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
identityProvider.failWith(outage);
|
|
17
|
+
|
|
18
|
+
await expect(application.eventBus.publish([opening])).rejects.toBe(outage);
|
|
17
19
|
|
|
18
20
|
identityProvider.answerAgain();
|
|
19
21
|
await application.eventBus.publish([opening]);
|
|
@@ -24,11 +24,13 @@ describe('Revoke invitation', () => {
|
|
|
24
24
|
await members.save(aMember().of('acme', 'subject-ada').as(MemberRole.Admin).build());
|
|
25
25
|
await invitations.save(anInvitation().identifiedBy('invitation-1').to('globex').build());
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
await expect(
|
|
28
|
+
application.commandBus.execute(new RevokeInvitationCommand(as('subject-ada'), 'acme', 'invitation-1')),
|
|
29
|
+
).rejects.toMatchObject({ code: 'INVITATION_NOT_FOUND' });
|
|
30
|
+
|
|
31
|
+
await expect(
|
|
32
|
+
application.commandBus.execute(new RevokeInvitationCommand(as('subject-ada'), 'acme', 'invitation-9')),
|
|
33
|
+
).rejects.toMatchObject({ code: 'INVITATION_NOT_FOUND' });
|
|
32
34
|
});
|
|
33
35
|
|
|
34
36
|
it('is refused to a member whose role does not invite', async () => {
|
|
@@ -29,9 +29,7 @@ describe('{{name.title}}', () => {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
it('ends at its deadline', () => {
|
|
32
|
-
givenProcess(waiting)
|
|
33
|
-
.when((current) => (current === undefined ? undefined : process.timedOut('deadline', current)))
|
|
34
|
-
.thenEnded();
|
|
32
|
+
givenProcess(waiting).when(timedOut('deadline')).thenEnded();
|
|
35
33
|
});
|
|
36
34
|
|
|
37
35
|
it('recognises the state it saved', () => {
|
|
@@ -42,3 +40,8 @@ describe('{{name.title}}', () => {
|
|
|
42
40
|
// TODO(domain): one case per step, and the commands a missed deadline sends.
|
|
43
41
|
it.todo('sends the command that answers a missed deadline');
|
|
44
42
|
});
|
|
43
|
+
|
|
44
|
+
function timedOut(timeout: string) {
|
|
45
|
+
return (current: typeof waiting | undefined) =>
|
|
46
|
+
current === undefined ? undefined : process.timedOut(timeout, current);
|
|
47
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from '{{tests.module}}';
|
|
2
|
+
import { InMemoryProcessStore, type BackgroundJob } from '@ddd-ts-kit/kernel';
|
|
3
|
+
import { InMemoryJobStore, QueueWorker, StoredJobQueue, StoredProcessRunner } from '@ddd-ts-kit/scheduling';
|
|
4
|
+
import { createTestBuses } from '@ddd-ts-kit/testing';
|
|
5
|
+
import { {{name.pascal}}TimeoutBackgroundJob } from '{{alias.context}}/application/background/{{name.kebab}}-timeout.background-job{{alias.ext}}';
|
|
6
|
+
import { {{name.pascal}}Process } from '{{alias.context}}/application/processes/{{name.kebab}}.process{{alias.ext}}';
|
|
7
|
+
|
|
8
|
+
const HOUR = 3_600_000;
|
|
9
|
+
|
|
10
|
+
describe('The timeout of {{name.words}}, when its job runs', () => {
|
|
11
|
+
it('runs the step of the deadline once it is due, and not before', async () => {
|
|
12
|
+
const { clock, processes, runner, worker } = arrange();
|
|
13
|
+
const deadline = new Date(clock.now().getTime() + HOUR);
|
|
14
|
+
const process = new {{name.pascal}}Process();
|
|
15
|
+
const id = '{{name.kebab}}-1';
|
|
16
|
+
|
|
17
|
+
await runner.run({{name.pascal}}Process, id, (current) => process.started(id, deadline, current));
|
|
18
|
+
|
|
19
|
+
expect(await worker.runDue()).toEqual([]);
|
|
20
|
+
|
|
21
|
+
clock.advance(HOUR);
|
|
22
|
+
|
|
23
|
+
expect(await worker.runDue()).toMatchObject([{ job: '{{process.timeoutJob}}', outcome: 'succeeded' }]);
|
|
24
|
+
|
|
25
|
+
expect(processes.list()).toMatchObject([{ ended: true }]);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/** The runner, the queue of its timeouts and the worker in memory, on the clock, the buses and the unit of work of the test buses. */
|
|
30
|
+
function arrange() {
|
|
31
|
+
const { commandBus, clock, ids, executionScope, unitOfWork } = createTestBuses();
|
|
32
|
+
const store = new InMemoryJobStore();
|
|
33
|
+
const processes = new InMemoryProcessStore();
|
|
34
|
+
const jobQueue = new StoredJobQueue({ store, clock, ids, scope: executionScope });
|
|
35
|
+
const runner = new StoredProcessRunner({ store: processes, jobs: jobQueue, commands: commandBus, unitOfWork });
|
|
36
|
+
const worker = new QueueWorker({ store, clock, scope: executionScope });
|
|
37
|
+
const job: BackgroundJob<unknown> = new {{name.pascal}}TimeoutBackgroundJob(runner);
|
|
38
|
+
|
|
39
|
+
worker.register({ name: {{name.pascal}}TimeoutBackgroundJob.jobName, run: (due, execution) => job.run(due, execution) });
|
|
40
|
+
|
|
41
|
+
return { clock, processes, runner, worker };
|
|
42
|
+
}
|
|
@@ -23,6 +23,16 @@ export const {{aggregate.pascal}}Mapper = {
|
|
|
23
23
|
|
|
24
24
|
toRow(saved: {{aggregate.pascal}}): {{aggregate.pascal}}Columns {
|
|
25
25
|
// TODO(domain): flatten each value object of {{aggregate.pascal}}State into its columns; nothing of the row type leaves this file.
|
|
26
|
+
{{#if personal.any}}
|
|
27
|
+
return {
|
|
28
|
+
id: saved.id,
|
|
29
|
+
...saved.toState(),
|
|
30
|
+
// What the table keeps of the person, as its personal fields declare it: written here once the aggregate carries it, empty until then.
|
|
31
|
+
{{personal.nullColumns}}
|
|
32
|
+
};
|
|
33
|
+
{{/if}}
|
|
34
|
+
{{#unless personal.any}}
|
|
26
35
|
return { id: saved.id, ...saved.toState() };
|
|
36
|
+
{{/unless}}
|
|
27
37
|
},
|
|
28
38
|
};
|