ddd-ts-kit 0.1.1 → 0.2.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/README.md +81 -21
- package/dist/alias/compiler-resolution-of.d.ts +10 -0
- package/dist/alias/compiler-resolution-of.d.ts.map +1 -0
- package/dist/alias/compiler-resolution-of.js +13 -0
- package/dist/alias/compiler-resolution-of.js.map +1 -0
- package/dist/alias/compiler-resolution.d.ts +8 -0
- package/dist/alias/compiler-resolution.d.ts.map +1 -0
- package/dist/alias/compiler-resolution.js +2 -0
- package/dist/alias/compiler-resolution.js.map +1 -0
- package/dist/alias/index.d.ts +3 -1
- package/dist/alias/index.d.ts.map +1 -1
- package/dist/alias/index.js +3 -1
- package/dist/alias/index.js.map +1 -1
- package/dist/alias/module-name-mapper.d.ts +4 -3
- package/dist/alias/module-name-mapper.d.ts.map +1 -1
- package/dist/alias/module-name-mapper.js +6 -4
- package/dist/alias/module-name-mapper.js.map +1 -1
- package/dist/alias/specifier-of.d.ts +7 -0
- package/dist/alias/specifier-of.d.ts.map +1 -0
- package/dist/alias/specifier-of.js +17 -0
- package/dist/alias/specifier-of.js.map +1 -0
- package/dist/alias/specifier-suffix.d.ts +6 -0
- package/dist/alias/specifier-suffix.d.ts.map +1 -0
- package/dist/alias/specifier-suffix.js +8 -0
- package/dist/alias/specifier-suffix.js.map +1 -0
- package/dist/alias/to-alias.d.ts +3 -2
- package/dist/alias/to-alias.d.ts.map +1 -1
- package/dist/alias/to-alias.js +4 -3
- package/dist/alias/to-alias.js.map +1 -1
- package/dist/build/emitted-place.d.ts +2 -0
- package/dist/build/emitted-place.d.ts.map +1 -1
- package/dist/build/emitted-specifier.d.ts +3 -2
- package/dist/build/emitted-specifier.d.ts.map +1 -1
- package/dist/build/emitted-specifier.js +6 -12
- package/dist/build/emitted-specifier.js.map +1 -1
- package/dist/build/emitted-target.d.ts +9 -0
- package/dist/build/emitted-target.d.ts.map +1 -0
- package/dist/build/emitted-target.js +18 -0
- package/dist/build/emitted-target.js.map +1 -0
- package/dist/build/rewrite-aliases.d.ts +5 -3
- package/dist/build/rewrite-aliases.d.ts.map +1 -1
- package/dist/build/rewrite-aliases.js +12 -7
- package/dist/build/rewrite-aliases.js.map +1 -1
- package/dist/build/rewrite-specifiers.d.ts +3 -1
- package/dist/build/rewrite-specifiers.d.ts.map +1 -1
- package/dist/build/rewrite-specifiers.js +2 -2
- package/dist/build/rewrite-specifiers.js.map +1 -1
- package/dist/build/unresolved-problem.d.ts +4 -0
- package/dist/build/unresolved-problem.d.ts.map +1 -0
- package/dist/build/unresolved-problem.js +16 -0
- package/dist/build/unresolved-problem.js.map +1 -0
- package/dist/check/alias/compiler-resolution.d.ts +10 -0
- package/dist/check/alias/compiler-resolution.d.ts.map +1 -0
- package/dist/check/alias/compiler-resolution.js +47 -0
- package/dist/check/alias/compiler-resolution.js.map +1 -0
- package/dist/check/alias/test-runners.js +4 -4
- package/dist/check/alias/test-runners.js.map +1 -1
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +6 -0
- 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 +4 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/configuration/config-inspection.d.ts +2 -0
- package/dist/check/configuration/config-inspection.d.ts.map +1 -1
- package/dist/check/configuration/config-inspection.js +11 -1
- package/dist/check/configuration/config-inspection.js.map +1 -1
- package/dist/check/declarations/classes-of.js +1 -1
- package/dist/check/declarations/classes-of.js.map +1 -1
- package/dist/check/explain/context-docs.js +7 -7
- package/dist/check/explain/context-docs.js.map +1 -1
- package/dist/check/explain/imports-docs.d.ts.map +1 -1
- package/dist/check/explain/imports-docs.js +24 -9
- package/dist/check/explain/imports-docs.js.map +1 -1
- package/dist/check/explain/layer-docs.js +7 -7
- package/dist/check/explain/layer-docs.js.map +1 -1
- package/dist/check/explain/ports-docs.d.ts.map +1 -1
- package/dist/check/explain/ports-docs.js +15 -7
- package/dist/check/explain/ports-docs.js.map +1 -1
- package/dist/check/explain/scheduling-docs.js +1 -1
- package/dist/check/explain/wiring-docs.d.ts.map +1 -1
- package/dist/check/explain/wiring-docs.js +35 -10
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js +32 -1
- package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/config-fixtures.js +6 -0
- package/dist/check/fixtures/config-fixtures.js.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts +3 -0
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/constructor-injection-fixtures.js +111 -0
- package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -0
- package/dist/check/fixtures/declared-project.d.ts.map +1 -1
- package/dist/check/fixtures/declared-project.js +4 -1
- package/dist/check/fixtures/declared-project.js.map +1 -1
- package/dist/check/fixtures/extension-fixtures.d.ts +3 -0
- package/dist/check/fixtures/extension-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/extension-fixtures.js +77 -0
- package/dist/check/fixtures/extension-fixtures.js.map +1 -0
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +4 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/signature-project.d.ts +11 -0
- package/dist/check/fixtures/signature-project.d.ts.map +1 -0
- package/dist/check/fixtures/signature-project.js +21 -0
- package/dist/check/fixtures/signature-project.js.map +1 -0
- package/dist/check/fixtures/signature.d.ts +13 -0
- package/dist/check/fixtures/signature.d.ts.map +1 -0
- package/dist/check/fixtures/signature.js +24 -0
- package/dist/check/fixtures/signature.js.map +1 -0
- package/dist/check/project/beside-the-sources.d.ts +5 -0
- package/dist/check/project/beside-the-sources.d.ts.map +1 -0
- package/dist/check/project/beside-the-sources.js +21 -0
- package/dist/check/project/beside-the-sources.js.map +1 -0
- package/dist/check/project/resolve-import.d.ts.map +1 -1
- package/dist/check/project/resolve-import.js +4 -1
- package/dist/check/project/resolve-import.js.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.d.ts.map +1 -1
- package/dist/check/rules/clean-one-export-per-file.js +14 -8
- package/dist/check/rules/clean-one-export-per-file.js.map +1 -1
- package/dist/check/rules/config-valid.d.ts.map +1 -1
- package/dist/check/rules/config-valid.js +2 -1
- package/dist/check/rules/config-valid.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +34 -32
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/declarations-constructor-injection.d.ts +3 -0
- package/dist/check/rules/declarations-constructor-injection.d.ts.map +1 -0
- package/dist/check/rules/declarations-constructor-injection.js +58 -0
- package/dist/check/rules/declarations-constructor-injection.js.map +1 -0
- package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
- package/dist/check/rules/imports-alias-declared.js +3 -1
- package/dist/check/rules/imports-alias-declared.js.map +1 -1
- package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
- package/dist/check/rules/imports-alias-only.js +16 -29
- package/dist/check/rules/imports-alias-only.js.map +1 -1
- package/dist/check/rules/imports-extension.d.ts +3 -0
- package/dist/check/rules/imports-extension.d.ts.map +1 -0
- package/dist/check/rules/imports-extension.js +65 -0
- package/dist/check/rules/imports-extension.js.map +1 -0
- package/dist/check/rules/ports-no-concrete-dependency.d.ts.map +1 -1
- package/dist/check/rules/ports-no-concrete-dependency.js +43 -15
- package/dist/check/rules/ports-no-concrete-dependency.js.map +1 -1
- package/dist/check/rules/tree-closed.js +6 -4
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/commands/build-aliases.d.ts.map +1 -1
- package/dist/commands/build-aliases.js +5 -3
- package/dist/commands/build-aliases.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +17 -2
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commit/is-derived.d.ts.map +1 -1
- package/dist/commit/is-derived.js +5 -2
- package/dist/commit/is-derived.js.map +1 -1
- package/dist/config/config.d.ts +2 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/default-import-extension.d.ts +3 -0
- package/dist/config/default-import-extension.d.ts.map +1 -0
- package/dist/config/default-import-extension.js +3 -0
- package/dist/config/default-import-extension.js.map +1 -0
- package/dist/config/import-extensions.d.ts +3 -0
- package/dist/config/import-extensions.d.ts.map +1 -0
- package/dist/config/import-extensions.js +3 -0
- package/dist/config/import-extensions.js.map +1 -0
- package/dist/config/index.d.ts +4 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +4 -1
- package/dist/config/index.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/parse-stack.d.ts.map +1 -1
- package/dist/config/parse-stack.js +2 -1
- package/dist/config/parse-stack.js.map +1 -1
- package/dist/config/restack-config-text.d.ts +11 -0
- package/dist/config/restack-config-text.d.ts.map +1 -0
- package/dist/config/restack-config-text.js +31 -0
- package/dist/config/restack-config-text.js.map +1 -0
- package/dist/config/serialize-config.d.ts.map +1 -1
- package/dist/config/serialize-config.js +3 -6
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +8 -0
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +1 -0
- package/dist/config/stack.js.map +1 -1
- package/dist/config/unwritten-import-extension.d.ts +3 -0
- package/dist/config/unwritten-import-extension.d.ts.map +1 -0
- package/dist/config/unwritten-import-extension.js +3 -0
- package/dist/config/unwritten-import-extension.js.map +1 -0
- package/dist/config/written-stack.d.ts +8 -0
- package/dist/config/written-stack.d.ts.map +1 -0
- package/dist/config/written-stack.js +10 -0
- package/dist/config/written-stack.js.map +1 -0
- package/dist/declared/declared-role.d.ts.map +1 -1
- package/dist/declared/declared-role.js +1 -0
- package/dist/declared/declared-role.js.map +1 -1
- package/dist/declared/dependencies-file.d.ts +7 -0
- package/dist/declared/dependencies-file.d.ts.map +1 -0
- package/dist/declared/dependencies-file.js +9 -0
- package/dist/declared/dependencies-file.js.map +1 -0
- package/dist/declared/generated-drift.d.ts +7 -0
- package/dist/declared/generated-drift.d.ts.map +1 -0
- package/dist/declared/generated-drift.js +47 -0
- package/dist/declared/generated-drift.js.map +1 -0
- package/dist/declared/index.d.ts +8 -1
- package/dist/declared/index.d.ts.map +1 -1
- package/dist/declared/index.js +6 -1
- package/dist/declared/index.js.map +1 -1
- package/dist/declared/injection/class-injection.d.ts +19 -0
- package/dist/declared/injection/class-injection.d.ts.map +1 -0
- package/dist/declared/injection/class-injection.js +2 -0
- package/dist/declared/injection/class-injection.js.map +1 -0
- package/dist/declared/injection/constructor-of.d.ts +16 -0
- package/dist/declared/injection/constructor-of.d.ts.map +1 -0
- package/dist/declared/injection/constructor-of.js +33 -0
- package/dist/declared/injection/constructor-of.js.map +1 -0
- package/dist/declared/injection/context-injections.d.ts +8 -0
- package/dist/declared/injection/context-injections.d.ts.map +1 -0
- package/dist/declared/injection/context-injections.js +14 -0
- package/dist/declared/injection/context-injections.js.map +1 -0
- package/dist/declared/injection/declared-kind-of.d.ts +8 -0
- package/dist/declared/injection/declared-kind-of.d.ts.map +1 -0
- package/dist/declared/injection/declared-kind-of.js +12 -0
- package/dist/declared/injection/declared-kind-of.js.map +1 -0
- package/dist/declared/injection/exported-name-of.d.ts +4 -0
- package/dist/declared/injection/exported-name-of.d.ts.map +1 -0
- package/dist/declared/injection/exported-name-of.js +17 -0
- package/dist/declared/injection/exported-name-of.js.map +1 -0
- package/dist/declared/injection/language-types.d.ts +3 -0
- package/dist/declared/injection/language-types.d.ts.map +1 -0
- package/dist/declared/injection/language-types.js +32 -0
- package/dist/declared/injection/language-types.js.map +1 -0
- package/dist/declared/injection/local-names.d.ts +17 -0
- package/dist/declared/injection/local-names.d.ts.map +1 -0
- package/dist/declared/injection/local-names.js +41 -0
- package/dist/declared/injection/local-names.js.map +1 -0
- package/dist/declared/injection/parameter-shape.d.ts +11 -0
- package/dist/declared/injection/parameter-shape.d.ts.map +1 -0
- package/dist/declared/injection/parameter-shape.js +58 -0
- package/dist/declared/injection/parameter-shape.js.map +1 -0
- package/dist/declared/injection/raw-class-name.d.ts +7 -0
- package/dist/declared/injection/raw-class-name.d.ts.map +1 -0
- package/dist/declared/injection/raw-class-name.js +28 -0
- package/dist/declared/injection/raw-class-name.js.map +1 -0
- package/dist/declared/injection/read-constructor.d.ts +10 -0
- package/dist/declared/injection/read-constructor.d.ts.map +1 -0
- package/dist/declared/injection/read-constructor.js +2 -0
- package/dist/declared/injection/read-constructor.js.map +1 -0
- package/dist/declared/injection/read-injections.d.ts +6 -0
- package/dist/declared/injection/read-injections.d.ts.map +1 -0
- package/dist/declared/injection/read-injections.js +75 -0
- package/dist/declared/injection/read-injections.js.map +1 -0
- package/dist/declared/injection/render-injections.d.ts +11 -0
- package/dist/declared/injection/render-injections.d.ts.map +1 -0
- package/dist/declared/injection/render-injections.js +51 -0
- package/dist/declared/injection/render-injections.js.map +1 -0
- package/dist/declared/injection/rendered-injections.d.ts +8 -0
- package/dist/declared/injection/rendered-injections.d.ts.map +1 -0
- package/dist/declared/injection/rendered-injections.js +2 -0
- package/dist/declared/injection/rendered-injections.js.map +1 -0
- package/dist/declared/injection/resolve-token.d.ts +18 -0
- package/dist/declared/injection/resolve-token.d.ts.map +1 -0
- package/dist/declared/injection/resolve-token.js +46 -0
- package/dist/declared/injection/resolve-token.js.map +1 -0
- package/dist/declared/injection/resolved-token.d.ts +10 -0
- package/dist/declared/injection/resolved-token.d.ts.map +1 -0
- package/dist/declared/injection/resolved-token.js +2 -0
- package/dist/declared/injection/resolved-token.js.map +1 -0
- package/dist/declared/injection/sources.d.ts +4 -0
- package/dist/declared/injection/sources.d.ts.map +1 -0
- package/dist/declared/injection/sources.js +2 -0
- package/dist/declared/injection/sources.js.map +1 -0
- package/dist/declared/injection/token-reference.d.ts +14 -0
- package/dist/declared/injection/token-reference.d.ts.map +1 -0
- package/dist/declared/injection/token-reference.js +2 -0
- package/dist/declared/injection/token-reference.js.map +1 -0
- package/dist/declared/render-barrel.d.ts +8 -5
- package/dist/declared/render-barrel.d.ts.map +1 -1
- package/dist/declared/render-barrel.js +13 -6
- package/dist/declared/render-barrel.js.map +1 -1
- package/dist/declared/render-dependencies-file.d.ts +8 -0
- package/dist/declared/render-dependencies-file.d.ts.map +1 -0
- package/dist/declared/render-dependencies-file.js +12 -0
- package/dist/declared/render-dependencies-file.js.map +1 -0
- package/dist/depcruise/hygiene-rules.js +2 -1
- package/dist/depcruise/hygiene-rules.js.map +1 -1
- package/dist/describe/context-description.d.ts +10 -0
- package/dist/describe/context-description.d.ts.map +1 -1
- package/dist/describe/describe-context.d.ts.map +1 -1
- package/dist/describe/describe-context.js +2 -0
- package/dist/describe/describe-context.js.map +1 -1
- package/dist/describe/format-description.d.ts.map +1 -1
- package/dist/describe/format-description.js +4 -0
- package/dist/describe/format-description.js.map +1 -1
- package/dist/describe/read-projections.d.ts +5 -0
- package/dist/describe/read-projections.d.ts.map +1 -0
- package/dist/describe/read-projections.js +19 -0
- package/dist/describe/read-projections.js.map +1 -0
- package/dist/describe/reference-lines.js +9 -0
- package/dist/describe/reference-lines.js.map +1 -1
- package/dist/dev/refresh-declarations.d.ts +9 -0
- package/dist/dev/refresh-declarations.d.ts.map +1 -0
- package/dist/dev/refresh-declarations.js +28 -0
- package/dist/dev/refresh-declarations.js.map +1 -0
- package/dist/generate/access-vars.js +3 -3
- package/dist/generate/access-vars.js.map +1 -1
- package/dist/generate/kinds/context-plan.d.ts +10 -0
- package/dist/generate/kinds/context-plan.d.ts.map +1 -0
- package/dist/generate/kinds/context-plan.js +2 -0
- package/dist/generate/kinds/context-plan.js.map +1 -0
- package/dist/generate/kinds/declare-context-entries.d.ts +3 -1
- package/dist/generate/kinds/declare-context-entries.d.ts.map +1 -1
- package/dist/generate/kinds/declare-context-entries.js +4 -2
- package/dist/generate/kinds/declare-context-entries.js.map +1 -1
- package/dist/generate/kinds/extraction/service-selection.js +8 -11
- package/dist/generate/kinds/extraction/service-selection.js.map +1 -1
- package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
- package/dist/generate/kinds/job/job-vars.js +5 -3
- package/dist/generate/kinds/job/job-vars.js.map +1 -1
- package/dist/generate/kinds/plan-vars.d.ts +5 -0
- package/dist/generate/kinds/plan-vars.d.ts.map +1 -0
- package/dist/generate/kinds/plan-vars.js +24 -0
- package/dist/generate/kinds/plan-vars.js.map +1 -0
- package/dist/generate/kinds/projection-kind.d.ts +3 -0
- package/dist/generate/kinds/projection-kind.d.ts.map +1 -0
- package/dist/generate/kinds/projection-kind.js +72 -0
- package/dist/generate/kinds/projection-kind.js.map +1 -0
- package/dist/generate/kinds/publish-in-index.js +2 -2
- package/dist/generate/kinds/publish-in-index.js.map +1 -1
- package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
- package/dist/generate/kinds/route/route-vars.js +7 -6
- package/dist/generate/kinds/route/route-vars.js.map +1 -1
- package/dist/generate/kinds/wire-context.d.ts +10 -0
- package/dist/generate/kinds/wire-context.d.ts.map +1 -0
- package/dist/generate/kinds/wire-context.js +36 -0
- package/dist/generate/kinds/wire-context.js.map +1 -0
- package/dist/generate/kinds/write-context-files.d.ts +1 -8
- package/dist/generate/kinds/write-context-files.d.ts.map +1 -1
- package/dist/generate/kinds/write-context-files.js +3 -40
- package/dist/generate/kinds/write-context-files.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/refresh-barrels.d.ts +4 -3
- package/dist/generate/refresh-barrels.d.ts.map +1 -1
- package/dist/generate/refresh-barrels.js +41 -16
- package/dist/generate/refresh-barrels.js.map +1 -1
- package/dist/generate/spec-vars.js +4 -4
- package/dist/generate/spec-vars.js.map +1 -1
- package/dist/generate/storage-vars.d.ts +2 -2
- package/dist/generate/storage-vars.d.ts.map +1 -1
- package/dist/generate/storage-vars.js +6 -10
- package/dist/generate/storage-vars.js.map +1 -1
- package/dist/generate/workspace-sources.d.ts +6 -0
- package/dist/generate/workspace-sources.d.ts.map +1 -0
- package/dist/generate/workspace-sources.js +13 -0
- package/dist/generate/workspace-sources.js.map +1 -0
- package/dist/init/manifest/scripts-for.js +6 -1
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.js +23 -23
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +32 -3
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/recorded-options.d.ts +11 -0
- package/dist/init/stack/recorded-options.d.ts.map +1 -0
- package/dist/init/stack/recorded-options.js +19 -0
- package/dist/init/stack/recorded-options.js.map +1 -0
- package/dist/init/stack/resolve-stack.d.ts +6 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +46 -9
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/resolve-style.d.ts +3 -5
- package/dist/init/stack/resolve-style.d.ts.map +1 -1
- package/dist/init/stack/resolve-style.js +11 -3
- package/dist/init/stack/resolve-style.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +3 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/write-agent-settings.js +4 -3
- package/dist/init/write-agent-settings.js.map +1 -1
- package/dist/init/write-type-script-configs.d.ts +2 -1
- package/dist/init/write-type-script-configs.d.ts.map +1 -1
- package/dist/init/write-type-script-configs.js +4 -4
- package/dist/init/write-type-script-configs.js.map +1 -1
- package/dist/refresh-declarations.d.ts +3 -0
- package/dist/refresh-declarations.d.ts.map +1 -0
- package/dist/refresh-declarations.js +4 -0
- package/dist/refresh-declarations.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/alias-vars.d.ts +2 -1
- package/dist/stack/alias-vars.d.ts.map +1 -1
- package/dist/stack/alias-vars.js +6 -3
- package/dist/stack/alias-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
- package/templates/acl/translator.spec.ts.tpl +1 -1
- package/templates/adapter/adapter.declared.ts.tpl +3 -3
- package/templates/adapter/adapter.spec.ts.tpl +1 -1
- package/templates/adapter/adapter.ts.tpl +1 -1
- package/templates/adapter/wiring.tsyringe.tpl +3 -3
- package/templates/aggregate/aggregate.spec.ts.tpl +2 -2
- package/templates/architecture/extractable.declared.spec.ts.tpl +1 -1
- package/templates/architecture/extractable.manual.spec.ts.tpl +4 -4
- package/templates/architecture/extractable.tsyringe.spec.ts.tpl +1 -1
- package/templates/architecture/wiring.declared.tpl +1 -1
- package/templates/architecture/wiring.manual.tpl +1 -1
- package/templates/architecture/wiring.tsyringe.tpl +1 -1
- package/templates/builder/builder.ts.tpl +1 -1
- package/templates/command/handler.declared.ts.tpl +7 -7
- package/templates/command/handler.spec.buses.ts.tpl +4 -4
- package/templates/command/handler.spec.tsyringe.ts.tpl +5 -5
- package/templates/command/handler.ts.tpl +4 -4
- package/templates/command/wiring.manual.tpl +2 -2
- package/templates/command/wiring.tsyringe.tpl +3 -3
- package/templates/context/module.manual.ts.tpl +1 -1
- package/templates/context/permission-set.tpl +1 -1
- package/templates/context/permissions.spec.ts.tpl +1 -1
- package/templates/context/routes.spec.ts.tpl +1 -1
- package/templates/context/wiring.declared.tpl +2 -2
- package/templates/context/wiring.manual.tpl +1 -1
- package/templates/context/wiring.tsyringe.tpl +2 -2
- package/templates/domain-error/domain-error.spec.ts.tpl +1 -1
- package/templates/domain-event/domain-event.spec.ts.tpl +1 -1
- package/templates/domain-service/domain-service.spec.ts.tpl +1 -1
- package/templates/e2e/e2e.spec.ts.tpl +2 -2
- package/templates/entity/entity.spec.ts.tpl +1 -1
- package/templates/event-handler/event-handler.declared.ts.tpl +3 -3
- package/templates/event-handler/event-handler.spec.ts.tpl +2 -2
- package/templates/event-handler/event-handler.ts.tpl +1 -1
- package/templates/event-handler/wiring.manual.tpl +2 -2
- package/templates/event-handler/wiring.tsyringe.tpl +2 -2
- package/templates/gateway/adapter.declared.ts.tpl +3 -3
- package/templates/gateway/adapter.ts.tpl +2 -2
- package/templates/gateway/contract.spec.ts.tpl +3 -3
- package/templates/gateway/fake.ts.tpl +1 -1
- package/templates/gateway/platform-test.declared.tpl +1 -1
- package/templates/gateway/platform.declared.tpl +1 -1
- package/templates/gateway/wiring.tsyringe.tpl +3 -3
- package/templates/init/CLAUDE.md.tpl +5 -2
- package/templates/init/README.md.tpl +15 -10
- package/templates/init/e2e/create-credentials.jwt.ts.tpl +1 -1
- package/templates/init/e2e/create-credentials.keycloak.ts.tpl +1 -1
- package/templates/init/e2e/create-credentials.none.ts.tpl +2 -2
- package/templates/init/e2e/start-application.database.ts.tpl +16 -16
- package/templates/init/e2e/start-application.memory.ts.tpl +16 -16
- package/templates/init/e2e/test-environment.ts.tpl +1 -1
- package/templates/init/main.ts.tpl +11 -11
- package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -5
- package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +4 -4
- package/templates/init/platform/audit/create-audit.ts.tpl +5 -5
- package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +1 -1
- package/templates/init/platform/audit/search-audit-entries.route.ts.tpl +1 -1
- package/templates/init/platform/auth/authorization.tsyringe.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authenticator.jwt.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authenticator.keycloak.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authenticator.none.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authorizer.abac.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authorizer.custom.ts.tpl +2 -2
- package/templates/init/platform/auth/create-authorizer.rbac.ts.tpl +1 -1
- package/templates/init/platform/auth/create-authorizer.rebac.ts.tpl +3 -3
- package/templates/init/platform/auth/create-tuple-store.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/auth/custom-authorizer.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/auth/http-boundary.ts.tpl +1 -1
- package/templates/init/platform/auth/permission-mapping.ts.tpl +1 -1
- package/templates/init/platform/auth/permissions.ts.tpl +1 -1
- package/templates/init/platform/auth/principal-of.none.ts.tpl +1 -1
- package/templates/init/platform/auth/relate-system-actors.ts.tpl +1 -1
- package/templates/init/platform/auth/relation-tuples.ts.tpl +2 -2
- package/templates/init/platform/auth/security-schemes.none.ts.tpl +1 -1
- package/templates/init/platform/buses/create-command-bus.ts.tpl +2 -2
- package/templates/init/platform/buses/create-query-bus.ts.tpl +1 -1
- package/templates/init/platform/compose-application.manual.ts.tpl +6 -6
- package/templates/init/platform/compose-application.tsyringe.ts.tpl +10 -10
- package/templates/init/platform/config/app-config.ts.tpl +2 -2
- package/templates/init/platform/config/load-config.ts.tpl +3 -3
- package/templates/init/platform/create-platform.manual.ts.tpl +16 -16
- package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
- package/templates/init/platform/database/create-data-source.typeorm.ts.tpl +1 -1
- package/templates/init/platform/database/data-source.typeorm.ts.tpl +1 -1
- package/templates/init/platform/database/database.drizzle.ts.tpl +1 -1
- package/templates/init/platform/database/database.prisma.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.memory.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.pooled.ts.tpl +2 -2
- package/templates/init/platform/database/inert-persistence.prisma.ts.tpl +3 -3
- package/templates/init/platform/database/inert-persistence.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/database/open-persistence.memory.ts.tpl +1 -1
- package/templates/init/platform/database/open-persistence.pooled.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.prisma.ts.tpl +3 -3
- package/templates/init/platform/database/open-persistence.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +4 -4
- package/templates/init/platform/database/open-test-database.knex.ts.tpl +5 -5
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +4 -4
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +3 -3
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +2 -2
- package/templates/init/platform/database/persistence.orm.ts.tpl +1 -1
- package/templates/init/platform/errors.ts.tpl +1 -1
- package/templates/init/platform/events/create-event-provider.custom.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.kafka.ts.tpl +3 -3
- package/templates/init/platform/events/create-event-provider.nats.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.rabbitmq.ts.tpl +2 -2
- package/templates/init/platform/events/create-event-provider.redis.ts.tpl +2 -2
- package/templates/init/platform/events/custom-event-bus.contract.spec.ts.tpl +1 -1
- package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
- package/templates/init/platform/events/start-outbox-relay.ts.tpl +1 -1
- package/templates/init/platform/http/create-app-module.ts.tpl +1 -1
- package/templates/init/platform/http/start-http-server.express.ts.tpl +4 -4
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -4
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +5 -5
- package/templates/init/platform/http/with-documentation.ts.tpl +2 -2
- package/templates/init/platform/lay-foundations.tsyringe.ts.tpl +5 -5
- package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/platform.manual.ts.tpl +3 -3
- package/templates/init/platform/platform.module.tsyringe.ts.tpl +8 -8
- package/templates/init/platform/resilience/adapter-aspects.ts.tpl +2 -2
- package/templates/init/platform/resilience/default-resilience.ts.tpl +1 -1
- package/templates/init/platform/resilience/own-policy.ts.tpl +1 -1
- package/templates/init/platform/tracing.ts.tpl +2 -2
- package/templates/init/rules/application.md.tpl +8 -2
- package/templates/init/rules/infrastructure.md.tpl +3 -3
- package/templates/init/scripts/openapi.ts.tpl +5 -5
- package/templates/integration-event/audited.tpl +1 -1
- package/templates/integration-event/integration-event.class-validator.ts.tpl +1 -1
- package/templates/integration-event/integration-event.custom.ts.tpl +1 -1
- package/templates/integration-event/publisher.declared.ts.tpl +4 -4
- package/templates/integration-event/publisher.spec.ts.tpl +2 -2
- package/templates/integration-event/publisher.ts.tpl +2 -2
- package/templates/integration-event/wiring.manual.tpl +2 -2
- package/templates/integration-event/wiring.tsyringe.tpl +2 -2
- package/templates/integration-handler/integration-handler.declared.ts.tpl +3 -3
- package/templates/integration-handler/integration-handler.spec.ts.tpl +2 -2
- package/templates/integration-handler/integration-handler.ts.tpl +1 -1
- package/templates/integration-handler/wiring.manual.tpl +3 -3
- package/templates/integration-handler/wiring.tsyringe.tpl +2 -2
- package/templates/job/job.declared.ts.tpl +3 -3
- package/templates/job/job.spec.buses.ts.tpl +2 -2
- package/templates/job/job.spec.tsyringe.ts.tpl +2 -2
- package/templates/job/job.ts.tpl +1 -1
- package/templates/job/wiring.manual.tpl +1 -1
- package/templates/job/wiring.tsyringe.tpl +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/policy/policy.declared.ts.tpl +1 -1
- package/templates/policy/policy.spec.declared.ts.tpl +1 -1
- package/templates/policy/policy.spec.ts.tpl +1 -1
- package/templates/policy/policy.ts.tpl +1 -1
- package/templates/policy/registration.tpl +1 -1
- package/templates/port/fake.ts.tpl +1 -1
- package/templates/projection/projection.spec.ts.tpl +17 -0
- package/templates/projection/projection.ts.tpl +11 -0
- package/templates/query/handler.declared.ts.tpl +4 -4
- package/templates/query/handler.spec.buses.ts.tpl +5 -5
- package/templates/query/handler.spec.tsyringe.ts.tpl +6 -6
- package/templates/query/handler.ts.tpl +3 -3
- package/templates/query/query.ts.tpl +1 -1
- package/templates/query/reader.fake.ts.tpl +2 -2
- package/templates/query/reader.in-memory.ts.tpl +4 -4
- package/templates/query/reader.port.ts.tpl +2 -2
- package/templates/query/search.handler.declared.ts.tpl +6 -6
- package/templates/query/search.handler.spec.buses.ts.tpl +5 -5
- package/templates/query/search.handler.spec.tsyringe.ts.tpl +6 -6
- package/templates/query/search.handler.ts.tpl +4 -4
- package/templates/query/search.query.ts.tpl +1 -1
- package/templates/query/search.reader.fake.ts.tpl +2 -2
- package/templates/query/search.reader.in-memory.ts.tpl +3 -3
- package/templates/query/search.reader.port.ts.tpl +1 -1
- package/templates/query/search.reader.spec.ts.tpl +2 -2
- package/templates/query/search.wiring.manual.tpl +3 -3
- package/templates/query/search.wiring.tsyringe.tpl +4 -4
- package/templates/query/wiring.manual.tpl +3 -3
- package/templates/query/wiring.tsyringe.tpl +4 -4
- package/templates/repository/contract.spec.ts.tpl +5 -5
- package/templates/repository/drizzle/mapper.ts.tpl +2 -2
- package/templates/repository/drizzle/repository.ts.tpl +9 -17
- package/templates/repository/drizzle/schema-export.tpl +1 -1
- package/templates/repository/fake.ts.tpl +2 -2
- package/templates/repository/knex/mapper.ts.tpl +2 -2
- package/templates/repository/knex/repository.ts.tpl +10 -30
- package/templates/repository/knex/schema-export.tpl +1 -1
- package/templates/repository/knex/tables.ts.tpl +1 -1
- package/templates/repository/none/repository.ts.tpl +3 -3
- package/templates/repository/prisma/mapper.ts.tpl +2 -2
- package/templates/repository/prisma/repository.ts.tpl +6 -9
- package/templates/repository/repository.ts.tpl +1 -1
- package/templates/repository/typeorm/mapper.ts.tpl +2 -2
- package/templates/repository/typeorm/repository.ts.tpl +9 -12
- package/templates/repository/typeorm/schema-export.tpl +1 -1
- package/templates/repository/typeorm/table.tpl +1 -1
- package/templates/repository/wiring.manual.tpl +1 -1
- package/templates/repository/wiring.tsyringe.tpl +2 -2
- package/templates/route/route.search.ts.tpl +1 -1
- package/templates/route/route.spec.ts.tpl +1 -1
- package/templates/route/routes.on-tsyringe.tpl +1 -1
- package/templates/route/wiring.manual.tpl +1 -1
- package/templates/service/main.ts.tpl +11 -11
- package/templates/value-object/value-object.spec.ts.tpl +1 -1
- package/templates/worker/main.ts.tpl +9 -9
- package/dist/alias/platform-alias.d.ts +0 -4
- package/dist/alias/platform-alias.d.ts.map +0 -1
- package/dist/alias/platform-alias.js +0 -7
- package/dist/alias/platform-alias.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { authEnvironment } from '{{alias.test}}/e2e/support/auth-environment.
|
|
1
|
+
import { authEnvironment } from '{{alias.test}}/e2e/support/auth-environment{{alias.ext}}';
|
|
2
2
|
{{#if broker.addressed}}
|
|
3
3
|
|
|
4
4
|
/** Without {{broker.variable}} (`npm run infra:up` gives one) the events stay in the process: the same ports, no broker. */
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// Imported first on purpose: instrumentation has to be installed before any module it patches is loaded.
|
|
2
|
-
import { tracing } from '{{alias.platform}}/tracing.
|
|
2
|
+
import { tracing } from '{{alias.platform}}/tracing{{alias.ext}}';
|
|
3
3
|
{{#if errors.sentry}}
|
|
4
4
|
// Imported second on purpose: a failure while the rest of the application loads is already reported.
|
|
5
|
-
import { errors } from '{{alias.platform}}/errors.
|
|
5
|
+
import { errors } from '{{alias.platform}}/errors{{alias.ext}}';
|
|
6
6
|
{{/if}}
|
|
7
7
|
{{#if http.any}}
|
|
8
|
-
import { createAuthenticator } from '{{alias.platform}}/auth/create-authenticator.
|
|
8
|
+
import { createAuthenticator } from '{{alias.platform}}/auth/create-authenticator{{alias.ext}}';
|
|
9
9
|
{{/if}}
|
|
10
|
-
import { composeApplication } from '{{alias.platform}}/compose-application.
|
|
11
|
-
import { loadConfig } from '{{alias.platform}}/config/load-config.
|
|
12
|
-
import { openPersistence } from '{{alias.platform}}/database/open-persistence.
|
|
13
|
-
import { {{events.providerName}} } from '{{alias.platform}}/events/{{events.providerFile}}.
|
|
10
|
+
import { composeApplication } from '{{alias.platform}}/compose-application{{alias.ext}}';
|
|
11
|
+
import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
|
|
12
|
+
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
13
|
+
import { {{events.providerName}} } from '{{alias.platform}}/events/{{events.providerFile}}{{alias.ext}}';
|
|
14
14
|
{{#if events.outbox}}
|
|
15
|
-
import { startOutboxRelay } from '{{alias.platform}}/events/start-outbox-relay.
|
|
15
|
+
import { startOutboxRelay } from '{{alias.platform}}/events/start-outbox-relay{{alias.ext}}';
|
|
16
16
|
{{/if}}
|
|
17
17
|
{{#if http.any}}
|
|
18
|
-
import { startHttpServer } from '{{alias.platform}}/http/start-http-server.
|
|
18
|
+
import { startHttpServer } from '{{alias.platform}}/http/start-http-server{{alias.ext}}';
|
|
19
19
|
{{/if}}
|
|
20
|
-
import { jobSettings } from '{{alias.platform}}/job-settings.
|
|
20
|
+
import { jobSettings } from '{{alias.platform}}/job-settings{{alias.ext}}';
|
|
21
21
|
{{#if cache.redis}}
|
|
22
|
-
import { openRedis } from '{{alias.platform}}/redis/open-redis.
|
|
22
|
+
import { openRedis } from '{{alias.platform}}/redis/open-redis{{alias.ext}}';
|
|
23
23
|
{{/if}}
|
|
24
24
|
|
|
25
25
|
const config = loadConfig(process.env);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { requires, type UseCaseDeclaration } from '@ddd-ts-kit/auth';
|
|
2
2
|
import type { Route } from '@ddd-ts-kit/http';
|
|
3
|
-
import type { Platform } from '{{alias.platform}}/platform.
|
|
4
|
-
import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions.
|
|
5
|
-
import { SearchAuditEntriesHandler } from '{{alias.platform}}/audit/search-audit-entries.handler.
|
|
6
|
-
import { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-entries.query.
|
|
7
|
-
import { searchAuditEntriesRoute } from '{{alias.platform}}/audit/search-audit-entries.route.
|
|
3
|
+
import type { Platform } from '{{alias.platform}}/platform{{alias.ext}}';
|
|
4
|
+
import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions{{alias.ext}}';
|
|
5
|
+
import { SearchAuditEntriesHandler } from '{{alias.platform}}/audit/search-audit-entries.handler{{alias.ext}}';
|
|
6
|
+
import { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-entries.query{{alias.ext}}';
|
|
7
|
+
import { searchAuditEntriesRoute } from '{{alias.platform}}/audit/search-audit-entries.route{{alias.ext}}';
|
|
8
8
|
|
|
9
9
|
interface AuditWiring {
|
|
10
10
|
readonly name: string;
|
|
@@ -3,12 +3,12 @@ import { defineContextModule, type ContextModule } from '@ddd-ts-kit/di';
|
|
|
3
3
|
import { subscribeAll } from '@ddd-ts-kit/events';
|
|
4
4
|
import { EventSubscribers } from '@ddd-ts-kit/kernel';
|
|
5
5
|
{{#if audit.route}}
|
|
6
|
-
import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions.
|
|
6
|
+
import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions{{alias.ext}}';
|
|
7
7
|
{{/if}}
|
|
8
|
-
import type { Audit } from '{{alias.platform}}/audit/create-audit.
|
|
8
|
+
import type { Audit } from '{{alias.platform}}/audit/create-audit{{alias.ext}}';
|
|
9
9
|
{{#if audit.route}}
|
|
10
|
-
import { SearchAuditEntriesHandler } from '{{alias.platform}}/audit/search-audit-entries.handler.
|
|
11
|
-
import { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-entries.query.
|
|
10
|
+
import { SearchAuditEntriesHandler } from '{{alias.platform}}/audit/search-audit-entries.handler{{alias.ext}}';
|
|
11
|
+
import { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-entries.query{{alias.ext}}';
|
|
12
12
|
{{/if}}
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -28,16 +28,16 @@ import { DrizzleAuditTrail } from '@ddd-ts-kit/audit/drizzle';
|
|
|
28
28
|
import type { OnDecision } from '@ddd-ts-kit/auth';
|
|
29
29
|
import type { EventSubscription } from '@ddd-ts-kit/events';
|
|
30
30
|
import type { BusMiddleware } from '@ddd-ts-kit/kernel';
|
|
31
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
31
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
32
32
|
{{#if audit.sql}}
|
|
33
|
-
import { AUDIT_SCHEMA } from '{{alias.platform}}/database/schema.
|
|
33
|
+
import { AUDIT_SCHEMA } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
34
34
|
{{/if}}
|
|
35
35
|
{{#if audit.route}}
|
|
36
|
-
import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions.
|
|
36
|
+
import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions{{alias.ext}}';
|
|
37
37
|
{{/if}}
|
|
38
|
-
import { auditedEvents } from '{{alias.platform}}/audit/audited-events.
|
|
38
|
+
import { auditedEvents } from '{{alias.platform}}/audit/audited-events{{alias.ext}}';
|
|
39
39
|
{{#if audit.route}}
|
|
40
|
-
import { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-entries.query.
|
|
40
|
+
import { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-entries.query{{alias.ext}}';
|
|
41
41
|
{{/if}}
|
|
42
42
|
|
|
43
43
|
/** The name the audit trail consumes integration events under: its idempotency scope, and its queues behind a broker. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuditEntry, AuditReader } from '@ddd-ts-kit/audit';
|
|
2
2
|
import type { Page, QueryHandler } from '@ddd-ts-kit/kernel';
|
|
3
|
-
import type { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-entries.query.
|
|
3
|
+
import type { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-entries.query{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
export class SearchAuditEntriesHandler implements QueryHandler<SearchAuditEntriesQuery> {
|
|
6
6
|
constructor(private readonly reader: AuditReader) {}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from '@ddd-ts-kit/http';
|
|
11
11
|
import { err, ok, type QueryBus } from '@ddd-ts-kit/kernel';
|
|
12
12
|
import { customSchema, type JsonSchema } from '@ddd-ts-kit/validation';
|
|
13
|
-
import { SearchAuditEntriesQuery, type AuditEntriesFilter } from '{{alias.platform}}/audit/search-audit-entries.query.
|
|
13
|
+
import { SearchAuditEntriesQuery, type AuditEntriesFilter } from '{{alias.platform}}/audit/search-audit-entries.query{{alias.ext}}';
|
|
14
14
|
|
|
15
15
|
/** Newest first unless asked otherwise, by cursor: the trail only grows, an offset would shift under the reader. */
|
|
16
16
|
const pageLimits = { sortable: ['occurredAt', 'sequence'], maxSize: 100, kind: 'cursor' } as const;
|
|
@@ -6,8 +6,8 @@ import type { OnDecision } from '@ddd-ts-kit/auth';
|
|
|
6
6
|
{{/unless}}
|
|
7
7
|
import { authorizationModule } from '@ddd-ts-kit/auth/di';
|
|
8
8
|
import type { ContextModule } from '@ddd-ts-kit/di';
|
|
9
|
-
import { accessPolicies } from '{{alias.platform}}/auth/access-policies.
|
|
10
|
-
import { createAuthorizer } from '{{alias.platform}}/auth/create-authorizer.
|
|
9
|
+
import { accessPolicies } from '{{alias.platform}}/auth/access-policies{{alias.ext}}';
|
|
10
|
+
import { createAuthorizer } from '{{alias.platform}}/auth/create-authorizer{{alias.ext}}';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Binds `Authorizer`, the guard both buses ask before any handler, the `Access` of the policies{{#if http.any}} and
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Authenticator } from '@ddd-ts-kit/auth';
|
|
2
2
|
import { JwtAuthenticator } from '@ddd-ts-kit/auth/jwt';
|
|
3
|
-
import type { AppConfig } from '{{alias.platform}}/config/app-config.
|
|
3
|
+
import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
/** Verifies the bearer token against the keys the issuer publishes. The session keeps nothing of the token. */
|
|
6
6
|
export function createAuthenticator(config: AppConfig): Authenticator {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Authenticator } from '@ddd-ts-kit/auth';
|
|
2
2
|
import { keycloakAuthenticator } from '@ddd-ts-kit/auth/jwt';
|
|
3
|
-
import type { AppConfig } from '{{alias.platform}}/config/app-config.
|
|
3
|
+
import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Verifies the access tokens of the Keycloak realm against the keys it publishes. The actor takes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Authenticator } from '@ddd-ts-kit/auth';
|
|
2
|
-
import type { AppConfig } from '{{alias.platform}}/config/app-config.
|
|
3
|
-
import { DevelopmentHeaderAuthenticator } from '{{alias.platform}}/auth/development-header-authenticator.
|
|
2
|
+
import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
|
|
3
|
+
import { DevelopmentHeaderAuthenticator } from '{{alias.platform}}/auth/development-header-authenticator{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
// TODO(platform): replace the development authenticator by a real adapter of Authenticator (a JWT verifier, your identity provider) before the first deployment.
|
|
6
6
|
export function createAuthenticator(config: AppConfig): Authenticator {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PolicyBasedAuthorizer, type Authorizer } from '@ddd-ts-kit/auth';
|
|
2
2
|
import { SystemClock } from '@ddd-ts-kit/kernel';
|
|
3
|
-
import { attributePolicies } from '{{alias.platform}}/auth/attribute-policies.
|
|
3
|
+
import { attributePolicies } from '{{alias.platform}}/auth/attribute-policies{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
/** Attribute policies: do the attributes of the actor, the resource and the moment satisfy a rule? */
|
|
6
6
|
export function createAuthorizer(): Authorizer {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Authorizer } from '@ddd-ts-kit/auth';
|
|
2
|
-
import { CustomAuthorizer } from '{{alias.platform}}/auth/custom-authorizer.
|
|
3
|
-
import { permissions } from '{{alias.platform}}/auth/permissions.
|
|
2
|
+
import { CustomAuthorizer } from '{{alias.platform}}/auth/custom-authorizer{{alias.ext}}';
|
|
3
|
+
import { permissions } from '{{alias.platform}}/auth/permissions{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
// TODO(platform): give the adapter what your model needs (a client of the service that decides, its mapping) instead of this table granting everything to the role "admin".
|
|
6
6
|
export function createAuthorizer(): Authorizer {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RoleBasedAuthorizer, type Authorizer } from '@ddd-ts-kit/auth';
|
|
2
|
-
import { roles } from '{{alias.platform}}/auth/roles.
|
|
2
|
+
import { roles } from '{{alias.platform}}/auth/roles{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
/** Roles: does one of the actor's roles grant this action? Another model is another adapter of the same port. */
|
|
5
5
|
export function createAuthorizer(): Authorizer {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Authorizer } from '@ddd-ts-kit/auth';
|
|
2
2
|
import { RelationBasedAuthorizer } from '@ddd-ts-kit/auth/rebac';
|
|
3
|
-
import { permissionMapping } from '{{alias.platform}}/auth/permission-mapping.
|
|
4
|
-
import { relationTuples } from '{{alias.platform}}/auth/relation-tuples.
|
|
5
|
-
import { relationshipSchema } from '{{alias.platform}}/auth/relationship-schema.
|
|
3
|
+
import { permissionMapping } from '{{alias.platform}}/auth/permission-mapping{{alias.ext}}';
|
|
4
|
+
import { relationTuples } from '{{alias.platform}}/auth/relation-tuples{{alias.ext}}';
|
|
5
|
+
import { relationshipSchema } from '{{alias.platform}}/auth/relationship-schema{{alias.ext}}';
|
|
6
6
|
|
|
7
7
|
/** Relationships: is there a path of stored tuples from this element to the actor? */
|
|
8
8
|
export function createAuthorizer(): Authorizer {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it } from '{{tests.module}}';
|
|
2
2
|
import { relationTupleStoreContract } from '@ddd-ts-kit/auth/testing';
|
|
3
|
-
import { createTupleStore } from '{{alias.platform}}/auth/create-tuple-store.
|
|
3
|
+
import { createTupleStore } from '{{alias.platform}}/auth/create-tuple-store{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
relationTupleStoreContract(
|
|
6
6
|
{ describe, it, expect, beforeEach },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it } from '{{tests.module}}';
|
|
2
2
|
import { definePermissions } from '@ddd-ts-kit/auth';
|
|
3
3
|
import { anActor, authorizerContract } from '@ddd-ts-kit/auth/testing';
|
|
4
|
-
import { CustomAuthorizer } from '{{alias.platform}}/auth/custom-authorizer.
|
|
4
|
+
import { CustomAuthorizer } from '{{alias.platform}}/auth/custom-authorizer{{alias.ext}}';
|
|
5
5
|
|
|
6
6
|
const permissions = definePermissions('contract', {
|
|
7
7
|
'element.read': { description: 'Read an element' },
|
|
@@ -8,7 +8,7 @@ import { reportHttpErrors, type ErrorContext, type ErrorMapper, type RouteAround
|
|
|
8
8
|
import type { Clock, ErrorReporter, ExecutionScope, Logger, Session } from '@ddd-ts-kit/kernel';
|
|
9
9
|
{{/if}}
|
|
10
10
|
import { tracedRoutes } from '@ddd-ts-kit/tracing';
|
|
11
|
-
import { principalOf } from '{{alias.platform}}/auth/principal-of.
|
|
11
|
+
import { principalOf } from '{{alias.platform}}/auth/principal-of{{alias.ext}}';
|
|
12
12
|
|
|
13
13
|
/** What the HTTP adapter needs at the edge of the application: spread into its mount options, for every route. */
|
|
14
14
|
export interface HttpBoundary {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PermissionMapping } from '@ddd-ts-kit/auth/rebac';
|
|
2
|
-
import { permissions } from '{{alias.platform}}/auth/permissions.
|
|
2
|
+
import { permissions } from '{{alias.platform}}/auth/permissions{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
/** Which permission of the relationship schema each permission of a context stands for. */
|
|
5
5
|
export function permissionMapping(): PermissionMapping {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PermissionRegistry } from '@ddd-ts-kit/auth';
|
|
2
2
|
{{#if audit.route}}
|
|
3
|
-
import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions.
|
|
3
|
+
import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions{{alias.ext}}';
|
|
4
4
|
{{/if}}
|
|
5
5
|
// ddd-ts-kit:imports
|
|
6
6
|
// /ddd-ts-kit:imports
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveSession, type Authenticator } from '@ddd-ts-kit/auth';
|
|
2
2
|
import type { Session } from '@ddd-ts-kit/kernel';
|
|
3
|
-
import { developmentActorHeader } from '{{alias.platform}}/auth/development-actor-header.
|
|
3
|
+
import { developmentActorHeader } from '{{alias.platform}}/auth/development-actor-header{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
/** Reads the development header of a request and answers its session, derived from the actor it names. */
|
|
6
6
|
export function principalOf(authenticator: Authenticator): (raw: unknown) => Promise<Session> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RelationTuple } from '@ddd-ts-kit/auth/rebac';
|
|
2
|
-
import { relationTuples } from '{{alias.platform}}/auth/relation-tuples.
|
|
2
|
+
import { relationTuples } from '{{alias.platform}}/auth/relation-tuples{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* What the application does on its own behalf: the relationships of its system actors, one per
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SchemaCheckedTupleStore, type RelationTupleStore } from '@ddd-ts-kit/auth/rebac';
|
|
2
|
-
import { createTupleStore } from '{{alias.platform}}/auth/create-tuple-store.
|
|
3
|
-
import { relationshipSchema } from '{{alias.platform}}/auth/relationship-schema.
|
|
2
|
+
import { createTupleStore } from '{{alias.platform}}/auth/create-tuple-store{{alias.ext}}';
|
|
3
|
+
import { relationshipSchema } from '{{alias.platform}}/auth/relationship-schema{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
/** The relationships the authorizer reads: a tuple that the schema does not know is refused when it is written. */
|
|
6
6
|
export const relationTuples: RelationTupleStore = new SchemaCheckedTupleStore(relationshipSchema, createTupleStore());
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { developmentActorHeader } from '{{alias.platform}}/auth/development-actor-header.
|
|
1
|
+
import { developmentActorHeader } from '{{alias.platform}}/auth/development-actor-header{{alias.ext}}';
|
|
2
2
|
|
|
3
3
|
/** The scheme routes name in `security`, as the OpenAPI document declares it. */
|
|
4
4
|
export const securitySchemes = { developmentActor: { type: 'apiKey', in: 'header', name: developmentActorHeader } };
|
|
@@ -31,9 +31,9 @@ import {
|
|
|
31
31
|
} from '@ddd-ts-kit/kernel';
|
|
32
32
|
{{/unless}}
|
|
33
33
|
{{/if}}
|
|
34
|
-
import type { Foundations } from '{{alias.platform}}/lay-foundations.
|
|
34
|
+
import type { Foundations } from '{{alias.platform}}/lay-foundations{{alias.ext}}';
|
|
35
35
|
{{#if cache.relaySignal}}
|
|
36
|
-
import type { RedisServices } from '{{alias.platform}}/redis/open-redis.
|
|
36
|
+
import type { RedisServices } from '{{alias.platform}}/redis/open-redis{{alias.ext}}';
|
|
37
37
|
|
|
38
38
|
interface Signalled {
|
|
39
39
|
readonly redis?: RedisServices;
|
|
@@ -6,7 +6,7 @@ import { InMemoryQueryBus } from '@ddd-ts-kit/kernel';
|
|
|
6
6
|
{{#if errors.sentry}}
|
|
7
7
|
import { ErrorReporter, InMemoryQueryBus, errorReportingMiddleware } from '@ddd-ts-kit/kernel';
|
|
8
8
|
{{/if}}
|
|
9
|
-
import type { Foundations } from '{{alias.platform}}/lay-foundations.
|
|
9
|
+
import type { Foundations } from '{{alias.platform}}/lay-foundations{{alias.ext}}';
|
|
10
10
|
|
|
11
11
|
/** Around every query, outermost first: {{#if errors.sentry}}the report of an unexpected failure, {{/if}}its log entry, its measure, the permission, its span{{#if audit.on}}, the audit entry of the reads that leave one{{/if}}. */
|
|
12
12
|
export function createQueryBus(resolve: Resolve, foundations: Foundations): InMemoryQueryBus {
|
|
@@ -18,17 +18,17 @@ import type { IntegrationEventPublisher, IntegrationEventSubscriber, Logger, Rat
|
|
|
18
18
|
import type { IntegrationEventPublisher, IntegrationEventSubscriber, Logger } from '@ddd-ts-kit/kernel';
|
|
19
19
|
{{/unless}}
|
|
20
20
|
{{#if audit.route}}
|
|
21
|
-
import { auditModule } from '{{alias.platform}}/audit/audit.module.
|
|
21
|
+
import { auditModule } from '{{alias.platform}}/audit/audit.module{{alias.ext}}';
|
|
22
22
|
{{/if}}
|
|
23
23
|
{{#if http.any}}
|
|
24
|
-
import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/http-boundary.
|
|
24
|
+
import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/http-boundary{{alias.ext}}';
|
|
25
25
|
{{/if}}
|
|
26
26
|
{{#if authz.rebac}}
|
|
27
|
-
import { relateSystemActors } from '{{alias.platform}}/auth/relate-system-actors.
|
|
27
|
+
import { relateSystemActors } from '{{alias.platform}}/auth/relate-system-actors{{alias.ext}}';
|
|
28
28
|
{{/if}}
|
|
29
|
-
import { createPlatform, type PlatformOptions } from '{{alias.platform}}/create-platform.
|
|
30
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
31
|
-
import type { Platform } from '{{alias.platform}}/platform.
|
|
29
|
+
import { createPlatform, type PlatformOptions } from '{{alias.platform}}/create-platform{{alias.ext}}';
|
|
30
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
31
|
+
import type { Platform } from '{{alias.platform}}/platform{{alias.ext}}';
|
|
32
32
|
// ddd-ts-kit:imports
|
|
33
33
|
// /ddd-ts-kit:imports
|
|
34
34
|
|
|
@@ -49,23 +49,23 @@ import {
|
|
|
49
49
|
} from '@ddd-ts-kit/kernel';
|
|
50
50
|
import { tracedPublisher } from '@ddd-ts-kit/tracing';
|
|
51
51
|
{{#if audit.on}}
|
|
52
|
-
import { auditModule } from '{{alias.platform}}/audit/audit.module.
|
|
52
|
+
import { auditModule } from '{{alias.platform}}/audit/audit.module{{alias.ext}}';
|
|
53
53
|
{{/if}}
|
|
54
54
|
{{#if audit.route}}
|
|
55
|
-
import { searchAuditEntriesRoute } from '{{alias.platform}}/audit/search-audit-entries.route.
|
|
55
|
+
import { searchAuditEntriesRoute } from '{{alias.platform}}/audit/search-audit-entries.route{{alias.ext}}';
|
|
56
56
|
{{/if}}
|
|
57
|
-
import { authorization } from '{{alias.platform}}/auth/authorization.
|
|
57
|
+
import { authorization } from '{{alias.platform}}/auth/authorization{{alias.ext}}';
|
|
58
58
|
{{#if http.any}}
|
|
59
|
-
import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/http-boundary.
|
|
59
|
+
import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/http-boundary{{alias.ext}}';
|
|
60
60
|
{{/if}}
|
|
61
61
|
{{#if authz.rebac}}
|
|
62
|
-
import { relateSystemActors } from '{{alias.platform}}/auth/relate-system-actors.
|
|
62
|
+
import { relateSystemActors } from '{{alias.platform}}/auth/relate-system-actors{{alias.ext}}';
|
|
63
63
|
{{/if}}
|
|
64
|
-
import { createCommandBus } from '{{alias.platform}}/buses/create-command-bus.
|
|
65
|
-
import { createQueryBus } from '{{alias.platform}}/buses/create-query-bus.
|
|
66
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
67
|
-
import { layFoundations, type Foundations } from '{{alias.platform}}/lay-foundations.
|
|
68
|
-
import { platformModule, type PlatformOptions } from '{{alias.platform}}/platform.module.
|
|
64
|
+
import { createCommandBus } from '{{alias.platform}}/buses/create-command-bus{{alias.ext}}';
|
|
65
|
+
import { createQueryBus } from '{{alias.platform}}/buses/create-query-bus{{alias.ext}}';
|
|
66
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
67
|
+
import { layFoundations, type Foundations } from '{{alias.platform}}/lay-foundations{{alias.ext}}';
|
|
68
|
+
import { platformModule, type PlatformOptions } from '{{alias.platform}}/platform.module{{alias.ext}}';
|
|
69
69
|
// ddd-ts-kit:imports
|
|
70
70
|
// /ddd-ts-kit:imports
|
|
71
71
|
|
|
@@ -4,8 +4,8 @@ import type { LogLevel, RateLimit } from '@ddd-ts-kit/kernel';
|
|
|
4
4
|
{{#unless cache.rateLimit}}
|
|
5
5
|
import type { LogLevel } from '@ddd-ts-kit/kernel';
|
|
6
6
|
{{/unless}}
|
|
7
|
-
import type { ResilienceSettings } from '{{alias.platform}}/resilience/resilience-settings.
|
|
8
|
-
import type { TracingConfig } from '{{alias.platform}}/config/read-tracing.
|
|
7
|
+
import type { ResilienceSettings } from '{{alias.platform}}/resilience/resilience-settings{{alias.ext}}';
|
|
8
|
+
import type { TracingConfig } from '{{alias.platform}}/config/read-tracing{{alias.ext}}';
|
|
9
9
|
|
|
10
10
|
/** The validated configuration of the process: `loadConfig` is the only reader of the environment. */
|
|
11
11
|
export interface AppConfig {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LOG_LEVELS, type LogLevel } from '@ddd-ts-kit/kernel';
|
|
2
|
-
import type { AppConfig } from '{{alias.platform}}/config/app-config.
|
|
3
|
-
import { ConfigError } from '{{alias.platform}}/config/config-error.
|
|
4
|
-
import { readTracing } from '{{alias.platform}}/config/read-tracing.
|
|
2
|
+
import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
|
|
3
|
+
import { ConfigError } from '{{alias.platform}}/config/config-error{{alias.ext}}';
|
|
4
|
+
import { readTracing } from '{{alias.platform}}/config/read-tracing{{alias.ext}}';
|
|
5
5
|
|
|
6
6
|
const environments = ['development', 'test', 'production'] as const;
|
|
7
7
|
|
|
@@ -48,27 +48,27 @@ import {
|
|
|
48
48
|
type TracedApplication,
|
|
49
49
|
} from '@ddd-ts-kit/tracing';
|
|
50
50
|
{{#if audit.on}}
|
|
51
|
-
import { createAudit } from '{{alias.platform}}/audit/create-audit.
|
|
51
|
+
import { createAudit } from '{{alias.platform}}/audit/create-audit{{alias.ext}}';
|
|
52
52
|
{{/if}}
|
|
53
|
-
import { accessPolicies } from '{{alias.platform}}/auth/access-policies.
|
|
54
|
-
import { createAuthorizer } from '{{alias.platform}}/auth/create-authorizer.
|
|
53
|
+
import { accessPolicies } from '{{alias.platform}}/auth/access-policies{{alias.ext}}';
|
|
54
|
+
import { createAuthorizer } from '{{alias.platform}}/auth/create-authorizer{{alias.ext}}';
|
|
55
55
|
{{#unless audit.on}}
|
|
56
|
-
import { logDecisions } from '{{alias.platform}}/auth/log-decisions.
|
|
56
|
+
import { logDecisions } from '{{alias.platform}}/auth/log-decisions{{alias.ext}}';
|
|
57
57
|
{{/unless}}
|
|
58
|
-
import { UseCaseProtection } from '{{alias.platform}}/auth/use-case-protection.
|
|
59
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
60
|
-
import type { EventProvider } from '{{alias.platform}}/events/event-provider.
|
|
61
|
-
import { ConfiguredJobScheduler } from '{{alias.platform}}/jobs/configured-job-scheduler.
|
|
62
|
-
import { createLogger, type LogSettings } from '{{alias.platform}}/observability/create-logger.
|
|
63
|
-
import { createMetrics } from '{{alias.platform}}/observability/create-metrics.
|
|
64
|
-
import type { Platform } from '{{alias.platform}}/platform.
|
|
58
|
+
import { UseCaseProtection } from '{{alias.platform}}/auth/use-case-protection{{alias.ext}}';
|
|
59
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
60
|
+
import type { EventProvider } from '{{alias.platform}}/events/event-provider{{alias.ext}}';
|
|
61
|
+
import { ConfiguredJobScheduler } from '{{alias.platform}}/jobs/configured-job-scheduler{{alias.ext}}';
|
|
62
|
+
import { createLogger, type LogSettings } from '{{alias.platform}}/observability/create-logger{{alias.ext}}';
|
|
63
|
+
import { createMetrics } from '{{alias.platform}}/observability/create-metrics{{alias.ext}}';
|
|
64
|
+
import type { Platform } from '{{alias.platform}}/platform{{alias.ext}}';
|
|
65
65
|
{{#if cache.redis}}
|
|
66
|
-
import type { RedisServices } from '{{alias.platform}}/redis/open-redis.
|
|
66
|
+
import type { RedisServices } from '{{alias.platform}}/redis/open-redis{{alias.ext}}';
|
|
67
67
|
{{/if}}
|
|
68
|
-
import { adapterAspects } from '{{alias.platform}}/resilience/adapter-aspects.
|
|
69
|
-
import { defaultResilience } from '{{alias.platform}}/resilience/default-resilience.
|
|
70
|
-
import { ownPolicy } from '{{alias.platform}}/resilience/own-policy.
|
|
71
|
-
import type { ResilienceSettings } from '{{alias.platform}}/resilience/resilience-settings.
|
|
68
|
+
import { adapterAspects } from '{{alias.platform}}/resilience/adapter-aspects{{alias.ext}}';
|
|
69
|
+
import { defaultResilience } from '{{alias.platform}}/resilience/default-resilience{{alias.ext}}';
|
|
70
|
+
import { ownPolicy } from '{{alias.platform}}/resilience/own-policy{{alias.ext}}';
|
|
71
|
+
import type { ResilienceSettings } from '{{alias.platform}}/resilience/resilience-settings{{alias.ext}}';
|
|
72
72
|
|
|
73
73
|
interface JobsOptions {
|
|
74
74
|
readonly start?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PrismaPg } from '@prisma/adapter-pg';
|
|
2
|
-
import { PrismaClient } from '{{alias.generated}}/prisma/client.
|
|
2
|
+
import { PrismaClient } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
export interface ConnectionOptions {
|
|
5
5
|
/** A single-session database (the in-process one of the tests) needs 1. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataSource } from 'typeorm';
|
|
2
|
-
import { entities } from '{{alias.platform}}/database/schema.
|
|
2
|
+
import { entities } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
export interface ConnectionOptions {
|
|
5
5
|
/** Default 10. A single-session database (the in-process one of the tests) needs 1. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataSource } from 'typeorm';
|
|
2
|
-
import { entities } from '{{alias.platform}}/database/schema.
|
|
2
|
+
import { entities } from '{{alias.platform}}/database/schema{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
// Read by the TypeORM CLI only (`npm run db:generate`, `npm run db:migrate`), once compiled.
|
|
5
5
|
export default new DataSource({
|
|
@@ -2,7 +2,7 @@ import type { PgQueryResultHKT } from 'drizzle-orm/pg-core';
|
|
|
2
2
|
import { DrizzleContext } from '@ddd-ts-kit/drizzle/postgres';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The storage of the application, as a repository adapter
|
|
5
|
+
* The storage of the application, as a repository adapter types its constructor parameter by it. Typed
|
|
6
6
|
* on the driver-neutral base, so that the same repositories run on node-postgres in production
|
|
7
7
|
* and on PGlite in the tests.
|
|
8
8
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PrismaContext } from '@ddd-ts-kit/prisma';
|
|
2
|
-
import type { Prisma } from '{{alias.generated}}/prisma/client.
|
|
2
|
+
import type { Prisma } from '{{alias.generated}}/prisma/client{{alias.ext}}';
|
|
3
3
|
|
|
4
|
-
/** The storage of the application, as a repository adapter
|
|
4
|
+
/** The storage of the application, as a repository adapter types its constructor parameter by it: the transaction client of the current unit of work, or the root client. */
|
|
5
5
|
export abstract class Database extends PrismaContext<Prisma.TransactionClient> {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { openPersistence } from '{{alias.platform}}/database/open-persistence.
|
|
2
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
1
|
+
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
2
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
/** For the scripts that only list routes: nothing to connect to here. */
|
|
5
5
|
export function inertPersistence(): Persistence {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { openPersistence } from '{{alias.platform}}/database/open-persistence.
|
|
2
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
1
|
+
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
2
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* For the script that only lists routes: the pool connects on the first query,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createClient } from '{{alias.platform}}/database/create-client.
|
|
2
|
-
import { persistenceOver } from '{{alias.platform}}/database/persistence-over.
|
|
3
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
1
|
+
import { createClient } from '{{alias.platform}}/database/create-client{{alias.ext}}';
|
|
2
|
+
import { persistenceOver } from '{{alias.platform}}/database/persistence-over{{alias.ext}}';
|
|
3
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* For the script that only lists routes: the client connects on the first query,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createDataSource } from '{{alias.platform}}/database/create-data-source.
|
|
2
|
-
import { persistenceOver } from '{{alias.platform}}/database/persistence-over.
|
|
3
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
1
|
+
import { createDataSource } from '{{alias.platform}}/database/create-data-source{{alias.ext}}';
|
|
2
|
+
import { persistenceOver } from '{{alias.platform}}/database/persistence-over{{alias.ext}}';
|
|
3
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* For the script that only lists routes: the data source is never initialised,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it } from '{{tests.module}}';
|
|
2
2
|
import { outboxStoreContract, processedEventStoreContract } from '@ddd-ts-kit/testing/contracts';
|
|
3
|
-
import { openPersistence } from '{{alias.platform}}/database/open-persistence.
|
|
3
|
+
import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
const runner = { describe, it, expect, beforeEach, afterEach };
|
|
6
6
|
|
|
@@ -5,7 +5,7 @@ import { InMemoryOutboxStore, InMemoryRelaySignal } from '@ddd-ts-kit/events';
|
|
|
5
5
|
import { InMemoryOutboxStore } from '@ddd-ts-kit/events';
|
|
6
6
|
{{/unless}}
|
|
7
7
|
import { InMemoryProcessedEventStore, InMemoryUnitOfWork } from '@ddd-ts-kit/kernel';
|
|
8
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
8
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
9
9
|
|
|
10
10
|
{{#if orm.custom}}
|
|
11
11
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { connectToDatabase } from '{{alias.platform}}/database/connect-to-database.
|
|
2
|
-
import { persistenceOver } from '{{alias.platform}}/database/persistence-over.
|
|
3
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
1
|
+
import { connectToDatabase } from '{{alias.platform}}/database/connect-to-database{{alias.ext}}';
|
|
2
|
+
import { persistenceOver } from '{{alias.platform}}/database/persistence-over{{alias.ext}}';
|
|
3
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
export function openPersistence(config: { readonly databaseUrl: string }): Persistence {
|
|
6
6
|
const connection = connectToDatabase(config.databaseUrl);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createClient } from '{{alias.platform}}/database/create-client.
|
|
2
|
-
import { persistenceOver } from '{{alias.platform}}/database/persistence-over.
|
|
3
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
1
|
+
import { createClient } from '{{alias.platform}}/database/create-client{{alias.ext}}';
|
|
2
|
+
import { persistenceOver } from '{{alias.platform}}/database/persistence-over{{alias.ext}}';
|
|
3
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
export async function openPersistence(config: { readonly databaseUrl: string }): Promise<Persistence> {
|
|
6
6
|
const client = createClient(config.databaseUrl);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createDataSource } from '{{alias.platform}}/database/create-data-source.
|
|
2
|
-
import { persistenceOver } from '{{alias.platform}}/database/persistence-over.
|
|
3
|
-
import type { Persistence } from '{{alias.platform}}/database/persistence.
|
|
1
|
+
import { createDataSource } from '{{alias.platform}}/database/create-data-source{{alias.ext}}';
|
|
2
|
+
import { persistenceOver } from '{{alias.platform}}/database/persistence-over{{alias.ext}}';
|
|
3
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
4
4
|
|
|
5
5
|
export async function openPersistence(config: { readonly databaseUrl: string }): Promise<Persistence> {
|
|
6
6
|
const dataSource = createDataSource(config.databaseUrl);
|