ddd-ts-kit 0.90.0 → 0.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +474 -0
- package/README.fr.md +53 -17
- package/README.md +49 -15
- package/dist/acceptance/lock-acceptance.d.ts.map +1 -1
- package/dist/acceptance/lock-acceptance.js +2 -1
- package/dist/acceptance/lock-acceptance.js.map +1 -1
- package/dist/alias/index.d.ts +2 -1
- package/dist/alias/index.d.ts.map +1 -1
- package/dist/alias/index.js +1 -0
- package/dist/alias/index.js.map +1 -1
- package/dist/alias/mapper-target-text.d.ts +4 -0
- package/dist/alias/mapper-target-text.d.ts.map +1 -0
- package/dist/alias/mapper-target-text.js +5 -0
- package/dist/alias/mapper-target-text.js.map +1 -0
- package/dist/alias/module-name-mapper.d.ts +5 -2
- package/dist/alias/module-name-mapper.d.ts.map +1 -1
- package/dist/alias/module-name-mapper.js +5 -2
- package/dist/alias/module-name-mapper.js.map +1 -1
- package/dist/check/alias/test-runners.js +8 -3
- package/dist/check/alias/test-runners.js.map +1 -1
- package/dist/check/baseline/apply-baseline.d.ts +14 -0
- package/dist/check/baseline/apply-baseline.d.ts.map +1 -0
- package/dist/check/baseline/apply-baseline.js +30 -0
- package/dist/check/baseline/apply-baseline.js.map +1 -0
- package/dist/check/baseline/baseline-following-moves.d.ts +9 -0
- package/dist/check/baseline/baseline-following-moves.d.ts.map +1 -0
- package/dist/check/baseline/baseline-following-moves.js +10 -0
- package/dist/check/baseline/baseline-following-moves.js.map +1 -0
- package/dist/check/baseline/baseline-move.d.ts +6 -0
- package/dist/check/baseline/baseline-move.d.ts.map +1 -0
- package/dist/check/baseline/baseline-move.js +2 -0
- package/dist/check/baseline/baseline-move.js.map +1 -0
- package/dist/check/baseline/baseline-text.d.ts +4 -0
- package/dist/check/baseline/baseline-text.d.ts.map +1 -0
- package/dist/check/baseline/baseline-text.js +12 -0
- package/dist/check/baseline/baseline-text.js.map +1 -0
- package/dist/check/baseline/baseline.d.ts +6 -0
- package/dist/check/baseline/baseline.d.ts.map +1 -0
- package/dist/check/baseline/baseline.js +2 -0
- package/dist/check/baseline/baseline.js.map +1 -0
- package/dist/check/baseline/moved-baseline-text.d.ts +4 -0
- package/dist/check/baseline/moved-baseline-text.d.ts.map +1 -0
- package/dist/check/baseline/moved-baseline-text.js +13 -0
- package/dist/check/baseline/moved-baseline-text.js.map +1 -0
- package/dist/check/baseline/parse-baseline.d.ts +4 -0
- package/dist/check/baseline/parse-baseline.d.ts.map +1 -0
- package/dist/check/baseline/parse-baseline.js +19 -0
- package/dist/check/baseline/parse-baseline.js.map +1 -0
- package/dist/check/baseline/pruned-baseline.d.ts +5 -0
- package/dist/check/baseline/pruned-baseline.d.ts.map +1 -0
- package/dist/check/baseline/pruned-baseline.js +14 -0
- package/dist/check/baseline/pruned-baseline.js.map +1 -0
- package/dist/check/baseline/read-baseline.d.ts +6 -0
- package/dist/check/baseline/read-baseline.d.ts.map +1 -0
- package/dist/check/baseline/read-baseline.js +11 -0
- package/dist/check/baseline/read-baseline.js.map +1 -0
- package/dist/check/baseline/recorded-baseline.d.ts +5 -0
- package/dist/check/baseline/recorded-baseline.d.ts.map +1 -0
- package/dist/check/baseline/recorded-baseline.js +11 -0
- package/dist/check/baseline/recorded-baseline.js.map +1 -0
- package/dist/check/baseline/renamed-files.d.ts +8 -0
- package/dist/check/baseline/renamed-files.d.ts.map +1 -0
- package/dist/check/baseline/renamed-files.js +23 -0
- package/dist/check/baseline/renamed-files.js.map +1 -0
- package/dist/check/baseline/write-baseline.d.ts +4 -0
- package/dist/check/baseline/write-baseline.d.ts.map +1 -0
- package/dist/check/baseline/write-baseline.js +9 -0
- package/dist/check/baseline/write-baseline.js.map +1 -0
- package/dist/check/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +5 -1
- package/dist/check/canonical/stray-entry.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/commands/check-command.d.ts.map +1 -1
- package/dist/check/commands/check-command.js +46 -1
- package/dist/check/commands/check-command.js.map +1 -1
- package/dist/check/commands/check-file-command.d.ts +5 -0
- package/dist/check/commands/check-file-command.d.ts.map +1 -1
- package/dist/check/commands/check-file-command.js +27 -6
- package/dist/check/commands/check-file-command.js.map +1 -1
- package/dist/check/event-sourcing/read-stored-shape.d.ts +2 -0
- package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
- package/dist/check/event-sourcing/read-stored-shape.js +3 -1
- 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/nest-docs.d.ts +3 -0
- package/dist/check/explain/nest-docs.d.ts.map +1 -0
- package/dist/check/explain/nest-docs.js +31 -0
- package/dist/check/explain/nest-docs.js.map +1 -0
- package/dist/check/explain/rule-docs.d.ts.map +1 -1
- package/dist/check/explain/rule-docs.js +2 -0
- package/dist/check/explain/rule-docs.js.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/authz-declared-fixtures.js +1 -1
- package/dist/check/fixtures/authz-declared-fixtures.js.map +1 -1
- 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/nest-controllers-fixtures.d.ts +3 -0
- package/dist/check/fixtures/nest-controllers-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/nest-controllers-fixtures.js +104 -0
- package/dist/check/fixtures/nest-controllers-fixtures.js.map +1 -0
- package/dist/check/fixtures/nest-fixtures.d.ts +3 -0
- package/dist/check/fixtures/nest-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/nest-fixtures.js +59 -0
- package/dist/check/fixtures/nest-fixtures.js.map +1 -0
- package/dist/check/nest/nest-equivalents-of.d.ts +14 -0
- package/dist/check/nest/nest-equivalents-of.d.ts.map +1 -0
- package/dist/check/nest/nest-equivalents-of.js +124 -0
- package/dist/check/nest/nest-equivalents-of.js.map +1 -0
- package/dist/check/project/load-project.d.ts +2 -0
- package/dist/check/project/load-project.d.ts.map +1 -1
- package/dist/check/project/load-project.js +7 -3
- package/dist/check/project/load-project.js.map +1 -1
- package/dist/check/rules/nest-controllers-current.d.ts +3 -0
- package/dist/check/rules/nest-controllers-current.d.ts.map +1 -0
- package/dist/check/rules/nest-controllers-current.js +54 -0
- package/dist/check/rules/nest-controllers-current.js.map +1 -0
- package/dist/check/rules/nest-no-parallel-pipeline.d.ts +3 -0
- package/dist/check/rules/nest-no-parallel-pipeline.d.ts.map +1 -0
- package/dist/check/rules/nest-no-parallel-pipeline.js +70 -0
- package/dist/check/rules/nest-no-parallel-pipeline.js.map +1 -0
- package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
- package/dist/check/support/is-generated-context-file.js +4 -1
- package/dist/check/support/is-generated-context-file.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +13 -5
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +21 -1
- package/dist/commands/drizzle-generate.js.map +1 -1
- package/dist/commands/generate.js +2 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/prisma-generate.d.ts +7 -0
- package/dist/commands/prisma-generate.d.ts.map +1 -0
- package/dist/commands/prisma-generate.js +23 -0
- package/dist/commands/prisma-generate.js.map +1 -0
- package/dist/commands/typeorm-generate.d.ts +10 -0
- package/dist/commands/typeorm-generate.d.ts.map +1 -0
- package/dist/commands/typeorm-generate.js +37 -0
- package/dist/commands/typeorm-generate.js.map +1 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/parse-config.js +1 -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/serialize-config.js +9 -2
- package/dist/config/serialize-config.js.map +1 -1
- package/dist/config/stack.d.ts +18 -5
- package/dist/config/stack.d.ts.map +1 -1
- package/dist/config/stack.js +5 -2
- package/dist/config/stack.js.map +1 -1
- package/dist/describe/guard-errors.d.ts +3 -0
- package/dist/describe/guard-errors.d.ts.map +1 -0
- package/dist/describe/guard-errors.js +10 -0
- package/dist/describe/guard-errors.js.map +1 -0
- package/dist/describe/no-group.d.ts +4 -0
- package/dist/describe/no-group.d.ts.map +1 -0
- package/dist/describe/no-group.js +3 -0
- package/dist/describe/no-group.js.map +1 -0
- package/dist/describe/read-controllers.d.ts +1 -1
- package/dist/describe/read-controllers.d.ts.map +1 -1
- package/dist/describe/read-controllers.js +12 -19
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/read-nest-controller-routes.d.ts +16 -0
- package/dist/describe/read-nest-controller-routes.d.ts.map +1 -0
- package/dist/describe/read-nest-controller-routes.js +117 -0
- package/dist/describe/read-nest-controller-routes.js.map +1 -0
- package/dist/describe/schema-class-of.d.ts +3 -0
- package/dist/describe/schema-class-of.d.ts.map +1 -0
- package/dist/describe/schema-class-of.js +10 -0
- package/dist/describe/schema-class-of.js.map +1 -0
- package/dist/dev/refresh-declarations.d.ts.map +1 -1
- package/dist/dev/refresh-declarations.js +4 -1
- package/dist/dev/refresh-declarations.js.map +1 -1
- package/dist/docs/declared-stored-events.d.ts +6 -2
- package/dist/docs/declared-stored-events.d.ts.map +1 -1
- package/dist/docs/declared-stored-events.js +4 -3
- package/dist/docs/declared-stored-events.js.map +1 -1
- package/dist/docs/emptily-recorded-stored-events.d.ts +6 -0
- package/dist/docs/emptily-recorded-stored-events.d.ts.map +1 -0
- package/dist/docs/emptily-recorded-stored-events.js +12 -0
- package/dist/docs/emptily-recorded-stored-events.js.map +1 -0
- package/dist/docs/refuse-unreadable-stored-events.d.ts +7 -0
- package/dist/docs/refuse-unreadable-stored-events.d.ts.map +1 -0
- package/dist/docs/refuse-unreadable-stored-events.js +27 -0
- package/dist/docs/refuse-unreadable-stored-events.js.map +1 -0
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +2 -0
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/docs/write-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 +5 -2
- package/dist/docs/write-stored-events-lock.js.map +1 -1
- package/dist/file-moves/move-files.d.ts.map +1 -1
- package/dist/file-moves/move-files.js +10 -0
- package/dist/file-moves/move-files.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/aggregate-kind.d.ts.map +1 -1
- package/dist/generate/kinds/aggregate-kind.js +6 -2
- package/dist/generate/kinds/aggregate-kind.js.map +1 -1
- package/dist/generate/kinds/assert-event-store.d.ts +4 -0
- package/dist/generate/kinds/assert-event-store.d.ts.map +1 -0
- package/dist/generate/kinds/assert-event-store.js +10 -0
- package/dist/generate/kinds/assert-event-store.js.map +1 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts +9 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +49 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -0
- package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload-kind.js +9 -2
- package/dist/generate/kinds/file-upload-kind.js.map +1 -1
- package/dist/generate/kinds/form-kind.d.ts.map +1 -1
- package/dist/generate/kinds/form-kind.js +15 -11
- package/dist/generate/kinds/form-kind.js.map +1 -1
- package/dist/generate/kinds/generate-event-sourced-repository.d.ts +11 -0
- package/dist/generate/kinds/generate-event-sourced-repository.d.ts.map +1 -0
- package/dist/generate/kinds/generate-event-sourced-repository.js +48 -0
- package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -0
- package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
- package/dist/generate/kinds/generate-repository.js +5 -0
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/is-event-sourced.d.ts +9 -0
- package/dist/generate/kinds/is-event-sourced.d.ts.map +1 -0
- package/dist/generate/kinds/is-event-sourced.js +11 -0
- package/dist/generate/kinds/is-event-sourced.js.map +1 -0
- package/dist/generate/kinds/presentation/controller-source.d.ts +11 -3
- package/dist/generate/kinds/presentation/controller-source.d.ts.map +1 -1
- package/dist/generate/kinds/presentation/controller-source.js +25 -4
- package/dist/generate/kinds/presentation/controller-source.js.map +1 -1
- package/dist/generate/kinds/property-kind.d.ts +3 -0
- package/dist/generate/kinds/property-kind.d.ts.map +1 -0
- package/dist/generate/kinds/property-kind.js +51 -0
- package/dist/generate/kinds/property-kind.js.map +1 -0
- package/dist/generate/kinds/repository-kind.js +1 -1
- package/dist/generate/kinds/repository-kind.js.map +1 -1
- package/dist/generate/kinds/representation-kind.d.ts.map +1 -1
- package/dist/generate/kinds/representation-kind.js +4 -3
- package/dist/generate/kinds/representation-kind.js.map +1 -1
- package/dist/generate/kinds/route/nest-controller-vars.d.ts +11 -0
- package/dist/generate/kinds/route/nest-controller-vars.d.ts.map +1 -0
- package/dist/generate/kinds/route/nest-controller-vars.js +91 -0
- package/dist/generate/kinds/route/nest-controller-vars.js.map +1 -0
- package/dist/generate/kinds/route/nest-search-vars.d.ts +6 -0
- package/dist/generate/kinds/route/nest-search-vars.d.ts.map +1 -0
- package/dist/generate/kinds/route/nest-search-vars.js +18 -0
- package/dist/generate/kinds/route/nest-search-vars.js.map +1 -0
- package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
- package/dist/generate/kinds/route/route-vars.js +1 -9
- package/dist/generate/kinds/route/route-vars.js.map +1 -1
- package/dist/generate/kinds/route/success-status.d.ts +5 -0
- package/dist/generate/kinds/route/success-status.d.ts.map +1 -0
- package/dist/generate/kinds/route/success-status.js +11 -0
- package/dist/generate/kinds/route/success-status.js.map +1 -0
- package/dist/generate/kinds/route/write-nest-controller.d.ts +8 -0
- package/dist/generate/kinds/route/write-nest-controller.d.ts.map +1 -0
- package/dist/generate/kinds/route/write-nest-controller.js +50 -0
- package/dist/generate/kinds/route/write-nest-controller.js.map +1 -0
- package/dist/generate/kinds/route-kind.d.ts.map +1 -1
- package/dist/generate/kinds/route-kind.js +6 -1
- package/dist/generate/kinds/route-kind.js.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.js +2 -1
- package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
- package/dist/generate/kinds/write-event-sourced-aggregate.js +5 -13
- package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +2 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/refresh-docs.d.ts.map +1 -1
- package/dist/generate/refresh-docs.js +2 -0
- package/dist/generate/refresh-docs.js.map +1 -1
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +5 -0
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +3 -1
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +7 -3
- package/dist/help/usage.js.map +1 -1
- package/dist/init/agent-permissions.js +12 -6
- package/dist/init/agent-permissions.js.map +1 -1
- package/dist/init/files/audit-files.js +1 -1
- package/dist/init/files/audit-files.js.map +1 -1
- package/dist/init/files/auth-files.js +4 -0
- package/dist/init/files/auth-files.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +2 -0
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/platform-files.js +1 -0
- package/dist/init/files/platform-files.js.map +1 -1
- package/dist/init/knip-vars.d.ts.map +1 -1
- package/dist/init/knip-vars.js +14 -5
- package/dist/init/knip-vars.js.map +1 -1
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +10 -4
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/dependencies-against-stack.d.ts +18 -0
- package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -0
- package/dist/init/manifest/dependencies-against-stack.js +99 -0
- package/dist/init/manifest/dependencies-against-stack.js.map +1 -0
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +19 -3
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/scripts-for.js +5 -2
- package/dist/init/manifest/scripts-for.js.map +1 -1
- package/dist/init/manifest/versions.d.ts.map +1 -1
- package/dist/init/manifest/versions.js +40 -30
- package/dist/init/manifest/versions.js.map +1 -1
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +14 -1
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/stack/resolve-queue.d.ts +4 -10
- package/dist/init/stack/resolve-queue.d.ts.map +1 -1
- package/dist/init/stack/resolve-queue.js +7 -11
- package/dist/init/stack/resolve-queue.js.map +1 -1
- package/dist/init/stack/resolve-stack.d.ts.map +1 -1
- package/dist/init/stack/resolve-stack.js +30 -9
- package/dist/init/stack/resolve-stack.js.map +1 -1
- package/dist/init/stack/stack-options.d.ts +2 -0
- package/dist/init/stack/stack-options.d.ts.map +1 -1
- package/dist/init/template-vars.js +1 -1
- package/dist/init/template-vars.js.map +1 -1
- package/dist/init/write-type-script-configs.d.ts.map +1 -1
- package/dist/init/write-type-script-configs.js +4 -1
- package/dist/init/write-type-script-configs.js.map +1 -1
- package/dist/markers/insert-in-region.js +1 -1
- package/dist/markers/insert-in-region.js.map +1 -1
- package/dist/merge/lost/untouched-by-branch.d.ts +12 -0
- package/dist/merge/lost/untouched-by-branch.d.ts.map +1 -0
- package/dist/merge/lost/untouched-by-branch.js +22 -0
- package/dist/merge/lost/untouched-by-branch.js.map +1 -0
- package/dist/merge/lost/verify-merge.d.ts.map +1 -1
- package/dist/merge/lost/verify-merge.js +6 -1
- package/dist/merge/lost/verify-merge.js.map +1 -1
- package/dist/migration/audit-guard/append-audit-guard.d.ts +18 -0
- package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -0
- package/dist/migration/audit-guard/append-audit-guard.js +27 -0
- package/dist/migration/audit-guard/append-audit-guard.js.map +1 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.d.ts +7 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.d.ts.map +1 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.js +18 -0
- package/dist/migration/audit-guard/audit-guard-statements-of.js.map +1 -0
- package/dist/migration/audit-guard/audit-schema-created.d.ts +3 -0
- package/dist/migration/audit-guard/audit-schema-created.d.ts.map +1 -0
- package/dist/migration/audit-guard/audit-schema-created.js +9 -0
- package/dist/migration/audit-guard/audit-schema-created.js.map +1 -0
- package/dist/migration/audit-guard/generate-guarded.d.ts +16 -0
- package/dist/migration/audit-guard/generate-guarded.d.ts.map +1 -0
- package/dist/migration/audit-guard/generate-guarded.js +22 -0
- package/dist/migration/audit-guard/generate-guarded.js.map +1 -0
- package/dist/migration/audit-guard/guard-marker.d.ts +3 -0
- package/dist/migration/audit-guard/guard-marker.d.ts.map +1 -0
- package/dist/migration/audit-guard/guard-marker.js +3 -0
- package/dist/migration/audit-guard/guard-marker.js.map +1 -0
- package/dist/migration/audit-guard/guarded-text.d.ts +5 -0
- package/dist/migration/audit-guard/guarded-text.d.ts.map +1 -0
- package/dist/migration/audit-guard/guarded-text.js +26 -0
- package/dist/migration/audit-guard/guarded-text.js.map +1 -0
- package/dist/migration/audit-guard/migrations-under.d.ts +3 -0
- package/dist/migration/audit-guard/migrations-under.d.ts.map +1 -0
- package/dist/migration/audit-guard/migrations-under.js +15 -0
- package/dist/migration/audit-guard/migrations-under.js.map +1 -0
- package/dist/migration/audit-guard/run-orm-tool.d.ts +3 -0
- package/dist/migration/audit-guard/run-orm-tool.d.ts.map +1 -0
- package/dist/migration/audit-guard/run-orm-tool.js +13 -0
- package/dist/migration/audit-guard/run-orm-tool.js.map +1 -0
- package/dist/migration/audit-guard/schemas-first.d.ts +6 -0
- package/dist/migration/audit-guard/schemas-first.d.ts.map +1 -0
- package/dist/migration/audit-guard/schemas-first.js +17 -0
- package/dist/migration/audit-guard/schemas-first.js.map +1 -0
- package/dist/migration/audit-guard/schemas-if-missing.d.ts +7 -0
- package/dist/migration/audit-guard/schemas-if-missing.d.ts.map +1 -0
- package/dist/migration/audit-guard/schemas-if-missing.js +9 -0
- package/dist/migration/audit-guard/schemas-if-missing.js.map +1 -0
- package/dist/migration/audit-guard/type-only-imports.d.ts +6 -0
- package/dist/migration/audit-guard/type-only-imports.d.ts.map +1 -0
- package/dist/migration/audit-guard/type-only-imports.js +8 -0
- package/dist/migration/audit-guard/type-only-imports.js.map +1 -0
- package/dist/migration/format-as-the-project.d.ts +4 -0
- package/dist/migration/format-as-the-project.d.ts.map +1 -0
- package/dist/migration/format-as-the-project.js +27 -0
- package/dist/migration/format-as-the-project.js.map +1 -0
- package/dist/migration/format-written-files.d.ts.map +1 -1
- package/dist/migration/format-written-files.js +2 -24
- package/dist/migration/format-written-files.js.map +1 -1
- package/dist/migration/index.d.ts +8 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +8 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/nest-controllers/controllers-file.d.ts +3 -0
- package/dist/nest-controllers/controllers-file.d.ts.map +1 -0
- package/dist/nest-controllers/controllers-file.js +5 -0
- package/dist/nest-controllers/controllers-file.js.map +1 -0
- package/dist/nest-controllers/nest-answer.d.ts +8 -0
- package/dist/nest-controllers/nest-answer.d.ts.map +1 -0
- package/dist/nest-controllers/nest-answer.js +2 -0
- package/dist/nest-controllers/nest-answer.js.map +1 -0
- package/dist/nest-controllers/nest-controller-entry.d.ts +18 -0
- package/dist/nest-controllers/nest-controller-entry.d.ts.map +1 -0
- package/dist/nest-controllers/nest-controller-entry.js +2 -0
- package/dist/nest-controllers/nest-controller-entry.js.map +1 -0
- package/dist/nest-controllers/nest-controllers-in.d.ts +6 -0
- package/dist/nest-controllers/nest-controllers-in.d.ts.map +1 -0
- package/dist/nest-controllers/nest-controllers-in.js +108 -0
- package/dist/nest-controllers/nest-controllers-in.js.map +1 -0
- package/dist/nest-controllers/nest-read-type.d.ts +12 -0
- package/dist/nest-controllers/nest-read-type.d.ts.map +1 -0
- package/dist/nest-controllers/nest-read-type.js +2 -0
- package/dist/nest-controllers/nest-read-type.js.map +1 -0
- package/dist/nest-controllers/nest-request-part.d.ts +9 -0
- package/dist/nest-controllers/nest-request-part.d.ts.map +1 -0
- package/dist/nest-controllers/nest-request-part.js +2 -0
- package/dist/nest-controllers/nest-request-part.js.map +1 -0
- package/dist/nest-controllers/parameters-of.d.ts +8 -0
- package/dist/nest-controllers/parameters-of.d.ts.map +1 -0
- package/dist/nest-controllers/parameters-of.js +32 -0
- package/dist/nest-controllers/parameters-of.js.map +1 -0
- package/dist/nest-controllers/project-files.d.ts +6 -0
- package/dist/nest-controllers/project-files.d.ts.map +1 -0
- package/dist/nest-controllers/project-files.js +2 -0
- package/dist/nest-controllers/project-files.js.map +1 -0
- package/dist/nest-controllers/read-nest-controllers.d.ts +12 -0
- package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -0
- package/dist/nest-controllers/read-nest-controllers.js +17 -0
- package/dist/nest-controllers/read-nest-controllers.js.map +1 -0
- package/dist/nest-controllers/refresh-nest-controllers.d.ts +9 -0
- package/dist/nest-controllers/refresh-nest-controllers.d.ts.map +1 -0
- package/dist/nest-controllers/refresh-nest-controllers.js +32 -0
- package/dist/nest-controllers/refresh-nest-controllers.js.map +1 -0
- package/dist/nest-controllers/render-controllers-file.d.ts +9 -0
- package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -0
- package/dist/nest-controllers/render-controllers-file.js +72 -0
- package/dist/nest-controllers/render-controllers-file.js.map +1 -0
- package/dist/platform-folders/platform-folders.d.ts.map +1 -1
- package/dist/platform-folders/platform-folders.js +10 -0
- package/dist/platform-folders/platform-folders.js.map +1 -1
- package/dist/platform-layout/platform-layout.d.ts +3 -0
- package/dist/platform-layout/platform-layout.d.ts.map +1 -1
- package/dist/platform-layout/platform-layout.js +3 -0
- package/dist/platform-layout/platform-layout.js.map +1 -1
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +22 -2
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-preset.d.ts.map +1 -1
- package/dist/presets/identity-preset.js +4 -1
- package/dist/presets/identity-preset.js.map +1 -1
- package/dist/presets/identity-refusal.d.ts.map +1 -1
- package/dist/presets/identity-refusal.js +14 -8
- package/dist/presets/identity-refusal.js.map +1 -1
- package/dist/presets/lay-out-prisma-models.d.ts +8 -0
- package/dist/presets/lay-out-prisma-models.d.ts.map +1 -0
- package/dist/presets/lay-out-prisma-models.js +51 -0
- package/dist/presets/lay-out-prisma-models.js.map +1 -0
- package/dist/presets/preset-files.d.ts.map +1 -1
- package/dist/presets/preset-files.js +6 -1
- package/dist/presets/preset-files.js.map +1 -1
- package/dist/presets/preset.d.ts +11 -0
- package/dist/presets/preset.d.ts.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +4 -0
- package/dist/run.js.map +1 -1
- package/dist/sdk/client-files.d.ts +5 -3
- package/dist/sdk/client-files.d.ts.map +1 -1
- package/dist/sdk/client-files.js +8 -3
- package/dist/sdk/client-files.js.map +1 -1
- package/dist/sdk/client-manifest.d.ts +3 -0
- package/dist/sdk/client-manifest.d.ts.map +1 -1
- package/dist/sdk/client-manifest.js +15 -2
- package/dist/sdk/client-manifest.js.map +1 -1
- package/dist/sdk/client-operation.d.ts +6 -0
- package/dist/sdk/client-operation.d.ts.map +1 -1
- package/dist/sdk/read-operation.d.ts.map +1 -1
- package/dist/sdk/read-operation.js +6 -0
- package/dist/sdk/read-operation.js.map +1 -1
- package/dist/sdk/render-orpc.d.ts +8 -0
- package/dist/sdk/render-orpc.d.ts.map +1 -0
- package/dist/sdk/render-orpc.js +42 -0
- package/dist/sdk/render-orpc.js.map +1 -0
- package/dist/sdk/render-readme.d.ts +3 -0
- package/dist/sdk/render-readme.d.ts.map +1 -1
- package/dist/sdk/render-readme.js +46 -0
- package/dist/sdk/render-readme.js.map +1 -1
- package/dist/sdk/render-trpc.d.ts +9 -0
- package/dist/sdk/render-trpc.d.ts.map +1 -0
- package/dist/sdk/render-trpc.js +36 -0
- package/dist/sdk/render-trpc.js.map +1 -0
- package/dist/sdk/rpc-packages.d.ts +7 -0
- package/dist/sdk/rpc-packages.d.ts.map +1 -0
- package/dist/sdk/rpc-packages.js +9 -0
- package/dist/sdk/rpc-packages.js.map +1 -0
- package/dist/sdk/rpc.d.ts +4 -0
- package/dist/sdk/rpc.d.ts.map +1 -0
- package/dist/sdk/rpc.js +2 -0
- package/dist/sdk/rpc.js.map +1 -0
- package/dist/sdk/write-clients.d.ts.map +1 -1
- package/dist/sdk/write-clients.js +18 -3
- package/dist/sdk/write-clients.js.map +1 -1
- package/dist/stack/alias-vars.d.ts.map +1 -1
- package/dist/stack/alias-vars.js +2 -2
- package/dist/stack/alias-vars.js.map +1 -1
- package/dist/stack/audit-vars.js +1 -1
- package/dist/stack/audit-vars.js.map +1 -1
- package/dist/stack/authentication-vars.d.ts.map +1 -1
- package/dist/stack/authentication-vars.js +8 -2
- package/dist/stack/authentication-vars.js.map +1 -1
- package/dist/stack/cache-vars.d.ts +5 -1
- package/dist/stack/cache-vars.d.ts.map +1 -1
- package/dist/stack/cache-vars.js +9 -3
- package/dist/stack/cache-vars.js.map +1 -1
- package/dist/stack/stack-vars.d.ts +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +11 -6
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/briefing-of.d.ts.map +1 -1
- package/dist/worker/briefing-of.js +2 -4
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/worker/resume-message.d.ts.map +1 -1
- package/dist/worker/resume-message.js +1 -2
- package/dist/worker/resume-message.js.map +1 -1
- package/package.json +6 -4
- package/templates/architecture/extractable.declared.spec.ts.tpl +22 -17
- package/templates/architecture/extractable.manual.spec.ts.tpl +14 -9
- package/templates/architecture/extractable.tsyringe.spec.ts.tpl +19 -14
- package/templates/background-job/wiring.manual.tpl +1 -1
- package/templates/command/wiring.manual.tpl +1 -1
- package/templates/context/module.manual.ts.tpl +52 -10
- package/templates/erasure-handler/wiring.manual.tpl +1 -1
- package/templates/event-handler/wiring.manual.tpl +1 -1
- package/templates/file-upload/wiring.manual.tpl +1 -1
- package/templates/init/docker/env.example.tpl +1 -1
- package/templates/init/e2e/auth-environment.passport.ts.tpl +6 -0
- package/templates/init/e2e/create-credentials.passport.ts.tpl +47 -0
- package/templates/init/jest.config.js.tpl +6 -0
- package/templates/init/platform/auth/authentication/actor-of-token.ts.tpl +15 -0
- package/templates/init/platform/auth/authentication/bearer-strategy.ts.tpl +29 -0
- package/templates/init/platform/auth/authentication/create-authenticator.passport.ts.tpl +13 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +55 -2
- package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +1 -1
- package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/composition/platform-error-mapper.ts.tpl +9 -0
- package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +11 -0
- package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +14 -5
- package/templates/init/platform/config/app-config.ts.tpl +2 -2
- package/templates/init/platform/config/load-config.ts.tpl +2 -2
- package/templates/init/platform/database/open-persistence.memory.ts.tpl +10 -0
- package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +6 -1
- package/templates/init/platform/database/persistence-over.knex.ts.tpl +6 -1
- package/templates/init/platform/database/persistence-over.prisma.ts.tpl +12 -1
- package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +28 -1
- package/templates/init/platform/database/persistence.contract.spec.ts.tpl +131 -0
- package/templates/init/platform/database/persistence.memory.ts.tpl +7 -1
- package/templates/init/platform/database/persistence.orm.ts.tpl +16 -3
- package/templates/init/platform/database/schema.drizzle.ts.tpl +11 -1
- package/templates/init/platform/database/schema.prisma.tpl +5 -2
- package/templates/init/platform/database/schema.typeorm.ts.tpl +17 -3
- package/templates/init/platform/database/table-statements.drizzle.ts.tpl +36 -0
- package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +18 -6
- package/templates/init/platform/files/bind-files.tsyringe.ts.tpl +1 -1
- package/templates/init/platform/files/create-files.ts.tpl +1 -1
- package/templates/init/platform/http/create-app-module.ts.tpl +20 -0
- package/templates/init/platform/http/start-http-server.express.ts.tpl +58 -2
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +50 -2
- package/templates/init/platform/http/start-http-server.hono.ts.tpl +60 -1
- package/templates/init/platform/http/start-http-server.nest.ts.tpl +67 -4
- package/templates/init/platform/jobs/create-background-work.ts.tpl +2 -2
- package/templates/init/rules/infrastructure.md.tpl +3 -0
- package/templates/init/rules/presentation.md.tpl +7 -0
- package/templates/integration-event/wiring.manual.tpl +1 -1
- package/templates/integration-handler/wiring.manual.tpl +1 -1
- package/templates/job/wiring.manual.tpl +1 -1
- package/templates/nest-controller/controller.search.ts.tpl +38 -0
- package/templates/nest-controller/controller.spec.ts.tpl +57 -0
- package/templates/nest-controller/controller.ts.tpl +49 -0
- package/templates/nest-controller/upload.spec.ts.tpl +47 -0
- package/templates/nest-controller/upload.ts.tpl +25 -0
- package/templates/pipeline/biome.json.tpl +2 -2
- package/templates/pipeline/eslint.config.mjs.tpl +6 -0
- package/templates/pipeline/knip.json.tpl +4 -8
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +271 -0
- package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +10 -0
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +6 -0
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/integration/handlers/account-deactivated.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/member-joined.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/member-removed.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/handlers/organisation-opened.integration-handler.ts.tpl +4 -0
- package/templates/presets/identity/context/application/integration/publishers/account-deactivated.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/delegation-granted.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/delegation-revoked.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-joined.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-removed.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/member-role-changed.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/integration/publishers/organisation-opened.publisher.ts.tpl +10 -1
- package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +12 -0
- package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +6 -0
- package/templates/presets/identity/context/infrastructure/external/crypto-invitation-tokens.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/external/environment-identity-provider-connection.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/external/keycloak-identity-provider-admin.adapter.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.mapper.prisma.ts.tpl +36 -0
- package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.prisma.ts.tpl +19 -0
- package/templates/presets/identity/context/infrastructure/persistence/delegation.mapper.prisma.ts.tpl +48 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-search-members-reader.repository.drizzle.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +43 -0
- package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.prisma.ts.tpl +20 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-account.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-delegation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-invitation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-member.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-organisation.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/knex-search-members-reader.repository.knex.ts.tpl +9 -0
- package/templates/presets/identity/context/infrastructure/persistence/member.mapper.prisma.ts.tpl +34 -0
- package/templates/presets/identity/context/infrastructure/persistence/organisation.mapper.prisma.ts.tpl +26 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +63 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +81 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +69 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +80 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +63 -0
- package/templates/presets/identity/context/infrastructure/persistence/prisma-search-members-reader.repository.prisma.ts.tpl +82 -0
- package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/deactivate-account.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.controller.nest-routes.ts.tpl +44 -0
- package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +56 -0
- package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.controller.nest-routes.ts.tpl +54 -0
- package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.controller.nest-routes.ts.tpl +32 -0
- package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.controller.nest-routes.ts.tpl +43 -0
- package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.controller.nest-routes.ts.tpl +25 -0
- package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.controller.nest-routes.ts.tpl +37 -0
- package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.controller.nest-routes.ts.tpl +31 -0
- package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.controller.nest-routes.ts.tpl +42 -0
- package/templates/presets/identity/context/test/integration/account.repository.contract.spec.ts.tpl +3 -3
- package/templates/presets/identity/context/test/integration/delegation.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/member.repository.contract.spec.ts.tpl +5 -5
- package/templates/presets/identity/context/test/integration/organisation.repository.contract.spec.ts.tpl +4 -4
- package/templates/presets/identity/context/test/integration/search-members-reader.spec.ts.tpl +8 -8
- package/templates/presets/identity/context/test/unit/__context__.module.spec.explicit.ts.tpl +108 -0
- package/templates/presets/identity/context/test/unit/accept-invitation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/change-member-role.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/deactivate-account.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/decline-invitation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/grant-delegation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/invite-member.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/open-organisation.controller.spec.nest-routes.ts.tpl +70 -0
- package/templates/presets/identity/context/test/unit/provision-account.controller.spec.nest-routes.ts.tpl +99 -0
- package/templates/presets/identity/context/test/unit/remove-member.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/revoke-delegation.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/revoke-invitation.controller.spec.nest-routes.ts.tpl +57 -0
- package/templates/presets/identity/context/test/unit/search-members.controller.spec.nest-routes.ts.tpl +54 -0
- package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +332 -0
- package/templates/presets/identity/explicit/access-policies.wiring.tpl +16 -0
- package/templates/presets/identity/prisma/models.prisma.tpl +128 -0
- package/templates/process/timeout-job.wiring.manual.tpl +1 -1
- package/templates/property/value-object.properties.spec.ts.tpl +38 -0
- package/templates/query/search.wiring.manual.tpl +1 -1
- package/templates/query/wiring.manual.tpl +1 -1
- package/templates/repository/contract.spec.ts.tpl +1 -3
- package/templates/repository/event-sourced/contract.spec.ts.tpl +36 -0
- package/templates/repository/event-sourced/fake.ts.tpl +24 -0
- package/templates/repository/event-sourced/repository.ts.tpl +38 -0
- package/templates/repository/event-sourced-first-use.wiring.manual.tpl +4 -0
- package/templates/repository/event-sourced.wiring.tsyringe.tpl +6 -0
- package/templates/repository/first-use.wiring.manual.tpl +1 -1
- package/templates/sdk/orpc.ts.tpl +46 -0
- package/templates/sdk/trpc.ts.tpl +86 -0
- /package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/{deactivate-account.controller.ts.tpl → deactivate-account.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/accounts/provision-account/{provision-account.controller.ts.tpl → provision-account.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/{accept-invitation.controller.ts.tpl → accept-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/{decline-invitation.controller.ts.tpl → decline-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/change-member-role/{change-member-role.controller.ts.tpl → change-member-role.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/{grant-delegation.controller.ts.tpl → grant-delegation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/invite-member/{invite-member.controller.ts.tpl → invite-member.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/open-organisation/{open-organisation.controller.ts.tpl → open-organisation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/remove-member/{remove-member.controller.ts.tpl → remove-member.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/{revoke-delegation.controller.ts.tpl → revoke-delegation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/{revoke-invitation.controller.ts.tpl → revoke-invitation.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/presentation/http/organisations/search-members/{search-members.controller.ts.tpl → search-members.controller.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{accept-invitation.controller.spec.ts.tpl → accept-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{change-member-role.controller.spec.ts.tpl → change-member-role.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{deactivate-account.controller.spec.ts.tpl → deactivate-account.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{decline-invitation.controller.spec.ts.tpl → decline-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{grant-delegation.controller.spec.ts.tpl → grant-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{invite-member.controller.spec.ts.tpl → invite-member.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{open-organisation.controller.spec.ts.tpl → open-organisation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{provision-account.controller.spec.ts.tpl → provision-account.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{remove-member.controller.spec.ts.tpl → remove-member.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{revoke-delegation.controller.spec.ts.tpl → revoke-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{revoke-invitation.controller.spec.ts.tpl → revoke-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/unit/{search-members.controller.spec.ts.tpl → search-members.controller.spec.kit-routes.ts.tpl} +0 -0
- /package/templates/presets/identity/context/test/worlds/{__context__.world.ts.tpl → __context__.world.declared.ts.tpl} +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { CONFIG_FILE } from '../../config/index.js';
|
|
2
|
+
import { renderControllersFile } from '../../nest-controllers/render-controllers-file.js';
|
|
3
|
+
import { config } from './config.js';
|
|
4
|
+
import { PATHS } from './paths.js';
|
|
5
|
+
import { project } from './project.js';
|
|
6
|
+
const { BILLING, CATALOG } = PATHS;
|
|
7
|
+
const RULE = 'nest/controllers-current';
|
|
8
|
+
const FOLDER = `${BILLING}/presentation/http/invoices/issue-invoice`;
|
|
9
|
+
const CONTROLLER = `${FOLDER}/issue-invoice.controller.ts`;
|
|
10
|
+
const ANSWER = `${FOLDER}/issue-invoice.answer.ts`;
|
|
11
|
+
const BILLING_FILE = `${BILLING}/billing.controllers.ts`;
|
|
12
|
+
const CATALOG_FILE = `${CATALOG}/catalog.controllers.ts`;
|
|
13
|
+
const NEST = { stack: { http: 'nest', di: 'nest', validation: 'class-validator', routes: 'nest' } };
|
|
14
|
+
const controller = (answered, taken = '') => `import { Body, Controller, Post } from '@nestjs/common';
|
|
15
|
+
import { KitRoutes } from '@ddd-ts-kit/http/nest';
|
|
16
|
+
import { IssueInvoiceAnswer } from '@/contexts/billing/presentation/http/invoices/issue-invoice/issue-invoice.answer.js';
|
|
17
|
+
|
|
18
|
+
@Controller('invoices')
|
|
19
|
+
@KitRoutes({ guards: [] })
|
|
20
|
+
export class IssueInvoiceController {
|
|
21
|
+
@Post()
|
|
22
|
+
async issueInvoice(${taken}): Promise<${answered}> {
|
|
23
|
+
return new IssueInvoiceAnswer();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
const ANSWERED = renderControllersFile('billing', 'billingControllers', [
|
|
28
|
+
{
|
|
29
|
+
file: CONTROLLER,
|
|
30
|
+
className: 'IssueInvoiceController',
|
|
31
|
+
specifier: '@/contexts/billing/presentation/http/invoices/issue-invoice/issue-invoice.controller.js',
|
|
32
|
+
methods: [
|
|
33
|
+
{
|
|
34
|
+
name: 'issueInvoice',
|
|
35
|
+
line: 9,
|
|
36
|
+
answer: {
|
|
37
|
+
kind: 'class',
|
|
38
|
+
name: 'IssueInvoiceAnswer',
|
|
39
|
+
specifier: '@/contexts/billing/presentation/http/invoices/issue-invoice/issue-invoice.answer.js',
|
|
40
|
+
},
|
|
41
|
+
request: [],
|
|
42
|
+
declaresResponse: false,
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
]);
|
|
47
|
+
export const NEST_CONTROLLERS_FIXTURES = [
|
|
48
|
+
{
|
|
49
|
+
ruleId: RULE,
|
|
50
|
+
name: 'the generated list of a context, the answer of each method read from its signature',
|
|
51
|
+
expect: 'pass',
|
|
52
|
+
files: nestProject({ [CONTROLLER]: controller('IssueInvoiceAnswer'), [BILLING_FILE]: ANSWERED }),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
ruleId: RULE,
|
|
56
|
+
name: 'the generated list left behind a controller written since',
|
|
57
|
+
expect: { file: BILLING_FILE },
|
|
58
|
+
files: nestProject({
|
|
59
|
+
[CONTROLLER]: controller('IssueInvoiceAnswer'),
|
|
60
|
+
[BILLING_FILE]: renderControllersFile('billing', 'billingControllers', []),
|
|
61
|
+
}),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
ruleId: RULE,
|
|
65
|
+
name: 'a method that answers a list the kit cannot read into a schema',
|
|
66
|
+
expect: { file: CONTROLLER },
|
|
67
|
+
files: nestProject({
|
|
68
|
+
[CONTROLLER]: controller('IssueInvoiceAnswer[]'),
|
|
69
|
+
[BILLING_FILE]: renderControllersFile('billing', 'billingControllers', [
|
|
70
|
+
{
|
|
71
|
+
file: CONTROLLER,
|
|
72
|
+
className: 'IssueInvoiceController',
|
|
73
|
+
specifier: '@/contexts/billing/presentation/http/invoices/issue-invoice/issue-invoice.controller.js',
|
|
74
|
+
methods: [
|
|
75
|
+
{
|
|
76
|
+
name: 'issueInvoice',
|
|
77
|
+
line: 9,
|
|
78
|
+
request: [],
|
|
79
|
+
answer: { kind: 'unread', text: '' },
|
|
80
|
+
declaresResponse: false,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
]),
|
|
85
|
+
}),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
ruleId: RULE,
|
|
89
|
+
name: 'a method that takes the whole body as a type written inline, which the kit cannot read into a schema',
|
|
90
|
+
expect: { file: CONTROLLER },
|
|
91
|
+
files: nestProject({
|
|
92
|
+
[CONTROLLER]: controller('IssueInvoiceAnswer', '@Body() body: { reason: string }'),
|
|
93
|
+
[BILLING_FILE]: ANSWERED,
|
|
94
|
+
}),
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
function nestProject(files) {
|
|
98
|
+
return project({
|
|
99
|
+
[ANSWER]: 'export class IssueInvoiceAnswer {}\n',
|
|
100
|
+
[CATALOG_FILE]: renderControllersFile('catalog', 'catalogControllers', []),
|
|
101
|
+
...files,
|
|
102
|
+
}, { [CONFIG_FILE]: config(NEST) });
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=nest-controllers-fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-controllers-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/nest-controllers-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;AACnC,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG,GAAG,OAAO,2CAA2C,CAAC;AACrE,MAAM,UAAU,GAAG,GAAG,MAAM,8BAA8B,CAAC;AAC3D,MAAM,MAAM,GAAG,GAAG,MAAM,0BAA0B,CAAC;AACnD,MAAM,YAAY,GAAG,GAAG,OAAO,yBAAyB,CAAC;AACzD,MAAM,YAAY,GAAG,GAAG,OAAO,yBAAyB,CAAC;AACzD,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;AAEpG,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,KAAK,GAAG,EAAE,EAAU,EAAE,CAC1D;;;;;;;;uBAQqB,KAAK,cAAc,QAAQ;;;;CAIjD,CAAC;AAEF,MAAM,QAAQ,GAAG,qBAAqB,CAAC,SAAS,EAAE,oBAAoB,EAAE;IACtE;QACE,IAAI,EAAE,UAAU;QAChB,SAAS,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E,IAAI,EAAE,cAAc;4BACpB,IAAI,EAAE,CAAC;4BACP,OAAO,EAAE,EAAE;4BACX,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE;4BACpC,gBAAgB,EAAE,KAAK;yBACxB;qBACF;iBACF;aACF,CAAC;SACH,CAAC;KACH;IACD;QACE,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,sGAAsG;QAC5G,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;QAC5B,KAAK,EAAE,WAAW,CAAC;YACjB,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,oBAAoB,EAAE,kCAAkC,CAAC;YAClF,CAAC,YAAY,CAAC,EAAE,QAAQ;SACzB,CAAC;KACH;CACF,CAAC;AAEF,SAAS,WAAW,CAAC,KAA6B;IAChD,OAAO,OAAO,CACZ;QACE,CAAC,MAAM,CAAC,EAAE,sCAAsC;QAChD,CAAC,YAAY,CAAC,EAAE,qBAAqB,CAAC,SAAS,EAAE,oBAAoB,EAAE,EAAE,CAAC;QAC1E,GAAG,KAAK;KACT,EACD,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/nest-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC,eAAO,MAAM,aAAa,EAAE,SAAS,OAAO,EA0D3C,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PATHS } from './paths.js';
|
|
2
|
+
import { project } from './project.js';
|
|
3
|
+
const { BILLING, ADAPTER, GATEWAY, MODULE } = PATHS;
|
|
4
|
+
const RULE = 'nest/no-parallel-pipeline';
|
|
5
|
+
const NEST_CONTROLLER = `${BILLING}/presentation/http/invoices.controller.ts`;
|
|
6
|
+
const PLATFORM_CONTROLLER = 'src/platform/http/invoices.controller.ts';
|
|
7
|
+
export const NEST_FIXTURES = [
|
|
8
|
+
{
|
|
9
|
+
ruleId: RULE,
|
|
10
|
+
name: 'Nest in the platform, a client of Nest microservices in an adapter, and the testing module of Nest in a spec',
|
|
11
|
+
expect: 'pass',
|
|
12
|
+
files: project({
|
|
13
|
+
'src/platform/http/app-module.ts': "import { Module } from '@nestjs/common';\nimport { APP_GUARD } from '@nestjs/core';\n\n@Module({})\nexport class AppModule {\n readonly guard = APP_GUARD;\n}\n",
|
|
14
|
+
[GATEWAY]: "import type { ClientProxy } from '@nestjs/microservices';\n\nexport class InProcessPriceCatalogGateway {\n constructor(private readonly client: ClientProxy) {}\n}\n",
|
|
15
|
+
[`${BILLING}/test/unit/invoices.spec.ts`]: "import { Test } from '@nestjs/testing';\nimport { it } from 'vitest';\n\nit.todo(String(Test));\n",
|
|
16
|
+
}),
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
ruleId: RULE,
|
|
20
|
+
name: 'a controller of Nest in a context, behind a guard of Nest',
|
|
21
|
+
expect: { file: NEST_CONTROLLER },
|
|
22
|
+
files: project({
|
|
23
|
+
[NEST_CONTROLLER]: "import { Controller, Post, UseGuards } from '@nestjs/common';\n\n@Controller('invoices')\nexport class InvoicesController {\n @Post()\n @UseGuards()\n issue(): void {}\n}\n",
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
ruleId: RULE,
|
|
28
|
+
name: 'an HTTP exception of Nest thrown by an adapter',
|
|
29
|
+
expect: { file: ADAPTER },
|
|
30
|
+
files: project({
|
|
31
|
+
[ADAPTER]: "import { NotFoundException } from '@nestjs/common';\n\nexport class InMemoryInvoiceRepository {\n find(): never {\n throw new NotFoundException();\n }\n}\n",
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
ruleId: RULE,
|
|
36
|
+
name: 'the configuration module of Nest in the module file of a context',
|
|
37
|
+
expect: { file: MODULE },
|
|
38
|
+
files: project({
|
|
39
|
+
[MODULE]: "import { ConfigService } from '@nestjs/config';\n\nexport const settings = ConfigService;\n",
|
|
40
|
+
}),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
ruleId: RULE,
|
|
44
|
+
name: 'a Nest controller of a context the kit serves, its routes declared with the decorators of Nest',
|
|
45
|
+
expect: 'pass',
|
|
46
|
+
files: project({
|
|
47
|
+
[NEST_CONTROLLER]: "import { Body, Controller, Post } from '@nestjs/common';\nimport { KitRoute } from '@ddd-ts-kit/http/nest';\n\n@Controller('invoices')\nexport class InvoicesController {\n @Post()\n @KitRoute({ operationId: 'issueInvoice', summary: 'Issue' })\n issue(@Body() body: object): object {\n return body;\n }\n}\n",
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
ruleId: RULE,
|
|
52
|
+
name: 'a controller Nest serves in the platform that sends a command',
|
|
53
|
+
expect: { file: PLATFORM_CONTROLLER },
|
|
54
|
+
files: project({
|
|
55
|
+
[PLATFORM_CONTROLLER]: "import { Controller } from '@nestjs/common';\nimport type { CommandBus } from '@ddd-ts-kit/kernel';\n\n@Controller('invoices')\nexport class InvoicesController {\n constructor(readonly commands: CommandBus) {}\n}\n",
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
//# sourceMappingURL=nest-fixtures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/nest-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;AACpD,MAAM,IAAI,GAAG,2BAA2B,CAAC;AACz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AAC,mBAAmB,CAAC,EACnB,yNAAyN;SAC5N,CAAC;KACH;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A tool of Nest a context reached for, and what the kit does in its place. */
|
|
2
|
+
export interface NestEquivalent {
|
|
3
|
+
readonly tool: string;
|
|
4
|
+
readonly instead: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* What a context imports of Nest that the kit does in its own way, one per tool: none for a
|
|
8
|
+
* package of Nest the kit has no answer to (WebSockets, GraphQL, microservices, testing), nor for
|
|
9
|
+
* its container (`Injectable`, `Inject`), which an adapter bound as a Nest provider may carry. In
|
|
10
|
+
* a controller the kit serves (`servedByKit`: it carries `@KitRoute`), the decorators that declare
|
|
11
|
+
* a route are what the kit reads, and are not reported.
|
|
12
|
+
*/
|
|
13
|
+
export declare function nestEquivalentsOf(packageName: string, names: readonly string[], servedByKit?: boolean): readonly NestEquivalent[];
|
|
14
|
+
//# sourceMappingURL=nest-equivalents-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-equivalents-of.d.ts","sourceRoot":"","sources":["../../../src/check/nest/nest-equivalents-of.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAgID;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,UAAQ,GAClB,SAAS,cAAc,EAAE,CAc3B"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
const ROUTE = {
|
|
2
|
+
tool: 'a controller Nest serves',
|
|
3
|
+
instead: 'a route of the kit: `@KitRoute` of `@ddd-ts-kit/http/nest` on each method of the controller, served by `createControllersModule`, or `generate route`. Its security is declared, its refusals are problem documents with their codes, and it is in the contract',
|
|
4
|
+
};
|
|
5
|
+
const UPLOADED = {
|
|
6
|
+
tool: 'a file parsed by Nest',
|
|
7
|
+
instead: '`upload` of `@KitRoute` (its field, largest size and media types, in the contract) and `@Upload()` of `@ddd-ts-kit/http/nest`, which hands the method the file the kit streams and checks: `ddd-ts-kit generate file-upload` writes it',
|
|
8
|
+
};
|
|
9
|
+
const RAW = {
|
|
10
|
+
tool: 'the raw request or answer',
|
|
11
|
+
instead: 'the parts of the request a route of the kit validates (`@Body`, `@Query`, `@Param`, `@Headers`, `@CurrentActor`, `@RouteContext`), and an answer it declares (`response` of `@KitRoute`, `cache` for its headers)',
|
|
12
|
+
};
|
|
13
|
+
const GUARD = {
|
|
14
|
+
tool: 'a guard',
|
|
15
|
+
instead: 'the guards of a route group of the kit for a control at the edge (`generate guard`), and the permission of the use case for a right (`@Requires`, or `requires` in the module file), which the bus checks on every door: HTTP, /rpc, /trpc, a job, an event',
|
|
16
|
+
};
|
|
17
|
+
const PIPE = {
|
|
18
|
+
tool: 'a pipe',
|
|
19
|
+
instead: 'the schemas of the route (`request.body`, `params`, `query`), the ones the contract documents',
|
|
20
|
+
};
|
|
21
|
+
const FILTER = {
|
|
22
|
+
tool: 'an exception filter or an HTTP exception',
|
|
23
|
+
instead: 'a refusal of the domain or the application from the code list of the context, which the error mapper answers as a problem document with its code',
|
|
24
|
+
};
|
|
25
|
+
const INTERCEPTOR = {
|
|
26
|
+
tool: 'an interceptor',
|
|
27
|
+
instead: 'a bus middleware or an aspect (logging, retry, timeout), and the `cache` of the route for what a cache keeps',
|
|
28
|
+
};
|
|
29
|
+
const LOGGER = { tool: 'its logger', instead: 'the `Logger` of `@ddd-ts-kit/kernel`' };
|
|
30
|
+
const SIDE_EFFECT = {
|
|
31
|
+
tool: 'its common package',
|
|
32
|
+
instead: 'nothing: a context needs no side effect of Nest, which the platform sets up',
|
|
33
|
+
};
|
|
34
|
+
const PIPELINE = {
|
|
35
|
+
tool: 'its request pipeline',
|
|
36
|
+
instead: 'the platform, for what acts on Nest itself: the routes of the kit do not go through `APP_GUARD`, `APP_FILTER` or `APP_INTERCEPTOR`',
|
|
37
|
+
};
|
|
38
|
+
/** The tools of `@nestjs/common`, by the names a context imports. */
|
|
39
|
+
const COMMON = [
|
|
40
|
+
[/^(?:Controller|Get|Post|Put|Patch|Delete|All|Head|Options|Search|Body|Param|Query|Headers|HttpCode)$/, ROUTE],
|
|
41
|
+
[/^(?:Req|Request|Res|Response|Next|Header|Redirect|Render|Sse|Ip|HostParam|Session)$/, RAW],
|
|
42
|
+
[/^(?:UploadedFiles?|ParseFilePipe|ParseFilePipeBuilder|MaxFileSizeValidator|FileTypeValidator)$/, UPLOADED],
|
|
43
|
+
[/^(?:UseGuards|CanActivate|SetMetadata|applyDecorators)$/, GUARD],
|
|
44
|
+
[/^(?:UsePipes|PipeTransform|ArgumentMetadata)$|Pipe$/, PIPE],
|
|
45
|
+
[/^(?:UseFilters|Catch|ExceptionFilter|ArgumentsHost)$|Exception$/, FILTER],
|
|
46
|
+
[/^(?:UseInterceptors|NestInterceptor|CallHandler|ExecutionContext)$/, INTERCEPTOR],
|
|
47
|
+
[/^(?:Logger|ConsoleLogger|LoggerService)$/, LOGGER],
|
|
48
|
+
];
|
|
49
|
+
/** The packages of Nest whose work the kit does, and what it does in their place. */
|
|
50
|
+
const PACKAGES = {
|
|
51
|
+
'@nestjs/core': PIPELINE,
|
|
52
|
+
'@nestjs/platform-express': PIPELINE,
|
|
53
|
+
'@nestjs/platform-fastify': PIPELINE,
|
|
54
|
+
'@nestjs/swagger': {
|
|
55
|
+
tool: 'Swagger',
|
|
56
|
+
instead: 'the OpenAPI contract the kit generates from the routes (`npm run docs:generate`), with its error codes',
|
|
57
|
+
},
|
|
58
|
+
'@nestjs/cqrs': {
|
|
59
|
+
tool: 'CQRS',
|
|
60
|
+
instead: 'the `CommandBus` and `QueryBus` of the kit, whose middlewares check the permission, open the unit of work and write the outbox',
|
|
61
|
+
},
|
|
62
|
+
'@nestjs/passport': {
|
|
63
|
+
tool: 'Passport',
|
|
64
|
+
instead: 'the strategy in the platform, where `passportPrincipal(strategy, { actorOf })` of `@ddd-ts-kit/auth/passport` makes it the `resolvePrincipal` of the HTTP boundary; a strategy class of `@nestjs/passport` is one, and Nest may build it',
|
|
65
|
+
},
|
|
66
|
+
'@nestjs/jwt': {
|
|
67
|
+
tool: 'its JWT module',
|
|
68
|
+
instead: 'the authentication of the platform, read by `resolvePrincipal` of the HTTP boundary',
|
|
69
|
+
},
|
|
70
|
+
'@nestjs/schedule': {
|
|
71
|
+
tool: 'its scheduler',
|
|
72
|
+
instead: 'a job of the kit (`generate job`), which sends a command through the bus',
|
|
73
|
+
},
|
|
74
|
+
'@nestjs/bull': { tool: 'its queues', instead: 'a background job of the kit, which sends a command through the bus' },
|
|
75
|
+
'@nestjs/bullmq': {
|
|
76
|
+
tool: 'its queues',
|
|
77
|
+
instead: 'a background job of the kit, which sends a command through the bus',
|
|
78
|
+
},
|
|
79
|
+
'@nestjs/config': {
|
|
80
|
+
tool: 'its configuration',
|
|
81
|
+
instead: 'the configuration of the platform, validated at start and handed to the module of the context',
|
|
82
|
+
},
|
|
83
|
+
'@nestjs/throttler': { tool: 'its throttler', instead: 'the rate limit of the platform (`rateLimit` of the config)' },
|
|
84
|
+
'@nestjs/cache-manager': {
|
|
85
|
+
tool: 'its cache',
|
|
86
|
+
instead: 'the `Cache` port of the kernel, and the `cache` of a route for what HTTP caches keep',
|
|
87
|
+
},
|
|
88
|
+
'@nestjs/event-emitter': {
|
|
89
|
+
tool: 'its event emitter',
|
|
90
|
+
instead: 'domain events, which leave with the save, and integration events through the outbox',
|
|
91
|
+
},
|
|
92
|
+
'@nestjs/typeorm': {
|
|
93
|
+
tool: 'its ORM module',
|
|
94
|
+
instead: 'the repository adapter of the context on the ORM package of the kit, inside the unit of work',
|
|
95
|
+
},
|
|
96
|
+
'@nestjs/mongoose': {
|
|
97
|
+
tool: 'its ORM module',
|
|
98
|
+
instead: 'the repository adapter of the context, inside the unit of work',
|
|
99
|
+
},
|
|
100
|
+
'@nestjs/sequelize': {
|
|
101
|
+
tool: 'its ORM module',
|
|
102
|
+
instead: 'the repository adapter of the context, inside the unit of work',
|
|
103
|
+
},
|
|
104
|
+
'@nestjs/terminus': { tool: 'its health checks', instead: 'the readiness of the platform' },
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* What a context imports of Nest that the kit does in its own way, one per tool: none for a
|
|
108
|
+
* package of Nest the kit has no answer to (WebSockets, GraphQL, microservices, testing), nor for
|
|
109
|
+
* its container (`Injectable`, `Inject`), which an adapter bound as a Nest provider may carry. In
|
|
110
|
+
* a controller the kit serves (`servedByKit`: it carries `@KitRoute`), the decorators that declare
|
|
111
|
+
* a route are what the kit reads, and are not reported.
|
|
112
|
+
*/
|
|
113
|
+
export function nestEquivalentsOf(packageName, names, servedByKit = false) {
|
|
114
|
+
if (packageName !== '@nestjs/common') {
|
|
115
|
+
const equivalent = PACKAGES[packageName];
|
|
116
|
+
return equivalent === undefined ? [] : [equivalent];
|
|
117
|
+
}
|
|
118
|
+
if (names.length === 0) {
|
|
119
|
+
return [SIDE_EFFECT];
|
|
120
|
+
}
|
|
121
|
+
const found = names.flatMap((name) => COMMON.find(([pattern]) => pattern.test(name))?.[1] ?? []);
|
|
122
|
+
return [...new Set(found.filter((equivalent) => !(servedByKit && equivalent === ROUTE)))];
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=nest-equivalents-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-equivalents-of.js","sourceRoot":"","sources":["../../../src/check/nest/nest-equivalents-of.ts"],"names":[],"mappings":"AAMA,MAAM,KAAK,GAAmB;IAC5B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EACL,iQAAiQ;CACpQ,CAAC;AAEF,MAAM,QAAQ,GAAmB;IAC/B,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EACL,wOAAwO;CAC3O,CAAC;AAE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AK;IAEnB,IAAI,WAAW,KAAK,gBAAgB,EAAE,CAAC;QACrC,MAAM,UAAU,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;QAEzC,OAAO,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,WAAW,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAEjG,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -2,6 +2,8 @@ import type { Project } from '../model/project.js';
|
|
|
2
2
|
export interface ProjectOptions {
|
|
3
3
|
/** Load only this source instead of walking the tree (editor hook path). */
|
|
4
4
|
readonly onlyFile?: string;
|
|
5
|
+
/** The text to judge for that file instead of what is on disk: what a session is about to write. */
|
|
6
|
+
readonly text?: string | undefined;
|
|
5
7
|
}
|
|
6
8
|
export declare function loadProject(root: string, options?: ProjectOptions): Project;
|
|
7
9
|
//# sourceMappingURL=load-project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-project.d.ts","sourceRoot":"","sources":["../../../src/check/project/load-project.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAQhD,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"load-project.d.ts","sourceRoot":"","sources":["../../../src/check/project/load-project.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAQhD,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,oGAAoG;IACpG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAID,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAS/E"}
|
|
@@ -8,11 +8,15 @@ import { loadSourceFile } from './load-source-file.js';
|
|
|
8
8
|
import { walkDirectory } from './walk-directory.js';
|
|
9
9
|
export function loadProject(root, options = {}) {
|
|
10
10
|
const { config, text: configText } = readConfig(root);
|
|
11
|
-
const tree = options.onlyFile === undefined
|
|
11
|
+
const tree = options.onlyFile === undefined
|
|
12
|
+
? walkTree(root, config)
|
|
13
|
+
: oneFile(root, config, { file: options.onlyFile, text: options.text });
|
|
12
14
|
return assembleProject({ root, config, configText, ...tree });
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
/** The one source the editor hook asks about: its text on disk, or the text about to be written. */
|
|
17
|
+
function oneFile(root, config, { file, text }) {
|
|
18
|
+
const source = text === undefined ? readSource(root, config, file) : loadSourceFile(config, file, text);
|
|
19
|
+
return { files: [source], contextEntries: [], contextsOnDisk: [] };
|
|
16
20
|
}
|
|
17
21
|
function walkTree(root, config) {
|
|
18
22
|
const files = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-project.js","sourceRoot":"","sources":["../../../src/check/project/load-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAA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AAM,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC;AACnD,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,MAAc,EAAE,IAAY;IAC5D,OAAO,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-controllers-current.d.ts","sourceRoot":"","sources":["../../../src/check/rules/nest-controllers-current.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAc1C,eAAO,MAAM,sBAAsB,EAAE,IAgBpC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { controllersFile } from '../../nest-controllers/controllers-file.js';
|
|
2
|
+
import { readNestControllers } from '../../nest-controllers/read-nest-controllers.js';
|
|
3
|
+
import { renderControllersFile } from '../../nest-controllers/render-controllers-file.js';
|
|
4
|
+
import { toName } from '../../naming/index.js';
|
|
5
|
+
import { reporter } from '../support/reporter.js';
|
|
6
|
+
const EXAMPLES = {
|
|
7
|
+
params: '@Param() params: InvoiceDetailsParams',
|
|
8
|
+
query: '@Query() criteria: SearchInvoicesCriteria',
|
|
9
|
+
headers: '@Headers() headers: SignedHeaders',
|
|
10
|
+
body: '@Body() body: IssueInvoiceBody',
|
|
11
|
+
};
|
|
12
|
+
const REGENERATE = 'Run `ddd-ts-kit docs` or `ddd-ts-kit generate`, or restart `npm run dev`, which rewrite it from the Nest controllers of the context and the signatures of their methods: the file is never edited by hand.';
|
|
13
|
+
export const nestControllersCurrent = {
|
|
14
|
+
id: 'nest/controllers-current',
|
|
15
|
+
description: 'With Nest controllers ("stack.routes": "nest"), the generated <context>.controllers.ts of each context lists its Nest controllers with what the signature of each method says, and every route method takes and answers types the kit reads into schemas: a part of the request taken whole is typed by a DTO class, or given in `request` of `@KitRoute`; the answer is a DTO class, `Accepted` or `void`, or given in `response` of `@KitRoute`.',
|
|
16
|
+
scope: 'project',
|
|
17
|
+
run(project) {
|
|
18
|
+
if (project.config.stack.routes !== 'nest') {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
const files = projectFiles(project);
|
|
22
|
+
return project.contextsOnDisk
|
|
23
|
+
.filter((context) => project.config.contexts[context] !== undefined)
|
|
24
|
+
.flatMap((context) => judged(project, files, context));
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
function judged(project, files, context) {
|
|
28
|
+
const report = reporter(project, nestControllersCurrent.id);
|
|
29
|
+
const entries = readNestControllers(files, project.config, context);
|
|
30
|
+
const file = `${project.config.contextsDir}/${context}/${controllersFile(context)}`;
|
|
31
|
+
const expected = renderControllersFile(context, `${toName(context).camel}Controllers`, entries);
|
|
32
|
+
const stale = files.read(file) === expected
|
|
33
|
+
? []
|
|
34
|
+
: [
|
|
35
|
+
report({ file, line: 1 }, `${controllersFile(context)} is not what ddd-ts-kit writes from the Nest controllers of "${context}".`, REGENERATE),
|
|
36
|
+
];
|
|
37
|
+
const unread = entries.flatMap((entry) => entry.methods
|
|
38
|
+
.filter(({ answer, declaresResponse }) => answer.kind === 'unread' && !declaresResponse)
|
|
39
|
+
.map(({ name, line, answer }) => report({ file: entry.file, line }, `${entry.className}.${name} answers ${answer.kind === 'unread' ? answer.text : ''}, which the kit cannot read into the body of its route.`, 'Answer a DTO class (`Promise<InvoiceDetailsAnswer>`), `Accepted` or `void`, or say the body in `response` of `@KitRoute`.')));
|
|
40
|
+
return [...stale, ...unread, ...unreadRequests(report, entries)];
|
|
41
|
+
}
|
|
42
|
+
function unreadRequests(report, entries) {
|
|
43
|
+
return entries.flatMap((entry) => entry.methods.flatMap(({ name, line, request }) => request
|
|
44
|
+
.filter(({ type, declared }) => type.kind === 'unread' && !declared)
|
|
45
|
+
.map(({ source, type }) => report({ file: entry.file, line }, `${entry.className}.${name} takes the whole ${source} as ${type.kind === 'unread' ? type.text : ''}, which the kit cannot read into the schema of its route.`, `Type it by a DTO class imported from its own file (\`${EXAMPLES[source]}\`), or give \`request.${source}\` in \`@KitRoute\`.`))));
|
|
46
|
+
}
|
|
47
|
+
function projectFiles(project) {
|
|
48
|
+
const texts = new Map(project.files.map((file) => [file.path, file.text]));
|
|
49
|
+
return {
|
|
50
|
+
read: (file) => texts.get(file),
|
|
51
|
+
under: (directory) => [...texts.keys()].filter((file) => file.startsWith(`${directory}/`)),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=nest-controllers-current.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-controllers-current.js","sourceRoot":"","sources":["../../../src/check/rules/nest-controllers-current.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAI1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,QAAQ,GAAwD;IACpE,MAAM,EAAE,uCAAuC;IAC/C,KAAK,EAAE,2CAA2C;IAClD,OAAO,EAAE,mCAAmC;IAC5C,IAAI,EAAE,gCAAgC;CACvC,CAAC;AAEF,MAAM,UAAU,GACd,4MAA4M,CAAC;AAE/M,MAAM,CAAC,MAAM,sBAAsB,GAAS;IAC1C,EAAE,EAAE,0BAA0B;IAC9B,WAAW,EACT,obAAob;IACtb,KAAK,EAAE,SAAS;IAChB,GAAG,CAAC,OAAO;QACT,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC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AA2D,EAC7J,wDAAwD,QAAQ,CAAC,MAAM,CAAC,0BAA0B,MAAM,sBAAsB,CAC/H,CACF,CACJ,CACF,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,OAAgB;IACpC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE3E,OAAO;QACL,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;QAC/B,KAAK,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;KAC3F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-no-parallel-pipeline.d.ts","sourceRoot":"","sources":["../../../src/check/rules/nest-no-parallel-pipeline.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAe1C,eAAO,MAAM,sBAAsB,EAAE,IAkBpC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { nestEquivalentsOf } from '../nest/nest-equivalents-of.js';
|
|
2
|
+
import { perFile } from '../support/per-file.js';
|
|
3
|
+
/** `domain/`, `application/` and the published language refuse every framework already (`layer/*`, `context/*`). */
|
|
4
|
+
const JUDGED = ['presentation', 'infrastructure', 'module', 'root'];
|
|
5
|
+
const NEST_COMMON = '@nestjs/common';
|
|
6
|
+
const NEST_BRIDGE = '@ddd-ts-kit/http/nest';
|
|
7
|
+
/** What a controller sends a use case through. */
|
|
8
|
+
const BUSES = ['CommandBus', 'QueryBus'];
|
|
9
|
+
const ROUTED_BY_NEST_FIX = 'Make it a route of the kit: `@KitRoute` of `@ddd-ts-kit/http/nest` on each method, served by `createControllersModule`, with its guards, its refusals and its place in the contract. A controller of Nest stays for what reaches no use case (health, metrics).';
|
|
10
|
+
export const nestNoParallelPipeline = {
|
|
11
|
+
id: 'nest/no-parallel-pipeline',
|
|
12
|
+
description: "A context uses none of the tools of Nest that the kit does its own way (guards, pipes, exception filters, interceptors, its logger, Swagger, CQRS, its scheduler, a controller Nest serves): they would bypass the security, the errors and the contract of the kit. A Nest controller the kit serves (`@KitRoute`) declares its routes with Nest's decorators. Outside the contexts, a controller Nest serves reaches no use case. Nest stays in the platform for the rest.",
|
|
13
|
+
scope: 'file',
|
|
14
|
+
run(project) {
|
|
15
|
+
return perFile(project, this.id, (file) => {
|
|
16
|
+
if (file.isTest) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
if (file.location.area === 'context') {
|
|
20
|
+
return JUDGED.includes(file.location.layer) ? nestToolsIn(file) : [];
|
|
21
|
+
}
|
|
22
|
+
return isUnderSources(file, project) ? routedByNest(file) : [];
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
/** In a context: each import of a tool of Nest whose work the kit does. */
|
|
27
|
+
function nestToolsIn(file) {
|
|
28
|
+
const servedByKit = servesThroughTheKit(file);
|
|
29
|
+
return file.imports.flatMap(({ line, specifier, names, target }) => {
|
|
30
|
+
const equivalents = target.kind === 'package' ? nestEquivalentsOf(target.name, names, servedByKit) : [];
|
|
31
|
+
if (equivalents.length === 0) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
line,
|
|
37
|
+
message: `"${specifier}" brings ${equivalents.map(({ tool }) => tool).join(' and ')} of Nest into a context, where the pipeline of the kit does not see it.`,
|
|
38
|
+
fix: `Use ${equivalents.map(({ instead }) => instead).join('; and ')}.`,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Outside the contexts: a controller Nest serves that reaches a use case, through a bus or a file of
|
|
45
|
+
* a context, is a route with none of the guarantees of the kit, wherever it is written.
|
|
46
|
+
*/
|
|
47
|
+
function routedByNest(file) {
|
|
48
|
+
const controller = file.imports.find(({ target, names }) => target.kind === 'package' && target.name === NEST_COMMON && names.includes('Controller'));
|
|
49
|
+
if (controller === undefined || servesThroughTheKit(file) || !reachesUseCase(file)) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
line: controller.line,
|
|
55
|
+
message: 'A controller Nest serves reaches a use case: its routes have no declared security, no problem codes and no place in the contract.',
|
|
56
|
+
fix: ROUTED_BY_NEST_FIX,
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
function servesThroughTheKit(file) {
|
|
61
|
+
return file.imports.some(({ specifier, names }) => specifier === NEST_BRIDGE && (names.includes('KitRoute') || names.includes('KitRoutes')));
|
|
62
|
+
}
|
|
63
|
+
function reachesUseCase(file) {
|
|
64
|
+
return file.imports.some(({ target, names }) => (target.kind === 'file' && target.location.area === 'context') ||
|
|
65
|
+
(target.kind === 'package' && names.some((name) => BUSES.includes(name))));
|
|
66
|
+
}
|
|
67
|
+
function isUnderSources({ path }, { config }) {
|
|
68
|
+
return path.startsWith(`${config.sourceRoot}/`);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=nest-no-parallel-pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nest-no-parallel-pipeline.js","sourceRoot":"","sources":["../../../src/check/rules/nest-no-parallel-pipeline.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,oHAAoH;AACpH,M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ACtB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,SAAS,KAAK,WAAW,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CACnH,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,IAAgB;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CACpB,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC;QAC9D,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,EAAE,IAAI,EAAc,EAAE,EAAE,MAAM,EAAW;IAC/D,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-generated-context-file.d.ts","sourceRoot":"","sources":["../../../src/check/support/is-generated-context-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-generated-context-file.d.ts","sourceRoot":"","sources":["../../../src/check/support/is-generated-context-file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAiBhE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { dependenciesFile, isDeclarationsFile } from '../../declared/index.js';
|
|
3
3
|
import { WITHOUT_MODULE } from '../../model-modules/index.js';
|
|
4
|
+
import { controllersFile } from '../../nest-controllers/controllers-file.js';
|
|
4
5
|
/**
|
|
5
6
|
* The generated files of a declared context: the declarations of each layer and their
|
|
6
7
|
* summary at its root, or `<context>.dependencies.ts`; `declarations/barrel-current` holds every
|
|
@@ -14,6 +15,8 @@ export function isGeneratedContextFile(file) {
|
|
|
14
15
|
const inContext = location.layer === 'root' && location.inside.length === 0
|
|
15
16
|
? path.posix.basename(file.path)
|
|
16
17
|
: [location.layer, ...location.inside].join('/');
|
|
17
|
-
return (isDeclarationsFile(location.context, inContext, WITHOUT_MODULE) ||
|
|
18
|
+
return (isDeclarationsFile(location.context, inContext, WITHOUT_MODULE) ||
|
|
19
|
+
inContext === dependenciesFile(location.context) ||
|
|
20
|
+
inContext === controllersFile(location.context));
|
|
18
21
|
}
|
|
19
22
|
//# sourceMappingURL=is-generated-context-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-generated-context-file.js","sourceRoot":"","sources":["../../../src/check/support/is-generated-context-file.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"is-generated-context-file.js","sourceRoot":"","sources":["../../../src/check/support/is-generated-context-file.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAG1E;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAgB;IACrD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE1B,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,SAAS,GACb,QAAQ,CAAC,KAAK,KAAK,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;QACvD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAChC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAErD,OAAO,CACL,kBAAkB,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC;QAC/D,SAAS,KAAK,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC;QAChD,SAAS,KAAK,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAChD,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,eAAO,MAAM,WAAW,EAAE,OAgCzB,CAAC"}
|