ddd-ts-kit 0.110.1 → 0.112.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 +164 -0
- package/README.fr.md +39 -8
- package/README.md +36 -7
- package/dist/alias/index.d.ts +2 -0
- package/dist/alias/index.d.ts.map +1 -1
- package/dist/alias/index.js +2 -0
- package/dist/alias/index.js.map +1 -1
- package/dist/alias/neighbour-sources.d.ts +17 -0
- package/dist/alias/neighbour-sources.d.ts.map +1 -0
- package/dist/alias/neighbour-sources.js +11 -0
- package/dist/alias/neighbour-sources.js.map +1 -0
- package/dist/alias/neighbour-suffix.d.ts +8 -0
- package/dist/alias/neighbour-suffix.d.ts.map +1 -0
- package/dist/alias/neighbour-suffix.js +10 -0
- package/dist/alias/neighbour-suffix.js.map +1 -0
- package/dist/build/rewrite-aliases.d.ts.map +1 -1
- package/dist/build/rewrite-aliases.js +11 -0
- package/dist/build/rewrite-aliases.js.map +1 -1
- package/dist/check/alias/build-scripts.d.ts.map +1 -1
- package/dist/check/alias/build-scripts.js +4 -8
- package/dist/check/alias/build-scripts.js.map +1 -1
- package/dist/check/alias/compiler-options-of.d.ts +3 -3
- package/dist/check/alias/compiler-options-of.js +17 -6
- package/dist/check/alias/compiler-options-of.js.map +1 -1
- package/dist/check/alias/neighbour-sources.d.ts +12 -0
- package/dist/check/alias/neighbour-sources.d.ts.map +1 -0
- package/dist/check/alias/neighbour-sources.js +80 -0
- package/dist/check/alias/neighbour-sources.js.map +1 -0
- package/dist/check/alias/script-steps.d.ts +11 -0
- package/dist/check/alias/script-steps.d.ts.map +1 -0
- package/dist/check/alias/script-steps.js +22 -0
- package/dist/check/alias/script-steps.js.map +1 -0
- package/dist/check/aspects/adapter-policies.d.ts +10 -0
- package/dist/check/aspects/adapter-policies.d.ts.map +1 -0
- package/dist/check/aspects/adapter-policies.js +104 -0
- package/dist/check/aspects/adapter-policies.js.map +1 -0
- package/dist/check/aspects/adapter-policy.d.ts +18 -0
- package/dist/check/aspects/adapter-policy.d.ts.map +1 -0
- package/dist/check/aspects/adapter-policy.js +2 -0
- package/dist/check/aspects/adapter-policy.js.map +1 -0
- package/dist/check/aspects/is-under-condition.d.ts +7 -0
- package/dist/check/aspects/is-under-condition.d.ts.map +1 -0
- package/dist/check/aspects/is-under-condition.js +50 -0
- package/dist/check/aspects/is-under-condition.js.map +1 -0
- package/dist/check/aspects/stated-policy.d.ts +18 -0
- package/dist/check/aspects/stated-policy.d.ts.map +1 -0
- package/dist/check/aspects/stated-policy.js +39 -0
- package/dist/check/aspects/stated-policy.js.map +1 -0
- 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/explain/imports-docs.d.ts.map +1 -1
- package/dist/check/explain/imports-docs.js +5 -3
- package/dist/check/explain/imports-docs.js.map +1 -1
- package/dist/check/explain/persistence-docs.d.ts.map +1 -1
- package/dist/check/explain/persistence-docs.js +21 -0
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/explain/standard-docs.d.ts.map +1 -1
- package/dist/check/explain/standard-docs.js +16 -0
- package/dist/check/explain/standard-docs.js.map +1 -1
- package/dist/check/explain/tenancy-docs.d.ts.map +1 -1
- package/dist/check/explain/tenancy-docs.js +3 -1
- package/dist/check/explain/tenancy-docs.js.map +1 -1
- package/dist/check/files/kit-content-types.d.ts +12 -0
- package/dist/check/files/kit-content-types.d.ts.map +1 -0
- package/dist/check/files/kit-content-types.js +38 -0
- package/dist/check/files/kit-content-types.js.map +1 -0
- package/dist/check/files/upload-content-defect.d.ts +7 -0
- package/dist/check/files/upload-content-defect.d.ts.map +1 -0
- package/dist/check/files/upload-content-defect.js +2 -0
- package/dist/check/files/upload-content-defect.js.map +1 -0
- package/dist/check/files/upload-content-defects.d.ts +9 -0
- package/dist/check/files/upload-content-defects.d.ts.map +1 -0
- package/dist/check/files/upload-content-defects.js +54 -0
- package/dist/check/files/upload-content-defects.js.map +1 -0
- package/dist/check/files/upload-declaration.d.ts +7 -0
- package/dist/check/files/upload-declaration.d.ts.map +1 -0
- package/dist/check/files/upload-declaration.js +2 -0
- package/dist/check/files/upload-declaration.js.map +1 -0
- package/dist/check/files/upload-declarations.d.ts +9 -0
- package/dist/check/files/upload-declarations.d.ts.map +1 -0
- package/dist/check/files/upload-declarations.js +41 -0
- package/dist/check/files/upload-declarations.js.map +1 -0
- package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js +95 -1
- package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +2 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/imports-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/imports-fixtures.js +97 -0
- package/dist/check/fixtures/imports-fixtures.js.map +1 -1
- package/dist/check/fixtures/standard-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/standard-fixtures.js +42 -0
- package/dist/check/fixtures/standard-fixtures.js.map +1 -1
- package/dist/check/fixtures/tenancy-advisory-lock-fixtures.d.ts +9 -0
- package/dist/check/fixtures/tenancy-advisory-lock-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/tenancy-advisory-lock-fixtures.js +45 -0
- package/dist/check/fixtures/tenancy-advisory-lock-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-fixtures.js +2 -0
- package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
- package/dist/check/fixtures/upload-fixtures.d.ts +3 -0
- package/dist/check/fixtures/upload-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/upload-fixtures.js +94 -0
- package/dist/check/fixtures/upload-fixtures.js.map +1 -0
- package/dist/check/migrations/is-working-migration.d.ts +6 -0
- package/dist/check/migrations/is-working-migration.d.ts.map +1 -0
- package/dist/check/migrations/is-working-migration.js +8 -0
- package/dist/check/migrations/is-working-migration.js.map +1 -0
- package/dist/check/migrations/journal-entries.d.ts +4 -0
- package/dist/check/migrations/journal-entries.d.ts.map +1 -0
- package/dist/check/migrations/journal-entries.js +21 -0
- package/dist/check/migrations/journal-entries.js.map +1 -0
- package/dist/check/migrations/read-drizzle-migrations.d.ts.map +1 -1
- package/dist/check/migrations/read-drizzle-migrations.js +4 -9
- package/dist/check/migrations/read-drizzle-migrations.js.map +1 -1
- package/dist/check/modules/imported-modules.d.ts +4 -0
- package/dist/check/modules/imported-modules.d.ts.map +1 -0
- package/dist/check/modules/imported-modules.js +5 -0
- package/dist/check/modules/imported-modules.js.map +1 -0
- package/dist/check/modules/module-imports.d.ts +17 -0
- package/dist/check/modules/module-imports.d.ts.map +1 -0
- package/dist/check/modules/module-imports.js +23 -0
- package/dist/check/modules/module-imports.js.map +1 -0
- package/dist/check/project/assemble-project.d.ts.map +1 -1
- package/dist/check/project/assemble-project.js +1 -8
- package/dist/check/project/assemble-project.js.map +1 -1
- package/dist/check/project/file-severity.d.ts +4 -0
- package/dist/check/project/file-severity.d.ts.map +1 -0
- package/dist/check/project/file-severity.js +11 -0
- package/dist/check/project/file-severity.js.map +1 -0
- package/dist/check/project/load-project.js +1 -10
- package/dist/check/project/load-project.js.map +1 -1
- package/dist/check/project/not-in-the-tree.d.ts +10 -0
- package/dist/check/project/not-in-the-tree.d.ts.map +1 -0
- package/dist/check/project/not-in-the-tree.js +17 -0
- package/dist/check/project/not-in-the-tree.js.map +1 -0
- package/dist/check/project/skipped-directories.d.ts +3 -0
- package/dist/check/project/skipped-directories.d.ts.map +1 -0
- package/dist/check/project/skipped-directories.js +3 -0
- package/dist/check/project/skipped-directories.js.map +1 -0
- package/dist/check/project/walk-directory.d.ts.map +1 -1
- package/dist/check/project/walk-directory.js +1 -1
- package/dist/check/project/walk-directory.js.map +1 -1
- package/dist/check/rules/aspects-timeout-covers-delegate.d.ts +3 -0
- package/dist/check/rules/aspects-timeout-covers-delegate.d.ts.map +1 -0
- package/dist/check/rules/aspects-timeout-covers-delegate.js +179 -0
- package/dist/check/rules/aspects-timeout-covers-delegate.js.map +1 -0
- package/dist/check/rules/files-upload-content-rule.d.ts +3 -0
- package/dist/check/rules/files-upload-content-rule.d.ts.map +1 -0
- package/dist/check/rules/files-upload-content-rule.js +25 -0
- package/dist/check/rules/files-upload-content-rule.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 +86 -7
- package/dist/check/rules/imports-alias-only.js.map +1 -1
- package/dist/check/rules/module-no-cycle.d.ts.map +1 -1
- package/dist/check/rules/module-no-cycle.js +12 -34
- package/dist/check/rules/module-no-cycle.js.map +1 -1
- package/dist/check/rules/privacy-declared-field.js +1 -1
- package/dist/check/rules/privacy-declared-field.js.map +1 -1
- package/dist/check/rules/tenancy-scoped-statement.d.ts.map +1 -1
- package/dist/check/rules/tenancy-scoped-statement.js +11 -3
- package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
- package/dist/cli-error.d.ts +7 -2
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +8 -2
- package/dist/cli-error.js.map +1 -1
- package/dist/commands/generate.js +3 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/knex-generate.d.ts.map +1 -1
- package/dist/commands/knex-generate.js +2 -1
- package/dist/commands/knex-generate.js.map +1 -1
- package/dist/commands/move-to-module.d.ts +6 -1
- package/dist/commands/move-to-module.d.ts.map +1 -1
- package/dist/commands/move-to-module.js +28 -3
- package/dist/commands/move-to-module.js.map +1 -1
- package/dist/commands/prisma-generate.d.ts.map +1 -1
- package/dist/commands/prisma-generate.js +2 -1
- package/dist/commands/prisma-generate.js.map +1 -1
- package/dist/commands/typeorm-generate.d.ts.map +1 -1
- package/dist/commands/typeorm-generate.js +2 -1
- package/dist/commands/typeorm-generate.js.map +1 -1
- package/dist/commands/verify-merge.d.ts +4 -2
- package/dist/commands/verify-merge.d.ts.map +1 -1
- package/dist/commands/verify-merge.js +8 -5
- package/dist/commands/verify-merge.js.map +1 -1
- package/dist/context-layout/context-layout.d.ts.map +1 -1
- package/dist/context-layout/context-layout.js +6 -0
- package/dist/context-layout/context-layout.js.map +1 -1
- package/dist/context-layout/module-moves.d.ts +8 -0
- package/dist/context-layout/module-moves.d.ts.map +1 -1
- package/dist/context-layout/module-moves.js +14 -3
- package/dist/context-layout/module-moves.js.map +1 -1
- package/dist/context-layout/runner-configs-by-hand.d.ts.map +1 -1
- package/dist/context-layout/runner-configs-by-hand.js +12 -0
- package/dist/context-layout/runner-configs-by-hand.js.map +1 -1
- package/dist/context-layout/settle.d.ts +9 -0
- package/dist/context-layout/settle.d.ts.map +1 -1
- package/dist/context-layout/settle.js +25 -3
- package/dist/context-layout/settle.js.map +1 -1
- package/dist/describe/read-adapters.d.ts.map +1 -1
- package/dist/describe/read-adapters.js +5 -1
- package/dist/describe/read-adapters.js.map +1 -1
- package/dist/describe/read-ports.js +8 -1
- package/dist/describe/read-ports.js.map +1 -1
- package/dist/generate/generate-options.d.ts +10 -0
- package/dist/generate/generate-options.d.ts.map +1 -1
- package/dist/generate/generate-options.js +3 -0
- package/dist/generate/generate-options.js.map +1 -1
- package/dist/generate/kind.d.ts +6 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.js +12 -0
- package/dist/generate/kinds/adapter-kind.js.map +1 -1
- package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
- package/dist/generate/kinds/declare-storage.js +3 -57
- package/dist/generate/kinds/declare-storage.js.map +1 -1
- package/dist/generate/kinds/declare-table.d.ts +14 -0
- package/dist/generate/kinds/declare-table.d.ts.map +1 -0
- package/dist/generate/kinds/declare-table.js +72 -0
- package/dist/generate/kinds/declare-table.js.map +1 -0
- package/dist/generate/kinds/e2e/job-slug.d.ts +3 -0
- package/dist/generate/kinds/e2e/job-slug.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/job-slug.js +8 -0
- package/dist/generate/kinds/e2e/job-slug.js.map +1 -0
- package/dist/generate/kinds/e2e/job-spec.d.ts +16 -0
- package/dist/generate/kinds/e2e/job-spec.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/job-spec.js +54 -0
- package/dist/generate/kinds/e2e/job-spec.js.map +1 -0
- package/dist/generate/kinds/e2e/jobs-sending.d.ts +17 -5
- package/dist/generate/kinds/e2e/jobs-sending.d.ts.map +1 -1
- package/dist/generate/kinds/e2e/jobs-sending.js +15 -6
- package/dist/generate/kinds/e2e/jobs-sending.js.map +1 -1
- package/dist/generate/kinds/e2e/reaction-of.d.ts +5 -5
- package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -1
- package/dist/generate/kinds/e2e/reaction-of.js +15 -8
- package/dist/generate/kinds/e2e/reaction-of.js.map +1 -1
- package/dist/generate/kinds/e2e/starting-jobs.d.ts +10 -0
- package/dist/generate/kinds/e2e/starting-jobs.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/starting-jobs.js +33 -0
- package/dist/generate/kinds/e2e/starting-jobs.js.map +1 -0
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +47 -35
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/kinds/file-upload/upload-file-vars.d.ts +9 -0
- package/dist/generate/kinds/file-upload/upload-file-vars.d.ts.map +1 -0
- package/dist/generate/kinds/file-upload/upload-file-vars.js +39 -0
- package/dist/generate/kinds/file-upload/upload-file-vars.js.map +1 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +2 -1
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -1
- package/dist/generate/kinds/file-upload/write-upload-controller.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload/write-upload-controller.js +2 -1
- package/dist/generate/kinds/file-upload/write-upload-controller.js.map +1 -1
- package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload-kind.js +5 -3
- package/dist/generate/kinds/file-upload-kind.js.map +1 -1
- package/dist/generate/kinds/generate-repository.d.ts +8 -0
- package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
- package/dist/generate/kinds/generate-repository.js +2 -13
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/note-the-migration.d.ts +4 -0
- package/dist/generate/kinds/note-the-migration.d.ts.map +1 -0
- package/dist/generate/kinds/note-the-migration.js +13 -0
- package/dist/generate/kinds/note-the-migration.js.map +1 -0
- package/dist/generate/kinds/personal-data/columns-of-table.d.ts +18 -0
- package/dist/generate/kinds/personal-data/columns-of-table.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/columns-of-table.js +31 -0
- package/dist/generate/kinds/personal-data/columns-of-table.js.map +1 -0
- package/dist/generate/kinds/personal-data/declare-personal-data.d.ts.map +1 -1
- package/dist/generate/kinds/personal-data/declare-personal-data.js +7 -52
- package/dist/generate/kinds/personal-data/declare-personal-data.js.map +1 -1
- package/dist/generate/kinds/personal-data/declare-table-personal-fields.d.ts +11 -0
- package/dist/generate/kinds/personal-data/declare-table-personal-fields.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/declare-table-personal-fields.js +71 -0
- package/dist/generate/kinds/personal-data/declare-table-personal-fields.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-request-of-table.d.ts +11 -0
- package/dist/generate/kinds/personal-data/personal-request-of-table.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/personal-request-of-table.js +20 -0
- package/dist/generate/kinds/personal-data/personal-request-of-table.js.map +1 -0
- package/dist/generate/kinds/personal-data/personal-vars.d.ts +7 -0
- package/dist/generate/kinds/personal-data/personal-vars.d.ts.map +1 -1
- package/dist/generate/kinds/personal-data/personal-vars.js +14 -11
- package/dist/generate/kinds/personal-data/personal-vars.js.map +1 -1
- package/dist/generate/kinds/personal-data/schema-table.d.ts +13 -0
- package/dist/generate/kinds/personal-data/schema-table.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/schema-table.js +2 -0
- package/dist/generate/kinds/personal-data/schema-table.js.map +1 -0
- package/dist/generate/kinds/personal-data/schema-tables-of.d.ts +9 -0
- package/dist/generate/kinds/personal-data/schema-tables-of.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/schema-tables-of.js +78 -0
- package/dist/generate/kinds/personal-data/schema-tables-of.js.map +1 -0
- package/dist/generate/kinds/personal-data/table-of-schema.d.ts +15 -0
- package/dist/generate/kinds/personal-data/table-of-schema.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/table-of-schema.js +39 -0
- package/dist/generate/kinds/personal-data/table-of-schema.js.map +1 -0
- package/dist/generate/kinds/personal-data/write-personal-declaration.d.ts +20 -0
- package/dist/generate/kinds/personal-data/write-personal-declaration.d.ts.map +1 -0
- package/dist/generate/kinds/personal-data/write-personal-declaration.js +63 -0
- package/dist/generate/kinds/personal-data/write-personal-declaration.js.map +1 -0
- package/dist/generate/kinds/personal-fields-kind.d.ts +3 -0
- package/dist/generate/kinds/personal-fields-kind.d.ts.map +1 -0
- package/dist/generate/kinds/personal-fields-kind.js +15 -0
- package/dist/generate/kinds/personal-fields-kind.js.map +1 -0
- package/dist/generate/kinds/projection-kind.d.ts.map +1 -1
- package/dist/generate/kinds/projection-kind.js +2 -1
- package/dist/generate/kinds/projection-kind.js.map +1 -1
- package/dist/generate/kinds/read-model/field-lines.d.ts +11 -0
- package/dist/generate/kinds/read-model/field-lines.d.ts.map +1 -0
- package/dist/generate/kinds/read-model/field-lines.js +85 -0
- package/dist/generate/kinds/read-model/field-lines.js.map +1 -0
- package/dist/generate/kinds/read-model/list-read-model.d.ts +17 -0
- package/dist/generate/kinds/read-model/list-read-model.d.ts.map +1 -0
- package/dist/generate/kinds/read-model/list-read-model.js +22 -0
- package/dist/generate/kinds/read-model/list-read-model.js.map +1 -0
- package/dist/generate/kinds/read-model/live-rows-check.d.ts +22 -0
- package/dist/generate/kinds/read-model/live-rows-check.d.ts.map +1 -0
- package/dist/generate/kinds/read-model/live-rows-check.js +47 -0
- package/dist/generate/kinds/read-model/live-rows-check.js.map +1 -0
- package/dist/generate/kinds/read-model/read-model-fields.d.ts +19 -0
- package/dist/generate/kinds/read-model/read-model-fields.d.ts.map +1 -0
- package/dist/generate/kinds/read-model/read-model-fields.js +31 -0
- package/dist/generate/kinds/read-model/read-model-fields.js.map +1 -0
- package/dist/generate/kinds/read-model/read-model-store.d.ts +24 -0
- package/dist/generate/kinds/read-model/read-model-store.d.ts.map +1 -0
- package/dist/generate/kinds/read-model/read-model-store.js +39 -0
- package/dist/generate/kinds/read-model/read-model-store.js.map +1 -0
- package/dist/generate/kinds/read-model/read-model-table.d.ts +11 -0
- package/dist/generate/kinds/read-model/read-model-table.d.ts.map +1 -0
- package/dist/generate/kinds/read-model/read-model-table.js +2 -0
- package/dist/generate/kinds/read-model/read-model-table.js.map +1 -0
- package/dist/generate/kinds/read-model-kind.d.ts +3 -0
- package/dist/generate/kinds/read-model-kind.d.ts.map +1 -0
- package/dist/generate/kinds/read-model-kind.js +103 -0
- package/dist/generate/kinds/read-model-kind.js.map +1 -0
- package/dist/generate/kinds/service-kind.d.ts.map +1 -1
- package/dist/generate/kinds/service-kind.js +8 -0
- package/dist/generate/kinds/service-kind.js.map +1 -1
- package/dist/generate/kinds/wire-context.d.ts.map +1 -1
- package/dist/generate/kinds/wire-context.js +4 -0
- package/dist/generate/kinds/wire-context.js.map +1 -1
- package/dist/generate/kinds.d.ts.map +1 -1
- package/dist/generate/kinds.js +4 -0
- package/dist/generate/kinds.js.map +1 -1
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +9 -0
- package/dist/generate/shared-writes.js.map +1 -1
- package/dist/help/tool-notes.d.ts.map +1 -1
- package/dist/help/tool-notes.js +7 -2
- package/dist/help/tool-notes.js.map +1 -1
- package/dist/help/usage.js +1 -1
- package/dist/help/work-notes.d.ts.map +1 -1
- package/dist/help/work-notes.js +9 -2
- package/dist/help/work-notes.js.map +1 -1
- package/dist/init/files/end-to-end-files.d.ts.map +1 -1
- package/dist/init/files/end-to-end-files.js +3 -0
- package/dist/init/files/end-to-end-files.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +8 -0
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/script-files.d.ts +2 -1
- package/dist/init/files/script-files.d.ts.map +1 -1
- package/dist/init/files/script-files.js +6 -1
- package/dist/init/files/script-files.js.map +1 -1
- package/dist/init/is-team-file.d.ts +2 -2
- package/dist/init/is-team-file.d.ts.map +1 -1
- package/dist/init/is-team-file.js +5 -4
- package/dist/init/is-team-file.js.map +1 -1
- package/dist/init/list-read-models.d.ts +17 -0
- package/dist/init/list-read-models.d.ts.map +1 -0
- package/dist/init/list-read-models.js +74 -0
- package/dist/init/list-read-models.js.map +1 -0
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +8 -0
- package/dist/init/manifest/database-scripts.js.map +1 -1
- package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
- package/dist/init/manifest/dependencies-for.js +10 -7
- package/dist/init/manifest/dependencies-for.js.map +1 -1
- package/dist/init/manifest/versions.js +25 -25
- package/dist/init/rewire-contexts.d.ts +4 -2
- package/dist/init/rewire-contexts.d.ts.map +1 -1
- package/dist/init/rewire-contexts.js +10 -2
- package/dist/init/rewire-contexts.js.map +1 -1
- package/dist/init/run-init.js +1 -1
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/wiring-notes.js +1 -1
- package/dist/init/wiring-notes.js.map +1 -1
- package/dist/init/write-type-script-configs.d.ts +3 -1
- package/dist/init/write-type-script-configs.d.ts.map +1 -1
- package/dist/init/write-type-script-configs.js +14 -2
- package/dist/init/write-type-script-configs.js.map +1 -1
- package/dist/layout/fit-block.js +4 -0
- package/dist/layout/fit-block.js.map +1 -1
- package/dist/merge/format-merge-report.js +5 -2
- package/dist/merge/format-merge-report.js.map +1 -1
- package/dist/merge/land-drizzle.d.ts +4 -0
- package/dist/merge/land-drizzle.d.ts.map +1 -1
- package/dist/merge/land-drizzle.js +6 -1
- package/dist/merge/land-drizzle.js.map +1 -1
- package/dist/merge/land-up-to-date.d.ts +15 -0
- package/dist/merge/land-up-to-date.d.ts.map +1 -0
- package/dist/merge/land-up-to-date.js +76 -0
- package/dist/merge/land-up-to-date.js.map +1 -0
- package/dist/merge/lost/format-merge-verification.d.ts +2 -1
- package/dist/merge/lost/format-merge-verification.d.ts.map +1 -1
- package/dist/merge/lost/format-merge-verification.js +13 -2
- package/dist/merge/lost/format-merge-verification.js.map +1 -1
- package/dist/merge/lost/merge-verification.d.ts +4 -0
- package/dist/merge/lost/merge-verification.d.ts.map +1 -1
- package/dist/merge/lost/verify-merges.d.ts +2 -1
- package/dist/merge/lost/verify-merges.d.ts.map +1 -1
- package/dist/merge/lost/verify-merges.js +10 -4
- package/dist/merge/lost/verify-merges.js.map +1 -1
- package/dist/merge/merge-trunk.d.ts +2 -1
- package/dist/merge/merge-trunk.d.ts.map +1 -1
- package/dist/merge/merge-trunk.js +5 -2
- package/dist/merge/merge-trunk.js.map +1 -1
- package/dist/merge/next-steps.d.ts +3 -0
- package/dist/merge/next-steps.d.ts.map +1 -1
- package/dist/merge/next-steps.js +3 -0
- package/dist/merge/next-steps.js.map +1 -1
- package/dist/merge/order/applied-under-old-name.d.ts +13 -0
- package/dist/merge/order/applied-under-old-name.d.ts.map +1 -0
- package/dist/merge/order/applied-under-old-name.js +14 -0
- package/dist/merge/order/applied-under-old-name.js.map +1 -0
- package/dist/merge/order/comes-after.d.ts +8 -0
- package/dist/merge/order/comes-after.d.ts.map +1 -0
- package/dist/merge/order/comes-after.js +9 -0
- package/dist/merge/order/comes-after.js.map +1 -0
- package/dist/merge/order/drizzle-order.d.ts +11 -0
- package/dist/merge/order/drizzle-order.d.ts.map +1 -0
- package/dist/merge/order/drizzle-order.js +64 -0
- package/dist/merge/order/drizzle-order.js.map +1 -0
- package/dist/merge/order/in-order.d.ts +4 -0
- package/dist/merge/order/in-order.d.ts.map +1 -0
- package/dist/merge/order/in-order.js +6 -0
- package/dist/merge/order/in-order.js.map +1 -0
- package/dist/merge/order/migration-order-finding.d.ts +18 -0
- package/dist/merge/order/migration-order-finding.d.ts.map +1 -0
- package/dist/merge/order/migration-order-finding.js +2 -0
- package/dist/merge/order/migration-order-finding.js.map +1 -0
- package/dist/merge/order/migration-order.d.ts +12 -0
- package/dist/merge/order/migration-order.d.ts.map +1 -0
- package/dist/merge/order/migration-order.js +21 -0
- package/dist/merge/order/migration-order.js.map +1 -0
- package/dist/merge/order/migrations-of-commit.d.ts +7 -0
- package/dist/merge/order/migrations-of-commit.d.ts.map +1 -0
- package/dist/merge/order/migrations-of-commit.js +43 -0
- package/dist/merge/order/migrations-of-commit.js.map +1 -0
- package/dist/merge/order/migrations-of-tree.d.ts +9 -0
- package/dist/merge/order/migrations-of-tree.d.ts.map +1 -0
- package/dist/merge/order/migrations-of-tree.js +25 -0
- package/dist/merge/order/migrations-of-tree.js.map +1 -0
- package/dist/merge/order/named-order.d.ts +11 -0
- package/dist/merge/order/named-order.d.ts.map +1 -0
- package/dist/merge/order/named-order.js +36 -0
- package/dist/merge/order/named-order.js.map +1 -0
- package/dist/merge/order/ordered-migration.d.ts +12 -0
- package/dist/merge/order/ordered-migration.d.ts.map +1 -0
- package/dist/merge/order/ordered-migration.js +2 -0
- package/dist/merge/order/ordered-migration.js.map +1 -0
- package/dist/merge/order/trunk-to-follow.d.ts +9 -0
- package/dist/merge/order/trunk-to-follow.d.ts.map +1 -0
- package/dist/merge/order/trunk-to-follow.js +2 -0
- package/dist/merge/order/trunk-to-follow.js.map +1 -0
- package/dist/merge/renumber-migrations.d.ts +14 -5
- package/dist/merge/renumber-migrations.d.ts.map +1 -1
- package/dist/merge/renumber-migrations.js +141 -60
- package/dist/merge/renumber-migrations.js.map +1 -1
- package/dist/merge/restamp-class.d.ts +9 -0
- package/dist/merge/restamp-class.d.ts.map +1 -0
- package/dist/merge/restamp-class.js +30 -0
- package/dist/merge/restamp-class.js.map +1 -0
- package/dist/migration/index.d.ts +1 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +1 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/plan-replay.d.ts.map +1 -1
- package/dist/migration/plan-replay.js +2 -1
- package/dist/migration/plan-replay.js.map +1 -1
- package/dist/migration/refuse-taken-migration-name.d.ts +8 -0
- package/dist/migration/refuse-taken-migration-name.d.ts.map +1 -0
- package/dist/migration/refuse-taken-migration-name.js +22 -0
- package/dist/migration/refuse-taken-migration-name.js.map +1 -0
- package/dist/migration/replay-drizzle-migrations.d.ts +5 -0
- package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
- package/dist/migration/replay-drizzle-migrations.js +10 -2
- package/dist/migration/replay-drizzle-migrations.js.map +1 -1
- package/dist/migration/replay-plan.d.ts +2 -2
- package/dist/migration/replay-plan.d.ts.map +1 -1
- package/dist/migration/restore-migration-folder.d.ts +6 -2
- package/dist/migration/restore-migration-folder.d.ts.map +1 -1
- package/dist/migration/restore-migration-folder.js +14 -7
- package/dist/migration/restore-migration-folder.js.map +1 -1
- package/dist/migration/snapshot-migration-folder.d.ts +7 -0
- package/dist/migration/snapshot-migration-folder.d.ts.map +1 -0
- package/dist/migration/snapshot-migration-folder.js +12 -0
- package/dist/migration/snapshot-migration-folder.js.map +1 -0
- package/dist/move-to-module/before-the-move.d.ts +5 -0
- package/dist/move-to-module/before-the-move.d.ts.map +1 -0
- package/dist/move-to-module/before-the-move.js +13 -0
- package/dist/move-to-module/before-the-move.js.map +1 -0
- package/dist/move-to-module/closed-cycles.d.ts +21 -0
- package/dist/move-to-module/closed-cycles.d.ts.map +1 -0
- package/dist/move-to-module/closed-cycles.js +66 -0
- package/dist/move-to-module/closed-cycles.js.map +1 -0
- package/dist/move-to-module/cycle-lines.d.ts +7 -0
- package/dist/move-to-module/cycle-lines.d.ts.map +1 -0
- package/dist/move-to-module/cycle-lines.js +22 -0
- package/dist/move-to-module/cycle-lines.js.map +1 -0
- package/dist/move-to-module/cycle-refusal.d.ts +17 -0
- package/dist/move-to-module/cycle-refusal.d.ts.map +1 -0
- package/dist/move-to-module/cycle-refusal.js +25 -0
- package/dist/move-to-module/cycle-refusal.js.map +1 -0
- package/dist/move-to-module/index.d.ts +5 -0
- package/dist/move-to-module/index.d.ts.map +1 -1
- package/dist/move-to-module/index.js +4 -0
- package/dist/move-to-module/index.js.map +1 -1
- package/dist/move-to-module/module-imports-in.d.ts +11 -0
- package/dist/move-to-module/module-imports-in.d.ts.map +1 -0
- package/dist/move-to-module/module-imports-in.js +32 -0
- package/dist/move-to-module/module-imports-in.js.map +1 -0
- package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
- package/dist/move-to-module/moves-into-module.js +6 -18
- package/dist/move-to-module/moves-into-module.js.map +1 -1
- package/dist/move-to-module/place-in-module.d.ts +13 -0
- package/dist/move-to-module/place-in-module.d.ts.map +1 -0
- package/dist/move-to-module/place-in-module.js +24 -0
- package/dist/move-to-module/place-in-module.js.map +1 -0
- package/dist/move-to-module/watch-cycles.d.ts +19 -0
- package/dist/move-to-module/watch-cycles.d.ts.map +1 -0
- package/dist/move-to-module/watch-cycles.js +51 -0
- package/dist/move-to-module/watch-cycles.js.map +1 -0
- package/dist/presets/no-flags.d.ts.map +1 -1
- package/dist/presets/no-flags.js +1 -0
- package/dist/presets/no-flags.js.map +1 -1
- package/dist/run.js +1 -1
- package/dist/run.js.map +1 -1
- package/dist/slice/format-slice-verification.d.ts.map +1 -1
- package/dist/slice/format-slice-verification.js +11 -5
- package/dist/slice/format-slice-verification.js.map +1 -1
- package/dist/stack/alias-vars.d.ts +3 -1
- package/dist/stack/alias-vars.d.ts.map +1 -1
- package/dist/stack/alias-vars.js +5 -2
- package/dist/stack/alias-vars.js.map +1 -1
- package/dist/stack/end-to-end-vars.d.ts +9 -0
- package/dist/stack/end-to-end-vars.d.ts.map +1 -0
- package/dist/stack/end-to-end-vars.js +32 -0
- package/dist/stack/end-to-end-vars.js.map +1 -0
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +2 -0
- 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.js +2 -2
- package/dist/worker/briefing-of.js.map +1 -1
- package/package.json +6 -6
- package/templates/e2e/e2e-background-job-case.ts.tpl +12 -0
- package/templates/e2e/e2e-job.spec.ts.tpl +3 -3
- package/templates/file-upload/controller.spec.ts.tpl +66 -2
- package/templates/file-upload/controller.ts.tpl +12 -0
- package/templates/file-upload/handler.spec.ts.tpl +3 -3
- package/templates/init/README.md.tpl +20 -1
- package/templates/init/e2e/jest.e2e.config.js.tpl +29 -5
- package/templates/init/e2e/start-application.database.ts.tpl +40 -2
- package/templates/init/e2e/start-application.memory.ts.tpl +36 -0
- package/templates/init/e2e/test-database-setup.ts.tpl +120 -0
- package/templates/init/e2e/vitest.e2e.config.ts.tpl +14 -4
- package/templates/init/platform/composition/compose-application.container.ts.tpl +5 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +20 -3
- package/templates/init/platform/composition/create-platform.manual.ts.tpl +6 -0
- package/templates/init/platform/composition/platform-options.manual.ts.tpl +11 -0
- package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
- package/templates/init/platform/composition/platform.module.container.ts.tpl +34 -0
- package/templates/init/platform/database/connect-to-database.drizzle.ts.tpl +7 -2
- package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +27 -4
- package/templates/init/platform/database/open-test-database.knex.ts.tpl +26 -3
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +27 -3
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +27 -3
- package/templates/init/platform/database/read-model-tables.ts.tpl +67 -0
- package/templates/init/platform/database/test-database-budget.ts.tpl +108 -0
- package/templates/init/platform/database/test-database-clone.ts.tpl +75 -0
- package/templates/init/platform/database/test-database-copy.ts.tpl +76 -0
- package/templates/init/platform/database/test-database-emptying.ts.tpl +209 -0
- package/templates/init/platform/database/test-database-kept.ts.tpl +32 -0
- package/templates/init/platform/database/test-database-leftovers.ts.tpl +52 -0
- package/templates/init/platform/database/test-database-run.ts.tpl +99 -0
- package/templates/init/platform/database/test-database-server.ts.tpl +140 -0
- package/templates/init/platform/database/test-database-session.ts.tpl +141 -0
- package/templates/init/platform/database/test-database-teardown.ts.tpl +11 -1
- package/templates/init/platform/jobs/background-jobs.ts.tpl +4 -0
- package/templates/init/platform/jobs/create-background-work.ts.tpl +1 -0
- package/templates/init/platform/resilience/default-policy.ts.tpl +8 -1
- package/templates/init/rules/infrastructure.md.tpl +3 -3
- package/templates/init/scripts/read-model-tables.ts.tpl +83 -0
- package/templates/nest-controller/upload.spec.ts.tpl +67 -2
- package/templates/nest-controller/upload.ts.tpl +12 -0
- package/templates/personal-data/declaration.drizzle.ts.tpl +6 -1
- package/templates/personal-data/declaration.knex.ts.tpl +14 -1
- package/templates/personal-data/declaration.prisma.ts.tpl +6 -1
- package/templates/personal-data/declaration.typeorm.ts.tpl +21 -1
- package/templates/personal-data/spec.table.ts.tpl +39 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +5 -9
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +5 -9
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +5 -9
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +5 -9
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +5 -9
- package/templates/projection/projection.manual.ts.tpl +2 -2
- package/templates/projection/projection.ts.tpl +2 -2
- package/templates/read-model/contract.spec.ts.tpl +95 -0
- package/templates/read-model/drizzle/schema.ts.tpl +8 -0
- package/templates/read-model/drizzle/store.ts.tpl +41 -0
- package/templates/read-model/drizzle/table.tpl +38 -0
- package/templates/read-model/fake.ts.tpl +8 -0
- package/templates/read-model/knex/store.ts.tpl +41 -0
- package/templates/read-model/knex/table.tpl +26 -0
- package/templates/read-model/none/store.ts.tpl +17 -0
- package/templates/read-model/port.ts.tpl +24 -0
- package/templates/read-model/prisma/model.tpl +25 -0
- package/templates/read-model/prisma/store.ts.tpl +43 -0
- package/templates/read-model/typeorm/schema-export.tpl +4 -0
- package/templates/read-model/typeorm/schema.ts.tpl +9 -0
- package/templates/read-model/typeorm/store.ts.tpl +30 -0
- package/templates/read-model/typeorm/table.tpl +54 -0
- package/templates/read-model/wiring.container.tpl +21 -0
- package/templates/repository/drizzle/repository.ts.tpl +6 -9
- package/templates/repository/drizzle/table.tpl +1 -0
- package/templates/repository/typeorm/table.tpl +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The compiler, called by its name, by its path or through a wrapper script named after it. */
|
|
2
|
+
const COMPILES = /(?:^|[\s/])tsc(?:\.[cm]?js)?(?=\s|$)/;
|
|
3
|
+
const TYPE_CHECK_ONLY = /--noEmit(?:\s|$)/;
|
|
4
|
+
/** The build of the clients `ddd-ts-kit sdk` generates: their sources import one another by relative paths, no alias. */
|
|
5
|
+
const BUILDS_CLIENTS = /\s-[bp]\s+(?:\.\/)?clients(?:\/|\s|$)/;
|
|
6
|
+
/** The configuration a step gives the compiler: a file, or a directory that holds a tsconfig.json. */
|
|
7
|
+
const PROJECT = /\s(?:-p|--project|-b|--build)[=\s]+(?:\.\/)?([^\s-]\S*)/;
|
|
8
|
+
/** What the compiler reads when a step names none. */
|
|
9
|
+
const DEFAULT_PROJECT = 'tsconfig.json';
|
|
10
|
+
/** The steps of a script, as `&&` chains them, with what each one compiles. */
|
|
11
|
+
export function scriptSteps(command) {
|
|
12
|
+
return command.split('&&').map((step) => {
|
|
13
|
+
const text = step.trim();
|
|
14
|
+
const compiles = COMPILES.test(text) && !TYPE_CHECK_ONLY.test(text) && !BUILDS_CLIENTS.test(text);
|
|
15
|
+
return { text, compiles, project: projectOf(text) };
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function projectOf(step) {
|
|
19
|
+
const given = PROJECT.exec(step)?.[1]?.replace(/\/$/, '') ?? DEFAULT_PROJECT;
|
|
20
|
+
return given.endsWith('.json') ? given : `${given}/${DEFAULT_PROJECT}`;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=script-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-steps.js","sourceRoot":"","sources":["../../../src/check/alias/script-steps.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AACxD,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,yHAAyH;AACzH,MAAM,cAAc,GAAG,uCAAuC,CAAC;AAC/D,sGAAsG;AACtG,MAAM,OAAO,GAAG,yDAAyD,CAAC;AAC1E,sDAAsD;AACtD,MAAM,eAAe,GAAG,eAAe,CAAC;AAWxC,+EAA+E;AAC/E,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC;IAE7E,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,eAAe,EAAE,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Project } from '../model/project.js';
|
|
2
|
+
import type { AdapterPolicy } from './adapter-policy.js';
|
|
3
|
+
/**
|
|
4
|
+
* What binds a port in the sources, with the policy stated there: the `@Adapter` or `@Gateway`
|
|
5
|
+
* above a class (declared style), or a `bind(Port)...` of a file that imports the container of the
|
|
6
|
+
* kit, whose chain `.toClass(Adapter).as(kind).with(...)` is read. A platform wired by hand
|
|
7
|
+
* (`platform.adapter(...)`) states nothing a text can follow.
|
|
8
|
+
*/
|
|
9
|
+
export declare function adapterPolicies(project: Project): AdapterPolicy[];
|
|
10
|
+
//# sourceMappingURL=adapter-policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-policies.d.ts","sourceRoot":"","sources":["../../../src/check/aspects/adapter-policies.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAiBtD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,EAAE,CAEjE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { bindingCalls } from '../declarations/binding-calls.js';
|
|
2
|
+
import { classesOf } from '../declarations/classes-of.js';
|
|
3
|
+
import { optionOf } from '../declarations/option-of.js';
|
|
4
|
+
import { callArguments } from '../text/call-arguments.js';
|
|
5
|
+
import { chainEnd } from '../text/chain-end.js';
|
|
6
|
+
import { splitTopLevel } from '../text/split-top-level.js';
|
|
7
|
+
import { isUnderCondition } from './is-under-condition.js';
|
|
8
|
+
import { statedPolicy } from './stated-policy.js';
|
|
9
|
+
const ADAPTER_DECORATORS = ['Adapter', 'Gateway'];
|
|
10
|
+
const TO_CLASS = /\.\s*toClass\s*\(\s*([A-Za-z_$][\w$]*)/;
|
|
11
|
+
const AS = /\.\s*as\s*\(\s*/;
|
|
12
|
+
const WITH = /\.\s*with\s*\(/g;
|
|
13
|
+
const ASPECTS = /^aspects\s*:\s*\[([\s\S]*)\]$/;
|
|
14
|
+
const UNREADABLE = { ownPolicy: false, timeouts: [], readable: false };
|
|
15
|
+
/**
|
|
16
|
+
* What binds a port in the sources, with the policy stated there: the `@Adapter` or `@Gateway`
|
|
17
|
+
* above a class (declared style), or a `bind(Port)...` of a file that imports the container of the
|
|
18
|
+
* kit, whose chain `.toClass(Adapter).as(kind).with(...)` is read. A platform wired by hand
|
|
19
|
+
* (`platform.adapter(...)`) states nothing a text can follow.
|
|
20
|
+
*/
|
|
21
|
+
export function adapterPolicies(project) {
|
|
22
|
+
return project.files.filter((file) => !file.isTest).flatMap((file) => [...declared(file), ...bound(file)]);
|
|
23
|
+
}
|
|
24
|
+
function declared(source) {
|
|
25
|
+
const { scan } = source;
|
|
26
|
+
return classesOf(scan).flatMap(({ name, decorations }) => decorations
|
|
27
|
+
.filter((decoration) => ADAPTER_DECORATORS.includes(decoration.name))
|
|
28
|
+
.map((decoration) => {
|
|
29
|
+
const given = splitTopLevel(scan.code.slice(decoration.open + 1, decoration.close)).map(({ code }) => code);
|
|
30
|
+
const kind = declaredKind(source, decoration);
|
|
31
|
+
return {
|
|
32
|
+
port: given[0] ?? '',
|
|
33
|
+
className: name,
|
|
34
|
+
source,
|
|
35
|
+
kind: kind.value,
|
|
36
|
+
kindKnown: kind.known,
|
|
37
|
+
conditional: false,
|
|
38
|
+
...declaredPolicy(given.slice(1)),
|
|
39
|
+
};
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
/** `@Gateway` is a gateway; `@Adapter` is `external` unless its `kind` says otherwise, as the kernel reads it. */
|
|
43
|
+
function declaredKind({ scan }, decoration) {
|
|
44
|
+
if (decoration.name === 'Gateway') {
|
|
45
|
+
return { known: true, value: 'gateway' };
|
|
46
|
+
}
|
|
47
|
+
const kind = optionOf(scan, decoration, 'kind');
|
|
48
|
+
return kind === undefined
|
|
49
|
+
? { known: true, value: 'external' }
|
|
50
|
+
: { known: kind.literal !== undefined, value: kind.literal };
|
|
51
|
+
}
|
|
52
|
+
/** The policy the `aspects: [...]` of the options of a declaration states; a list of dependencies is not options. */
|
|
53
|
+
function declaredPolicy(settings) {
|
|
54
|
+
const options = settings.filter((setting) => !setting.startsWith('['));
|
|
55
|
+
const [first = '{}'] = options;
|
|
56
|
+
if (options.length > 1 || !first.startsWith('{')) {
|
|
57
|
+
return UNREADABLE;
|
|
58
|
+
}
|
|
59
|
+
const properties = splitTopLevel(first.slice(1, -1)).map(({ code }) => code);
|
|
60
|
+
const aspects = properties.find((property) => /^aspects(?![\w$])/.test(property));
|
|
61
|
+
const listed = aspects === undefined ? '' : ASPECTS.exec(aspects)?.[1];
|
|
62
|
+
return listed === undefined || properties.some((property) => property.startsWith('...'))
|
|
63
|
+
? UNREADABLE
|
|
64
|
+
: statedPolicy(elementsOf(listed));
|
|
65
|
+
}
|
|
66
|
+
function bound(source) {
|
|
67
|
+
const { code } = source.scan;
|
|
68
|
+
return bindingCalls(source)
|
|
69
|
+
.filter(({ method }) => method === 'bind')
|
|
70
|
+
.map(({ open, token }) => {
|
|
71
|
+
const chain = code.slice(open, chainEnd(code, open + 1));
|
|
72
|
+
const kind = boundKind(source, chain, open);
|
|
73
|
+
return {
|
|
74
|
+
port: token?.code ?? '',
|
|
75
|
+
className: TO_CLASS.exec(chain)?.[1],
|
|
76
|
+
source,
|
|
77
|
+
kind: kind.value,
|
|
78
|
+
kindKnown: kind.known,
|
|
79
|
+
conditional: isUnderCondition(code, open),
|
|
80
|
+
...statedPolicy([...chain.matchAll(WITH)].flatMap((call) => elementsOf(givenTo(chain, call)))),
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/** The literal given to `.as(...)`; a binding without `.as(...)` has no kind, and no policy of a kind goes around it. */
|
|
85
|
+
function boundKind({ scan }, chain, chainStart) {
|
|
86
|
+
const as = AS.exec(chain);
|
|
87
|
+
if (as === null) {
|
|
88
|
+
return { known: true, value: undefined };
|
|
89
|
+
}
|
|
90
|
+
const kindAt = chainStart + as.index + as[0].length;
|
|
91
|
+
const literal = scan.strings.find((candidate) => candidate.start === kindAt);
|
|
92
|
+
return { known: literal !== undefined, value: literal?.value };
|
|
93
|
+
}
|
|
94
|
+
function givenTo(chain, call) {
|
|
95
|
+
return callArguments(chain, call.index + call[0].length - 1)
|
|
96
|
+
.map(({ code }) => code)
|
|
97
|
+
.join(', ');
|
|
98
|
+
}
|
|
99
|
+
function elementsOf(list) {
|
|
100
|
+
return splitTopLevel(list)
|
|
101
|
+
.map(({ code }) => code)
|
|
102
|
+
.filter((code) => code !== '');
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=adapter-policies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-policies.js","sourceRoot":"","sources":["../../../src/check/aspects/adapter-policies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MA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AE,KAAK,EAAE,OAAO,KAAK,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACjE,CAAC;AAED,SAAS,OAAO,CAAC,KAAa,EAAE,IAAqB;IACnD,OAAO,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SACzD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;SACvB,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,aAAa,CAAC,IAAI,CAAC;SACvB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;SACvB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SourceFile } from '../model/source-file.js';
|
|
2
|
+
import type { StatedPolicy } from './stated-policy.js';
|
|
3
|
+
/** What the declaration or the binding of one adapter says of its policy, read as text. */
|
|
4
|
+
export interface AdapterPolicy extends StatedPolicy {
|
|
5
|
+
/** The port the adapter is bound to. */
|
|
6
|
+
readonly port: string;
|
|
7
|
+
/** Undefined for a binding that names no class (`toValue`, `toFactory`): it still binds the port. */
|
|
8
|
+
readonly className: string | undefined;
|
|
9
|
+
/** The file that states it: the one of the class in the declared style, the one that binds it otherwise. */
|
|
10
|
+
readonly source: SourceFile;
|
|
11
|
+
/** `external`, `gateway`, or whatever is stated; undefined when the adapter has no kind, or one the text does not show. */
|
|
12
|
+
readonly kind: string | undefined;
|
|
13
|
+
/** False when the kind is written as anything but a literal. */
|
|
14
|
+
readonly kindKnown: boolean;
|
|
15
|
+
/** True for a binding that runs in some cases only: under a condition, a loop, a ternary, `when(...)`. */
|
|
16
|
+
readonly conditional: boolean;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=adapter-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-policy.d.ts","sourceRoot":"","sources":["../../../src/check/aspects/adapter-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,2FAA2F;AAC3F,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,4GAA4G;IAC5G,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,2HAA2H;IAC3H,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,0GAA0G;IAC1G,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter-policy.js","sourceRoot":"","sources":["../../../src/check/aspects/adapter-policy.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the call whose name ends at `at` runs in some cases only: its statement starts with
|
|
3
|
+
* anything but a receiver (a ternary, `&&`, an assignment), or a block around it is opened by a
|
|
4
|
+
* condition, a loop or `when(...)`. Read on blanked code.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isUnderCondition(code: string, at: number): boolean;
|
|
7
|
+
//# sourceMappingURL=is-under-condition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-under-condition.d.ts","sourceRoot":"","sources":["../../../src/check/aspects/is-under-condition.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAQlE"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** What makes a statement, or the block it sits in, run in some cases only. */
|
|
2
|
+
const CONDITION = /(?<![\w$.])(?:if|else|switch|case|for|while|do|try|catch|finally|when)(?![\w$])/;
|
|
3
|
+
const RECEIVER = /^[\s\w$.]*$/;
|
|
4
|
+
/**
|
|
5
|
+
* Whether the call whose name ends at `at` runs in some cases only: its statement starts with
|
|
6
|
+
* anything but a receiver (a ternary, `&&`, an assignment), or a block around it is opened by a
|
|
7
|
+
* condition, a loop or `when(...)`. Read on blanked code.
|
|
8
|
+
*/
|
|
9
|
+
export function isUnderCondition(code, at) {
|
|
10
|
+
const statement = code.slice(headStart(code, at), at);
|
|
11
|
+
return (!RECEIVER.test(statement) ||
|
|
12
|
+
CONDITION.test(statement) ||
|
|
13
|
+
enclosingHeads(code, at).some((head) => CONDITION.test(head)));
|
|
14
|
+
}
|
|
15
|
+
/** The text that opens each block around `at`, the innermost first. */
|
|
16
|
+
function enclosingHeads(code, at) {
|
|
17
|
+
const heads = [];
|
|
18
|
+
let closed = 0;
|
|
19
|
+
for (let index = at - 1; index >= 0; index -= 1) {
|
|
20
|
+
const char = code.charAt(index);
|
|
21
|
+
if (char === '}') {
|
|
22
|
+
closed += 1;
|
|
23
|
+
}
|
|
24
|
+
else if (char === '{' && closed > 0) {
|
|
25
|
+
closed -= 1;
|
|
26
|
+
}
|
|
27
|
+
else if (char === '{') {
|
|
28
|
+
heads.push(code.slice(headStart(code, index), index));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return heads;
|
|
32
|
+
}
|
|
33
|
+
/** Offset after the `;`, `{` or `}` that ends what comes before the statement or the block head ending at `end`, parentheses skipped. */
|
|
34
|
+
function headStart(code, end) {
|
|
35
|
+
let nested = 0;
|
|
36
|
+
for (let index = end - 1; index >= 0; index -= 1) {
|
|
37
|
+
const char = code.charAt(index);
|
|
38
|
+
if (char === ')') {
|
|
39
|
+
nested += 1;
|
|
40
|
+
}
|
|
41
|
+
else if (char === '(') {
|
|
42
|
+
nested -= 1;
|
|
43
|
+
}
|
|
44
|
+
else if (nested <= 0 && ';{}'.includes(char)) {
|
|
45
|
+
return index + 1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=is-under-condition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-under-condition.js","sourceRoot":"","sources":["../../../src/check/aspects/is-under-condition.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,SAAS,GAAG,iFAAiF,CAAC;AACpG,MAAM,QAAQ,GAAG,aAAa,CAAC;AAE/B;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,EAAU;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEtD,OAAO,CACL,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QACzB,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;QACzB,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,SAAS,cAAc,CAAC,IAAY,EAAE,EAAU;IAC9C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,IAAI,KAAK,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEhC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yIAAyI;AACzI,SAAS,SAAS,CAAC,IAAY,EAAE,GAAW;IAC1C,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,KAAK,IAAI,KAAK,GAAG,GAAG,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAEhC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACxB,MAAM,IAAI,CAAC,CAAC;QACd,CAAC;aAAM,IAAI,MAAM,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC/C,OAAO,KAAK,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** What a list of aspects states, each element read as text. */
|
|
2
|
+
export interface StatedPolicy {
|
|
3
|
+
/** Whether `ownPolicy(...)` is an element: the default policy of the platform then leaves the adapter alone. */
|
|
4
|
+
readonly ownPolicy: boolean;
|
|
5
|
+
/** The durations of the `timeout(<number>)` that are elements of the list or arguments of its `ownPolicy(...)`. */
|
|
6
|
+
readonly timeouts: readonly number[];
|
|
7
|
+
/**
|
|
8
|
+
* False when an element may state a limit or a policy the text does not show: a `timeout(...)` given
|
|
9
|
+
* anything but a number, an aspect under `when(...)`, a variable, a spread, a call of another name.
|
|
10
|
+
*/
|
|
11
|
+
readonly readable: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Reads the elements of an aspects list. A `timeout(` nested in the options of another aspect is
|
|
15
|
+
* not an element, and states nothing here.
|
|
16
|
+
*/
|
|
17
|
+
export declare function statedPolicy(elements: readonly string[]): StatedPolicy;
|
|
18
|
+
//# sourceMappingURL=stated-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stated-policy.d.ts","sourceRoot":"","sources":["../../../src/check/aspects/stated-policy.ts"],"names":[],"mappings":"AAQA,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,gHAAgH;IAChH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,mHAAmH;IACnH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,YAAY,CAStE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { matchingBracket } from '../text/matching-bracket.js';
|
|
2
|
+
import { splitTopLevel } from '../text/split-top-level.js';
|
|
3
|
+
const CALL = /^([A-Za-z_$][\w$]*)\s*\(/;
|
|
4
|
+
const NUMBER = /^\d[\d_]*$/;
|
|
5
|
+
/** The aspects of `@ddd-ts-kit/aspects` that state no time limit and no policy of their own. */
|
|
6
|
+
const WITHOUT_LIMIT = ['retry', 'circuitBreaker', 'cached', 'bulkhead', 'logged', 'timed'];
|
|
7
|
+
/**
|
|
8
|
+
* Reads the elements of an aspects list. A `timeout(` nested in the options of another aspect is
|
|
9
|
+
* not an element, and states nothing here.
|
|
10
|
+
*/
|
|
11
|
+
export function statedPolicy(elements) {
|
|
12
|
+
return elements.map(statedBy).reduce((all, one) => ({
|
|
13
|
+
ownPolicy: all.ownPolicy || one.ownPolicy,
|
|
14
|
+
timeouts: [...all.timeouts, ...one.timeouts],
|
|
15
|
+
readable: all.readable && one.readable,
|
|
16
|
+
}), { ownPolicy: false, timeouts: [], readable: true });
|
|
17
|
+
}
|
|
18
|
+
function statedBy(element) {
|
|
19
|
+
const call = CALL.exec(element);
|
|
20
|
+
const open = call === null ? -1 : call[0].length - 1;
|
|
21
|
+
if (call === null || matchingBracket(element, open) !== element.length - 1) {
|
|
22
|
+
return { ownPolicy: false, timeouts: [], readable: false };
|
|
23
|
+
}
|
|
24
|
+
const given = splitTopLevel(element.slice(open + 1, -1))
|
|
25
|
+
.map(({ code }) => code)
|
|
26
|
+
.filter((code) => code !== '');
|
|
27
|
+
if (call[1] === 'ownPolicy') {
|
|
28
|
+
return { ...statedPolicy(given), ownPolicy: true };
|
|
29
|
+
}
|
|
30
|
+
return call[1] === 'timeout'
|
|
31
|
+
? limitOf(given[0] ?? '')
|
|
32
|
+
: { ownPolicy: false, timeouts: [], readable: WITHOUT_LIMIT.includes(call[1] ?? '') };
|
|
33
|
+
}
|
|
34
|
+
function limitOf(duration) {
|
|
35
|
+
return NUMBER.test(duration)
|
|
36
|
+
? { ownPolicy: false, timeouts: [Number(duration.replaceAll('_', ''))], readable: true }
|
|
37
|
+
: { ownPolicy: false, timeouts: [], readable: false };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=stated-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stated-policy.js","sourceRoot":"","sources":["../../../src/check/aspects/stated-policy.ts"],"names":[],"mappings":"AAAA,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.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"architecture-rules.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAgH1C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EA+G7C,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { aspectsOutsideIn } from '../rules/aspects-outside-in.js';
|
|
2
|
+
import { aspectsTimeoutCoversDelegate } from '../rules/aspects-timeout-covers-delegate.js';
|
|
2
3
|
import { authzActorExplicit } from '../rules/authz-actor-explicit.js';
|
|
3
4
|
import { authzFieldsBySchema } from '../rules/authz-fields-by-schema.js';
|
|
4
5
|
import { authzDeclared } from '../rules/authz-declared.js';
|
|
@@ -51,6 +52,7 @@ import { eventSourcingStoreBehindRepository } from '../rules/event-sourcing-stor
|
|
|
51
52
|
import { eventSourcingUpcasterRequired } from '../rules/event-sourcing-upcaster-required.js';
|
|
52
53
|
import { errorsKnownCode } from '../rules/errors-known-code.js';
|
|
53
54
|
import { filesPortNotConnector } from '../rules/files-port-not-connector.js';
|
|
55
|
+
import { filesUploadContentRule } from '../rules/files-upload-content-rule.js';
|
|
54
56
|
import { searchStoreFromPlatform } from '../rules/search-store-from-platform.js';
|
|
55
57
|
import { eventsConsumerIdempotent } from '../rules/events-consumer-idempotent.js';
|
|
56
58
|
import { eventsDefinedInPublishedLanguage } from '../rules/events-defined-in-published-language.js';
|
|
@@ -182,6 +184,7 @@ export const ARCHITECTURE_RULES = [
|
|
|
182
184
|
privacyNoPersonalDataInLogs,
|
|
183
185
|
privacySnapshotSealed,
|
|
184
186
|
aspectsOutsideIn,
|
|
187
|
+
aspectsTimeoutCoversDelegate,
|
|
185
188
|
tracingPlatformOnly,
|
|
186
189
|
tenancyScopedStatement,
|
|
187
190
|
standardNoParallelInterface,
|
|
@@ -215,6 +218,7 @@ export const ARCHITECTURE_RULES = [
|
|
|
215
218
|
persistenceNoFileContent,
|
|
216
219
|
persistencePrimaryKeyOrder,
|
|
217
220
|
filesPortNotConnector,
|
|
221
|
+
filesUploadContentRule,
|
|
218
222
|
searchStoreFromPlatform,
|
|
219
223
|
];
|
|
220
224
|
//# sourceMappingURL=architecture-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architecture-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,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,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,6BAA6B;IAC7B,wBAAwB;IACxB,iBAAiB;IACjB,uBAAuB;IACvB,yBAAyB;IACzB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;IACrB,uBAAuB;CACxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"architecture-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,M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3B,sBAAsB;IACtB,sBAAsB;IACtB,2BAA2B;IAC3B,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;IACzB,gCAAgC;IAChC,4BAA4B;IAC5B,kBAAkB;IAClB,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,6BAA6B;IAC7B,wBAAwB;IACxB,iBAAiB;IACjB,uBAAuB;IACvB,yBAAyB;IACzB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;IACxB,0BAA0B;IAC1B,qBAAqB;IACrB,sBAAsB;IACtB,uBAAuB;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/imports-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"imports-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/imports-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8C1D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const IMPORTS_DOCS = {
|
|
2
2
|
'imports/alias-only': {
|
|
3
|
-
why: 'An alias names a file from the root of the project: the import reads the same from every file, says which context and which layer it reaches without counting "../", and does not change when the importing file moves. One way of writing an import also means one thing to review and one thing for the boundary rules to read: the checker, ESLint and dependency-cruiser resolve an alias exactly as they resolve a relative path, so no boundary is crossed by choosing the other spelling. The rule holds under the source root, test/ and scripts/, the same directory included, for import, export ... from and import(). The alias is declared once, under "paths" in tsconfig.json, and the build rewrites it into a relative path in the compiled output, which runs with plain `node`. An alias path with a "." or ".." segment is refused too, since it could name a file outside its directory. The compiler reports an alias that names no file; a JavaScript file at the project root (a config, a migration) is not judged. ESLint fixes the import (`eslint --fix`) and writes it with the ending "importExtension" asks for, which `imports/extension` holds.',
|
|
3
|
+
why: 'An alias names a file from the root of the project: the import reads the same from every file, says which context and which layer it reaches without counting "../", and does not change when the importing file moves. One way of writing an import also means one thing to review and one thing for the boundary rules to read: the checker, ESLint and dependency-cruiser resolve an alias exactly as they resolve a relative path, so no boundary is crossed by choosing the other spelling. The rule holds under the source root, test/ and scripts/, the same directory included, for import, export ... from and import(). The alias is declared once, under "paths" in tsconfig.json, and the build rewrites it into a relative path in the compiled output, which runs with plain `node`. An alias path with a "." or ".." segment is refused too, since it could name a file outside its directory. The compiler reports an alias that names no file; a JavaScript file at the project root (a config, a migration) is not judged. One relative path stands: a file directly under test/support/ imports its neighbour by "./<name>", because a test runner loads its global setup, and what that file imports, before any alias exists. That path names a file: "./.", "./.." and a directory of test/support/ are refused as any relative path. Its name is judged too, against the files on disk: a ".ts" source without its extension under "importExtension": "none"; under "js" the name of the source ("./x.ts" for "./x" and "./x.js", "./x.mts" for "./x.mjs"), where the runner finds the file under the name it has and a ".js" passes the type check, then stops the run on a module that cannot be found. A file that exists as it is named (a JSON file, a JavaScript file) is left alone. ESLint fixes the import (`eslint --fix`) and writes it with the ending "importExtension" asks for, which `imports/extension` holds.',
|
|
4
4
|
bad: `// src/contexts/billing/application/commands/issue-invoice/issue-invoice.handler.ts
|
|
5
5
|
import { Invoice } from '../../../domain/aggregates/invoice.aggregate';
|
|
6
6
|
import { IssueInvoiceCommand } from './issue-invoice.command';`,
|
|
@@ -8,7 +8,9 @@ import { IssueInvoiceCommand } from './issue-invoice.command';`,
|
|
|
8
8
|
import { IssueInvoiceCommand } from '@/contexts/billing/application/commands/issue-invoice/issue-invoice.command';
|
|
9
9
|
import { Invoice } from '@/contexts/billing/domain/aggregates/invoice.aggregate';
|
|
10
10
|
// test/e2e/issue-invoice.e2e.spec.ts
|
|
11
|
-
import { startApplication } from '$test/e2e/support/start-application'
|
|
11
|
+
import { startApplication } from '$test/e2e/support/start-application';
|
|
12
|
+
// test/support/test-database-setup.ts: a test runner loads its global setup, and what it imports, before any alias exists
|
|
13
|
+
import { openRun } from './test-database-run'; // './test-database-run.ts' under "importExtension": "js"`,
|
|
12
14
|
},
|
|
13
15
|
'imports/extension': {
|
|
14
16
|
why: 'An import of a file of the project has one spelling, and "importExtension" in ddd-ts-kit.config.json says which. Under "none", the default of a new project, it names the file without an extension: the compiler resolves as a bundler does ("moduleResolution": "Bundler"), which still reports a file that does not exist but would also accept ".js", so this rule is what refuses it. Under "js", which is also what a config without the key means, it ends with the ".js" of the file the compiler emits: the compiler resolves as Node does and refuses any other spelling itself (TS2835); this rule says it in the words of the project and ESLint fixes it. Node needs the extension at run time either way: `ddd-ts-kit build-aliases` rewrites each alias of the compiled output into a relative path ending in ".js". Under "none" an alias may name a directory (".../published-language"): the compiler resolves its index.ts and the build completes it with "/index.js". Only a specifier that starts with an alias of the project is judged: a package subpath that ends like a file name ("zod/v4/core.js") is left alone, and a relative import belongs to imports/alias-only. A dot in a file name is not an extension: "invoice.aggregate" is written without one. To move a project from one spelling to the other: change "importExtension", write the "module" and "moduleResolution" that imports/alias-declared then asks for, run `eslint --fix` and the formatter.',
|
|
@@ -24,7 +26,7 @@ import { Invoice } from '@/contexts/billing/domain/aggregates/invoice.aggregate'
|
|
|
24
26
|
import { InvoiceIssued } from '@/contexts/billing/published-language';`,
|
|
25
27
|
},
|
|
26
28
|
'imports/alias-declared': {
|
|
27
|
-
why: 'An alias is declared in one place and resolved by many tools: the compiler, the dev runner, the test runner, ESLint, the checker, dependency-cruiser, knip, and the build that makes the output runnable. If two of them disagree, the type check passes on one file while production loads another, or a boundary rule stops seeing an import. So there is one source a person edits, "importAlias" in ddd-ts-kit.config.json, and one declaration derived from it that the tools read, "paths" in tsconfig.json. Node reads neither: the compiler emits an alias as it was written, so `ddd-ts-kit build-aliases` rewrites each one into a relative path after the compiler, and the output runs with plain `node`. The rule compares "paths" (tsconfig.json and tsconfig.build.json) with "importAlias", refuses a second entry under an alias, a "baseUrl" and a knip "paths"; checks that vitest and dependency-cruiser read tsconfig and that jest, which does not, repeats the same mapping; reports a script that compiles without the rewrite step and a tsx script under another tsconfig. The ending of an import has one source too, "importExtension", and three declarations follow it: "module" and "moduleResolution" of tsconfig.json ("ESNext" and "Bundler" without an extension, a Node resolution with one), the pattern of each jest mapping, and the build step, which writes the ".js" Node needs. An alias is "@/" or "$<name>/": neither can be the name of a package, so no installed dependency can ever take the place of a file of the project; "#<name>/" (a Node subpath import) and "@<name>/" (the name of a scope) are refused.',
|
|
29
|
+
why: 'An alias is declared in one place and resolved by many tools: the compiler, the dev runner, the test runner, ESLint, the checker, dependency-cruiser, knip, and the build that makes the output runnable. If two of them disagree, the type check passes on one file while production loads another, or a boundary rule stops seeing an import. So there is one source a person edits, "importAlias" in ddd-ts-kit.config.json, and one declaration derived from it that the tools read, "paths" in tsconfig.json. Node reads neither: the compiler emits an alias as it was written, so `ddd-ts-kit build-aliases` rewrites each one into a relative path after the compiler, and the output runs with plain `node`. The rule compares "paths" (tsconfig.json and tsconfig.build.json) with "importAlias", refuses a second entry under an alias, a "baseUrl" and a knip "paths"; checks that vitest and dependency-cruiser read tsconfig and that jest, which does not, repeats the same mapping; reports a script that compiles without the rewrite step and a tsx script under another tsconfig. The ending of an import has one source too, "importExtension", and three declarations follow it: "module" and "moduleResolution" of tsconfig.json ("ESNext" and "Bundler" without an extension, a Node resolution with one), the pattern of each jest mapping, and the build step, which writes the ".js" Node needs. Under "js" a file directly under test/support/ names its neighbour by the ".ts" of its source (imports/alias-only): where one does, tsconfig.json has to let the type check read that ending, with "allowImportingTsExtensions": true, which the compiler accepts only with "noEmit": true, and tsconfig.build.json, which extends it, has to set both back to false, or the build writes nothing. Whatever the ending, tsconfig.build.json and each tsconfig a script of package.json compiles what ships with are reported when they resolve "noEmit": true, their own or inherited through "extends": the compiler then writes no file, without an error, and an earlier output would ship. An alias is "@/" or "$<name>/": neither can be the name of a package, so no installed dependency can ever take the place of a file of the project; "#<name>/" (a Node subpath import) and "@<name>/" (the name of a scope) are refused.',
|
|
28
30
|
bad: `// ddd-ts-kit.config.json
|
|
29
31
|
"importAlias": "@/", "importExtension": "none"
|
|
30
32
|
// tsconfig.json
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports-docs.js","sourceRoot":"","sources":["../../../src/check/explain/imports-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAsC;IAC7D,oBAAoB,EAAE;QACpB,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"imports-docs.js","sourceRoot":"","sources":["../../../src/check/explain/imports-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAsC;IAC7D,oBAAoB,EAAE;QACpB,GAAG,EAAE,w1DAAw1D;QAC71D,GAAG,EAAE;;+DAEsD;QAC3D,IAAI,EAAE;;;;;;yGAM+F;KACtG;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,k6CAAk6C;QACv6C,GAAG,EAAE;;;;uEAI8D;QACnE,IAAI,EAAE;;;;uEAI6D;KACpE;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,muEAAmuE;QACxuE,GAAG,EAAE;;;;;;sCAM6B;QAClC,IAAI,EAAE;;;;;;;;iCAQuB;KAC9B;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"persistence-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoF9D,CAAC"}
|
|
@@ -42,6 +42,27 @@ export class AttachReceiptHandler {
|
|
|
42
42
|
export class AttachReceiptHandler {
|
|
43
43
|
constructor(private readonly staging: FileStaging, private readonly keys: FileKeys) {}
|
|
44
44
|
}`,
|
|
45
|
+
},
|
|
46
|
+
'files/upload-content-rule': {
|
|
47
|
+
why: "An upload is checked twice: the media type the client declares must be one the route accepts, and the first bytes must prove that type, by the signature of its format or, for text, by holding no control character and being valid UTF-8 (or any single-byte text when the upload says `text: 'single-byte'`). A type the kit has no such rule for can never be proven: `application/vnd.ms-excel`, which a browser on Windows sends for a CSV, `application/octet-stream`, a video. A route that accepts it without saying how its content is judged answers 415 to every file of it, which looks like a client mistake and is a declaration that could never work. So the route states the rule in `contentRules`: `text`, the content is text under another name, or `unchecked`, the route takes the bytes as they are and says so in its contract. `@ddd-ts-kit/http` refuses the route when it is declared, with the same sentence; this rule reads the upload of a *.route.ts or a *.controller.ts when its `mediaTypes` and `contentRules` are written as literals, and reports the string. Reported too: an entry that is no media type (`*/*`, a bare word), a family none of whose types has a rule (`video/*`), and a stated rule that does nothing, for a type the kit already verifies or one the upload does not accept. The rule of a family never reaches a type a browser runs (`image/svg+xml`, `text/html`, `application/xhtml+xml`, `text/javascript`, `application/javascript`): accepted, such a type is reported until `contentRules` names it. A list built elsewhere (a constant, a spread) is not read here: the declaration of the route judges it.",
|
|
48
|
+
bad: `@Controller({
|
|
49
|
+
method: 'POST',
|
|
50
|
+
path: '/statements',
|
|
51
|
+
upload: { field: 'file', maxBytes: 5_000_000, mediaTypes: ['text/csv', 'application/vnd.ms-excel'] },
|
|
52
|
+
response: { status: 201 },
|
|
53
|
+
})`,
|
|
54
|
+
good: `@Controller({
|
|
55
|
+
method: 'POST',
|
|
56
|
+
path: '/statements',
|
|
57
|
+
upload: {
|
|
58
|
+
field: 'file',
|
|
59
|
+
maxBytes: 5_000_000,
|
|
60
|
+
mediaTypes: ['text/csv', 'application/vnd.ms-excel'],
|
|
61
|
+
text: 'single-byte',
|
|
62
|
+
contentRules: { 'application/vnd.ms-excel': 'text' },
|
|
63
|
+
},
|
|
64
|
+
response: { status: 201 },
|
|
65
|
+
})`,
|
|
45
66
|
},
|
|
46
67
|
'search/store-from-platform': {
|
|
47
68
|
why: 'Which node a read model reaches and how its tenants are kept apart are choices of the platform, made once for every store: a context that opens a transport or names a tenancy of its own has chosen them for itself, out of reach of the provisioning, of the credentials of the deployment and of the tenancy of the project, and one of its stores may read the documents of every tenant; spreading the answer of `search.options` to replace its tenancy is the same choice made over the platform. The domain and the use cases see a read model through its port, as on any store.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence-docs.js","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAsC;IACjE,+BAA+B,EAAE;QAC/B,GAAG,EAAE,0jCAA0jC;QAC/jC,GAAG,EAAE;;;wFAG+E;QACpF,IAAI,EAAE;;;kGAGwF;KAC/F;IACD,+BAA+B,EAAE;QAC/B,GAAG,EAAE,6wBAA6wB;QAClxB,GAAG,EAAE;oGAC2F;QAChG,IAAI,EAAE;0FACgF;KACvF;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,ugBAAugB;QAC5gB,GAAG,EAAE;;;IAGL;QACA,IAAI,EAAE;;;;;IAKN;KACD;IACD,0BAA0B,EAAE;QAC1B,GAAG,EAAE,0YAA0Y;QAC/Y,GAAG,EAAE;;;;EAIP;QACE,IAAI,EAAE;;;;EAIR;KACC;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,2jBAA2jB;QAChkB,GAAG,EAAE;;;;;;EAMP;QACE,IAAI,EAAE;;;;;;;EAOR;KACC;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"persistence-docs.js","sourceRoot":"","sources":["../../../src/check/explain/persistence-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAsC;IACjE,+BAA+B,EAAE;QAC/B,GAAG,EAAE,0jCAA0jC;QAC/jC,GAAG,EAAE;;;wFAG+E;QACpF,IAAI,EAAE;;;kGAGwF;KAC/F;IACD,+BAA+B,EAAE;QAC/B,GAAG,EAAE,6wBAA6wB;QAClxB,GAAG,EAAE;oGAC2F;QAChG,IAAI,EAAE;0FACgF;KACvF;IACD,6BAA6B,EAAE;QAC7B,GAAG,EAAE,ugBAAugB;QAC5gB,GAAG,EAAE;;;IAGL;QACA,IAAI,EAAE;;;;;IAKN;KACD;IACD,0BAA0B,EAAE;QAC1B,GAAG,EAAE,0YAA0Y;QAC/Y,GAAG,EAAE;;;;EAIP;QACE,IAAI,EAAE;;;;EAIR;KACC;IACD,2BAA2B,EAAE;QAC3B,GAAG,EAAE,mlDAAmlD;QACxlD,GAAG,EAAE;;;;;GAKN;QACC,IAAI,EAAE;;;;;;;;;;;GAWP;KACA;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,2jBAA2jB;QAChkB,GAAG,EAAE;;;;;;EAMP;QACE,IAAI,EAAE;;;;;;;EAOR;KACC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/standard-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"standard-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/standard-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2D3D,CAAC"}
|
|
@@ -7,6 +7,22 @@ import { Retry } from '@ddd-ts-kit/aspects/decorators';`,
|
|
|
7
7
|
builder.bind(PaymentGateway).toClass(StripePaymentGateway, [PaymentSettings]).with(retry({ attempts: 3 }), timeout(2000));
|
|
8
8
|
// infrastructure/external/stripe-payment.gateway.ts
|
|
9
9
|
import { Retry } from '@ddd-ts-kit/aspects/decorators';`,
|
|
10
|
+
},
|
|
11
|
+
'aspects/timeout-covers-delegate': {
|
|
12
|
+
why: 'The platform puts a default policy around every `external` or `gateway` adapter that states none: retries, and a time limit for each attempt (the fallback of OUTBOUND_TIMEOUT_MS in the configuration of the platform, else `timeoutMs` of resilience/default-resilience-settings.ts: 2 seconds as generated). An adapter that only hands its call to another adapter, slow by nature and bound with a longer limit of its own, is then cut by a limit nobody chose: every call fails at the default, as a timeout of the outer adapter, and nothing points at the adapter behind it. The rule reports that one case: an adapter left to the default policy (no `ownPolicy(...)`, no `timeout(...)` of its own, a kind `external` or `gateway`, which an `@Adapter` that names no kind has), given a port whose adapter states a longer `timeout(<ms>)` around all its methods. An adapter that states its own limit, even a shorter one, chose it and is never reported. It reads `@Adapter`, `@Gateway` and the bindings of the container of the kit (`bind(Port).toClass(Adapter).as(kind).with(...)`), and judges nothing the text does not show: a platform wired by hand (`platform.adapter(...)`); a duration or a kind that is not a literal; an aspect that is a variable, a spread, a call of another name or under `when(...)`; a `timeout(` nested in the options of another aspect; a `@Timeout` on a method; a port or an adapter bound more than once, bound again by `rebind(`, or bound under a condition; a parameter typed by a name the adapter does not import from a file of the project (a type of a package, a declaration of its own file); two ports of one name unless each file imports its own from the file that declares it; an adapter reached through a middle adapter; a default limit that is not one number, or an environment that sets OUTBOUND_TIMEOUT_MS; and the retries around a limit.',
|
|
13
|
+
bad: `// infrastructure/external/remote-quote-reader.adapter.ts
|
|
14
|
+
@Adapter(QuoteReader, { kind: 'external' })
|
|
15
|
+
export class RemoteQuoteReader implements QuoteReader {
|
|
16
|
+
constructor(private readonly models: ModelReader) {}
|
|
17
|
+
}
|
|
18
|
+
// infrastructure/external/remote-model-reader.adapter.ts
|
|
19
|
+
@Adapter(ModelReader, { kind: 'external', aspects: [ownPolicy(timeout(120_000))] })
|
|
20
|
+
export class RemoteModelReader implements ModelReader {}`,
|
|
21
|
+
good: `// infrastructure/external/remote-quote-reader.adapter.ts
|
|
22
|
+
@Adapter(QuoteReader, { kind: 'external', aspects: [ownPolicy(timeout(120_000))] })
|
|
23
|
+
export class RemoteQuoteReader implements QuoteReader {
|
|
24
|
+
constructor(private readonly models: ModelReader) {}
|
|
25
|
+
}`,
|
|
10
26
|
},
|
|
11
27
|
'tracing/platform-only': {
|
|
12
28
|
why: 'Tracing is non-invasive and wired once. One action is one trace because every span is opened by the same few places: the request boundary, the bus middleware, the instrumentation around adapters and handlers, the outbox relay. A context that imports @ddd-ts-kit/tracing or an @opentelemetry package opens spans of its own, with names and attributes nobody reviews, and can no longer be traced differently by changing the composition root alone. Judged: every source under the source root, tests included, but the platform directory, main.ts and apps/.',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-docs.js","sourceRoot":"","sources":["../../../src/check/explain/standard-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAsC;IAC9D,oBAAoB,EAAE;QACpB,GAAG,EAAE,8cAA8c;QACnd,GAAG,EAAE;wDAC+C;QACpD,IAAI,EAAE;;;wDAG8C;KACrD;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,yiBAAyiB;QAC9iB,GAAG,EAAE;4CACmC;QACxC,IAAI,EAAE;;wDAE8C;KACrD;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,qkBAAqkB;QAC1kB,GAAG,EAAE;;;;;gFAKuE;QAC5E,IAAI,EAAE;;;;;;6CAMmC;KAC1C;IACD,+BAA+B,EAAE;QAC/B,GAAG,EAAE,8TAA8T;QACnU,GAAG,EAAE;8GACqG;QAC1G,IAAI,EAAE;;;oFAG0E;KACjF;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"standard-docs.js","sourceRoot":"","sources":["../../../src/check/explain/standard-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAsC;IAC9D,oBAAoB,EAAE;QACpB,GAAG,EAAE,8cAA8c;QACnd,GAAG,EAAE;wDAC+C;QACpD,IAAI,EAAE;;;wDAG8C;KACrD;IACD,iCAAiC,EAAE;QACjC,GAAG,EAAE,o0DAAo0D;QACz0D,GAAG,EAAE;;;;;;;yDAOgD;QACrD,IAAI,EAAE;;;;EAIR;KACC;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,yiBAAyiB;QAC9iB,GAAG,EAAE;4CACmC;QACxC,IAAI,EAAE;;wDAE8C;KACrD;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,qkBAAqkB;QAC1kB,GAAG,EAAE;;;;;gFAKuE;QAC5E,IAAI,EAAE;;;;;;6CAMmC;KAC1C;IACD,+BAA+B,EAAE;QAC/B,GAAG,EAAE,8TAA8T;QACnU,GAAG,EAAE;8GACqG;QAC1G,IAAI,EAAE;;;oFAG0E;KACjF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenancy-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/tenancy-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"tenancy-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/tenancy-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAqC1D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const TENANCY_DOCS = {
|
|
2
2
|
'tenancy/scoped-statement': {
|
|
3
|
-
why: 'On shared tables, one statement without its tenant condition reads or overwrites the data of every tenant: the most common and the most damaging leak of a multi-tenant application. The kit puts the condition in one place, the helpers of the ORM package, which read the tenant from the execution scope, refuse work that names none, widen reads only under an audited elevation and never widen writes. A table reached straight from the executor bypasses all of it. Judged in a project whose "stack.tenancy" is not "none": the infrastructure of the contexts, tests aside, but a context declared the control plane of the tenants ("contexts.<name>.tenancy": "control-plane", a deviation recorded in "deviations"), whose tables belong to no tenant since it decides who belongs to which (the identity preset declares its context so). Checked by text, statement by statement: on Knex the executor used other than as the argument of a helper, and raw SQL that may reach rows by itself: a word that reads or writes rows (`select`, `from`, `join`, `insert`, `update`, `delete`, `values`, `call`...) or starts a statement (`table`, `with`, `do`...), a call to a function that is not a known expression (an aggregate, a cast, arithmetic, text), a text that is not a literal or a template that interpolates; a statement of the schema (`create`, `alter`, `drop`, `comment`) with no word of rows, and an aggregate in a select, reach no row by themselves; on Drizzle a read, update or delete whose where carries no tenant condition (inline or in the local it is given), an insert whose row names no tenant, a relational query or a raw execute; on Prisma a statement on the client whose where spreads no `tenantWhere` (a read) or `ownTenantWhere` (an update, a delete), a create whose data spreads no `tenantScopeOf`, `findUnique` and `upsert`, which reach a row by its key when the tenant is never part of the key, raw SQL, and the client held in a variable; on TypeORM the same on the manager (`find*`, `count*`, `update`, `delete`, `insert`, a query builder whose where carries no condition, `insertIgnoringConflict` given a row that names no tenant, `save` and `upsert`, `query`); on the four, a read model store built without its tenant option. The condition has to be a conjunct of the statement, since SQL binds `and` before `or` and an alternative beside it is outside it: on Knex no `.orWhere*` or `.or` at the top of a statement of `tenantTable`, `ownTenantTable` or `whereTenant`, and no `clearWhere()` or `clear(\'where\')`, on the chain, on a local, on what a function of the file answers or in a `modify` (`tenantTable`, `ownTenantTable` and `whereTenant` also refuse them when the statement is built, `UngroupedOrError` and `ClearedTenantConditionError`, and hold the text of a `whereRaw`, or a `knex.raw` given to a where, as one conjunct in parentheses; an `orHaving` applies after the where, and is free); on Drizzle the condition is a direct argument of `where` or of `and`, never under `or`, `not` or a `sql` template; on Prisma the helper is spread at the top of the where or in its `AND`, never under `OR`, `NOT` or a relation; on TypeORM the same, a where array spreads it in each entry, a query builder has no `orWhere` at its top, and the condition stands in its last `where` or an `andWhere` after it, since a `where` resets what comes before it. What is in a group beside the condition is correct and accepted: a callback of a Knex `where`, an `or` given to the `and` of Drizzle, an `OR` beside the Prisma spread, `new Brackets(...)` in a TypeORM `andWhere`. A where built by another function is not followed: inline it, or record a deviation.',
|
|
3
|
+
why: 'On shared tables, one statement without its tenant condition reads or overwrites the data of every tenant: the most common and the most damaging leak of a multi-tenant application. The kit puts the condition in one place, the helpers of the ORM package, which read the tenant from the execution scope, refuse work that names none, widen reads only under an audited elevation and never widen writes. A table reached straight from the executor bypasses all of it. Judged in a project whose "stack.tenancy" is not "none": the infrastructure of the contexts, tests aside, but a context declared the control plane of the tenants ("contexts.<name>.tenancy": "control-plane", a deviation recorded in "deviations"), whose tables belong to no tenant since it decides who belongs to which (the identity preset declares its context so). Checked by text, statement by statement: on Knex the executor used other than as the argument of a helper, and raw SQL that may reach rows by itself: a word that reads or writes rows (`select`, `from`, `join`, `insert`, `update`, `delete`, `values`, `call`...) or starts a statement (`table`, `with`, `do`...), a call to a function that is not a known expression (an aggregate, a cast, arithmetic, text), a text that is not a literal or a template that interpolates; a statement of the schema (`create`, `alter`, `drop`, `comment`) with no word of rows, and an aggregate in a select, reach no row by themselves; on Drizzle a read, update or delete whose where carries no tenant condition (inline or in the local it is given), an insert whose row names no tenant, a relational query or a raw execute; on Prisma a statement on the client whose where spreads no `tenantWhere` (a read) or `ownTenantWhere` (an update, a delete), a create whose data spreads no `tenantScopeOf`, `findUnique` and `upsert`, which reach a row by its key when the tenant is never part of the key, raw SQL, and the client held in a variable; on TypeORM the same on the manager (`find*`, `count*`, `update`, `delete`, `insert`, a query builder whose where carries no condition, `insertIgnoringConflict` given a row that names no tenant, `save` and `upsert`, `query`); on the four, a read model store built without its tenant option. The condition has to be a conjunct of the statement, since SQL binds `and` before `or` and an alternative beside it is outside it: on Knex no `.orWhere*` or `.or` at the top of a statement of `tenantTable`, `ownTenantTable` or `whereTenant`, and no `clearWhere()` or `clear(\'where\')`, on the chain, on a local, on what a function of the file answers or in a `modify` (`tenantTable`, `ownTenantTable` and `whereTenant` also refuse them when the statement is built, `UngroupedOrError` and `ClearedTenantConditionError`, and hold the text of a `whereRaw`, or a `knex.raw` given to a where, as one conjunct in parentheses; an `orHaving` applies after the where, and is free); on Drizzle the condition is a direct argument of `where` or of `and`, never under `or`, `not` or a `sql` template; on Prisma the helper is spread at the top of the where or in its `AND`, never under `OR`, `NOT` or a relation; on TypeORM the same, a where array spreads it in each entry, a query builder has no `orWhere` at its top, and the condition stands in its last `where` or an `andWhere` after it, since a `where` resets what comes before it. What is in a group beside the condition is correct and accepted: a callback of a Knex `where`, an `or` given to the `and` of Drizzle, an `OR` beside the Prisma spread, `new Brackets(...)` in a TypeORM `andWhere`. A where built by another function is not followed: inline it, or record a deviation. A lock on a business key (count then insert, the next number of a sequence) is taken with `advisoryLock(context, key, { tenant: scope })` or `tryAdvisoryLock` of the ORM package, which is given the context and never the executor: a raw `pg_advisory_xact_lock` is raw SQL, reported with a message that names the helper.',
|
|
4
4
|
bad: `// infrastructure/persistence/knex-invoice.repository.ts
|
|
5
5
|
const row = await this.database.executor()<InvoiceRow, InvoiceRow[]>('invoices').where({ id }).first();
|
|
6
6
|
const all = await this.database.executor().from('invoices').where({ status }); // the executor chained
|
|
@@ -13,6 +13,7 @@ await this.database.client().billingInvoice.updateMany({ where: { id, version },
|
|
|
13
13
|
// infrastructure/persistence/type-orm-invoice.repository.ts
|
|
14
14
|
await this.database.manager().findOneBy(invoices, { id });
|
|
15
15
|
await this.database.manager().save(invoices, row); // writes by the key alone
|
|
16
|
+
await this.database.executor().raw('select pg_advisory_xact_lock(hashtext(?))', [key]); // a lock by hand: one key for every tenant
|
|
16
17
|
// the tenant is not a conjunct: \`and\` binds first, or the condition holds for one branch alone
|
|
17
18
|
await tenantTable<InvoiceRow>(this.database, this.scope, INVOICES).where({ id }).orWhere({ reference: id });
|
|
18
19
|
await this.database.executor().select().from(invoices).where(or(eq(invoices.id, id), tenantCondition(invoices.tenantId, this.scope)));
|
|
@@ -27,6 +28,7 @@ const found = await this.database.client().billingInvoice.findFirst({ where: { i
|
|
|
27
28
|
await this.database.client().billingInvoice.updateMany({ where: { id, version, ...ownTenantWhere(this.scope) }, data });
|
|
28
29
|
await this.database.manager().findOneBy(invoices, { id, ...tenantWhere(this.scope) });
|
|
29
30
|
await this.database.manager().update(invoices, { id, version, ...ownTenantWhere(this.scope) }, row);
|
|
31
|
+
await advisoryLock(this.database, 'invoice-number', { tenant: this.scope }); // held until the unit of work ends
|
|
30
32
|
// alternatives in a group beside the condition
|
|
31
33
|
await tenantTable<InvoiceRow>(this.database, this.scope, INVOICES).where((either) => either.where({ id }).orWhere({ reference: id }));
|
|
32
34
|
await this.database.executor().select().from(invoices).where(and(tenantCondition(invoices.tenantId, this.scope), or(eq(invoices.id, id), eq(invoices.reference, id))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenancy-docs.js","sourceRoot":"","sources":["../../../src/check/explain/tenancy-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAsC;IAC7D,0BAA0B,EAAE;QAC1B,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"tenancy-docs.js","sourceRoot":"","sources":["../../../src/check/explain/tenancy-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAsC;IAC7D,0BAA0B,EAAE;QAC1B,GAAG,EAAE,o4HAAo4H;QACz4H,GAAG,EAAE;;;;;;;;;;;;;;;;;kHAiByG;QAC9G,IAAI,EAAE;;;;;;;;;;;;;;8IAcoI;KAC3I;CACF,CAAC"}
|