ddd-ts-kit 0.27.0 → 0.83.1
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 +232 -0
- package/README.fr.md +186 -72
- package/README.md +177 -71
- package/dist/check/canonical/role.d.ts +2 -0
- package/dist/check/canonical/role.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +1 -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 +6 -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 +2 -0
- package/dist/check/catalogue/default-severities.js.map +1 -1
- package/dist/check/catalogue/eslint-only-rules.js +3 -3
- package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
- package/dist/check/commands/check-command.d.ts.map +1 -1
- package/dist/check/commands/check-command.js +4 -1
- package/dist/check/commands/check-command.js.map +1 -1
- package/dist/check/commands/explain-command.d.ts.map +1 -1
- package/dist/check/commands/explain-command.js +2 -9
- package/dist/check/commands/explain-command.js.map +1 -1
- package/dist/check/engine/format-check.d.ts +6 -1
- package/dist/check/engine/format-check.d.ts.map +1 -1
- package/dist/check/engine/format-check.js +33 -11
- package/dist/check/engine/format-check.js.map +1 -1
- package/dist/check/errors/builds-through-factories.d.ts +4 -1
- package/dist/check/errors/builds-through-factories.d.ts.map +1 -1
- package/dist/check/errors/builds-through-factories.js +6 -2
- package/dist/check/errors/builds-through-factories.js.map +1 -1
- package/dist/check/errors/code-entry.d.ts +8 -0
- package/dist/check/errors/code-entry.d.ts.map +1 -0
- package/dist/check/errors/code-entry.js +2 -0
- package/dist/check/errors/code-entry.js.map +1 -0
- package/dist/check/errors/code-list-name.d.ts +3 -0
- package/dist/check/errors/code-list-name.d.ts.map +1 -0
- package/dist/check/errors/code-list-name.js +6 -0
- package/dist/check/errors/code-list-name.js.map +1 -0
- package/dist/check/errors/code-list.d.ts +10 -0
- package/dist/check/errors/code-list.d.ts.map +1 -0
- package/dist/check/errors/code-list.js +2 -0
- package/dist/check/errors/code-list.js.map +1 -0
- package/dist/check/errors/codes-set-in.d.ts +9 -0
- package/dist/check/errors/codes-set-in.d.ts.map +1 -0
- package/dist/check/errors/codes-set-in.js +15 -0
- package/dist/check/errors/codes-set-in.js.map +1 -0
- package/dist/check/errors/error-codes.d.ts +2 -0
- package/dist/check/errors/error-codes.d.ts.map +1 -1
- package/dist/check/errors/error-codes.js +8 -0
- package/dist/check/errors/error-codes.js.map +1 -1
- package/dist/check/errors/is-codes-file.d.ts +4 -0
- package/dist/check/errors/is-codes-file.d.ts.map +1 -0
- package/dist/check/errors/is-codes-file.js +11 -0
- package/dist/check/errors/is-codes-file.js.map +1 -0
- package/dist/check/errors/is-error-file.d.ts +4 -0
- package/dist/check/errors/is-error-file.d.ts.map +1 -0
- package/dist/check/errors/is-error-file.js +6 -0
- package/dist/check/errors/is-error-file.js.map +1 -0
- package/dist/check/errors/listed-codes.d.ts +5 -0
- package/dist/check/errors/listed-codes.d.ts.map +1 -0
- package/dist/check/errors/listed-codes.js +12 -0
- package/dist/check/errors/listed-codes.js.map +1 -0
- package/dist/check/errors/names-refusals.d.ts +4 -0
- package/dist/check/errors/names-refusals.d.ts.map +1 -0
- package/dist/check/errors/names-refusals.js +5 -0
- package/dist/check/errors/names-refusals.js.map +1 -0
- package/dist/check/errors/read-code-list.d.ts +5 -0
- package/dist/check/errors/read-code-list.d.ts.map +1 -0
- package/dist/check/errors/read-code-list.js +32 -0
- package/dist/check/errors/read-code-list.js.map +1 -0
- package/dist/check/errors/refusal-classes.d.ts +8 -0
- package/dist/check/errors/refusal-classes.d.ts.map +1 -0
- package/dist/check/errors/refusal-classes.js +9 -0
- package/dist/check/errors/refusal-classes.js.map +1 -0
- package/dist/check/event-sourcing/declared-shape.d.ts +7 -1
- package/dist/check/event-sourcing/declared-shape.d.ts.map +1 -1
- package/dist/check/event-sourcing/declared-shape.js +12 -4
- package/dist/check/event-sourcing/declared-shape.js.map +1 -1
- package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
- package/dist/check/event-sourcing/read-stored-shape.js +10 -2
- package/dist/check/event-sourcing/read-stored-shape.js.map +1 -1
- package/dist/check/event-sourcing/stored-event-declaration.d.ts +2 -0
- package/dist/check/event-sourcing/stored-event-declaration.d.ts.map +1 -1
- package/dist/check/event-sourcing/stored-event-declarations.js +1 -0
- package/dist/check/event-sourcing/stored-event-declarations.js.map +1 -1
- package/dist/check/event-sourcing/stored-shape.d.ts +2 -0
- package/dist/check/event-sourcing/stored-shape.d.ts.map +1 -1
- package/dist/check/explain/documented-rule.d.ts +8 -0
- package/dist/check/explain/documented-rule.d.ts.map +1 -0
- package/dist/check/explain/documented-rule.js +14 -0
- package/dist/check/explain/documented-rule.js.map +1 -0
- package/dist/check/explain/errors-docs.d.ts.map +1 -1
- package/dist/check/explain/errors-docs.js +30 -2
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/explanations-of.d.ts +5 -0
- package/dist/check/explain/explanations-of.d.ts.map +1 -0
- package/dist/check/explain/explanations-of.js +16 -0
- package/dist/check/explain/explanations-of.js.map +1 -0
- package/dist/check/explain/language-docs.js +1 -1
- package/dist/check/explain/language-docs.js.map +1 -1
- package/dist/check/explain/persistence-docs.d.ts.map +1 -1
- package/dist/check/explain/persistence-docs.js +7 -0
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.d.ts.map +1 -1
- package/dist/check/explain/wiring-docs.js +13 -0
- package/dist/check/explain/wiring-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 +11 -0
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +78 -1
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/errors-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/errors-fixtures.js +1 -1
- package/dist/check/fixtures/errors-fixtures.js.map +1 -1
- package/dist/check/fixtures/errors-route.d.ts +3 -0
- package/dist/check/fixtures/errors-route.d.ts.map +1 -0
- package/dist/check/fixtures/errors-route.js +6 -0
- package/dist/check/fixtures/errors-route.js.map +1 -0
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +2 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/named-refusal-fixtures.d.ts +4 -0
- package/dist/check/fixtures/named-refusal-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/named-refusal-fixtures.js +210 -0
- package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -0
- package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/persistence-fixtures.js +25 -0
- package/dist/check/fixtures/persistence-fixtures.js.map +1 -1
- package/dist/check/language/refusal-qualifiers.d.ts +8 -0
- package/dist/check/language/refusal-qualifiers.d.ts.map +1 -0
- package/dist/check/language/refusal-qualifiers.js +16 -0
- package/dist/check/language/refusal-qualifiers.js.map +1 -0
- package/dist/check/language/unknown-words.d.ts +2 -2
- package/dist/check/language/unknown-words.d.ts.map +1 -1
- package/dist/check/language/unknown-words.js +3 -2
- package/dist/check/language/unknown-words.js.map +1 -1
- package/dist/check/model/rule-explanation.d.ts +10 -0
- package/dist/check/model/rule-explanation.d.ts.map +1 -0
- package/dist/check/model/rule-explanation.js +2 -0
- package/dist/check/model/rule-explanation.js.map +1 -0
- package/dist/check/rules/authz-policy-asked.js +5 -2
- package/dist/check/rules/authz-policy-asked.js.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.d.ts +3 -0
- package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -0
- package/dist/check/rules/declarations-port-adapter-wired.js +104 -0
- package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -0
- package/dist/check/rules/errors-code-listed.d.ts +3 -0
- package/dist/check/rules/errors-code-listed.d.ts.map +1 -0
- package/dist/check/rules/errors-code-listed.js +160 -0
- package/dist/check/rules/errors-code-listed.js.map +1 -0
- package/dist/check/rules/errors-code-unique.d.ts.map +1 -1
- package/dist/check/rules/errors-code-unique.js +13 -8
- package/dist/check/rules/errors-code-unique.js.map +1 -1
- package/dist/check/rules/errors-known-code.d.ts.map +1 -1
- package/dist/check/rules/errors-known-code.js +17 -7
- package/dist/check/rules/errors-known-code.js.map +1 -1
- package/dist/check/rules/event-sourcing-upcaster-required.js +14 -4
- package/dist/check/rules/event-sourcing-upcaster-required.js.map +1 -1
- package/dist/check/rules/language-glossary-term.d.ts.map +1 -1
- package/dist/check/rules/language-glossary-term.js +10 -3
- package/dist/check/rules/language-glossary-term.js.map +1 -1
- package/dist/check/rules/naming-suffix.js +1 -1
- package/dist/check/rules/naming-suffix.js.map +1 -1
- package/dist/check/rules/persistence-primary-key-order.d.ts +3 -0
- package/dist/check/rules/persistence-primary-key-order.d.ts.map +1 -0
- package/dist/check/rules/persistence-primary-key-order.js +31 -0
- package/dist/check/rules/persistence-primary-key-order.js.map +1 -0
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +16 -7
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +20 -4
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/error-factories.d.ts +4 -2
- package/dist/commands/error-factories.d.ts.map +1 -1
- package/dist/commands/error-factories.js +74 -17
- package/dist/commands/error-factories.js.map +1 -1
- package/dist/commands/lint.d.ts +7 -0
- package/dist/commands/lint.d.ts.map +1 -0
- package/dist/commands/lint.js +55 -0
- package/dist/commands/lint.js.map +1 -0
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/open-api-problems.js +7 -6
- package/dist/config/open-api-problems.js.map +1 -1
- package/dist/config/parse-config.d.ts.map +1 -1
- package/dist/config/parse-config.js +2 -0
- package/dist/config/parse-config.js.map +1 -1
- package/dist/config/restack-config-text.d.ts +3 -2
- package/dist/config/restack-config-text.d.ts.map +1 -1
- package/dist/config/restack-config-text.js +5 -3
- package/dist/config/restack-config-text.js.map +1 -1
- package/dist/config/serialize-config.d.ts.map +1 -1
- package/dist/config/serialize-config.js +2 -1
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +9 -6
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +1 -1
- package/dist/config/stack.js.map +1 -1
- package/dist/describe/context-description.d.ts +7 -2
- package/dist/describe/context-description.d.ts.map +1 -1
- package/dist/describe/exposed-by.d.ts +7 -0
- package/dist/describe/exposed-by.d.ts.map +1 -0
- package/dist/describe/exposed-by.js +11 -0
- package/dist/describe/exposed-by.js.map +1 -0
- package/dist/describe/read-errors.d.ts +3 -1
- package/dist/describe/read-errors.d.ts.map +1 -1
- package/dist/describe/read-errors.js +18 -11
- package/dist/describe/read-errors.js.map +1 -1
- package/dist/describe/read-refusals.d.ts +11 -0
- package/dist/describe/read-refusals.d.ts.map +1 -0
- package/dist/describe/read-refusals.js +41 -0
- package/dist/describe/read-refusals.js.map +1 -0
- package/dist/describe/reference-lines.d.ts.map +1 -1
- package/dist/describe/reference-lines.js +18 -2
- package/dist/describe/reference-lines.js.map +1 -1
- package/dist/docs/formerly-recorded-stored-events.d.ts +9 -0
- package/dist/docs/formerly-recorded-stored-events.d.ts.map +1 -0
- package/dist/docs/formerly-recorded-stored-events.js +17 -0
- package/dist/docs/formerly-recorded-stored-events.js.map +1 -0
- package/dist/docs/write-stored-events-lock.d.ts +3 -2
- package/dist/docs/write-stored-events-lock.d.ts.map +1 -1
- package/dist/docs/write-stored-events-lock.js +10 -4
- package/dist/docs/write-stored-events-lock.js.map +1 -1
- package/dist/doctor/diagnose.d.ts +2 -0
- package/dist/doctor/diagnose.d.ts.map +1 -1
- package/dist/doctor/diagnose.js +22 -3
- package/dist/doctor/diagnose.js.map +1 -1
- package/dist/doctor/doctor-finding.d.ts +13 -5
- package/dist/doctor/doctor-finding.d.ts.map +1 -1
- package/dist/doctor/format-diagnosis.d.ts +4 -1
- package/dist/doctor/format-diagnosis.d.ts.map +1 -1
- package/dist/doctor/format-diagnosis.js +49 -3
- package/dist/doctor/format-diagnosis.js.map +1 -1
- package/dist/doctor/in-range.d.ts +7 -0
- package/dist/doctor/in-range.d.ts.map +1 -0
- package/dist/doctor/in-range.js +90 -0
- package/dist/doctor/in-range.js.map +1 -0
- package/dist/doctor/install-findings.d.ts +11 -0
- package/dist/doctor/install-findings.d.ts.map +1 -0
- package/dist/doctor/install-findings.js +119 -0
- package/dist/doctor/install-findings.js.map +1 -0
- package/dist/doctor/node-findings.d.ts +7 -0
- package/dist/doctor/node-findings.d.ts.map +1 -0
- package/dist/doctor/node-findings.js +19 -0
- package/dist/doctor/node-findings.js.map +1 -0
- package/dist/doctor/package-findings.d.ts +2 -0
- package/dist/doctor/package-findings.d.ts.map +1 -1
- package/dist/doctor/package-findings.js +1 -1
- package/dist/doctor/package-findings.js.map +1 -1
- package/dist/doctor/submodule-findings.d.ts +7 -0
- package/dist/doctor/submodule-findings.d.ts.map +1 -0
- package/dist/doctor/submodule-findings.js +22 -0
- package/dist/doctor/submodule-findings.js.map +1 -0
- package/dist/generate/concept.d.ts.map +1 -1
- package/dist/generate/concept.js +3 -29
- package/dist/generate/concept.js.map +1 -1
- package/dist/generate/errors/add-code.d.ts +13 -0
- package/dist/generate/errors/add-code.d.ts.map +1 -0
- package/dist/generate/errors/add-code.js +18 -0
- package/dist/generate/errors/add-code.js.map +1 -0
- package/dist/generate/errors/codes-list.d.ts +10 -0
- package/dist/generate/errors/codes-list.d.ts.map +1 -0
- package/dist/generate/errors/codes-list.js +25 -0
- package/dist/generate/errors/codes-list.js.map +1 -0
- package/dist/generate/errors/error-code-pattern.d.ts +3 -0
- package/dist/generate/errors/error-code-pattern.d.ts.map +1 -0
- package/dist/generate/errors/error-code-pattern.js +3 -0
- package/dist/generate/errors/error-code-pattern.js.map +1 -0
- package/dist/generate/errors/factory-prefix.d.ts +3 -0
- package/dist/generate/errors/factory-prefix.d.ts.map +1 -0
- package/dist/generate/errors/factory-prefix.js +3 -0
- package/dist/generate/errors/factory-prefix.js.map +1 -0
- package/dist/generate/errors/named-refusal-code.d.ts +17 -0
- package/dist/generate/errors/named-refusal-code.d.ts.map +1 -0
- package/dist/generate/errors/named-refusal-code.js +42 -0
- package/dist/generate/errors/named-refusal-code.js.map +1 -0
- package/dist/generate/errors/refusal-class-name.d.ts +8 -0
- package/dist/generate/errors/refusal-class-name.d.ts.map +1 -0
- package/dist/generate/errors/refusal-class-name.js +16 -0
- package/dist/generate/errors/refusal-class-name.js.map +1 -0
- package/dist/generate/errors/refusal-factory-name.d.ts +4 -0
- package/dist/generate/errors/refusal-factory-name.d.ts.map +1 -0
- package/dist/generate/errors/refusal-factory-name.js +15 -0
- package/dist/generate/errors/refusal-factory-name.js.map +1 -0
- package/dist/generate/errors/write-named-refusal.d.ts +18 -0
- package/dist/generate/errors/write-named-refusal.d.ts.map +1 -0
- package/dist/generate/errors/write-named-refusal.js +89 -0
- package/dist/generate/errors/write-named-refusal.js.map +1 -0
- package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
- package/dist/generate/kinds/domain-error-kind.js +12 -5
- package/dist/generate/kinds/domain-error-kind.js.map +1 -1
- package/dist/generate/kinds/error-kind.d.ts.map +1 -1
- package/dist/generate/kinds/error-kind.js +27 -12
- package/dist/generate/kinds/error-kind.js.map +1 -1
- package/dist/generate/schedule/cron-problem.d.ts.map +1 -1
- package/dist/generate/schedule/cron-problem.js +16 -1
- package/dist/generate/schedule/cron-problem.js.map +1 -1
- package/dist/generate/spoken-in-language.d.ts +9 -0
- package/dist/generate/spoken-in-language.d.ts.map +1 -0
- package/dist/generate/spoken-in-language.js +39 -0
- package/dist/generate/spoken-in-language.js.map +1 -0
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +32 -13
- 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/manifest/versions.js +24 -24
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +4 -2
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-stack.js +2 -2
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/lint/eslint-in-project.d.ts +8 -0
- package/dist/lint/eslint-in-project.d.ts.map +1 -0
- package/dist/lint/eslint-in-project.js +33 -0
- package/dist/lint/eslint-in-project.js.map +1 -0
- package/dist/lint/format-verdict.d.ts +4 -0
- package/dist/lint/format-verdict.d.ts.map +1 -0
- package/dist/lint/format-verdict.js +11 -0
- package/dist/lint/format-verdict.js.map +1 -0
- package/dist/lint/lint-run.d.ts +8 -0
- package/dist/lint/lint-run.d.ts.map +1 -0
- package/dist/lint/lint-run.js +2 -0
- package/dist/lint/lint-run.js.map +1 -0
- package/dist/lint/lint-verdict.d.ts +19 -0
- package/dist/lint/lint-verdict.d.ts.map +1 -0
- package/dist/lint/lint-verdict.js +25 -0
- package/dist/lint/lint-verdict.js.map +1 -0
- package/dist/lint/parse-lint-answer.d.ts +13 -0
- package/dist/lint/parse-lint-answer.d.ts.map +1 -0
- package/dist/lint/parse-lint-answer.js +18 -0
- package/dist/lint/parse-lint-answer.js.map +1 -0
- package/dist/migration/plan-replay.d.ts +4 -3
- package/dist/migration/plan-replay.d.ts.map +1 -1
- package/dist/migration/plan-replay.js +21 -6
- package/dist/migration/plan-replay.js.map +1 -1
- package/dist/migration/rename-branch-migrations.d.ts +13 -0
- package/dist/migration/rename-branch-migrations.d.ts.map +1 -0
- package/dist/migration/rename-branch-migrations.js +25 -0
- package/dist/migration/rename-branch-migrations.js.map +1 -0
- package/dist/migration/replay-drizzle-migrations.d.ts +6 -3
- package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
- package/dist/migration/replay-drizzle-migrations.js +48 -4
- package/dist/migration/replay-drizzle-migrations.js.map +1 -1
- package/dist/migration/replay-plan.d.ts +8 -0
- package/dist/migration/replay-plan.d.ts.map +1 -1
- package/dist/migration/restore-migration-folder.d.ts +4 -0
- package/dist/migration/restore-migration-folder.d.ts.map +1 -0
- package/dist/migration/restore-migration-folder.js +15 -0
- package/dist/migration/restore-migration-folder.js.map +1 -0
- package/dist/package-manager/lockfiles.d.ts +2 -0
- package/dist/package-manager/lockfiles.d.ts.map +1 -1
- package/dist/package-manager/lockfiles.js +5 -0
- package/dist/package-manager/lockfiles.js.map +1 -1
- package/dist/presets/identity-refusal.js +1 -1
- package/dist/presets/identity-refusal.js.map +1 -1
- package/dist/presets/identity-terms.d.ts.map +1 -1
- package/dist/presets/identity-terms.js +30 -0
- package/dist/presets/identity-terms.js.map +1 -1
- package/dist/presets/preset-files.d.ts.map +1 -1
- package/dist/presets/preset-files.js +4 -1
- package/dist/presets/preset-files.js.map +1 -1
- package/dist/refusals/aggregates-of.d.ts +10 -0
- package/dist/refusals/aggregates-of.d.ts.map +1 -0
- package/dist/refusals/aggregates-of.js +9 -0
- package/dist/refusals/aggregates-of.js.map +1 -0
- package/dist/refusals/applied-moves.d.ts +7 -0
- package/dist/refusals/applied-moves.d.ts.map +1 -0
- package/dist/refusals/applied-moves.js +2 -0
- package/dist/refusals/applied-moves.js.map +1 -0
- package/dist/refusals/apply-named-plan.d.ts +19 -0
- package/dist/refusals/apply-named-plan.d.ts.map +1 -0
- package/dist/refusals/apply-named-plan.js +46 -0
- package/dist/refusals/apply-named-plan.js.map +1 -0
- package/dist/refusals/apply-plan.d.ts.map +1 -1
- package/dist/refusals/apply-plan.js +21 -25
- package/dist/refusals/apply-plan.js.map +1 -1
- package/dist/refusals/code-without-imports.d.ts +3 -0
- package/dist/refusals/code-without-imports.d.ts.map +1 -0
- package/dist/refusals/code-without-imports.js +9 -0
- package/dist/refusals/code-without-imports.js.map +1 -0
- package/dist/refusals/concept-error-class.d.ts +26 -0
- package/dist/refusals/concept-error-class.d.ts.map +1 -0
- package/dist/refusals/concept-error-class.js +2 -0
- package/dist/refusals/concept-error-class.js.map +1 -0
- package/dist/refusals/concept-errors.d.ts +6 -0
- package/dist/refusals/concept-errors.d.ts.map +1 -0
- package/dist/refusals/concept-errors.js +16 -0
- package/dist/refusals/concept-errors.js.map +1 -0
- package/dist/refusals/concept-imports.d.ts +8 -0
- package/dist/refusals/concept-imports.d.ts.map +1 -0
- package/dist/refusals/concept-imports.js +33 -0
- package/dist/refusals/concept-imports.js.map +1 -0
- package/dist/refusals/concept-leftovers.d.ts +5 -0
- package/dist/refusals/concept-leftovers.d.ts.map +1 -0
- package/dist/refusals/concept-leftovers.js +26 -0
- package/dist/refusals/concept-leftovers.js.map +1 -0
- package/dist/refusals/concept-named.d.ts +3 -0
- package/dist/refusals/concept-named.d.ts.map +1 -0
- package/dist/refusals/concept-named.js +13 -0
- package/dist/refusals/concept-named.js.map +1 -0
- package/dist/refusals/concerns.d.ts +16 -0
- package/dist/refusals/concerns.d.ts.map +1 -0
- package/dist/refusals/concerns.js +9 -0
- package/dist/refusals/concerns.js.map +1 -0
- package/dist/refusals/cut-factories.d.ts +7 -0
- package/dist/refusals/cut-factories.d.ts.map +1 -0
- package/dist/refusals/cut-factories.js +30 -0
- package/dist/refusals/cut-factories.js.map +1 -0
- package/dist/refusals/earlier-guidance.d.ts +8 -0
- package/dist/refusals/earlier-guidance.d.ts.map +1 -0
- package/dist/refusals/earlier-guidance.js +21 -0
- package/dist/refusals/earlier-guidance.js.map +1 -0
- package/dist/refusals/factory-for-parameter.d.ts +7 -0
- package/dist/refusals/factory-for-parameter.d.ts.map +1 -0
- package/dist/refusals/factory-for-parameter.js +17 -0
- package/dist/refusals/factory-for-parameter.js.map +1 -0
- package/dist/refusals/first-parameter.d.ts +6 -0
- package/dist/refusals/first-parameter.d.ts.map +1 -0
- package/dist/refusals/first-parameter.js +12 -0
- package/dist/refusals/first-parameter.js.map +1 -0
- package/dist/refusals/ignore-code-types.d.ts +10 -0
- package/dist/refusals/ignore-code-types.d.ts.map +1 -0
- package/dist/refusals/ignore-code-types.js +53 -0
- package/dist/refusals/ignore-code-types.js.map +1 -0
- package/dist/refusals/imports-used-by.d.ts +6 -0
- package/dist/refusals/imports-used-by.d.ts.map +1 -0
- package/dist/refusals/imports-used-by.js +32 -0
- package/dist/refusals/imports-used-by.js.map +1 -0
- package/dist/refusals/leave-origins.d.ts +10 -0
- package/dist/refusals/leave-origins.d.ts.map +1 -0
- package/dist/refusals/leave-origins.js +35 -0
- package/dist/refusals/leave-origins.js.map +1 -0
- package/dist/refusals/legacy-move.d.ts +5 -0
- package/dist/refusals/legacy-move.d.ts.map +1 -0
- package/dist/refusals/legacy-move.js +14 -0
- package/dist/refusals/legacy-move.js.map +1 -0
- package/dist/refusals/markdown-files.d.ts +4 -0
- package/dist/refusals/markdown-files.d.ts.map +1 -0
- package/dist/refusals/markdown-files.js +13 -0
- package/dist/refusals/markdown-files.js.map +1 -0
- package/dist/refusals/member-start.d.ts +3 -0
- package/dist/refusals/member-start.d.ts.map +1 -0
- package/dist/refusals/member-start.js +14 -0
- package/dist/refusals/member-start.js.map +1 -0
- package/dist/refusals/migration-targets.d.ts +3 -0
- package/dist/refusals/migration-targets.d.ts.map +1 -0
- package/dist/refusals/migration-targets.js +3 -0
- package/dist/refusals/migration-targets.js.map +1 -0
- package/dist/refusals/move-named-specs.d.ts +16 -0
- package/dist/refusals/move-named-specs.d.ts.map +1 -0
- package/dist/refusals/move-named-specs.js +119 -0
- package/dist/refusals/move-named-specs.js.map +1 -0
- package/dist/refusals/move.d.ts +6 -1
- package/dist/refusals/move.d.ts.map +1 -1
- package/dist/refusals/named-move.d.ts +23 -0
- package/dist/refusals/named-move.d.ts.map +1 -0
- package/dist/refusals/named-move.js +2 -0
- package/dist/refusals/named-move.js.map +1 -0
- package/dist/refusals/named-moves.d.ts +10 -0
- package/dist/refusals/named-moves.d.ts.map +1 -0
- package/dist/refusals/named-moves.js +64 -0
- package/dist/refusals/named-moves.js.map +1 -0
- package/dist/refusals/named-plan.d.ts +7 -0
- package/dist/refusals/named-plan.d.ts.map +1 -0
- package/dist/refusals/named-plan.js +2 -0
- package/dist/refusals/named-plan.js.map +1 -0
- package/dist/refusals/own-factory.d.ts +14 -0
- package/dist/refusals/own-factory.d.ts.map +1 -0
- package/dist/refusals/own-factory.js +38 -0
- package/dist/refusals/own-factory.js.map +1 -0
- package/dist/refusals/plan-target.d.ts +7 -0
- package/dist/refusals/plan-target.d.ts.map +1 -0
- package/dist/refusals/plan-target.js +13 -0
- package/dist/refusals/plan-target.js.map +1 -0
- package/dist/refusals/planned-refusal.d.ts +13 -0
- package/dist/refusals/planned-refusal.d.ts.map +1 -0
- package/dist/refusals/planned-refusal.js +2 -0
- package/dist/refusals/planned-refusal.js.map +1 -0
- package/dist/refusals/propose-named-plan.d.ts +25 -0
- package/dist/refusals/propose-named-plan.d.ts.map +1 -0
- package/dist/refusals/propose-named-plan.js +67 -0
- package/dist/refusals/propose-named-plan.js.map +1 -0
- package/dist/refusals/propose-plan.d.ts.map +1 -1
- package/dist/refusals/propose-plan.js +3 -19
- package/dist/refusals/propose-plan.js.map +1 -1
- package/dist/refusals/read-concept-error.d.ts +9 -0
- package/dist/refusals/read-concept-error.d.ts.map +1 -0
- package/dist/refusals/read-concept-error.js +51 -0
- package/dist/refusals/read-concept-error.js.map +1 -0
- package/dist/refusals/read-named-plan.d.ts +4 -0
- package/dist/refusals/read-named-plan.d.ts.map +1 -0
- package/dist/refusals/read-named-plan.js +57 -0
- package/dist/refusals/read-named-plan.js.map +1 -0
- package/dist/refusals/refusal-class-file.d.ts +15 -0
- package/dist/refusals/refusal-class-file.d.ts.map +1 -0
- package/dist/refusals/refusal-class-file.js +38 -0
- package/dist/refusals/refusal-class-file.js.map +1 -0
- package/dist/refusals/rename-concept.d.ts +7 -0
- package/dist/refusals/rename-concept.d.ts.map +1 -0
- package/dist/refusals/rename-concept.js +15 -0
- package/dist/refusals/rename-concept.js.map +1 -0
- package/dist/refusals/render-factory.d.ts +1 -1
- package/dist/refusals/render-factory.d.ts.map +1 -1
- package/dist/refusals/render-factory.js +3 -2
- package/dist/refusals/render-factory.js.map +1 -1
- package/dist/refusals/rewrite-concept-usages.d.ts +11 -0
- package/dist/refusals/rewrite-concept-usages.d.ts.map +1 -0
- package/dist/refusals/rewrite-concept-usages.js +61 -0
- package/dist/refusals/rewrite-concept-usages.js.map +1 -0
- package/dist/refusals/rewrite-named-usages.d.ts +9 -0
- package/dist/refusals/rewrite-named-usages.d.ts.map +1 -0
- package/dist/refusals/rewrite-named-usages.js +14 -0
- package/dist/refusals/rewrite-named-usages.js.map +1 -0
- package/dist/refusals/rewrite-usages.d.ts.map +1 -1
- package/dist/refusals/rewrite-usages.js +10 -6
- package/dist/refusals/rewrite-usages.js.map +1 -1
- package/dist/refusals/say-refusals.d.ts +3 -0
- package/dist/refusals/say-refusals.d.ts.map +1 -0
- package/dist/refusals/say-refusals.js +8 -0
- package/dist/refusals/say-refusals.js.map +1 -0
- package/dist/refusals/split-concept-spec.d.ts +19 -0
- package/dist/refusals/split-concept-spec.d.ts.map +1 -0
- package/dist/refusals/split-concept-spec.js +74 -0
- package/dist/refusals/split-concept-spec.js.map +1 -0
- package/dist/refusals/stale-mentions.d.ts +10 -0
- package/dist/refusals/stale-mentions.d.ts.map +1 -0
- package/dist/refusals/stale-mentions.js +41 -0
- package/dist/refusals/stale-mentions.js.map +1 -0
- package/dist/refusals/undefined-words.d.ts +15 -0
- package/dist/refusals/undefined-words.d.ts.map +1 -0
- package/dist/refusals/undefined-words.js +26 -0
- package/dist/refusals/undefined-words.js.map +1 -0
- package/dist/refusals/with-codes.d.ts +11 -0
- package/dist/refusals/with-codes.d.ts.map +1 -0
- package/dist/refusals/with-codes.js +46 -0
- package/dist/refusals/with-codes.js.map +1 -0
- package/dist/refusals/with-imports.d.ts +3 -0
- package/dist/refusals/with-imports.d.ts.map +1 -0
- package/dist/refusals/with-imports.js +8 -0
- package/dist/refusals/with-imports.js.map +1 -0
- package/dist/refusals/write-refusal-classes.d.ts +9 -0
- package/dist/refusals/write-refusal-classes.d.ts.map +1 -0
- package/dist/refusals/write-refusal-classes.js +23 -0
- package/dist/refusals/write-refusal-classes.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -0
- package/dist/run.js.map +1 -1
- package/dist/stack/stack-vars.js +1 -1
- 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 +2 -2
- package/templates/aggregate/aggregate.ts.tpl +3 -0
- package/templates/aggregate/event-sourced.aggregate.ts.tpl +3 -0
- package/templates/command/handler.declared.ts.tpl +3 -0
- package/templates/command/handler.ts.tpl +3 -0
- package/templates/entity/entity.ts.tpl +3 -0
- package/templates/error/codes.ts.tpl +5 -0
- package/templates/error/refusal-case.spec.ts.tpl +8 -0
- package/templates/error/refusal-factory.ts.tpl +4 -0
- package/templates/error/refusal.spec.ts.tpl +7 -0
- package/templates/error/refusal.ts.tpl +8 -0
- package/templates/init/rules/domain.md.tpl +9 -2
- package/templates/init/rules/presentation.md.tpl +3 -0
- package/templates/pipeline/knip.json.tpl +5 -0
- package/templates/pipeline/package-scripts.json +3 -3
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +22 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +16 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +16 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +16 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +10 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +16 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +10 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +16 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +10 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/aggregates/account.aggregate.ts.tpl +16 -0
- package/templates/presets/identity/context/domain/aggregates/delegation.aggregate.ts.tpl +28 -0
- package/templates/presets/identity/context/domain/aggregates/invitation.aggregate.ts.tpl +27 -0
- package/templates/presets/identity/context/domain/aggregates/member.aggregate.ts.tpl +31 -0
- package/templates/presets/identity/context/domain/errors/above-own-role.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/account-already-deactivated.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/already-member.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/codes.named.ts.tpl +33 -0
- package/templates/presets/identity/context/domain/errors/deactivated-account.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/delegation-not-active.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/delegation-period-inverted.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/delegation-to-oneself.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/delegation-too-long.error.named.ts.tpl +12 -0
- package/templates/presets/identity/context/domain/errors/delegation-with-no-right.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/email-not-verified.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/invalid-display-name.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/invalid-email-address.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/invalid-organisation-name.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/invalid-organisation-slug.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/invitation-expired.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/invitation-not-addressed-to-account.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/invitation-not-pending.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/last-owner.error.named.ts.tpl +12 -0
- package/templates/presets/identity/context/domain/errors/not-an-owner.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/organisation-slug-taken.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/own-role.error.named.ts.tpl +12 -0
- package/templates/presets/identity/context/domain/errors/right-not-in-role.error.named.ts.tpl +12 -0
- package/templates/presets/identity/context/domain/errors/unknown-account.error.named.ts.tpl +12 -0
- package/templates/presets/identity/context/domain/errors/unknown-delegation.error.named.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/errors/unknown-invitation.error.named.ts.tpl +11 -0
- package/templates/presets/identity/context/domain/errors/unknown-member.error.named.ts.tpl +13 -0
- package/templates/presets/identity/context/domain/errors/unknown-organisation.error.named.ts.tpl +12 -0
- package/templates/presets/identity/context/domain/value-objects/delegation-period.vo.ts.tpl +16 -0
- package/templates/presets/identity/context/domain/value-objects/display-name.vo.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/value-objects/email-address.vo.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/value-objects/organisation-name.vo.ts.tpl +10 -0
- package/templates/presets/identity/context/domain/value-objects/organisation-slug.vo.ts.tpl +10 -0
- package/templates/state-machine/state-machine.ts.tpl +5 -0
- package/templates/value-object/value-object.ts.tpl +6 -0
- /package/templates/presets/identity/context/domain/errors/{account.error.ts.tpl → account.error.factories.ts.tpl} +0 -0
- /package/templates/presets/identity/context/domain/errors/{delegation.error.ts.tpl → delegation.error.factories.ts.tpl} +0 -0
- /package/templates/presets/identity/context/domain/errors/{invitation.error.ts.tpl → invitation.error.factories.ts.tpl} +0 -0
- /package/templates/presets/identity/context/domain/errors/{member.error.ts.tpl → member.error.factories.ts.tpl} +0 -0
- /package/templates/presets/identity/context/domain/errors/{organisation.error.ts.tpl → organisation.error.factories.ts.tpl} +0 -0
package/templates/presets/identity/context/domain/errors/invitation-not-pending.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}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class InvitationNotPending extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.InvitationNotPending;
|
|
6
|
+
|
|
7
|
+
static forInvitation(invitationId: string, status: string) {
|
|
8
|
+
return InvitationNotPending.refusal(`The invitation ${invitationId} is already ${status}.`, {
|
|
9
|
+
invitationId,
|
|
10
|
+
status,
|
|
11
|
+
}).exposing('status');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class LastOwner extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.LastOwner;
|
|
6
|
+
|
|
7
|
+
static forOrganisation(organisationId: string) {
|
|
8
|
+
return LastOwner.refusal(`${organisationId} keeps at least one owner.`, {
|
|
9
|
+
organisationId,
|
|
10
|
+
}).exposing('organisationId');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class NotAnOwner extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.NotAnOwner;
|
|
6
|
+
|
|
7
|
+
static forOrganisation(organisationId: string) {
|
|
8
|
+
return NotAnOwner.refusal(`Only an owner of ${organisationId} appoints or changes an owner.`, { organisationId });
|
|
9
|
+
}
|
|
10
|
+
}
|
package/templates/presets/identity/context/domain/errors/organisation-slug-taken.error.named.ts.tpl
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class OrganisationSlugTaken extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.OrganisationSlugTaken;
|
|
6
|
+
|
|
7
|
+
static forSlug(slug: string) {
|
|
8
|
+
return OrganisationSlugTaken.refusal(`An organisation is already named ${slug}.`, { slug }).exposing('slug');
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class OwnRole extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.OwnRole;
|
|
6
|
+
|
|
7
|
+
static forOrganisation(organisationId: string) {
|
|
8
|
+
return OwnRole.refusal(`A member of ${organisationId} does not change their own role: another member does.`, {
|
|
9
|
+
organisationId,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class RightNotInRole extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.RightNotInRole;
|
|
6
|
+
|
|
7
|
+
static forRight(right: string) {
|
|
8
|
+
return RightNotInRole.refusal(`A member lends only the rights they hold: ${right}.`, {
|
|
9
|
+
right,
|
|
10
|
+
}).exposing('right');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class UnknownAccount extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.UnknownAccount;
|
|
6
|
+
|
|
7
|
+
static forAccount(accountId: string) {
|
|
8
|
+
return UnknownAccount.refusal(`No account ${accountId}: the person signs in once before acting.`, {
|
|
9
|
+
accountId,
|
|
10
|
+
}).exposing('accountId');
|
|
11
|
+
}
|
|
12
|
+
}
|
package/templates/presets/identity/context/domain/errors/unknown-delegation.error.named.ts.tpl
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class UnknownDelegation extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.UnknownDelegation;
|
|
6
|
+
|
|
7
|
+
static forDelegation(delegationId: string) {
|
|
8
|
+
return UnknownDelegation.refusal(`No delegation ${delegationId}.`, { delegationId }).exposing('delegationId');
|
|
9
|
+
}
|
|
10
|
+
}
|
package/templates/presets/identity/context/domain/errors/unknown-invitation.error.named.ts.tpl
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
/** No invitation answers the token or the identifier given. The token of an invitation is never a fact of a refusal. */
|
|
5
|
+
export class UnknownInvitation extends DomainRefusal {
|
|
6
|
+
readonly code = {{context.pascal}}Codes.UnknownInvitation;
|
|
7
|
+
|
|
8
|
+
static forReference() {
|
|
9
|
+
return UnknownInvitation.refusal('No invitation answers this token or this identifier.');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class UnknownMember extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.UnknownMember;
|
|
6
|
+
|
|
7
|
+
static forMembership(organisationId: string, accountId: string) {
|
|
8
|
+
return UnknownMember.refusal(`The account ${accountId} is not a member of ${organisationId}.`, {
|
|
9
|
+
organisationId,
|
|
10
|
+
accountId,
|
|
11
|
+
}).exposing('organisationId', 'accountId');
|
|
12
|
+
}
|
|
13
|
+
}
|
package/templates/presets/identity/context/domain/errors/unknown-organisation.error.named.ts.tpl
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DomainRefusal } from '@ddd-ts-kit/kernel';
|
|
2
|
+
import { {{context.pascal}}Codes } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
|
|
3
|
+
|
|
4
|
+
export class UnknownOrganisation extends DomainRefusal {
|
|
5
|
+
readonly code = {{context.pascal}}Codes.UnknownOrganisation;
|
|
6
|
+
|
|
7
|
+
static forOrganisation(organisationId: string) {
|
|
8
|
+
return UnknownOrganisation.refusal(`No organisation ${organisationId}.`, {
|
|
9
|
+
organisationId,
|
|
10
|
+
}).exposing('organisationId');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { ValueObject } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#unless refusals.named}}
|
|
2
3
|
import { DelegationError } from '{{alias.context}}/domain/errors/delegation.error{{alias.ext}}';
|
|
4
|
+
{{/unless}}
|
|
5
|
+
{{#if refusals.named}}
|
|
6
|
+
import { DelegationPeriodInverted } from '{{alias.context}}/domain/errors/delegation-period-inverted.error{{alias.ext}}';
|
|
7
|
+
import { DelegationTooLong } from '{{alias.context}}/domain/errors/delegation-too-long.error{{alias.ext}}';
|
|
8
|
+
{{/if}}
|
|
3
9
|
|
|
4
10
|
/** A delegation is a stand-in for an absence: past this, the right belongs in a role. */
|
|
5
11
|
const LONGEST_DAYS = 90;
|
|
@@ -18,11 +24,21 @@ export class DelegationPeriod extends ValueObject<DelegationPeriodProps> {
|
|
|
18
24
|
|
|
19
25
|
static create(startsAt: Date, endsAt: Date): DelegationPeriod {
|
|
20
26
|
if (endsAt.getTime() <= startsAt.getTime()) {
|
|
27
|
+
{{#if refusals.named}}
|
|
28
|
+
throw DelegationPeriodInverted.forPeriod(startsAt, endsAt);
|
|
29
|
+
{{/if}}
|
|
30
|
+
{{#unless refusals.named}}
|
|
21
31
|
throw DelegationError.periodInverted(startsAt, endsAt);
|
|
32
|
+
{{/unless}}
|
|
22
33
|
}
|
|
23
34
|
|
|
24
35
|
if (endsAt.getTime() - startsAt.getTime() > LONGEST_DAYS * DAY_MS) {
|
|
36
|
+
{{#if refusals.named}}
|
|
37
|
+
throw DelegationTooLong.withLongestDays(LONGEST_DAYS);
|
|
38
|
+
{{/if}}
|
|
39
|
+
{{#unless refusals.named}}
|
|
25
40
|
throw DelegationError.tooLong(LONGEST_DAYS);
|
|
41
|
+
{{/unless}}
|
|
26
42
|
}
|
|
27
43
|
|
|
28
44
|
return new DelegationPeriod({ startsAt, endsAt });
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ValueObject } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#unless refusals.named}}
|
|
2
3
|
import { AccountError } from '{{alias.context}}/domain/errors/account.error{{alias.ext}}';
|
|
4
|
+
{{/unless}}
|
|
5
|
+
{{#if refusals.named}}
|
|
6
|
+
import { InvalidDisplayName } from '{{alias.context}}/domain/errors/invalid-display-name.error{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
3
8
|
|
|
4
9
|
const LONGEST = 100;
|
|
5
10
|
|
|
@@ -17,7 +22,12 @@ export class DisplayName extends ValueObject<DisplayNameProps> {
|
|
|
17
22
|
const value = raw.trim();
|
|
18
23
|
|
|
19
24
|
if (value.length === 0 || value.length > LONGEST) {
|
|
25
|
+
{{#if refusals.named}}
|
|
26
|
+
throw InvalidDisplayName.forValue(raw);
|
|
27
|
+
{{/if}}
|
|
28
|
+
{{#unless refusals.named}}
|
|
20
29
|
throw AccountError.invalidDisplayName(raw);
|
|
30
|
+
{{/unless}}
|
|
21
31
|
}
|
|
22
32
|
|
|
23
33
|
return new DisplayName({ value });
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ValueObject } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#unless refusals.named}}
|
|
2
3
|
import { AccountError } from '{{alias.context}}/domain/errors/account.error{{alias.ext}}';
|
|
4
|
+
{{/unless}}
|
|
5
|
+
{{#if refusals.named}}
|
|
6
|
+
import { InvalidEmailAddress } from '{{alias.context}}/domain/errors/invalid-email-address.error{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
3
8
|
|
|
4
9
|
/** The longest address the standards allow (RFC 5321, a path of 256 characters and its two brackets). */
|
|
5
10
|
const LONGEST = 254;
|
|
@@ -19,7 +24,12 @@ export class EmailAddress extends ValueObject<EmailAddressProps> {
|
|
|
19
24
|
const value = raw.trim().toLowerCase();
|
|
20
25
|
|
|
21
26
|
if (value.length > LONGEST || !SHAPE.test(value)) {
|
|
27
|
+
{{#if refusals.named}}
|
|
28
|
+
throw InvalidEmailAddress.forValue(raw);
|
|
29
|
+
{{/if}}
|
|
30
|
+
{{#unless refusals.named}}
|
|
22
31
|
throw AccountError.invalidEmailAddress(raw);
|
|
32
|
+
{{/unless}}
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
return new EmailAddress({ value });
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ValueObject } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#unless refusals.named}}
|
|
2
3
|
import { OrganisationError } from '{{alias.context}}/domain/errors/organisation.error{{alias.ext}}';
|
|
4
|
+
{{/unless}}
|
|
5
|
+
{{#if refusals.named}}
|
|
6
|
+
import { InvalidOrganisationName } from '{{alias.context}}/domain/errors/invalid-organisation-name.error{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
3
8
|
|
|
4
9
|
const LONGEST = 100;
|
|
5
10
|
|
|
@@ -17,7 +22,12 @@ export class OrganisationName extends ValueObject<OrganisationNameProps> {
|
|
|
17
22
|
const value = raw.trim();
|
|
18
23
|
|
|
19
24
|
if (value.length === 0 || value.length > LONGEST) {
|
|
25
|
+
{{#if refusals.named}}
|
|
26
|
+
throw InvalidOrganisationName.forValue(raw);
|
|
27
|
+
{{/if}}
|
|
28
|
+
{{#unless refusals.named}}
|
|
20
29
|
throw OrganisationError.invalidOrganisationName(raw);
|
|
30
|
+
{{/unless}}
|
|
21
31
|
}
|
|
22
32
|
|
|
23
33
|
return new OrganisationName({ value });
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ValueObject } from '@ddd-ts-kit/kernel';
|
|
2
|
+
{{#unless refusals.named}}
|
|
2
3
|
import { OrganisationError } from '{{alias.context}}/domain/errors/organisation.error{{alias.ext}}';
|
|
4
|
+
{{/unless}}
|
|
5
|
+
{{#if refusals.named}}
|
|
6
|
+
import { InvalidOrganisationSlug } from '{{alias.context}}/domain/errors/invalid-organisation-slug.error{{alias.ext}}';
|
|
7
|
+
{{/if}}
|
|
3
8
|
|
|
4
9
|
/** Lower-case letters, digits and hyphens, at most 63: a slug is also a valid tenant id and a valid alias of the identity provider. */
|
|
5
10
|
const SHAPE = /^[a-z0-9][a-z0-9-]{1,62}$/;
|
|
@@ -18,7 +23,12 @@ export class OrganisationSlug extends ValueObject<OrganisationSlugProps> {
|
|
|
18
23
|
const value = raw.trim().toLowerCase();
|
|
19
24
|
|
|
20
25
|
if (!SHAPE.test(value)) {
|
|
26
|
+
{{#if refusals.named}}
|
|
27
|
+
throw InvalidOrganisationSlug.forValue(raw);
|
|
28
|
+
{{/if}}
|
|
29
|
+
{{#unless refusals.named}}
|
|
21
30
|
throw OrganisationError.invalidOrganisationSlug(raw);
|
|
31
|
+
{{/unless}}
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
return new OrganisationSlug({ value });
|
|
@@ -12,5 +12,10 @@ export const {{machine.constant}} = defineStateMachine({
|
|
|
12
12
|
// TODO(domain): one transition per intention method of {{aggregate.pascal}}, named after it: `issue: { from: [{{machine.initial}}], to: <state> }`; a transition without `to` keeps its state, a `guard` refuses what the status alone does not decide.
|
|
13
13
|
{{/unless}}
|
|
14
14
|
},
|
|
15
|
+
{{#if refusals.named}}
|
|
16
|
+
// TODO(domain): refuse a forbidden transition with a static factory of the refusal named after it, `refused: ({ from, transition }, context) => <Refusal>.for<Fact>(...)` (`ddd-ts-kit generate error {{context.kebab}} <Refusal> <factory>`); until then the refusal is TransitionError.forbidden, code FORBIDDEN_TRANSITION.
|
|
17
|
+
{{/if}}
|
|
18
|
+
{{#unless refusals.named}}
|
|
15
19
|
// TODO(domain): refuse a forbidden transition with a static factory of {{aggregate.pascal}}Error, `refused: ({ from, transition }, context) => {{aggregate.pascal}}Error.<refusal>(...)`; until then the refusal is TransitionError.forbidden, code FORBIDDEN_TRANSITION.
|
|
20
|
+
{{/unless}}
|
|
16
21
|
});
|
|
@@ -16,6 +16,9 @@ export class {{name.pascal}} extends ValueObject<{{name.pascal}}Props> {
|
|
|
16
16
|
|
|
17
17
|
{{#if valueObjects.throwing}}
|
|
18
18
|
static create(value: string): {{name.pascal}} {
|
|
19
|
+
{{#if refusals.named}}
|
|
20
|
+
// TODO(domain): replace `value: string` by the real components of {{name.pascal}}, normalize them and check every validity rule; throw the refusal named after the rule, for example `Invalid{{name.pascal}}.forValue(value)` (`ddd-ts-kit generate error {{context.kebab}} Invalid{{name.pascal}} forValue`), instead of InvariantViolation.
|
|
21
|
+
{{/if}}
|
|
19
22
|
{{#if refusals.factories}}
|
|
20
23
|
// TODO(domain): replace `value: string` by the real components of {{name.pascal}}, normalize them and check every validity rule; throw a refusal of the concept this value describes, for example `<Concept>Error.invalid{{name.pascal}}(value)` (`ddd-ts-kit generate error {{context.kebab}} <Concept> invalid{{name.pascal}}`), instead of InvariantViolation.
|
|
21
24
|
{{/if}}
|
|
@@ -31,6 +34,9 @@ export class {{name.pascal}} extends ValueObject<{{name.pascal}}Props> {
|
|
|
31
34
|
{{/if}}
|
|
32
35
|
{{#if valueObjects.result}}
|
|
33
36
|
static create(value: string): Result<{{name.pascal}}, InvariantViolation> {
|
|
37
|
+
{{#if refusals.named}}
|
|
38
|
+
// TODO(domain): replace `value: string` by the real components of {{name.pascal}}, normalize them and check every validity rule; return `err(...)` with the refusal named after the rule, for example `Invalid{{name.pascal}}.forValue(value)` (`ddd-ts-kit generate error {{context.kebab}} Invalid{{name.pascal}} forValue`), instead of InvariantViolation.
|
|
39
|
+
{{/if}}
|
|
34
40
|
{{#if refusals.factories}}
|
|
35
41
|
// TODO(domain): replace `value: string` by the real components of {{name.pascal}}, normalize them and check every validity rule; return `err(...)` with a refusal of the concept this value describes, for example `<Concept>Error.invalid{{name.pascal}}(value)` (`ddd-ts-kit generate error {{context.kebab}} <Concept> invalid{{name.pascal}}`), instead of InvariantViolation.
|
|
36
42
|
{{/if}}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|