ddd-ts-kit 0.7.0 → 0.9.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.
Files changed (196) hide show
  1. package/README.md +9 -4
  2. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  3. package/dist/check/catalogue/architecture-rules.js +6 -0
  4. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  5. package/dist/check/errors/kit-error-codes.d.ts.map +1 -1
  6. package/dist/check/errors/kit-error-codes.js +5 -0
  7. package/dist/check/errors/kit-error-codes.js.map +1 -1
  8. package/dist/check/explain/errors-docs.js +1 -1
  9. package/dist/check/explain/errors-docs.js.map +1 -1
  10. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  11. package/dist/check/explain/persistence-docs.js +26 -0
  12. package/dist/check/explain/persistence-docs.js.map +1 -1
  13. package/dist/check/explain/rule-docs.d.ts.map +1 -1
  14. package/dist/check/explain/rule-docs.js +2 -0
  15. package/dist/check/explain/rule-docs.js.map +1 -1
  16. package/dist/check/explain/tenancy-docs.d.ts +3 -0
  17. package/dist/check/explain/tenancy-docs.d.ts.map +1 -0
  18. package/dist/check/explain/tenancy-docs.js +15 -0
  19. package/dist/check/explain/tenancy-docs.js.map +1 -0
  20. package/dist/check/files/file-content-findings.d.ts +4 -0
  21. package/dist/check/files/file-content-findings.d.ts.map +1 -0
  22. package/dist/check/files/file-content-findings.js +29 -0
  23. package/dist/check/files/file-content-findings.js.map +1 -0
  24. package/dist/check/files/file-content-pattern.d.ts +7 -0
  25. package/dist/check/files/file-content-pattern.d.ts.map +1 -0
  26. package/dist/check/files/file-content-pattern.js +17 -0
  27. package/dist/check/files/file-content-pattern.js.map +1 -0
  28. package/dist/check/files/schema-sources.d.ts +13 -0
  29. package/dist/check/files/schema-sources.d.ts.map +1 -0
  30. package/dist/check/files/schema-sources.js +37 -0
  31. package/dist/check/files/schema-sources.js.map +1 -0
  32. package/dist/check/fixtures/files-fixtures.d.ts +3 -0
  33. package/dist/check/fixtures/files-fixtures.d.ts.map +1 -0
  34. package/dist/check/fixtures/files-fixtures.js +92 -0
  35. package/dist/check/fixtures/files-fixtures.js.map +1 -0
  36. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  37. package/dist/check/fixtures/fixtures.js +4 -0
  38. package/dist/check/fixtures/fixtures.js.map +1 -1
  39. package/dist/check/fixtures/tenancy-fixtures.d.ts +3 -0
  40. package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -0
  41. package/dist/check/fixtures/tenancy-fixtures.js +136 -0
  42. package/dist/check/fixtures/tenancy-fixtures.js.map +1 -0
  43. package/dist/check/layers/outside-concern.d.ts.map +1 -1
  44. package/dist/check/layers/outside-concern.js +4 -0
  45. package/dist/check/layers/outside-concern.js.map +1 -1
  46. package/dist/check/rules/files-port-not-connector.d.ts +3 -0
  47. package/dist/check/rules/files-port-not-connector.d.ts.map +1 -0
  48. package/dist/check/rules/files-port-not-connector.js +28 -0
  49. package/dist/check/rules/files-port-not-connector.js.map +1 -0
  50. package/dist/check/rules/persistence-no-file-content.d.ts +3 -0
  51. package/dist/check/rules/persistence-no-file-content.d.ts.map +1 -0
  52. package/dist/check/rules/persistence-no-file-content.js +14 -0
  53. package/dist/check/rules/persistence-no-file-content.js.map +1 -0
  54. package/dist/check/rules/tenancy-scoped-statement.d.ts +3 -0
  55. package/dist/check/rules/tenancy-scoped-statement.d.ts.map +1 -0
  56. package/dist/check/rules/tenancy-scoped-statement.js +37 -0
  57. package/dist/check/rules/tenancy-scoped-statement.js.map +1 -0
  58. package/dist/check/tenancy/balanced-arguments.d.ts +3 -0
  59. package/dist/check/tenancy/balanced-arguments.d.ts.map +1 -0
  60. package/dist/check/tenancy/balanced-arguments.js +13 -0
  61. package/dist/check/tenancy/balanced-arguments.js.map +1 -0
  62. package/dist/check/tenancy/declared-with.d.ts +11 -0
  63. package/dist/check/tenancy/declared-with.d.ts.map +1 -0
  64. package/dist/check/tenancy/declared-with.js +13 -0
  65. package/dist/check/tenancy/declared-with.js.map +1 -0
  66. package/dist/check/tenancy/drizzle-unscoped.d.ts +7 -0
  67. package/dist/check/tenancy/drizzle-unscoped.d.ts.map +1 -0
  68. package/dist/check/tenancy/drizzle-unscoped.js +35 -0
  69. package/dist/check/tenancy/drizzle-unscoped.js.map +1 -0
  70. package/dist/check/tenancy/executor-uses.d.ts +11 -0
  71. package/dist/check/tenancy/executor-uses.d.ts.map +1 -0
  72. package/dist/check/tenancy/executor-uses.js +14 -0
  73. package/dist/check/tenancy/executor-uses.js.map +1 -0
  74. package/dist/check/tenancy/knex-unscoped.d.ts +7 -0
  75. package/dist/check/tenancy/knex-unscoped.d.ts.map +1 -0
  76. package/dist/check/tenancy/knex-unscoped.js +19 -0
  77. package/dist/check/tenancy/knex-unscoped.js.map +1 -0
  78. package/dist/check/tenancy/unscoped-read-models.d.ts +4 -0
  79. package/dist/check/tenancy/unscoped-read-models.d.ts.map +1 -0
  80. package/dist/check/tenancy/unscoped-read-models.js +15 -0
  81. package/dist/check/tenancy/unscoped-read-models.js.map +1 -0
  82. package/dist/commands/init.d.ts.map +1 -1
  83. package/dist/commands/init.js +2 -0
  84. package/dist/commands/init.js.map +1 -1
  85. package/dist/config/index.d.ts +1 -1
  86. package/dist/config/index.d.ts.map +1 -1
  87. package/dist/config/index.js +1 -1
  88. package/dist/config/index.js.map +1 -1
  89. package/dist/config/parse-stack.d.ts.map +1 -1
  90. package/dist/config/parse-stack.js +3 -1
  91. package/dist/config/parse-stack.js.map +1 -1
  92. package/dist/config/stack.d.ts +18 -0
  93. package/dist/config/stack.d.ts.map +1 -1
  94. package/dist/config/stack.js +8 -0
  95. package/dist/config/stack.js.map +1 -1
  96. package/dist/config/written-stack.d.ts.map +1 -1
  97. package/dist/config/written-stack.js +6 -2
  98. package/dist/config/written-stack.js.map +1 -1
  99. package/dist/generate/kinds/file-upload/write-upload-controller.d.ts +5 -0
  100. package/dist/generate/kinds/file-upload/write-upload-controller.d.ts.map +1 -0
  101. package/dist/generate/kinds/file-upload/write-upload-controller.js +42 -0
  102. package/dist/generate/kinds/file-upload/write-upload-controller.js.map +1 -0
  103. package/dist/generate/kinds/file-upload-kind.d.ts +3 -0
  104. package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -0
  105. package/dist/generate/kinds/file-upload-kind.js +55 -0
  106. package/dist/generate/kinds/file-upload-kind.js.map +1 -0
  107. package/dist/generate/kinds/generate-repository.js +5 -4
  108. package/dist/generate/kinds/generate-repository.js.map +1 -1
  109. package/dist/generate/kinds.d.ts.map +1 -1
  110. package/dist/generate/kinds.js +2 -0
  111. package/dist/generate/kinds.js.map +1 -1
  112. package/dist/help/usage.d.ts +1 -1
  113. package/dist/help/usage.d.ts.map +1 -1
  114. package/dist/help/usage.js +3 -2
  115. package/dist/help/usage.js.map +1 -1
  116. package/dist/init/files/platform-files.d.ts.map +1 -1
  117. package/dist/init/files/platform-files.js +22 -0
  118. package/dist/init/files/platform-files.js.map +1 -1
  119. package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
  120. package/dist/init/manifest/dependencies-for.js +7 -1
  121. package/dist/init/manifest/dependencies-for.js.map +1 -1
  122. package/dist/init/manifest/versions.d.ts.map +1 -1
  123. package/dist/init/manifest/versions.js +28 -23
  124. package/dist/init/manifest/versions.js.map +1 -1
  125. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  126. package/dist/init/stack/resolve-stack.js +13 -2
  127. package/dist/init/stack/resolve-stack.js.map +1 -1
  128. package/dist/init/stack/resolve-tenancy.d.ts +8 -0
  129. package/dist/init/stack/resolve-tenancy.d.ts.map +1 -0
  130. package/dist/init/stack/resolve-tenancy.js +31 -0
  131. package/dist/init/stack/resolve-tenancy.js.map +1 -0
  132. package/dist/init/stack/stack-options.d.ts +2 -0
  133. package/dist/init/stack/stack-options.d.ts.map +1 -1
  134. package/dist/init/template-vars.d.ts.map +1 -1
  135. package/dist/init/template-vars.js +3 -2
  136. package/dist/init/template-vars.js.map +1 -1
  137. package/dist/stack/files-vars.d.ts +5 -0
  138. package/dist/stack/files-vars.d.ts.map +1 -0
  139. package/dist/stack/files-vars.js +11 -0
  140. package/dist/stack/files-vars.js.map +1 -0
  141. package/dist/stack/stack-vars.d.ts.map +1 -1
  142. package/dist/stack/stack-vars.js +14 -4
  143. package/dist/stack/stack-vars.js.map +1 -1
  144. package/dist/version.d.ts +1 -1
  145. package/dist/version.js +1 -1
  146. package/package.json +3 -3
  147. package/templates/file-upload/command.ts.tpl +41 -0
  148. package/templates/file-upload/controller.spec.ts.tpl +46 -0
  149. package/templates/file-upload/controller.ts.tpl +23 -0
  150. package/templates/file-upload/handler.declared.ts.tpl +18 -0
  151. package/templates/file-upload/handler.spec.ts.tpl +79 -0
  152. package/templates/file-upload/handler.ts.tpl +16 -0
  153. package/templates/file-upload/wiring.manual.tpl +9 -0
  154. package/templates/file-upload/wiring.tsyringe.tpl +7 -0
  155. package/templates/init/README.md.tpl +22 -0
  156. package/templates/init/docker/docker-compose.yml.tpl +25 -0
  157. package/templates/init/docker/env.example.tpl +21 -0
  158. package/templates/init/gitignore.tpl +3 -0
  159. package/templates/init/main.ts.tpl +6 -0
  160. package/templates/init/platform/audit/audit.module.manual.ts.tpl +5 -0
  161. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +5 -0
  162. package/templates/init/platform/audit/create-audit.ts.tpl +24 -0
  163. package/templates/init/platform/audit/search-audit-entries.handler.ts.tpl +13 -0
  164. package/templates/init/platform/audit/search-audit-entries.query.ts.tpl +5 -0
  165. package/templates/init/platform/auth/http-boundary.ts.tpl +62 -1
  166. package/templates/init/platform/buses/create-command-bus.ts.tpl +7 -1
  167. package/templates/init/platform/compose-application.manual.ts.tpl +28 -0
  168. package/templates/init/platform/compose-application.tsyringe.ts.tpl +45 -0
  169. package/templates/init/platform/config/app-config.ts.tpl +7 -0
  170. package/templates/init/platform/config/load-config.ts.tpl +9 -0
  171. package/templates/init/platform/config/read-files.local.ts.tpl +39 -0
  172. package/templates/init/platform/config/read-files.s3.ts.tpl +42 -0
  173. package/templates/init/platform/create-platform.manual.ts.tpl +38 -1
  174. package/templates/init/platform/database/persistence-over.knex.ts.tpl +5 -0
  175. package/templates/init/platform/database/schema.drizzle.ts.tpl +8 -0
  176. package/templates/init/platform/database/schema.knex.ts.tpl +6 -0
  177. package/templates/init/platform/files/bind-files.tsyringe.ts.tpl +32 -0
  178. package/templates/init/platform/files/create-files.ts.tpl +34 -0
  179. package/templates/init/platform/files/file-routes.ts.tpl +10 -0
  180. package/templates/init/platform/files/files.module.tsyringe.ts.tpl +18 -0
  181. package/templates/init/platform/files/open-files.local.ts.tpl +13 -0
  182. package/templates/init/platform/files/open-files.s3.ts.tpl +10 -0
  183. package/templates/init/platform/files/staging-uploads.tsyringe.ts.tpl +11 -0
  184. package/templates/init/platform/http/start-http-server.express.ts.tpl +5 -1
  185. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +4 -1
  186. package/templates/init/platform/http/start-http-server.nest.ts.tpl +12 -1
  187. package/templates/init/platform/platform-test.module.tsyringe.ts.tpl +11 -0
  188. package/templates/init/platform/platform.manual.ts.tpl +7 -0
  189. package/templates/init/rules/application.md.tpl +3 -0
  190. package/templates/init/rules/infrastructure.md.tpl +4 -0
  191. package/templates/init/rules/platform.md.tpl +3 -0
  192. package/templates/pipeline/package-scripts.json +1 -1
  193. package/templates/repository/drizzle/repository.ts.tpl +7 -8
  194. package/templates/repository/knex/repository.ts.tpl +32 -12
  195. package/templates/service/main.ts.tpl +6 -0
  196. package/templates/worker/main.ts.tpl +6 -0
package/README.md CHANGED
@@ -51,6 +51,7 @@ ddd-ts-kit init [--http express|fastify|nest|none]
51
51
  [--style declared|explicit] [--assembly barrel|discovery]
52
52
  [--dependencies signature|listed] [--refusals factories|classes]
53
53
  [--routes controllers|functions] [--value-objects throwing|result]
54
+ [--literals named|free] [--tenancy none|shared-table]
54
55
  [--package-manager npm|pnpm]
55
56
  [--allow-no-outbox "<reason>"] [--import-alias '$<name>/']
56
57
  [--import-extension none|js] [--sdk]
@@ -192,7 +193,8 @@ config, `docsUi`, `ci` and `logger` included.
192
193
  | tracing | wired once, by the platform (`tracing/platform-only`): no `decorate` hook, no `decorate-bindings.ts`. `tracing.ts` starts `initTracing` of `@ddd-ts-kit/tracing/node` before any other module, on what `config/read-tracing.ts` validates: `OTEL_EXPORTER_OTLP_ENDPOINT` (a URL; left out, no span leaves the process), `TRACE_SAMPLE_RATIO` (0 to 1) and `TRACE_CONSUMERS` (`continue`, the default: a consumed event stays in the trace of its publication; `link`: each delivery starts a trace linked to it). With `--di tsyringe`: `lay-foundations.ts` builds `traceApplication({ consumers })`, `compose-application.ts` hands it to `kernelModule({ instrumentation })` (one span per use case, repository call, domain event, publication, consumer and job) and gives the outbox relay `tracedPublisher(bus)`. With hand wiring: `create-platform.ts` applies the members of `traceApplication()` itself (`useCase` on both buses, `domainEvents`, `publisher`, `binding` around every adapter, `job`, `executionScope`, `errorReporter`), with `tracedSubscriber` and `tracedPublisher` around the provider. With an HTTP stack, in both families, `auth/http-boundary.ts` sets `around: tracedRoutes()`: one `SERVER` span per request, named by its route |
193
194
  | `--logger` | `src/platform/observability/create-logger.ts`, one per choice: `stdout` (the default) is the `StdoutLogger` of `@ddd-ts-kit/aspects`, JSON lines, credentials not redacted; `pino` is `createPinoLogger` of `@ddd-ts-kit/pino` (dependencies `pino` and `pino-pretty`); `winston` is `createWinstonLogger` of `@ddd-ts-kit/winston`; these two redact the credential keys of the kernel. Every entry carries `traceLogFields(scope)`: the correlation id, origin, actor and tenant of the work in progress and the ids of the active trace. `LOG_LEVEL`, `LOG_FORMAT` (`json`, the default, or `pretty`; with `stdout`, which has no pretty format, `pretty` is refused when the configuration is loaded) and `LOG_SCRUB_MESSAGES` (`[message removed]` in place of the message of a logged error that is not a `DomainError`) are validated in `config/load-config.ts`. Stopping the application flushes the error reporter, then the logger, last: `container.stop()` does it on tsyringe, `compose-application.ts` flushes explicitly with hand wiring. The tools and the tests compose the application without `log` and write nothing |
194
195
  | `src/platform/auth/` | `create-authenticator.ts` (`--authn jwt`: `JwtAuthenticator` on `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI`; `--authn keycloak`: `keycloakAuthenticator` on `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` and the optional `KEYCLOAK_CLIENT_ID`; `--authn none`: `development-header-authenticator.ts`, which reads `x-development-actor` and throws in production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` answering a `Session`, `executionScope`, `errorMapper` and `onError`, spread into the mount options: every request runs inside the execution scope, with its correlation id), `create-authorizer.ts` and the files of the model (`roles.ts`, with the role `system` every system actor holds; `attribute-policies.ts`; `relationship-schema.ts`, `create-tuple-store.ts` and its contract spec, `relation-tuples.ts`, `relate-system-actors.ts`, `permission-mapping.ts` and `permissions.ts`; `custom-authorizer.ts`, its `authorizerContract` spec and `permissions.ts`), `authorization.ts` (`authorizationModule` with tsyringe) or `use-case-protection.ts` (the guard of the hand-wired buses), `access-policies.ts`, and with `--audit off` `log-decisions.ts` (one log entry per decision, ids and codes only). Without an HTTP stack there is no authenticator and no boundary |
195
- | `--audit on` | `src/platform/audit/`: `create-audit.ts` (the trail, the `onDecision` of the authorization, the middleware before the unit of work, the integration events subscribed under the consumer name `audit`), `audited-events.ts` (the registry `generate integration-event` adds to), `audit.module.ts`, and with an HTTP stack the read side: `audit.permissions.ts` (`audit:trail.read`), `search-audit-entries.query.ts`, its handler, `search-audit-entries.route.ts` (`GET /audit/entries`: cursor pages, filters `actorId`, `action`, `outcome`, `correlationId`). It is a capability of the platform, not a bounded context: no model, one protected query over the `AuditReader` port, bounded by the tenant of the actor. A scheduled job is audited like a request: origin `schedule`, actor `system:<context>.<job>`. With knex the two tables and their append-only triggers are created by the first migration; with drizzle the tables are in `schema.ts` and `npm run db:audit-guard` prints the trigger statements for a custom migration; with prisma, typeorm, `custom` or no ORM the trail is an `InMemoryAuditTrail` behind a `TODO(platform)`. The test databases leave the audit schema out of `reset()` |
196
+ | `--audit on` | `src/platform/audit/`: `create-audit.ts` (the trail, the `onDecision` of the authorization, the refusals of the guards at the edge given to the HTTP boundary as `onGuardRefusal`, the middleware before the unit of work, the integration events subscribed under the consumer name `audit`), `audited-events.ts` (the registry `generate integration-event` adds to), `audit.module.ts`, and with an HTTP stack the read side: `audit.permissions.ts` (`audit:trail.read`), `search-audit-entries.query.ts`, its handler, `search-audit-entries.route.ts` (`GET /audit/entries`: cursor pages, filters `actorId`, `action`, `outcome`, `correlationId`). It is a capability of the platform, not a bounded context: no model, one protected query over the `AuditReader` port, bounded by the tenant of the actor (with `--tenancy shared-table`, by the tenant of the work through `TenantAuditReader`: platform staff read across tenants only inside `acrossTenants`). The refusals of a caller without a credential are not recorded. A scheduled job is audited like a request: origin `schedule`, actor `system:<context>.<job>`. With knex the two tables and their append-only triggers are created by the first migration; with drizzle the tables are in `schema.ts` and `npm run db:audit-guard` prints the trigger statements for a custom migration; with prisma, typeorm, `custom` or no ORM the trail is an `InMemoryAuditTrail` behind a `TODO(platform)`. The test databases leave the audit schema out of `reset()` |
197
+ | `--tenancy shared-table` | recorded as `stack.tenancy`; Knex or Drizzle only. Every `generate repository` is tenant-scoped (as `--tenant-scoped`), through `tenantTable` and `ownTenantTable` or `tenantCondition` and `ownTenantCondition`; the outbox keeps the tenant of each event (`createOutboxTables(knex, { tenant: true })` and `KnexOutboxStore`'s `tenant: true`, or `tenantOutboxTable`), so consumers run in it; `tenancy/scoped-statement` judges the adapters. Row-level security, schema per tenant and database per tenant are refused, with what to wire by hand ([Multitenancy](../../docs/concepts/multitenancy.md)) |
196
198
  | `--cache redis` | `src/platform/redis/open-redis.ts` (`RedisServices`: the cache bound to the kernel `Cache`, the limiter to `RateLimiter`, the lock to `Lock`, which keeps a scheduled job to one instance, the relay signal as the `wakeOn` of the outbox relay with `relayWakeUpMiddleware` on the command bus), `http/refusal-for.ts` (one sliding window per caller address, 429 `application/problem+json` with `retry-after`; `RATE_LIMIT_MAX`, `RATE_LIMIT_WINDOW_MS`), `GET /health/ready` on the HTTP server, `REDIS_URL` validated, a compose service `cache` running Dragonfly with a healthcheck. Without a server (tools, tests without `REDIS_URL`) the same ports stay in the memory of the process |
197
199
  | `--errors sentry` | unexpected failures reported to Sentry or GlitchTip (one protocol, only the DSN differs) through the kernel `ErrorReporter`, bound to `@ddd-ts-kit/sentry`. `src/platform/errors.ts` (`initSentry` on the validated configuration, then `reportProcessFailures`), the second import of `main.ts`, of `apps/<context>/main.ts` and of `apps/worker/main.ts`, right after `tracing.ts`; `errors` handed to `composeApplication`, which gives it to the kernel module on tsyringe (`errorReporter`, flushed by `container.stop()` before the logger, `errorReportingMiddleware` first on both buses, the default scheduler observing with `reportFailedRuns`) or to `createPlatform` by hand (the same middleware, `onRun: reportFailedRuns(errors)`, `platform.errors`, flushed two seconds at most when the application stops); `reportHttpErrors` in `auth/http-boundary.ts` for every request answered 5xx; `DeadLetterReports` on the `onFailure` hook of a provided broker (`createEventProvider(config, errors)`, with `observing` around each consumer) and of the outbox relay. `SENTRY_DSN`, `SENTRY_ENVIRONMENT` (default: `NODE_ENV`), `SENTRY_RELEASE` and `SENTRY_SCRUB_MESSAGES` validated in `config/load-config.ts` as `errorReporting`: without a DSN the application starts and reports nothing; a DSN that is not a URL refuses the start. Dependencies `@ddd-ts-kit/sentry` and `@sentry/node`. A compose profile `errors` running GlitchTip 6.2.6 with its own PostgreSQL and Valkey (`GLITCHTIP_PORT`, loopback only, development bootstrap), and a section of the generated README saying how to read its DSN. The tools and the tests compose the application without a reporter. It goes with every other choice of the stack; with `--errors none` nothing of this is written |
198
200
  | `--authn keycloak` | a compose service `keycloak` (Keycloak 26.8.0, `start-dev --import-realm`, profile `identity`) and `docker/keycloak/<project>-realm.json`: the API client, a public client `<project>-local` with the direct grant, its audience and `tenant_id` mappers, the realm role `admin`, and the demo users `demo-admin` and `demo-user`, for local development only |
@@ -362,9 +364,11 @@ ddd-ts-kit generate --help --json
362
364
  `ActorContext` nor a dispatcher, and stamps `created_at`, `created_by`, `updated_at`, `updated_by` with `stampCreation` and `stampUpdate`;
363
365
  the table uses `auditColumns` of the ORM package (the five fields are written out for Prisma).
364
366
  The sample fact of an aggregate is `registeredAt`, since `created_at` is the audit column.
365
- `repository --tenant-scoped` (drizzle and knex) adds `tenantColumn` and puts `tenantScopeOf(scope)`
366
- on the insert and in the condition of every read and update, with a spec that one tenant does
367
- not see another's rows. With another ORM the regular adapter is written and a note says what to add.
367
+ `repository --tenant-scoped` (drizzle and knex), and every repository of a project whose
368
+ `stack.tenancy` is `shared-table`, adds `tenantColumn`, names the tenant on the insert and reaches
369
+ the table through the helpers of the ORM package (`tenantTable` and `ownTenantTable` on Knex,
370
+ `tenantCondition` and `ownTenantCondition` on Drizzle), with a spec that one tenant does not see
371
+ another's rows. With another ORM the regular adapter is written and a note says what to add.
368
372
  - `adapter --decorators` is accepted on every stack: the aspects decorators serve the standard
369
373
  mode and the legacy one a `tsconfig.json` with `experimentalDecorators` imposes.
370
374
  - `route` of a `--search` query reads the page with `pageQuerySchema` and answers `pageSchemaOf` and
@@ -761,6 +765,7 @@ saying what to do instead. Exit code 1 when there is at least one error.
761
765
  | `authz/actor-explicit` | in `domain/` and `application/`: `ActorContext`, `ExecutionScope` (as a type or as a value: the class is the token of a dependency list), `AsyncLocalStorageExecutionScope`, `ScopedActorContext`, `AsyncLocalStorage`; `.current()` or `.require()` on an actor context or on something named `scope`, `scopes` or `...executionScope`; an import of `stampCreation`, `stampUpdate` or `tenantScopeOf` |
762
766
  | `aspects/outside-in` | an import of `@ddd-ts-kit/aspects/decorators` outside `infrastructure/` of a context and the platform directory: `presentation/`, the module file, `published-language/`, the shared kernel, `main.ts`, any other source (`domain/` and `application/` are reported by the two `layer/*` rules instead) |
763
767
  | `tracing/platform-only` | an import of `@ddd-ts-kit/tracing` or of an `@opentelemetry/*` package outside the platform directory, `main.ts` and `apps/`, tests included |
768
+ | `tenancy/scoped-statement` | with `stack.tenancy` other than `none`, in `infrastructure/` of a context, tests aside: on Knex the executor used other than as an argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) and any `.raw(`; on Drizzle, statement by statement, a read, update or delete on the executor whose where has no `tenantCondition(` nor `ownTenantCondition(` (inline or in the local it is given), an insert whose row has no `tenantScopeOf(`, a relational query (`executor().query`), a raw `execute(`, or the executor held in a variable; on both, a read model store built without its `tenant` option. A where built by another function is not followed |
764
769
  | `standard/no-parallel-interface` | a class, interface or type alias declared as `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (outside `presentation/` and the platform), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `I` followed by a standard name (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) or a name of `standardInterfaces`; a class that implements or extends the standard interface is an adapter and is not reported |
765
770
  | `events/outbox-required` | `stack.events` other than `outbox` with an ORM and no `stack.events` deviation; in `domain/` and `application/`, the import of a broker client or of a bus or relay implementation; a publisher depending on more than `IntegrationEventPublisher`; a platform module that hands out a publisher and never names `OutboxPublisher` |
766
771
  | `events/consumer-idempotent` | an integration event handler class (`application/integration/handlers/*.integration-handler.ts`) that neither carries `@IntegrationEventHandler` nor is registered in its module file under a consumer name; an `@IntegrationEventHandler` whose `consumer` is not a non-empty string literal; a free `on(` or `consume(` without `processed`; a consumer name used twice, in declarations and registrations alike |
@@ -1 +1 @@
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,kBAAkB,CAAC;AAmE7C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EAkE7C,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,kBAAkB,CAAC;AAsE7C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EAqE7C,CAAC"}
@@ -26,6 +26,7 @@ import { domainEventsDispatchedOnSave } from '../rules/domain-events-dispatched-
26
26
  import { domainEventsTransactionalBeforeCommit } from '../rules/domain-events-transactional-before-commit.js';
27
27
  import { errorsCodeUnique } from '../rules/errors-code-unique.js';
28
28
  import { errorsKnownCode } from '../rules/errors-known-code.js';
29
+ import { filesPortNotConnector } from '../rules/files-port-not-connector.js';
29
30
  import { eventsConsumerIdempotent } from '../rules/events-consumer-idempotent.js';
30
31
  import { eventsDefinedInPublishedLanguage } from '../rules/events-defined-in-published-language.js';
31
32
  import { eventsNameFormat } from '../rules/events-name-format.js';
@@ -45,6 +46,7 @@ import { namingOneConceptPerFile } from '../rules/naming-one-concept-per-file.js
45
46
  import { namingSearchNotList } from '../rules/naming-search-not-list.js';
46
47
  import { namingSuffix } from '../rules/naming-suffix.js';
47
48
  import { persistenceMigrationHistory } from '../rules/persistence-migration-history.js';
49
+ import { persistenceNoFileContent } from '../rules/persistence-no-file-content.js';
48
50
  import { portsAbstractClass } from '../rules/ports-abstract-class.js';
49
51
  import { portsImplementsNeverExtends } from '../rules/ports-implements-never-extends.js';
50
52
  import { portsNoConcreteDependency } from '../rules/ports-no-concrete-dependency.js';
@@ -56,6 +58,7 @@ import { purityNoSystemClock } from '../rules/purity-no-system-clock.js';
56
58
  import { schedulingJobName } from '../rules/scheduling-job-name.js';
57
59
  import { schedulingJobTriggersUseCase } from '../rules/scheduling-job-triggers-use-case.js';
58
60
  import { standardNoParallelInterface } from '../rules/standard-no-parallel-interface.js';
61
+ import { tenancyScopedStatement } from '../rules/tenancy-scoped-statement.js';
59
62
  import { testBuilderRequired } from '../rules/test-builder-required.js';
60
63
  import { testCoverageGoverned } from '../rules/test-coverage-governed.js';
61
64
  import { testNoMocks } from '../rules/test-no-mocks.js';
@@ -111,6 +114,7 @@ export const ARCHITECTURE_RULES = [
111
114
  authzActorExplicit,
112
115
  aspectsOutsideIn,
113
116
  tracingPlatformOnly,
117
+ tenancyScopedStatement,
114
118
  standardNoParallelInterface,
115
119
  governanceRecordedDeviation,
116
120
  compositionOnlyInModule,
@@ -130,5 +134,7 @@ export const ARCHITECTURE_RULES = [
130
134
  errorsCodeUnique,
131
135
  errorsKnownCode,
132
136
  persistenceMigrationHistory,
137
+ persistenceNoFileContent,
138
+ filesPortNotConnector,
133
139
  ];
134
140
  //# 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,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC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,kBAAkB;IAClB,2BAA2B;IAC3B,oBAAoB;IACpB,yBAAyB;IACzB,gBAAgB;IAChB,4BAA4B;IAC5B,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,oBAAoB;IACpB,gBAAgB;IAChB,eAAe;IACf,2BAA2B;CAC5B,CAAC"}
1
+ {"version":3,"file":"architecture-rules.js","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,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"kit-error-codes.d.ts","sourceRoot":"","sources":["../../../src/check/errors/kit-error-codes.ts"],"names":[],"mappings":"AAAA,yHAAyH;AACzH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAc5C,CAAC"}
1
+ {"version":3,"file":"kit-error-codes.d.ts","sourceRoot":"","sources":["../../../src/check/errors/kit-error-codes.ts"],"names":[],"mappings":"AAAA,yHAAyH;AACzH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAmB5C,CAAC"}
@@ -13,5 +13,10 @@ export const KIT_ERROR_CODES = [
13
13
  'CIRCUIT_OPEN',
14
14
  'BULKHEAD_FULL',
15
15
  'ATTEMPTS_EXHAUSTED',
16
+ 'FILE_TOO_LARGE',
17
+ 'UNSUPPORTED_MEDIA_TYPE',
18
+ 'FILE_NOT_FOUND',
19
+ 'FILE_REJECTED',
20
+ 'INVALID_FILE_KEY',
16
21
  ];
17
22
  //# sourceMappingURL=kit-error-codes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kit-error-codes.js","sourceRoot":"","sources":["../../../src/check/errors/kit-error-codes.ts"],"names":[],"mappings":"AAAA,yHAAyH;AACzH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,mBAAmB;IACnB,WAAW;IACX,UAAU;IACV,qBAAqB;IACrB,cAAc;IACd,WAAW;IACX,sBAAsB;IACtB,kBAAkB;IAClB,sBAAsB;IACtB,SAAS;IACT,cAAc;IACd,eAAe;IACf,oBAAoB;CACrB,CAAC"}
1
+ {"version":3,"file":"kit-error-codes.js","sourceRoot":"","sources":["../../../src/check/errors/kit-error-codes.ts"],"names":[],"mappings":"AAAA,yHAAyH;AACzH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,mBAAmB;IACnB,WAAW;IACX,UAAU;IACV,qBAAqB;IACrB,cAAc;IACd,WAAW;IACX,sBAAsB;IACtB,kBAAkB;IAClB,sBAAsB;IACtB,SAAS;IACT,cAAc;IACd,eAAe;IACf,oBAAoB;IACpB,gBAAgB;IAChB,wBAAwB;IACxB,gBAAgB;IAChB,eAAe;IACf,kBAAkB;CACnB,CAAC"}
@@ -21,7 +21,7 @@ export const ERRORS_DOCS = {
21
21
  }`,
22
22
  },
23
23
  'errors/known-code': {
24
- why: 'The `errors` list of a route is what the OpenAPI document promises: one problem response per status of the codes it names. A code written there that no refusal sets, misspelled or left behind by a renamed factory, is a response the contract documents and the API never gives, while the refusal really raised is missing from it. A code exists when a factory or an error class of the context of the route sets it, when a class outside the contexts (the platform, the shared kernel) does, or when it is a code of the kit: VALIDATION_FAILED, NOT_FOUND, CONFLICT, INVARIANT_VIOLATION, UNAUTHORIZED, FORBIDDEN, CONCURRENCY_CONFLICT, INVALID_CRITERIA, INVALID_PAGE_REQUEST, TIMEOUT, CIRCUIT_OPEN, BULKHEAD_FULL, ATTEMPTS_EXHAUSTED. A code another context sets does not count: a context answers with its own language. Judged under "stack.refusals": "factories" only.',
24
+ why: 'The `errors` list of a route is what the OpenAPI document promises: one problem response per status of the codes it names. A code written there that no refusal sets, misspelled or left behind by a renamed factory, is a response the contract documents and the API never gives, while the refusal really raised is missing from it. A code exists when a factory or an error class of the context of the route sets it, when a class outside the contexts (the platform, the shared kernel) does, or when it is a code of the kit: VALIDATION_FAILED, NOT_FOUND, CONFLICT, INVARIANT_VIOLATION, UNAUTHORIZED, FORBIDDEN, CONCURRENCY_CONFLICT, INVALID_CRITERIA, INVALID_PAGE_REQUEST, TIMEOUT, CIRCUIT_OPEN, BULKHEAD_FULL, ATTEMPTS_EXHAUSTED, and the refusals of a file: FILE_TOO_LARGE, UNSUPPORTED_MEDIA_TYPE, FILE_NOT_FOUND, FILE_REJECTED, INVALID_FILE_KEY. A code another context sets does not count: a context answers with its own language. Judged under "stack.refusals": "factories" only.',
25
25
  bad: `// domain/errors/appointment.error.ts sets 'SLOT_TAKEN'
26
26
  defineRoute({ method: 'POST', path: '/appointments', errors: ['FORBIDDEN', 'SLOT_ALREADY_TAKEN'], security: ['bearer'] }, book);`,
27
27
  good: `defineRoute({ method: 'POST', path: '/appointments', errors: ['FORBIDDEN', 'SLOT_TAKEN'], security: ['bearer'] }, book);`,
@@ -1 +1 @@
1
- {"version":3,"file":"errors-docs.js","sourceRoot":"","sources":["../../../src/check/explain/errors-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,oBAAoB,EAAE;QACpB,GAAG,EAAE,y1BAAy1B;QAC91B,GAAG,EAAE;;;;;;;;EAQP;QACE,IAAI,EAAE;;;;;;;;EAQR;KACC;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,41BAA41B;QACj2B,GAAG,EAAE;iIACwH;QAC7H,IAAI,EAAE,0HAA0H;KACjI;CACF,CAAC"}
1
+ {"version":3,"file":"errors-docs.js","sourceRoot":"","sources":["../../../src/check/explain/errors-docs.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAsC;IAC5D,oBAAoB,EAAE;QACpB,GAAG,EAAE,y1BAAy1B;QAC91B,GAAG,EAAE;;;;;;;;EAQP;QACE,IAAI,EAAE;;;;;;;;EAQR;KACC;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,i9BAAi9B;QACt9B,GAAG,EAAE;iIACwH;QAC7H,IAAI,EAAE,0HAA0H;KACjI;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,sBAAsB,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY9D,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,sBAAsB,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsC9D,CAAC"}
@@ -10,5 +10,31 @@ export const PERSISTENCE_DOCS = {
10
10
  20261012093000_add-payments.sql # generated again after main took add-invoices
11
11
  meta/_journal.json # one entry each, in order, each snapshot from the one before`,
12
12
  },
13
+ 'persistence/no-file-content': {
14
+ why: 'A file in a column is read whole into the memory of the application and of the database, travels in every backup, every replica and every dump, swells the table its rows share pages with, and cannot be handed out by a short signed link: an upload of a few megabytes becomes a transaction, a replication lag and a backup to restore. An object store is made for it: it streams, it is cheap per gigabyte, it has lifecycle rules and signed links. The row keeps what the domain needs to know about the file, its reference.',
15
+ bad: `export const invoices = pgTable('invoices', {
16
+ receipt: bytea('receipt'), // the content of the file
17
+ receiptBase64: text('receipt_base64'), // the same, as text
18
+ });`,
19
+ good: `export const invoices = pgTable('invoices', {
20
+ receiptKey: text('receipt_key'), // where the file storage keeps it
21
+ receiptSize: integer('receipt_size'),
22
+ receiptMediaType: text('receipt_media_type'),
23
+ receiptChecksum: text('receipt_checksum'), // sha256 of the content
24
+ });`,
25
+ },
26
+ 'files/port-not-connector': {
27
+ why: 'Where files live is a choice of the platform: a directory in development, the memory in the tests, a bucket in a deployment. A handler or an aggregate that names a connector has made that choice for every environment, and its tests no longer run on the memory connector. The port says what is needed, streams in and out, signed links, and the platform binds the connector of each environment.',
28
+ bad: `import { LocalFileStorage } from '@ddd-ts-kit/kernel';
29
+
30
+ export class AttachReceiptHandler {
31
+ private readonly files = new LocalFileStorage({ directory: 'files' });
32
+ }`,
33
+ good: `import type { FileKeys, FileStaging } from '@ddd-ts-kit/kernel';
34
+
35
+ export class AttachReceiptHandler {
36
+ constructor(private readonly staging: FileStaging, private readonly keys: FileKeys) {}
37
+ }`,
38
+ },
13
39
  };
14
40
  //# sourceMappingURL=persistence-docs.js.map
@@ -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,ytBAAytB;QAC9tB,GAAG,EAAE;;;wFAG+E;QACpF,IAAI,EAAE;;;kGAGwF;KAC/F;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,ytBAAytB;QAC9tB,GAAG,EAAE;;;wFAG+E;QACpF,IAAI,EAAE;;;kGAGwF;KAC/F;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;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rule-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/rule-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAiBpD,oGAAoG;AACpG,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBvD,CAAC"}
1
+ {"version":3,"file":"rule-docs.d.ts","sourceRoot":"","sources":["../../../src/check/explain/rule-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAkBpD,oGAAoG;AACpG,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBvD,CAAC"}
@@ -11,6 +11,7 @@ import { PERSISTENCE_DOCS } from './persistence-docs.js';
11
11
  import { PORTS_DOCS } from './ports-docs.js';
12
12
  import { SCHEDULING_DOCS } from './scheduling-docs.js';
13
13
  import { STANDARD_DOCS } from './standard-docs.js';
14
+ import { TENANCY_DOCS } from './tenancy-docs.js';
14
15
  import { TREE_DOCS } from './tree-docs.js';
15
16
  import { WIRING_DOCS } from './wiring-docs.js';
16
17
  /** Shown by `ddd-ts-kit explain <rule-id>`: the reason behind the rule and one example each way. */
@@ -28,6 +29,7 @@ export const RULE_DOCS = {
28
29
  ...PORTS_DOCS,
29
30
  ...SCHEDULING_DOCS,
30
31
  ...STANDARD_DOCS,
32
+ ...TENANCY_DOCS,
31
33
  ...TREE_DOCS,
32
34
  ...WIRING_DOCS,
33
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"rule-docs.js","sourceRoot":"","sources":["../../../src/check/explain/rule-docs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM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AAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,oGAAoG;AACpG,MAAM,CAAC,MAAM,SAAS,GAAsC;IAC1D,GAAG,UAAU;IACb,GAAG,UAAU;IACb,GAAG,YAAY;IACf,GAAG,WAAW;IACd,GAAG,WAAW;IACd,GAAG,YAAY;IACf,GAAG,aAAa;IAChB,GAAG,UAAU;IACb,GAAG,WAAW;IACd,GAAG,gBAAgB;IACnB,GAAG,UAAU;IACb,GAAG,eAAe;IAClB,GAAG,aAAa;IAChB,GAAG,YAAY;IACf,GAAG,SAAS;IACZ,GAAG,WAAW;CACf,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { RuleDoc } from '../model/rule-doc.js';
2
+ export declare const TENANCY_DOCS: Readonly<Record<string, RuleDoc>>;
3
+ //# sourceMappingURL=tenancy-docs.d.ts.map
@@ -0,0 +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,sBAAsB,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAa1D,CAAC"}
@@ -0,0 +1,15 @@
1
+ export const TENANCY_DOCS = {
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. Checked by text, statement by statement: on Knex the executor used other than as the argument of a helper, and raw SQL; 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 both, a read model store built without its tenant option. A where built by another function is not followed: inline it, or record a deviation.',
4
+ bad: `// infrastructure/persistence/knex-invoice.repository.ts
5
+ const row = await this.database.executor()<InvoiceRow, InvoiceRow[]>('invoices').where({ id }).first();
6
+ const all = await this.database.executor().from('invoices').where({ status }); // the executor chained
7
+ // infrastructure/persistence/drizzle-invoice.repository.ts
8
+ await this.database.executor().select().from(invoices).where(eq(invoices.id, id));
9
+ await this.database.executor().query.invoices.findMany(); // a relational query cannot carry the condition`,
10
+ good: `const row = await tenantTable<InvoiceRow>(this.database, this.scope, INVOICES).where({ id }).first();
11
+ await ownTenantTable<InvoiceRow>(this.database, this.scope, INVOICES).where({ id, version }).update(changes);
12
+ await this.database.executor().select().from(invoices).where(and(eq(invoices.id, id), tenantCondition(invoices.tenantId, this.scope)));`,
13
+ },
14
+ };
15
+ //# sourceMappingURL=tenancy-docs.js.map
@@ -0,0 +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,+/BAA+/B;QACpgC,GAAG,EAAE;;;;;2GAKkG;QACvG,IAAI,EAAE;;wIAE8H;KACrI;CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Finding } from '../model/finding.js';
2
+ /** The lines of a schema or a migration that declare a column of file content; comments are not read. */
3
+ export declare function fileContentFindings(text: string): Finding[];
4
+ //# sourceMappingURL=file-content-findings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-content-findings.d.ts","sourceRoot":"","sources":["../../../src/check/files/file-content-findings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAYnD,yGAAyG;AACzG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAgB3D"}
@@ -0,0 +1,29 @@
1
+ import { FILE_CONTENT_PATTERNS } from './file-content-pattern.js';
2
+ const COMMENT = /^\s*(?:\/\/|\/\*|\*|--|#)/;
3
+ /** A comment that ends a line of code: `//` not part of a URL, or `--` of SQL. */
4
+ const TRAILING_COMMENT = /(?:(?<!:)\/\/|\s--\s).*$/;
5
+ /** A URL written as a string, such as a link to a repository (`.../blob/main/...`). */
6
+ const URL_STRING = /(['"`])[a-z][\w+.-]*:\/\/[^'"`]*\1/gi;
7
+ const FIX = 'Keep the content in the `FileStorage` port of @ddd-ts-kit/kernel (`ddd-ts-kit generate file-upload` writes the use case) and store in the row the reference `put` answers, a `StoredFile`: key, size, media type, checksum. A small binary value that is not a file (a hash, a key) is a decision: record it as a deviation of this rule.';
8
+ /** The lines of a schema or a migration that declare a column of file content; comments are not read. */
9
+ export function fileContentFindings(text) {
10
+ return text.split('\n').flatMap((content, index) => {
11
+ const matched = COMMENT.test(content)
12
+ ? undefined
13
+ : FILE_CONTENT_PATTERNS.map((pattern) => pattern.exec(codeOf(content))?.[0]).find(Boolean);
14
+ return matched === undefined
15
+ ? []
16
+ : [
17
+ {
18
+ line: index + 1,
19
+ message: `A column of file content ("${matched.trim()}"): files are kept in a storage, never in the database, whose backups, replicas and memory are sized for rows.`,
20
+ fix: FIX,
21
+ },
22
+ ];
23
+ });
24
+ }
25
+ /** The line without its trailing comment and its URLs, which mention words without declaring anything. */
26
+ function codeOf(line) {
27
+ return line.replace(URL_STRING, '""').replace(TRAILING_COMMENT, '');
28
+ }
29
+ //# sourceMappingURL=file-content-findings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-content-findings.js","sourceRoot":"","sources":["../../../src/check/files/file-content-findings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,OAAO,GAAG,2BAA2B,CAAC;AAC5C,kFAAkF;AAClF,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AACpD,uFAAuF;AACvF,MAAM,UAAU,GAAG,sCAAsC,CAAC;AAE1D,MAAM,GAAG,GACP,2UAA2U,CAAC;AAE9U,yGAAyG;AACzG,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACjD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;YACnC,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7F,OAAO,OAAO,KAAK,SAAS;YAC1B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE;oBACE,IAAI,EAAE,KAAK,GAAG,CAAC;oBACf,OAAO,EAAE,8BAA8B,OAAO,CAAC,IAAI,EAAE,gHAAgH;oBACrK,GAAG,EAAE,GAAG;iBACT;aACF,CAAC;IACR,CAAC,CAAC,CAAC;AACL,CAAC;AAED,0GAA0G;AAC1G,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AACtE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * What declares a column of file content: a binary type of an ORM, of SQL or of Prisma, or a
3
+ * column of text whose name says base64. A word base64 elsewhere (an encoded cursor, an ETag)
4
+ * declares no column and is not matched.
5
+ */
6
+ export declare const FILE_CONTENT_PATTERNS: readonly RegExp[];
7
+ //# sourceMappingURL=file-content-pattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-content-pattern.d.ts","sourceRoot":"","sources":["../../../src/check/files/file-content-pattern.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EASlD,CAAC"}
@@ -0,0 +1,17 @@
1
+ const TEXT_TYPES = '(?:text|varchar|char|string|json|jsonb|clob|longtext|mediumtext|character varying)';
2
+ /**
3
+ * What declares a column of file content: a binary type of an ORM, of SQL or of Prisma, or a
4
+ * column of text whose name says base64. A word base64 elsewhere (an encoded cursor, an ETag)
5
+ * declares no column and is not matched.
6
+ */
7
+ export const FILE_CONTENT_PATTERNS = [
8
+ /\b(?:bytea|(?:tiny|medium|long)?blob|varbinary)\b/i,
9
+ /\.binary\s*\(/,
10
+ /customType\s*<\s*\{\s*data\s*:\s*(?:Buffer|Uint8Array)/,
11
+ /^\s*\w+\s+Bytes\b/,
12
+ new RegExp(`\\b${TEXT_TYPES}\\s*\\(\\s*['"\`]\\w*base_?64\\w*['"\`]`, 'i'),
13
+ new RegExp(`\\b\\w*base_?64\\w*\\s*:\\s*${TEXT_TYPES}\\s*\\(`, 'i'),
14
+ new RegExp(`["\`]?\\b\\w*base_?64\\w*\\b["\`]?\\s+${TEXT_TYPES}\\b`, 'i'),
15
+ /^\s*\w*base_?64\w*\s+String\b/i,
16
+ ];
17
+ //# sourceMappingURL=file-content-pattern.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-content-pattern.js","sourceRoot":"","sources":["../../../src/check/files/file-content-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,oFAAoF,CAAC;AAExG;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,oDAAoD;IACpD,eAAe;IACf,wDAAwD;IACxD,mBAAmB;IACnB,IAAI,MAAM,CAAC,MAAM,UAAU,yCAAyC,EAAE,GAAG,CAAC;IAC1E,IAAI,MAAM,CAAC,+BAA+B,UAAU,SAAS,EAAE,GAAG,CAAC;IACnE,IAAI,MAAM,CAAC,yCAAyC,UAAU,KAAK,EAAE,GAAG,CAAC;IACzE,gCAAgC;CACjC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Project } from '../model/project.js';
2
+ /** A file that declares tables, by its path from the root, with its text. */
3
+ export interface SchemaSource {
4
+ readonly file: string;
5
+ readonly text: string;
6
+ }
7
+ /**
8
+ * What declares the tables of a project: the persistence sources of the contexts and of the
9
+ * platform database, the migrations (`migrations/`, `drizzle/`, `prisma/migrations/`) and the
10
+ * Prisma schema. Specs are not read.
11
+ */
12
+ export declare function schemaSources(project: Project): SchemaSource[];
13
+ //# sourceMappingURL=schema-sources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-sources.d.ts","sourceRoot":"","sources":["../../../src/check/files/schema-sources.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,EAAE,CAQ9D"}
@@ -0,0 +1,37 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ const MIGRATION_EXTENSIONS = new Set(['.sql', '.js', '.ts', '.mjs', '.cjs']);
4
+ /**
5
+ * What declares the tables of a project: the persistence sources of the contexts and of the
6
+ * platform database, the migrations (`migrations/`, `drizzle/`, `prisma/migrations/`) and the
7
+ * Prisma schema. Specs are not read.
8
+ */
9
+ export function schemaSources(project) {
10
+ const database = `${project.config.platformDir}/database/`;
11
+ const sources = project.files
12
+ .filter((file) => !file.isTest && (persistenceOfAContext(file.location) || file.path.startsWith(database)))
13
+ .map(({ path: file, text }) => ({ file, text }));
14
+ return [...sources, ...['migrations', 'drizzle', 'prisma'].flatMap((folder) => filesUnder(project.root, folder))];
15
+ }
16
+ function persistenceOfAContext(location) {
17
+ return location.area === 'context' && location.layer === 'infrastructure' && location.inside[0] === 'persistence';
18
+ }
19
+ function filesUnder(root, folder) {
20
+ const entries = readTree(path.join(root, folder));
21
+ return entries
22
+ .filter((entry) => entry.isFile() && (MIGRATION_EXTENSIONS.has(path.extname(entry.name)) || entry.name.endsWith('.prisma')))
23
+ .filter((entry) => !entry.name.endsWith('.d.ts'))
24
+ .map((entry) => {
25
+ const absolute = path.join(entry.parentPath, entry.name);
26
+ return { file: path.relative(root, absolute).split(path.sep).join('/'), text: fs.readFileSync(absolute, 'utf8') };
27
+ });
28
+ }
29
+ function readTree(directory) {
30
+ try {
31
+ return fs.readdirSync(directory, { recursive: true, withFileTypes: true });
32
+ }
33
+ catch {
34
+ return [];
35
+ }
36
+ }
37
+ //# sourceMappingURL=schema-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-sources.js","sourceRoot":"","sources":["../../../src/check/files/schema-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAS7B,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7E;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,YAAY,CAAC;IAE3D,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC1G,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE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E,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;IACpH,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,QAAQ,CAAC,SAAiB;IACjC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Fixture } from './fixture.js';
2
+ export declare const FILES_FIXTURES: readonly Fixture[];
3
+ //# sourceMappingURL=files-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/files-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAS5C,eAAO,MAAM,cAAc,EAAE,SAAS,OAAO,EA6F5C,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { PATHS } from './paths.js';
2
+ import { project } from './project.js';
3
+ const { BILLING, PORT, REPOSITORY_PORT } = PATHS;
4
+ const SCHEMA = `${BILLING}/infrastructure/persistence/invoice.schema.ts`;
5
+ const ADAPTER = `${BILLING}/infrastructure/persistence/drizzle-invoice.repository.ts`;
6
+ const SPEC = `${BILLING}/test/unit/attach-receipt.handler.spec.ts`;
7
+ export const FILES_FIXTURES = [
8
+ {
9
+ ruleId: 'files/port-not-connector',
10
+ name: 'a port on the file storage port, a spec on the in-memory connector',
11
+ expect: 'pass',
12
+ files: project({
13
+ [PORT]: "import type { FileStorage, StoredFile } from '@ddd-ts-kit/kernel';\nexport abstract class PaymentGateway {\n abstract receipts(): FileStorage;\n\n abstract lastReceipt(): StoredFile;\n}\n",
14
+ [SPEC]: "import { InMemoryFileStorage } from '@ddd-ts-kit/kernel';\nexport const storage = new InMemoryFileStorage();\n",
15
+ }),
16
+ },
17
+ {
18
+ ruleId: 'files/port-not-connector',
19
+ name: 'a port of the application that names the local connector',
20
+ expect: { file: PORT },
21
+ files: project({
22
+ [PORT]: "import type { LocalFileStorage } from '@ddd-ts-kit/kernel';\nexport abstract class PaymentGateway {\n abstract receipts(): LocalFileStorage;\n}\n",
23
+ }),
24
+ },
25
+ {
26
+ ruleId: 'files/port-not-connector',
27
+ name: 'a repository port of the domain that names the in-memory connector',
28
+ expect: { file: REPOSITORY_PORT },
29
+ files: project({
30
+ [REPOSITORY_PORT]: "import type { InMemoryFileStorage } from '@ddd-ts-kit/kernel';\nexport abstract class InvoiceRepository {\n abstract receipts(): InMemoryFileStorage;\n}\n",
31
+ }),
32
+ },
33
+ {
34
+ ruleId: 'persistence/no-file-content',
35
+ name: 'a table that keeps the reference of a stored file, its key, size, type and checksum',
36
+ expect: 'pass',
37
+ files: project({
38
+ [SCHEMA]: "// No bytea here: the content is in the file storage.\nexport const invoices = pgTable('invoices', {\n receiptKey: text('receipt_key'),\n receiptSize: integer('receipt_size'),\n receiptMediaType: text('receipt_media_type'),\n receiptChecksum: text('receipt_checksum'),\n});\n",
39
+ 'migrations/20261012093000_add-receipts.sql': 'ALTER TABLE "invoices" ADD COLUMN "receipt_key" text;\n',
40
+ }),
41
+ },
42
+ {
43
+ ruleId: 'persistence/no-file-content',
44
+ name: 'a repository that encodes its keyset cursor in base64, and a link to a blob in a trailing comment',
45
+ expect: 'pass',
46
+ files: project({
47
+ [ADAPTER]: "export class DrizzleInvoiceRepository {\n cursorOf(id: string): string {\n const documented = 'https://github.com/acme/app/blob/main/CURSORS.md';\n\n return Buffer.from(`${id} ${documented}`).toString('base64url'); // https://github.com/acme/app/blob/main/README.md\n }\n}\n",
48
+ 'migrations/20261012093000_add-receipts.sql': 'ALTER TABLE "invoices" ADD COLUMN "receipt_key" text; -- not a blob: the key of the file\n',
49
+ }),
50
+ },
51
+ {
52
+ ruleId: 'persistence/no-file-content',
53
+ name: 'a SQL migration that adds a column of base64 text',
54
+ expect: { file: 'migrations/20261012093000_add-receipts.sql' },
55
+ files: project({
56
+ 'migrations/20261012093000_add-receipts.sql': 'ALTER TABLE "invoices" ADD COLUMN "receipt_base64" text;\n',
57
+ }),
58
+ },
59
+ {
60
+ ruleId: 'persistence/no-file-content',
61
+ name: 'a drizzle column of bytes',
62
+ expect: { file: SCHEMA },
63
+ files: project({
64
+ [SCHEMA]: "export const invoices = pgTable('invoices', {\n receipt: bytea('receipt'),\n});\n",
65
+ }),
66
+ },
67
+ {
68
+ ruleId: 'persistence/no-file-content',
69
+ name: 'a knex migration that adds a binary column',
70
+ expect: { file: 'migrations/20261012093000_add-receipts.js' },
71
+ files: project({
72
+ 'migrations/20261012093000_add-receipts.js': "export const up = (knex) => knex.schema.alterTable('invoices', (table) => {\n table.binary('receipt');\n});\n",
73
+ }),
74
+ },
75
+ {
76
+ ruleId: 'persistence/no-file-content',
77
+ name: 'a column of base64 text in the database schema of the platform',
78
+ expect: { file: 'src/platform/database/schema.ts' },
79
+ files: project({
80
+ 'src/platform/database/schema.ts': "export const receipts = pgTable('receipts', {\n contentBase64: text('content_base64'),\n});\n",
81
+ }),
82
+ },
83
+ {
84
+ ruleId: 'persistence/no-file-content',
85
+ name: 'a Prisma field of bytes',
86
+ expect: { file: 'prisma/schema.prisma' },
87
+ files: project({
88
+ 'prisma/schema.prisma': 'model Receipt {\n id String @id\n content Bytes\n}\n',
89
+ }),
90
+ },
91
+ ];
92
+ //# sourceMappingURL=files-fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files-fixtures.js","sourceRoot":"","sources":["../../../src/check/fixtures/files-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,KAAK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,MAAM,EAAE,EAAE,IAAI,EAAE,4CAA4C,EAAE;QAC9D,KAAK,EAAE,OAAO,CAAC;YACb,4CAA4C,EAAE,4DAA4D;SAC3G,CAAC;KACH;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,2BAA2B;QACjC,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QACxB,KAAK,EAAE,OAAO,CAAC;YACb,CAAC,MAAM,CAAC,EAAE,oFAAoF;SAC/F,CAAC;KACH;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,4CAA4C;QAClD,MAAM,EAAE,EAAE,IAAI,EAAE,2CAA2C,EAAE;QAC7D,KAAK,EAAE,OAAO,CAAC;YACb,2CAA2C,EACzC,gHAAgH;SACnH,CAAC;KACH;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,gEAAgE;QACtE,MAAM,EAAE,EAAE,IAAI,EAAE,iCAAiC,EAAE;QACnD,KAAK,EAAE,OAAO,CAAC;YACb,iCAAiC,EAC/B,gGAAgG;SACnG,CAAC;KACH;IACD;QACE,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,yBAAyB;QAC/B,MAAM,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;QACxC,KAAK,EAAE,OAAO,CAAC;YACb,sBAAsB,EAAE,6DAA6D;SACtF,CAAC;KACH;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,OAAO,EAiCtC,CAAC"}
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/fixtures.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,OAAO,EAmCtC,CAAC"}
@@ -14,6 +14,7 @@ import { ERRORS_FIXTURES } from './errors-fixtures.js';
14
14
  import { EVENTS_FIXTURES } from './events-fixtures.js';
15
15
  import { EXTENSION_FIXTURES } from './extension-fixtures.js';
16
16
  import { EXTRACTABLE_FIXTURES } from './extractable-fixtures.js';
17
+ import { FILES_FIXTURES } from './files-fixtures.js';
17
18
  import { GOVERNANCE_FIXTURES } from './governance-fixtures.js';
18
19
  import { IMPORTS_FIXTURES } from './imports-fixtures.js';
19
20
  import { LANGUAGE_FIXTURES } from './language-fixtures.js';
@@ -27,6 +28,7 @@ import { PORTS_FIXTURES } from './ports-fixtures.js';
27
28
  import { PURITY_FIXTURES } from './purity-fixtures.js';
28
29
  import { SCHEDULING_FIXTURES } from './scheduling-fixtures.js';
29
30
  import { STANDARD_FIXTURES } from './standard-fixtures.js';
31
+ import { TENANCY_FIXTURES } from './tenancy-fixtures.js';
30
32
  import { TEST_FIXTURES } from './test-fixtures.js';
31
33
  import { TRACING_FIXTURES } from './tracing-fixtures.js';
32
34
  import { TREE_FIXTURES } from './tree-fixtures.js';
@@ -52,6 +54,7 @@ export const FIXTURES = [
52
54
  ...EVENTS_FIXTURES,
53
55
  ...EXTENSION_FIXTURES,
54
56
  ...EXTRACTABLE_FIXTURES,
57
+ ...FILES_FIXTURES,
55
58
  ...GOVERNANCE_FIXTURES,
56
59
  ...IMPORTS_FIXTURES,
57
60
  ...LANGUAGE_FIXTURES,
@@ -65,6 +68,7 @@ export const FIXTURES = [
65
68
  ...PURITY_FIXTURES,
66
69
  ...SCHEDULING_FIXTURES,
67
70
  ...STANDARD_FIXTURES,
71
+ ...TENANCY_FIXTURES,
68
72
  ...TEST_FIXTURES,
69
73
  ...TRACING_FIXTURES,
70
74
  ...TREE_FIXTURES,
@@ -1 +1 @@
1
- {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../../src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AG,aAAa;IAChB,GAAG,gBAAgB;IACnB,GAAG,aAAa;CACjB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Fixture } from './fixture.js';
2
+ export declare const TENANCY_FIXTURES: readonly Fixture[];
3
+ //# sourceMappingURL=tenancy-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenancy-fixtures.d.ts","sourceRoot":"","sources":["../../../src/check/fixtures/tenancy-fixtures.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAsF5C,eAAO,MAAM,gBAAgB,EAAE,SAAS,OAAO,EAwF9C,CAAC"}