ddd-ts-kit 0.90.0 → 0.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (746) hide show
  1. package/CHANGELOG.md +474 -0
  2. package/README.fr.md +53 -17
  3. package/README.md +49 -15
  4. package/dist/acceptance/lock-acceptance.d.ts.map +1 -1
  5. package/dist/acceptance/lock-acceptance.js +2 -1
  6. package/dist/acceptance/lock-acceptance.js.map +1 -1
  7. package/dist/alias/index.d.ts +2 -1
  8. package/dist/alias/index.d.ts.map +1 -1
  9. package/dist/alias/index.js +1 -0
  10. package/dist/alias/index.js.map +1 -1
  11. package/dist/alias/mapper-target-text.d.ts +4 -0
  12. package/dist/alias/mapper-target-text.d.ts.map +1 -0
  13. package/dist/alias/mapper-target-text.js +5 -0
  14. package/dist/alias/mapper-target-text.js.map +1 -0
  15. package/dist/alias/module-name-mapper.d.ts +5 -2
  16. package/dist/alias/module-name-mapper.d.ts.map +1 -1
  17. package/dist/alias/module-name-mapper.js +5 -2
  18. package/dist/alias/module-name-mapper.js.map +1 -1
  19. package/dist/check/alias/test-runners.js +8 -3
  20. package/dist/check/alias/test-runners.js.map +1 -1
  21. package/dist/check/baseline/apply-baseline.d.ts +14 -0
  22. package/dist/check/baseline/apply-baseline.d.ts.map +1 -0
  23. package/dist/check/baseline/apply-baseline.js +30 -0
  24. package/dist/check/baseline/apply-baseline.js.map +1 -0
  25. package/dist/check/baseline/baseline-following-moves.d.ts +9 -0
  26. package/dist/check/baseline/baseline-following-moves.d.ts.map +1 -0
  27. package/dist/check/baseline/baseline-following-moves.js +10 -0
  28. package/dist/check/baseline/baseline-following-moves.js.map +1 -0
  29. package/dist/check/baseline/baseline-move.d.ts +6 -0
  30. package/dist/check/baseline/baseline-move.d.ts.map +1 -0
  31. package/dist/check/baseline/baseline-move.js +2 -0
  32. package/dist/check/baseline/baseline-move.js.map +1 -0
  33. package/dist/check/baseline/baseline-text.d.ts +4 -0
  34. package/dist/check/baseline/baseline-text.d.ts.map +1 -0
  35. package/dist/check/baseline/baseline-text.js +12 -0
  36. package/dist/check/baseline/baseline-text.js.map +1 -0
  37. package/dist/check/baseline/baseline.d.ts +6 -0
  38. package/dist/check/baseline/baseline.d.ts.map +1 -0
  39. package/dist/check/baseline/baseline.js +2 -0
  40. package/dist/check/baseline/baseline.js.map +1 -0
  41. package/dist/check/baseline/moved-baseline-text.d.ts +4 -0
  42. package/dist/check/baseline/moved-baseline-text.d.ts.map +1 -0
  43. package/dist/check/baseline/moved-baseline-text.js +13 -0
  44. package/dist/check/baseline/moved-baseline-text.js.map +1 -0
  45. package/dist/check/baseline/parse-baseline.d.ts +4 -0
  46. package/dist/check/baseline/parse-baseline.d.ts.map +1 -0
  47. package/dist/check/baseline/parse-baseline.js +19 -0
  48. package/dist/check/baseline/parse-baseline.js.map +1 -0
  49. package/dist/check/baseline/pruned-baseline.d.ts +5 -0
  50. package/dist/check/baseline/pruned-baseline.d.ts.map +1 -0
  51. package/dist/check/baseline/pruned-baseline.js +14 -0
  52. package/dist/check/baseline/pruned-baseline.js.map +1 -0
  53. package/dist/check/baseline/read-baseline.d.ts +6 -0
  54. package/dist/check/baseline/read-baseline.d.ts.map +1 -0
  55. package/dist/check/baseline/read-baseline.js +11 -0
  56. package/dist/check/baseline/read-baseline.js.map +1 -0
  57. package/dist/check/baseline/recorded-baseline.d.ts +5 -0
  58. package/dist/check/baseline/recorded-baseline.d.ts.map +1 -0
  59. package/dist/check/baseline/recorded-baseline.js +11 -0
  60. package/dist/check/baseline/recorded-baseline.js.map +1 -0
  61. package/dist/check/baseline/renamed-files.d.ts +8 -0
  62. package/dist/check/baseline/renamed-files.d.ts.map +1 -0
  63. package/dist/check/baseline/renamed-files.js +23 -0
  64. package/dist/check/baseline/renamed-files.js.map +1 -0
  65. package/dist/check/baseline/write-baseline.d.ts +4 -0
  66. package/dist/check/baseline/write-baseline.d.ts.map +1 -0
  67. package/dist/check/baseline/write-baseline.js +9 -0
  68. package/dist/check/baseline/write-baseline.js.map +1 -0
  69. package/dist/check/canonical/stray-entry.d.ts.map +1 -1
  70. package/dist/check/canonical/stray-entry.js +5 -1
  71. package/dist/check/canonical/stray-entry.js.map +1 -1
  72. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  73. package/dist/check/catalogue/architecture-rules.js +4 -0
  74. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  75. package/dist/check/commands/check-command.d.ts.map +1 -1
  76. package/dist/check/commands/check-command.js +46 -1
  77. package/dist/check/commands/check-command.js.map +1 -1
  78. package/dist/check/commands/check-file-command.d.ts +5 -0
  79. package/dist/check/commands/check-file-command.d.ts.map +1 -1
  80. package/dist/check/commands/check-file-command.js +27 -6
  81. package/dist/check/commands/check-file-command.js.map +1 -1
  82. package/dist/check/event-sourcing/read-stored-shape.d.ts +2 -0
  83. package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
  84. package/dist/check/event-sourcing/read-stored-shape.js +3 -1
  85. package/dist/check/event-sourcing/read-stored-shape.js.map +1 -1
  86. package/dist/check/event-sourcing/stored-event-declaration.d.ts +2 -0
  87. package/dist/check/event-sourcing/stored-event-declaration.d.ts.map +1 -1
  88. package/dist/check/event-sourcing/stored-event-declarations.js +1 -0
  89. package/dist/check/event-sourcing/stored-event-declarations.js.map +1 -1
  90. package/dist/check/event-sourcing/stored-shape.d.ts +2 -0
  91. package/dist/check/event-sourcing/stored-shape.d.ts.map +1 -1
  92. package/dist/check/explain/nest-docs.d.ts +3 -0
  93. package/dist/check/explain/nest-docs.d.ts.map +1 -0
  94. package/dist/check/explain/nest-docs.js +31 -0
  95. package/dist/check/explain/nest-docs.js.map +1 -0
  96. package/dist/check/explain/rule-docs.d.ts.map +1 -1
  97. package/dist/check/explain/rule-docs.js +2 -0
  98. package/dist/check/explain/rule-docs.js.map +1 -1
  99. package/dist/check/fixtures/alias-declared-fixtures.js +1 -1
  100. package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
  101. package/dist/check/fixtures/authz-declared-fixtures.js +1 -1
  102. package/dist/check/fixtures/authz-declared-fixtures.js.map +1 -1
  103. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  104. package/dist/check/fixtures/fixtures.js +4 -0
  105. package/dist/check/fixtures/fixtures.js.map +1 -1
  106. package/dist/check/fixtures/nest-controllers-fixtures.d.ts +3 -0
  107. package/dist/check/fixtures/nest-controllers-fixtures.d.ts.map +1 -0
  108. package/dist/check/fixtures/nest-controllers-fixtures.js +104 -0
  109. package/dist/check/fixtures/nest-controllers-fixtures.js.map +1 -0
  110. package/dist/check/fixtures/nest-fixtures.d.ts +3 -0
  111. package/dist/check/fixtures/nest-fixtures.d.ts.map +1 -0
  112. package/dist/check/fixtures/nest-fixtures.js +59 -0
  113. package/dist/check/fixtures/nest-fixtures.js.map +1 -0
  114. package/dist/check/nest/nest-equivalents-of.d.ts +14 -0
  115. package/dist/check/nest/nest-equivalents-of.d.ts.map +1 -0
  116. package/dist/check/nest/nest-equivalents-of.js +124 -0
  117. package/dist/check/nest/nest-equivalents-of.js.map +1 -0
  118. package/dist/check/project/load-project.d.ts +2 -0
  119. package/dist/check/project/load-project.d.ts.map +1 -1
  120. package/dist/check/project/load-project.js +7 -3
  121. package/dist/check/project/load-project.js.map +1 -1
  122. package/dist/check/rules/nest-controllers-current.d.ts +3 -0
  123. package/dist/check/rules/nest-controllers-current.d.ts.map +1 -0
  124. package/dist/check/rules/nest-controllers-current.js +54 -0
  125. package/dist/check/rules/nest-controllers-current.js.map +1 -0
  126. package/dist/check/rules/nest-no-parallel-pipeline.d.ts +3 -0
  127. package/dist/check/rules/nest-no-parallel-pipeline.d.ts.map +1 -0
  128. package/dist/check/rules/nest-no-parallel-pipeline.js +70 -0
  129. package/dist/check/rules/nest-no-parallel-pipeline.js.map +1 -0
  130. package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
  131. package/dist/check/support/is-generated-context-file.js +4 -1
  132. package/dist/check/support/is-generated-context-file.js.map +1 -1
  133. package/dist/commands/docs.d.ts.map +1 -1
  134. package/dist/commands/docs.js +13 -5
  135. package/dist/commands/docs.js.map +1 -1
  136. package/dist/commands/drizzle-generate.d.ts.map +1 -1
  137. package/dist/commands/drizzle-generate.js +21 -1
  138. package/dist/commands/drizzle-generate.js.map +1 -1
  139. package/dist/commands/generate.js +2 -0
  140. package/dist/commands/generate.js.map +1 -1
  141. package/dist/commands/init.d.ts.map +1 -1
  142. package/dist/commands/init.js +1 -0
  143. package/dist/commands/init.js.map +1 -1
  144. package/dist/commands/prisma-generate.d.ts +7 -0
  145. package/dist/commands/prisma-generate.d.ts.map +1 -0
  146. package/dist/commands/prisma-generate.js +23 -0
  147. package/dist/commands/prisma-generate.js.map +1 -0
  148. package/dist/commands/typeorm-generate.d.ts +10 -0
  149. package/dist/commands/typeorm-generate.d.ts.map +1 -0
  150. package/dist/commands/typeorm-generate.js +37 -0
  151. package/dist/commands/typeorm-generate.js.map +1 -0
  152. package/dist/config/config.d.ts +6 -0
  153. package/dist/config/config.d.ts.map +1 -1
  154. package/dist/config/index.d.ts +1 -1
  155. package/dist/config/index.d.ts.map +1 -1
  156. package/dist/config/index.js +1 -1
  157. package/dist/config/index.js.map +1 -1
  158. package/dist/config/parse-config.js +1 -0
  159. package/dist/config/parse-config.js.map +1 -1
  160. package/dist/config/parse-stack.d.ts.map +1 -1
  161. package/dist/config/parse-stack.js +2 -1
  162. package/dist/config/parse-stack.js.map +1 -1
  163. package/dist/config/serialize-config.js +9 -2
  164. package/dist/config/serialize-config.js.map +1 -1
  165. package/dist/config/stack.d.ts +18 -5
  166. package/dist/config/stack.d.ts.map +1 -1
  167. package/dist/config/stack.js +5 -2
  168. package/dist/config/stack.js.map +1 -1
  169. package/dist/describe/guard-errors.d.ts +3 -0
  170. package/dist/describe/guard-errors.d.ts.map +1 -0
  171. package/dist/describe/guard-errors.js +10 -0
  172. package/dist/describe/guard-errors.js.map +1 -0
  173. package/dist/describe/no-group.d.ts +4 -0
  174. package/dist/describe/no-group.d.ts.map +1 -0
  175. package/dist/describe/no-group.js +3 -0
  176. package/dist/describe/no-group.js.map +1 -0
  177. package/dist/describe/read-controllers.d.ts +1 -1
  178. package/dist/describe/read-controllers.d.ts.map +1 -1
  179. package/dist/describe/read-controllers.js +12 -19
  180. package/dist/describe/read-controllers.js.map +1 -1
  181. package/dist/describe/read-nest-controller-routes.d.ts +16 -0
  182. package/dist/describe/read-nest-controller-routes.d.ts.map +1 -0
  183. package/dist/describe/read-nest-controller-routes.js +117 -0
  184. package/dist/describe/read-nest-controller-routes.js.map +1 -0
  185. package/dist/describe/schema-class-of.d.ts +3 -0
  186. package/dist/describe/schema-class-of.d.ts.map +1 -0
  187. package/dist/describe/schema-class-of.js +10 -0
  188. package/dist/describe/schema-class-of.js.map +1 -0
  189. package/dist/dev/refresh-declarations.d.ts.map +1 -1
  190. package/dist/dev/refresh-declarations.js +4 -1
  191. package/dist/dev/refresh-declarations.js.map +1 -1
  192. package/dist/docs/declared-stored-events.d.ts +6 -2
  193. package/dist/docs/declared-stored-events.d.ts.map +1 -1
  194. package/dist/docs/declared-stored-events.js +4 -3
  195. package/dist/docs/declared-stored-events.js.map +1 -1
  196. package/dist/docs/emptily-recorded-stored-events.d.ts +6 -0
  197. package/dist/docs/emptily-recorded-stored-events.d.ts.map +1 -0
  198. package/dist/docs/emptily-recorded-stored-events.js +12 -0
  199. package/dist/docs/emptily-recorded-stored-events.js.map +1 -0
  200. package/dist/docs/refuse-unreadable-stored-events.d.ts +7 -0
  201. package/dist/docs/refuse-unreadable-stored-events.d.ts.map +1 -0
  202. package/dist/docs/refuse-unreadable-stored-events.js +27 -0
  203. package/dist/docs/refuse-unreadable-stored-events.js.map +1 -0
  204. package/dist/docs/write-docs.d.ts.map +1 -1
  205. package/dist/docs/write-docs.js +2 -0
  206. package/dist/docs/write-docs.js.map +1 -1
  207. package/dist/docs/write-stored-events-lock.d.ts +3 -2
  208. package/dist/docs/write-stored-events-lock.d.ts.map +1 -1
  209. package/dist/docs/write-stored-events-lock.js +5 -2
  210. package/dist/docs/write-stored-events-lock.js.map +1 -1
  211. package/dist/file-moves/move-files.d.ts.map +1 -1
  212. package/dist/file-moves/move-files.js +10 -0
  213. package/dist/file-moves/move-files.js.map +1 -1
  214. package/dist/generate/kind.d.ts +2 -0
  215. package/dist/generate/kind.d.ts.map +1 -1
  216. package/dist/generate/kinds/aggregate-kind.d.ts.map +1 -1
  217. package/dist/generate/kinds/aggregate-kind.js +6 -2
  218. package/dist/generate/kinds/aggregate-kind.js.map +1 -1
  219. package/dist/generate/kinds/assert-event-store.d.ts +4 -0
  220. package/dist/generate/kinds/assert-event-store.d.ts.map +1 -0
  221. package/dist/generate/kinds/assert-event-store.js +10 -0
  222. package/dist/generate/kinds/assert-event-store.js.map +1 -0
  223. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts +9 -0
  224. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -0
  225. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +49 -0
  226. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -0
  227. package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
  228. package/dist/generate/kinds/file-upload-kind.js +9 -2
  229. package/dist/generate/kinds/file-upload-kind.js.map +1 -1
  230. package/dist/generate/kinds/form-kind.d.ts.map +1 -1
  231. package/dist/generate/kinds/form-kind.js +15 -11
  232. package/dist/generate/kinds/form-kind.js.map +1 -1
  233. package/dist/generate/kinds/generate-event-sourced-repository.d.ts +11 -0
  234. package/dist/generate/kinds/generate-event-sourced-repository.d.ts.map +1 -0
  235. package/dist/generate/kinds/generate-event-sourced-repository.js +48 -0
  236. package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -0
  237. package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
  238. package/dist/generate/kinds/generate-repository.js +5 -0
  239. package/dist/generate/kinds/generate-repository.js.map +1 -1
  240. package/dist/generate/kinds/is-event-sourced.d.ts +9 -0
  241. package/dist/generate/kinds/is-event-sourced.d.ts.map +1 -0
  242. package/dist/generate/kinds/is-event-sourced.js +11 -0
  243. package/dist/generate/kinds/is-event-sourced.js.map +1 -0
  244. package/dist/generate/kinds/presentation/controller-source.d.ts +11 -3
  245. package/dist/generate/kinds/presentation/controller-source.d.ts.map +1 -1
  246. package/dist/generate/kinds/presentation/controller-source.js +25 -4
  247. package/dist/generate/kinds/presentation/controller-source.js.map +1 -1
  248. package/dist/generate/kinds/property-kind.d.ts +3 -0
  249. package/dist/generate/kinds/property-kind.d.ts.map +1 -0
  250. package/dist/generate/kinds/property-kind.js +51 -0
  251. package/dist/generate/kinds/property-kind.js.map +1 -0
  252. package/dist/generate/kinds/repository-kind.js +1 -1
  253. package/dist/generate/kinds/repository-kind.js.map +1 -1
  254. package/dist/generate/kinds/representation-kind.d.ts.map +1 -1
  255. package/dist/generate/kinds/representation-kind.js +4 -3
  256. package/dist/generate/kinds/representation-kind.js.map +1 -1
  257. package/dist/generate/kinds/route/nest-controller-vars.d.ts +11 -0
  258. package/dist/generate/kinds/route/nest-controller-vars.d.ts.map +1 -0
  259. package/dist/generate/kinds/route/nest-controller-vars.js +91 -0
  260. package/dist/generate/kinds/route/nest-controller-vars.js.map +1 -0
  261. package/dist/generate/kinds/route/nest-search-vars.d.ts +6 -0
  262. package/dist/generate/kinds/route/nest-search-vars.d.ts.map +1 -0
  263. package/dist/generate/kinds/route/nest-search-vars.js +18 -0
  264. package/dist/generate/kinds/route/nest-search-vars.js.map +1 -0
  265. package/dist/generate/kinds/route/route-vars.d.ts.map +1 -1
  266. package/dist/generate/kinds/route/route-vars.js +1 -9
  267. package/dist/generate/kinds/route/route-vars.js.map +1 -1
  268. package/dist/generate/kinds/route/success-status.d.ts +5 -0
  269. package/dist/generate/kinds/route/success-status.d.ts.map +1 -0
  270. package/dist/generate/kinds/route/success-status.js +11 -0
  271. package/dist/generate/kinds/route/success-status.js.map +1 -0
  272. package/dist/generate/kinds/route/write-nest-controller.d.ts +8 -0
  273. package/dist/generate/kinds/route/write-nest-controller.d.ts.map +1 -0
  274. package/dist/generate/kinds/route/write-nest-controller.js +50 -0
  275. package/dist/generate/kinds/route/write-nest-controller.js.map +1 -0
  276. package/dist/generate/kinds/route-kind.d.ts.map +1 -1
  277. package/dist/generate/kinds/route-kind.js +6 -1
  278. package/dist/generate/kinds/route-kind.js.map +1 -1
  279. package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -1
  280. package/dist/generate/kinds/wire-repository-on-first-use.js +2 -1
  281. package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -1
  282. package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
  283. package/dist/generate/kinds/write-event-sourced-aggregate.js +5 -13
  284. package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
  285. package/dist/generate/kinds.d.ts.map +1 -1
  286. package/dist/generate/kinds.js +2 -0
  287. package/dist/generate/kinds.js.map +1 -1
  288. package/dist/generate/refresh-docs.d.ts.map +1 -1
  289. package/dist/generate/refresh-docs.js +2 -0
  290. package/dist/generate/refresh-docs.js.map +1 -1
  291. package/dist/generate/shared-writes.d.ts.map +1 -1
  292. package/dist/generate/shared-writes.js +5 -0
  293. package/dist/generate/shared-writes.js.map +1 -1
  294. package/dist/help/notes.d.ts +1 -1
  295. package/dist/help/notes.d.ts.map +1 -1
  296. package/dist/help/notes.js +3 -1
  297. package/dist/help/notes.js.map +1 -1
  298. package/dist/help/usage.d.ts +1 -1
  299. package/dist/help/usage.d.ts.map +1 -1
  300. package/dist/help/usage.js +7 -3
  301. package/dist/help/usage.js.map +1 -1
  302. package/dist/init/agent-permissions.js +12 -6
  303. package/dist/init/agent-permissions.js.map +1 -1
  304. package/dist/init/files/audit-files.js +1 -1
  305. package/dist/init/files/audit-files.js.map +1 -1
  306. package/dist/init/files/auth-files.js +4 -0
  307. package/dist/init/files/auth-files.js.map +1 -1
  308. package/dist/init/files/persistence-files.d.ts.map +1 -1
  309. package/dist/init/files/persistence-files.js +2 -0
  310. package/dist/init/files/persistence-files.js.map +1 -1
  311. package/dist/init/files/platform-files.js +1 -0
  312. package/dist/init/files/platform-files.js.map +1 -1
  313. package/dist/init/knip-vars.d.ts.map +1 -1
  314. package/dist/init/knip-vars.js +14 -5
  315. package/dist/init/knip-vars.js.map +1 -1
  316. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  317. package/dist/init/manifest/database-scripts.js +10 -4
  318. package/dist/init/manifest/database-scripts.js.map +1 -1
  319. package/dist/init/manifest/dependencies-against-stack.d.ts +18 -0
  320. package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -0
  321. package/dist/init/manifest/dependencies-against-stack.js +99 -0
  322. package/dist/init/manifest/dependencies-against-stack.js.map +1 -0
  323. package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
  324. package/dist/init/manifest/dependencies-for.js +19 -3
  325. package/dist/init/manifest/dependencies-for.js.map +1 -1
  326. package/dist/init/manifest/scripts-for.js +5 -2
  327. package/dist/init/manifest/scripts-for.js.map +1 -1
  328. package/dist/init/manifest/versions.d.ts.map +1 -1
  329. package/dist/init/manifest/versions.js +40 -30
  330. package/dist/init/manifest/versions.js.map +1 -1
  331. package/dist/init/run-init.d.ts.map +1 -1
  332. package/dist/init/run-init.js +14 -1
  333. package/dist/init/run-init.js.map +1 -1
  334. package/dist/init/stack/resolve-queue.d.ts +4 -10
  335. package/dist/init/stack/resolve-queue.d.ts.map +1 -1
  336. package/dist/init/stack/resolve-queue.js +7 -11
  337. package/dist/init/stack/resolve-queue.js.map +1 -1
  338. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  339. package/dist/init/stack/resolve-stack.js +30 -9
  340. package/dist/init/stack/resolve-stack.js.map +1 -1
  341. package/dist/init/stack/stack-options.d.ts +2 -0
  342. package/dist/init/stack/stack-options.d.ts.map +1 -1
  343. package/dist/init/template-vars.js +1 -1
  344. package/dist/init/template-vars.js.map +1 -1
  345. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  346. package/dist/init/write-type-script-configs.js +4 -1
  347. package/dist/init/write-type-script-configs.js.map +1 -1
  348. package/dist/markers/insert-in-region.js +1 -1
  349. package/dist/markers/insert-in-region.js.map +1 -1
  350. package/dist/merge/lost/untouched-by-branch.d.ts +12 -0
  351. package/dist/merge/lost/untouched-by-branch.d.ts.map +1 -0
  352. package/dist/merge/lost/untouched-by-branch.js +22 -0
  353. package/dist/merge/lost/untouched-by-branch.js.map +1 -0
  354. package/dist/merge/lost/verify-merge.d.ts.map +1 -1
  355. package/dist/merge/lost/verify-merge.js +6 -1
  356. package/dist/merge/lost/verify-merge.js.map +1 -1
  357. package/dist/migration/audit-guard/append-audit-guard.d.ts +18 -0
  358. package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -0
  359. package/dist/migration/audit-guard/append-audit-guard.js +27 -0
  360. package/dist/migration/audit-guard/append-audit-guard.js.map +1 -0
  361. package/dist/migration/audit-guard/audit-guard-statements-of.d.ts +7 -0
  362. package/dist/migration/audit-guard/audit-guard-statements-of.d.ts.map +1 -0
  363. package/dist/migration/audit-guard/audit-guard-statements-of.js +18 -0
  364. package/dist/migration/audit-guard/audit-guard-statements-of.js.map +1 -0
  365. package/dist/migration/audit-guard/audit-schema-created.d.ts +3 -0
  366. package/dist/migration/audit-guard/audit-schema-created.d.ts.map +1 -0
  367. package/dist/migration/audit-guard/audit-schema-created.js +9 -0
  368. package/dist/migration/audit-guard/audit-schema-created.js.map +1 -0
  369. package/dist/migration/audit-guard/generate-guarded.d.ts +16 -0
  370. package/dist/migration/audit-guard/generate-guarded.d.ts.map +1 -0
  371. package/dist/migration/audit-guard/generate-guarded.js +22 -0
  372. package/dist/migration/audit-guard/generate-guarded.js.map +1 -0
  373. package/dist/migration/audit-guard/guard-marker.d.ts +3 -0
  374. package/dist/migration/audit-guard/guard-marker.d.ts.map +1 -0
  375. package/dist/migration/audit-guard/guard-marker.js +3 -0
  376. package/dist/migration/audit-guard/guard-marker.js.map +1 -0
  377. package/dist/migration/audit-guard/guarded-text.d.ts +5 -0
  378. package/dist/migration/audit-guard/guarded-text.d.ts.map +1 -0
  379. package/dist/migration/audit-guard/guarded-text.js +26 -0
  380. package/dist/migration/audit-guard/guarded-text.js.map +1 -0
  381. package/dist/migration/audit-guard/migrations-under.d.ts +3 -0
  382. package/dist/migration/audit-guard/migrations-under.d.ts.map +1 -0
  383. package/dist/migration/audit-guard/migrations-under.js +15 -0
  384. package/dist/migration/audit-guard/migrations-under.js.map +1 -0
  385. package/dist/migration/audit-guard/run-orm-tool.d.ts +3 -0
  386. package/dist/migration/audit-guard/run-orm-tool.d.ts.map +1 -0
  387. package/dist/migration/audit-guard/run-orm-tool.js +13 -0
  388. package/dist/migration/audit-guard/run-orm-tool.js.map +1 -0
  389. package/dist/migration/audit-guard/schemas-first.d.ts +6 -0
  390. package/dist/migration/audit-guard/schemas-first.d.ts.map +1 -0
  391. package/dist/migration/audit-guard/schemas-first.js +17 -0
  392. package/dist/migration/audit-guard/schemas-first.js.map +1 -0
  393. package/dist/migration/audit-guard/schemas-if-missing.d.ts +7 -0
  394. package/dist/migration/audit-guard/schemas-if-missing.d.ts.map +1 -0
  395. package/dist/migration/audit-guard/schemas-if-missing.js +9 -0
  396. package/dist/migration/audit-guard/schemas-if-missing.js.map +1 -0
  397. package/dist/migration/audit-guard/type-only-imports.d.ts +6 -0
  398. package/dist/migration/audit-guard/type-only-imports.d.ts.map +1 -0
  399. package/dist/migration/audit-guard/type-only-imports.js +8 -0
  400. package/dist/migration/audit-guard/type-only-imports.js.map +1 -0
  401. package/dist/migration/format-as-the-project.d.ts +4 -0
  402. package/dist/migration/format-as-the-project.d.ts.map +1 -0
  403. package/dist/migration/format-as-the-project.js +27 -0
  404. package/dist/migration/format-as-the-project.js.map +1 -0
  405. package/dist/migration/format-written-files.d.ts.map +1 -1
  406. package/dist/migration/format-written-files.js +2 -24
  407. package/dist/migration/format-written-files.js.map +1 -1
  408. package/dist/migration/index.d.ts +8 -0
  409. package/dist/migration/index.d.ts.map +1 -1
  410. package/dist/migration/index.js +8 -0
  411. package/dist/migration/index.js.map +1 -1
  412. package/dist/nest-controllers/controllers-file.d.ts +3 -0
  413. package/dist/nest-controllers/controllers-file.d.ts.map +1 -0
  414. package/dist/nest-controllers/controllers-file.js +5 -0
  415. package/dist/nest-controllers/controllers-file.js.map +1 -0
  416. package/dist/nest-controllers/nest-answer.d.ts +8 -0
  417. package/dist/nest-controllers/nest-answer.d.ts.map +1 -0
  418. package/dist/nest-controllers/nest-answer.js +2 -0
  419. package/dist/nest-controllers/nest-answer.js.map +1 -0
  420. package/dist/nest-controllers/nest-controller-entry.d.ts +18 -0
  421. package/dist/nest-controllers/nest-controller-entry.d.ts.map +1 -0
  422. package/dist/nest-controllers/nest-controller-entry.js +2 -0
  423. package/dist/nest-controllers/nest-controller-entry.js.map +1 -0
  424. package/dist/nest-controllers/nest-controllers-in.d.ts +6 -0
  425. package/dist/nest-controllers/nest-controllers-in.d.ts.map +1 -0
  426. package/dist/nest-controllers/nest-controllers-in.js +108 -0
  427. package/dist/nest-controllers/nest-controllers-in.js.map +1 -0
  428. package/dist/nest-controllers/nest-read-type.d.ts +12 -0
  429. package/dist/nest-controllers/nest-read-type.d.ts.map +1 -0
  430. package/dist/nest-controllers/nest-read-type.js +2 -0
  431. package/dist/nest-controllers/nest-read-type.js.map +1 -0
  432. package/dist/nest-controllers/nest-request-part.d.ts +9 -0
  433. package/dist/nest-controllers/nest-request-part.d.ts.map +1 -0
  434. package/dist/nest-controllers/nest-request-part.js +2 -0
  435. package/dist/nest-controllers/nest-request-part.js.map +1 -0
  436. package/dist/nest-controllers/parameters-of.d.ts +8 -0
  437. package/dist/nest-controllers/parameters-of.d.ts.map +1 -0
  438. package/dist/nest-controllers/parameters-of.js +32 -0
  439. package/dist/nest-controllers/parameters-of.js.map +1 -0
  440. package/dist/nest-controllers/project-files.d.ts +6 -0
  441. package/dist/nest-controllers/project-files.d.ts.map +1 -0
  442. package/dist/nest-controllers/project-files.js +2 -0
  443. package/dist/nest-controllers/project-files.js.map +1 -0
  444. package/dist/nest-controllers/read-nest-controllers.d.ts +12 -0
  445. package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -0
  446. package/dist/nest-controllers/read-nest-controllers.js +17 -0
  447. package/dist/nest-controllers/read-nest-controllers.js.map +1 -0
  448. package/dist/nest-controllers/refresh-nest-controllers.d.ts +9 -0
  449. package/dist/nest-controllers/refresh-nest-controllers.d.ts.map +1 -0
  450. package/dist/nest-controllers/refresh-nest-controllers.js +32 -0
  451. package/dist/nest-controllers/refresh-nest-controllers.js.map +1 -0
  452. package/dist/nest-controllers/render-controllers-file.d.ts +9 -0
  453. package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -0
  454. package/dist/nest-controllers/render-controllers-file.js +72 -0
  455. package/dist/nest-controllers/render-controllers-file.js.map +1 -0
  456. package/dist/platform-folders/platform-folders.d.ts.map +1 -1
  457. package/dist/platform-folders/platform-folders.js +10 -0
  458. package/dist/platform-folders/platform-folders.js.map +1 -1
  459. package/dist/platform-layout/platform-layout.d.ts +3 -0
  460. package/dist/platform-layout/platform-layout.d.ts.map +1 -1
  461. package/dist/platform-layout/platform-layout.js +3 -0
  462. package/dist/platform-layout/platform-layout.js.map +1 -1
  463. package/dist/presets/apply-preset.d.ts.map +1 -1
  464. package/dist/presets/apply-preset.js +22 -2
  465. package/dist/presets/apply-preset.js.map +1 -1
  466. package/dist/presets/identity-preset.d.ts.map +1 -1
  467. package/dist/presets/identity-preset.js +4 -1
  468. package/dist/presets/identity-preset.js.map +1 -1
  469. package/dist/presets/identity-refusal.d.ts.map +1 -1
  470. package/dist/presets/identity-refusal.js +14 -8
  471. package/dist/presets/identity-refusal.js.map +1 -1
  472. package/dist/presets/lay-out-prisma-models.d.ts +8 -0
  473. package/dist/presets/lay-out-prisma-models.d.ts.map +1 -0
  474. package/dist/presets/lay-out-prisma-models.js +51 -0
  475. package/dist/presets/lay-out-prisma-models.js.map +1 -0
  476. package/dist/presets/preset-files.d.ts.map +1 -1
  477. package/dist/presets/preset-files.js +6 -1
  478. package/dist/presets/preset-files.js.map +1 -1
  479. package/dist/presets/preset.d.ts +11 -0
  480. package/dist/presets/preset.d.ts.map +1 -1
  481. package/dist/run.d.ts.map +1 -1
  482. package/dist/run.js +4 -0
  483. package/dist/run.js.map +1 -1
  484. package/dist/sdk/client-files.d.ts +5 -3
  485. package/dist/sdk/client-files.d.ts.map +1 -1
  486. package/dist/sdk/client-files.js +8 -3
  487. package/dist/sdk/client-files.js.map +1 -1
  488. package/dist/sdk/client-manifest.d.ts +3 -0
  489. package/dist/sdk/client-manifest.d.ts.map +1 -1
  490. package/dist/sdk/client-manifest.js +15 -2
  491. package/dist/sdk/client-manifest.js.map +1 -1
  492. package/dist/sdk/client-operation.d.ts +6 -0
  493. package/dist/sdk/client-operation.d.ts.map +1 -1
  494. package/dist/sdk/read-operation.d.ts.map +1 -1
  495. package/dist/sdk/read-operation.js +6 -0
  496. package/dist/sdk/read-operation.js.map +1 -1
  497. package/dist/sdk/render-orpc.d.ts +8 -0
  498. package/dist/sdk/render-orpc.d.ts.map +1 -0
  499. package/dist/sdk/render-orpc.js +42 -0
  500. package/dist/sdk/render-orpc.js.map +1 -0
  501. package/dist/sdk/render-readme.d.ts +3 -0
  502. package/dist/sdk/render-readme.d.ts.map +1 -1
  503. package/dist/sdk/render-readme.js +46 -0
  504. package/dist/sdk/render-readme.js.map +1 -1
  505. package/dist/sdk/render-trpc.d.ts +9 -0
  506. package/dist/sdk/render-trpc.d.ts.map +1 -0
  507. package/dist/sdk/render-trpc.js +36 -0
  508. package/dist/sdk/render-trpc.js.map +1 -0
  509. package/dist/sdk/rpc-packages.d.ts +7 -0
  510. package/dist/sdk/rpc-packages.d.ts.map +1 -0
  511. package/dist/sdk/rpc-packages.js +9 -0
  512. package/dist/sdk/rpc-packages.js.map +1 -0
  513. package/dist/sdk/rpc.d.ts +4 -0
  514. package/dist/sdk/rpc.d.ts.map +1 -0
  515. package/dist/sdk/rpc.js +2 -0
  516. package/dist/sdk/rpc.js.map +1 -0
  517. package/dist/sdk/write-clients.d.ts.map +1 -1
  518. package/dist/sdk/write-clients.js +18 -3
  519. package/dist/sdk/write-clients.js.map +1 -1
  520. package/dist/stack/alias-vars.d.ts.map +1 -1
  521. package/dist/stack/alias-vars.js +2 -2
  522. package/dist/stack/alias-vars.js.map +1 -1
  523. package/dist/stack/audit-vars.js +1 -1
  524. package/dist/stack/audit-vars.js.map +1 -1
  525. package/dist/stack/authentication-vars.d.ts.map +1 -1
  526. package/dist/stack/authentication-vars.js +8 -2
  527. package/dist/stack/authentication-vars.js.map +1 -1
  528. package/dist/stack/cache-vars.d.ts +5 -1
  529. package/dist/stack/cache-vars.d.ts.map +1 -1
  530. package/dist/stack/cache-vars.js +9 -3
  531. package/dist/stack/cache-vars.js.map +1 -1
  532. package/dist/stack/stack-vars.d.ts +1 -1
  533. package/dist/stack/stack-vars.d.ts.map +1 -1
  534. package/dist/stack/stack-vars.js +11 -6
  535. package/dist/stack/stack-vars.js.map +1 -1
  536. package/dist/version.d.ts +1 -1
  537. package/dist/version.js +1 -1
  538. package/dist/worker/briefing-of.d.ts.map +1 -1
  539. package/dist/worker/briefing-of.js +2 -4
  540. package/dist/worker/briefing-of.js.map +1 -1
  541. package/dist/worker/resume-message.d.ts.map +1 -1
  542. package/dist/worker/resume-message.js +1 -2
  543. package/dist/worker/resume-message.js.map +1 -1
  544. package/package.json +6 -4
  545. package/templates/architecture/extractable.declared.spec.ts.tpl +22 -17
  546. package/templates/architecture/extractable.manual.spec.ts.tpl +14 -9
  547. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +19 -14
  548. package/templates/background-job/wiring.manual.tpl +1 -1
  549. package/templates/command/wiring.manual.tpl +1 -1
  550. package/templates/context/module.manual.ts.tpl +52 -10
  551. package/templates/erasure-handler/wiring.manual.tpl +1 -1
  552. package/templates/event-handler/wiring.manual.tpl +1 -1
  553. package/templates/file-upload/wiring.manual.tpl +1 -1
  554. package/templates/init/docker/env.example.tpl +1 -1
  555. package/templates/init/e2e/auth-environment.passport.ts.tpl +6 -0
  556. package/templates/init/e2e/create-credentials.passport.ts.tpl +47 -0
  557. package/templates/init/jest.config.js.tpl +6 -0
  558. package/templates/init/platform/auth/authentication/actor-of-token.ts.tpl +15 -0
  559. package/templates/init/platform/auth/authentication/bearer-strategy.ts.tpl +29 -0
  560. package/templates/init/platform/auth/authentication/create-authenticator.passport.ts.tpl +13 -0
  561. package/templates/init/platform/composition/compose-application.manual.ts.tpl +55 -2
  562. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +1 -1
  563. package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
  564. package/templates/init/platform/composition/platform-error-mapper.ts.tpl +9 -0
  565. package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +11 -0
  566. package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +14 -5
  567. package/templates/init/platform/config/app-config.ts.tpl +2 -2
  568. package/templates/init/platform/config/load-config.ts.tpl +2 -2
  569. package/templates/init/platform/database/open-persistence.memory.ts.tpl +10 -0
  570. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +6 -1
  571. package/templates/init/platform/database/persistence-over.knex.ts.tpl +6 -1
  572. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +12 -1
  573. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +28 -1
  574. package/templates/init/platform/database/persistence.contract.spec.ts.tpl +131 -0
  575. package/templates/init/platform/database/persistence.memory.ts.tpl +7 -1
  576. package/templates/init/platform/database/persistence.orm.ts.tpl +16 -3
  577. package/templates/init/platform/database/schema.drizzle.ts.tpl +11 -1
  578. package/templates/init/platform/database/schema.prisma.tpl +5 -2
  579. package/templates/init/platform/database/schema.typeorm.ts.tpl +17 -3
  580. package/templates/init/platform/database/table-statements.drizzle.ts.tpl +36 -0
  581. package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +18 -6
  582. package/templates/init/platform/files/bind-files.tsyringe.ts.tpl +1 -1
  583. package/templates/init/platform/files/create-files.ts.tpl +1 -1
  584. package/templates/init/platform/http/create-app-module.ts.tpl +20 -0
  585. package/templates/init/platform/http/start-http-server.express.ts.tpl +58 -2
  586. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +50 -2
  587. package/templates/init/platform/http/start-http-server.hono.ts.tpl +60 -1
  588. package/templates/init/platform/http/start-http-server.nest.ts.tpl +67 -4
  589. package/templates/init/platform/jobs/create-background-work.ts.tpl +2 -2
  590. package/templates/init/rules/infrastructure.md.tpl +3 -0
  591. package/templates/init/rules/presentation.md.tpl +7 -0
  592. package/templates/integration-event/wiring.manual.tpl +1 -1
  593. package/templates/integration-handler/wiring.manual.tpl +1 -1
  594. package/templates/job/wiring.manual.tpl +1 -1
  595. package/templates/nest-controller/controller.search.ts.tpl +38 -0
  596. package/templates/nest-controller/controller.spec.ts.tpl +57 -0
  597. package/templates/nest-controller/controller.ts.tpl +49 -0
  598. package/templates/nest-controller/upload.spec.ts.tpl +47 -0
  599. package/templates/nest-controller/upload.ts.tpl +25 -0
  600. package/templates/pipeline/biome.json.tpl +2 -2
  601. package/templates/pipeline/eslint.config.mjs.tpl +6 -0
  602. package/templates/pipeline/knip.json.tpl +4 -8
  603. package/templates/pipeline/package-scripts.json +2 -2
  604. package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +271 -0
  605. package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +10 -0
  606. package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +10 -0
  607. package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +10 -0
  608. package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +10 -0
  609. package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +10 -0
  610. package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +10 -0
  611. package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +10 -0
  612. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +6 -0
  613. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +12 -0
  614. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +6 -0
  615. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +12 -0
  616. package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +6 -0
  617. package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +12 -0
  618. package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +6 -0
  619. package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +12 -0
  620. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +6 -0
  621. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +12 -0
  622. package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +6 -0
  623. package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +12 -0
  624. package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +6 -0
  625. package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +12 -0
  626. package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +6 -0
  627. package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +12 -0
  628. package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +6 -0
  629. package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +12 -0
  630. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +6 -0
  631. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +12 -0
  632. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +6 -0
  633. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +12 -0
  634. package/templates/presets/identity/context/application/integration/handlers/account-deactivated.integration-handler.ts.tpl +4 -0
  635. package/templates/presets/identity/context/application/integration/handlers/member-joined.integration-handler.ts.tpl +4 -0
  636. package/templates/presets/identity/context/application/integration/handlers/member-removed.integration-handler.ts.tpl +4 -0
  637. package/templates/presets/identity/context/application/integration/handlers/organisation-opened.integration-handler.ts.tpl +4 -0
  638. package/templates/presets/identity/context/application/integration/publishers/account-deactivated.publisher.ts.tpl +10 -1
  639. package/templates/presets/identity/context/application/integration/publishers/delegation-granted.publisher.ts.tpl +10 -1
  640. package/templates/presets/identity/context/application/integration/publishers/delegation-revoked.publisher.ts.tpl +10 -1
  641. package/templates/presets/identity/context/application/integration/publishers/member-joined.publisher.ts.tpl +10 -1
  642. package/templates/presets/identity/context/application/integration/publishers/member-removed.publisher.ts.tpl +10 -1
  643. package/templates/presets/identity/context/application/integration/publishers/member-role-changed.publisher.ts.tpl +10 -1
  644. package/templates/presets/identity/context/application/integration/publishers/organisation-opened.publisher.ts.tpl +10 -1
  645. package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +12 -0
  646. package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +6 -0
  647. package/templates/presets/identity/context/infrastructure/external/crypto-invitation-tokens.adapter.ts.tpl +9 -0
  648. package/templates/presets/identity/context/infrastructure/external/environment-identity-provider-connection.adapter.ts.tpl +9 -0
  649. package/templates/presets/identity/context/infrastructure/external/keycloak-identity-provider-admin.adapter.ts.tpl +9 -0
  650. package/templates/presets/identity/context/infrastructure/persistence/account.mapper.prisma.ts.tpl +36 -0
  651. package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.prisma.ts.tpl +19 -0
  652. package/templates/presets/identity/context/infrastructure/persistence/delegation.mapper.prisma.ts.tpl +48 -0
  653. package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +9 -0
  654. package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +9 -0
  655. package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +9 -0
  656. package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +9 -0
  657. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +9 -0
  658. package/templates/presets/identity/context/infrastructure/persistence/drizzle-search-members-reader.repository.drizzle.ts.tpl +9 -0
  659. package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +43 -0
  660. package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.prisma.ts.tpl +20 -0
  661. package/templates/presets/identity/context/infrastructure/persistence/knex-account.repository.knex.ts.tpl +9 -0
  662. package/templates/presets/identity/context/infrastructure/persistence/knex-delegation.repository.knex.ts.tpl +9 -0
  663. package/templates/presets/identity/context/infrastructure/persistence/knex-invitation.repository.knex.ts.tpl +9 -0
  664. package/templates/presets/identity/context/infrastructure/persistence/knex-member.repository.knex.ts.tpl +9 -0
  665. package/templates/presets/identity/context/infrastructure/persistence/knex-organisation.repository.knex.ts.tpl +9 -0
  666. package/templates/presets/identity/context/infrastructure/persistence/knex-search-members-reader.repository.knex.ts.tpl +9 -0
  667. package/templates/presets/identity/context/infrastructure/persistence/member.mapper.prisma.ts.tpl +34 -0
  668. package/templates/presets/identity/context/infrastructure/persistence/organisation.mapper.prisma.ts.tpl +26 -0
  669. package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +63 -0
  670. package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +81 -0
  671. package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +69 -0
  672. package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +80 -0
  673. package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +63 -0
  674. package/templates/presets/identity/context/infrastructure/persistence/prisma-search-members-reader.repository.prisma.ts.tpl +82 -0
  675. package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/deactivate-account.controller.nest-routes.ts.tpl +31 -0
  676. package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.controller.nest-routes.ts.tpl +44 -0
  677. package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +56 -0
  678. package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.controller.nest-routes.ts.tpl +54 -0
  679. package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.controller.nest-routes.ts.tpl +32 -0
  680. package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.controller.nest-routes.ts.tpl +43 -0
  681. package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.controller.nest-routes.ts.tpl +25 -0
  682. package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.controller.nest-routes.ts.tpl +37 -0
  683. package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.controller.nest-routes.ts.tpl +31 -0
  684. package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.controller.nest-routes.ts.tpl +31 -0
  685. package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.controller.nest-routes.ts.tpl +31 -0
  686. package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.controller.nest-routes.ts.tpl +42 -0
  687. package/templates/presets/identity/context/test/integration/account.repository.contract.spec.ts.tpl +3 -3
  688. package/templates/presets/identity/context/test/integration/delegation.repository.contract.spec.ts.tpl +5 -5
  689. package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +5 -5
  690. package/templates/presets/identity/context/test/integration/member.repository.contract.spec.ts.tpl +5 -5
  691. package/templates/presets/identity/context/test/integration/organisation.repository.contract.spec.ts.tpl +4 -4
  692. package/templates/presets/identity/context/test/integration/search-members-reader.spec.ts.tpl +8 -8
  693. package/templates/presets/identity/context/test/unit/__context__.module.spec.explicit.ts.tpl +108 -0
  694. package/templates/presets/identity/context/test/unit/accept-invitation.controller.spec.nest-routes.ts.tpl +70 -0
  695. package/templates/presets/identity/context/test/unit/change-member-role.controller.spec.nest-routes.ts.tpl +70 -0
  696. package/templates/presets/identity/context/test/unit/deactivate-account.controller.spec.nest-routes.ts.tpl +57 -0
  697. package/templates/presets/identity/context/test/unit/decline-invitation.controller.spec.nest-routes.ts.tpl +70 -0
  698. package/templates/presets/identity/context/test/unit/grant-delegation.controller.spec.nest-routes.ts.tpl +70 -0
  699. package/templates/presets/identity/context/test/unit/invite-member.controller.spec.nest-routes.ts.tpl +70 -0
  700. package/templates/presets/identity/context/test/unit/open-organisation.controller.spec.nest-routes.ts.tpl +70 -0
  701. package/templates/presets/identity/context/test/unit/provision-account.controller.spec.nest-routes.ts.tpl +99 -0
  702. package/templates/presets/identity/context/test/unit/remove-member.controller.spec.nest-routes.ts.tpl +57 -0
  703. package/templates/presets/identity/context/test/unit/revoke-delegation.controller.spec.nest-routes.ts.tpl +57 -0
  704. package/templates/presets/identity/context/test/unit/revoke-invitation.controller.spec.nest-routes.ts.tpl +57 -0
  705. package/templates/presets/identity/context/test/unit/search-members.controller.spec.nest-routes.ts.tpl +54 -0
  706. package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +332 -0
  707. package/templates/presets/identity/explicit/access-policies.wiring.tpl +16 -0
  708. package/templates/presets/identity/prisma/models.prisma.tpl +128 -0
  709. package/templates/process/timeout-job.wiring.manual.tpl +1 -1
  710. package/templates/property/value-object.properties.spec.ts.tpl +38 -0
  711. package/templates/query/search.wiring.manual.tpl +1 -1
  712. package/templates/query/wiring.manual.tpl +1 -1
  713. package/templates/repository/contract.spec.ts.tpl +1 -3
  714. package/templates/repository/event-sourced/contract.spec.ts.tpl +36 -0
  715. package/templates/repository/event-sourced/fake.ts.tpl +24 -0
  716. package/templates/repository/event-sourced/repository.ts.tpl +38 -0
  717. package/templates/repository/event-sourced-first-use.wiring.manual.tpl +4 -0
  718. package/templates/repository/event-sourced.wiring.tsyringe.tpl +6 -0
  719. package/templates/repository/first-use.wiring.manual.tpl +1 -1
  720. package/templates/sdk/orpc.ts.tpl +46 -0
  721. package/templates/sdk/trpc.ts.tpl +86 -0
  722. /package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/{deactivate-account.controller.ts.tpl → deactivate-account.controller.kit-routes.ts.tpl} +0 -0
  723. /package/templates/presets/identity/context/presentation/http/accounts/provision-account/{provision-account.controller.ts.tpl → provision-account.controller.kit-routes.ts.tpl} +0 -0
  724. /package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/{accept-invitation.controller.ts.tpl → accept-invitation.controller.kit-routes.ts.tpl} +0 -0
  725. /package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/{decline-invitation.controller.ts.tpl → decline-invitation.controller.kit-routes.ts.tpl} +0 -0
  726. /package/templates/presets/identity/context/presentation/http/organisations/change-member-role/{change-member-role.controller.ts.tpl → change-member-role.controller.kit-routes.ts.tpl} +0 -0
  727. /package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/{grant-delegation.controller.ts.tpl → grant-delegation.controller.kit-routes.ts.tpl} +0 -0
  728. /package/templates/presets/identity/context/presentation/http/organisations/invite-member/{invite-member.controller.ts.tpl → invite-member.controller.kit-routes.ts.tpl} +0 -0
  729. /package/templates/presets/identity/context/presentation/http/organisations/open-organisation/{open-organisation.controller.ts.tpl → open-organisation.controller.kit-routes.ts.tpl} +0 -0
  730. /package/templates/presets/identity/context/presentation/http/organisations/remove-member/{remove-member.controller.ts.tpl → remove-member.controller.kit-routes.ts.tpl} +0 -0
  731. /package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/{revoke-delegation.controller.ts.tpl → revoke-delegation.controller.kit-routes.ts.tpl} +0 -0
  732. /package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/{revoke-invitation.controller.ts.tpl → revoke-invitation.controller.kit-routes.ts.tpl} +0 -0
  733. /package/templates/presets/identity/context/presentation/http/organisations/search-members/{search-members.controller.ts.tpl → search-members.controller.kit-routes.ts.tpl} +0 -0
  734. /package/templates/presets/identity/context/test/unit/{accept-invitation.controller.spec.ts.tpl → accept-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  735. /package/templates/presets/identity/context/test/unit/{change-member-role.controller.spec.ts.tpl → change-member-role.controller.spec.kit-routes.ts.tpl} +0 -0
  736. /package/templates/presets/identity/context/test/unit/{deactivate-account.controller.spec.ts.tpl → deactivate-account.controller.spec.kit-routes.ts.tpl} +0 -0
  737. /package/templates/presets/identity/context/test/unit/{decline-invitation.controller.spec.ts.tpl → decline-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  738. /package/templates/presets/identity/context/test/unit/{grant-delegation.controller.spec.ts.tpl → grant-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
  739. /package/templates/presets/identity/context/test/unit/{invite-member.controller.spec.ts.tpl → invite-member.controller.spec.kit-routes.ts.tpl} +0 -0
  740. /package/templates/presets/identity/context/test/unit/{open-organisation.controller.spec.ts.tpl → open-organisation.controller.spec.kit-routes.ts.tpl} +0 -0
  741. /package/templates/presets/identity/context/test/unit/{provision-account.controller.spec.ts.tpl → provision-account.controller.spec.kit-routes.ts.tpl} +0 -0
  742. /package/templates/presets/identity/context/test/unit/{remove-member.controller.spec.ts.tpl → remove-member.controller.spec.kit-routes.ts.tpl} +0 -0
  743. /package/templates/presets/identity/context/test/unit/{revoke-delegation.controller.spec.ts.tpl → revoke-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
  744. /package/templates/presets/identity/context/test/unit/{revoke-invitation.controller.spec.ts.tpl → revoke-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  745. /package/templates/presets/identity/context/test/unit/{search-members.controller.spec.ts.tpl → search-members.controller.spec.kit-routes.ts.tpl} +0 -0
  746. /package/templates/presets/identity/context/test/worlds/{__context__.world.ts.tpl → __context__.world.declared.ts.tpl} +0 -0
package/README.fr.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [English](README.md) · **Français**
2
- <!-- translation-of: README.md sha256:431355ccfd0abdd4 -->
2
+ <!-- translation-of: README.md sha256:f9728c17b021be67 -->
3
3
 
4
4
  # ddd-ts-kit
5
5
 
@@ -61,14 +61,14 @@ ddd-ts-kit init [--http express|fastify|hono|nest|none]
61
61
  [--database postgres|mysql|sqlite|none]
62
62
  [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]
63
63
  [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]
64
- [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]
64
+ [--authn jwt|keycloak|passport|none] [--authz rbac|abac|rebac|custom]
65
65
  [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis]
66
66
  [--http-cache none|varnish] [--storage local|s3|none] [--audit on|off]
67
67
  [--event-sourcing on|off] [--privacy on|off]
68
68
  [--errors none|sentry] [--logger stdout|pino|winston]
69
69
  [--style declared|explicit] [--assembly barrel|discovery]
70
70
  [--dependencies signature|listed] [--refusals named|factories|classes]
71
- [--routes controllers|functions] [--value-objects throwing|result]
71
+ [--routes controllers|functions|nest] [--value-objects throwing|result]
72
72
  [--literals named|free] [--values classes|free] [--tenancy none|shared-table]
73
73
  [--queue database|redis|memory]
74
74
  [--schemas shared|per-route]
@@ -88,7 +88,11 @@ générés tels que les scripts du projet les écrivent pour un projet qui n'a e
88
88
  que le premier *commit* les contienne et que `docs:check` passe d'emblée ; un contrat déjà
89
89
  présent est laissé tel quel, `--force` compris. Un `package.json` existant est fusionné : les
90
90
  scripts et les dépendances qui manquent sont ajoutés, les vôtres sont gardés et mentionnés dans
91
- les notes. Relancé plus tard, `init` garde la *stack* enregistrée dans la configuration.
91
+ les notes. La première fois, les notes nomment aussi chaque dépendance que la *stack* sur le
92
+ point d'être écrite contredit, et l'option qui la garde (`package.json depends on fastify, and the
93
+ project is written for --http express: pass --http fastify to keep it.`), en *dry run* compris :
94
+ lancez d'abord `init --dry-run` sur un projet existant. Relancé plus tard, `init` garde la
95
+ *stack* enregistrée dans la configuration.
92
96
 
93
97
  `init --force` sur un projet déjà initialisé réécrit les fichiers qui appartiennent à `init` et
94
98
  garde la configuration : les contextes et leurs amonts, les règles, les limites, les dérogations
@@ -120,8 +124,9 @@ Un import d'un fichier du projet s'écrit sans extension
120
124
  émis. Une configuration sans cette clé se lit comme `js`, si bien qu'un projet généré avant
121
125
  l'existence de la clé garde son écriture. Voir [docs/CONFIG.fr.md](../../docs/CONFIG.fr.md).
122
126
 
123
- Valeurs par défaut : `express`, `zod`, `tsyringe` (`nest` avec `--http nest`, et seulement
124
- alors), `vitest`, `drizzle` sur `postgres`, `outbox` quand il y a un ORM, `swagger`, `github`,
127
+ Valeurs par défaut : `express`, `zod` (`class-validator` avec `--http nest`, comme Nest valide),
128
+ `tsyringe` (`nest` avec `--http nest`, et seulement alors), des routes écrites en contrôleurs du
129
+ kit (des contrôleurs Nest avec `--http nest` sur class-validator, `--routes nest`), `vitest`, `drizzle` sur `postgres`, `outbox` quand il y a un ORM, `swagger`, `github`,
125
130
  `jwt`, `rbac`, aucun *broker*, le cache dans le processus, les fichiers dans un répertoire local
126
131
  (`--storage local`), le journal d'audit `on` quand il y a un ORM, les demandes d'une personne concernée traitées (`--privacy on`) quand il y a un ORM, pas d'event store (`--event-sourcing off`), les échecs inattendus remontés
127
132
  nulle part (`--errors none`), des lignes JSON sur la sortie standard (`--logger stdout`), et le
@@ -469,7 +474,9 @@ réponse d'identifiant comprise, comme 0.1 à 0.5 les écrivaient.
469
474
  `generate value-object` écrit un `create` qui renvoie l'objet-valeur ou lève le refus de son
470
475
  concept, et une *spec* qui le vérifie avec `expectRefusal(() => ..)`. `--value-objects result`,
471
476
  ou une configuration sans la clé, garde un `create` qui renvoie un `Result` que l'appelant
472
- déballe, comme 0.1 à 0.5 l'écrivaient ; `value-objects` fait passer un projet de l'un à l'autre.
477
+ déballe, comme 0.1 à 0.5 l'écrivaient ; `value-objects` fait passer un projet de l'un à l'autre. `generate property`
478
+ écrit les lois d'un *value object* existant comme une *spec* sur des valeurs générées, sous
479
+ l'une ou l'autre forme, et ajoute `fast-check` aux dépendances de développement s'il manque.
473
480
 
474
481
  **Les événements du domaine partent avec la sauvegarde.** Un gestionnaire de commande généré
475
482
  construit ou charge son agrégat, appelle une méthode d'intention, `await repository.save(aggregate)`
@@ -556,22 +563,22 @@ choix sont enregistrés sous `stack` dans la configuration, `docsUi`, `ci` et `l
556
563
  | traçage | câblé une fois, par la plateforme (`tracing/platform-only`) : pas de *hook* `decorate`, pas de `decorate-bindings.ts`. `tracing.ts` démarre `initTracing` de `@ddd-ts-kit/tracing/node` avant tout autre module, sur ce que valide `config/read-tracing.ts` : `OTEL_EXPORTER_OTLP_ENDPOINT` (une URL ; absente, aucun *span* ne sort du processus), `TRACE_SAMPLE_RATIO` (de 0 à 1) et `TRACE_CONSUMERS` (`continue`, par défaut : un événement consommé reste dans la trace de sa publication ; `link` : chaque livraison démarre une trace liée à elle). Avec `--di tsyringe` : `lay-foundations.ts` construit `traceApplication({ consumers })`, `compose-application.ts` la remet à `kernelModule({ instrumentation })` (un *span* par cas d'usage, appel de *repository*, événement du domaine, publication, consommateur et *job*) et donne au relais de l'outbox `tracedPublisher(bus)`. En câblage manuel : `create-platform.ts` applique lui-même les membres de `traceApplication()` (`useCase` sur les deux bus, `domainEvents`, `publisher`, `binding` autour de chaque adaptateur, `job`, `executionScope`, `errorReporter`), avec `tracedSubscriber` et `tracedPublisher` autour du fournisseur. Avec une *stack* HTTP, dans les deux familles, `auth/authentication/http-boundary.ts` pose `around: tracedRoutes()` : un *span* `SERVER` par requête HTTP, nommé d'après sa route |
557
564
  | `--logger` | `src/platform/observability/create-logger.ts`, un par choix : `stdout` (par défaut) est le `StdoutLogger` de `@ddd-ts-kit/aspects`, des lignes JSON, identifiants de connexion non masqués ; `pino` est `createPinoLogger` de `@ddd-ts-kit/pino` (dépendances `pino` et `pino-pretty`) ; `winston` est `createWinstonLogger` de `@ddd-ts-kit/winston` ; ces deux-là masquent les clés d'identifiants de connexion du kernel. Chaque entrée porte `traceLogFields(scope)` : l'identifiant de corrélation, l'origine, l'acteur et le *tenant* du travail en cours, et les identifiants de la trace active. `LOG_LEVEL`, `LOG_FORMAT` (`json`, par défaut, ou `pretty` ; avec `stdout`, qui n'a pas de format lisible, `pretty` est refusé au chargement de la configuration) et `LOG_SCRUB_MESSAGES` (`[message removed]` à la place du message d'une erreur journalisée qui n'est pas une `DomainError`) sont validés dans `config/load-config.ts`. L'arrêt de l'application vide le tampon du *reporter* d'erreurs, puis celui du *logger*, en dernier : `container.stop()` le fait sur tsyringe, `compose-application.ts` le fait explicitement en câblage manuel. Les outils et les tests composent l'application sans `log` et n'écrivent rien |
558
565
  | `src/platform/auth/` | un dossier par question : `authentication/` (qui appelle), `authorization/` (ce qu'il peut faire, quel que soit le modèle) et le dossier du modèle que nomme `stack.authz` (`roles/`, `attributes/`, `relationships/` ou `custom/`). Un projet généré avant les dossiers garde ses fichiers à plat : les générateurs les y lisent, `npx ddd-ts-kit doctor` le signale et `npx ddd-ts-kit platform-folders` les déplace avec chaque import |
559
- | `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt` : `JwtAuthenticator` sur `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI` ; `--authn keycloak` : `keycloakAuthenticator` sur `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` et l'optionnel `KEYCLOAK_CLIENT_ID` ; `--authn none` : `development-header-authenticator.ts` et `development-actor-header.ts`, qui lisent `x-development-actor` et lèvent une erreur en production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` qui répond une `Session`, `executionScope`, `errorMapper` et `onError`, étalés dans les options de montage : chaque requête HTTP s'exécute dans la portée d'exécution, avec son identifiant de corrélation). Sans *stack* HTTP, il n'y a ni authentificateur ni frontière, ni dossier |
566
+ | `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt` : `JwtAuthenticator` sur `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI` ; `--authn keycloak` : `keycloakAuthenticator` sur `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` et l'optionnel `KEYCLOAK_CLIENT_ID` ; `--authn passport` : `passportAuthenticator` de `@ddd-ts-kit/auth/passport` sur `bearer-strategy.ts`, la stratégie de `passport-jwt` sur le jeu de clés que publie `AUTH_JWKS_URI` (`jwks-rsa`), `AUTH_ISSUER` et `AUTH_AUDIENCE`, et `actor-of-token.ts`, qui lit sa charge utile avec `actorOfClaims` ; `--authn none` : `development-header-authenticator.ts` et `development-actor-header.ts`, qui lisent `x-development-actor` et lèvent une erreur en production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` qui répond une `Session`, `executionScope`, `errorMapper` et `onError`, étalés dans les options de montage : chaque requête HTTP s'exécute dans la portée d'exécution, avec son identifiant de corrélation). Sans *stack* HTTP, il n'y a ni authentificateur ni frontière, ni dossier |
560
567
  | `src/platform/auth/authorization/` | `create-authorizer.ts`, `authorization.ts` (`authorizationModule` avec tsyringe) ou `use-case-protection.ts` (la garde des bus câblés à la main), `access-policies.ts`, `role.ts` (les rôles que porte un identifiant, avec des rôles ou des attributs, ou dès qu'une garde en nomme un), `permissions.ts` (le registre de toutes les permissions, avec des relations ou un authorizer à vous), `signed-in-grants.ts` dès qu'un *preset* de contexte accorde à toute personne connectée, et avec `--audit off` `log-decisions.ts` (une entrée de journal par décision, identifiants et codes seulement) |
561
568
  | `src/platform/auth/<modèle>/` | `roles/roles.ts` (avec le rôle `system` que détient chaque acteur système) ; `attributes/attribute-policies.ts` ; `relationships/` : `relationship-schema.ts`, `create-tuple-store.ts` et sa *spec* de contrat, `relation-tuples.ts`, `relate-system-actors.ts` ; `custom/` : `custom-authorizer.ts` et sa *spec* `authorizerContract` |
562
569
  | `--representations negotiated`, `--forms on` | `src/platform/http/presentation-of.ts` (`Representations.standard()` avec `negotiated`, et `fieldDeciderOf` sur l'`Access` de l'application), décomposé dans la frontière HTTP et donné au script du contrat ; avec `--forms on`, `src/platform/http/with-forms.ts` ajoute `formRoutes` aux routes et `scripts/openapi.ts` écrit `openapi/forms/<operationId>.json`. Les deux sont la valeur par défaut avec une *stack* HTTP ; `json` et `off` les laissent de côté ([docs/CONFIG.fr.md](../../docs/CONFIG.fr.md)) |
563
- | `--audit on` | `src/platform/audit/` : `create-audit.ts` (le journal, le `onDecision` de l'autorisation, les refus des gardes à la frontière remis à la frontière HTTP comme `onGuardRefusal`, le *middleware* avant l'unité de travail, les événements d'intégration abonnés sous le nom de consommateur `audit`), `audited-events.ts` (le registre auquel `generate integration-event` ajoute), `audit.module.ts`, et avec une *stack* HTTP le côté lecture : `audit.permissions.ts` (`audit:trail.read`), puis dans `search-audit-entries/` : `search-audit-entries.query.ts`, son gestionnaire, `search-audit-entries.route.ts` ou `.controller.ts` (`GET /audit/entries` : pages par curseur, filtres `actorId`, `action`, `outcome`, `correlationId`), qui commence par le point d'entrée et prend ce qu'il reçoit et répond dans `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` et `audit-outcomes.ts`. C'est une capacité de la plateforme, pas un contexte délimité : pas de modèle, une requête protégée sur le port `AuditReader`, bornée par le *tenant* de l'acteur (avec `--tenancy shared-table`, par le *tenant* du travail au moyen de `TenantAuditReader` : le personnel de la plateforme ne lit à travers les *tenants* qu'à l'intérieur de `acrossTenants`). Les refus d'un appelant sans identifiant de connexion ne sont pas enregistrés. Un *job* planifié est audité comme une requête HTTP : origine `schedule`, acteur `system:<context>.<job>`. Avec knex, les deux tables et leurs déclencheurs en ajout seul sont créés par la première migration ; avec drizzle, les tables sont dans `schema.ts` et `npm run db:audit-guard` affiche les instructions des déclencheurs pour une migration personnalisée ; avec prisma et typeorm, les tables sont des modèles de `prisma/schema.prisma` ou des entités de `schema.ts` (`auditPrismaModels`, `auditEntities` de `@ddd-ts-kit/audit`), écrites par `PrismaAuditTrail` et `TypeOrmAuditTrail`, et `npm run db:audit-guard` affiche les instructions des déclencheurs pour une migration écrite à la main ; les bases de test installent ce garde ; avec `custom` ou sans ORM, le journal est un `InMemoryAuditTrail` derrière un `TODO(platform)`. Les bases de test laissent le schéma d'audit hors de `reset()`. Avec le journal en base et `--storage local` ou `s3`, `audit.module.ts` (ou la composition câblée à la main) enregistre `audit.archive` le premier jour de chaque mois à 04:00 UTC : les entrées de plus de douze mois entiers partent dans le stockage sous `audit-archives/`, vérifiées, relues et ancrées (`ArchiveAuditEntries`) ; avec `s3` il tourne sauf `JOB_AUDIT_ARCHIVE_ENABLED=false`, avec `local` seulement avec `JOB_AUDIT_ARCHIVE_ENABLED=true`, puisque l'archive supprime les entrées de la base et que le disque du serveur peut ne pas durer |
570
+ | `--audit on` | `src/platform/audit/` : `create-audit.ts` (le journal, le `onDecision` de l'autorisation, les refus des gardes à la frontière remis à la frontière HTTP comme `onGuardRefusal`, le *middleware* avant l'unité de travail, les événements d'intégration abonnés sous le nom de consommateur `audit`), `audited-events.ts` (le registre auquel `generate integration-event` ajoute), `audit.module.ts`, et avec une *stack* HTTP le côté lecture : `audit.permissions.ts` (`audit:trail.read`), puis dans `search-audit-entries/` : `search-audit-entries.query.ts`, son gestionnaire, `search-audit-entries.route.ts` ou `.controller.ts` (`GET /audit/entries` : pages par curseur, filtres `actorId`, `action`, `outcome`, `correlationId`), qui commence par le point d'entrée et prend ce qu'il reçoit et répond dans `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` et `audit-outcomes.ts`. C'est une capacité de la plateforme, pas un contexte délimité : pas de modèle, une requête protégée sur le port `AuditReader`, bornée par le *tenant* de l'acteur (avec `--tenancy shared-table`, par le *tenant* du travail au moyen de `TenantAuditReader` : le personnel de la plateforme ne lit à travers les *tenants* qu'à l'intérieur de `acrossTenants`). Les refus d'un appelant sans identifiant de connexion ne sont pas enregistrés. Un *job* planifié est audité comme une requête HTTP : origine `schedule`, acteur `system:<context>.<job>`. Avec knex, les deux tables et leurs déclencheurs en ajout seul sont créés par la première migration ; avec drizzle, les tables sont dans `schema.ts` et `npm run db:generate` ajoute les instructions des déclencheurs à la migration qui crée les tables (`npm run db:audit-guard` les affiche pour une migration écrite à la main) ; avec prisma et typeorm, les tables sont des modèles de `prisma/schema.prisma` ou des entités de `schema.ts` (`auditPrismaModels`, `auditEntities` de `@ddd-ts-kit/audit`), écrites par `PrismaAuditTrail` et `TypeOrmAuditTrail`, et `npm run db:generate` (par `ddd-ts-kit prisma-generate` ou `typeorm-generate`) ajoute les instructions des déclencheurs à la migration qui crée les tables, `npm run db:audit-guard` les affichant pour une migration écrite à la main ; les bases de test installent ce garde ; avec `custom` ou sans ORM, le journal est un `InMemoryAuditTrail` derrière un `TODO(platform)`. Les bases de test laissent le schéma d'audit hors de `reset()`. Avec le journal en base et `--storage local` ou `s3`, `audit.module.ts` (ou la composition câblée à la main) enregistre `audit.archive` le premier jour de chaque mois à 04:00 UTC : les entrées de plus de douze mois entiers partent dans le stockage sous `audit-archives/`, vérifiées, relues et ancrées (`ArchiveAuditEntries`) ; avec `s3` il tourne sauf `JOB_AUDIT_ARCHIVE_ENABLED=false`, avec `local` seulement avec `JOB_AUDIT_ARCHIVE_ENABLED=true`, puisque l'archive supprime les entrées de la base et que le disque du serveur peut ne pas durer |
564
571
  | `--event-sourcing on` | enregistré comme `stack.eventSourcing`, `off` sauf demande : `Persistence` gagne `eventSourcing` (`create<Orm>EventSourcing` dans le schéma `event_store`, dont le fichier de schéma déclare les cinq tables ; les stores en mémoire avec `--orm none`), et `src/platform/event-sourcing/` : `create-event-sourcing.ts` (`EventSourcing` : les stores, le `SubjectKeyStore` enveloppé par `auditedSubjectKeys` avec `--audit on`, et le `PersonalDataCipher` par-dessus) et, avec tsyringe, `event-sourcing.module.ts` (lie `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` et `PersonalDataCipher`, pour qu'un adaptateur de *repository* *event-sourced* les nomme dans son constructeur ; la `Platform` câblée à la main les porte comme `platform.eventSourcing`) ; `platform-test.module.ts` lie les stores en mémoire, pour qu'une *spec* de gestionnaire d'un agrégat *event-sourced* n'ait besoin d'aucun *fake*. `generate aggregate --event-sourced` est refusé sans lui, avec le `init --force --event-sourcing on` à lancer. Refusé avec `--orm custom` : l'event store du kit tourne sur PostgreSQL par les quatre paquets d'ORM |
565
572
  | `--privacy on` | enregistré comme `stack.privacy`, `on` quand il y a un ORM : `src/platform/privacy/`, avec `data-subject-copies.ts` et `data-subject-exports.ts` (les ports, ou les adaptateurs à la main, des contextes qui étendent `PersonalDataErasure` et `PersonalDataExport`, entre marqueurs ; `generate repository --personal` y liste l'effacement et l'export d'un contexte), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, tenants? })` : un contexte d'exécution d'origine `cli` avec l'opérateur pour acteur, la clé de la personne quand le projet a un event store, puis `eraseDataSubject` du kernel sur les copies, `inEachTenant` avec `--tenancy shared-table`, puis `privacy.data-subject.erased` publié par l'outbox, une fois par *tenant*) et `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })` : `exportDataSubject` du kernel sur les exports, chacun enveloppé par `auditedPersonalDataExport` avec `--audit on`, `recordsInEachTenant` avec `--tenancy shared-table`, un `PersonalDataExportDocument` daté), et les deux scripts ci-dessous. `docs/privacy/register.md`, le registre des données personnelles que `ddd-ts-kit docs` tient (voir `docs` plus bas). Un projet sans donnée personnelle prend `--privacy off` et ne paie rien. Aucune commande HTTP n'efface encore : les deux scripts sont les points d'entrée |
566
573
  | `--tenancy shared-table` | enregistré comme `stack.tenancy` ; les quatre ORM. Chaque `generate repository` est cloisonné par *tenant* (comme `--tenant-scoped`), au moyen de `tenantTable` et `ownTenantTable` (Knex), de `tenantCondition` et `ownTenantCondition` (Drizzle), de `tenantWhere` et `ownTenantWhere` (Prisma, TypeORM) ; l'outbox garde le *tenant* de chaque événement (`createOutboxTables(knex, { tenant: true })` et le `tenant: true` de `KnexOutboxStore`, `tenantOutboxTable`, le champ `tenantId` du modèle Prisma et le `tenant: true` de `PrismaOutboxStore`, `outboxEntity({ tenant: true })`), si bien que les consommateurs s'exécutent dans ce *tenant* ; `tenancy/scoped-statement` juge les adaptateurs. La sécurité au niveau des lignes, un schéma par *tenant* et une base par *tenant* sont refusés, avec ce qu'il faut câbler à la main ([Multitenance](../../docs/concepts/multitenancy.fr.md)) |
567
- | `--queue database\|redis\|memory` | enregistré comme `stack.queue`. `database` (par défaut sur Knex ou Drizzle avec tsyringe) : `createJobTable` et `createProcessTable`, ou `jobsTable` et `processesTable`, dans le schéma `messaging`, `Persistence` gagne `jobs` et `processes`, et la plateforme relie `JobStore` et `ProcessStore` à eux (le module de la plateforme sur tsyringe, `jobs/create-background-work.ts` là où la plateforme est câblée à la main), si bien qu'un *job* mis en file par une commande est écrit dans sa transaction ; `redis` (avec `--cache redis`) : `RedisJobStore` sur la connexion du cache, les processus dans la base de données ; `memory` (par défaut sinon) : rien n'est écrit, les deux restent dans le processus. Refusé : `database` avec un autre ORM, `redis` sans le cache |
574
+ | `--queue database\|redis\|memory` | enregistré comme `stack.queue`. `database` (par défaut sur Knex, Drizzle, Prisma et TypeORM, quel que soit le conteneur) : les tables du *package* de l'ORM (`createJobTable` et `createProcessTable`, `jobsTable` et `processesTable`, les modèles `BackgroundJob` et `ProcessInstance`, `jobEntity` et `processEntity`) dans le schéma `messaging`, `Persistence` gagne `jobs` et `processes`, et la plateforme relie `JobStore` et `ProcessStore` à eux (le module de la plateforme sur tsyringe, `jobs/create-background-work.ts` là où la plateforme est câblée à la main ou sous Nest), si bien qu'un *job* mis en file par une commande est écrit dans sa transaction ; `redis` (avec `--cache redis`) : `RedisJobStore` sur la connexion du cache, les processus dans la base de données ; `memory` (par défaut avec une persistance sur mesure ou sans persistance) : rien n'est écrit, les deux restent dans le processus. Refusé : `database` avec un autre ORM, `redis` sans le cache |
568
575
  | `--cache redis` | `src/platform/redis/open-redis.ts` (`RedisServices` : le cache lié au `Cache` du kernel, le limiteur à `RateLimiter`, le verrou à `Lock`, qui réserve un *job* planifié à une seule instance, le signal du relais comme `wakeOn` du relais de l'outbox avec `relayWakeUpMiddleware` sur le bus de commandes), `http/too-many-requests-for.ts` (une fenêtre glissante par adresse d'appelant, 429 `application/problem+json` avec `retry-after` ; `RATE_LIMIT_MAX`, `RATE_LIMIT_WINDOW_MS`), `GET /health/ready` sur le serveur HTTP, `REDIS_URL` validée, un service compose `cache` qui exécute Dragonfly avec un contrôle de santé. Sans serveur (outils, tests sans `REDIS_URL`), les mêmes ports restent dans la mémoire du processus |
569
576
  | `--http-cache varnish` | un service compose `varnish` (Varnish 9.1.0, qui joint l'API sur `host.docker.internal`) avec son VCL dans `docker/varnish/default.vcl` (seules les réponses dont le `Cache-Control` les autorise par `max-age` ou `s-maxage` sont gardées, rangées sous leurs étiquettes `xkey`, purgées par `PURGE` depuis la machine de Varnish ou avec `VARNISH_PURGE_KEY`, `x-cache: HIT\|MISS`), `VARNISH_URL` et `VARNISH_PURGE_KEY` validées, `cacheTags: { header: CacheTagHeader.xkey }` dans la frontière HTTP, et le relais de l'outbox de `main.ts` et de chaque point d'entrée de `generate service` qui publie au moyen de `PurgingPublisher` avec `VarnishCachePurger` (l'application de bout en bout enregistre les purges dans `purges`) ; sur `--di manual` et `nest`, la plateforme gagne `cacheInvalidation` ; avec `--tenancy`, les étiquettes des réponses et les purges sont rangées sous le *tenant* (`perTenant`) et le *tenant* d'une requête HTTP est lu dans `x-tenant-id`. Demande un framework HTTP et `--events outbox` : une purge est une ligne de l'outbox |
570
577
  | `--errors sentry` | les échecs inattendus remontés à Sentry ou à GlitchTip (un seul protocole, seul le DSN diffère) au moyen de l'`ErrorReporter` du kernel, lié à `@ddd-ts-kit/sentry`. `src/platform/observability/errors.ts` (`initSentry` sur la configuration validée, puis `reportProcessFailures`), le deuxième import de `main.ts`, de `apps/<context>/main.ts` et de `apps/worker/main.ts`, juste après `tracing.ts` ; `errors` remis à `composeApplication`, qui le donne au module du kernel sur tsyringe (`errorReporter`, vidé par `container.stop()` avant le *logger*, `errorReportingMiddleware` en premier sur les deux bus, le planificateur par défaut qui observe avec `reportFailedRuns`) ou à `createPlatform` à la main (le même *middleware*, `onRun: reportFailedRuns(errors)`, `platform.errors`, vidé en deux secondes au plus quand l'application s'arrête) ; `reportHttpErrors` dans `auth/authentication/http-boundary.ts` pour chaque requête HTTP qui reçoit une réponse 5xx ; `DeadLetterReports` sur le *hook* `onFailure` d'un *broker* fourni (`createEventProvider(config, errors)`, avec `observing` autour de chaque consommateur) et du relais de l'outbox. `SENTRY_DSN`, `SENTRY_ENVIRONMENT` (par défaut : `NODE_ENV`), `SENTRY_RELEASE` et `SENTRY_SCRUB_MESSAGES` validées dans `config/load-config.ts` comme `errorReporting` : sans DSN, l'application démarre et ne remonte rien ; un DSN qui n'est pas une URL refuse le démarrage. Dépendances `@ddd-ts-kit/sentry` et `@sentry/node`. Un profil compose `errors` qui exécute GlitchTip 6.2.6 avec son propre PostgreSQL et son propre Valkey (`GLITCHTIP_PORT`, sur la boucle locale seulement, amorçage de développement), et une section du README généré qui dit comment lire son DSN. Les outils et les tests composent l'application sans *reporter*. Il va avec tous les autres choix de la *stack* ; avec `--errors none`, rien de tout cela n'est écrit |
571
578
  | `--authn keycloak` | un service compose `keycloak` (Keycloak 26.8.0, `start-dev --import-realm`, profil `identity`) et `docker/keycloak/<project>-realm.json` : le client de l'API, un client public `<project>-local` avec l'octroi direct, ses *mappers* d'audience et de `tenant_id`, le rôle de realm `admin`, et les utilisateurs de démonstration `demo-admin` et `demo-user`, pour le développement local seulement |
572
579
  | `--storage local\|s3` | enregistré comme `stack.storage` : où vit le contenu des fichiers, jamais dans la base de données. `src/platform/config/read-files.ts` et `src/platform/files/open-files.ts`, un par choix : `local`, un répertoire en développement (`FILES_DIRECTORY`, `.data/files`) et les liens signés servis par l'application sous `/files` (`FILES_PUBLIC_URL` et `FILES_SIGNING_SECRET` requises en production) ; `s3`, un bucket de n'importe quel fournisseur du protocole S3 au moyen de `@ddd-ts-kit/s3` (les variables `S3_*`, MinIO dans la stack compose) ; la mémoire du processus dans les tests et les outils, dans les deux cas. Avec `--di tsyringe` : `files/bind-files.ts`, `files/files.module.ts` et `files/staging-uploads.ts` ; en câblage manuel, `files/create-files.ts` ; avec une *stack* HTTP, `files/file-routes.ts`. Ils lient `FileStorage`, `FileKeys`, `FileScanner` et `FileStaging`, enregistrent la purge horaire des fichiers en attente et mettent en attente le fichier que porte une commande avant sa transaction ; `generate file-upload` en a besoin. `--storage none` n'écrit rien de tout cela ([Stockage de fichiers](../../docs/concepts/file-storage.fr.md)) |
573
580
  | `src/platform/events/` | `event-provider.ts` (`bus`, `forConsumer(name)`, `start()`, `close()`), `in-process-events.ts`, et pour `--broker` `create-event-provider.ts` : `RabbitMqEventBus` (`AMQP_URL`), `KafkaEventBus` (`KAFKA_BROKERS`, avec `aggregate-key-of.ts` pour l'ordre par agrégat), `NatsEventBus` (`NATS_URL`) ou `RedisStreamsEventBus` de `@ddd-ts-kit/redis/event-bus` (`REDIS_URL` : Redis, Dragonfly ou Valkey), chacun avec un abonné par contexte consommateur (`forConsumer`), `assertTopology` au démarrage, son adresse validée et un service compose avec un contrôle de santé ; ou `custom-event-bus.ts` avec sa *spec* `eventBusContract`. `start-outbox-relay.ts` avec l'outbox. `--broker redis` avec `--cache redis` fait un seul serveur et un seul service compose, `cache` ; seul, le service s'appelle `streams` |
574
- | `src/platform/database/` | `persistence.ts` (`interface Persistence` : unité de travail, magasins de l'outbox et des événements traités du *package* de l'ORM, la poignée de stockage), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, la connexion (`connect-to-database.ts`, `create-client.ts` ou `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, le schéma de ce que le kit stocke pour l'application), `open-test-database.ts` (PostgreSQL dans le processus, ou le serveur nommé par une URL ; avec Vitest chaque *spec* ouvre une copie du cluster que `test/support/test-database-template.ts`, la mise en place globale de l'exécution, initialise une fois, et y crée ses tables ; avec drizzle depuis `table-statements.ts`, le SQL des tables de `schema.ts`, puisque drizzle-kit écrit des migrations, pas des tables). La classe de stockage qu'un adaptateur de *repository* nomme dans sa liste de dépendances : `database.ts` avec drizzle et prisma (`abstract class Database extends` le type de contexte du *package* de l'ORM), `KnexContext` de `@ddd-ts-kit/knex`, `TypeOrmContext` de `@ddd-ts-kit/typeorm` |
581
+ | `src/platform/database/` | `persistence.ts` (`interface Persistence` : unité de travail, magasins de l'outbox et des événements traités du *package* de l'ORM, la poignée de stockage), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, la connexion (`connect-to-database.ts`, `create-client.ts` ou `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, le schéma de ce que le kit stocke pour l'application), `open-test-database.ts` (PostgreSQL dans le processus, ou le serveur nommé par une URL ; avec Vitest chaque *spec* ouvre une copie du cluster que `test/support/test-database-template.ts`, la mise en place globale de l'exécution, initialise une fois, et y crée ses tables ; avec drizzle depuis `table-statements.ts`, le SQL des tables de `schema.ts`, puisque drizzle-kit écrit des migrations, pas des tables, ses index uniques compris), `persistence.contract.spec.ts` (les stores de l'outbox, des événements traités, des *jobs* et des processus tels que la plateforme les branche, tenus aux contrats de `@ddd-ts-kit/testing` avec ce que la pile active : le *tenant* sous `--tenancy`, l'unité de travail). La classe de stockage qu'un adaptateur de *repository* nomme dans sa liste de dépendances : `database.ts` avec drizzle et prisma (`abstract class Database extends` le type de contexte du *package* de l'ORM), `KnexContext` de `@ddd-ts-kit/knex`, `TypeOrmContext` de `@ddd-ts-kit/typeorm` |
575
582
  | outillage des migrations | `drizzle.config.ts`, `knexfile.js` et `migrations/00000000000000_initial.js`, `prisma/schema.prisma` et `prisma.config.ts`, ou `data-source.ts` |
576
583
  | `scripts/openapi.ts`, `scripts/events.ts` | écrivent `openapi/openapi.yaml` (un fichier par document de `openapi.documents`), `docs/integration/asyncapi.yaml` et `docs/integration/event-catalog.md`, en JSON sous `openapi.format: json` ; `--check` échoue sur une différence |
577
584
  | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | avec `--privacy on`, les deux demandes d'une personne concernée, traitées en ligne de commande sur les sources avec les variables de `.env` (`npm run privacy:erase -- <subject-id> [--operator <qui-demande>]`, `npm run privacy:export -- <subject-id> > export.json`) : l'effacement détruit d'abord la clé de la personne quand le projet a un event store (`--event-sourcing on` : ses événements stockés se lisent effacés ; audité avec `--audit on`), puis efface chaque copie listée dans `src/platform/privacy/data-subject-copies.ts` ; `privacy:purge` lance à la main ce que le *job* `privacy.purge-expired` lance chaque nuit à 03:00 UTC, la purge de ce qui a dépassé sa durée de conservation (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` coupe le *job*) ; l'export rassemble chaque enregistrement listé dans `data-subject-exports.ts` en un document JSON daté (`format`, `subject`, `exportedAt`, `records`), l'export de chaque contexte audité avec `--audit on`, jamais les valeurs (chaque exécution laisse son entrée, un essai compris : essayez-le sur une personne de test). Avec `--tenancy shared-table`, `TENANTS` nomme les tenants, séparés par des virgules : une écriture de données de tenant n'est jamais élargie. Ni l'un ni l'autre n'atteint les sauvegardes, les journaux ou une copie qu'aucun contexte n'a déclarée |
@@ -664,7 +671,7 @@ quoi que dise `--authz` : l'attribution `'identity:*'` de `platform/auth/authori
664
671
  le *preset* écrit, et avec `--authn keycloak` l'authentificateur lit le *claim* `organization`
665
672
  comme les *tenants* de la personne (un autre authentificateur reçoit une étape suivante qui dit
666
673
  quoi faire correspondre). Le *preset* est écrit pour `declared` avec les dépendances `signature`,
667
- `factories`, les objets-valeurs `throwing`, `controllers`, Knex ou Drizzle sur PostgreSQL, Zod ou
674
+ `factories`, les objets-valeurs `throwing`, les routes `controllers` ou `nest` (des contrôleurs Nest, lus dans leurs signatures, sur un projet Nest), Knex ou Drizzle sur PostgreSQL, Zod ou
668
675
  class-validator, Express ou Fastify, et un vérificateur de jeton (`jwt` ou `keycloak`) ; une
669
676
  autre *stack* est refusée avec ce qu'il faut changer, de même qu'un second contexte écrit depuis
670
677
  le même *preset*. Pourquoi, et quels autres contextes en méritent un :
@@ -712,7 +719,7 @@ Next, in this order: the language of the context first, then the business decisi
712
719
  | Genre | Arguments | Écrit |
713
720
  |---|---|---|
714
721
  | `context` | `<name> --classification <c> [--purpose "<two sentences>"] [--term ...]... [--upstream <ctx>[:relationship]]... [--preset identity]` | `CONTEXT.md` avec son glossaire, `published-language/index.ts`, l'entrée de configuration, l'enregistrement dans `platform/composition/compose-application.ts` et dans `test/architecture/extractable.spec.ts` ; sur tsyringe, avec HTTP, `presentation/http/<name>.routes.ts` (une fonction des deux bus, dans les deux styles) ; déclaré : le barrel `<name>.declarations.ts` ; explicite et câblage manuel : `<name>.module.ts`. `<name>.permissions.ts`, à la racine du contexte, naît avec la première permission, ou tout de suite quand `platform/auth/authorization/permissions.ts` liste les ensembles de permissions (rebac, custom). Avec `--preset`, le contexte est ensuite écrit en entier depuis ce *preset*, sa classification et son objet étant ceux du *preset* sauf si les options disent autre chose ([Presets](#presets)) |
715
- | `aggregate` | `<context> <Name> [--event-sourced]` | agrégat, *builder*, *spec* sur le modèle étant donné / quand / alors ; avec `--event-sourced`, un agrégat sur `EventSourcedAggregate` dont l'état est le rejeu de ses événements, né avec son événement du domaine `Created`, le codec de ses événements stockés dans `infrastructure/persistence/<name>-events.mapper.ts`, un *builder* qui rejoue un historique et une *spec* à partir d'événements donnés, et une note qui nomme le `EventSourcedRepository` auquel délègue son adaptateur de *repository* ; refusé tant que `stack.eventSourcing` est `off`, avec le `init --force --event-sourcing on` à lancer |
722
+ | `aggregate` | `<context> <Name> [--event-sourced [--birth <Event>]]` | agrégat, *builder*, *spec* sur le modèle étant donné / quand / alors ; avec `--event-sourced`, un agrégat sur `EventSourcedAggregate` dont l'état est le rejeu de ses événements, né avec son événement du domaine `Created` (ou le fait que nomme `--birth <Event>`, vérifié contre le glossaire), le codec de ses événements stockés dans `infrastructure/persistence/<name>-events.mapper.ts`, un *builder* qui rejoue un historique et une *spec* à partir d'événements donnés, et une note qui nomme le `EventSourcedRepository` auquel délègue son adaptateur de *repository* ; refusé tant que `stack.eventSourcing` est `off`, avec le `init --force --event-sourcing on` à lancer |
716
723
  | `builder` | `<context> <Aggregate>` | `test/builders/<name>.builder.ts`, une classe qui étend `Builder` |
717
724
  | `test-world` | `<context> [Name]` | `test/worlds/<name>.world.ts` (le nom est par défaut celui du contexte) : `a<Name>World({ now, idPrefix, given })`, la mise en place que partagent plusieurs *specs* du contexte. Il lit les *fakes* de `test/fakes/` et le port que chacun implémente, les construit, les passe à `given` pour que la *spec* enregistre ce dont elle part, puis à l'application de test (avec `modules`, l'autorisation de la *spec*) ou, câblé à la main, enveloppe les *repositories* des bus de `createTestBuses` par `dispatching` ; il rend chaque *fake* sous le nom de son port. Un *fake* qui attend des arguments de constructeur, ou, avec un conteneur, celui d'un port que rien ne lie ni n'utilise encore, est laissé de côté avec une note |
718
725
  | `entity` | `<context> <Name>` | entité, *spec* |
@@ -723,7 +730,7 @@ Next, in this order: the language of the context first, then the business decisi
723
730
  | `domain-error` | `<context> <Name> [--code CODE]` | une classe par erreur avec un code stable, *spec* : la forme d'un projet dont la configuration dit `"stack.refusals": "classes"` ou rien. Refusé sous `named` et `factories`, avec la commande `generate error` à lancer à la place |
724
731
  | `domain-service` | `<context> <Name>` | service, *spec* |
725
732
  | `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 |
726
- | `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. 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 |
733
+ | `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 |
727
734
  | `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 |
728
735
  | `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 |
729
736
  | `port` | `<context> <Name>` | `application/ports/<name>.port.ts`, une classe abstraite, et son *fake* |
@@ -1848,7 +1855,10 @@ Une ligne insérée entre des lignes de la base que l'autre côté n'a pas touch
1848
1855
  même quand l'autre côté a inséré au même endroit : perdre l'une de deux nouvelles méthodes est la
1849
1856
  perte que le contrôle cherche. De même pour une réécriture qui a perdu plus de lignes que les
1850
1857
  lignes de la base ou que la réécriture de l'autre côté qu'elle concurrençait (une modification
1851
- suivie d'une nouvelle méthode). Ce qu'un côté a supprimé, ou rouvert, n'est jamais signalé. Une
1858
+ suivie d'une nouvelle méthode). Ce qu'un côté a supprimé, ou rouvert, n'est jamais signalé. Une ligne de la branche dans un fichier
1859
+ que la branche n'a pas touché depuis sa bifurcation de la branche principale (le fichier est le même sur
1860
+ la branche et à `git merge-base`) ne l'est pas non plus : ce que la branche principale y a supprimé ou
1861
+ remplacé depuis est son propre changement, quelle que soit la base du calcul de la fusion. Une
1852
1862
  suppression voulue se consigne dans le *commit* de fusion par un *trailer*
1853
1863
  `Lost-Accepted: <file:line>,...` (un fichier seul accepte toutes ses lignes) : ces constats sont
1854
1864
  listés et ne font jamais échouer. Pour une fusion plus ancienne que HEAD, un constat que HEAD ne
@@ -2027,6 +2037,7 @@ ajoute, `lint` ce qu'elle ajoute à ESLint ; les *pipelines* générés câblent
2027
2037
  ```
2028
2038
  ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab]
2029
2039
  [--changed-since <git-ref>] [--explain] [--self]
2040
+ ddd-ts-kit check --baseline write|prune
2030
2041
  ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]
2031
2042
  ddd-ts-kit check --commit-size [--staged] [--strict]
2032
2043
  ```
@@ -2087,6 +2098,26 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
2087
2098
  règle.
2088
2099
 
2089
2100
  - `paths` et `--changed-since` limitent ce qui est signalé, pas ce qui est analysé.
2101
+ - `--baseline write` consigne les erreurs qu'un projet a déjà, comptées par fichier et par règle,
2102
+ dans `ddd-ts-kit-baseline.json` (la forme de `eslint-suppressions.json`), pour un code existant
2103
+ qui adopte le kit ; commitez-le. Dès lors, `check` et `check-file` (le *hook* de l'agent) taisent
2104
+ les erreurs d'une règle dans un fichier tant qu'elles ne dépassent pas ce que la *baseline*
2105
+ consigne, et les signalent toutes dès qu'elles le dépassent ; `check` échoue quand un compte
2106
+ consigné n'est plus atteint, jusqu'à ce que `--baseline prune` l'abaisse, pour que la *baseline*
2107
+ ne fasse que rétrécir. Les avertissements ne sont pas consignés : ils ne font rien échouer.
2108
+ Écrire une *baseline* est une décision du *owner* du projet, qui lance `--baseline write` dans
2109
+ un terminal : la garde du *plugin* refuse la commande et toute modification directe du fichier
2110
+ à un agent, sous Claude Code, Codex et Copilot de la même façon, et les permissions qu'écrit
2111
+ `init` demandent avant les deux pour un agent sans le *plugin*. Une commande que la garde ne lit
2112
+ pas (un script du projet qui écrit le fichier) n'est pas interceptée : la revue lit le *diff*
2113
+ de la *baseline*, qui ne doit que rétrécir. `--baseline prune` ne demande personne. Un fichier
2114
+ déplacé garde ses comptes : les commandes du kit qui déplacent des fichiers (`move-to-module`,
2115
+ `context-layout`, `platform-folders`) portent son entrée au nouveau chemin, et `--baseline
2116
+ prune` suit les renommages que git voit depuis le commit de la *baseline* (un `git mv`) ; un
2117
+ fichier déplacé autrement signale ses erreurs à son nouveau chemin, et son ancienne entrée
2118
+ échoue jusqu'à ce que le propriétaire réécrive la *baseline*. Une
2119
+ *baseline* fait taire les anciennes erreurs ; elle ne rend pas vérifiable une arborescence hors
2120
+ de l'arborescence canonique.
2090
2121
  `--changed-since` lance `git diff --name-only --relative <ref>...` dans le projet.
2091
2122
  - `--format github` affiche des annotations `::error file=...,line=...::`.
2092
2123
  - `--explain` fait suivre les violations de chaque règle qu'elles signalent, une fois, avec sa
@@ -2192,6 +2223,8 @@ règle.
2192
2223
  | `authz/fields-by-schema` | sous `application/queries/` : `roles.includes(`, `.some(`, `.every(`, `.find(`, `.indexOf(`, une comparaison avec un `role`, `isAdmin` |
2193
2224
  | `aspects/outside-in` | un import de `@ddd-ts-kit/aspects/decorators` hors de `infrastructure/` d'un contexte et du répertoire de la plateforme : `presentation/`, le fichier de module, `published-language/`, le noyau partagé, `main.ts`, toute autre source (`domain/` et `application/` sont signalés par les deux règles `layer/*` à la place) |
2194
2225
  | `tracing/platform-only` | un import de `@ddd-ts-kit/tracing` ou d'un *package* `@opentelemetry/*` hors du répertoire de la plateforme, de `main.ts` et de `apps/`, tests compris |
2226
+ | `nest/no-parallel-pipeline` | dans `presentation/`, `infrastructure/` ou le fichier de module d'un contexte, tests à part : un import d'un contrôleur que Nest sert (ses décorateurs de route et de paramètres, sauf si le fichier importe `KitRoute` ou `KitRoutes` de `@ddd-ts-kit/http/nest`), de la requête ou de la réponse brutes, d'un *guard*, d'un *pipe*, d'un filtre d'exceptions ou d'une `HttpException`, d'un intercepteur ou du `Logger` de `@nestjs/common`, un import sans nom de celui-ci, ou un import d'un *package* de Nest dont le kit fait le travail (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` et les autres de la section 3 d'ARCHITECTURE.md) ; le message dit ce que le kit fait à sa place ; sous la racine des sources hors des contextes, tests à part : un fichier qui importe `Controller` de `@nestjs/common`, ni `KitRoute` ni `KitRoutes`, et nomme `CommandBus` ou `QueryBus` ou importe un fichier d'un contexte |
2227
+ | `nest/controllers-current` | avec `"stack.routes": "nest"` : un `<context>.controllers.ts` qui diffère de ce que donnent les contrôleurs Nest du contexte et les signatures de leurs méthodes, ou absent ; une partie de la requête prise entière par aucune classe DTO et que `request` de `@KitRoute` ne donne pas ; une méthode de route qui ne répond ni une classe DTO, ni `Accepted`, ni `void`, et ne déclare pas de `response` dans `@KitRoute` |
2195
2228
  | `tenancy/scoped-statement` | avec `stack.tenancy` autre que `none`, dans `infrastructure/` d'un contexte, tests mis à part : sur Knex, l'exécuteur utilisé autrement que comme argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) et tout `.raw(` ; sur Drizzle, instruction par instruction, une lecture, une mise à jour ou une suppression sur l'exécuteur dont le where n'a ni `tenantCondition(` ni `ownTenantCondition(` (en ligne ou dans la variable locale qu'il reçoit), une insertion dont la ligne n'a pas de `tenantScopeOf(`, une requête relationnelle (`executor().query`), un `execute(` brut, ou l'exécuteur gardé dans une variable ; sur Prisma, instruction par instruction sur le client, une lecture (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) dont le where ne décompose pas `tenantWhere(`, une mise à jour ou une suppression dont le where ne décompose pas `ownTenantWhere(`, une création dont les données ne décomposent pas `tenantScopeOf(` (en ligne ou dans une variable locale que les arguments nomment), `findUnique(`, `upsert(`, une requête brute (`$queryRaw`, `$executeRaw`), ou le client gardé dans une variable ; sur TypeORM, la même chose sur le *manager* (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, la ligne confiée à `insertIgnoringConflict(`, un *query builder* dont le where ne porte aucune condition, `save(`, `upsert(`, `query(`) ; sur les quatre, un magasin de modèle de lecture construit sans son option `tenant`. Un where construit par une autre fonction n'est pas suivi |
2196
2229
  | `standard/no-parallel-interface` | une classe, une interface ou un alias de type déclaré comme `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (hors de `presentation/` et de la plateforme), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `CacheInvalidator`, `CacheInvalidationService`, `CachePurgeService`, `CdnPurger`, `I` suivi d'un nom standard (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) ou un nom de `standardInterfaces` ; une classe qui implémente ou étend l'interface standard est un adaptateur et n'est pas signalée |
2197
2230
  | `events/outbox-required` | `stack.events` autre que `outbox` avec un ORM et sans dérogation `stack.events` ; dans `domain/` et `application/`, l'import d'un client de *broker* ou d'une implémentation de bus ou de relais ; un *publisher* qui dépend de plus que `IntegrationEventPublisher` ; un module de la plateforme qui distribue un *publisher* et ne nomme jamais `OutboxPublisher` |
@@ -2374,13 +2407,16 @@ exactement comme le chemin relatif vers le même fichier.
2374
2407
  ## check-file
2375
2408
 
2376
2409
  ```
2377
- ddd-ts-kit check-file <path>
2410
+ ddd-ts-kit check-file <path> [--content-from <file>] [--rule <id>]...
2378
2411
  ```
2379
2412
 
2380
2413
  Exécute les règles par fichier (couches, contextes, nommage, événements, langage, pureté, code
2381
2414
  propre, *mocks*, composition, désactivations) sur un fichier sans parcourir le projet : conçu pour
2382
2415
  un *hook* d'éditeur ou d'agent après chaque écriture. Un fichier qui n'est pas une source du
2383
- projet est ignoré.
2416
+ projet est ignoré. `--content-from <file>` juge le texte de ce fichier comme le contenu de
2417
+ `<path>`, qui n'a pas besoin d'exister encore : ce qu'une session s'apprête à écrire, comme la
2418
+ garde du *plugin* le lit avant l'écriture sous `"dependenciesBeforeWrite": true`. `--rule`
2419
+ restreint les règles ; la *baseline* du projet s'applique comme pour un fichier sur le disque.
2384
2420
 
2385
2421
  ## lint
2386
2422
 
package/README.md CHANGED
@@ -56,14 +56,14 @@ ddd-ts-kit init [--http express|fastify|hono|nest|none]
56
56
  [--database postgres|mysql|sqlite|none]
57
57
  [--events in-memory|outbox] [--docs-ui swagger|scalar|redoc|none]
58
58
  [--ci github|gitlab|both|none] [--ci-extras <extra>,...|none]
59
- [--authn jwt|keycloak|none] [--authz rbac|abac|rebac|custom]
59
+ [--authn jwt|keycloak|passport|none] [--authz rbac|abac|rebac|custom]
60
60
  [--broker none|rabbitmq|kafka|nats|redis|custom] [--cache none|redis]
61
61
  [--http-cache none|varnish] [--storage local|s3|none] [--audit on|off]
62
62
  [--event-sourcing on|off] [--privacy on|off]
63
63
  [--errors none|sentry] [--logger stdout|pino|winston]
64
64
  [--style declared|explicit] [--assembly barrel|discovery]
65
65
  [--dependencies signature|listed] [--refusals named|factories|classes]
66
- [--routes controllers|functions] [--value-objects throwing|result]
66
+ [--routes controllers|functions|nest] [--value-objects throwing|result]
67
67
  [--literals named|free] [--values classes|free] [--tenancy none|shared-table]
68
68
  [--queue database|redis|memory]
69
69
  [--schemas shared|per-route]
@@ -82,8 +82,11 @@ of the project write them for a project without a route or an integration event
82
82
  `"openapi": { "format": "json" }` of the config), so that the first commit holds them and
83
83
  `docs:check` passes at once; a contract that is already there is
84
84
  left alone, `--force` included. An existing `package.json` is merged: missing scripts and
85
- dependencies are added, yours are kept and mentioned in the notes. Run again later, `init` keeps
86
- the stack recorded in the config.
85
+ dependencies are added, yours are kept and mentioned in the notes. The first time, the notes also
86
+ name each dependency the stack about to be written contradicts, and the flag that keeps it
87
+ (`package.json depends on fastify, and the project is written for --http express: pass --http
88
+ fastify to keep it.`), a dry run included: run `init --dry-run` first on an existing project.
89
+ Run again later, `init` keeps the stack recorded in the config.
87
90
 
88
91
  `init --force` on a project that is already initialised rewrites the files `init` owns and keeps
89
92
  the config: the contexts and their upstreams, the rules, the limits, the deviations and every
@@ -113,7 +116,9 @@ An import of a file of the project is written without an extension
113
116
  instead. A config without the key is read as `js`, so a project generated before the key
114
117
  existed keeps its spelling. See [docs/CONFIG.md](../../docs/CONFIG.md).
115
118
 
116
- Defaults: `express`, `zod`, `tsyringe` (`nest` with `--http nest`, and only then), `vitest`,
119
+ Defaults: `express`, `zod` (`class-validator` with `--http nest`, as Nest validates), `tsyringe` (`nest` with
120
+ `--http nest`, and only then), routes written as controllers of the kit (Nest controllers with `--http nest`
121
+ on class-validator, `--routes nest`), `vitest`,
117
122
  `drizzle` on `postgres`, `outbox` when there is an ORM, `swagger`, `github`, `jwt`, `rbac`, no broker,
118
123
  the cache in the process, files in a local directory (`--storage local`), the audit trail `on` when there is an ORM, the requests of a data subject answered (`--privacy on`) when there is an ORM, no event store (`--event-sourcing off`), unexpected failures reported
119
124
  nowhere (`--errors none`), JSON lines on the standard output (`--logger stdout`), and the
@@ -451,7 +456,9 @@ schema per route, an identifier answer included, as 0.1 to 0.5 wrote them.
451
456
  `generate value-object` writes a `create` that returns the value object or throws the refusal of
452
457
  its concept, and a spec that asserts it with `expectRefusal(() => ..)`. `--value-objects result`,
453
458
  or a config without the key, keeps a `create` returning a `Result` that the caller unwraps, as 0.1
454
- to 0.5 wrote it; `value-objects` moves a project from one to the other.
459
+ to 0.5 wrote it; `value-objects` moves a project from one to the other. `generate property` writes
460
+ the laws of an existing value object as a spec on generated values, in either form, and adds
461
+ `fast-check` to the development dependencies when it is missing.
455
462
 
456
463
  **Domain events leave with the save.** A generated command handler builds or loads its aggregate,
457
464
  calls one intention method, `await repository.save(aggregate)` and returns: no `pullEvents()`, and
@@ -536,22 +543,22 @@ config, `docsUi`, `ci` and `logger` included.
536
543
  | tracing | wired once, by the platform (`tracing/platform-only`): no `decorate` hook, no `decorate-bindings.ts`. `tracing.ts` starts `initTracing` of `@ddd-ts-kit/tracing/node` before any other module, on what `config/read-tracing.ts` validates: `OTEL_EXPORTER_OTLP_ENDPOINT` (a URL; left out, no span leaves the process), `TRACE_SAMPLE_RATIO` (0 to 1) and `TRACE_CONSUMERS` (`continue`, the default: a consumed event stays in the trace of its publication; `link`: each delivery starts a trace linked to it). With `--di tsyringe`: `lay-foundations.ts` builds `traceApplication({ consumers })`, `compose-application.ts` hands it to `kernelModule({ instrumentation })` (one span per use case, repository call, domain event, publication, consumer and job) and gives the outbox relay `tracedPublisher(bus)`. With hand wiring: `create-platform.ts` applies the members of `traceApplication()` itself (`useCase` on both buses, `domainEvents`, `publisher`, `binding` around every adapter, `job`, `executionScope`, `errorReporter`), with `tracedSubscriber` and `tracedPublisher` around the provider. With an HTTP stack, in both families, `auth/authentication/http-boundary.ts` sets `around: tracedRoutes()`: one `SERVER` span per request, named by its route |
537
544
  | `--logger` | `src/platform/observability/create-logger.ts`, one per choice: `stdout` (the default) is the `StdoutLogger` of `@ddd-ts-kit/aspects`, JSON lines, credentials not redacted; `pino` is `createPinoLogger` of `@ddd-ts-kit/pino` (dependencies `pino` and `pino-pretty`); `winston` is `createWinstonLogger` of `@ddd-ts-kit/winston`; these two redact the credential keys of the kernel. Every entry carries `traceLogFields(scope)`: the correlation id, origin, actor and tenant of the work in progress and the ids of the active trace. `LOG_LEVEL`, `LOG_FORMAT` (`json`, the default, or `pretty`; with `stdout`, which has no pretty format, `pretty` is refused when the configuration is loaded) and `LOG_SCRUB_MESSAGES` (`[message removed]` in place of the message of a logged error that is not a `DomainError`) are validated in `config/load-config.ts`. Stopping the application flushes the error reporter, then the logger, last: `container.stop()` does it on tsyringe, `compose-application.ts` flushes explicitly with hand wiring. The tools and the tests compose the application without `log` and write nothing |
538
545
  | `src/platform/auth/` | one folder per question: `authentication/` (who is calling), `authorization/` (what they may do, whatever the model) and the folder of the model `stack.authz` names (`roles/`, `attributes/`, `relationships/` or `custom/`). A project generated before the folders keeps its files flat: the generators read them there, `npx ddd-ts-kit doctor` says so and `npx ddd-ts-kit platform-folders` moves them with every import |
539
- | `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt`: `JwtAuthenticator` on `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI`; `--authn keycloak`: `keycloakAuthenticator` on `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` and the optional `KEYCLOAK_CLIENT_ID`; `--authn none`: `development-header-authenticator.ts` and `development-actor-header.ts`, which read `x-development-actor` and throw in production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` answering a `Session`, `executionScope`, `errorMapper` and `onError`, spread into the mount options: every request runs inside the execution scope, with its correlation id). Without an HTTP stack there is no authenticator and no boundary, and no folder |
546
+ | `src/platform/auth/authentication/` | `create-authenticator.ts` (`--authn jwt`: `JwtAuthenticator` on `AUTH_ISSUER`, `AUTH_AUDIENCE`, `AUTH_JWKS_URI`; `--authn keycloak`: `keycloakAuthenticator` on `KEYCLOAK_URL`, `KEYCLOAK_REALM`, `KEYCLOAK_AUDIENCE` and the optional `KEYCLOAK_CLIENT_ID`; `--authn passport`: `passportAuthenticator` of `@ddd-ts-kit/auth/passport` over `bearer-strategy.ts`, the strategy of `passport-jwt` on the key set `AUTH_JWKS_URI` publishes (`jwks-rsa`), `AUTH_ISSUER` and `AUTH_AUDIENCE`, and `actor-of-token.ts`, which reads its payload with `actorOfClaims`; `--authn none`: `development-header-authenticator.ts` and `development-actor-header.ts`, which read `x-development-actor` and throw in production), `principal-of.ts`, `security-schemes.ts`, `offline-authenticator.ts`, `http-boundary.ts` (`resolvePrincipal` answering a `Session`, `executionScope`, `errorMapper` and `onError`, spread into the mount options: every request runs inside the execution scope, with its correlation id). Without an HTTP stack there is no authenticator and no boundary, and no folder |
540
547
  | `src/platform/auth/authorization/` | `create-authorizer.ts`, `authorization.ts` (`authorizationModule` with tsyringe) or `use-case-protection.ts` (the guard of the hand-wired buses), `access-policies.ts`, `role.ts` (the roles a credential carries, with roles or attributes, or once a guard names one), `permissions.ts` (the registry of every permission, with relationships or an authorizer of your own), `signed-in-grants.ts` once a context preset grants every signed-in person, and with `--audit off` `log-decisions.ts` (one log entry per decision, ids and codes only) |
541
548
  | `src/platform/auth/<model>/` | `roles/roles.ts` (with the role `system` every system actor holds); `attributes/attribute-policies.ts`; `relationships/`: `relationship-schema.ts`, `create-tuple-store.ts` and its contract spec, `relation-tuples.ts`, `relate-system-actors.ts`; `custom/`: `custom-authorizer.ts` and its `authorizerContract` spec |
542
549
  | `--representations negotiated`, `--forms on` | `src/platform/http/presentation-of.ts` (`Representations.standard()` with `negotiated`, and `fieldDeciderOf` over the `Access` of the application), spread into the HTTP boundary and given to the contract script; with `--forms on`, `src/platform/http/with-forms.ts` adds `formRoutes` to the routes and `scripts/openapi.ts` writes `openapi/forms/<operationId>.json`. Both are the default with an HTTP stack; `json` and `off` leave them out ([docs/CONFIG.md](../../docs/CONFIG.md)) |
543
- | `--audit on` | `src/platform/audit/`: `create-audit.ts` (the trail, the `onDecision` of the authorization, the refusals of the guards at the edge given to the HTTP boundary as `onGuardRefusal`, the middleware before the unit of work, the integration events subscribed under the consumer name `audit`), `audited-events.ts` (the registry `generate integration-event` adds to), `audit.module.ts`, and with an HTTP stack the read side: `audit.permissions.ts` (`audit:trail.read`), then in `search-audit-entries/`: `search-audit-entries.query.ts`, its handler, `search-audit-entries.route.ts` or `.controller.ts` (`GET /audit/entries`: cursor pages, filters `actorId`, `action`, `outcome`, `correlationId`), which starts with the endpoint and takes what it receives and answers from `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` and `audit-outcomes.ts`. It is a capability of the platform, not a bounded context: no model, one protected query over the `AuditReader` port, bounded by the tenant of the actor (with `--tenancy shared-table`, by the tenant of the work through `TenantAuditReader`: platform staff read across tenants only inside `acrossTenants`). The refusals of a caller without a credential are not recorded. A scheduled job is audited like a request: origin `schedule`, actor `system:<context>.<job>`. With knex the two tables and their append-only triggers are created by the first migration; with drizzle the tables are in `schema.ts` and `npm run db:audit-guard` prints the trigger statements for a custom migration; with prisma and typeorm the tables are models of `prisma/schema.prisma` or entities of `schema.ts` (`auditPrismaModels`, `auditEntities` of `@ddd-ts-kit/audit`), written by `PrismaAuditTrail` and `TypeOrmAuditTrail`, and `npm run db:audit-guard` prints the trigger statements for a migration by hand; the test databases install that guard; with `custom` or no ORM the trail is an `InMemoryAuditTrail` behind a `TODO(platform)`. The test databases leave the audit schema out of `reset()`. With the trail in a database and `--storage local` or `s3`, `audit.module.ts` (or the hand-wired composition) registers `audit.archive` on the first day of every month at 04:00 UTC: the entries older than twelve whole months move to the storage under `audit-archives/`, verified, read back and anchored (`ArchiveAuditEntries`); with `s3` it runs unless `JOB_AUDIT_ARCHIVE_ENABLED=false`, with `local` only with `JOB_AUDIT_ARCHIVE_ENABLED=true`, since the archive removes the entries from the database and the disk of the server may not last |
550
+ | `--audit on` | `src/platform/audit/`: `create-audit.ts` (the trail, the `onDecision` of the authorization, the refusals of the guards at the edge given to the HTTP boundary as `onGuardRefusal`, the middleware before the unit of work, the integration events subscribed under the consumer name `audit`), `audited-events.ts` (the registry `generate integration-event` adds to), `audit.module.ts`, and with an HTTP stack the read side: `audit.permissions.ts` (`audit:trail.read`), then in `search-audit-entries/`: `search-audit-entries.query.ts`, its handler, `search-audit-entries.route.ts` or `.controller.ts` (`GET /audit/entries`: cursor pages, filters `actorId`, `action`, `outcome`, `correlationId`), which starts with the endpoint and takes what it receives and answers from `audit-entries-parameters.ts`, `audit-entries-filter-of.ts`, `audit-entry-view.ts`, `audit-entry-view-of.ts` and `audit-outcomes.ts`. It is a capability of the platform, not a bounded context: no model, one protected query over the `AuditReader` port, bounded by the tenant of the actor (with `--tenancy shared-table`, by the tenant of the work through `TenantAuditReader`: platform staff read across tenants only inside `acrossTenants`). The refusals of a caller without a credential are not recorded. A scheduled job is audited like a request: origin `schedule`, actor `system:<context>.<job>`. With knex the two tables and their append-only triggers are created by the first migration; with drizzle the tables are in `schema.ts` and `npm run db:generate` adds the trigger statements to the migration that creates the tables (`npm run db:audit-guard` prints them for a migration by hand); with prisma and typeorm the tables are models of `prisma/schema.prisma` or entities of `schema.ts` (`auditPrismaModels`, `auditEntities` of `@ddd-ts-kit/audit`), written by `PrismaAuditTrail` and `TypeOrmAuditTrail`, and `npm run db:generate` (through `ddd-ts-kit prisma-generate` or `typeorm-generate`) adds the trigger statements to the migration that creates the tables, `npm run db:audit-guard` printing them for a migration by hand; the test databases install that guard; with `custom` or no ORM the trail is an `InMemoryAuditTrail` behind a `TODO(platform)`. The test databases leave the audit schema out of `reset()`. With the trail in a database and `--storage local` or `s3`, `audit.module.ts` (or the hand-wired composition) registers `audit.archive` on the first day of every month at 04:00 UTC: the entries older than twelve whole months move to the storage under `audit-archives/`, verified, read back and anchored (`ArchiveAuditEntries`); with `s3` it runs unless `JOB_AUDIT_ARCHIVE_ENABLED=false`, with `local` only with `JOB_AUDIT_ARCHIVE_ENABLED=true`, since the archive removes the entries from the database and the disk of the server may not last |
544
551
  | `--event-sourcing on` | recorded as `stack.eventSourcing`, `off` unless asked: `Persistence` gains `eventSourcing` (`create<Orm>EventSourcing` in the `event_store` schema, whose five tables the schema file declares; the in-memory stores with `--orm none`), and `src/platform/event-sourcing/`: `create-event-sourcing.ts` (`EventSourcing`: the stores, the `SubjectKeyStore` wrapped by `auditedSubjectKeys` with `--audit on`, and the `PersonalDataCipher` over it) and, on tsyringe, `event-sourcing.module.ts` (binds `EventStore`, `SnapshotStore`, `CheckpointStore`, `SubjectKeyStore` and `PersonalDataCipher`, so an event-sourced repository adapter names them in its constructor; the hand-wired `Platform` carries them as `platform.eventSourcing`); `platform-test.module.ts` binds the in-memory stores, so a handler spec of an event-sourced aggregate needs no fake. `generate aggregate --event-sourced` is refused without it, with the `init --force --event-sourcing on` to run. Refused with `--orm custom`: the event store of the kit runs on PostgreSQL through the four ORM packages |
545
552
  | `--privacy on` | recorded as `stack.privacy`, `on` when there is an ORM: `src/platform/privacy/`, with `data-subject-copies.ts` and `data-subject-exports.ts` (the ports, or the adapters by hand, of the contexts that extend `PersonalDataErasure` and `PersonalDataExport`, between markers; `generate repository --personal` lists the erasure and the export of a context there), `run-erasure.ts` (`runErasure(subject, { operator, correlationId, tenants? })`: an execution context of origin `cli` with the operator as actor, the key of the subject when the project has an event store, then `eraseDataSubject` of the kernel over the copies, `inEachTenant` with `--tenancy shared-table`, then `privacy.data-subject.erased` published through the outbox, once per tenant) and `run-export.ts` (`runExport(subject, { operator, correlationId, tenants? })`: `exportDataSubject` of the kernel over the exports, each wrapped by `auditedPersonalDataExport` with `--audit on`, `recordsInEachTenant` with `--tenancy shared-table`, one dated `PersonalDataExportDocument`), and the two scripts below. `docs/privacy/register.md`, the register of personal data `ddd-ts-kit docs` keeps (see `docs` below). A project without personal data takes `--privacy off` and pays nothing. No HTTP command erases yet: the two scripts are the entry points |
546
553
  | `--tenancy shared-table` | recorded as `stack.tenancy`; the four ORMs. Every `generate repository` is tenant-scoped (as `--tenant-scoped`), through `tenantTable` and `ownTenantTable` (Knex), `tenantCondition` and `ownTenantCondition` (Drizzle), `tenantWhere` and `ownTenantWhere` (Prisma, TypeORM); the outbox keeps the tenant of each event (`createOutboxTables(knex, { tenant: true })` and `KnexOutboxStore`'s `tenant: true`, `tenantOutboxTable`, the `tenantId` field of the Prisma model and `PrismaOutboxStore`'s `tenant: true`, `outboxEntity({ tenant: true })`), so consumers run in it; `tenancy/scoped-statement` judges the adapters. Row-level security, schema per tenant and database per tenant are refused, with what to wire by hand ([Multitenancy](../../docs/concepts/multitenancy.md)) |
547
- | `--queue database\|redis\|memory` | recorded as `stack.queue`. `database` (the default on Knex or Drizzle with tsyringe): `createJobTable` and `createProcessTable`, or `jobsTable` and `processesTable`, in the `messaging` schema, `Persistence` gains `jobs` and `processes`, and the platform binds `JobStore` and `ProcessStore` to them (the platform module on tsyringe, `jobs/create-background-work.ts` where the platform is wired by hand), so a job enqueued by a command is written in its transaction; `redis` (with `--cache redis`): `RedisJobStore` on the connection of the cache, the processes in the database; `memory` (the default otherwise): nothing is written, both stay in the process. Refused: `database` with another ORM, `redis` without the cache |
554
+ | `--queue database\|redis\|memory` | recorded as `stack.queue`. `database` (the default on Knex, Drizzle, Prisma and TypeORM, whatever the container): the tables of the ORM package (`createJobTable` and `createProcessTable`, `jobsTable` and `processesTable`, the `BackgroundJob` and `ProcessInstance` models, `jobEntity` and `processEntity`) in the `messaging` schema, `Persistence` gains `jobs` and `processes`, and the platform binds `JobStore` and `ProcessStore` to them (the platform module on tsyringe, `jobs/create-background-work.ts` where the platform is wired by hand or under Nest), so a job enqueued by a command is written in its transaction; `redis` (with `--cache redis`): `RedisJobStore` on the connection of the cache, the processes in the database; `memory` (the default with a custom persistence or none): nothing is written, both stay in the process. Refused: `database` with another ORM, `redis` without the cache |
548
555
  | `--cache redis` | `src/platform/redis/open-redis.ts` (`RedisServices`: the cache bound to the kernel `Cache`, the limiter to `RateLimiter`, the lock to `Lock`, which keeps a scheduled job to one instance, the relay signal as the `wakeOn` of the outbox relay with `relayWakeUpMiddleware` on the command bus), `http/too-many-requests-for.ts` (one sliding window per caller address, 429 `application/problem+json` with `retry-after`; `RATE_LIMIT_MAX`, `RATE_LIMIT_WINDOW_MS`), `GET /health/ready` on the HTTP server, `REDIS_URL` validated, a compose service `cache` running Dragonfly with a healthcheck. Without a server (tools, tests without `REDIS_URL`) the same ports stay in the memory of the process |
549
556
  | `--http-cache varnish` | a compose service `varnish` (Varnish 9.1.0, reaching the API on `host.docker.internal`) with its VCL in `docker/varnish/default.vcl` (only answers whose `Cache-Control` allows them by `max-age` or `s-maxage` are kept, filed under their `xkey` tags, purged by `PURGE` from the machine of Varnish or with `VARNISH_PURGE_KEY`, `x-cache: HIT\|MISS`), `VARNISH_URL` and `VARNISH_PURGE_KEY` validated, `cacheTags: { header: CacheTagHeader.xkey }` in the HTTP boundary, and the outbox relay of `main.ts` and of every `generate service` entry point publishing through `PurgingPublisher` with `VarnishCachePurger` (the end-to-end application records the purges in `purges`); on `--di manual` and `nest` the platform gains `cacheInvalidation`; with `--tenancy`, the tags of the answers and the purges are filed under the tenant (`perTenant`) and the tenant of a request is read from `x-tenant-id`. Needs an HTTP framework and `--events outbox`: a purge is a row of the outbox |
550
557
  | `--errors sentry` | unexpected failures reported to Sentry or GlitchTip (one protocol, only the DSN differs) through the kernel `ErrorReporter`, bound to `@ddd-ts-kit/sentry`. `src/platform/observability/errors.ts` (`initSentry` on the validated configuration, then `reportProcessFailures`), the second import of `main.ts`, of `apps/<context>/main.ts` and of `apps/worker/main.ts`, right after `tracing.ts`; `errors` handed to `composeApplication`, which gives it to the kernel module on tsyringe (`errorReporter`, flushed by `container.stop()` before the logger, `errorReportingMiddleware` first on both buses, the default scheduler observing with `reportFailedRuns`) or to `createPlatform` by hand (the same middleware, `onRun: reportFailedRuns(errors)`, `platform.errors`, flushed two seconds at most when the application stops); `reportHttpErrors` in `auth/authentication/http-boundary.ts` for every request answered 5xx; `DeadLetterReports` on the `onFailure` hook of a provided broker (`createEventProvider(config, errors)`, with `observing` around each consumer) and of the outbox relay. `SENTRY_DSN`, `SENTRY_ENVIRONMENT` (default: `NODE_ENV`), `SENTRY_RELEASE` and `SENTRY_SCRUB_MESSAGES` validated in `config/load-config.ts` as `errorReporting`: without a DSN the application starts and reports nothing; a DSN that is not a URL refuses the start. Dependencies `@ddd-ts-kit/sentry` and `@sentry/node`. A compose profile `errors` running GlitchTip 6.2.6 with its own PostgreSQL and Valkey (`GLITCHTIP_PORT`, loopback only, development bootstrap), and a section of the generated README saying how to read its DSN. The tools and the tests compose the application without a reporter. It goes with every other choice of the stack; with `--errors none` nothing of this is written |
551
558
  | `--authn keycloak` | a compose service `keycloak` (Keycloak 26.8.0, `start-dev --import-realm`, profile `identity`) and `docker/keycloak/<project>-realm.json`: the API client, a public client `<project>-local` with the direct grant, its audience and `tenant_id` mappers, the realm role `admin`, and the demo users `demo-admin` and `demo-user`, for local development only |
552
559
  | `--storage local\|s3` | recorded as `stack.storage`: where the content of files lives, never in the database. `src/platform/config/read-files.ts` and `src/platform/files/open-files.ts`, one per choice: `local`, a directory in development (`FILES_DIRECTORY`, `.data/files`) and the signed links answered by the application under `/files` (`FILES_PUBLIC_URL` and `FILES_SIGNING_SECRET` required in production); `s3`, a bucket of any provider of the S3 protocol through `@ddd-ts-kit/s3` (the `S3_*` variables, MinIO in the compose stack); the memory of the process in the tests and the tools, either way. With `--di tsyringe`: `files/bind-files.ts`, `files/files.module.ts` and `files/staging-uploads.ts`; with hand wiring `files/create-files.ts`; with an HTTP stack `files/file-routes.ts`. They bind `FileStorage`, `FileKeys`, `FileScanner` and `FileStaging`, register the hourly purge of staged files and stage the file a command carries before its transaction; `generate file-upload` needs them. `--storage none` writes none of this ([File storage](../../docs/concepts/file-storage.md)) |
553
560
  | `src/platform/events/` | `event-provider.ts` (`bus`, `forConsumer(name)`, `start()`, `close()`), `in-process-events.ts`, and for `--broker` `create-event-provider.ts`: `RabbitMqEventBus` (`AMQP_URL`), `KafkaEventBus` (`KAFKA_BROKERS`, with `aggregate-key-of.ts` for per-aggregate order), `NatsEventBus` (`NATS_URL`) or `RedisStreamsEventBus` of `@ddd-ts-kit/redis/event-bus` (`REDIS_URL`: Redis, Dragonfly or Valkey), each with one subscriber per consuming context (`forConsumer`), `assertTopology` at start, its address validated and a compose service with a healthcheck; or `custom-event-bus.ts` with its `eventBusContract` spec. `start-outbox-relay.ts` with the outbox. `--broker redis` with `--cache redis` is one server and one compose service, `cache`; alone, the service is `streams` |
554
- | `src/platform/database/` | `persistence.ts` (`interface Persistence`: unit of work, outbox and processed-event stores of the ORM package, the storage handle), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, the connection (`connect-to-database.ts`, `create-client.ts` or `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, the schema of what the kit stores for the application), `open-test-database.ts` (PostgreSQL in process, or the server named by a URL; with Vitest each spec opens a copy of the cluster `test/support/test-database-template.ts`, the global setup of the run, initialised once, and creates its tables there; with drizzle from `table-statements.ts`, the SQL of the tables of `schema.ts`, since drizzle-kit writes migrations, not tables). The storage class a repository adapter names in its dependency list: `database.ts` with drizzle and prisma (`abstract class Database extends` the context type of the ORM package), `KnexContext` of `@ddd-ts-kit/knex`, `TypeOrmContext` of `@ddd-ts-kit/typeorm` |
561
+ | `src/platform/database/` | `persistence.ts` (`interface Persistence`: unit of work, outbox and processed-event stores of the ORM package, the storage handle), `open-persistence.ts`, `persistence-over.ts`, `inert-persistence.ts`, the connection (`connect-to-database.ts`, `create-client.ts` or `create-data-source.ts`), `schema.ts` (`MESSAGING_SCHEMA`, the schema of what the kit stores for the application), `open-test-database.ts` (PostgreSQL in process, or the server named by a URL; with Vitest each spec opens a copy of the cluster `test/support/test-database-template.ts`, the global setup of the run, initialised once, and creates its tables there; with drizzle from `table-statements.ts`, the SQL of the tables of `schema.ts`, since drizzle-kit writes migrations, not tables, its unique indexes included), `persistence.contract.spec.ts` (the outbox, processed-event, job and process stores as the platform wires them, held to the contracts of `@ddd-ts-kit/testing` with what the stack turns on: the tenant under `--tenancy`, the unit of work). The storage class a repository adapter names in its dependency list: `database.ts` with drizzle and prisma (`abstract class Database extends` the context type of the ORM package), `KnexContext` of `@ddd-ts-kit/knex`, `TypeOrmContext` of `@ddd-ts-kit/typeorm` |
555
562
  | migration tooling | `drizzle.config.ts`, `knexfile.js` and `migrations/00000000000000_initial.js`, `prisma/schema.prisma` and `prisma.config.ts`, or `data-source.ts` |
556
563
  | `scripts/openapi.ts`, `scripts/events.ts` | write `openapi/openapi.yaml` (one file per document of `openapi.documents`), `docs/integration/asyncapi.yaml` and `docs/integration/event-catalog.md`, in JSON under `openapi.format: json`; `--check` fails on a difference |
557
564
  | `scripts/privacy-erase.ts`, `scripts/privacy-export.ts` | with `--privacy on`, the two requests of a data subject, answered from the command line on the sources with the variables of `.env` (`npm run privacy:erase -- <subject-id> [--operator <who-asks>]`, `npm run privacy:export -- <subject-id> > export.json`): the erasure destroys the key of the subject first when the project has an event store (`--event-sourcing on`: its stored events read as erased; audited with `--audit on`), then erases every copy listed in `src/platform/privacy/data-subject-copies.ts`; `privacy:purge` runs by hand what the job `privacy.purge-expired` runs every night at 03:00 UTC, the purge of what outlived its retention (`JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false` switches the job off); the export gathers every record listed in `data-subject-exports.ts` into one dated JSON document (`format`, `subject`, `exportedAt`, `records`), the export of each context audited with `--audit on`, never the values (every run leaves its entry, a trial included: try it on a test subject). With `--tenancy shared-table`, `TENANTS` names the tenants, comma separated: a write of tenant data is never widened. Neither reaches backups, logs or a copy no context declared |
@@ -638,7 +645,8 @@ the grant `'identity:*'` of `platform/auth/authorization/signed-in-grants.ts`, a
638
645
  the context belong to none, under a decision record the preset writes, and with `--authn
639
646
  keycloak` the authenticator reads the `organization` claim as the tenants of the person
640
647
  (another authenticator gets a next step saying what to map). The preset is written for
641
- `declared` with `signature` dependencies, `factories`, `throwing` value objects, `controllers`,
648
+ `declared` with `signature` dependencies, `factories`, `throwing` value objects, `controllers` or `nest` routes (Nest controllers, read from their
649
+ signatures, on a Nest project),
642
650
  Knex or Drizzle on PostgreSQL, Zod or class-validator, Express or Fastify, and a token verifier
643
651
  (`jwt` or `keycloak`); another stack is refused with what to change, and so is a second context
644
652
  written from the same preset. Why, and which other contexts deserve one:
@@ -686,7 +694,7 @@ Next, in this order: the language of the context first, then the business decisi
686
694
  | Kind | Arguments | Writes |
687
695
  |---|---|---|
688
696
  | `context` | `<name> --classification <c> [--purpose "<two sentences>"] [--term ...]... [--upstream <ctx>[:relationship]]... [--preset identity]` | `CONTEXT.md` with its glossary, `published-language/index.ts`, config entry, registration in `platform/composition/compose-application.ts` and in `test/architecture/extractable.spec.ts`; on tsyringe, with HTTP, `presentation/http/<name>.routes.ts` (a function of the two buses, in both styles); declared: the barrel `<name>.declarations.ts`; explicit and hand wiring: `<name>.module.ts`. `<name>.permissions.ts`, at the root of the context, is born with the first permission, or at once when `platform/auth/authorization/permissions.ts` lists the permission sets (rebac, custom). With `--preset`, the context is then written whole from that preset, its classification and purpose those of the preset unless the flags say otherwise ([Presets](#presets)) |
689
- | `aggregate` | `<context> <Name> [--event-sourced]` | aggregate, builder, spec in given / when / then; with `--event-sourced`, an aggregate on `EventSourcedAggregate` whose state is the replay of its events, born with its `Created` domain event, the codec of its stored events in `infrastructure/persistence/<name>-events.mapper.ts`, a builder that replays a history and a spec given events, and a note naming the `EventSourcedRepository` its repository adapter delegates to; refused while `stack.eventSourcing` is `off`, with the `init --force --event-sourcing on` to run |
697
+ | `aggregate` | `<context> <Name> [--event-sourced [--birth <Event>]]` | aggregate, builder, spec in given / when / then; with `--event-sourced`, an aggregate on `EventSourcedAggregate` whose state is the replay of its events, born with its `Created` domain event (or the fact `--birth <Event>` names, checked against the glossary), the codec of its stored events in `infrastructure/persistence/<name>-events.mapper.ts`, a builder that replays a history and a spec given events, and a note naming the `EventSourcedRepository` its repository adapter delegates to; refused while `stack.eventSourcing` is `off`, with the `init --force --event-sourcing on` to run |
690
698
  | `builder` | `<context> <Aggregate>` | `test/builders/<name>.builder.ts`, a class extending `Builder` |
691
699
  | `test-world` | `<context> [Name]` | `test/worlds/<name>.world.ts` (the name defaults to the context): `a<Name>World({ now, idPrefix, given })`, the arrangement several specs of the context share. It reads the fakes of `test/fakes/` and the port each one implements, builds them, hands them to `given` so that the spec stores what it starts from, then to the test application (with `modules`, the authorization of the spec) or, wired by hand, wraps the repositories of the buses of `createTestBuses` with `dispatching`; it returns every fake under the name of its port. A fake that needs constructor arguments, or, under a container, stands for a port nothing binds or depends on yet, is left out with a note |
692
700
  | `entity` | `<context> <Name>` | entity, spec |
@@ -697,7 +705,7 @@ Next, in this order: the language of the context first, then the business decisi
697
705
  | `domain-error` | `<context> <Name> [--code CODE]` | one class per error with a stable code, spec: the form of a project whose config says `"stack.refusals": "classes"` or nothing. Refused under `named` and `factories`, with the `generate error` command to run instead |
698
706
  | `domain-service` | `<context> <Name>` | service, spec |
699
707
  | `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 |
700
- | `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. 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 |
708
+ | `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 |
701
709
  | `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 |
702
710
  | `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 |
703
711
  | `port` | `<context> <Name>` | `application/ports/<name>.port.ts`, one abstract class, and its fake |
@@ -1744,7 +1752,9 @@ A line inserted between base lines the other side left alone stays an error even
1744
1752
  side inserted at the same place: dropping one of two new methods is the loss the check exists
1745
1753
  for. So does a rewrite that lost more lines than the base lines or the other side's rewrite it
1746
1754
  competed with (an edit with a new method under it). What one side deleted, or reopened, is never
1747
- reported. A removal decided on purpose is recorded in the merge commit as a trailer
1755
+ reported. Nor is a line of the branch in a file the branch did not touch since its fork from the trunk
1756
+ (the file is the same on the branch and at `git merge-base`): what the trunk removed or replaced
1757
+ there since is the trunk's change, whatever base the merge is computed from. A removal decided on purpose is recorded in the merge commit as a trailer
1748
1758
  `Lost-Accepted: <file:line>,...` (a file alone accepts all of its lines): those findings are
1749
1759
  listed and never fail. For a merge older than HEAD, a finding HEAD no longer shows was repaired
1750
1760
  by a later commit: listed too.
@@ -1910,6 +1920,7 @@ generated pipelines wire all three.
1910
1920
  ```
1911
1921
  ddd-ts-kit check [paths...] [--rule <id>]... [--format text|json|github|gitlab]
1912
1922
  [--changed-since <git-ref>] [--explain] [--self]
1923
+ ddd-ts-kit check --baseline write|prune
1913
1924
  ddd-ts-kit check --clean-only <dir>... [--rule <id>]... [--format text|json|github]
1914
1925
  ddd-ts-kit check --commit-size [--staged] [--strict]
1915
1926
  ```
@@ -1969,6 +1980,23 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
1969
1980
  `ddd-ts-kit explain <rule-id>` prints the same kind of bad and good example for every rule.
1970
1981
 
1971
1982
  - `paths` and `--changed-since` limit what is reported, not what is analysed.
1983
+ - `--baseline write` records the errors a project already has, counted by file and by rule, in
1984
+ `ddd-ts-kit-baseline.json` (the shape of `eslint-suppressions.json`), for a codebase that adopts
1985
+ the kit; commit it. From then on `check` and `check-file` (the hook of the agent) leave quiet the
1986
+ errors of a rule in a file while they are no more than the baseline records, and report all of
1987
+ them once they are more; `check` fails when a recorded count is no longer reached, until
1988
+ `--baseline prune` lowers it, so that the baseline only shrinks. Warnings are not recorded: they
1989
+ fail nothing. Writing a baseline is a decision of the project owner, who runs `--baseline write`
1990
+ in a terminal: the guard of the plugin refuses the command and any direct edit of the file to an
1991
+ agent, under Claude Code, Codex and Copilot alike, and the permissions `init` writes ask before
1992
+ both for an agent without the plugin. A command the guard does not read (a script of the
1993
+ project that writes the file) is not caught: the review reads the diff of the baseline, which
1994
+ should only shrink. `--baseline prune` needs no one. A file that moves keeps its counts: the
1995
+ commands of the kit that move files (`move-to-module`, `context-layout`, `platform-folders`)
1996
+ carry its entry to the new path, and `--baseline prune` follows the renames git sees since the
1997
+ baseline was committed (a `git mv`); a file moved otherwise reports its errors at its new path,
1998
+ and its old entry fails until the owner writes the baseline again. A baseline makes old errors quiet; it does
1999
+ not make a tree outside the canonical one checkable.
1972
2000
  `--changed-since` runs `git diff --name-only --relative <ref>...` in the project.
1973
2001
  - `--format github` prints `::error file=...,line=...::` annotations.
1974
2002
  - `--explain` follows the violations with each rule they report, once, with its description and
@@ -2067,6 +2095,8 @@ const due = handler.isDueNow(new Reminder(new Date('2026-03-01T09:00:00Z'))); //
2067
2095
  | `authz/fields-by-schema` | under `application/queries/`: `roles.includes(`, `.some(`, `.every(`, `.find(`, `.indexOf(`, a comparison with a `role`, `isAdmin` |
2068
2096
  | `aspects/outside-in` | an import of `@ddd-ts-kit/aspects/decorators` outside `infrastructure/` of a context and the platform directory: `presentation/`, the module file, `published-language/`, the shared kernel, `main.ts`, any other source (`domain/` and `application/` are reported by the two `layer/*` rules instead) |
2069
2097
  | `tracing/platform-only` | an import of `@ddd-ts-kit/tracing` or of an `@opentelemetry/*` package outside the platform directory, `main.ts` and `apps/`, tests included |
2098
+ | `nest/no-parallel-pipeline` | in `presentation/`, `infrastructure/` or the module file of a context, tests apart: an import of a controller Nest serves (its route and parameter decorators, unless the file imports `KitRoute` or `KitRoutes` of `@ddd-ts-kit/http/nest`), the raw request or answer, a guard, a pipe, an exception filter or an `HttpException`, an interceptor or the `Logger` of `@nestjs/common`, a bare import of it, or an import of a package of Nest whose work the kit does (`@nestjs/core`, `@nestjs/swagger`, `@nestjs/cqrs`, `@nestjs/passport`, `@nestjs/config`, `@nestjs/schedule` and the others of section 3 of ARCHITECTURE.md); the message names what the kit does in its place; under the source root outside the contexts, tests apart: a file that imports `Controller` of `@nestjs/common`, neither `KitRoute` nor `KitRoutes`, and names `CommandBus` or `QueryBus` or imports a file of a context |
2099
+ | `nest/controllers-current` | with `"stack.routes": "nest"`: a `<context>.controllers.ts` that differs from what the Nest controllers of the context and the signatures of their methods give, or is missing; a part of the request taken whole by no DTO class that `request` of `@KitRoute` does not give; a route method that answers no DTO class, `Accepted` or `void` and declares no `response` in `@KitRoute` |
2070
2100
  | `tenancy/scoped-statement` | with `stack.tenancy` other than `none`, in `infrastructure/` of a context, tests aside: on Knex the executor used other than as an argument (`executor()(`, `executor().from(`, `executor().raw(`, `const db = ...executor();`) and any `.raw(`; on Drizzle, statement by statement, a read, update or delete on the executor whose where has no `tenantCondition(` nor `ownTenantCondition(` (inline or in the local it is given), an insert whose row has no `tenantScopeOf(`, a relational query (`executor().query`), a raw `execute(`, or the executor held in a variable; on Prisma, statement by statement on the client, a read (`findFirst(`, `findMany(`, `count(`, `aggregate(`, `groupBy(`) whose where spreads no `tenantWhere(`, an update or a delete whose where spreads no `ownTenantWhere(`, a create whose data spreads no `tenantScopeOf(` (inline or in a local the arguments name), `findUnique(`, `upsert(`, a raw query (`$queryRaw`, `$executeRaw`), or the client held in a variable; on TypeORM the same on the manager (`find*(`, `count*(`, `update(`, `delete(`, `insert(`, the row handed to `insertIgnoringConflict(`, a query builder whose where carries no condition, `save(`, `upsert(`, `query(`); on the four, a read model store built without its `tenant` option. A where built by another function is not followed |
2071
2101
  | `standard/no-parallel-interface` | a class, interface or type alias declared as `ILogger`, `AppLogger`, `LoggerService`, `LoggerInterface`, `IMetrics`, `MetricsService`, `ICache`, `CacheService`, `UserContext`, `CurrentUser`, `AuthContext`, `RequestContext` (outside `presentation/` and the platform), `UserSession`, `AuthSession`, `SessionData`, `PaginatedResult`, `PageResult`, `PaginatedResponse`, `Paginated`, `PaginationParams`, `PageParams`, `AuditLog`, `AuditLogEntry`, `AuditRecord`, `IJobScheduler`, `JobSchedulerService`, `CronScheduler`, `TaskScheduler`, `IScheduledJob`, `CronJob`, `ScheduledTask`, `BackgroundJob`, `IErrorReporter`, `ErrorReporterService`, `ErrorTracker`, `ExceptionReporter`, `CrashReporter`, `CacheInvalidator`, `CacheInvalidationService`, `CachePurgeService`, `CdnPurger`, `I` followed by a standard name (`IClock`, `IIdGenerator`, `IUnitOfWork`, `ISession`, ...) or a name of `standardInterfaces`; a class that implements or extends the standard interface is an adapter and is not reported |
2072
2102
  | `events/outbox-required` | `stack.events` other than `outbox` with an ORM and no `stack.events` deviation; in `domain/` and `application/`, the import of a broker client or of a bus or relay implementation; a publisher depending on more than `IntegrationEventPublisher`; a platform module that hands out a publisher and never names `OutboxPublisher` |
@@ -2229,12 +2259,16 @@ import is judged by every boundary rule exactly as the relative path to the same
2229
2259
  ## check-file
2230
2260
 
2231
2261
  ```
2232
- ddd-ts-kit check-file <path>
2262
+ ddd-ts-kit check-file <path> [--content-from <file>] [--rule <id>]...
2233
2263
  ```
2234
2264
 
2235
2265
  Runs the per-file rules (layers, contexts, naming, events, language, purity, clean code, mocks,
2236
2266
  composition, suppressions) on one file without walking the project: meant for an editor or
2237
2267
  agent hook after each write. A file that is not a source of the project is ignored.
2268
+ `--content-from <file>` judges the text of that file as the content of `<path>`, which need not
2269
+ exist yet: what a session is about to write, as the guard of the plugin reads it before the write
2270
+ under `"dependenciesBeforeWrite": true`. `--rule` narrows the rules; the baseline of the project
2271
+ applies as for a file on disk.
2238
2272
 
2239
2273
  ## lint
2240
2274
 
@@ -1 +1 @@
1
- {"version":3,"file":"lock-acceptance.d.ts","sourceRoot":"","sources":["../../src/acceptance/lock-acceptance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAkB,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAQ/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAM1D,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,gHAAgH;AAChH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAuB1E"}
1
+ {"version":3,"file":"lock-acceptance.d.ts","sourceRoot":"","sources":["../../src/acceptance/lock-acceptance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAkB,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAQ/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAM1D,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,gHAAgH;AAChH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;CAC3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,MAAM,CAuB1E"}
@@ -1,4 +1,5 @@
1
1
  import { CliError } from '../cli-error.js';
2
+ import { formatJson } from '../json/format-json.js';
2
3
  import { countsFor } from './counts-for.js';
3
4
  import { driftOf } from './drift.js';
4
5
  import { lockFileOf } from './lock-file-of.js';
@@ -32,7 +33,7 @@ export function lockAcceptance(ws, request) {
32
33
  amendments: [...(previous?.amendments ?? []), ...amendments],
33
34
  };
34
35
  const file = lockFileOf(story.story);
35
- ws.update(file, `${JSON.stringify(lock, null, 2)}\n`);
36
+ ws.update(file, formatJson(lock));
36
37
  return { file, scenarios: written.length, tests: tests.length, amendments };
37
38
  }
38
39
  /** The regression tests of a fix as the lock records them: each written test of each listed spec. */
@@ -1 +1 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