ddd-ts-kit 0.101.0 → 0.103.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 +320 -0
- package/README.fr.md +11 -12
- package/README.md +10 -11
- package/dist/acceptance/check-locked-files.d.ts.map +1 -1
- package/dist/acceptance/check-locked-files.js +6 -3
- package/dist/acceptance/check-locked-files.js.map +1 -1
- package/dist/build/emitted-place.d.ts +1 -2
- package/dist/build/emitted-place.d.ts.map +1 -1
- package/dist/build/emitted-specifier.d.ts +7 -1
- package/dist/build/emitted-specifier.d.ts.map +1 -1
- package/dist/build/emitted-specifier.js +5 -6
- package/dist/build/emitted-specifier.js.map +1 -1
- package/dist/build/emitted-target.d.ts +6 -5
- package/dist/build/emitted-target.d.ts.map +1 -1
- package/dist/build/emitted-target.js +5 -9
- package/dist/build/emitted-target.js.map +1 -1
- package/dist/build/rewrite-aliases.d.ts.map +1 -1
- package/dist/build/rewrite-aliases.js +7 -5
- package/dist/build/rewrite-aliases.js.map +1 -1
- package/dist/build/rewrite-specifiers.d.ts +7 -6
- package/dist/build/rewrite-specifiers.d.ts.map +1 -1
- package/dist/build/rewrite-specifiers.js +6 -4
- package/dist/build/rewrite-specifiers.js.map +1 -1
- package/dist/build/unresolved-problem.d.ts +2 -1
- package/dist/build/unresolved-problem.d.ts.map +1 -1
- package/dist/build/unresolved-problem.js +2 -2
- package/dist/build/unresolved-problem.js.map +1 -1
- package/dist/check/baseline/write-baseline.d.ts.map +1 -1
- package/dist/check/baseline/write-baseline.js +2 -3
- package/dist/check/baseline/write-baseline.js.map +1 -1
- package/dist/check/business-names/parameter-lists.js +1 -3
- package/dist/check/business-names/parameter-lists.js.map +1 -1
- package/dist/check/engine/run-check.d.ts +3 -0
- package/dist/check/engine/run-check.d.ts.map +1 -1
- package/dist/check/engine/run-check.js +1 -1
- package/dist/check/engine/run-check.js.map +1 -1
- package/dist/check/errors/kit-error-codes.d.ts.map +1 -1
- package/dist/check/errors/kit-error-codes.js +1 -0
- package/dist/check/errors/kit-error-codes.js.map +1 -1
- package/dist/check/explain/authz-docs.js +1 -1
- package/dist/check/explain/authz-docs.js.map +1 -1
- package/dist/check/explain/errors-docs.js +1 -1
- package/dist/check/explain/errors-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/fixtures/authz-policy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.js +13 -1
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
- package/dist/check/fixtures/conjunct-cases.d.ts +11 -0
- package/dist/check/fixtures/conjunct-cases.d.ts.map +1 -0
- package/dist/check/fixtures/conjunct-cases.js +19 -0
- package/dist/check/fixtures/conjunct-cases.js.map +1 -0
- package/dist/check/fixtures/run-fixture.d.ts +3 -2
- package/dist/check/fixtures/run-fixture.d.ts.map +1 -1
- package/dist/check/fixtures/run-fixture.js +3 -3
- package/dist/check/fixtures/run-fixture.js.map +1 -1
- package/dist/check/fixtures/run-self-check.js +1 -1
- package/dist/check/fixtures/run-self-check.js.map +1 -1
- package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.d.ts +3 -0
- package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.js +33 -0
- package/dist/check/fixtures/tenancy-conjunct-drizzle-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-fixtures.d.ts +4 -0
- package/dist/check/fixtures/tenancy-conjunct-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-fixtures.js +12 -0
- package/dist/check/fixtures/tenancy-conjunct-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.d.ts +3 -0
- package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.js +49 -0
- package/dist/check/fixtures/tenancy-conjunct-knex-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.d.ts +3 -0
- package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.js +32 -0
- package/dist/check/fixtures/tenancy-conjunct-prisma-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.d.ts +3 -0
- package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.js +34 -0
- package/dist/check/fixtures/tenancy-conjunct-typeorm-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-fixtures.js +2 -0
- package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
- package/dist/check/rules/authz-policy-asked.d.ts.map +1 -1
- package/dist/check/rules/authz-policy-asked.js +45 -6
- package/dist/check/rules/authz-policy-asked.js.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.js +1 -0
- package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
- package/dist/check/rules/schema-no-duplicate-shape.js +1 -3
- package/dist/check/rules/schema-no-duplicate-shape.js.map +1 -1
- package/dist/check/rules/tenancy-scoped-statement.js +2 -2
- package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
- package/dist/check/rules/test-spec-required.d.ts.map +1 -1
- package/dist/check/rules/test-spec-required.js +3 -1
- package/dist/check/rules/test-spec-required.js.map +1 -1
- package/dist/check/scan/named-outside-imports.d.ts +3 -0
- package/dist/check/scan/named-outside-imports.d.ts.map +1 -0
- package/dist/check/scan/named-outside-imports.js +8 -0
- package/dist/check/scan/named-outside-imports.js.map +1 -0
- package/dist/check/scan/star-exports-of.d.ts +3 -0
- package/dist/check/scan/star-exports-of.d.ts.map +1 -0
- package/dist/check/scan/star-exports-of.js +8 -0
- package/dist/check/scan/star-exports-of.js.map +1 -0
- package/dist/check/scan/string-at.d.ts +3 -0
- package/dist/check/scan/string-at.d.ts.map +1 -0
- package/dist/check/scan/string-at.js +5 -0
- package/dist/check/scan/string-at.js.map +1 -0
- package/dist/check/tenancy/arguments-of-call.d.ts +3 -0
- package/dist/check/tenancy/arguments-of-call.d.ts.map +1 -0
- package/dist/check/tenancy/arguments-of-call.js +11 -0
- package/dist/check/tenancy/arguments-of-call.js.map +1 -0
- package/dist/check/tenancy/bare-expression.d.ts +3 -0
- package/dist/check/tenancy/bare-expression.d.ts.map +1 -0
- package/dist/check/tenancy/bare-expression.js +9 -0
- package/dist/check/tenancy/bare-expression.js.map +1 -0
- package/dist/check/tenancy/bracket-depth.d.ts +3 -0
- package/dist/check/tenancy/bracket-depth.d.ts.map +1 -0
- package/dist/check/tenancy/bracket-depth.js +10 -0
- package/dist/check/tenancy/bracket-depth.js.map +1 -0
- package/dist/check/tenancy/chain-links.d.ts +17 -0
- package/dist/check/tenancy/chain-links.d.ts.map +1 -0
- package/dist/check/tenancy/chain-links.js +24 -0
- package/dist/check/tenancy/chain-links.js.map +1 -0
- package/dist/check/tenancy/choice-branches.d.ts +3 -0
- package/dist/check/tenancy/choice-branches.d.ts.map +1 -0
- package/dist/check/tenancy/choice-branches.js +39 -0
- package/dist/check/tenancy/choice-branches.js.map +1 -0
- package/dist/check/tenancy/declaration-before.d.ts +12 -0
- package/dist/check/tenancy/declaration-before.d.ts.map +1 -0
- package/dist/check/tenancy/declaration-before.js +11 -0
- package/dist/check/tenancy/declaration-before.js.map +1 -0
- package/dist/check/tenancy/declaration-of.d.ts +1 -5
- package/dist/check/tenancy/declaration-of.d.ts.map +1 -1
- package/dist/check/tenancy/declaration-of.js +3 -8
- package/dist/check/tenancy/declaration-of.js.map +1 -1
- package/dist/check/tenancy/drizzle-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/drizzle-unscoped.js +16 -3
- package/dist/check/tenancy/drizzle-unscoped.js.map +1 -1
- package/dist/check/tenancy/enclosed-by.d.ts +3 -0
- package/dist/check/tenancy/enclosed-by.d.ts.map +1 -0
- package/dist/check/tenancy/enclosed-by.js +6 -0
- package/dist/check/tenancy/enclosed-by.js.map +1 -0
- package/dist/check/tenancy/end-of-enclosing.d.ts +7 -0
- package/dist/check/tenancy/end-of-enclosing.d.ts.map +1 -0
- package/dist/check/tenancy/end-of-enclosing.js +18 -0
- package/dist/check/tenancy/end-of-enclosing.js.map +1 -0
- package/dist/check/tenancy/holds-condition.d.ts +14 -0
- package/dist/check/tenancy/holds-condition.d.ts.map +1 -0
- package/dist/check/tenancy/holds-condition.js +26 -0
- package/dist/check/tenancy/holds-condition.js.map +1 -0
- package/dist/check/tenancy/is-conjunct.d.ts +8 -0
- package/dist/check/tenancy/is-conjunct.d.ts.map +1 -0
- package/dist/check/tenancy/is-conjunct.js +17 -0
- package/dist/check/tenancy/is-conjunct.js.map +1 -0
- package/dist/check/tenancy/is-or-link.d.ts +4 -0
- package/dist/check/tenancy/is-or-link.d.ts.map +1 -0
- package/dist/check/tenancy/is-or-link.js +7 -0
- package/dist/check/tenancy/is-or-link.js.map +1 -0
- package/dist/check/tenancy/knex-links-outside-condition.d.ts +11 -0
- package/dist/check/tenancy/knex-links-outside-condition.d.ts.map +1 -0
- package/dist/check/tenancy/knex-links-outside-condition.js +108 -0
- package/dist/check/tenancy/knex-links-outside-condition.js.map +1 -0
- package/dist/check/tenancy/knex-unscoped.d.ts +3 -1
- package/dist/check/tenancy/knex-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/knex-unscoped.js +12 -2
- package/dist/check/tenancy/knex-unscoped.js.map +1 -1
- package/dist/check/tenancy/prisma-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/prisma-unscoped.js +15 -10
- package/dist/check/tenancy/prisma-unscoped.js.map +1 -1
- package/dist/check/tenancy/spreads-at-top.d.ts +9 -0
- package/dist/check/tenancy/spreads-at-top.d.ts.map +1 -0
- package/dist/check/tenancy/spreads-at-top.js +49 -0
- package/dist/check/tenancy/spreads-at-top.js.map +1 -0
- package/dist/check/tenancy/top-level-parts.d.ts +3 -0
- package/dist/check/tenancy/top-level-parts.d.ts.map +1 -0
- package/dist/check/tenancy/top-level-parts.js +13 -0
- package/dist/check/tenancy/top-level-parts.js.map +1 -0
- package/dist/check/tenancy/typeorm-unscoped.d.ts.map +1 -1
- package/dist/check/tenancy/typeorm-unscoped.js +30 -16
- package/dist/check/tenancy/typeorm-unscoped.js.map +1 -1
- package/dist/check/tenancy/unconfined-where.d.ts +11 -0
- package/dist/check/tenancy/unconfined-where.d.ts.map +1 -0
- package/dist/check/tenancy/unconfined-where.js +18 -0
- package/dist/check/tenancy/unconfined-where.js.map +1 -0
- package/dist/check/text/closing-bracket.d.ts +6 -0
- package/dist/check/text/closing-bracket.d.ts.map +1 -0
- package/dist/check/text/closing-bracket.js +24 -0
- package/dist/check/text/closing-bracket.js.map +1 -0
- package/dist/commands/depcruise-config.d.ts.map +1 -1
- package/dist/commands/depcruise-config.js +4 -0
- package/dist/commands/depcruise-config.js.map +1 -1
- package/dist/commands/drizzle-generate.d.ts +3 -2
- package/dist/commands/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +14 -6
- package/dist/commands/drizzle-generate.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +3 -2
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/knex-generate.d.ts +10 -0
- package/dist/commands/knex-generate.d.ts.map +1 -0
- package/dist/commands/knex-generate.js +74 -0
- package/dist/commands/knex-generate.js.map +1 -0
- package/dist/commands/lint.js +15 -0
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/move-to-module.d.ts.map +1 -1
- package/dist/commands/move-to-module.js +3 -0
- package/dist/commands/move-to-module.js.map +1 -1
- package/dist/commands/mutation.js +1 -1
- package/dist/commands/mutation.js.map +1 -1
- package/dist/commands/parse-migration-arguments.d.ts +11 -0
- package/dist/commands/parse-migration-arguments.d.ts.map +1 -0
- package/dist/commands/parse-migration-arguments.js +17 -0
- package/dist/commands/parse-migration-arguments.js.map +1 -0
- package/dist/commands/prisma-generate.d.ts.map +1 -1
- package/dist/commands/prisma-generate.js +5 -11
- package/dist/commands/prisma-generate.js.map +1 -1
- package/dist/commands/typeorm-generate.d.ts +2 -1
- package/dist/commands/typeorm-generate.d.ts.map +1 -1
- package/dist/commands/typeorm-generate.js +5 -2
- package/dist/commands/typeorm-generate.js.map +1 -1
- package/dist/config/read-config.d.ts.map +1 -1
- package/dist/config/read-config.js +20 -0
- package/dist/config/read-config.js.map +1 -1
- package/dist/declared/render-declarations.js +1 -3
- package/dist/declared/render-declarations.js.map +1 -1
- package/dist/describe/read-controllers.d.ts.map +1 -1
- package/dist/describe/read-controllers.js +18 -2
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/schema-class-of.js +8 -1
- package/dist/describe/schema-class-of.js.map +1 -1
- package/dist/digest/tree-at.d.ts.map +1 -1
- package/dist/digest/tree-at.js +2 -0
- package/dist/digest/tree-at.js.map +1 -1
- package/dist/docs/context-sections.js +3 -7
- package/dist/docs/context-sections.js.map +1 -1
- package/dist/docs/personal-event-lines.d.ts +7 -0
- package/dist/docs/personal-event-lines.d.ts.map +1 -0
- package/dist/docs/personal-event-lines.js +34 -0
- package/dist/docs/personal-event-lines.js.map +1 -0
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +2 -0
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/docs/write-personal-events.d.ts +11 -0
- package/dist/docs/write-personal-events.d.ts.map +1 -0
- package/dist/docs/write-personal-events.js +28 -0
- package/dist/docs/write-personal-events.js.map +1 -0
- package/dist/doctor/permission-findings.d.ts.map +1 -1
- package/dist/doctor/permission-findings.js +68 -4
- package/dist/doctor/permission-findings.js.map +1 -1
- package/dist/generate/concept-role.d.ts +10 -0
- package/dist/generate/concept-role.d.ts.map +1 -1
- package/dist/generate/concept.d.ts.map +1 -1
- package/dist/generate/concept.js +5 -1
- package/dist/generate/concept.js.map +1 -1
- package/dist/generate/emit.d.ts +5 -2
- package/dist/generate/emit.d.ts.map +1 -1
- package/dist/generate/emit.js +5 -4
- package/dist/generate/emit.js.map +1 -1
- package/dist/generate/event-names.d.ts.map +1 -1
- package/dist/generate/event-names.js.map +1 -1
- package/dist/generate/files-without-modules.d.ts +8 -0
- package/dist/generate/files-without-modules.d.ts.map +1 -0
- package/dist/generate/files-without-modules.js +12 -0
- package/dist/generate/files-without-modules.js.map +1 -0
- package/dist/generate/grant-permission.js +2 -2
- package/dist/generate/grant-permission.js.map +1 -1
- package/dist/generate/kinds/aggregate-kind.js +4 -4
- package/dist/generate/kinds/aggregate-kind.js.map +1 -1
- package/dist/generate/kinds/assert-event-store.d.ts +5 -1
- package/dist/generate/kinds/assert-event-store.d.ts.map +1 -1
- package/dist/generate/kinds/assert-event-store.js +11 -5
- package/dist/generate/kinds/assert-event-store.js.map +1 -1
- package/dist/generate/kinds/background/background-job-vars.js +4 -2
- package/dist/generate/kinds/background/background-job-vars.js.map +1 -1
- package/dist/generate/kinds/command-kind.d.ts.map +1 -1
- package/dist/generate/kinds/command-kind.js +6 -1
- package/dist/generate/kinds/command-kind.js.map +1 -1
- package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
- package/dist/generate/kinds/declare-storage.js +4 -10
- package/dist/generate/kinds/declare-storage.js.map +1 -1
- package/dist/generate/kinds/domain-event-kind.d.ts.map +1 -1
- package/dist/generate/kinds/domain-event-kind.js +3 -1
- package/dist/generate/kinds/domain-event-kind.js.map +1 -1
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +8 -1
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/kinds/ensure-domain-event.d.ts.map +1 -1
- package/dist/generate/kinds/ensure-domain-event.js +2 -0
- package/dist/generate/kinds/ensure-domain-event.js.map +1 -1
- package/dist/generate/kinds/extraction/add-compose-service.js +1 -1
- package/dist/generate/kinds/extraction/add-compose-service.js.map +1 -1
- package/dist/generate/kinds/extraction/compose-service-of.d.ts +5 -0
- package/dist/generate/kinds/extraction/compose-service-of.d.ts.map +1 -0
- package/dist/generate/kinds/extraction/compose-service-of.js +8 -0
- package/dist/generate/kinds/extraction/compose-service-of.js.map +1 -0
- package/dist/generate/kinds/gateway-kind.js +9 -0
- package/dist/generate/kinds/gateway-kind.js.map +1 -1
- package/dist/generate/kinds/generate-context.d.ts.map +1 -1
- package/dist/generate/kinds/generate-context.js +36 -0
- package/dist/generate/kinds/generate-context.js.map +1 -1
- package/dist/generate/kinds/generate-event-sourced-repository.js +8 -1
- package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -1
- package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
- package/dist/generate/kinds/generate-repository.js +13 -0
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/query-kind.d.ts.map +1 -1
- package/dist/generate/kinds/query-kind.js +24 -2
- package/dist/generate/kinds/query-kind.js.map +1 -1
- package/dist/generate/kinds/route/controller-vars.js +1 -1
- package/dist/generate/kinds/route/controller-vars.js.map +1 -1
- package/dist/generate/kinds/route/find-use-case.js +1 -1
- package/dist/generate/kinds/route/find-use-case.js.map +1 -1
- package/dist/generate/kinds/route/message-call.d.ts +6 -2
- package/dist/generate/kinds/route/message-call.d.ts.map +1 -1
- package/dist/generate/kinds/route/message-call.js +2 -1
- package/dist/generate/kinds/route/message-call.js.map +1 -1
- package/dist/generate/kinds/route/standard-schema-of.d.ts +2 -1
- package/dist/generate/kinds/route/standard-schema-of.d.ts.map +1 -1
- package/dist/generate/kinds/route/standard-schema-of.js +2 -4
- package/dist/generate/kinds/route/standard-schema-of.js.map +1 -1
- package/dist/generate/kinds/service-kind.d.ts.map +1 -1
- package/dist/generate/kinds/service-kind.js +4 -3
- package/dist/generate/kinds/service-kind.js.map +1 -1
- package/dist/generate/kinds/tables-files.d.ts +3 -0
- package/dist/generate/kinds/tables-files.d.ts.map +1 -0
- package/dist/generate/kinds/tables-files.js +7 -0
- package/dist/generate/kinds/tables-files.js.map +1 -0
- package/dist/generate/kinds/worker-kind.d.ts.map +1 -1
- package/dist/generate/kinds/worker-kind.js +12 -0
- package/dist/generate/kinds/worker-kind.js.map +1 -1
- package/dist/generate/kinds/write-birth.d.ts +8 -0
- package/dist/generate/kinds/write-birth.d.ts.map +1 -0
- package/dist/generate/kinds/write-birth.js +13 -0
- package/dist/generate/kinds/write-birth.js.map +1 -0
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js +8 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/mark-policy-questions.js +2 -2
- package/dist/generate/mark-policy-questions.js.map +1 -1
- package/dist/generate/permission-name.d.ts +3 -0
- package/dist/generate/permission-name.d.ts.map +1 -0
- package/dist/generate/permission-name.js +3 -0
- package/dist/generate/permission-name.js.map +1 -0
- package/dist/generate/permission-named.d.ts.map +1 -1
- package/dist/generate/permission-named.js +1 -1
- package/dist/generate/permission-named.js.map +1 -1
- package/dist/generate/permission-words.d.ts +7 -0
- package/dist/generate/permission-words.d.ts.map +1 -0
- package/dist/generate/permission-words.js +11 -0
- package/dist/generate/permission-words.js.map +1 -0
- package/dist/generate/refined-by-policy.js +2 -2
- package/dist/generate/refined-by-policy.js.map +1 -1
- package/dist/generate/refuse-stuttering-event.d.ts +8 -0
- package/dist/generate/refuse-stuttering-event.d.ts.map +1 -0
- package/dist/generate/refuse-stuttering-event.js +14 -0
- package/dist/generate/refuse-stuttering-event.js.map +1 -0
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +1 -0
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/generate/spoken-in-language.d.ts +11 -2
- package/dist/generate/spoken-in-language.d.ts.map +1 -1
- package/dist/generate/spoken-in-language.js +27 -12
- package/dist/generate/spoken-in-language.js.map +1 -1
- package/dist/generator-lock/unreadable-lock-refusal.d.ts +4 -0
- package/dist/generator-lock/unreadable-lock-refusal.d.ts.map +1 -0
- package/dist/generator-lock/unreadable-lock-refusal.js +7 -0
- package/dist/generator-lock/unreadable-lock-refusal.js.map +1 -0
- package/dist/generator-lock/with-generator-lock.d.ts.map +1 -1
- package/dist/generator-lock/with-generator-lock.js +8 -7
- package/dist/generator-lock/with-generator-lock.js.map +1 -1
- package/dist/help/flag-notes.d.ts.map +1 -1
- package/dist/help/flag-notes.js +5 -1
- package/dist/help/flag-notes.js.map +1 -1
- package/dist/help/tool-notes.d.ts.map +1 -1
- package/dist/help/tool-notes.js +16 -0
- package/dist/help/tool-notes.js.map +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +1 -0
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.d.ts.map +1 -1
- package/dist/init/agent-permissions.js +18 -3
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/files/audit-files.d.ts.map +1 -1
- package/dist/init/files/audit-files.js +1 -0
- package/dist/init/files/audit-files.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +2 -1
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/platform-files.d.ts.map +1 -1
- package/dist/init/files/platform-files.js +14 -0
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/files/privacy-files.d.ts +2 -2
- package/dist/init/files/privacy-files.d.ts.map +1 -1
- package/dist/init/files/privacy-files.js +3 -2
- package/dist/init/files/privacy-files.js.map +1 -1
- package/dist/init/files/script-files.d.ts +4 -1
- package/dist/init/files/script-files.d.ts.map +1 -1
- package/dist/init/files/script-files.js +6 -1
- package/dist/init/files/script-files.js.map +1 -1
- package/dist/init/is-team-file.d.ts +2 -2
- package/dist/init/is-team-file.d.ts.map +1 -1
- package/dist/init/is-team-file.js +5 -3
- package/dist/init/is-team-file.js.map +1 -1
- package/dist/init/keep-regions.d.ts +21 -0
- package/dist/init/keep-regions.d.ts.map +1 -0
- package/dist/init/keep-regions.js +63 -0
- package/dist/init/keep-regions.js.map +1 -0
- package/dist/init/kept-combination-notes.d.ts.map +1 -1
- package/dist/init/kept-combination-notes.js +6 -2
- package/dist/init/kept-combination-notes.js.map +1 -1
- package/dist/init/kept-compose-services.d.ts +6 -0
- package/dist/init/kept-compose-services.d.ts.map +1 -0
- package/dist/init/kept-compose-services.js +42 -0
- package/dist/init/kept-compose-services.js.map +1 -0
- package/dist/init/kept-role-vocabulary.d.ts +3 -0
- package/dist/init/kept-role-vocabulary.d.ts.map +1 -0
- package/dist/init/kept-role-vocabulary.js +7 -0
- package/dist/init/kept-role-vocabulary.js.map +1 -0
- package/dist/init/kept-roles.d.ts +12 -0
- package/dist/init/kept-roles.d.ts.map +1 -0
- package/dist/init/kept-roles.js +29 -0
- package/dist/init/kept-roles.js.map +1 -0
- package/dist/init/kept-wiring.d.ts +22 -0
- package/dist/init/kept-wiring.d.ts.map +1 -0
- package/dist/init/kept-wiring.js +91 -0
- package/dist/init/kept-wiring.js.map +1 -0
- package/dist/init/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +5 -1
- 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 +5 -3
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/scripts-for.d.ts.map +1 -1
- package/dist/init/manifest/scripts-for.js +8 -0
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/orphaned-wiring-notes.d.ts +13 -0
- package/dist/init/orphaned-wiring-notes.d.ts.map +1 -0
- package/dist/init/orphaned-wiring-notes.js +42 -0
- package/dist/init/orphaned-wiring-notes.js.map +1 -0
- package/dist/init/profile-hooks.js +1 -1
- package/dist/init/profile-hooks.js.map +1 -1
- package/dist/init/repositories-left-behind.d.ts +12 -0
- package/dist/init/repositories-left-behind.d.ts.map +1 -0
- package/dist/init/repositories-left-behind.js +26 -0
- package/dist/init/repositories-left-behind.js.map +1 -0
- package/dist/init/rewire-audited-events.d.ts +10 -0
- package/dist/init/rewire-audited-events.d.ts.map +1 -0
- package/dist/init/rewire-audited-events.js +32 -0
- package/dist/init/rewire-audited-events.js.map +1 -0
- package/dist/init/rewire-contexts.d.ts +15 -0
- package/dist/init/rewire-contexts.d.ts.map +1 -0
- package/dist/init/rewire-contexts.js +41 -0
- package/dist/init/rewire-contexts.js.map +1 -0
- package/dist/init/rewire-preset.d.ts +9 -0
- package/dist/init/rewire-preset.d.ts.map +1 -0
- package/dist/init/rewire-preset.js +29 -0
- package/dist/init/rewire-preset.js.map +1 -0
- package/dist/init/rewire-tables.d.ts +10 -0
- package/dist/init/rewire-tables.d.ts.map +1 -0
- package/dist/init/rewire-tables.js +54 -0
- package/dist/init/rewire-tables.js.map +1 -0
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +28 -28
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/kept-flag-notes.d.ts +7 -0
- package/dist/init/stack/kept-flag-notes.d.ts.map +1 -0
- package/dist/init/stack/kept-flag-notes.js +24 -0
- package/dist/init/stack/kept-flag-notes.js.map +1 -0
- package/dist/init/stack/refuse-unused-no-outbox.d.ts +4 -0
- package/dist/init/stack/refuse-unused-no-outbox.d.ts.map +1 -0
- package/dist/init/stack/refuse-unused-no-outbox.js +9 -0
- package/dist/init/stack/refuse-unused-no-outbox.js.map +1 -0
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +10 -0
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack-before.d.ts +4 -0
- package/dist/init/stack-before.d.ts.map +1 -0
- package/dist/init/stack-before.js +11 -0
- package/dist/init/stack-before.js.map +1 -0
- package/dist/init/wiring-notes.d.ts +9 -0
- package/dist/init/wiring-notes.d.ts.map +1 -0
- package/dist/init/wiring-notes.js +22 -0
- package/dist/init/wiring-notes.js.map +1 -0
- package/dist/init/with-named-imports.d.ts +8 -0
- package/dist/init/with-named-imports.d.ts.map +1 -0
- package/dist/init/with-named-imports.js +69 -0
- package/dist/init/with-named-imports.js.map +1 -0
- package/dist/init/with-system-grants.d.ts +7 -0
- package/dist/init/with-system-grants.d.ts.map +1 -0
- package/dist/init/with-system-grants.js +26 -0
- package/dist/init/with-system-grants.js.map +1 -0
- package/dist/init/write-local-environment.d.ts +8 -0
- package/dist/init/write-local-environment.d.ts.map +1 -0
- package/dist/init/write-local-environment.js +18 -0
- package/dist/init/write-local-environment.js.map +1 -0
- package/dist/lint/eslint-in-project.d.ts +1 -1
- package/dist/lint/eslint-in-project.d.ts.map +1 -1
- package/dist/lint/eslint-in-project.js +11 -2
- package/dist/lint/eslint-in-project.js.map +1 -1
- package/dist/markers/index.d.ts +3 -0
- package/dist/markers/index.d.ts.map +1 -1
- package/dist/markers/index.js +3 -0
- package/dist/markers/index.js.map +1 -1
- package/dist/markers/region-marker.d.ts +3 -0
- package/dist/markers/region-marker.d.ts.map +1 -0
- package/dist/markers/region-marker.js +3 -0
- package/dist/markers/region-marker.js.map +1 -0
- package/dist/markers/regions-of.d.ts +9 -0
- package/dist/markers/regions-of.d.ts.map +1 -0
- package/dist/markers/regions-of.js +20 -0
- package/dist/markers/regions-of.js.map +1 -0
- package/dist/markers/unpaired-markers.d.ts +3 -0
- package/dist/markers/unpaired-markers.d.ts.map +1 -0
- package/dist/markers/unpaired-markers.js +13 -0
- package/dist/markers/unpaired-markers.js.map +1 -0
- package/dist/measures/timeline-of.js +1 -0
- package/dist/measures/timeline-of.js.map +1 -1
- package/dist/merge/apply-resolutions.d.ts.map +1 -1
- package/dist/merge/apply-resolutions.js +6 -4
- package/dist/merge/apply-resolutions.js.map +1 -1
- package/dist/merge/continue-merge.d.ts.map +1 -1
- package/dist/merge/continue-merge.js +1 -0
- package/dist/merge/continue-merge.js.map +1 -1
- package/dist/merge/ensure-mergeable.js +1 -1
- package/dist/merge/ensure-mergeable.js.map +1 -1
- package/dist/merge/lost/verify-merges.d.ts.map +1 -1
- package/dist/merge/lost/verify-merges.js +4 -0
- package/dist/merge/lost/verify-merges.js.map +1 -1
- package/dist/merge/merge-state.d.ts.map +1 -1
- package/dist/merge/merge-state.js +2 -2
- package/dist/merge/merge-state.js.map +1 -1
- package/dist/merge/merge-trunk.d.ts.map +1 -1
- package/dist/merge/merge-trunk.js +4 -0
- package/dist/merge/merge-trunk.js.map +1 -1
- package/dist/merge/refuse-shallow-history.d.ts +10 -0
- package/dist/merge/refuse-shallow-history.d.ts.map +1 -0
- package/dist/merge/refuse-shallow-history.js +15 -0
- package/dist/merge/refuse-shallow-history.js.map +1 -0
- package/dist/merge/resume-merge.js +2 -2
- package/dist/merge/resume-merge.js.map +1 -1
- package/dist/merge/settle-regions.d.ts.map +1 -1
- package/dist/merge/settle-regions.js +3 -4
- package/dist/merge/settle-regions.js.map +1 -1
- package/dist/migration/audit-guard/append-audit-guard.d.ts +4 -2
- package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -1
- package/dist/migration/audit-guard/append-audit-guard.js +18 -3
- package/dist/migration/audit-guard/append-audit-guard.js.map +1 -1
- package/dist/migration/declared-tables.d.ts +8 -0
- package/dist/migration/declared-tables.d.ts.map +1 -0
- package/dist/migration/declared-tables.js +13 -0
- package/dist/migration/declared-tables.js.map +1 -0
- package/dist/migration/find-project-formatter.d.ts.map +1 -1
- package/dist/migration/find-project-formatter.js +2 -1
- package/dist/migration/find-project-formatter.js.map +1 -1
- package/dist/migration/index.d.ts +8 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +8 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/knex-migration-text.d.ts +4 -0
- package/dist/migration/knex-migration-text.d.ts.map +1 -0
- package/dist/migration/knex-migration-text.js +24 -0
- package/dist/migration/knex-migration-text.js.map +1 -0
- package/dist/migration/knex-schema-difference.d.ts +12 -0
- package/dist/migration/knex-schema-difference.d.ts.map +1 -0
- package/dist/migration/knex-schema-difference.js +165 -0
- package/dist/migration/knex-schema-difference.js.map +1 -0
- package/dist/migration/listed-in-index.d.ts +6 -0
- package/dist/migration/listed-in-index.d.ts.map +1 -0
- package/dist/migration/listed-in-index.js +8 -0
- package/dist/migration/listed-in-index.js.map +1 -0
- package/dist/migration/refuse-other-orm.d.ts +8 -0
- package/dist/migration/refuse-other-orm.d.ts.map +1 -0
- package/dist/migration/refuse-other-orm.js +34 -0
- package/dist/migration/refuse-other-orm.js.map +1 -0
- package/dist/migration/required-migration-name.d.ts +3 -0
- package/dist/migration/required-migration-name.d.ts.map +1 -0
- package/dist/migration/required-migration-name.js +11 -0
- package/dist/migration/required-migration-name.js.map +1 -0
- package/dist/migration/warn-dropped-context-tables.d.ts +12 -0
- package/dist/migration/warn-dropped-context-tables.d.ts.map +1 -0
- package/dist/migration/warn-dropped-context-tables.js +88 -0
- package/dist/migration/warn-dropped-context-tables.js.map +1 -0
- package/dist/package-manager/dialects.js +1 -1
- package/dist/package-manager/dialects.js.map +1 -1
- package/dist/package-manager/in-project-dialect.d.ts +8 -0
- package/dist/package-manager/in-project-dialect.d.ts.map +1 -0
- package/dist/package-manager/in-project-dialect.js +22 -0
- package/dist/package-manager/in-project-dialect.js.map +1 -0
- package/dist/presets/adapter-of.d.ts +5 -0
- package/dist/presets/adapter-of.d.ts.map +1 -0
- package/dist/presets/adapter-of.js +6 -0
- package/dist/presets/adapter-of.js.map +1 -0
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +1 -5
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/grant-to-signed-in.d.ts.map +1 -1
- package/dist/presets/grant-to-signed-in.js +1 -24
- package/dist/presets/grant-to-signed-in.js.map +1 -1
- package/dist/presets/identity-terms.d.ts.map +1 -1
- package/dist/presets/identity-terms.js +4 -0
- package/dist/presets/identity-terms.js.map +1 -1
- package/dist/presets/lay-out-prisma-models.js +1 -19
- package/dist/presets/lay-out-prisma-models.js.map +1 -1
- package/dist/presets/organisations-as-tenants.d.ts +2 -2
- package/dist/presets/organisations-as-tenants.d.ts.map +1 -1
- package/dist/presets/organisations-as-tenants.js +46 -2
- package/dist/presets/organisations-as-tenants.js.map +1 -1
- package/dist/presets/preset-named.d.ts +2 -0
- package/dist/presets/preset-named.d.ts.map +1 -1
- package/dist/presets/preset-named.js +1 -1
- package/dist/presets/preset-named.js.map +1 -1
- package/dist/presets/wrap-authorizer.d.ts +4 -0
- package/dist/presets/wrap-authorizer.d.ts.map +1 -0
- package/dist/presets/wrap-authorizer.js +25 -0
- package/dist/presets/wrap-authorizer.js.map +1 -0
- package/dist/prisma-schema/datasource-schemas.d.ts +3 -0
- package/dist/prisma-schema/datasource-schemas.d.ts.map +1 -0
- package/dist/prisma-schema/datasource-schemas.js +5 -0
- package/dist/prisma-schema/datasource-schemas.js.map +1 -0
- package/dist/prisma-schema/index.d.ts +4 -0
- package/dist/prisma-schema/index.d.ts.map +1 -1
- package/dist/prisma-schema/index.js +4 -0
- package/dist/prisma-schema/index.js.map +1 -1
- package/dist/prisma-schema/preview-features-of.d.ts +3 -0
- package/dist/prisma-schema/preview-features-of.d.ts.map +1 -0
- package/dist/prisma-schema/preview-features-of.js +7 -0
- package/dist/prisma-schema/preview-features-of.js.map +1 -0
- package/dist/prisma-schema/with-datasource-schema.d.ts +3 -0
- package/dist/prisma-schema/with-datasource-schema.d.ts.map +1 -0
- package/dist/prisma-schema/with-datasource-schema.js +9 -0
- package/dist/prisma-schema/with-datasource-schema.js.map +1 -0
- package/dist/prisma-schema/with-preview-feature.d.ts +3 -0
- package/dist/prisma-schema/with-preview-feature.d.ts.map +1 -0
- package/dist/prisma-schema/with-preview-feature.js +19 -0
- package/dist/prisma-schema/with-preview-feature.js.map +1 -0
- package/dist/progress/format-progress.js +1 -0
- package/dist/progress/format-progress.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +10 -1
- package/dist/run.js.map +1 -1
- package/dist/sdk/planned-clients.d.ts +2 -2
- package/dist/sdk/planned-clients.d.ts.map +1 -1
- package/dist/sdk/planned-clients.js +2 -6
- package/dist/sdk/planned-clients.js.map +1 -1
- package/dist/sdk/render-client.js +1 -1
- package/dist/sdk/render-client.js.map +1 -1
- package/dist/sdk/set-up-sdk.d.ts.map +1 -1
- package/dist/sdk/set-up-sdk.js +3 -2
- package/dist/sdk/set-up-sdk.js.map +1 -1
- package/dist/slice/record-verification.d.ts.map +1 -1
- package/dist/slice/record-verification.js +2 -5
- package/dist/slice/record-verification.js.map +1 -1
- package/dist/stack/stack-vars.js +16 -3
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/stories/forecast-merge.js +1 -0
- package/dist/stories/forecast-merge.js.map +1 -1
- package/dist/stories/open-story-scope.d.ts.map +1 -1
- package/dist/stories/open-story-scope.js +2 -4
- package/dist/stories/open-story-scope.js.map +1 -1
- package/dist/story/change-gated.d.ts +3 -3
- package/dist/story/change-gated.d.ts.map +1 -1
- package/dist/story/change-gated.js +13 -7
- package/dist/story/change-gated.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/format-resume.d.ts.map +1 -1
- package/dist/worker/format-resume.js +5 -0
- package/dist/worker/format-resume.js.map +1 -1
- package/dist/worker/format-workers.js +5 -0
- package/dist/worker/format-workers.js.map +1 -1
- package/dist/worker/open-worker-scope.d.ts.map +1 -1
- package/dist/worker/open-worker-scope.js +2 -3
- package/dist/worker/open-worker-scope.js.map +1 -1
- package/dist/worker/progress-of.d.ts +8 -3
- package/dist/worker/progress-of.d.ts.map +1 -1
- package/dist/worker/progress-of.js +2 -16
- package/dist/worker/progress-of.js.map +1 -1
- package/dist/worker/read-agent-record.d.ts.map +1 -1
- package/dist/worker/read-agent-record.js +15 -3
- package/dist/worker/read-agent-record.js.map +1 -1
- package/dist/worker/read-workers.js +2 -2
- package/dist/worker/read-workers.js.map +1 -1
- package/dist/worker/readable-progress.d.ts +5 -0
- package/dist/worker/readable-progress.d.ts.map +1 -0
- package/dist/worker/readable-progress.js +16 -0
- package/dist/worker/readable-progress.js.map +1 -0
- package/dist/worker/resume-worker.d.ts.map +1 -1
- package/dist/worker/resume-worker.js +4 -5
- package/dist/worker/resume-worker.js.map +1 -1
- package/dist/worker/worker-progress.d.ts +2 -1
- package/dist/worker/worker-progress.d.ts.map +1 -1
- package/dist/workspace/real-path-of.d.ts +2 -2
- package/dist/workspace/real-path-of.d.ts.map +1 -1
- package/dist/workspace/real-path-of.js +15 -10
- package/dist/workspace/real-path-of.js.map +1 -1
- package/dist/workspace/write-inside-project.d.ts +8 -0
- package/dist/workspace/write-inside-project.d.ts.map +1 -0
- package/dist/workspace/write-inside-project.js +17 -0
- package/dist/workspace/write-inside-project.js.map +1 -0
- package/package.json +5 -5
- package/templates/aggregate/event-sourced.events.mapper.ts.tpl +5 -1
- package/templates/command/handler.declared.ts.tpl +4 -12
- package/templates/command/handler.ts.tpl +4 -12
- package/templates/docs/privacy-register.md.tpl +2 -0
- package/templates/e2e/e2e.spec.ts.tpl +2 -2
- package/templates/init/README.md.tpl +42 -9
- package/templates/init/docker/docker-compose.yml.tpl +5 -2
- package/templates/init/docker/dockerignore.tpl +1 -0
- package/templates/init/docker/env.example.tpl +16 -1
- package/templates/init/gitignore.tpl +1 -0
- package/templates/init/hooks/change-reference.mjs +96 -17
- package/templates/init/hooks/production-gate.mjs +65 -11
- package/templates/init/jest.config.js.tpl +4 -1
- package/templates/init/main.ts.tpl +3 -0
- package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +25 -8
- package/templates/init/platform/audit/create-audit-trail.ts.tpl +59 -0
- package/templates/init/platform/audit/create-audit.ts.tpl +13 -52
- package/templates/init/platform/auth/authentication/development-header-authenticator.ts.tpl +7 -3
- package/templates/init/platform/auth/relationships/relationship-schema.ts.tpl +5 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +58 -7
- package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +9 -4
- package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +1 -1
- package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/composition/platform-options.manual.ts.tpl +7 -0
- package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
- package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +7 -0
- package/templates/init/platform/config/app-config.ts.tpl +16 -0
- package/templates/init/platform/config/load-config.ts.tpl +46 -0
- package/templates/init/platform/database/data-source.typeorm.ts.tpl +6 -0
- package/templates/init/platform/database/gitkeep +0 -0
- package/templates/init/platform/database/knexfile.js.tpl +10 -3
- package/templates/init/platform/database/open-persistence.prisma.ts.tpl +5 -2
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +11 -3
- package/templates/init/platform/database/persistence.contract.spec.ts.tpl +14 -3
- package/templates/init/platform/database/prisma.config.ts.tpl +6 -0
- package/templates/init/platform/database/schema.knex.ts.tpl +4 -3
- package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +5 -1
- package/templates/init/platform/http/start-http-server.express.ts.tpl +9 -6
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +5 -2
- package/templates/init/platform/http/start-http-server.hono.ts.tpl +5 -2
- package/templates/init/platform/jobs/create-background-work.ts.tpl +12 -0
- package/templates/init/platform/jobs/days-before.ts.tpl +8 -0
- package/templates/init/platform/jobs/housekeeping.module.tsyringe.ts.tpl +46 -0
- package/templates/init/platform/jobs/housekeeping.ts.tpl +24 -0
- package/templates/init/platform/jobs/job-settings.ts.tpl +9 -0
- package/templates/init/platform/privacy/personal-events.ts.tpl +11 -0
- package/templates/init/platform/privacy/run-erasure.manual.ts.tpl +69 -19
- package/templates/init/platform/privacy/run-erasure.tsyringe.ts.tpl +69 -8
- package/templates/init/platform/privacy/run-export.manual.ts.tpl +26 -4
- package/templates/init/platform/privacy/run-export.tsyringe.ts.tpl +34 -3
- package/templates/init/platform/privacy/run-purge.manual.ts.tpl +3 -2
- package/templates/init/platform/privacy/run-purge.tsyringe.ts.tpl +4 -2
- package/templates/init/rules/infrastructure.md.tpl +1 -1
- package/templates/init/scripts/audit-verify.ts.tpl +35 -0
- package/templates/init/scripts/privacy-erase.manual.ts.tpl +52 -7
- package/templates/init/scripts/privacy-erase.tsyringe.ts.tpl +52 -7
- package/templates/init/scripts/privacy-export.manual.ts.tpl +5 -7
- package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +5 -7
- package/templates/init/scripts/privacy-purge.manual.ts.tpl +4 -0
- package/templates/init/scripts/privacy-purge.tsyringe.ts.tpl +4 -0
- package/templates/pipeline/github/dependabot.yml +6 -0
- package/templates/pipeline/github/workflows/ci.yml.tpl +26 -1
- package/templates/pipeline/github/workflows/claude-review.yml +3 -2
- package/templates/pipeline/github/workflows/claude-triage.yml +1 -1
- package/templates/pipeline/github/workflows/codeql.yml +2 -0
- package/templates/pipeline/github/workflows/copilot-setup-steps.yml +2 -0
- package/templates/pipeline/github/workflows/intent-to-spec.yml +12 -4
- package/templates/pipeline/github/workflows/pr-title.yml +2 -0
- package/templates/pipeline/gitlab/claude-review.gitlab-ci.yml.tpl +1 -1
- package/templates/pipeline/knip.json.tpl +1 -4
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/pipeline/renovate.json +11 -0
- package/templates/pipeline/stryker.config.mjs.tpl +4 -0
- package/templates/pipeline/vitest.config.ts.tpl +3 -2
- package/templates/presets/identity/context/__context__.codes.named.ts.tpl +1 -0
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +28 -1
- package/templates/presets/identity/context/domain/aggregates/invitation.aggregate.ts.tpl +13 -1
- package/templates/presets/identity/context/domain/aggregates/member.aggregate.ts.tpl +6 -1
- package/templates/presets/identity/context/domain/errors/invitation-withdrawn.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/invitation.error.factories.ts.tpl +8 -0
- package/templates/presets/identity/context/domain/services/role-rights.service.ts.tpl +23 -1
- package/templates/presets/identity/context/infrastructure/persistence/__context__.schema.drizzle.ts.tpl +1 -0
- package/templates/presets/identity/context/infrastructure/persistence/create-__context__-tables.schema.knex.ts.tpl +1 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +6 -2
- package/templates/presets/identity/context/infrastructure/persistence/invitation-row.schema.knex.ts.tpl +1 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.drizzle.ts.tpl +2 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.knex.ts.tpl +2 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +2 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +8 -5
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.kit-routes.ts.tpl +1 -0
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +1 -0
- package/templates/presets/identity/context/test/builders/invitation.builder.ts.tpl +15 -2
- package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +10 -0
- package/templates/presets/identity/context/test/unit/accept-invitation.handler.spec.ts.tpl +114 -4
- package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +1 -1
- package/templates/presets/identity/design.md.tpl +3 -1
- package/templates/presets/identity/prisma/models.prisma.tpl +1 -0
- package/templates/query/reader.fake.ts.tpl +4 -6
- package/templates/query/reader.in-memory.ts.tpl +1 -1
- package/templates/repository/drizzle/repository.ts.tpl +4 -3
- package/templates/repository/knex/table.tpl +1 -1
- package/templates/repository/prisma/repository.ts.tpl +24 -18
- package/templates/state-machine/state-machine.spec.ts.tpl +5 -0
- package/templates/worker/main.ts.tpl +3 -0
- package/templates/init/platform/database/migration.knex.js.tpl +0 -8
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"extends": [
|
|
4
4
|
"config:recommended",
|
|
5
5
|
"helpers:pinGitHubActionDigests",
|
|
6
|
+
"docker:pinDigests",
|
|
6
7
|
":semanticCommits",
|
|
7
8
|
":semanticCommitTypeAll(chore)"
|
|
8
9
|
],
|
|
@@ -21,6 +22,16 @@
|
|
|
21
22
|
"schedule": ["at any time"],
|
|
22
23
|
"minimumReleaseAge": null
|
|
23
24
|
},
|
|
25
|
+
"customManagers": [
|
|
26
|
+
{
|
|
27
|
+
"description": "The Claude Code CLI the opt-in pipeline jobs install, written in a run line.",
|
|
28
|
+
"customType": "regex",
|
|
29
|
+
"managerFilePatterns": ["/(^|/)\\.github/workflows/[^/]+\\.yml$/", "/(^|/)\\.gitlab/[^/]+\\.yml$/"],
|
|
30
|
+
"matchStrings": ["@anthropic-ai/claude-code@(?<currentValue>\\d+\\.\\d+\\.\\d+)"],
|
|
31
|
+
"depNameTemplate": "@anthropic-ai/claude-code",
|
|
32
|
+
"datasourceTemplate": "npm"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
24
35
|
"packageRules": [
|
|
25
36
|
{
|
|
26
37
|
"groupName": "production dependencies (minor and patch)",
|
|
@@ -3,11 +3,15 @@ import { governedMutation } from '@ddd-ts-kit/testing/mutation';
|
|
|
3
3
|
export default {
|
|
4
4
|
{{#if tests.vitest}}
|
|
5
5
|
testRunner: 'vitest',
|
|
6
|
+
// Named, since Stryker looks for its plugins beside its own real path, where pnpm's strict layout keeps `core` alone; the ignorer of the kit is appended by governedMutation().
|
|
7
|
+
plugins: ['@stryker-mutator/vitest-runner'],
|
|
6
8
|
// 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
9
|
vitest: { configFile: 'vitest.mutation.config.ts' },
|
|
8
10
|
{{/if}}
|
|
9
11
|
{{#if tests.jest}}
|
|
10
12
|
testRunner: 'jest',
|
|
13
|
+
// Named, since Stryker looks for its plugins beside its own real path, where pnpm's strict layout keeps `core` alone; the ignorer of the kit is appended by governedMutation().
|
|
14
|
+
plugins: ['@stryker-mutator/jest-runner'],
|
|
11
15
|
// 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
16
|
testRunnerNodeArgs: ['--experimental-vm-modules'],
|
|
13
17
|
// 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.
|
|
@@ -5,7 +5,7 @@ import { decorators } from '@ddd-ts-kit/testing/vitest';
|
|
|
5
5
|
{{#if decorators.legacy}}
|
|
6
6
|
import { decoratorCoverage } from '@ddd-ts-kit/testing/vitest';
|
|
7
7
|
{{/if}}
|
|
8
|
-
import { defineConfig, type TestProjectInlineConfiguration } from 'vitest/config';
|
|
8
|
+
import { configDefaults, defineConfig, type TestProjectInlineConfiguration } from 'vitest/config';
|
|
9
9
|
|
|
10
10
|
const INTEGRATION_SPECS = '{{config.contextsDir}}/*/test/integration/**/*.spec.ts';
|
|
11
11
|
const INTEGRATION_MODE = 'integration';
|
|
@@ -56,7 +56,8 @@ export default defineConfig(({ mode }) => ({
|
|
|
56
56
|
passWithNoTests: mode === INTEGRATION_MODE,
|
|
57
57
|
...WORKERS,
|
|
58
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
|
|
59
|
+
// The reporters Vitest picks itself (a terse one under a coding agent), and the budget one after them.
|
|
60
|
+
reporters: [...configDefaults.reporters, '@ddd-ts-kit/testing/budget/vitest'],
|
|
60
61
|
{{#if assembly.discovery}}
|
|
61
62
|
// Discovery imports the role files of a context itself: inlined, the package loads them through the runner, which compiles them.
|
|
62
63
|
server: { deps: { inline: ['@ddd-ts-kit/di'] } },
|
|
@@ -20,6 +20,7 @@ export const {{context.pascal}}Codes = {
|
|
|
20
20
|
InvitationExpired: 'INVITATION_EXPIRED',
|
|
21
21
|
InvitationNotPending: 'INVITATION_NOT_PENDING',
|
|
22
22
|
InvitationNotAddressedToAccount: 'INVITATION_ADDRESSED_TO_ANOTHER',
|
|
23
|
+
InvitationWithdrawn: 'INVITATION_WITHDRAWN',
|
|
23
24
|
UnknownDelegation: 'DELEGATION_NOT_FOUND',
|
|
24
25
|
DelegationNotActive: 'DELEGATION_NOT_ACTIVE',
|
|
25
26
|
DelegationToOneself: 'DELEGATION_TO_ONESELF',
|
|
@@ -195,7 +195,7 @@ function registerInvitations({ commands, ids, clock }: Platform, adapters: Adapt
|
|
|
195
195
|
const own = { context: '{{context.kebab}}' };
|
|
196
196
|
|
|
197
197
|
commands.register(InviteMemberCommand, new InviteMemberHandler(invitations, members, delegations, tokens, access, ids, clock), own);
|
|
198
|
-
commands.register(AcceptInvitationCommand, new AcceptInvitationHandler(invitations, members, accounts, tokens, ids, clock), own);
|
|
198
|
+
commands.register(AcceptInvitationCommand, new AcceptInvitationHandler(invitations, members, accounts, delegations, tokens, ids, clock), own);
|
|
199
199
|
commands.register(DeclineInvitationCommand, new DeclineInvitationHandler(invitations, accounts, tokens, clock), own);
|
|
200
200
|
commands.register(RevokeInvitationCommand, new RevokeInvitationHandler(invitations, members, delegations, access, clock), own);
|
|
201
201
|
}
|
|
@@ -5,6 +5,7 @@ import { CommandHandler } from '@ddd-ts-kit/kernel/declarations';
|
|
|
5
5
|
{{#unless style.declared}}
|
|
6
6
|
import type { CommandHandler } from '@ddd-ts-kit/kernel';
|
|
7
7
|
{{/unless}}
|
|
8
|
+
import type { Invitation } from '{{alias.context}}/domain/aggregates/invitation.aggregate{{alias.ext}}';
|
|
8
9
|
import { Member } from '{{alias.context}}/domain/aggregates/member.aggregate{{alias.ext}}';
|
|
9
10
|
{{#unless refusals.named}}
|
|
10
11
|
import { AccountError } from '{{alias.context}}/domain/errors/account.error{{alias.ext}}';
|
|
@@ -14,11 +15,14 @@ import { MemberError } from '{{alias.context}}/domain/errors/member.error{{alias
|
|
|
14
15
|
{{#if refusals.named}}
|
|
15
16
|
import { AlreadyMember } from '{{alias.context}}/domain/errors/already-member.error{{alias.ext}}';
|
|
16
17
|
import { UnknownAccount } from '{{alias.context}}/domain/errors/unknown-account.error{{alias.ext}}';
|
|
18
|
+
import { InvitationWithdrawn } from '{{alias.context}}/domain/errors/invitation-withdrawn.error{{alias.ext}}';
|
|
17
19
|
import { UnknownInvitation } from '{{alias.context}}/domain/errors/unknown-invitation.error{{alias.ext}}';
|
|
18
20
|
{{/if}}
|
|
19
21
|
import type { AccountRepository } from '{{alias.context}}/domain/repositories/account.repository{{alias.ext}}';
|
|
22
|
+
import type { DelegationRepository } from '{{alias.context}}/domain/repositories/delegation.repository{{alias.ext}}';
|
|
20
23
|
import type { InvitationRepository } from '{{alias.context}}/domain/repositories/invitation.repository{{alias.ext}}';
|
|
21
24
|
import type { MemberRepository } from '{{alias.context}}/domain/repositories/member.repository{{alias.ext}}';
|
|
25
|
+
import { RoleRightsService } from '{{alias.context}}/domain/services/role-rights.service{{alias.ext}}';
|
|
22
26
|
{{#if style.declared}}
|
|
23
27
|
import { AcceptInvitationCommand } from '{{alias.context}}/application/commands/accept-invitation/accept-invitation.command{{alias.ext}}';
|
|
24
28
|
{{/if}}
|
|
@@ -35,12 +39,16 @@ export class AcceptInvitationHandler implements CommandHandler<AcceptInvitationC
|
|
|
35
39
|
private readonly invitationRepository: InvitationRepository,
|
|
36
40
|
private readonly memberRepository: MemberRepository,
|
|
37
41
|
private readonly accountRepository: AccountRepository,
|
|
42
|
+
private readonly delegationRepository: DelegationRepository,
|
|
38
43
|
private readonly tokens: InvitationTokens,
|
|
39
44
|
private readonly ids: IdGenerator,
|
|
40
45
|
private readonly clock: Clock,
|
|
41
46
|
) {}
|
|
42
47
|
|
|
43
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* The person the invitation was sent to, signed in, answers with its token: they join in the
|
|
50
|
+
* role it names, while the account that issued it may still invite in that role.
|
|
51
|
+
*/
|
|
44
52
|
async execute({ actor, token }: AcceptInvitationCommand): Promise<string> {
|
|
45
53
|
const invitation = await this.invitationRepository.findByTokenHash(this.tokens.digestOf(token));
|
|
46
54
|
const account = await this.accountRepository.findById(actor.id);
|
|
@@ -79,6 +87,7 @@ export class AcceptInvitationHandler implements CommandHandler<AcceptInvitationC
|
|
|
79
87
|
{{/unless}}
|
|
80
88
|
}
|
|
81
89
|
|
|
90
|
+
await this.assertIssuerMayStillInvite(invitation, now);
|
|
82
91
|
await this.invitationRepository.save(invitation);
|
|
83
92
|
|
|
84
93
|
await this.memberRepository.save(
|
|
@@ -87,4 +96,22 @@ export class AcceptInvitationHandler implements CommandHandler<AcceptInvitationC
|
|
|
87
96
|
|
|
88
97
|
return invitation.id;
|
|
89
98
|
}
|
|
99
|
+
|
|
100
|
+
/** Removed, deactivated, demoted or no longer lent the right to invite, the issuer lets nobody in with what they issued before. */
|
|
101
|
+
private async assertIssuerMayStillInvite(invitation: Invitation, now: Date): Promise<void> {
|
|
102
|
+
const { organisationId, invitedBy } = invitation;
|
|
103
|
+
const member = await this.memberRepository.findOf(organisationId, invitedBy);
|
|
104
|
+
const lent = await this.delegationRepository.findUnendedTo(organisationId, invitedBy);
|
|
105
|
+
|
|
106
|
+
if (new RoleRightsService().mayStillIssue(invitation, { member, lent, now })) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
{{#if refusals.named}}
|
|
111
|
+
throw InvitationWithdrawn.forInvitation(invitation.id);
|
|
112
|
+
{{/if}}
|
|
113
|
+
{{#unless refusals.named}}
|
|
114
|
+
throw InvitationError.withdrawn(invitation.id);
|
|
115
|
+
{{/unless}}
|
|
116
|
+
}
|
|
90
117
|
}
|
|
@@ -25,6 +25,8 @@ export interface InvitationState {
|
|
|
25
25
|
/** The digest of the token sent to the person: the token itself is never stored. */
|
|
26
26
|
readonly tokenHash: string;
|
|
27
27
|
readonly invitedBy: string;
|
|
28
|
+
/** The delegation that lent the right to invite, when the role of the inviter did not grant it. */
|
|
29
|
+
readonly delegationId: string | undefined;
|
|
28
30
|
readonly issuedAt: Date;
|
|
29
31
|
readonly expiresAt: Date;
|
|
30
32
|
readonly status: InvitationStatus;
|
|
@@ -56,7 +58,7 @@ export class Invitation extends AggregateRoot<string> {
|
|
|
56
58
|
const expiresAt = new Date(now.getTime() + VALIDITY_MS);
|
|
57
59
|
const pending = { status: InvitationStatus.Pending, issuedAt: now, expiresAt, answeredAt: undefined };
|
|
58
60
|
const { organisationId, email, role, tokenHash, invitedBy, delegationId } = terms;
|
|
59
|
-
const issued = new Invitation(id, { organisationId, email, role, tokenHash, invitedBy, ...pending });
|
|
61
|
+
const issued = new Invitation(id, { organisationId, email, role, tokenHash, invitedBy, delegationId, ...pending });
|
|
60
62
|
const under = delegationId === undefined ? {} : { delegationId };
|
|
61
63
|
|
|
62
64
|
issued.record(new InvitationIssued(id, now, { organisationId, email: email.value, role, expiresAt, ...under }));
|
|
@@ -108,6 +110,16 @@ export class Invitation extends AggregateRoot<string> {
|
|
|
108
110
|
return this.state.role;
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
/** The account that issued it: the invitation holds while that account may still invite in its role (`RoleRightsService.mayStillIssue`). */
|
|
114
|
+
get invitedBy(): string {
|
|
115
|
+
return this.state.invitedBy;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** The delegation it was issued under: it holds while that delegation does, whatever else is lent to the inviter. */
|
|
119
|
+
get delegationId(): string | undefined {
|
|
120
|
+
return this.state.delegationId;
|
|
121
|
+
}
|
|
122
|
+
|
|
111
123
|
get status(): InvitationStatus {
|
|
112
124
|
return this.state.status;
|
|
113
125
|
}
|
|
@@ -60,7 +60,7 @@ export class Member extends AggregateRoot<string> {
|
|
|
60
60
|
|
|
61
61
|
/** Whoever invites or appoints in `role` holds that role or a higher one: only an owner makes an owner. */
|
|
62
62
|
static assertAppointable(organisationId: string, role: MemberRole, by: MemberRole): void {
|
|
63
|
-
if (
|
|
63
|
+
if (Member.mayAppoint(role, by)) {
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -74,6 +74,11 @@ export class Member extends AggregateRoot<string> {
|
|
|
74
74
|
{{/unless}}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/** Whether a member of the role `by` may invite or appoint in `role`, as `assertAppointable` decides. */
|
|
78
|
+
static mayAppoint(role: MemberRole, by: MemberRole): boolean {
|
|
79
|
+
return !outranks(role, by);
|
|
80
|
+
}
|
|
81
|
+
|
|
77
82
|
/** Never one's own role, never above one's own role, and the last owner stays one. */
|
|
78
83
|
changeRole(role: MemberRole, change: MembershipChange, now: Date): void {
|
|
79
84
|
this.assertActive();
|
package/templates/presets/identity/context/domain/errors/invitation-withdrawn.error.named.ts.tpl
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/{{context.kebab}}.codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class InvitationWithdrawn extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.InvitationWithdrawn;
|
|
6
|
+
|
|
7
|
+
static forInvitation(invitationId: string) {
|
|
8
|
+
return InvitationWithdrawn.refusal(
|
|
9
|
+
`The invitation ${invitationId} is withdrawn: its issuer may no longer invite in its role.`,
|
|
10
|
+
{ invitationId },
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -27,4 +27,12 @@ export class InvitationError extends ConceptError {
|
|
|
27
27
|
{ invitationId },
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
static withdrawn(invitationId: string) {
|
|
32
|
+
return InvitationError.refusal(
|
|
33
|
+
'INVITATION_WITHDRAWN',
|
|
34
|
+
`The invitation ${invitationId} is withdrawn: its issuer may no longer invite in its role.`,
|
|
35
|
+
{ invitationId },
|
|
36
|
+
);
|
|
37
|
+
}
|
|
30
38
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Delegation } from '{{alias.context}}/domain/aggregates/delegation.aggregate{{alias.ext}}';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Invitation } from '{{alias.context}}/domain/aggregates/invitation.aggregate{{alias.ext}}';
|
|
3
|
+
import { Member } from '{{alias.context}}/domain/aggregates/member.aggregate{{alias.ext}}';
|
|
3
4
|
import { OrganisationRights } from '{{alias.context}}/domain/value-objects/organisation-rights.vo{{alias.ext}}';
|
|
4
5
|
import { MemberRight } from '{{alias.context}}/domain/vocabularies/member-right.vocabulary{{alias.ext}}';
|
|
5
6
|
import { MemberRole } from '{{alias.context}}/domain/vocabularies/member-role.vocabulary{{alias.ext}}';
|
|
@@ -44,6 +45,27 @@ export class RoleRightsService {
|
|
|
44
45
|
return OrganisationRights.of(organisationId, accountId, [...GRANTED[held.member.role], ...lent]);
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Whether the account that issued `invitation`, as it holds at `now` (`held`), may still issue it:
|
|
50
|
+
* a current membership in a role at or above the one of the invitation, and the right to invite
|
|
51
|
+
* from where it came when issued: the delegation the invitation names, still active, or else
|
|
52
|
+
* the role. Removed, deactivated, demoted, or the delegation ended or revoked, its pending
|
|
53
|
+
* invitations are withdrawn: they let nobody in.
|
|
54
|
+
*/
|
|
55
|
+
mayStillIssue(invitation: Invitation, held: HeldRights): boolean {
|
|
56
|
+
const { role, delegationId } = invitation;
|
|
57
|
+
|
|
58
|
+
if (!held.member?.isActive || !Member.mayAppoint(role, held.member.role)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (delegationId === undefined) {
|
|
63
|
+
return GRANTED[held.member.role].includes(MemberRight.InviteMembers);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return activeAt(held).some((given) => given.id === delegationId && given.rights.includes(MemberRight.InviteMembers));
|
|
67
|
+
}
|
|
68
|
+
|
|
47
69
|
/** The delegation `right` is used under, when the role of the member does not grant it: what the facts it leads to name. */
|
|
48
70
|
delegationUsedFor(right: MemberRight, held: HeldRights): string | undefined {
|
|
49
71
|
if (held.member === undefined || GRANTED[held.member.role].includes(right)) {
|
|
@@ -69,6 +69,7 @@ export const invitations = {{context.camel}}Schema.table(
|
|
|
69
69
|
role: text('role').$type<MemberRole>().notNull(),
|
|
70
70
|
tokenHash: text('token_hash').notNull().unique(),
|
|
71
71
|
invitedBy: text('invited_by').notNull(),
|
|
72
|
+
delegationId: text('delegation_id'),
|
|
72
73
|
issuedAt: instant('issued_at').notNull(),
|
|
73
74
|
expiresAt: instant('expires_at').notNull(),
|
|
74
75
|
status: text('status').$type<InvitationStatus>().notNull(),
|
|
@@ -78,6 +78,7 @@ function createInvitationTable(knex: Knex): Promise<void> {
|
|
|
78
78
|
table.text('role').notNullable();
|
|
79
79
|
table.text('token_hash').notNullable().unique();
|
|
80
80
|
table.text('invited_by').notNullable();
|
|
81
|
+
table.text('delegation_id');
|
|
81
82
|
table.timestamp('issued_at', { useTz: true }).notNullable();
|
|
82
83
|
table.timestamp('expires_at', { useTz: true }).notNullable();
|
|
83
84
|
table.text('status').notNullable();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { and, eq } from 'drizzle-orm';
|
|
2
|
-
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
2
|
+
import { optimisticUpdate, primaryKeyOf } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
4
|
{{#if style.declared}}
|
|
5
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -45,7 +45,11 @@ export class DrizzleAccountRepository implements AccountRepository {
|
|
|
45
45
|
private insert(state: VersionedAccount) {
|
|
46
46
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
47
47
|
|
|
48
|
-
return executorOf(this.database)
|
|
48
|
+
return executorOf(this.database)
|
|
49
|
+
.insert(accounts)
|
|
50
|
+
.values(row)
|
|
51
|
+
.onConflictDoNothing({ target: primaryKeyOf(accounts) })
|
|
52
|
+
.returning({ id: accounts.id });
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
private update(state: VersionedAccount, expected: number) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { and, eq, isNull, or } from 'drizzle-orm';
|
|
2
|
-
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
2
|
+
import { optimisticUpdate, primaryKeyOf } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
4
|
{{#if style.declared}}
|
|
5
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -59,7 +59,11 @@ export class DrizzleDelegationRepository implements DelegationRepository {
|
|
|
59
59
|
private insert(state: VersionedDelegation) {
|
|
60
60
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
61
61
|
|
|
62
|
-
return executorOf(this.database)
|
|
62
|
+
return executorOf(this.database)
|
|
63
|
+
.insert(delegations)
|
|
64
|
+
.values(row)
|
|
65
|
+
.onConflictDoNothing({ target: primaryKeyOf(delegations) })
|
|
66
|
+
.returning({ id: delegations.id });
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
private update(state: VersionedDelegation, expected: number) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { and, eq } from 'drizzle-orm';
|
|
2
|
-
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
2
|
+
import { optimisticUpdate, primaryKeyOf } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
4
|
{{#if style.declared}}
|
|
5
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -51,7 +51,11 @@ export class DrizzleInvitationRepository implements InvitationRepository {
|
|
|
51
51
|
private insert(state: VersionedInvitation) {
|
|
52
52
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
53
53
|
|
|
54
|
-
return executorOf(this.database)
|
|
54
|
+
return executorOf(this.database)
|
|
55
|
+
.insert(invitations)
|
|
56
|
+
.values(row)
|
|
57
|
+
.onConflictDoNothing({ target: primaryKeyOf(invitations) })
|
|
58
|
+
.returning({ id: invitations.id });
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
private update(state: VersionedInvitation, expected: number) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { and, count, eq, isNull } from 'drizzle-orm';
|
|
2
|
-
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
2
|
+
import { optimisticUpdate, primaryKeyOf } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
4
|
{{#if style.declared}}
|
|
5
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -66,7 +66,11 @@ export class DrizzleMemberRepository implements MemberRepository {
|
|
|
66
66
|
private insert(state: VersionedMember) {
|
|
67
67
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
68
68
|
|
|
69
|
-
return executorOf(this.database)
|
|
69
|
+
return executorOf(this.database)
|
|
70
|
+
.insert(members)
|
|
71
|
+
.values(row)
|
|
72
|
+
.onConflictDoNothing({ target: primaryKeyOf(members) })
|
|
73
|
+
.returning({ id: members.id });
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
private update(state: VersionedMember, expected: number) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { and, eq } from 'drizzle-orm';
|
|
2
|
-
import { optimisticUpdate } from '@ddd-ts-kit/drizzle/postgres';
|
|
2
|
+
import { optimisticUpdate, primaryKeyOf } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
4
4
|
{{#if style.declared}}
|
|
5
5
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -45,7 +45,11 @@ export class DrizzleOrganisationRepository implements OrganisationRepository {
|
|
|
45
45
|
private insert(state: VersionedOrganisation) {
|
|
46
46
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
47
47
|
|
|
48
|
-
return executorOf(this.database)
|
|
48
|
+
return executorOf(this.database)
|
|
49
|
+
.insert(organisations)
|
|
50
|
+
.values(row)
|
|
51
|
+
.onConflictDoNothing({ target: primaryKeyOf(organisations) })
|
|
52
|
+
.returning({ id: organisations.id });
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
private update(state: VersionedOrganisation, expected: number) {
|
|
@@ -9,6 +9,7 @@ export interface InvitationColumns {
|
|
|
9
9
|
readonly role: MemberRole;
|
|
10
10
|
readonly token_hash: string;
|
|
11
11
|
readonly invited_by: string;
|
|
12
|
+
readonly delegation_id: string | null;
|
|
12
13
|
readonly issued_at: Date;
|
|
13
14
|
readonly expires_at: Date;
|
|
14
15
|
readonly status: InvitationStatus;
|
|
@@ -15,6 +15,7 @@ export const InvitationMapper = {
|
|
|
15
15
|
role: row.role,
|
|
16
16
|
tokenHash: row.tokenHash,
|
|
17
17
|
invitedBy: row.invitedBy,
|
|
18
|
+
delegationId: row.delegationId ?? undefined,
|
|
18
19
|
issuedAt: row.issuedAt,
|
|
19
20
|
expiresAt: row.expiresAt,
|
|
20
21
|
status: row.status,
|
|
@@ -36,6 +37,7 @@ export const InvitationMapper = {
|
|
|
36
37
|
role: state.role,
|
|
37
38
|
tokenHash: state.tokenHash,
|
|
38
39
|
invitedBy: state.invitedBy,
|
|
40
|
+
delegationId: state.delegationId ?? null,
|
|
39
41
|
issuedAt: state.issuedAt,
|
|
40
42
|
expiresAt: state.expiresAt,
|
|
41
43
|
status: state.status,
|
package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.knex.ts.tpl
CHANGED
|
@@ -10,6 +10,7 @@ export const InvitationMapper = {
|
|
|
10
10
|
role: row.role,
|
|
11
11
|
tokenHash: row.token_hash,
|
|
12
12
|
invitedBy: row.invited_by,
|
|
13
|
+
delegationId: row.delegation_id ?? undefined,
|
|
13
14
|
issuedAt: row.issued_at,
|
|
14
15
|
expiresAt: row.expires_at,
|
|
15
16
|
status: row.status,
|
|
@@ -31,6 +32,7 @@ export const InvitationMapper = {
|
|
|
31
32
|
role: state.role,
|
|
32
33
|
token_hash: state.tokenHash,
|
|
33
34
|
invited_by: state.invitedBy,
|
|
35
|
+
delegation_id: state.delegationId ?? null,
|
|
34
36
|
issued_at: state.issuedAt,
|
|
35
37
|
expires_at: state.expiresAt,
|
|
36
38
|
status: state.status,
|
|
@@ -13,6 +13,7 @@ export const InvitationMapper = {
|
|
|
13
13
|
role: row.role,
|
|
14
14
|
tokenHash: row.tokenHash,
|
|
15
15
|
invitedBy: row.invitedBy,
|
|
16
|
+
delegationId: row.delegationId ?? undefined,
|
|
16
17
|
issuedAt: row.issuedAt,
|
|
17
18
|
expiresAt: row.expiresAt,
|
|
18
19
|
status: row.status,
|
|
@@ -34,6 +35,7 @@ export const InvitationMapper = {
|
|
|
34
35
|
role: state.role,
|
|
35
36
|
tokenHash: state.tokenHash,
|
|
36
37
|
invitedBy: state.invitedBy,
|
|
38
|
+
delegationId: state.delegationId ?? null,
|
|
37
39
|
issuedAt: state.issuedAt,
|
|
38
40
|
expiresAt: state.expiresAt,
|
|
39
41
|
status: state.status,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { optimisticUpdate } from '@ddd-ts-kit/prisma';
|
|
1
|
+
import { optimisticUpdate, rowsCreated } from '@ddd-ts-kit/prisma';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
3
|
{{#if style.declared}}
|
|
4
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -34,16 +34,19 @@ export class PrismaAccountRepository implements AccountRepository {
|
|
|
34
34
|
async save(saved: Account): Promise<void> {
|
|
35
35
|
await optimisticUpdate(saved, async ({ expected, next }) => {
|
|
36
36
|
const state = { ...AccountMapper.toRow(saved), version: next };
|
|
37
|
-
const written = expected === 0 ? await this.insert(state) : await this.update(state, expected);
|
|
38
37
|
|
|
39
|
-
return
|
|
38
|
+
return expected === 0 ? this.insert(state) : (await this.update(state, expected)).count;
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
private insert(state: VersionedAccount): Promise<
|
|
42
|
+
private async insert(state: VersionedAccount): Promise<number> {
|
|
44
43
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
44
|
+
const created = await accountsOf(this.database).createMany({ data: [row], skipDuplicates: true });
|
|
45
45
|
|
|
46
|
-
return
|
|
46
|
+
return rowsCreated(created, {
|
|
47
|
+
id: state.id,
|
|
48
|
+
holders: () => accountsOf(this.database).count({ where: { id: state.id } }),
|
|
49
|
+
});
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
private update(state: VersionedAccount, expected: number): Promise<{ count: number }> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { optimisticUpdate } from '@ddd-ts-kit/prisma';
|
|
1
|
+
import { optimisticUpdate, rowsCreated } from '@ddd-ts-kit/prisma';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
3
|
{{#if style.declared}}
|
|
4
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -52,16 +52,19 @@ export class PrismaDelegationRepository implements DelegationRepository {
|
|
|
52
52
|
async save(saved: Delegation): Promise<void> {
|
|
53
53
|
await optimisticUpdate(saved, async ({ expected, next }) => {
|
|
54
54
|
const state = { ...DelegationMapper.toRow(saved), version: next };
|
|
55
|
-
const written = expected === 0 ? await this.insert(state) : await this.update(state, expected);
|
|
56
55
|
|
|
57
|
-
return
|
|
56
|
+
return expected === 0 ? this.insert(state) : (await this.update(state, expected)).count;
|
|
58
57
|
});
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
private insert(state: VersionedDelegation): Promise<
|
|
60
|
+
private async insert(state: VersionedDelegation): Promise<number> {
|
|
62
61
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
62
|
+
const created = await delegationsOf(this.database).createMany({ data: [row], skipDuplicates: true });
|
|
63
63
|
|
|
64
|
-
return
|
|
64
|
+
return rowsCreated(created, {
|
|
65
|
+
id: state.id,
|
|
66
|
+
holders: () => delegationsOf(this.database).count({ where: { id: state.id } }),
|
|
67
|
+
});
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
private update(state: VersionedDelegation, expected: number): Promise<{ count: number }> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { optimisticUpdate } from '@ddd-ts-kit/prisma';
|
|
1
|
+
import { optimisticUpdate, rowsCreated } from '@ddd-ts-kit/prisma';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
3
|
{{#if style.declared}}
|
|
4
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -40,16 +40,19 @@ export class PrismaInvitationRepository implements InvitationRepository {
|
|
|
40
40
|
async save(saved: Invitation): Promise<void> {
|
|
41
41
|
await optimisticUpdate(saved, async ({ expected, next }) => {
|
|
42
42
|
const state = { ...InvitationMapper.toRow(saved), version: next };
|
|
43
|
-
const written = expected === 0 ? await this.insert(state) : await this.update(state, expected);
|
|
44
43
|
|
|
45
|
-
return
|
|
44
|
+
return expected === 0 ? this.insert(state) : (await this.update(state, expected)).count;
|
|
46
45
|
});
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
private insert(state: VersionedInvitation): Promise<
|
|
48
|
+
private async insert(state: VersionedInvitation): Promise<number> {
|
|
50
49
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
50
|
+
const created = await invitationsOf(this.database).createMany({ data: [row], skipDuplicates: true });
|
|
51
51
|
|
|
52
|
-
return
|
|
52
|
+
return rowsCreated(created, {
|
|
53
|
+
id: state.id,
|
|
54
|
+
holders: () => invitationsOf(this.database).count({ where: { id: state.id } }),
|
|
55
|
+
});
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
private update(state: VersionedInvitation, expected: number): Promise<{ count: number }> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { optimisticUpdate } from '@ddd-ts-kit/prisma';
|
|
1
|
+
import { optimisticUpdate, rowsCreated } from '@ddd-ts-kit/prisma';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
3
|
{{#if style.declared}}
|
|
4
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -51,16 +51,19 @@ export class PrismaMemberRepository implements MemberRepository {
|
|
|
51
51
|
async save(saved: Member): Promise<void> {
|
|
52
52
|
await optimisticUpdate(saved, async ({ expected, next }) => {
|
|
53
53
|
const state = { ...MemberMapper.toRow(saved), version: next };
|
|
54
|
-
const written = expected === 0 ? await this.insert(state) : await this.update(state, expected);
|
|
55
54
|
|
|
56
|
-
return
|
|
55
|
+
return expected === 0 ? this.insert(state) : (await this.update(state, expected)).count;
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
private insert(state: VersionedMember): Promise<
|
|
59
|
+
private async insert(state: VersionedMember): Promise<number> {
|
|
61
60
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
61
|
+
const created = await membersOf(this.database).createMany({ data: [row], skipDuplicates: true });
|
|
62
62
|
|
|
63
|
-
return
|
|
63
|
+
return rowsCreated(created, {
|
|
64
|
+
id: state.id,
|
|
65
|
+
holders: () => membersOf(this.database).count({ where: { id: state.id } }),
|
|
66
|
+
});
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
private update(state: VersionedMember, expected: number): Promise<{ count: number }> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { optimisticUpdate } from '@ddd-ts-kit/prisma';
|
|
1
|
+
import { optimisticUpdate, rowsCreated } from '@ddd-ts-kit/prisma';
|
|
2
2
|
import { stampCreation, stampUpdate, type Clock, type ExecutionScope } from '@ddd-ts-kit/kernel';
|
|
3
3
|
{{#if style.declared}}
|
|
4
4
|
import { Repository } from '@ddd-ts-kit/kernel/declarations';
|
|
@@ -34,16 +34,19 @@ export class PrismaOrganisationRepository implements OrganisationRepository {
|
|
|
34
34
|
async save(saved: Organisation): Promise<void> {
|
|
35
35
|
await optimisticUpdate(saved, async ({ expected, next }) => {
|
|
36
36
|
const state = { ...OrganisationMapper.toRow(saved), version: next };
|
|
37
|
-
const written = expected === 0 ? await this.insert(state) : await this.update(state, expected);
|
|
38
37
|
|
|
39
|
-
return
|
|
38
|
+
return expected === 0 ? this.insert(state) : (await this.update(state, expected)).count;
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
private insert(state: VersionedOrganisation): Promise<
|
|
42
|
+
private async insert(state: VersionedOrganisation): Promise<number> {
|
|
44
43
|
const row = { ...state, ...stampCreation(this.scope, this.clock) };
|
|
44
|
+
const created = await organisationsOf(this.database).createMany({ data: [row], skipDuplicates: true });
|
|
45
45
|
|
|
46
|
-
return
|
|
46
|
+
return rowsCreated(created, {
|
|
47
|
+
id: state.id,
|
|
48
|
+
holders: () => organisationsOf(this.database).count({ where: { id: state.id } }),
|
|
49
|
+
});
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
private update(state: VersionedOrganisation, expected: number): Promise<{ count: number }> {
|
|
@@ -46,6 +46,7 @@ export class AcceptInvitationController {
|
|
|
46
46
|
'INVITATION_EXPIRED',
|
|
47
47
|
'INVITATION_ADDRESSED_TO_ANOTHER',
|
|
48
48
|
'ALREADY_MEMBER',
|
|
49
|
+
'INVITATION_WITHDRAWN',
|
|
49
50
|
],
|
|
50
51
|
})
|
|
51
52
|
async acceptInvitation(@Body() body: {{#if schemas.shared}}InvitationToken{{/if}}{{#if schemas.perRoute}}AcceptInvitationBody{{/if}}, @CurrentActor() actor: Actor): Promise<{{#if schemas.shared}}Accepted{{/if}}{{#if schemas.perRoute}}AcceptInvitationAccepted{{/if}}> {
|