ddd-ts-kit 0.96.0 → 0.98.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 +142 -0
- package/README.fr.md +9 -7
- package/README.md +8 -6
- package/dist/check/authz/operator-tuples.d.ts +16 -0
- package/dist/check/authz/operator-tuples.d.ts.map +1 -0
- package/dist/check/authz/operator-tuples.js +29 -0
- package/dist/check/authz/operator-tuples.js.map +1 -0
- package/dist/check/authz/own-authorizer.d.ts +9 -0
- package/dist/check/authz/own-authorizer.d.ts.map +1 -0
- package/dist/check/authz/own-authorizer.js +15 -0
- package/dist/check/authz/own-authorizer.js.map +1 -0
- package/dist/check/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +14 -2
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +4 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/domain-events/event-handlers-of.d.ts.map +1 -1
- package/dist/check/domain-events/event-handlers-of.js +21 -8
- package/dist/check/domain-events/event-handlers-of.js.map +1 -1
- package/dist/check/events/consumer-registrations.d.ts +2 -0
- package/dist/check/events/consumer-registrations.d.ts.map +1 -1
- package/dist/check/events/consumer-registrations.js +44 -2
- package/dist/check/events/consumer-registrations.js.map +1 -1
- package/dist/check/explain/authz-docs.d.ts.map +1 -1
- package/dist/check/explain/authz-docs.js +12 -1
- package/dist/check/explain/authz-docs.js.map +1 -1
- package/dist/check/explain/events-docs.js +1 -1
- package/dist/check/explain/events-docs.js.map +1 -1
- package/dist/check/explain/scheduling-docs.d.ts.map +1 -1
- package/dist/check/explain/scheduling-docs.js +22 -0
- package/dist/check/explain/scheduling-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +7 -4
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.js +1 -1
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/authz-granted-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-granted-fixtures.js +69 -0
- package/dist/check/fixtures/authz-granted-fixtures.js.map +1 -1
- package/dist/check/fixtures/authz-resource-modelled-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-resource-modelled-fixtures.js +5 -0
- package/dist/check/fixtures/authz-resource-modelled-fixtures.js.map +1 -1
- package/dist/check/fixtures/authz-system-actor-granted-fixtures.d.ts +3 -0
- package/dist/check/fixtures/authz-system-actor-granted-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/authz-system-actor-granted-fixtures.js +89 -0
- package/dist/check/fixtures/authz-system-actor-granted-fixtures.js.map +1 -0
- package/dist/check/fixtures/consumer-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/consumer-fixtures.js +33 -0
- package/dist/check/fixtures/consumer-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/scheduling-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/scheduling-fixtures.js +47 -1
- package/dist/check/fixtures/scheduling-fixtures.js.map +1 -1
- package/dist/check/project/locate.js +9 -3
- package/dist/check/project/locate.js.map +1 -1
- package/dist/check/rules/authz-granted.d.ts +19 -6
- package/dist/check/rules/authz-granted.d.ts.map +1 -1
- package/dist/check/rules/authz-granted.js +59 -7
- package/dist/check/rules/authz-granted.js.map +1 -1
- package/dist/check/rules/authz-system-actor-granted.d.ts +15 -0
- package/dist/check/rules/authz-system-actor-granted.d.ts.map +1 -0
- package/dist/check/rules/authz-system-actor-granted.js +91 -0
- package/dist/check/rules/authz-system-actor-granted.js.map +1 -0
- package/dist/check/rules/composition-only-in-module.js +2 -2
- package/dist/check/rules/composition-only-in-module.js.map +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.js +1 -1
- package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -1
- package/dist/check/rules/events-consumer-idempotent.d.ts.map +1 -1
- package/dist/check/rules/events-consumer-idempotent.js +6 -3
- package/dist/check/rules/events-consumer-idempotent.js.map +1 -1
- package/dist/check/rules/scheduling-job-registered.d.ts +12 -0
- package/dist/check/rules/scheduling-job-registered.d.ts.map +1 -0
- package/dist/check/rules/scheduling-job-registered.js +40 -0
- package/dist/check/rules/scheduling-job-registered.js.map +1 -0
- package/dist/check/rules/tree-closed.js +1 -1
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/check/scheduling/job-classes.d.ts +13 -0
- package/dist/check/scheduling/job-classes.d.ts.map +1 -0
- package/dist/check/scheduling/job-classes.js +32 -0
- package/dist/check/scheduling/job-classes.js.map +1 -0
- package/dist/commands/generate.js +3 -1
- package/dist/commands/generate.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/describe/context-sources.d.ts +1 -1
- package/dist/describe/context-sources.d.ts.map +1 -1
- package/dist/describe/describe-context.js +2 -2
- package/dist/describe/describe-context.js.map +1 -1
- package/dist/docs/personal-declarations-in.js +6 -1
- package/dist/docs/personal-declarations-in.js.map +1 -1
- package/dist/docs/personal-table-cells.js +7 -1
- package/dist/docs/personal-table-cells.js.map +1 -1
- package/dist/docs/personal-table-facts.d.ts +1 -1
- package/dist/docs/personal-table-facts.d.ts.map +1 -1
- package/dist/docs/read-jobs.d.ts +1 -1
- package/dist/docs/read-jobs.d.ts.map +1 -1
- package/dist/docs/read-jobs.js +3 -3
- package/dist/docs/read-jobs.js.map +1 -1
- package/dist/generate/apply-wiring.js +1 -1
- package/dist/generate/apply-wiring.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.js +2 -2
- package/dist/generate/kinds/adapter-kind.js.map +1 -1
- package/dist/generate/kinds/ask-policy-in-generated-use-case.d.ts.map +1 -1
- package/dist/generate/kinds/ask-policy-in-generated-use-case.js +10 -4
- package/dist/generate/kinds/ask-policy-in-generated-use-case.js.map +1 -1
- package/dist/generate/kinds/command-context.d.ts +5 -2
- package/dist/generate/kinds/command-context.d.ts.map +1 -1
- package/dist/generate/kinds/command-context.js +11 -3
- package/dist/generate/kinds/command-context.js.map +1 -1
- package/dist/generate/kinds/command-kind.d.ts.map +1 -1
- package/dist/generate/kinds/command-kind.js +9 -4
- package/dist/generate/kinds/command-kind.js.map +1 -1
- package/dist/generate/kinds/e2e/jobs-sending.d.ts +5 -0
- package/dist/generate/kinds/e2e/jobs-sending.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/jobs-sending.js +11 -0
- package/dist/generate/kinds/e2e/jobs-sending.js.map +1 -0
- package/dist/generate/kinds/e2e/reaction-of.d.ts +9 -2
- package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -1
- package/dist/generate/kinds/e2e/reaction-of.js +16 -7
- package/dist/generate/kinds/e2e/reaction-of.js.map +1 -1
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +20 -5
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/kinds/erasure-handler-kind.js +7 -0
- package/dist/generate/kinds/erasure-handler-kind.js.map +1 -1
- package/dist/generate/kinds/extend-event-sourced-aggregate.js +2 -2
- package/dist/generate/kinds/extend-event-sourced-aggregate.js.map +1 -1
- package/dist/generate/kinds/integration-handler-kind.d.ts.map +1 -1
- package/dist/generate/kinds/integration-handler-kind.js +1 -13
- package/dist/generate/kinds/integration-handler-kind.js.map +1 -1
- package/dist/generate/kinds/job/grant-system-actor.js +4 -2
- package/dist/generate/kinds/job/grant-system-actor.js.map +1 -1
- package/dist/generate/kinds/job/read-sent-command.d.ts.map +1 -1
- package/dist/generate/kinds/job/read-sent-command.js +2 -1
- package/dist/generate/kinds/job/read-sent-command.js.map +1 -1
- package/dist/generate/kinds/module-kind.d.ts.map +1 -1
- package/dist/generate/kinds/module-kind.js +22 -2
- package/dist/generate/kinds/module-kind.js.map +1 -1
- package/dist/generate/kinds/projection-kind.d.ts.map +1 -1
- package/dist/generate/kinds/projection-kind.js +15 -10
- package/dist/generate/kinds/projection-kind.js.map +1 -1
- package/dist/generate/kinds/repository-line.d.ts +4 -0
- package/dist/generate/kinds/repository-line.d.ts.map +1 -0
- package/dist/generate/kinds/repository-line.js +5 -0
- package/dist/generate/kinds/repository-line.js.map +1 -0
- package/dist/generate/kinds/subscription-vars.d.ts +8 -0
- package/dist/generate/kinds/subscription-vars.d.ts.map +1 -0
- package/dist/generate/kinds/subscription-vars.js +14 -0
- package/dist/generate/kinds/subscription-vars.js.map +1 -0
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts +3 -2
- package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -1
- package/dist/generate/kinds/wire-repository-on-first-use.js +8 -3
- package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -1
- package/dist/generate/refuse-shared-writes.d.ts +1 -1
- package/dist/generate/refuse-shared-writes.d.ts.map +1 -1
- package/dist/generate/refuse-shared-writes.js +25 -2
- package/dist/generate/refuse-shared-writes.js.map +1 -1
- package/dist/generate/registration.d.ts +10 -0
- package/dist/generate/registration.d.ts.map +1 -0
- package/dist/generate/registration.js +2 -0
- package/dist/generate/registration.js.map +1 -0
- package/dist/generate/wire.d.ts +5 -2
- package/dist/generate/wire.d.ts.map +1 -1
- package/dist/generate/wire.js +6 -3
- package/dist/generate/wire.js.map +1 -1
- package/dist/generate/wirings.d.ts +2 -1
- package/dist/generate/wirings.d.ts.map +1 -1
- package/dist/generate/wirings.js +25 -4
- package/dist/generate/wirings.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +5 -2
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/first-install-note.d.ts.map +1 -1
- package/dist/init/first-install-note.js +1 -0
- package/dist/init/first-install-note.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/migration/ensure-database-reachable.d.ts +13 -0
- package/dist/migration/ensure-database-reachable.d.ts.map +1 -0
- package/dist/migration/ensure-database-reachable.js +51 -0
- package/dist/migration/ensure-database-reachable.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/model-modules/index.d.ts +4 -0
- package/dist/model-modules/index.d.ts.map +1 -1
- package/dist/model-modules/index.js +4 -0
- package/dist/model-modules/index.js.map +1 -1
- package/dist/model-modules/module-file-of.d.ts +7 -0
- package/dist/model-modules/module-file-of.d.ts.map +1 -0
- package/dist/model-modules/module-file-of.js +9 -0
- package/dist/model-modules/module-file-of.js.map +1 -0
- package/dist/model-modules/module-of-module-file.d.ts +3 -0
- package/dist/model-modules/module-of-module-file.d.ts.map +1 -0
- package/dist/model-modules/module-of-module-file.js +6 -0
- package/dist/model-modules/module-of-module-file.js.map +1 -0
- package/dist/model-modules/wiring-files-of.d.ts +4 -0
- package/dist/model-modules/wiring-files-of.d.ts.map +1 -0
- package/dist/model-modules/wiring-files-of.js +6 -0
- package/dist/model-modules/wiring-files-of.js.map +1 -0
- package/dist/model-modules/wiring-text-of.d.ts +5 -0
- package/dist/model-modules/wiring-text-of.d.ts.map +1 -0
- package/dist/model-modules/wiring-text-of.js +8 -0
- package/dist/model-modules/wiring-text-of.js.map +1 -0
- package/dist/presets/apply-preset.d.ts.map +1 -1
- package/dist/presets/apply-preset.js +5 -0
- package/dist/presets/apply-preset.js.map +1 -1
- package/dist/presets/identity-preset.d.ts.map +1 -1
- package/dist/presets/identity-preset.js +1 -0
- package/dist/presets/identity-preset.js.map +1 -1
- 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/presets/preset.d.ts +6 -0
- package/dist/presets/preset.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/add-worktree.d.ts +5 -1
- package/dist/worker/add-worktree.d.ts.map +1 -1
- package/dist/worker/add-worktree.js +6 -2
- package/dist/worker/add-worktree.js.map +1 -1
- package/dist/workspace/workspace.d.ts +2 -1
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +6 -5
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +4 -4
- package/templates/aggregate/event-sourced.events.mapper.ts.tpl +2 -2
- package/templates/command/handler.declared.ts.tpl +39 -1
- package/templates/command/handler.spec.buses.ts.tpl +4 -4
- package/templates/command/handler.spec.tsyringe.ts.tpl +2 -2
- package/templates/command/handler.ts.tpl +38 -1
- package/templates/command/wiring.manual.tpl +4 -1
- package/templates/command/wiring.tsyringe.tpl +7 -2
- package/templates/e2e/e2e-job-case.ts.tpl +8 -0
- package/templates/e2e/e2e-job.spec.ts.tpl +43 -0
- package/templates/init/e2e/start-application.database.ts.tpl +94 -9
- package/templates/init/e2e/start-application.memory.ts.tpl +76 -9
- package/templates/init/jest.config.js.tpl +11 -2
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +11 -2
- package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +4 -0
- package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +1 -5
- package/templates/init/platform/database/open-test-database.knex.ts.tpl +1 -5
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +1 -5
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +1 -5
- package/templates/init/platform/database/test-database-teardown.ts.tpl +11 -0
- package/templates/init/platform/database/test-database-template.ts.tpl +16 -1
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/module/module-file.manual.ts.tpl +46 -0
- package/templates/module/module-file.tsyringe.ts.tpl +14 -0
- package/templates/module/wiring.manual.tpl +14 -0
- package/templates/module/wiring.tsyringe.tpl +6 -0
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +10 -4
- package/templates/presets/identity/e2e/support.wiring.tpl +17 -0
- package/templates/projection/projection.manual.ts.tpl +8 -0
- package/templates/projection/wiring.manual.tpl +22 -0
- package/templates/projection/wiring.tsyringe.tpl +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,148 @@ What each version changes for someone who uses the kit. The packages of `package
|
|
|
4
4
|
together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
|
|
5
5
|
list the pull requests behind it.
|
|
6
6
|
|
|
7
|
+
## 0.98.0
|
|
8
|
+
|
|
9
|
+
**The test runners page measures Vitest against Jest, and says which settings make each faster.**
|
|
10
|
+
`docs/tools/test-runners.md` (and its French page) said speed was not measured; it now gives the
|
|
11
|
+
wall time, CPU and memory of both runners on three pairs of projects identical but for `--tests` (a
|
|
12
|
+
new project, the identity preset, the scheduling example ported to Jest), cold and warm, with and
|
|
13
|
+
without coverage, unit and integration specs apart, one file, and on four CPUs as on a hosted
|
|
14
|
+
runner. Without coverage Jest is 24 to 29 percent faster on the larger projects; with coverage as
|
|
15
|
+
generated Vitest is 1.6 to 2.4 times faster on the example, the cost of Jest's `v8` provider, while
|
|
16
|
+
Jest with the `babel` provider is the fastest of the three (20.6 s against 29.5 and 48.0). The page
|
|
17
|
+
also measures the coverage providers and what each one reports, the number of workers, the pool
|
|
18
|
+
and isolation of Vitest, the worker threads of Jest, the related specs of a changed file, a
|
|
19
|
+
pipeline without cache, the install and mutation testing, and closes on a table of recommendations
|
|
20
|
+
by case, each with its measured gain and what to watch. It names two limits of the Jest template
|
|
21
|
+
the measures found: coverage through `v8`, and PostgreSQL started in process once per spec file
|
|
22
|
+
where the Vitest template starts it once per run.
|
|
23
|
+
|
|
24
|
+
**A Jest project starts PostgreSQL in process once per run, as a Vitest project does.** On an ORM,
|
|
25
|
+
`init --tests jest` writes `test/support/test-database-template.ts`, a global setup that initialises
|
|
26
|
+
the PGlite cluster once and saves it, and `test/support/test-database-teardown.ts`, which deletes
|
|
27
|
+
it, both named in `jest.config.js`; `open-test-database.ts` opens a copy of that cluster in each
|
|
28
|
+
spec instead of running an initdb of its own, as it already did under Vitest. On the identity
|
|
29
|
+
preset the integration specs under Jest take 26 CPU seconds instead of 45, for the same wall time
|
|
30
|
+
on a workstation (`docs/tools/test-runners.md`), and a busy machine no longer makes the hook that
|
|
31
|
+
opens the database outlast its timeout.
|
|
32
|
+
|
|
33
|
+
To move: in a Jest project on an ORM, copy the two files of `test/support/` from a new project
|
|
34
|
+
(`init --tests jest` with the same `--orm`), name them in `jest.config.js`
|
|
35
|
+
(`globalSetup: '<rootDir>/test/support/test-database-template.ts'`,
|
|
36
|
+
`globalTeardown: '<rootDir>/test/support/test-database-teardown.ts'`), and take
|
|
37
|
+
`inProcessPostgres()` of the new `src/platform/database/open-test-database.ts` in place of
|
|
38
|
+
`PGlite.create()`.
|
|
39
|
+
|
|
40
|
+
**A Jest project measures its coverage through the `babel` provider.** The `jest.config.js` that
|
|
41
|
+
`init --tests jest` writes sets `coverageProvider: 'babel'` instead of `'v8'`: on the scheduling
|
|
42
|
+
example ported to Jest, a run with coverage takes 20.6 s instead of 48.0 s on a workstation, and
|
|
43
|
+
65 s instead of 201 s on four CPUs, faster than the same specs under Vitest (measured in
|
|
44
|
+
`docs/tools/test-runners.md`). The branches it reports are those of the `v8` provider of Vitest;
|
|
45
|
+
the `v8` provider of Jest reported two to three points more. A line left out of the measure carries
|
|
46
|
+
the hint the provider reads, `istanbul ignore`, which `v8` did not read, as `babel` does not read
|
|
47
|
+
`v8 ignore`: the explanation of `test/coverage-governed` (`ddd-ts-kit explain`) gives both, and
|
|
48
|
+
the testing rules of a new project name the one its runner reads.
|
|
49
|
+
|
|
50
|
+
To move: in the `jest.config.js` of an existing Jest project, set `coverageProvider: 'babel'`,
|
|
51
|
+
rewrite each `v8 ignore` comment as `istanbul ignore` with its decision record, and run
|
|
52
|
+
`npm run test:coverage` once: a layer whose branch threshold sat within three points of the old
|
|
53
|
+
figure can fall under it.
|
|
54
|
+
|
|
55
|
+
**The test runners page says how mutation testing fares under each runner.** On the identity
|
|
56
|
+
preset, Stryker completes under Vitest in 1 min 46 s with 19 processes and 1 min 54 s with 8, for
|
|
57
|
+
11.6 GB and 5.4 GB of summed memory; under Jest it did not complete on a workstation of 31 GB, at
|
|
58
|
+
19 or 8 processes nor with each process restarted after 10 runs, each Jest process reaching about
|
|
59
|
+
2.5 GB within the first minute. `docs/tools/test-runners.md` gives the figures, a recommendation
|
|
60
|
+
(`--concurrency 8` under Vitest on a workstation, the mutation job planned on Vitest) and a limit
|
|
61
|
+
of Jest.
|
|
62
|
+
|
|
63
|
+
**`reset()` of the end-to-end support writes the grants of the system actors again.** With `--authz rebac` and a database (any ORM), `startApplication().reset()` emptied the relation tuples with every other table, so the relationships `relateSystemActors` wrote at start were gone from the second test of a spec on, and a reaction that sent a protected command as a system actor was refused with FORBIDDEN. `reset()` now calls `relateSystemActors()` after emptying the database, which leaves the application in the state it had right after start while the specs stay isolated.
|
|
64
|
+
|
|
65
|
+
To move: in a generated project, make `reset` in `test/e2e/support/start-application.ts` call `relateSystemActors()` after `database.reset()`, and drop the calls a spec made to relate its system actors again.
|
|
66
|
+
|
|
67
|
+
**The privacy register no longer says "until erased" for a retention read from configuration.**
|
|
68
|
+
`personalFields` accepts `configuredRetention: 'RETENTION_PERIODS'`, the key of the configuration
|
|
69
|
+
that gives the period when the project reads it at run time and purges by its own job. The generated
|
|
70
|
+
register and the `CONTEXT.md` write ``configured by `RETENTION_PERIODS` `` in the Kept column. The key
|
|
71
|
+
is read from the source text, never the value; the kit's own purge still runs only from a literal
|
|
72
|
+
`retention`, and the two together are refused.
|
|
73
|
+
|
|
74
|
+
**`generate erasure-handler` on an event-sourced context says that the key of the subject erases it, instead of sending to a table.** The context has no table to erase: its personal values are sealed by `personalData(subjectId, value)`, and `privacy:erase` (`eraseDataSubject`) destroys the key, which erases them in every context. The refusal now names `personalData`, `eraseDataSubject` and the guides, and the privacy guide, the persistence and integration-event skills say that a retention date on such a context is a scheduled job that calls the same key destruction.
|
|
75
|
+
|
|
76
|
+
**A file of types only no longer fails the coverage floor of a Jest project on the `v8` provider.**
|
|
77
|
+
A file that declares interfaces and type aliases and is imported with `import type` only, for
|
|
78
|
+
example `application/commands/pay/pay.result.ts`, is never loaded at run time, and the `v8`
|
|
79
|
+
provider of Jest reported all its lines uncovered, so that the floor of the layer failed though
|
|
80
|
+
nothing executable was untested. `governedJestCoverage()` now reads each source file as text and
|
|
81
|
+
leaves out of `collectCoverageFrom` those that declare types only, as it does for the ports; a
|
|
82
|
+
layer that holds nothing else is held to nothing, under Vitest too. Vitest and the `babel`
|
|
83
|
+
provider of Jest already skipped such a file.
|
|
84
|
+
|
|
85
|
+
To move: nothing; a project that moved its types into the command file to get around it can move
|
|
86
|
+
them back.
|
|
87
|
+
|
|
88
|
+
**`generate e2e` writes the spec of a use case only a job starts.** A use case with no route and no integration event handler used to be refused, although a job (`generate job`) is a starter of a use case too. The spec now starts the application, runs the job as the scheduler would with `await application.runJob('<context>.<job>')`, awaits `settled()` and leaves the `then` to fill. The refusal, when nothing starts the use case, names the job as a third starter it looked for. The shared support `test/e2e/support/start-application.ts` gains `runJob(name)`, which rejects when the run did not succeed, and `composeApplication` returns its `jobs` scheduler.
|
|
89
|
+
|
|
90
|
+
To move: in an existing project, add `runJob(name: string): Promise<void>;` to `RunningApplication` in `test/e2e/support/start-application.ts` and implement it with `jobs.runNow(name)` on the composed application (a run whose `outcome` is not `succeeded` throws); add `readonly jobs: JobScheduler` to `Application` in `compose-application.ts`, returned as `platform.jobs` (manual wiring) or `container.resolve(JobScheduler)` (tsyringe). `generate e2e` notes a support without `runJob`.
|
|
91
|
+
|
|
92
|
+
**`events/consumer-idempotent` accepts options spread from a shared object.**
|
|
93
|
+
`consume(definition, { ...options, consumer: 'ctx.name' }, handler)` passes when `options` is a
|
|
94
|
+
`const` of the same file initialised with an object literal that carries `processed`, or a value typed
|
|
95
|
+
`ConsumeOptions`; the consumer name is still read as the literal `consumer` key. A spread whose content
|
|
96
|
+
the file does not show is still refused, and the fix says that `processed` cannot be read.
|
|
97
|
+
|
|
98
|
+
**`generate command --aggregate` writes a handler that changes an aggregate that exists and writes nothing, and `--creates` is the birth.** Until now every command generated with `--aggregate` called `<Aggregate>.create(...)` and saved a new row on each run, so the use case a job sends created a row on every tick until a worker filled it, and the handler did not compile when `create` of the aggregate takes other arguments (TS2554). The handler now receives the repository of the aggregate, answers `void`, and holds a `TODO(domain)` (load, call one intention method, save): it compiles against the aggregate as it is and writes nothing. `--aggregate <Name> --creates` generates the former handler, which gives birth to the aggregate and answers its identifier. `--creates` without `--aggregate` is refused. A policy added later to the permission of a generated command is asked in either form.
|
|
99
|
+
|
|
100
|
+
To move: add `--creates` to the `generate command ... --aggregate` of each slice that is the birth of its aggregate (a `Start with` cell of a story included). A handler already generated is left as it is.
|
|
101
|
+
|
|
102
|
+
**In the explicit style, each module of the model has its module file, `<module>/<module>.module.ts`, composed by `<context>.module.ts`.** A context divided into modules (`contexts.<name>.modules`) registered the handlers, consumers and reactions of every module in its one `<context>.module.ts`, which passed the 350 lines of `clean/file-size` on a large context, and `tree/closed` refused any other file at the root of the context, so a project had to declare an extra directory to split it. Now `generate module <context> <module>` writes `<module>/<module>.module.ts` and composes it from `<context>.module.ts`: on tsyringe the file exports `{ register(builder), onStart({ resolve }) }`, called from `register` and `onStart` of the context; wired by hand (`--di manual` or `nest`) it exports `registerHandlers`, `registerReactions`, `registerJobs`, `useCases()` and `routes(platform)`, called from the functions of the same names. `generate <kind> ... --module <module>` writes its registration there when the file exists; wired by hand, a use case whose repository another module file already creates is registered in that file, so a repository is still created once per context. `tree/closed` accepts the module file at the root of a declared module and reports any other file there; `check` reads it as a module file (`composition/only-in-module`, `declarations/port-adapter-wired`, `authz/declared`, `domain-events/transactional-before-commit`), and so do `describe`, `docs` and the generators that read the registrations. A wiring block written into a module file also merges an import it repeats once the import names the file in its module, which wrote the same import twice in a context with modules. The declared style is unchanged: a module has no module file, its classes declare themselves.
|
|
103
|
+
|
|
104
|
+
To move: in an explicit context with modules, run `npx ddd-ts-kit generate module <context> <module>` again for each module (it adds the module file and its composition, and nothing else), then move the registrations of each module from `<context>.module.ts` to its module file, with their imports; a `composition/` folder declared in `extraDirectories` for this can go.
|
|
105
|
+
|
|
106
|
+
**The end-to-end support binds the fake identity provider admin once the identity preset is written.**
|
|
107
|
+
Opening an organisation queues `identity.organisation.opened` and `identity.member.joined`, whose
|
|
108
|
+
handlers call the identity provider admin; in a test run no provider answers, so the outbox retried
|
|
109
|
+
for ever and `settled()` failed (`outbox: 2 (2 failed, waiting for a retry)`) in every spec that opens
|
|
110
|
+
an organisation. `test/e2e/support/start-application.ts` now composes the contexts through
|
|
111
|
+
`contextsOfTheRun()`, the place where the fake of an outside system is bound, and the identity preset
|
|
112
|
+
(with `init --preset identity` or `generate context identity --preset identity`) binds
|
|
113
|
+
`FakeIdentityProviderAdmin` there. In the explicit style, `identityModule(platform, outside)` takes
|
|
114
|
+
the adapters a test run replaces.
|
|
115
|
+
|
|
116
|
+
To move: in a project written before, bind the fake yourself in `contextsOfTheRun()`; the support
|
|
117
|
+
of an existing project is not rewritten.
|
|
118
|
+
|
|
119
|
+
## 0.97.0
|
|
120
|
+
|
|
121
|
+
**Under the sandbox of the regulated profile, `prisma-generate` and `typeorm-generate` say that the database is out of reach instead of failing with a raw connection error.** A sandboxed command cannot open a TCP connection to the local PostgreSQL (probed on Claude Code 2.1.311 on Linux: `allowedDomains` with the host and the port, `allowLocalBinding` and `allowAllUnixSockets` all end in `ECONNREFUSED`; the sandbox's network leaves through an HTTP proxy only, and `allowLocalBinding` and `allowUnixSockets` are macOS settings), so `init` writes no setting for it. When `DATABASE_URL` is set and its server does not answer, the two commands stop before the ORM tool, exit 3 and say that migrations and database tests run outside the sandbox, by the owner or the CI. `drizzle-kit generate` needs no connection and is unchanged. The sandbox guide (and its French translation), the notes of `init` and the `persistence`, `parallel-work` and `story` skills say it.
|
|
122
|
+
|
|
123
|
+
**`check` reports a slice the started application cannot run: a job nobody registers, a system actor nobody grants, a permission nobody holds under relationships.** Three rows of a trial were marked done with every spec and `verify` green, yet the started application could not do them. Two rules are new and one reads more:
|
|
124
|
+
|
|
125
|
+
- **`scheduling/job-registered`** (an error): in the explicit style, the class of a job (`application/scheduling/*.job.ts`) or background job (`application/background/*.background-job.ts`) that no other file outside the tests registers (`.handledBy(..)`, `.register(..)` or `new`) is reported. The declared style registers by decorator, which `declarations/role-declared` already requires.
|
|
126
|
+
- **`authz/system-actor-granted`** (an error): under relationships, a `systemActor(<name>)` of a context (a string literal, or `<Class>.name`) in a file that sends a command or a query not declared public needs the subject `system:system:<name>` in a file of `platform/auth/relationships/`. Without it the command is refused with FORBIDDEN when the application runs, which a spec on a fake authorizer never shows. Silent with an authorizer of the project's own.
|
|
127
|
+
- **`authz/granted`** now reads relationships too (a warning, as under roles): a permission the schema leaves on the context is held by its operators, and it is reported when no signed-in grant holds it and no source outside the tests writes an `operator` relationship on that context (for a person or a system actor). Silent with an authorizer of the project's own, which may grant what the schema does not, and in a project that makes no person operator of any context in its sources: it provisions its operators out of the tree, and a project as generated stays at zero finding. It stays a warning because a permission granted to nobody can be a state between two slices. A permission derived on an element is not judged, and a schema or a tuple the checker cannot read keeps the rule silent.
|
|
128
|
+
|
|
129
|
+
**`generate job` wrote the grant of the system actor of a job under a subject the authorizer never matches.** On relationships it wrote `subject: 'system:<job>'`, while the authorizer reads an actor as `<type>:<id>`, here `system:system:<job>`: the job was refused at run time. It now writes `system:system:<job>`.
|
|
130
|
+
|
|
131
|
+
The use-case and plan-slices skills say a row is done when the started application does it, and name the three rules that prove it.
|
|
132
|
+
|
|
133
|
+
To move: run `ddd-ts-kit check`. Register each reported job in the module file of its context; in `relate-system-actors.ts` of a project on relationships, write `system:system:<name>` for each reported system actor, and correct the lines `generate job` wrote as `system:<job>`; make somebody operator of each context whose permissions `authz/granted` reports (a provisioning step), or leave the warning while the grant is the work of a later slice.
|
|
134
|
+
|
|
135
|
+
**`generate projection` works in the explicit style.** It no longer refuses `stack.style: explicit`. On tsyringe the projector keeps `@Projection` and `@On` and the module file of the context includes it with `builder.include(<Name>Projection)`, so its consumer, its processed mark and its metrics are the ones of the declared style. On a platform wired by hand (Nest, or `di: manual`) the projector is a plain class and the module file subscribes it under its consumer name `<context>.<name>`, with the processed mark of any hand-wired consumer (no projection metrics, no listing by `describe`).
|
|
136
|
+
|
|
137
|
+
**`generate job` and `generate integration-event` with `--local-only` name the command the conductor runs on the trunk.** The refusal (these two kinds write shared files: the job settings and the grant of the system actor, the audited events and the context map) now prints the same command without `--local-only` (and without `--cwd`), then says to commit it there, run `merge-trunk` in the worker's branch and fill the TODOs, as the refusal of a missing repository already does. The `parallel-work` and `plan-slices` skills and the parallel-work guide (and its French translation) plan a job or an integration event of a row as a conductor step before the worker's row, the contracts first. The shared part is not split: the registries stay the conductor's.
|
|
138
|
+
|
|
139
|
+
**`worktree`, `worker-scope` and `story-scope` cut the branch of the new worktree with `--no-track`.** A worker's branch needs no upstream, and recording one writes `.git/config`, which the Claude Code sandbox keeps read-only for the length of a session (`git worktree add -b` failed with "unable to lock .git/config" and left a branch without a worktree). The three commands now succeed there. Their default worktree already resolves under `.worktrees/` of the main checkout wherever they run, from inside another worktree too; specs on temporary repositories (a read-only `config.lock`, a run from a worktree) pin both.
|
|
140
|
+
|
|
141
|
+
**The codec `generate aggregate --event-sourced` and `generate domain-event` write now declares an event without data in the shape `docs --stored-events` accepts.** The generator wrote `interface LedgerCreditedData {}`, which the command refuses ("declares no member"). It now writes `type LedgerCreditedData = Record<string, never>;`, which is recorded as it stands; an event that carries fields gets an `interface` with them, as before.
|
|
142
|
+
|
|
143
|
+
To move: nothing for a codec already filled. A generated codec you left with an empty `interface XData {}` for an event that carries nothing: write `type XData = Record<string, never>;`.
|
|
144
|
+
|
|
145
|
+
**The guard refuses a git command that skips the hooks of the project.** A headless session committed with `git commit --no-verify` and nothing stopped it, though the pre-commit and commit-msg hooks are the local gate of the pipeline. The guard now refuses `--no-verify` on `git commit`, `push`, `merge`, `pull` and `rebase` (also its unambiguous abbreviations), `-n` on `git commit` (alone or in a cluster such as `-an`), `git -c core.hooksPath=...`, `git config core.hooksPath`, and `LEFTHOOK=0` or `HUSKY=0` set for a command that runs git. The reason says the hooks are the local gate; in `advise` mode it asks, with `guard: "off"` it is silent. The commit-discipline skill says so.
|
|
146
|
+
|
|
147
|
+
To move: nothing. If a hook is broken, fix the hook or have the project owner skip it in a terminal.
|
|
148
|
+
|
|
7
149
|
## 0.96.0
|
|
8
150
|
|
|
9
151
|
**`plan-waves` replays the generator commands of the plan and refuses a name the glossary does not define, before a worker runs the row.** A plan whose rows use words the glossary of their context does not define, with no `--term`, was handed to workers as it was, and each of them was refused at the first command: on a plan of the incident-response example written by a small model, 71 of the 85 commands of one context. Once the rows can be ordered, `plan-waves` now replays their generator commands in a copy of the project, in the order of the waves, and reports, without waves and with exit 1, each name whose words the glossary of its context does not define (`undefined-word`) or that carries a technical word no term holds (`technical-word`), counting the `--term` of the row and of the rows it waits for, with the `--term` to add. The generator itself says which names a command introduces, so the check judges exactly what a worker would meet. The commands the generator refuses for another reason (a missing `--module`, an aggregate no row generates) are listed apart, without failing (`notReplayed` in `--json`). The `plan-slices` skill commits a plan only once `plan-waves` exits 0.
|
package/README.fr.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](README.md) · **Français**
|
|
2
|
-
<!-- translation-of: README.md sha256:
|
|
2
|
+
<!-- translation-of: README.md sha256:abcea9074d99a803 -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit
|
|
5
5
|
|
|
@@ -30,7 +30,7 @@ Aucune dépendance d'exécution. Node 22.12 ou ultérieur.
|
|
|
30
30
|
npx ddd-ts-kit init
|
|
31
31
|
npx ddd-ts-kit generate context billing --classification core --term "Invoice=A request for payment"
|
|
32
32
|
npx ddd-ts-kit generate aggregate billing Invoice
|
|
33
|
-
npx ddd-ts-kit generate command billing IssueInvoice --aggregate Invoice --permission invoice.issue --grant accountant --term "Issue=To make an invoice final"
|
|
33
|
+
npx ddd-ts-kit generate command billing IssueInvoice --aggregate Invoice --creates --permission invoice.issue --grant accountant --term "Issue=To make an invoice final"
|
|
34
34
|
npx ddd-ts-kit generate route billing IssueInvoice --method POST --path /invoices
|
|
35
35
|
npx ddd-ts-kit check
|
|
36
36
|
```
|
|
@@ -193,7 +193,7 @@ lui remet, dans l'un ou l'autre assemblage. Une configuration écrite avant l'ex
|
|
|
193
193
|
Le même cas d'usage dans les deux styles. Dans le style déclaré, la commande et son gestionnaire
|
|
194
194
|
(handler) portent leur décorateur, et le constructeur du gestionnaire dit ce dont il a besoin. Le
|
|
195
195
|
corps du gestionnaire est celui qu'écrit
|
|
196
|
-
`generate command billing IssueInvoice --aggregate Invoice --permission invoice.issue`, avant
|
|
196
|
+
`generate command billing IssueInvoice --aggregate Invoice --creates --permission invoice.issue`, avant
|
|
197
197
|
que son `TODO(domain)` soit traité ; l'entrée de la commande est remplie :
|
|
198
198
|
|
|
199
199
|
<!-- checked sample -->
|
|
@@ -761,7 +761,7 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
761
761
|
| `domain-service` | `<context> <Name>` | service, *spec* |
|
|
762
762
|
| `state-machine` | `<context> <Aggregate> [--value <state>]... [--transition "<intention>:<from>[,<from>]...[><to>]"]...` | le vocabulaire `<Aggregate>Status` (créé depuis `--value`, deux états au moins, ou complété des valeurs qui lui manquent), `domain/state-machines/<aggregate>.state-machine.ts` (`<aggregate>Lifecycle` : chaque valeur un état, la première initiale, les transitions demandées, un `TODO(domain)` pour le refus de l'erreur du concept) et `test/unit/<aggregate>.state-machine.spec.ts` (chaque transition là où elle mène, un refus depuis un état qu'elle ne quitte pas) ; c'est à l'agrégat de l'utiliser |
|
|
763
763
|
| `repository` | `<context> <Aggregate> [--tenant-scoped] [--personal <colonne>,... [--subject <colonne>] [--erasure pseudonymise\|row] [--retention <colonne>:<n><d\|m\|y>]]` | le port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), l'adaptateur de l'ORM du projet (qui `implements` le port) avec son *mapper* et sa table (ou son modèle), un *fake*, une *spec* `repositoryContract` exécutée sur les deux, l'enregistrement. Sur un agrégat *event-sourced* (sa classe étend `EventSourcedAggregate`), ni table ni *mapper* : `event-store-<name>.repository.ts` délègue à `EventSourcedRepository` du kernel au-dessus de l'`EventStore` et du `PersonalDataCipher` que lie la plateforme, avec le codec de `<name>-events.mapper.ts` (la politique de *snapshot* laissée en `TODO(domain)`), le *fake* est cet adaptateur sur les stores en mémoire, et la suite de contrat s'exécute sur les deux (son cas de sauvegarde périmée en attente tant qu'un `mutate` qui enregistre un événement n'est pas ajouté) ; `--personal` y est refusé, les valeurs personnelles étant scellées dans les événements. Avec `--personal`, les colonnes de la table qui tiennent des données personnelles : ajoutées au stockage et au type de ligne en texte nullable (le *mapper* les écrit vides tant que l'agrégat ne les porte pas), déclarées à côté du *mapper* dans `<name>.personal-fields.ts` (`personalFields` du kernel : la colonne du sujet, `id` sauf si `--subject` nomme la colonne qui tient l'id de la personne, les champs, `pseudonymise` sauf `--erasure row`), épelées comme l'effacement de l'ORM les lit (noms SQL sur Knex et Prisma, propriétés sur Drizzle et TypeORM) ; et, une fois par contexte, son effacement : le port `application/ports/<context>-personal-data-erasure.port.ts` (`extends PersonalDataErasure`), l'adaptateur `<orm>-<context>-personal-data-erasure.repository.ts` sur `<Orm>PersonalDataErasure` du paquet d'ORM (confiné au *tenant* du travail avec `--tenant-scoped`), son *fake*, lié là où le contexte lie ses adaptateurs et listé dans `src/platform/privacy/data-subject-copies.ts`, pour que `npm run privacy:erase` l'atteigne ; et son export : le port `<context>-personal-data-export.port.ts` (`extends PersonalDataExport`), l'adaptateur `<orm>-<context>-personal-data-export.repository.ts` sur `<Orm>PersonalDataExport`, son *fake*, lié de même et listé dans `data-subject-exports.ts`, pour que `npm run privacy:export` le remette ; une seule *spec*, `test/integration/<context>-personal-data.spec.ts`, prouve les deux sur la base de test. Avec `--retention <colonne>:<n><d|m|y>`, la déclaration gagne `retention`, comptée depuis une colonne qui date la fin de la relation et rejoint le stockage en horodatage nullable, vide tant qu'elle dure (une colonne que la table garde pour elle, `registered_at` d'abord, est refusée : comptée depuis l'inscription, la purge effacerait des personnes encore clientes) et la *spec* prouve la purge de ce qui l'a dépassée. Une deuxième table du contexte rejoint les déclarations des deux adaptateurs. Refusé sans `stack.privacy` à `on` (`init --force --privacy on`), avec `--orm none` ou `custom`, et avant d'écrire quoi que ce soit pour une colonne qui n'en est pas une, une colonne que la table garde pour elle, un sujet listé comme personnel ou un mode qui n'existe pas |
|
|
764
|
-
| `command` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--aggregate <Name>]` | `<use-case>.command.ts` sur `AuthorizedCommand` (simple `Command` quand elle est publique), `<use-case>.handler.ts` (il construit l'agrégat, le sauvegarde et répond : les événements partent avec la sauvegarde), une *spec* par le bus avec le refus d'un acteur à qui manque la permission, l'enregistrement avec `.requires(...)` ou `.public()` (et le *repository* s'il manque). Une commande générée répond `void` ou l'identifiant de son agrégat, si bien qu'aucun `<use-case>.result.ts` n'est écrit |
|
|
764
|
+
| `command` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--aggregate <Name> [--creates]]` | `<use-case>.command.ts` sur `AuthorizedCommand` (simple `Command` quand elle est publique), `<use-case>.handler.ts` (avec `--aggregate`, il reçoit le *repository* et n'écrit rien tant que son `TODO(domain)` n'est pas traité : une commande change un agrégat qui existe ; avec `--creates`, il construit l'agrégat, le sauvegarde et répond son identifiant : les événements partent avec la sauvegarde), une *spec* par le bus avec le refus d'un acteur à qui manque la permission, l'enregistrement avec `.requires(...)` ou `.public()` (et le *repository* s'il manque). Une commande générée répond `void` ou l'identifiant de son agrégat, si bien qu'aucun `<use-case>.result.ts` n'est écrit |
|
|
765
765
|
| `query` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--search]` | `<use-case>.query.ts` sur `AuthorizedQuery` (simple `Query` quand elle est publique), `<use-case>.result.ts`, `<use-case>.handler.ts`, le port de lecture `application/ports/<use-case>-reader.port.ts` (une classe abstraite), son adaptateur en mémoire, un *fake*, une *spec*, l'enregistrement sur le bus de requêtes. Avec `--search` (demande `--permission`) : une `PageRequest` du kernel dans la requête, l'élément, le tri et `Page<Item>` dans le fichier de résultat, un gestionnaire qui demande `Access.scope` et remet le périmètre au port de lecture, un lecteur en mémoire qui pagine par décalage ou par curseur |
|
|
766
766
|
| `port` | `<context> <Name>` | `application/ports/<name>.port.ts`, une classe abstraite, et son *fake* |
|
|
767
767
|
| `route` | `<context> <UseCaseName> --method <GET\|POST\|PUT\|PATCH\|DELETE> --path <p> [--command\|--query] [--group <Name>] [--mapper] [--serializer] [--cache public\|private\|no-store]` | sous `"stack.routes": "controllers"` : une classe contrôleur dans `presentation/http/<resource>/<use-case>/` (la ressource est le premier segment du chemin), qui dépend de `CommandBus` ou de `QueryBus`, derrière le groupe de routes de sa ressource, écrit avec elle quand il est nouveau (`<resource>.routes.ts` : préfixe, étiquette, `Authenticated`) ; un cas d'usage public ne se tient dans aucun groupe et dit `guards: [Public]` ; avec class-validator, une classe par fichier (`<use-case>.params.ts`, `.body.ts`, `.answer.ts`, `.accepted.ts`, `.line.ts`) ; `--mapper` et `--serializer` ajoutent un *mapper* de requête HTTP et un sérialiseur que reçoit le contrôleur ; une *spec* ; aucun enregistrement dans un projet déclaré, un contrôleur construit à la main dans `<context>.routes.ts` (le fichier de module en câblage manuel) dans un projet explicite. Sous `"functions"` : une fonction `defineRoute`, sa *spec*, son enregistrement dans `<context>.routes.ts`, et des classes `<use-case>-<role>.dto.ts` |
|
|
@@ -774,9 +774,9 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
774
774
|
| `schema` | `<context\|shared-kernel> <Name>` | `presentation/http/shared/<name>.schema.ts` du contexte, ou `presentation/<name>.schema.ts` du noyau partagé : une forme du contrat déclarée une fois (un schéma zod avec `.meta({ id })`, une classe class-validator, ou un schéma enveloppé par `sharedSchema`), à remplir ; les routes l'utilisent en entier, imbriquée ou en partie |
|
|
775
775
|
| `integration-event` | `<context> <Aggregate> <Fact> [--version n]` | la déclaration `defineIntegrationEvent` dans le langage publié (sa charge utile dans `<event>.v<n>.payload.ts` avec class-validator ou un schéma à vous), l'export de l'index, le *publisher* `application/integration/publishers/<event>.publisher.ts`, une *spec*, l'enregistrement, une ligne de `platform/audit/audited-events.ts` |
|
|
776
776
|
| `integration-handler` (`consumer`) | `<context> <upstreamContext> <eventType>` | `application/integration/handlers/<name>.integration-handler.ts`, une classe `<Name>IntegrationHandler` qui dépend de `CommandBus`, sa *spec*, son abonnement idempotent sous le nom de consommateur `<context>.<name>` ; refusé sauf si l'amont est déclaré |
|
|
777
|
-
| `erasure-handler` | `<context>` | `application/integration/handlers/data-subject-erased.integration-handler.ts`, une classe `DataSubjectErasedIntegrationHandler` qui efface ce que le contexte garde d'une personne par son `<Context>PersonalDataErasure` quand la plateforme annonce `privacy.data-subject.erased` (`dataSubjectErasedV1` du kernel), sa *spec* sur le *fake*, son abonnement idempotent sous le nom de consommateur `<context>.data-subject-erased` (dans une transaction derrière un *broker*) ; pour un contexte qui tourne comme un service à part ou copie des données personnelles depuis des événements. Refusé tant que le contexte n'a pas son effacement (`generate repository --personal`) |
|
|
777
|
+
| `erasure-handler` | `<context>` | `application/integration/handlers/data-subject-erased.integration-handler.ts`, une classe `DataSubjectErasedIntegrationHandler` qui efface ce que le contexte garde d'une personne par son `<Context>PersonalDataErasure` quand la plateforme annonce `privacy.data-subject.erased` (`dataSubjectErasedV1` du kernel), sa *spec* sur le *fake*, son abonnement idempotent sous le nom de consommateur `<context>.data-subject-erased` (dans une transaction derrière un *broker*) ; pour un contexte qui tourne comme un service à part ou copie des données personnelles depuis des événements. Refusé tant que le contexte n'a pas son effacement (`generate repository --personal`), et refusé sur un contexte en *event sourcing*, dont les valeurs personnelles s'effacent en détruisant la clé du sujet (`eraseDataSubject`) |
|
|
778
778
|
| `event-handler` | `<context> <Aggregate> <Fact> [--phase before-commit\|after-commit]` | réaction à un événement du domaine du contexte, *spec*, abonnement ; avant la validation (commit) de l'unité de travail par défaut, après elle avec `--phase after-commit` (un effet qu'aucune transaction ne couvre, au plus une fois), et la *spec* exécute la réaction dans cette phase |
|
|
779
|
-
| `projection` (`projector`) | `<context> <Name> <event-type>` | un projecteur dans `application/projections/<name>.projection.ts`, déclaré avec `@Projection('<context>.<name>')` et une méthode `@On(definition)` pour l'événement d'intégration, que publie le contexte lui-même ou un amont déclaré, et sa *spec
|
|
779
|
+
| `projection` (`projector`) | `<context> <Name> <event-type>` | un projecteur dans `application/projections/<name>.projection.ts`, déclaré avec `@Projection('<context>.<name>')` et une méthode `@On(definition)` pour l'événement d'intégration, que publie le contexte lui-même ou un amont déclaré, et sa *spec*. Dans le style explicite sur tsyringe, le fichier de module du contexte l'inclut par `builder.include(<Name>Projection)` ; sur une plateforme câblée à la main, la classe est simple et le module la souscrit sous son nom de consommateur. Il tient un seul modèle de lecture : son port est reçu par le constructeur |
|
|
780
780
|
| `job` | `<context> <Name> (--every <duration> \| --cron "<expression>" [--time-zone <zone>]) --command <UseCaseName>` | `application/scheduling/<name>.job.ts`, une classe `<Name>Job implements ScheduledJob` qui envoie la commande, en tant que `systemActor('<context>.<name>')` quand elle est protégée, avec `execution.scheduledAt` quand la commande le prend ; `test/unit/<name>.job.spec.ts`, qui exécute le *job* (par son nom sur tsyringe, `application.jobs.runNow` ; `job.run(occurrence)` en câblage manuel) et vérifie la commande qu'il a envoyée ; son enregistrement ; son interrupteur dans `platform/jobs/job-settings.ts` ; l'autorisation de son acteur système (ci-dessous) |
|
|
781
781
|
| `background-job` | `<context> <Name> --command <UseCaseName>` | `application/background/<name>.background-job.ts`, une classe `<Name>BackgroundJob implements BackgroundJob<<Name>Payload>` nommée par son `jobName` statique `<context>.<name>`, qui envoie la commande en tant que `execution.actor` quand elle est protégée, suivi d'un champ de `<Name>Payload` par autre paramètre du constructeur de la commande (chaînes, nombres, booléens, littéraux et listes de ceux-ci tels qu'écrits, une `Date` sous forme de son texte ISO ; tout le reste est refusé) ; `test/unit/<name>.background-job.spec.ts`, qui le met en file avec une charge utile de chaque champ en tant qu'utilisateur et exécute ce qui est dû (à travers l'application de test sur tsyringe, à travers une file et un *worker* en mémoire sur les bus de test sinon) ; son enregistrement (`@Background()`, `builder.backgroundJob(..)` dans le fichier de module sur tsyringe, `platform.backgroundJobs.register(..)` dans le fichier de module d'une plateforme câblée à la main) |
|
|
782
782
|
| `process` (`process-manager`) | `<context> <Name>` | `application/processes/<name>.process.ts` (son état, `processName`, `timeoutJob`, `isState`, une première étape qui arme une échéance, une étape qui y met fin à temps, l'étape de l'échéance), `application/background/<name>-timeout.background-job.ts`, qui livre ses expirations au moyen de `ProcessRunner`, et les *specs* des deux (`givenProcess`, la file de l'application de test sur tsyringe, une file et un *runner* en mémoire sur les bus de test sinon) |
|
|
@@ -2278,7 +2278,8 @@ règle.
|
|
|
2278
2278
|
| `config/valid` | un amont, une classification, une relation, un identifiant de règle, un mode de `guard` ou un `importExtension` inconnu ; un contexte absent du disque ou de la configuration ; une limite de `commit` qui n'est pas un entier positif |
|
|
2279
2279
|
| `config/suppression-needs-reason` | une désactivation sans identifiant de règle ou sans raison (gardée comme alias à côté de `governance/recorded-deviation`, qui juge la raison) |
|
|
2280
2280
|
| `authz/declared` | dans un fichier de module, `builder.command(X)` ou `builder.query(X)` sans `.requires(` ni `.public(` dans sa chaîne, sauf si la classe du message porte `@Requires` ou `@Public` de `@ddd-ts-kit/kernel/declarations` ; en câblage manuel ou nest, une classe de commande ou de requête absente de tous les `requires(X, ...)` et `publicUseCase(X)` du fichier de module et de `application/authorization/` ; un `defineRoute` sans `security` (le type de la route le refuse déjà, et une liste vide aussi : c'est le filet au niveau du texte pour une définition construite de façon lâche) ; dans le style déclaré, la classe exportée d'un fichier `*.command.ts` ou `*.query.ts` qui ne porte ni `@Requires` ni `@Public` |
|
|
2281
|
-
| `authz/granted` | avec `stack.authz` `rbac`, une permission du `definePermissions` d'un contexte que ni `platform/auth/roles/roles.ts` ni `platform/auth/authorization/signed-in-grants.ts` n'accorde par son nom (par l'entrée de son ensemble, son identifiant ou `<contexte>:*`) ; le `*` du super-administrateur ne compte pas (un avertissement) |
|
|
2281
|
+
| `authz/granted` | avec `stack.authz` `rbac`, une permission du `definePermissions` d'un contexte que ni `platform/auth/roles/roles.ts` ni `platform/auth/authorization/signed-in-grants.ts` n'accorde par son nom (par l'entrée de son ensemble, son identifiant ou `<contexte>:*`) ; le `*` du super-administrateur ne compte pas (un avertissement) ; avec `rebac`, une permission que le schéma laisse sur le contexte alors qu'aucune source hors des tests n'écrit de relation `operator` (d'une personne ou d'un acteur système) sur ce contexte et qu'aucun droit de toute personne connectée ne la tient, dans un projet qui fait déjà d'une personne l'opérateur d'un contexte ; muette avec un *authorizer* propre au projet (un avertissement) |
|
|
2282
|
+
| `authz/system-actor-granted` | avec `stack.authz` `rebac`, un `systemActor(<name>)` d'un contexte (un littéral, ou `<Classe>.name`) dans un fichier qui envoie une commande ou une requête non déclarée publique, alors qu'aucun fichier de `platform/auth/relationships/` ne nomme le sujet `system:system:<name>` |
|
|
2282
2283
|
| `authz/scope-narrows` | dans un contexte, un appel `.scope(` dont la permission (l'entrée d'un ensemble dans l'appel, ou dans une constante ou un champ du fichier) est détenue par toute personne connectée, dans `platform/auth/authorization/signed-in-grants.ts` ou dans les `grants` d'un `new SignedInGrantsAuthorizer` : sa portée est toujours `all` ; des droits ou une permission qu'elle ne sait pas lire sont signalés aussi (un avertissement) |
|
|
2283
2284
|
| `privacy/declared-field` | avec `stack.privacy` `on` : une colonne d'une table Knex, d'une table Drizzle ou d'un *entity schema* TypeORM de `infrastructure/persistence/`, ou d'un modèle Prisma dans le schéma du contexte, dont le nom porte un mot du vocabulaire personnel et qu'aucune déclaration `personalFields` du contexte ne nomme |
|
|
2284
2285
|
| `privacy/event-payload-declared` | avec `stack.privacy` `on` : un champ du *payload* d'un événement d'intégration (le `z.object` de la déclaration, la classe ou l'interface de son `.payload.ts`) nommé comme une donnée personnelle que son option `personal` ne liste pas |
|
|
@@ -2315,6 +2316,7 @@ règle.
|
|
|
2315
2316
|
| `ports/no-concrete-dependency` | une liste de dépendances qui nomme une classe importée de `infrastructure/` ou de `test/fakes/` d'un contexte ; dans le style déclaré, un paramètre de constructeur d'une classe déclarée qui ne liste rien, typé par une telle classe |
|
|
2316
2317
|
| `ports/value-import` | une classe nommée dans une liste de dépendances, ou donnée à `bind` ou `rebind`, importée avec `import type` ou `import { type X }` |
|
|
2317
2318
|
| `scheduling/job-triggers-use-case` | dans `application/scheduling/*.job.ts` : une classe exportée qui n'implémente pas `ScheduledJob` ; un `run` qui n'envoie aucune commande (pas d'appel `.execute(`) ; un *repository* dans la liste de dépendances ou le constructeur ; un import de `domain/aggregates/`, `domain/entities/`, `domain/services/` ou `infrastructure/`. Un enregistrement `builder.job(..)` d'une classe qui vit ailleurs |
|
|
2319
|
+
| `scheduling/job-registered` | dans le style explicite, la classe d'un *job* (`application/scheduling/*.job.ts`) ou d'un *job* d'arrière-plan (`application/background/*.background-job.ts`) qu'aucun autre fichier hors des tests n'enregistre (`.handledBy(..)`, `.register(..)` ou `new`) |
|
|
2318
2320
|
| `scheduling/job-name` | le premier argument de `@Scheduled(..)` ou de `.job(..)` qui n'est pas une chaîne littérale `<context>.<job-name>` en kebab-case minuscule avec le contexte de son fichier ; un `systemActor(..)` d'un fichier de *job* qui passe un autre nom ; un même nom de *job* utilisé deux fois dans le projet |
|
|
2319
2321
|
| `errors/code-unique` | sous `"stack.refusals": "named"` ou `"factories"`, dans le `domain/errors/` d'un contexte : un code posé une seconde fois, par une valeur de `<context>.codes.ts`, une fabrique (`refusal('CODE', ..)`) ou une classe (`readonly code = 'CODE'`), avec le fichier et la ligne du premier. Le même code dans deux contextes n'est pas signalé |
|
|
2320
2322
|
| `errors/code-listed` | sous `"stack.refusals": "named"`, dans le `domain/errors/` d'un contexte : une classe de refus (qui étend `DomainRefusal`) dont le code n'est pas `readonly code = <Context>Codes.<Class>` lu dans le `<context>.codes.ts` de son contexte, des classes de refus sans `<context>.codes.ts`, une classe que la liste ne contient pas ; dans `<context>.codes.ts`, pas de liste `<Context>Codes` ou une liste non déclarée `as const`, une clé qui ne nomme aucune classe de refus du contexte, une valeur qui n'est pas un littéral de chaîne en casse de constante |
|
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ No runtime dependency. Node 22.12 or later.
|
|
|
28
28
|
npx ddd-ts-kit init
|
|
29
29
|
npx ddd-ts-kit generate context billing --classification core --term "Invoice=A request for payment"
|
|
30
30
|
npx ddd-ts-kit generate aggregate billing Invoice
|
|
31
|
-
npx ddd-ts-kit generate command billing IssueInvoice --aggregate Invoice --permission invoice.issue --grant accountant --term "Issue=To make an invoice final"
|
|
31
|
+
npx ddd-ts-kit generate command billing IssueInvoice --aggregate Invoice --creates --permission invoice.issue --grant accountant --term "Issue=To make an invoice final"
|
|
32
32
|
npx ddd-ts-kit generate route billing IssueInvoice --method POST --path /invoices
|
|
33
33
|
npx ddd-ts-kit check
|
|
34
34
|
```
|
|
@@ -177,7 +177,7 @@ A config written before `stack.style` existed is explicit.
|
|
|
177
177
|
|
|
178
178
|
The same use case in both styles. In the declared style, the command and its handler carry their
|
|
179
179
|
decorator, and the handler's constructor says what it needs. The body of the handler is the one
|
|
180
|
-
`generate command billing IssueInvoice --aggregate Invoice --permission invoice.issue` writes,
|
|
180
|
+
`generate command billing IssueInvoice --aggregate Invoice --creates --permission invoice.issue` writes,
|
|
181
181
|
before its `TODO(domain)` is answered; the input of the command is filled in:
|
|
182
182
|
|
|
183
183
|
<!-- checked sample -->
|
|
@@ -732,7 +732,7 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
732
732
|
| `domain-service` | `<context> <Name>` | service, spec |
|
|
733
733
|
| `state-machine` | `<context> <Aggregate> [--value <state>]... [--transition "<intention>:<from>[,<from>]...[><to>]"]...` | the vocabulary `<Aggregate>Status` (created from `--value`, two states at least, or given the values it misses), `domain/state-machines/<aggregate>.state-machine.ts` (`<aggregate>Lifecycle`: every value a state, the first one initial, the transitions asked, a `TODO(domain)` for the refusal of the concept error) and `test/unit/<aggregate>.state-machine.spec.ts` (each transition where it leads, a refusal from a state it does not leave); the aggregate is left to use it |
|
|
734
734
|
| `repository` | `<context> <Aggregate> [--tenant-scoped] [--personal <column>,... [--subject <column>] [--erasure pseudonymise\|row] [--retention <column>:<n><d\|m\|y>]]` | the port `domain/repositories/<name>.repository.ts` (`abstract class <Name>Repository extends Repository<<Name>>`), the adapter of the project's ORM (`implements` the port) with its mapper and table (or model), a fake, one `repositoryContract` spec run on both, registration. On an event-sourced aggregate (its class extends `EventSourcedAggregate`) there is no table nor mapper: `event-store-<name>.repository.ts` delegates to `EventSourcedRepository` of the kernel over the `EventStore` and the `PersonalDataCipher` the platform binds, with the codec of `<name>-events.mapper.ts` (the snapshot policy left as a `TODO(domain)`), the fake is that adapter over the in-memory stores, and the contract suite runs on both (its stale-save case pending until a `mutate` that records an event is added); `--personal` is refused there, the personal values being sealed in the events. With `--personal`, the columns of the table that hold personal data: added to the storage and to the row type as nullable text (the mapper writes them empty until the aggregate carries them), declared next to the mapper in `<name>.personal-fields.ts` (`personalFields` of the kernel: the subject column, `id` unless `--subject` names the column that holds the id of the person, the fields, `pseudonymise` unless `--erasure row`), spelled as the erasure of the ORM reads them (SQL names on Knex and Prisma, properties on Drizzle and TypeORM); and, once per context, its erasure: the port `application/ports/<context>-personal-data-erasure.port.ts` (`extends PersonalDataErasure`), the adapter `<orm>-<context>-personal-data-erasure.repository.ts` over `<Orm>PersonalDataErasure` of the ORM package (confined to the tenant of the work with `--tenant-scoped`), its fake, bound where the context binds its adapters and listed in `src/platform/privacy/data-subject-copies.ts`, so that `npm run privacy:erase` reaches it; and its export: the port `<context>-personal-data-export.port.ts` (`extends PersonalDataExport`), the adapter `<orm>-<context>-personal-data-export.repository.ts` over `<Orm>PersonalDataExport`, its fake, bound the same way and listed in `data-subject-exports.ts`, so that `npm run privacy:export` hands it over; one spec, `test/integration/<context>-personal-data.spec.ts`, proves both on the test database. With `--retention <column>:<n><d|m|y>`, the declaration gains `retention`, counted from a column that dates the end of the relation and joins the storage as a nullable timestamp, empty while it lasts (a column the table keeps for itself, `registered_at` first, is refused: counted from the registration, the purge would erase people who are still customers) and the spec proves the purge of what outlived it. A second table of the context joins the declarations of both adapters. Refused without `stack.privacy` on (`init --force --privacy on`), with `--orm none` or `custom`, and before anything is written for a column that is not one, a column the table keeps for itself, a subject listed as personal or a mode that does not exist |
|
|
735
|
-
| `command` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--aggregate <Name>]` | `<use-case>.command.ts` on `AuthorizedCommand` (plain `Command` when public), `<use-case>.handler.ts` (it builds the aggregate, saves it and answers: the events leave with the save), spec through the bus with the refusal of an actor who lacks the permission, registration with `.requires(...)` or `.public()` (and the repository when missing). A generated command answers `void` or the identifier of its aggregate, so no `<use-case>.result.ts` is written |
|
|
735
|
+
| `command` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--aggregate <Name> [--creates]]` | `<use-case>.command.ts` on `AuthorizedCommand` (plain `Command` when public), `<use-case>.handler.ts` (with `--aggregate` it receives the repository and writes nothing until its `TODO(domain)` is answered: a command changes an aggregate that exists; with `--creates` it builds the aggregate, saves it and answers its identifier: the events leave with the save), spec through the bus with the refusal of an actor who lacks the permission, registration with `.requires(...)` or `.public()` (and the repository when missing). A generated command answers `void` or the identifier of its aggregate, so no `<use-case>.result.ts` is written |
|
|
736
736
|
| `query` | `<context> <UseCaseName> (--permission <aggregate>.<action> [--grant <role>] \| --public) [--search]` | `<use-case>.query.ts` on `AuthorizedQuery` (plain `Query` when public), `<use-case>.result.ts`, `<use-case>.handler.ts`, the read port `application/ports/<use-case>-reader.port.ts` (an abstract class), its in-memory adapter, fake, spec, registration on the query bus. With `--search` (needs `--permission`): a kernel `PageRequest` in the query, the item, the sort and `Page<Item>` in the result file, a handler that asks `Access.scope` and hands the scope to the read port, an in-memory reader paging by offset or cursor |
|
|
737
737
|
| `port` | `<context> <Name>` | `application/ports/<name>.port.ts`, one abstract class, and its fake |
|
|
738
738
|
| `route` | `<context> <UseCaseName> --method <GET\|POST\|PUT\|PATCH\|DELETE> --path <p> [--command\|--query] [--group <Name>] [--mapper] [--serializer] [--cache public\|private\|no-store]` | under `"stack.routes": "controllers"`: a controller class in `presentation/http/<resource>/<use-case>/` (the resource is the first segment of the path), depending on `CommandBus` or `QueryBus`, behind the route group of its resource, written with it when it is new (`<resource>.routes.ts`: prefix, tag, `Authenticated`); a public use case stands in no group and says `guards: [Public]`; with class-validator one class per file (`<use-case>.params.ts`, `.body.ts`, `.answer.ts`, `.accepted.ts`, `.line.ts`); `--mapper` and `--serializer` add a request mapper and a serializer the controller is given; a spec; no registration in a declared project, a controller built by hand in `<context>.routes.ts` (the module file with hand wiring) in an explicit one. Under `"functions"`: a `defineRoute` function, its spec, its registration in `<context>.routes.ts`, and `<use-case>-<role>.dto.ts` classes |
|
|
@@ -745,9 +745,9 @@ Next, in this order: the language of the context first, then the business decisi
|
|
|
745
745
|
| `schema` | `<context\|shared-kernel> <Name>` | `presentation/http/shared/<name>.schema.ts` of the context, or `presentation/<name>.schema.ts` of the shared kernel: one shape of the contract declared once (a zod schema with `.meta({ id })`, a class-validator class, or a schema wrapped by `sharedSchema`), to fill; the routes use it whole, nested or in part |
|
|
746
746
|
| `integration-event` | `<context> <Aggregate> <Fact> [--version n]` | `defineIntegrationEvent` declaration in the published language (its payload in `<event>.v<n>.payload.ts` with class-validator or a schema of your own), index export, the publisher `application/integration/publishers/<event>.publisher.ts`, spec, registration, a line of `platform/audit/audited-events.ts` |
|
|
747
747
|
| `integration-handler` (`consumer`) | `<context> <upstreamContext> <eventType>` | `application/integration/handlers/<name>.integration-handler.ts`, a class `<Name>IntegrationHandler` depending on `CommandBus`, its spec, its idempotent subscription under the consumer name `<context>.<name>`; refused unless the upstream is declared |
|
|
748
|
-
| `erasure-handler` | `<context>` | `application/integration/handlers/data-subject-erased.integration-handler.ts`, a class `DataSubjectErasedIntegrationHandler` that erases what the context keeps of a person through its `<Context>PersonalDataErasure` when the platform announces `privacy.data-subject.erased` (`dataSubjectErasedV1` of the kernel), its spec on the fake, its idempotent subscription under the consumer name `<context>.data-subject-erased` (in a transaction behind a broker); for a context that runs as a service of its own or copies personal data from events. Refused until the context has its erasure (`generate repository --personal`) |
|
|
748
|
+
| `erasure-handler` | `<context>` | `application/integration/handlers/data-subject-erased.integration-handler.ts`, a class `DataSubjectErasedIntegrationHandler` that erases what the context keeps of a person through its `<Context>PersonalDataErasure` when the platform announces `privacy.data-subject.erased` (`dataSubjectErasedV1` of the kernel), its spec on the fake, its idempotent subscription under the consumer name `<context>.data-subject-erased` (in a transaction behind a broker); for a context that runs as a service of its own or copies personal data from events. Refused until the context has its erasure (`generate repository --personal`), and refused on an event-sourced context, whose personal values are erased by destroying the key of the subject (`eraseDataSubject`) |
|
|
749
749
|
| `event-handler` | `<context> <Aggregate> <Fact> [--phase before-commit\|after-commit]` | reaction to a domain event of the context, spec, subscription; before the commit of the unit of work by default, after it with `--phase after-commit` (an effect no transaction covers, at most once), and the spec runs the reaction in that phase |
|
|
750
|
-
| `projection` (`projector`) | `<context> <Name> <event-type>` | a projector in `application/projections/<name>.projection.ts`, declared with `@Projection('<context>.<name>')` and one `@On(definition)` method for the integration event, which the context itself or a declared upstream publishes, and its spec
|
|
750
|
+
| `projection` (`projector`) | `<context> <Name> <event-type>` | a projector in `application/projections/<name>.projection.ts`, declared with `@Projection('<context>.<name>')` and one `@On(definition)` method for the integration event, which the context itself or a declared upstream publishes, and its spec. In the explicit style on tsyringe the module file of the context includes it with `builder.include(<Name>Projection)`; on a hand-wired platform the class is plain and the module subscribes it under its consumer name. It keeps one read model: its port is received in the constructor |
|
|
751
751
|
| `job` | `<context> <Name> (--every <duration> \| --cron "<expression>" [--time-zone <zone>]) --command <UseCaseName>` | `application/scheduling/<name>.job.ts`, a class `<Name>Job implements ScheduledJob` that sends the command, as `systemActor('<context>.<name>')` when it is protected, with `execution.scheduledAt` when the command takes it; `test/unit/<name>.job.spec.ts`, which runs the job (by name on tsyringe, `application.jobs.runNow`; `job.run(occurrence)` with hand wiring) and asserts the command it sent; its registration; its switch in `platform/jobs/job-settings.ts`; the grant of its system actor (below) |
|
|
752
752
|
| `background-job` | `<context> <Name> --command <UseCaseName>` | `application/background/<name>.background-job.ts`, a class `<Name>BackgroundJob implements BackgroundJob<<Name>Payload>` named by its static `jobName` `<context>.<name>`, that sends the command as `execution.actor` when it is protected, followed by one field of `<Name>Payload` per other parameter of the constructor of the command (strings, numbers, booleans, literals and lists of them as written, a `Date` as its ISO text; anything else is refused); `test/unit/<name>.background-job.spec.ts`, which enqueues it with a payload of every field as a user and runs what is due (through the test application on tsyringe, through a queue and a worker in memory on the test buses otherwise); its registration (`@Background()`, `builder.backgroundJob(..)` in the module file on tsyringe, `platform.backgroundJobs.register(..)` in the module file of a platform wired by hand) |
|
|
753
753
|
| `process` (`process-manager`) | `<context> <Name>` | `application/processes/<name>.process.ts` (its state, `processName`, `timeoutJob`, `isState`, a first step that arms a deadline, a step that ends it in time, the step of the deadline), `application/background/<name>-timeout.background-job.ts`, which delivers its timeouts through `ProcessRunner`, and the specs of both (`givenProcess`, the queue of the test application on tsyringe, a queue and a runner in memory on the test buses otherwise) |
|
|
@@ -2143,7 +2143,8 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
|
|
|
2143
2143
|
| `config/valid` | unknown upstream, classification, relationship, rule id, `guard` mode or `importExtension`; a context missing on disk or in the config; a `commit` limit that is not a positive integer |
|
|
2144
2144
|
| `config/suppression-needs-reason` | a suppression without a rule id or a reason (kept as an alias next to `governance/recorded-deviation`, which judges the reason) |
|
|
2145
2145
|
| `authz/declared` | in a module file, `builder.command(X)` or `builder.query(X)` without `.requires(` or `.public(` in its chain, unless the message class carries `@Requires` or `@Public` of `@ddd-ts-kit/kernel/declarations`; with manual or nest wiring, a command or query class absent from every `requires(X, ...)` and `publicUseCase(X)` of the module file and of `application/authorization/`; a `defineRoute` without `security` (the route type refuses it already, and an empty list too: this is the text-level net for a definition built loosely); in the declared style, the exported class of a `*.command.ts` or `*.query.ts` file carrying neither `@Requires` nor `@Public` |
|
|
2146
|
-
| `authz/granted` | with `stack.authz` `rbac`, a permission of a context's `definePermissions` that neither `platform/auth/roles/roles.ts` nor `platform/auth/authorization/signed-in-grants.ts` grants by name (by the entry of its set, its id or `<context>:*`); the super-admin `*` does not count (a warning) |
|
|
2146
|
+
| `authz/granted` | with `stack.authz` `rbac`, a permission of a context's `definePermissions` that neither `platform/auth/roles/roles.ts` nor `platform/auth/authorization/signed-in-grants.ts` grants by name (by the entry of its set, its id or `<context>:*`); the super-admin `*` does not count (a warning); with `rebac`, a permission the schema leaves on the context while no source outside the tests writes an `operator` relationship (of a person or a system actor) on that context and no signed-in grant holds it, in a project that already makes a person operator of some context; silent with an authorizer of the project's own (a warning) |
|
|
2147
|
+
| `authz/system-actor-granted` | with `stack.authz` `rebac`, a `systemActor(<name>)` of a context (a literal, or `<Class>.name`) in a file that sends a command or a query not declared public, while no file of `platform/auth/relationships/` names the subject `system:system:<name>` |
|
|
2147
2148
|
| `authz/scope-narrows` | in a context, a `.scope(` call whose permission (the entry of a set in the call, or in a constant or a field of the file) every signed-in person holds, in `platform/auth/authorization/signed-in-grants.ts` or in the `grants` of a `new SignedInGrantsAuthorizer`: its scope is always `all`; grants or a permission it cannot read are reported too (a warning) |
|
|
2148
2149
|
| `privacy/declared-field` | with `stack.privacy` `on`: a column of a Knex table, a Drizzle table or a TypeORM entity schema of `infrastructure/persistence/`, or of a Prisma model in the schema of the context, whose name holds a word of the personal vocabulary and that no `personalFields` declaration of the context names |
|
|
2149
2150
|
| `privacy/event-payload-declared` | with `stack.privacy` `on`: a field of the payload of an integration event (the `z.object` of the declaration, the class or the interface of its `.payload.ts`) named like personal data that its `personal` option does not list |
|
|
@@ -2180,6 +2181,7 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
|
|
|
2180
2181
|
| `ports/no-concrete-dependency` | a dependency list naming a class imported from `infrastructure/` or from `test/fakes/` of a context; in the declared style, a constructor parameter of a declared class that lists nothing, typed by such a class |
|
|
2181
2182
|
| `ports/value-import` | a class named in a dependency list, or given to `bind` or `rebind`, imported with `import type` or `import { type X }` |
|
|
2182
2183
|
| `scheduling/job-triggers-use-case` | in `application/scheduling/*.job.ts`: an exported class that does not implement `ScheduledJob`; a `run` that sends no command (no `.execute(` call); a repository in the dependency list or the constructor; an import from `domain/aggregates/`, `domain/entities/`, `domain/services/` or `infrastructure/`. A `builder.job(..)` registration of a class that lives elsewhere |
|
|
2184
|
+
| `scheduling/job-registered` | in the explicit style, the class of a job (`application/scheduling/*.job.ts`) or background job (`application/background/*.background-job.ts`) that no other file outside the tests registers (`.handledBy(..)`, `.register(..)` or `new`) |
|
|
2183
2185
|
| `scheduling/job-name` | the first argument of `@Scheduled(..)` or `.job(..)` that is not a string literal `<context>.<job-name>` in lower-case kebab-case with the context of its file; a `systemActor(..)` of a job file passing another name; one job name used twice in the project |
|
|
2184
2186
|
| `errors/code-unique` | under `"stack.refusals": "named"` or `"factories"`, in the `domain/errors/` of a context: a code set a second time, by a value of `<context>.codes.ts`, a factory (`refusal('CODE', ..)`) or a class (`readonly code = 'CODE'`), with the file and line of the first. The same code in two contexts is not reported |
|
|
2185
2187
|
| `errors/code-listed` | under `"stack.refusals": "named"`, in the `domain/errors/` of a context: a refusal class (extending `DomainRefusal`) whose code is not `readonly code = <Context>Codes.<Class>` from the `<context>.codes.ts` of its context, refusal classes and no `<context>.codes.ts`, a class the list does not hold; in `<context>.codes.ts`, no list `<Context>Codes` or one not declared `as const`, a key that names no refusal class of the context, a value that is not a string literal in constant case |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Project } from '../model/project.js';
|
|
2
|
+
/** The contexts somebody is made operator of by a relationship written in the sources, outside the tests. */
|
|
3
|
+
export interface OperatorTuples {
|
|
4
|
+
/** A tuple whose object the checker cannot read (a computed context): every context may be covered. */
|
|
5
|
+
readonly unreadable: boolean;
|
|
6
|
+
readonly contexts: ReadonlySet<string>;
|
|
7
|
+
/** A tuple makes a person (a subject other than `system:..`) operator of some context: the project provisions its operators in its tree. */
|
|
8
|
+
readonly provisioned: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The `{ object: 'context:<name>', relation: 'operator', subject: '..' }` tuples the project writes
|
|
12
|
+
* in its sources, tests aside, whoever the subject is: a person, or a system actor whose grant
|
|
13
|
+
* `authz/system-actor-granted` judges (a use case only the system sends is held by it).
|
|
14
|
+
*/
|
|
15
|
+
export declare function operatorTuples(project: Project): OperatorTuples;
|
|
16
|
+
//# sourceMappingURL=operator-tuples.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-tuples.d.ts","sourceRoot":"","sources":["../../../src/check/authz/operator-tuples.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAQhD,6GAA6G;AAC7G,MAAM,WAAW,cAAc;IAC7B,uGAAuG;IACvG,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,4IAA4I;IAC5I,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,cAAc,CAoB/D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const BODY = '(?:[^{}]|\\$\\{[^{}]*\\})*';
|
|
2
|
+
const QUOTE = '[\'"`]';
|
|
3
|
+
const TUPLE = new RegExp(`\\{${BODY}?\\brelation\\s*:\\s*(${QUOTE})operator\\1${BODY}\\}`, 'g');
|
|
4
|
+
const SYSTEM_SUBJECT = /\bsubject\s*:\s*(['"`])system:/;
|
|
5
|
+
const OBJECT = /\bobject\s*:\s*(['"`])context:([^'"`]*)\1/;
|
|
6
|
+
/**
|
|
7
|
+
* The `{ object: 'context:<name>', relation: 'operator', subject: '..' }` tuples the project writes
|
|
8
|
+
* in its sources, tests aside, whoever the subject is: a person, or a system actor whose grant
|
|
9
|
+
* `authz/system-actor-granted` judges (a use case only the system sends is held by it).
|
|
10
|
+
*/
|
|
11
|
+
export function operatorTuples(project) {
|
|
12
|
+
const contexts = new Set();
|
|
13
|
+
let unreadable = false;
|
|
14
|
+
let provisioned = false;
|
|
15
|
+
for (const file of project.files.filter(({ isTest }) => !isTest)) {
|
|
16
|
+
for (const [tuple] of file.text.matchAll(TUPLE)) {
|
|
17
|
+
provisioned ||= !SYSTEM_SUBJECT.test(tuple);
|
|
18
|
+
const context = OBJECT.exec(tuple)?.[2];
|
|
19
|
+
if (context === undefined || context.includes('${')) {
|
|
20
|
+
unreadable = true;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
contexts.add(context);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return { unreadable, contexts, provisioned };
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=operator-tuples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-tuples.js","sourceRoot":"","sources":["../../../src/check/authz/operator-tuples.ts"],"names":[],"mappings":"AAEA,MAAM,IAAI,GAAG,4BAA4B,CAAC;AAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC;AACvB,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,IAAI,yBAAyB,KAAK,eAAe,IAAI,KAAK,EAAE,GAAG,CAAC,CAAC;AAChG,MAAM,cAAc,GAAG,gCAAgC,CAAC;AACxD,MAAM,MAAM,GAAG,2CAA2C,CAAC;AAW3D;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACjE,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAChD,WAAW,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAE5C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAExC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpD,UAAU,GAAG,IAAI,CAAC;YACpB,CAAC;iBAAM,CAAC;gBACN,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Project } from '../model/project.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the project decides rights with an authorizer of its own: the `createAuthorizer` of the
|
|
4
|
+
* platform imports a class named `*Authorizer` from a file of the project. Such a class may grant
|
|
5
|
+
* what the schema does not (a system actor its own context, a role of the token), which the
|
|
6
|
+
* checker cannot read: the rules that judge the grants of the standard authorizer stay silent.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ownAuthorizer(project: Project): boolean;
|
|
9
|
+
//# sourceMappingURL=own-authorizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"own-authorizer.d.ts","sourceRoot":"","sources":["../../../src/check/authz/own-authorizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIhD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAYvD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { platformFileIn } from '../../platform-layout/index.js';
|
|
2
|
+
import { isInProject } from './is-in-project.js';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the project decides rights with an authorizer of its own: the `createAuthorizer` of the
|
|
5
|
+
* platform imports a class named `*Authorizer` from a file of the project. Such a class may grant
|
|
6
|
+
* what the schema does not (a system actor its own context, a role of the token), which the
|
|
7
|
+
* checker cannot read: the rules that judge the grants of the standard authorizer stay silent.
|
|
8
|
+
*/
|
|
9
|
+
export function ownAuthorizer(project) {
|
|
10
|
+
const path = platformFileIn(project.config, 'auth/authorization/create-authorizer.ts', (candidate) => isInProject(project, candidate));
|
|
11
|
+
return (project.files
|
|
12
|
+
.find((file) => file.path === path)
|
|
13
|
+
?.imports.some(({ target, names }) => target.kind === 'file' && names.some((name) => name.endsWith('Authorizer'))) ?? false);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=own-authorizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"own-authorizer.js","sourceRoot":"","sources":["../../../src/check/authz/own-authorizer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,yCAAyC,EAAE,CAAC,SAAS,EAAE,EAAE,CACnG,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAChC,CAAC;IAEF,OAAO,CACL,OAAO,CAAC,KAAK;SACV,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC;QACnC,EAAE,OAAO,CAAC,IAAI,CACZ,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CACnG,IAAI,KAAK,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stray-entry.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/stray-entry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"stray-entry.d.ts","sourceRoot":"","sources":["../../../src/check/canonical/stray-entry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAkB1C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAc1E"}
|
|
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import { CONTEXT_FILES } from '../../context-files/index.js';
|
|
3
3
|
import { controllersFile } from '../../nest-controllers/controllers-file.js';
|
|
4
4
|
import { barrelFile, dependenciesFile, isDeclarationsFile } from '../../declared/index.js';
|
|
5
|
-
import { declaredModules, moduleSplit, WITHOUT_MODULE } from '../../model-modules/index.js';
|
|
5
|
+
import { declaredModules, moduleFileOf, moduleOfModuleFile, moduleSplit, WITHOUT_MODULE } from '../../model-modules/index.js';
|
|
6
6
|
import { isCanonicalDirectory } from './is-canonical-directory.js';
|
|
7
7
|
import { OPEN_DIRECTORIES } from './open-directories.js';
|
|
8
8
|
import { roleOf } from './role-of.js';
|
|
@@ -16,6 +16,10 @@ export function strayEntry(entry, config) {
|
|
|
16
16
|
if (placed === undefined || (placed.module !== undefined && placed.inside === '') || inDotDirectory(entry)) {
|
|
17
17
|
return undefined;
|
|
18
18
|
}
|
|
19
|
+
// At its root, a module of the model holds its module file, which the module file of the context composes.
|
|
20
|
+
if (moduleOfModuleFile(placed.inside, placed.modules) !== undefined) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
19
23
|
return entry.endsWith('/') ? strayDirectory(placed) : straySource(placed);
|
|
20
24
|
}
|
|
21
25
|
/** A dot-directory of a context (the `.claude/` a sandbox leaves) is written by a tool: it is no part of the tree. */
|
|
@@ -33,11 +37,13 @@ function place(entry, config) {
|
|
|
33
37
|
if (rest.length === 0) {
|
|
34
38
|
return undefined;
|
|
35
39
|
}
|
|
36
|
-
const
|
|
40
|
+
const modules = declaredModules(config, context);
|
|
41
|
+
const { module, path: inside } = moduleSplit(rest.join('/'), modules);
|
|
37
42
|
return {
|
|
38
43
|
context,
|
|
39
44
|
declared: stack.style === 'declared',
|
|
40
45
|
inside,
|
|
46
|
+
modules,
|
|
41
47
|
...(module === undefined ? {} : { module }),
|
|
42
48
|
extras: contexts[context]?.extraDirectories ?? [],
|
|
43
49
|
};
|
|
@@ -72,6 +78,12 @@ function straySource(placed) {
|
|
|
72
78
|
if (open || generated || roleOf(directory) !== undefined || coveredByExtra(extras, directory)) {
|
|
73
79
|
return undefined;
|
|
74
80
|
}
|
|
81
|
+
if (placed.modules.includes(directory)) {
|
|
82
|
+
return {
|
|
83
|
+
message: `"${inside}" sits at the root of the module ${directory}.`,
|
|
84
|
+
fix: `Move it into the directory of its role (${directory}/<layer>/<role>/); only ${moduleFileOf(directory)}, its module file in the explicit style, lives at the root of a module.`,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
75
87
|
return {
|
|
76
88
|
message: `"${inside}" is not in a role directory.`,
|
|
77
89
|
fix: `Move it one level down into the directory of its role (for example ${directory.split('/')[0] ?? directory}/<role>/), so that its suffix and its tests can be checked.`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stray-entry.js","sourceRoot":"","sources":["../../../src/check/canonical/stray-entry.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"stray-entry.js","sourceRoot":"","sources":["../../../src/check/canonical/stray-entry.ts"],"names":[],"mappings":"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"}
|
|
@@ -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,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"architecture-rules.d.ts","sourceRoot":"","sources":["../../../src/check/catalogue/architecture-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AA4G1C,gHAAgH;AAChH,eAAO,MAAM,kBAAkB,EAAE,SAAS,IAAI,EA2G7C,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { authzFieldsBySchema } from '../rules/authz-fields-by-schema.js';
|
|
|
4
4
|
import { authzDeclared } from '../rules/authz-declared.js';
|
|
5
5
|
import { authzGranted } from '../rules/authz-granted.js';
|
|
6
6
|
import { authzResourceModelled } from '../rules/authz-resource-modelled.js';
|
|
7
|
+
import { authzSystemActorGranted } from '../rules/authz-system-actor-granted.js';
|
|
7
8
|
import { authzScopeNarrows } from '../rules/authz-scope-narrows.js';
|
|
8
9
|
import { privacyDeclaredField } from '../rules/privacy-declared-field.js';
|
|
9
10
|
import { privacyErasureReachesCopies } from '../rules/privacy-erasure-reaches-copies.js';
|
|
@@ -86,6 +87,7 @@ import { purityNoEnvironment } from '../rules/purity-no-environment.js';
|
|
|
86
87
|
import { purityNoSystemClock } from '../rules/purity-no-system-clock.js';
|
|
87
88
|
import { schedulingTenancyDeclared } from '../rules/scheduling-tenancy-declared.js';
|
|
88
89
|
import { schedulingJobName } from '../rules/scheduling-job-name.js';
|
|
90
|
+
import { schedulingJobRegistered } from '../rules/scheduling-job-registered.js';
|
|
89
91
|
import { schedulingJobTriggersUseCase } from '../rules/scheduling-job-triggers-use-case.js';
|
|
90
92
|
import { schemaNoDuplicateShape } from '../rules/schema-no-duplicate-shape.js';
|
|
91
93
|
import { schemaPresentationOnly } from '../rules/schema-presentation-only.js';
|
|
@@ -170,6 +172,7 @@ export const ARCHITECTURE_RULES = [
|
|
|
170
172
|
authzGranted,
|
|
171
173
|
authzScopeNarrows,
|
|
172
174
|
authzResourceModelled,
|
|
175
|
+
authzSystemActorGranted,
|
|
173
176
|
privacyDeclaredField,
|
|
174
177
|
privacyEventPayloadDeclared,
|
|
175
178
|
privacyErasureReachesCopies,
|
|
@@ -197,6 +200,7 @@ export const ARCHITECTURE_RULES = [
|
|
|
197
200
|
lifecycleStatusThroughMachine,
|
|
198
201
|
processSendsCommandsOnly,
|
|
199
202
|
schedulingJobName,
|
|
203
|
+
schedulingJobRegistered,
|
|
200
204
|
schedulingTenancyDeclared,
|
|
201
205
|
importsAliasOnly,
|
|
202
206
|
importsExtension,
|