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,11 @@
|
|
|
1
|
+
import type { Scope } from '../../scope.js';
|
|
2
|
+
import { type PersonalRequest } from './personal-request-of.js';
|
|
3
|
+
/**
|
|
4
|
+
* The request of `generate personal-fields`, on a table no aggregate owns: `--personal` and
|
|
5
|
+
* `--subject` are both required, then checked as `--personal` of a repository is. No default
|
|
6
|
+
* names the subject there: the row of such a table (a read model, a received message) is rarely
|
|
7
|
+
* the person, and a declaration that said `id` would have the erasure look for the person in the
|
|
8
|
+
* wrong column while the register says the table is covered.
|
|
9
|
+
*/
|
|
10
|
+
export declare function personalRequestOfTable(scope: Scope): PersonalRequest;
|
|
11
|
+
//# sourceMappingURL=personal-request-of-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal-request-of-table.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/personal-request-of-table.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CAiBpE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CliError } from '../../../cli-error.js';
|
|
2
|
+
import { personalRequestOf } from './personal-request-of.js';
|
|
3
|
+
/**
|
|
4
|
+
* The request of `generate personal-fields`, on a table no aggregate owns: `--personal` and
|
|
5
|
+
* `--subject` are both required, then checked as `--personal` of a repository is. No default
|
|
6
|
+
* names the subject there: the row of such a table (a read model, a received message) is rarely
|
|
7
|
+
* the person, and a declaration that said `id` would have the erasure look for the person in the
|
|
8
|
+
* wrong column while the register says the table is covered.
|
|
9
|
+
*/
|
|
10
|
+
export function personalRequestOfTable(scope) {
|
|
11
|
+
const { personal, subject } = scope.flags;
|
|
12
|
+
const request = personal === undefined || subject === undefined ? undefined : personalRequestOf(scope);
|
|
13
|
+
if (request !== undefined) {
|
|
14
|
+
return request;
|
|
15
|
+
}
|
|
16
|
+
throw personal === undefined
|
|
17
|
+
? new CliError('generate personal-fields needs --personal: the columns of the table that hold personal data.', 'Name them as the database spells them, comma separated: --personal email,display_name --subject <column>.')
|
|
18
|
+
: new CliError('generate personal-fields needs --subject: the column that holds the id of the person a row is about.', 'Name it: --subject customer_id. No default here: on a table without aggregate the row is rarely the person, and a declaration that named `id` by default would have `npm run privacy:erase -- <person>` miss the row while the register says the column is covered. Give `--subject id` only when the id of the row is the id of the person.');
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=personal-request-of-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal-request-of-table.js","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/personal-request-of-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAwB,MAAM,uBAAuB,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAY;IACjD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1C,MAAM,OAAO,GAAG,QAAQ,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAEvG,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,QAAQ,KAAK,SAAS;QAC1B,CAAC,CAAC,IAAI,QAAQ,CACV,8FAA8F,EAC9F,2GAA2G,CAC5G;QACH,CAAC,CAAC,IAAI,QAAQ,CACV,sGAAsG,EACtG,8UAA8U,CAC/U,CAAC;AACR,CAAC"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { RenderContext } from '../../../templating/index.js';
|
|
2
2
|
import type { Scope } from '../../scope.js';
|
|
3
|
+
import { type PersonalColumn } from './personal-column.js';
|
|
4
|
+
import { type PersonalRequest } from './personal-request-of.js';
|
|
5
|
+
/** How a column the request names is spelled in the definition of its table: derived from its SQL name, or read in the schema of a table the project wrote. */
|
|
6
|
+
type ColumnOf = (column: string) => PersonalColumn;
|
|
3
7
|
/**
|
|
4
8
|
* `--personal` as the templates read it: whether a declaration is written, how the rows are erased,
|
|
5
9
|
* the columns the storage gains, and for each ORM the names its declaration, its rows and its tests
|
|
6
10
|
* spell. Nothing when the flag is absent.
|
|
7
11
|
*/
|
|
8
12
|
export declare function personalVars(scope: Scope): RenderContext;
|
|
13
|
+
/** The request of a declaration as the templates read it, each column spelled by `columnOf`. */
|
|
14
|
+
export declare function personalVarsOf(scope: Scope, request: PersonalRequest, columnOf: ColumnOf): RenderContext;
|
|
15
|
+
export {};
|
|
9
16
|
//# sourceMappingURL=personal-vars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personal-vars.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/personal-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"personal-vars.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/personal-vars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAoBhF,+JAA+J;AAC/J,KAAK,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,cAAc,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAMxD;AAED,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,aAAa,CAkBxG"}
|
|
@@ -19,9 +19,12 @@ const SQL_NAMES = { declaration: 'column', row: 'column' };
|
|
|
19
19
|
*/
|
|
20
20
|
export function personalVars(scope) {
|
|
21
21
|
const request = personalRequestOf(scope);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
return request === undefined
|
|
23
|
+
? { any: false, retains: false }
|
|
24
|
+
: { ...personalVarsOf(scope, request, personalColumn), ofTable: false };
|
|
25
|
+
}
|
|
26
|
+
/** The request of a declaration as the templates read it, each column spelled by `columnOf`. */
|
|
27
|
+
export function personalVarsOf(scope, request, columnOf) {
|
|
25
28
|
const { orm } = scope.config.stack;
|
|
26
29
|
const names = personalNames(orm, scope.context);
|
|
27
30
|
const spelling = SPELLINGS[orm] ?? SQL_NAMES;
|
|
@@ -32,11 +35,11 @@ export function personalVars(scope) {
|
|
|
32
35
|
pseudonymise: request.erasure === 'pseudonymise',
|
|
33
36
|
subjectIsId: request.subject === 'id',
|
|
34
37
|
names: { ...names },
|
|
35
|
-
...retentionVars(request, spelling),
|
|
38
|
+
...retentionVars(request, spelling, columnOf),
|
|
36
39
|
header: classHeader(names.adapter, names.base, names.port),
|
|
37
40
|
exportHeader: classHeader(names.exportAdapter, names.exportBase, names.exportPort),
|
|
38
41
|
...storageVars(request),
|
|
39
|
-
...spelledVars(request, spelling),
|
|
42
|
+
...spelledVars(request, spelling, columnOf),
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
45
|
/** The columns the generated storage gains, nullable text each: the personal ones, and the subject column when the row is about somebody else. */
|
|
@@ -67,12 +70,12 @@ function linesOf(columns, dated) {
|
|
|
67
70
|
return (text, date) => [columnLines(columns, text), ...(dated.length === 0 ? [] : [columnLines(dated, date)])].join('\n');
|
|
68
71
|
}
|
|
69
72
|
/** The retention as the declaration spells it and as the generated spec dates a row. */
|
|
70
|
-
function retentionVars(request, spelling) {
|
|
73
|
+
function retentionVars(request, spelling, columnOf) {
|
|
71
74
|
const { retention } = request;
|
|
72
75
|
if (retention === undefined) {
|
|
73
76
|
return { retains: false };
|
|
74
77
|
}
|
|
75
|
-
const after =
|
|
78
|
+
const after = columnOf(retention.column);
|
|
76
79
|
return {
|
|
77
80
|
retains: true,
|
|
78
81
|
retention: `{ after: '${after[spelling.declaration]}', ${retention.unit}: ${String(retention.amount)} }`,
|
|
@@ -81,10 +84,10 @@ function retentionVars(request, spelling) {
|
|
|
81
84
|
};
|
|
82
85
|
}
|
|
83
86
|
/** The subject and the fields as the declaration of this ORM spells them, the rows of two people as its tests write and expect them, and what the export hands over of one. */
|
|
84
|
-
function spelledVars(request, spelling) {
|
|
85
|
-
const fields = request.fields.map(
|
|
86
|
-
const subject =
|
|
87
|
-
const dated = request.retention === undefined ? [] : [
|
|
87
|
+
function spelledVars(request, spelling, columnOf) {
|
|
88
|
+
const fields = request.fields.map(columnOf);
|
|
89
|
+
const subject = columnOf(request.subject);
|
|
90
|
+
const dated = request.retention === undefined ? [] : [columnOf(request.retention.column)];
|
|
88
91
|
const columns = [...(request.subject === 'id' ? fields : [...fields, subject]), ...dated];
|
|
89
92
|
const about = (person) => request.subject === 'id' ? [] : [[subject[spelling.row], `'${person}'`]];
|
|
90
93
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"personal-vars.js","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/personal-vars.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAuB,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAwB,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAUzC,MAAM,SAAS,GAAuC;IACpD,IAAI,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE;IAC9C,OAAO,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE;IACrD,MAAM,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAE;IAClD,OAAO,EAAE,EAAE,WAAW,EAAE,UAA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,EAAE,sBAAsB,CAAU,CAAC,CAAC;KACjH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PersonalColumn } from './personal-column.js';
|
|
2
|
+
/** A table as the schema of a context declares it, read from the text of the file. */
|
|
3
|
+
export interface SchemaTable {
|
|
4
|
+
/** The table as the database names it. */
|
|
5
|
+
readonly name: string;
|
|
6
|
+
/** What the schema calls it: the exported constant of a Drizzle table or of a TypeORM entity schema, the model on Prisma, the SQL name on Knex. */
|
|
7
|
+
readonly reference: string;
|
|
8
|
+
/** The columns its definition names, each as the database spells it and as the definition does. */
|
|
9
|
+
readonly columns: readonly PersonalColumn[];
|
|
10
|
+
/** True when the definition takes columns from elsewhere (a spread, a helper called on the table): the ones it names are not all it holds. */
|
|
11
|
+
readonly open: boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=schema-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-table.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/schema-table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,sFAAsF;AACtF,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mJAAmJ;IACnJ,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,mGAAmG;IACnG,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,8IAA8I;IAC9I,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-table.js","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/schema-table.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SchemaTable } from './schema-table.js';
|
|
2
|
+
/**
|
|
3
|
+
* The tables the schema file of a context declares, read from its text as each ORM writes them: a
|
|
4
|
+
* Drizzle table (`export const x = schema.table('x', { ... })`), a TypeORM entity schema
|
|
5
|
+
* (`tableName: 'x'`), a table of a Knex schema (`createTable('x', ...)`), a Prisma model
|
|
6
|
+
* (`@@map("x")`). A definition in a comment is not one.
|
|
7
|
+
*/
|
|
8
|
+
export declare function schemaTablesOf(orm: string, text: string): SchemaTable[];
|
|
9
|
+
//# sourceMappingURL=schema-tables-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-tables-of.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/schema-tables-of.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAEvE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { scan } from '../../../check/scan/scan.js';
|
|
2
|
+
import { matchingBracket } from '../../../check/text/matching-bracket.js';
|
|
3
|
+
import { prismaBlocks } from '../../../prisma-schema/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* The tables the schema file of a context declares, read from its text as each ORM writes them: a
|
|
6
|
+
* Drizzle table (`export const x = schema.table('x', { ... })`), a TypeORM entity schema
|
|
7
|
+
* (`tableName: 'x'`), a table of a Knex schema (`createTable('x', ...)`), a Prisma model
|
|
8
|
+
* (`@@map("x")`). A definition in a comment is not one.
|
|
9
|
+
*/
|
|
10
|
+
export function schemaTablesOf(orm, text) {
|
|
11
|
+
return READERS[orm]?.(text) ?? [];
|
|
12
|
+
}
|
|
13
|
+
const READERS = {
|
|
14
|
+
drizzle: (text) => definitionsIn(text, DRIZZLE_TABLE).map(drizzleTable),
|
|
15
|
+
typeorm: (text) => definitionsIn(text, ENTITY_SCHEMA).flatMap(typeormTable),
|
|
16
|
+
knex: (text) => definitionsIn(text, KNEX_TABLE).map(knexTable),
|
|
17
|
+
prisma: prismaTables,
|
|
18
|
+
};
|
|
19
|
+
const DRIZZLE_TABLE = /\bexport\s+const\s+([A-Za-z_$][\w$]*)\s*=\s*[\w$.]*[tT]able\s*\(\s*['"]([^'"]+)['"]/g;
|
|
20
|
+
const ENTITY_SCHEMA = /\bexport\s+const\s+([A-Za-z_$][\w$]*)\s*=\s*new\s+EntitySchema\b[^(]*\(/g;
|
|
21
|
+
const KNEX_TABLE = /\.createTable\s*\(\s*['"]([^'"]+)['"]/g;
|
|
22
|
+
function definitionsIn(text, pattern) {
|
|
23
|
+
const { code } = scan(text);
|
|
24
|
+
return [...text.matchAll(pattern)]
|
|
25
|
+
.filter((match) => code.charAt(match.index) === text.charAt(match.index))
|
|
26
|
+
.map((match) => {
|
|
27
|
+
const open = match.index + match[0].indexOf('(');
|
|
28
|
+
return { captured: match.slice(1), body: text.slice(open, matchingBracket(code, open) + 1) };
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** `customerEmail: text('customer_email')`, or `email: text()`, which names the column after its key. */
|
|
32
|
+
const DRIZZLE_COLUMN = /\b([A-Za-z_$][\w$]*)\s*:\s*[\w$.]+\(\s*(?:['"]([^'"]+)['"])?/g;
|
|
33
|
+
const SPREAD = /\.\.\./;
|
|
34
|
+
function drizzleTable({ captured: [reference = '', name = ''], body }) {
|
|
35
|
+
const columns = [...body.matchAll(DRIZZLE_COLUMN)].flatMap(([, property = '', column]) => column === undefined ? unnamed(property) : [{ column, property }]);
|
|
36
|
+
return { name, reference, columns, open: SPREAD.test(body) };
|
|
37
|
+
}
|
|
38
|
+
/** A column the definition does not name: its key, and its key in snake case, as the `casing` of the client may spell it. */
|
|
39
|
+
function unnamed(property) {
|
|
40
|
+
const snake = property.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
|
|
41
|
+
return [...new Set([property, snake])].map((column) => ({ column, property }));
|
|
42
|
+
}
|
|
43
|
+
/** `customerEmail: { name: 'customer_email', type: 'text' }`, or `email: { type: 'text' }`. */
|
|
44
|
+
const TYPEORM_COLUMN = /\b([A-Za-z_$][\w$]*)\s*:\s*\{([^{}]*\btype:[^{}]*)\}/g;
|
|
45
|
+
function typeormTable({ captured: [reference = ''], body }) {
|
|
46
|
+
const name = /\btableName:\s*['"]([^'"]+)['"]/.exec(body)?.[1];
|
|
47
|
+
const columns = [...body.matchAll(TYPEORM_COLUMN)].map(([, property = '', options = '']) => ({
|
|
48
|
+
column: /\bname:\s*['"]([^'"]+)['"]/.exec(options)?.[1] ?? property,
|
|
49
|
+
property,
|
|
50
|
+
}));
|
|
51
|
+
return name === undefined ? [] : [{ name, reference, columns, open: SPREAD.test(body) }];
|
|
52
|
+
}
|
|
53
|
+
/** `table.text('customer_email')`. */
|
|
54
|
+
const KNEX_COLUMN = /\b[\w$]+\.[\w$]+\(\s*['"]([A-Za-z_]\w*)['"]/g;
|
|
55
|
+
/** `auditColumns(table)`: a helper that adds columns of its own. */
|
|
56
|
+
const KNEX_HELPER = /(?<![.\w$])[\w$]+\(\s*[\w$]+\s*[,)]/;
|
|
57
|
+
function knexTable({ captured: [name = ''], body }) {
|
|
58
|
+
const columns = [...body.matchAll(KNEX_COLUMN)].map(([, column = '']) => ({ column, property: column }));
|
|
59
|
+
return { name, reference: name, columns, open: KNEX_HELPER.test(body) };
|
|
60
|
+
}
|
|
61
|
+
const PRISMA_MODEL = /^model\s+(\w+)\s*\{/;
|
|
62
|
+
const PRISMA_FIELD = /^\s+([A-Za-z_]\w*)\s+[A-Z]\w*(?:\[\]|\?)?(.*)$/;
|
|
63
|
+
function prismaTables(text) {
|
|
64
|
+
const lines = text.split('\n');
|
|
65
|
+
return prismaBlocks(lines).flatMap(({ start, end }) => {
|
|
66
|
+
const model = PRISMA_MODEL.exec(lines[start] ?? '')?.[1];
|
|
67
|
+
const body = lines.slice(start + 1, end);
|
|
68
|
+
const mapped = body.flatMap((line) => /@@map\("([^"]+)"\)/.exec(line)?.[1] ?? [])[0];
|
|
69
|
+
return model === undefined
|
|
70
|
+
? []
|
|
71
|
+
: [{ name: mapped ?? model, reference: model, columns: body.flatMap(prismaColumn), open: false }];
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function prismaColumn(line) {
|
|
75
|
+
const [, property, rest = ''] = PRISMA_FIELD.exec(line) ?? [];
|
|
76
|
+
return property === undefined ? [] : [{ column: /@map\("([^"]+)"\)/.exec(rest)?.[1] ?? property, property }];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=schema-tables-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-tables-of.js","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/schema-tables-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAMtD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,IAAY;IACtD,OAAO,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC;AAED,MAAM,OAAO,GAAqC;IAChD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC;IACvE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IAC3E,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;IAC9D,MAAM,EAAE,YAAY;CACrB,CAAC;AAEF,MAAM,aAAa,GA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,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAErF,OAAO,KAAK,KAAK,SAAS;YACxB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACtG,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAE9D,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC/G,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Scope } from '../../scope.js';
|
|
2
|
+
import type { SchemaTable } from './schema-table.js';
|
|
3
|
+
/** A table of the schema of a context, and the file that declares it, where it is today. */
|
|
4
|
+
export interface FoundTable {
|
|
5
|
+
readonly table: SchemaTable;
|
|
6
|
+
readonly file: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The table `generate personal-fields` declares the personal columns of: one the schema of the
|
|
10
|
+
* context already holds, in the file its ORM reads (`<context>.schema.ts` on Drizzle and TypeORM,
|
|
11
|
+
* `create-<context>-tables.schema.ts` on Knex, `prisma/schema/<context>.prisma` on Prisma). The
|
|
12
|
+
* generator writes no table: one the schema does not declare is refused, with the ones it does.
|
|
13
|
+
*/
|
|
14
|
+
export declare function tableOfSchema(scope: Scope, name: string): FoundTable;
|
|
15
|
+
//# sourceMappingURL=table-of-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-of-schema.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/table-of-schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,4FAA4F;AAC5F,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAoBpE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CliError } from '../../../cli-error.js';
|
|
2
|
+
import { prismaSchemaOf } from '../../../prisma-schema/index.js';
|
|
3
|
+
import { TABLES_FILES } from '../tables-files.js';
|
|
4
|
+
import { schemaTablesOf } from './schema-tables-of.js';
|
|
5
|
+
const TABLE = /^[a-z][a-z0-9_]*$/;
|
|
6
|
+
/**
|
|
7
|
+
* The table `generate personal-fields` declares the personal columns of: one the schema of the
|
|
8
|
+
* context already holds, in the file its ORM reads (`<context>.schema.ts` on Drizzle and TypeORM,
|
|
9
|
+
* `create-<context>-tables.schema.ts` on Knex, `prisma/schema/<context>.prisma` on Prisma). The
|
|
10
|
+
* generator writes no table: one the schema does not declare is refused, with the ones it does.
|
|
11
|
+
*/
|
|
12
|
+
export function tableOfSchema(scope, name) {
|
|
13
|
+
if (!TABLE.test(name)) {
|
|
14
|
+
throw new CliError(`"${name}" is not a table name.`, 'Name the table as the database spells it: lower case letters, digits and underscores (received_messages).');
|
|
15
|
+
}
|
|
16
|
+
const asked = schemaFileOf(scope);
|
|
17
|
+
const file = scope.ws.placed(asked);
|
|
18
|
+
const tables = schemaTablesOf(scope.config.stack.orm, scope.ws.read(asked) ?? '');
|
|
19
|
+
const table = tables.find((candidate) => candidate.name === name);
|
|
20
|
+
if (table === undefined) {
|
|
21
|
+
throw undeclared(scope, { name, file, tables });
|
|
22
|
+
}
|
|
23
|
+
scope.flags.builtOn?.(file);
|
|
24
|
+
return { table, file };
|
|
25
|
+
}
|
|
26
|
+
function schemaFileOf(scope) {
|
|
27
|
+
const context = scope.context.kebab;
|
|
28
|
+
const tablesFile = TABLES_FILES[scope.config.stack.orm];
|
|
29
|
+
return tablesFile === undefined
|
|
30
|
+
? prismaSchemaOf(context)
|
|
31
|
+
: `${scope.dir}/infrastructure/persistence/${tablesFile(context)}.ts`;
|
|
32
|
+
}
|
|
33
|
+
function undeclared(scope, { name, file, tables }) {
|
|
34
|
+
const context = scope.context.kebab;
|
|
35
|
+
const names = tables.map((table) => table.name).sort();
|
|
36
|
+
const held = names.length === 0 ? 'none yet' : names.join(', ');
|
|
37
|
+
return new CliError(`The schema of ${context} (${file}) declares no table "${name}".`, `This generator declares what a table of the project keeps of a person, it writes no table: name one the schema declares (${held}), or write the table in ${file} first. The table of an aggregate comes with \`ddd-ts-kit generate repository ${context} <Aggregate> --personal <column>,...\`.`);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=table-of-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-of-schema.js","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/table-of-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,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AAU,CAAC,OAAO,CAAC,KAAK,CAAC;AAC1E,CAAC;AAQD,SAAS,UAAU,CAAC,KAAY,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAc;IAClE,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IACpC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhE,OAAO,IAAI,QAAQ,CACjB,iBAAiB,OAAO,KAAK,IAAI,wBAAwB,IAAI,IAAI,EACjE,4HAA4H,IAAI,4BAA4B,IAAI,iFAAiF,OAAO,yCAAyC,CAClS,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Name } from '../../../naming/index.js';
|
|
2
|
+
import type { RenderContext } from '../../../templating/index.js';
|
|
3
|
+
import type { Scope } from '../../scope.js';
|
|
4
|
+
/** One declaration to write: what names its table, the spec the first one of a context brings, and what the command says of each case. */
|
|
5
|
+
export interface PersonalDeclaration {
|
|
6
|
+
/** The aggregate of the table, or the table itself when no aggregate owns it: its file and its constant are named after it. */
|
|
7
|
+
readonly owner: Name;
|
|
8
|
+
readonly spec: string;
|
|
9
|
+
/** Said when the erasure of the context exists and the declaration joins it. */
|
|
10
|
+
readonly joined: string;
|
|
11
|
+
/** Said when the declaration is the first of its context, which brings the erasure and the export. */
|
|
12
|
+
readonly written: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The declaration next to the adapters, joined to the erasure and to the export of the context
|
|
16
|
+
* when they exist, written with them when it is the first: ports, adapters, fakes, spec,
|
|
17
|
+
* registration, and their line among the copies and the exports of the platform.
|
|
18
|
+
*/
|
|
19
|
+
export declare function writePersonalDeclaration(scope: Scope, context: RenderContext, declaration: PersonalDeclaration): void;
|
|
20
|
+
//# sourceMappingURL=write-personal-declaration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-personal-declaration.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/write-personal-declaration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKzC,0IAA0I;AAC1I,MAAM,WAAW,mBAAmB;IAClC,+HAA+H;IAC/H,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sGAAsG;IACtG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,GAAG,IAAI,CA0BrH"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { applyWiring } from '../../apply-wiring.js';
|
|
2
|
+
import { emit } from '../../emit.js';
|
|
3
|
+
import { rendered } from '../../rendered.js';
|
|
4
|
+
import { wire } from '../../wire.js';
|
|
5
|
+
import { wiringFamily } from '../../wiring-family.js';
|
|
6
|
+
import { personalNames } from './personal-names.js';
|
|
7
|
+
/**
|
|
8
|
+
* The declaration next to the adapters, joined to the erasure and to the export of the context
|
|
9
|
+
* when they exist, written with them when it is the first: ports, adapters, fakes, spec,
|
|
10
|
+
* registration, and their line among the copies and the exports of the platform.
|
|
11
|
+
*/
|
|
12
|
+
export function writePersonalDeclaration(scope, context, declaration) {
|
|
13
|
+
const { owner } = declaration;
|
|
14
|
+
const names = personalNames(scope.config.stack.orm, scope.context);
|
|
15
|
+
const adapters = [names.adapterKebab, names.exportAdapterKebab].map(adapterFileOf(scope));
|
|
16
|
+
emit(scope, context, [
|
|
17
|
+
[
|
|
18
|
+
`personal-data/declaration.${scope.config.stack.orm}.ts.tpl`,
|
|
19
|
+
`infrastructure/persistence/${owner.kebab}.personal-fields.ts`,
|
|
20
|
+
],
|
|
21
|
+
]);
|
|
22
|
+
if (adapters.some((file) => scope.ws.exists(file))) {
|
|
23
|
+
for (const file of adapters) {
|
|
24
|
+
applyWiring(scope.ws, file, rendered(scope, 'personal-data/adapter-field.tpl', context));
|
|
25
|
+
}
|
|
26
|
+
scope.ws.note(declaration.joined);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
writeErasure(scope, context, { names, spec: declaration.spec });
|
|
30
|
+
writeExport(scope, context, names);
|
|
31
|
+
wire(scope, 'personal-data', context);
|
|
32
|
+
scope.ws.note(declaration.written);
|
|
33
|
+
}
|
|
34
|
+
function adapterFileOf(scope) {
|
|
35
|
+
return (adapter) => `${scope.dir}/infrastructure/persistence/${adapter}.repository.ts`;
|
|
36
|
+
}
|
|
37
|
+
/** The port, the adapter, the fake and the spec of the erasure of the context, listed among the copies the platform erases. */
|
|
38
|
+
function writeErasure(scope, context, { names, spec }) {
|
|
39
|
+
const { orm } = scope.config.stack;
|
|
40
|
+
emit(scope, context, [
|
|
41
|
+
['personal-data/port.ts.tpl', `application/ports/${names.portKebab}.port.ts`],
|
|
42
|
+
[`personal-data/erasure.${orm}.ts.tpl`, `infrastructure/persistence/${names.adapterKebab}.repository.ts`],
|
|
43
|
+
['personal-data/fake.ts.tpl', `test/fakes/${names.portKebab}.fake.ts`],
|
|
44
|
+
[spec, `test/integration/${scope.context.kebab}-personal-data.spec.ts`],
|
|
45
|
+
]);
|
|
46
|
+
listIn(scope, context, 'copies');
|
|
47
|
+
}
|
|
48
|
+
/** The port, the adapter and the fake of the export of the context, listed among the exports the platform gathers; the spec of the erasure covers it. */
|
|
49
|
+
function writeExport(scope, context, names) {
|
|
50
|
+
const { orm } = scope.config.stack;
|
|
51
|
+
emit(scope, context, [
|
|
52
|
+
['personal-data/export-port.ts.tpl', `application/ports/${names.exportPortKebab}.port.ts`],
|
|
53
|
+
[`personal-data/export.${orm}.ts.tpl`, `infrastructure/persistence/${names.exportAdapterKebab}.repository.ts`],
|
|
54
|
+
['personal-data/export-fake.ts.tpl', `test/fakes/${names.exportPortKebab}.fake.ts`],
|
|
55
|
+
]);
|
|
56
|
+
listIn(scope, context, 'exports');
|
|
57
|
+
}
|
|
58
|
+
/** The port on tsyringe, or the factory of the hand-wired platform, listed once in the file of the platform the script reads. */
|
|
59
|
+
function listIn(scope, context, list) {
|
|
60
|
+
const family = wiringFamily(scope.config) === 'manual' ? 'manual' : 'container';
|
|
61
|
+
applyWiring(scope.ws, `${scope.config.platformDir}/privacy/data-subject-${list}.ts`, rendered(scope, `personal-data/${list}.${family}.tpl`, context));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=write-personal-declaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-personal-declaration.js","sourceRoot":"","sources":["../../../../src/generate/kinds/personal-data/write-personal-declaration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AAarE;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAY,EAAE,OAAsB,EAAE,WAAgC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OAAsB,EAAE,IAA0B;IAC9E,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC;IAEhF,WAAW,CACT,KAAK,CAAC,EAAE,EACR,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,yBAAyB,IAAI,KAAK,EAC7D,QAAQ,CAAC,KAAK,EAAE,iBAAiB,IAAI,IAAI,MAAM,MAAM,EAAE,OAAO,CAAC,CAChE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal-fields-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/personal-fields-kind.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAIpC,eAAO,MAAM,kBAAkB,EAAE,IAahC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { openScope } from '../open-scope.js';
|
|
2
|
+
import { declareTablePersonalFields } from './personal-data/declare-table-personal-fields.js';
|
|
3
|
+
export const personalFieldsKind = {
|
|
4
|
+
name: 'personal-fields',
|
|
5
|
+
aliases: [],
|
|
6
|
+
usage: 'personal-fields <context> <table> --personal <column>,<column>... --subject <column> [--erasure pseudonymise|row] [--retention <column>:<n><d|m|y>] [--tenant-scoped]',
|
|
7
|
+
summary: 'The declaration of the personal columns of a table no aggregate owns (a read model, a table of received messages, a table written by hand), by its SQL name: next to the adapters, joined to the erasure and to the export of the context, or written with them (ports, adapters, fakes, a spec of it.todo, registration) when it is the first. --subject is required: the row of such a table is rarely the person. The table and its columns are read in the schema of the context and never changed; a column it does not hold is refused. After the table is written in the schema of the context; the table of an aggregate is declared by `generate repository <context> <Aggregate> --personal <column>,...`.',
|
|
8
|
+
positionals: ['context', 'table'],
|
|
9
|
+
writesShared: true,
|
|
10
|
+
writesInModules: true,
|
|
11
|
+
run: (request) => {
|
|
12
|
+
declareTablePersonalFields(openScope(request), request.args[1] ?? '');
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=personal-fields-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal-fields-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/personal-fields-kind.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAC;AAE3F,MAAM,CAAC,MAAM,kBAAkB,GAAS;IACtC,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,EAAE;IACX,KAAK,EACH,uKAAuK;IACzK,OAAO,EACL,srBAAsrB;IACxrB,WAAW,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;IACjC,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE;QACf,0BAA0B,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACxE,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/projection-kind.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAgBpC,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"projection-kind.d.ts","sourceRoot":"","sources":["../../../src/generate/kinds/projection-kind.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAgBpC,eAAO,MAAM,cAAc,EAAE,IAoD5B,CAAC"}
|
|
@@ -20,7 +20,7 @@ export const projectionKind = {
|
|
|
20
20
|
name: 'projection',
|
|
21
21
|
aliases: ['projector'],
|
|
22
22
|
usage: 'projection <context> <Name> <eventType>[@v<n>] [--term "<Term>=<meaning>"]...',
|
|
23
|
-
summary: 'A projector, the class that keeps one read model up to date from integration events of its own context or of a declared upstream, and its spec; registered in the module file of its context in the explicit style. After `generate integration-event <context> <Aggregate> <Fact>` of its eventType, in the context that publishes it.',
|
|
23
|
+
summary: 'A projector, the class that keeps one read model up to date from integration events of its own context or of a declared upstream, and its spec; registered in the module file of its context in the explicit style. The read model it keeps (port, table, store adapter, fake) comes from `generate read-model <context> <Name>`. After `generate integration-event <context> <Aggregate> <Fact>` of its eventType, in the context that publishes it.',
|
|
24
24
|
positionals: ['context', 'Name', 'eventType'],
|
|
25
25
|
writesShared: false,
|
|
26
26
|
writesInModules: true,
|
|
@@ -52,6 +52,7 @@ export const projectionKind = {
|
|
|
52
52
|
['projection/projection.spec.ts.tpl', `test/unit/${name.kebab}.projection.spec.ts`],
|
|
53
53
|
]);
|
|
54
54
|
wire(scope, 'projection', context);
|
|
55
|
+
scope.ws.note(`${name.pascal}Projection keeps a read model: \`ddd-ts-kit generate read-model ${scope.context.kebab} <Name> --field <name>:<type>\` writes its port, its table, its store adapter and its fake, which the projection then receives in its constructor.`);
|
|
55
56
|
},
|
|
56
57
|
};
|
|
57
58
|
/** The context that publishes the event: this one, or one of its declared upstreams. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection-kind.js","sourceRoot":"","sources":["../../../src/generate/kinds/projection-kind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAa,MAAM,cAAc,CAAC;AAEnE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM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C;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RenderContext } from '../../../templating/index.js';
|
|
2
|
+
import type { ReadModelField } from './read-model-fields.js';
|
|
3
|
+
import type { ReadModelTable } from './read-model-table.js';
|
|
4
|
+
/**
|
|
5
|
+
* The fields of the row of a read model as its templates read them: the lines of the row, of its
|
|
6
|
+
* criteria and of a sample row, then the columns and the mapping of each ORM. Every column of a
|
|
7
|
+
* field accepts null, whatever the row requires: a removed row is a trace that holds its key and
|
|
8
|
+
* its stamp alone, and `liveRowsCheck` is what keeps the rows that are not removed whole.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fieldLines(fields: readonly ReadModelField[], table: ReadModelTable): RenderContext;
|
|
11
|
+
//# sourceMappingURL=field-lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-lines.d.ts","sourceRoot":"","sources":["../../../../src/generate/kinds/read-model/field-lines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAa,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAwDzD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,EAAE,KAAK,EAAE,cAAc,GAAG,aAAa,CAuBlG"}
|