ddd-ts-kit 0.91.0 → 0.93.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 (484) hide show
  1. package/CHANGELOG.md +225 -0
  2. package/README.fr.md +27 -18
  3. package/README.md +24 -15
  4. package/dist/acceptance/check-locked-files.d.ts +25 -0
  5. package/dist/acceptance/check-locked-files.d.ts.map +1 -0
  6. package/dist/acceptance/check-locked-files.js +84 -0
  7. package/dist/acceptance/check-locked-files.js.map +1 -0
  8. package/dist/acceptance/lock-acceptance.d.ts.map +1 -1
  9. package/dist/acceptance/lock-acceptance.js +2 -1
  10. package/dist/acceptance/lock-acceptance.js.map +1 -1
  11. package/dist/acceptance/scenarios-in.d.ts +4 -0
  12. package/dist/acceptance/scenarios-in.d.ts.map +1 -1
  13. package/dist/acceptance/scenarios-in.js +2 -2
  14. package/dist/acceptance/scenarios-in.js.map +1 -1
  15. package/dist/check/event-sourcing/read-stored-shape.d.ts +2 -0
  16. package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
  17. package/dist/check/event-sourcing/read-stored-shape.js +3 -1
  18. package/dist/check/event-sourcing/read-stored-shape.js.map +1 -1
  19. package/dist/check/event-sourcing/stored-event-declaration.d.ts +2 -0
  20. package/dist/check/event-sourcing/stored-event-declaration.d.ts.map +1 -1
  21. package/dist/check/event-sourcing/stored-event-declarations.js +1 -0
  22. package/dist/check/event-sourcing/stored-event-declarations.js.map +1 -1
  23. package/dist/check/event-sourcing/stored-shape.d.ts +2 -0
  24. package/dist/check/event-sourcing/stored-shape.d.ts.map +1 -1
  25. package/dist/check/fixtures/nest-controllers-fixtures.d.ts.map +1 -1
  26. package/dist/check/fixtures/nest-controllers-fixtures.js +21 -3
  27. package/dist/check/fixtures/nest-controllers-fixtures.js.map +1 -1
  28. package/dist/check/nest/nest-equivalents-of.d.ts.map +1 -1
  29. package/dist/check/nest/nest-equivalents-of.js +7 -2
  30. package/dist/check/nest/nest-equivalents-of.js.map +1 -1
  31. package/dist/check/rules/nest-controllers-current.d.ts.map +1 -1
  32. package/dist/check/rules/nest-controllers-current.js +13 -2
  33. package/dist/check/rules/nest-controllers-current.js.map +1 -1
  34. package/dist/commands/acceptance.d.ts.map +1 -1
  35. package/dist/commands/acceptance.js +14 -0
  36. package/dist/commands/acceptance.js.map +1 -1
  37. package/dist/commands/docs.d.ts.map +1 -1
  38. package/dist/commands/docs.js +13 -5
  39. package/dist/commands/docs.js.map +1 -1
  40. package/dist/commands/drizzle-generate.d.ts.map +1 -1
  41. package/dist/commands/drizzle-generate.js +21 -1
  42. package/dist/commands/drizzle-generate.js.map +1 -1
  43. package/dist/commands/generate.js +4 -0
  44. package/dist/commands/generate.js.map +1 -1
  45. package/dist/commands/prisma-generate.d.ts +7 -0
  46. package/dist/commands/prisma-generate.d.ts.map +1 -0
  47. package/dist/commands/prisma-generate.js +23 -0
  48. package/dist/commands/prisma-generate.js.map +1 -0
  49. package/dist/commands/typeorm-generate.d.ts +10 -0
  50. package/dist/commands/typeorm-generate.d.ts.map +1 -0
  51. package/dist/commands/typeorm-generate.js +37 -0
  52. package/dist/commands/typeorm-generate.js.map +1 -0
  53. package/dist/commit/run-git.d.ts +5 -1
  54. package/dist/commit/run-git.d.ts.map +1 -1
  55. package/dist/commit/run-git.js +19 -2
  56. package/dist/commit/run-git.js.map +1 -1
  57. package/dist/config/stack.d.ts +1 -1
  58. package/dist/config/stack.d.ts.map +1 -1
  59. package/dist/config/stack.js +1 -1
  60. package/dist/config/stack.js.map +1 -1
  61. package/dist/controllers/finish-migration.js +4 -2
  62. package/dist/controllers/finish-migration.js.map +1 -1
  63. package/dist/describe/guard-errors.d.ts +3 -0
  64. package/dist/describe/guard-errors.d.ts.map +1 -0
  65. package/dist/describe/guard-errors.js +10 -0
  66. package/dist/describe/guard-errors.js.map +1 -0
  67. package/dist/describe/no-group.d.ts +4 -0
  68. package/dist/describe/no-group.d.ts.map +1 -0
  69. package/dist/describe/no-group.js +3 -0
  70. package/dist/describe/no-group.js.map +1 -0
  71. package/dist/describe/read-controllers.d.ts +1 -1
  72. package/dist/describe/read-controllers.d.ts.map +1 -1
  73. package/dist/describe/read-controllers.js +12 -19
  74. package/dist/describe/read-controllers.js.map +1 -1
  75. package/dist/describe/read-nest-controller-routes.d.ts +16 -0
  76. package/dist/describe/read-nest-controller-routes.d.ts.map +1 -0
  77. package/dist/describe/read-nest-controller-routes.js +117 -0
  78. package/dist/describe/read-nest-controller-routes.js.map +1 -0
  79. package/dist/describe/schema-class-of.d.ts +3 -0
  80. package/dist/describe/schema-class-of.d.ts.map +1 -0
  81. package/dist/describe/schema-class-of.js +10 -0
  82. package/dist/describe/schema-class-of.js.map +1 -0
  83. package/dist/docs/behaviour-page.d.ts.map +1 -1
  84. package/dist/docs/behaviour-page.js +9 -1
  85. package/dist/docs/behaviour-page.js.map +1 -1
  86. package/dist/docs/declared-stored-events.d.ts +6 -2
  87. package/dist/docs/declared-stored-events.d.ts.map +1 -1
  88. package/dist/docs/declared-stored-events.js +4 -3
  89. package/dist/docs/declared-stored-events.js.map +1 -1
  90. package/dist/docs/emptily-recorded-stored-events.d.ts +6 -0
  91. package/dist/docs/emptily-recorded-stored-events.d.ts.map +1 -0
  92. package/dist/docs/emptily-recorded-stored-events.js +12 -0
  93. package/dist/docs/emptily-recorded-stored-events.js.map +1 -0
  94. package/dist/docs/refuse-unreadable-stored-events.d.ts +7 -0
  95. package/dist/docs/refuse-unreadable-stored-events.d.ts.map +1 -0
  96. package/dist/docs/refuse-unreadable-stored-events.js +27 -0
  97. package/dist/docs/refuse-unreadable-stored-events.js.map +1 -0
  98. package/dist/docs/write-stored-events-lock.d.ts +3 -2
  99. package/dist/docs/write-stored-events-lock.d.ts.map +1 -1
  100. package/dist/docs/write-stored-events-lock.js +5 -2
  101. package/dist/docs/write-stored-events-lock.js.map +1 -1
  102. package/dist/generate/kind.d.ts +4 -0
  103. package/dist/generate/kind.d.ts.map +1 -1
  104. package/dist/generate/kinds/aggregate-kind.d.ts.map +1 -1
  105. package/dist/generate/kinds/aggregate-kind.js +6 -2
  106. package/dist/generate/kinds/aggregate-kind.js.map +1 -1
  107. package/dist/generate/kinds/assert-event-store.d.ts +4 -0
  108. package/dist/generate/kinds/assert-event-store.d.ts.map +1 -0
  109. package/dist/generate/kinds/assert-event-store.js +10 -0
  110. package/dist/generate/kinds/assert-event-store.js.map +1 -0
  111. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts +9 -0
  112. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -0
  113. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +49 -0
  114. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -0
  115. package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
  116. package/dist/generate/kinds/file-upload-kind.js +9 -2
  117. package/dist/generate/kinds/file-upload-kind.js.map +1 -1
  118. package/dist/generate/kinds/form-kind.d.ts.map +1 -1
  119. package/dist/generate/kinds/form-kind.js +15 -11
  120. package/dist/generate/kinds/form-kind.js.map +1 -1
  121. package/dist/generate/kinds/generate-event-sourced-repository.d.ts +11 -0
  122. package/dist/generate/kinds/generate-event-sourced-repository.d.ts.map +1 -0
  123. package/dist/generate/kinds/generate-event-sourced-repository.js +48 -0
  124. package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -0
  125. package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
  126. package/dist/generate/kinds/generate-repository.js +5 -0
  127. package/dist/generate/kinds/generate-repository.js.map +1 -1
  128. package/dist/generate/kinds/is-event-sourced.d.ts +9 -0
  129. package/dist/generate/kinds/is-event-sourced.d.ts.map +1 -0
  130. package/dist/generate/kinds/is-event-sourced.js +11 -0
  131. package/dist/generate/kinds/is-event-sourced.js.map +1 -0
  132. package/dist/generate/kinds/job/job-vars.d.ts +4 -1
  133. package/dist/generate/kinds/job/job-vars.d.ts.map +1 -1
  134. package/dist/generate/kinds/job/job-vars.js +11 -1
  135. package/dist/generate/kinds/job/job-vars.js.map +1 -1
  136. package/dist/generate/kinds/job-kind.js +20 -3
  137. package/dist/generate/kinds/job-kind.js.map +1 -1
  138. package/dist/generate/kinds/presentation/controller-source.d.ts +11 -3
  139. package/dist/generate/kinds/presentation/controller-source.d.ts.map +1 -1
  140. package/dist/generate/kinds/presentation/controller-source.js +25 -4
  141. package/dist/generate/kinds/presentation/controller-source.js.map +1 -1
  142. package/dist/generate/kinds/repository-kind.js +1 -1
  143. package/dist/generate/kinds/repository-kind.js.map +1 -1
  144. package/dist/generate/kinds/representation-kind.d.ts.map +1 -1
  145. package/dist/generate/kinds/representation-kind.js +4 -3
  146. package/dist/generate/kinds/representation-kind.js.map +1 -1
  147. package/dist/generate/kinds/route/nest-controller-vars.d.ts +2 -2
  148. package/dist/generate/kinds/route/nest-controller-vars.js +3 -9
  149. package/dist/generate/kinds/route/nest-controller-vars.js.map +1 -1
  150. package/dist/generate/kinds/route/nest-search-vars.d.ts +6 -0
  151. package/dist/generate/kinds/route/nest-search-vars.d.ts.map +1 -0
  152. package/dist/generate/kinds/route/nest-search-vars.js +18 -0
  153. package/dist/generate/kinds/route/nest-search-vars.js.map +1 -0
  154. package/dist/generate/kinds/route/write-nest-controller.d.ts.map +1 -1
  155. package/dist/generate/kinds/route/write-nest-controller.js +6 -8
  156. package/dist/generate/kinds/route/write-nest-controller.js.map +1 -1
  157. package/dist/generate/kinds/route-kind.js +1 -1
  158. package/dist/generate/kinds/route-kind.js.map +1 -1
  159. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  160. package/dist/generate/kinds/service-kind.js +30 -3
  161. package/dist/generate/kinds/service-kind.js.map +1 -1
  162. package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -1
  163. package/dist/generate/kinds/wire-repository-on-first-use.js +2 -1
  164. package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -1
  165. package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
  166. package/dist/generate/kinds/write-event-sourced-aggregate.js +5 -13
  167. package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
  168. package/dist/help/notes.d.ts +1 -1
  169. package/dist/help/notes.d.ts.map +1 -1
  170. package/dist/help/notes.js +3 -1
  171. package/dist/help/notes.js.map +1 -1
  172. package/dist/help/usage.d.ts +1 -1
  173. package/dist/help/usage.d.ts.map +1 -1
  174. package/dist/help/usage.js +3 -1
  175. package/dist/help/usage.js.map +1 -1
  176. package/dist/init/agent-permissions.js +10 -6
  177. package/dist/init/agent-permissions.js.map +1 -1
  178. package/dist/init/files/auth-files.js +4 -0
  179. package/dist/init/files/auth-files.js.map +1 -1
  180. package/dist/init/files/inert-persistence-file.d.ts +5 -0
  181. package/dist/init/files/inert-persistence-file.d.ts.map +1 -0
  182. package/dist/init/files/inert-persistence-file.js +16 -0
  183. package/dist/init/files/inert-persistence-file.js.map +1 -0
  184. package/dist/init/files/platform-files.js +7 -1
  185. package/dist/init/files/platform-files.js.map +1 -1
  186. package/dist/init/knip-vars.js +4 -3
  187. package/dist/init/knip-vars.js.map +1 -1
  188. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  189. package/dist/init/manifest/database-scripts.js +10 -4
  190. package/dist/init/manifest/database-scripts.js.map +1 -1
  191. package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -1
  192. package/dist/init/manifest/dependencies-against-stack.js +5 -1
  193. package/dist/init/manifest/dependencies-against-stack.js.map +1 -1
  194. package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
  195. package/dist/init/manifest/dependencies-for.js +7 -1
  196. package/dist/init/manifest/dependencies-for.js.map +1 -1
  197. package/dist/init/manifest/versions.d.ts.map +1 -1
  198. package/dist/init/manifest/versions.js +34 -30
  199. package/dist/init/manifest/versions.js.map +1 -1
  200. package/dist/init/stack/resolve-stack.js +9 -7
  201. package/dist/init/stack/resolve-stack.js.map +1 -1
  202. package/dist/init/template-vars.js +1 -1
  203. package/dist/init/template-vars.js.map +1 -1
  204. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  205. package/dist/init/write-type-script-configs.js +4 -1
  206. package/dist/init/write-type-script-configs.js.map +1 -1
  207. package/dist/markers/insert-in-region.js +1 -1
  208. package/dist/markers/insert-in-region.js.map +1 -1
  209. package/dist/measures/branch-commits.d.ts +4 -2
  210. package/dist/measures/branch-commits.d.ts.map +1 -1
  211. package/dist/measures/branch-commits.js +32 -8
  212. package/dist/measures/branch-commits.js.map +1 -1
  213. package/dist/measures/timeline-of.d.ts +3 -2
  214. package/dist/measures/timeline-of.d.ts.map +1 -1
  215. package/dist/measures/timeline-of.js +37 -8
  216. package/dist/measures/timeline-of.js.map +1 -1
  217. package/dist/merge/lost/untouched-by-branch.d.ts +12 -0
  218. package/dist/merge/lost/untouched-by-branch.d.ts.map +1 -0
  219. package/dist/merge/lost/untouched-by-branch.js +22 -0
  220. package/dist/merge/lost/untouched-by-branch.js.map +1 -0
  221. package/dist/merge/lost/verify-merge.d.ts.map +1 -1
  222. package/dist/merge/lost/verify-merge.js +6 -1
  223. package/dist/merge/lost/verify-merge.js.map +1 -1
  224. package/dist/migration/audit-guard/append-audit-guard.d.ts +18 -0
  225. package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -0
  226. package/dist/migration/audit-guard/append-audit-guard.js +27 -0
  227. package/dist/migration/audit-guard/append-audit-guard.js.map +1 -0
  228. package/dist/migration/audit-guard/audit-guard-statements-of.d.ts +7 -0
  229. package/dist/migration/audit-guard/audit-guard-statements-of.d.ts.map +1 -0
  230. package/dist/migration/audit-guard/audit-guard-statements-of.js +18 -0
  231. package/dist/migration/audit-guard/audit-guard-statements-of.js.map +1 -0
  232. package/dist/migration/audit-guard/audit-schema-created.d.ts +3 -0
  233. package/dist/migration/audit-guard/audit-schema-created.d.ts.map +1 -0
  234. package/dist/migration/audit-guard/audit-schema-created.js +9 -0
  235. package/dist/migration/audit-guard/audit-schema-created.js.map +1 -0
  236. package/dist/migration/audit-guard/generate-guarded.d.ts +16 -0
  237. package/dist/migration/audit-guard/generate-guarded.d.ts.map +1 -0
  238. package/dist/migration/audit-guard/generate-guarded.js +22 -0
  239. package/dist/migration/audit-guard/generate-guarded.js.map +1 -0
  240. package/dist/migration/audit-guard/guard-marker.d.ts +3 -0
  241. package/dist/migration/audit-guard/guard-marker.d.ts.map +1 -0
  242. package/dist/migration/audit-guard/guard-marker.js +3 -0
  243. package/dist/migration/audit-guard/guard-marker.js.map +1 -0
  244. package/dist/migration/audit-guard/guarded-text.d.ts +5 -0
  245. package/dist/migration/audit-guard/guarded-text.d.ts.map +1 -0
  246. package/dist/migration/audit-guard/guarded-text.js +26 -0
  247. package/dist/migration/audit-guard/guarded-text.js.map +1 -0
  248. package/dist/migration/audit-guard/migrations-under.d.ts +3 -0
  249. package/dist/migration/audit-guard/migrations-under.d.ts.map +1 -0
  250. package/dist/migration/audit-guard/migrations-under.js +15 -0
  251. package/dist/migration/audit-guard/migrations-under.js.map +1 -0
  252. package/dist/migration/audit-guard/run-orm-tool.d.ts +3 -0
  253. package/dist/migration/audit-guard/run-orm-tool.d.ts.map +1 -0
  254. package/dist/migration/audit-guard/run-orm-tool.js +13 -0
  255. package/dist/migration/audit-guard/run-orm-tool.js.map +1 -0
  256. package/dist/migration/audit-guard/schemas-first.d.ts +6 -0
  257. package/dist/migration/audit-guard/schemas-first.d.ts.map +1 -0
  258. package/dist/migration/audit-guard/schemas-first.js +17 -0
  259. package/dist/migration/audit-guard/schemas-first.js.map +1 -0
  260. package/dist/migration/audit-guard/schemas-if-missing.d.ts +7 -0
  261. package/dist/migration/audit-guard/schemas-if-missing.d.ts.map +1 -0
  262. package/dist/migration/audit-guard/schemas-if-missing.js +9 -0
  263. package/dist/migration/audit-guard/schemas-if-missing.js.map +1 -0
  264. package/dist/migration/audit-guard/type-only-imports.d.ts +6 -0
  265. package/dist/migration/audit-guard/type-only-imports.d.ts.map +1 -0
  266. package/dist/migration/audit-guard/type-only-imports.js +8 -0
  267. package/dist/migration/audit-guard/type-only-imports.js.map +1 -0
  268. package/dist/migration/format-as-the-project.d.ts +4 -0
  269. package/dist/migration/format-as-the-project.d.ts.map +1 -0
  270. package/dist/migration/format-as-the-project.js +27 -0
  271. package/dist/migration/format-as-the-project.js.map +1 -0
  272. package/dist/migration/format-written-files.d.ts.map +1 -1
  273. package/dist/migration/format-written-files.js +2 -24
  274. package/dist/migration/format-written-files.js.map +1 -1
  275. package/dist/migration/index.d.ts +8 -0
  276. package/dist/migration/index.d.ts.map +1 -1
  277. package/dist/migration/index.js +8 -0
  278. package/dist/migration/index.js.map +1 -1
  279. package/dist/nest-controllers/nest-answer.d.ts +2 -10
  280. package/dist/nest-controllers/nest-answer.d.ts.map +1 -1
  281. package/dist/nest-controllers/nest-controller-entry.d.ts +4 -2
  282. package/dist/nest-controllers/nest-controller-entry.d.ts.map +1 -1
  283. package/dist/nest-controllers/nest-controllers-in.d.ts +6 -0
  284. package/dist/nest-controllers/nest-controllers-in.d.ts.map +1 -0
  285. package/dist/nest-controllers/nest-controllers-in.js +108 -0
  286. package/dist/nest-controllers/nest-controllers-in.js.map +1 -0
  287. package/dist/nest-controllers/nest-read-type.d.ts +12 -0
  288. package/dist/nest-controllers/nest-read-type.d.ts.map +1 -0
  289. package/dist/nest-controllers/nest-read-type.js +2 -0
  290. package/dist/nest-controllers/nest-read-type.js.map +1 -0
  291. package/dist/nest-controllers/nest-request-part.d.ts +9 -0
  292. package/dist/nest-controllers/nest-request-part.d.ts.map +1 -0
  293. package/dist/nest-controllers/nest-request-part.js +2 -0
  294. package/dist/nest-controllers/nest-request-part.js.map +1 -0
  295. package/dist/nest-controllers/parameters-of.d.ts +8 -0
  296. package/dist/nest-controllers/parameters-of.d.ts.map +1 -0
  297. package/dist/nest-controllers/parameters-of.js +32 -0
  298. package/dist/nest-controllers/parameters-of.js.map +1 -0
  299. package/dist/nest-controllers/project-files.d.ts +6 -0
  300. package/dist/nest-controllers/project-files.d.ts.map +1 -0
  301. package/dist/nest-controllers/project-files.js +2 -0
  302. package/dist/nest-controllers/project-files.js.map +1 -0
  303. package/dist/nest-controllers/read-nest-controllers.d.ts +6 -9
  304. package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -1
  305. package/dist/nest-controllers/read-nest-controllers.js +10 -82
  306. package/dist/nest-controllers/read-nest-controllers.js.map +1 -1
  307. package/dist/nest-controllers/render-controllers-file.d.ts +4 -3
  308. package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -1
  309. package/dist/nest-controllers/render-controllers-file.js +45 -29
  310. package/dist/nest-controllers/render-controllers-file.js.map +1 -1
  311. package/dist/platform-layout/platform-layout.d.ts +5 -0
  312. package/dist/platform-layout/platform-layout.d.ts.map +1 -1
  313. package/dist/platform-layout/platform-layout.js +5 -0
  314. package/dist/platform-layout/platform-layout.js.map +1 -1
  315. package/dist/presets/identity-refusal.js +3 -3
  316. package/dist/presets/identity-refusal.js.map +1 -1
  317. package/dist/presets/no-flags.d.ts.map +1 -1
  318. package/dist/presets/no-flags.js +1 -0
  319. package/dist/presets/no-flags.js.map +1 -1
  320. package/dist/presets/preset-files.d.ts.map +1 -1
  321. package/dist/presets/preset-files.js +3 -1
  322. package/dist/presets/preset-files.js.map +1 -1
  323. package/dist/progress/build-next-of.d.ts +9 -0
  324. package/dist/progress/build-next-of.d.ts.map +1 -0
  325. package/dist/progress/build-next-of.js +22 -0
  326. package/dist/progress/build-next-of.js.map +1 -0
  327. package/dist/progress/format-progress.d.ts.map +1 -1
  328. package/dist/progress/format-progress.js +3 -0
  329. package/dist/progress/format-progress.js.map +1 -1
  330. package/dist/progress/progress.d.ts +3 -1
  331. package/dist/progress/progress.d.ts.map +1 -1
  332. package/dist/progress/read-progress.d.ts.map +1 -1
  333. package/dist/progress/read-progress.js +7 -2
  334. package/dist/progress/read-progress.js.map +1 -1
  335. package/dist/run.d.ts.map +1 -1
  336. package/dist/run.js +4 -0
  337. package/dist/run.js.map +1 -1
  338. package/dist/stack/authentication-vars.d.ts.map +1 -1
  339. package/dist/stack/authentication-vars.js +8 -2
  340. package/dist/stack/authentication-vars.js.map +1 -1
  341. package/dist/version.d.ts +1 -1
  342. package/dist/version.js +1 -1
  343. package/dist/worker/briefing-of.d.ts.map +1 -1
  344. package/dist/worker/briefing-of.js +2 -4
  345. package/dist/worker/briefing-of.js.map +1 -1
  346. package/dist/worker/resume-message.d.ts.map +1 -1
  347. package/dist/worker/resume-message.js +1 -2
  348. package/dist/worker/resume-message.js.map +1 -1
  349. package/package.json +6 -4
  350. package/templates/architecture/extractable.declared.spec.ts.tpl +2 -2
  351. package/templates/architecture/extractable.manual.spec.ts.tpl +2 -2
  352. package/templates/architecture/extractable.tsyringe.spec.ts.tpl +2 -2
  353. package/templates/architecture/hosting.declared.spec.ts.tpl +69 -0
  354. package/templates/architecture/hosting.manual.spec.ts.tpl +57 -0
  355. package/templates/architecture/hosting.tsyringe.spec.ts.tpl +69 -0
  356. package/templates/background-job/wiring.manual.tpl +1 -1
  357. package/templates/command/wiring.manual.tpl +1 -1
  358. package/templates/context/module.manual.ts.tpl +41 -10
  359. package/templates/erasure-handler/wiring.manual.tpl +1 -1
  360. package/templates/event-handler/wiring.manual.tpl +1 -1
  361. package/templates/file-upload/wiring.manual.tpl +1 -1
  362. package/templates/init/docker/env.example.tpl +9 -1
  363. package/templates/init/e2e/auth-environment.passport.ts.tpl +6 -0
  364. package/templates/init/e2e/create-credentials.passport.ts.tpl +47 -0
  365. package/templates/init/gitignore.tpl +3 -0
  366. package/templates/init/main.ts.tpl +27 -20
  367. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +11 -3
  368. package/templates/init/platform/auth/authentication/actor-of-token.ts.tpl +15 -0
  369. package/templates/init/platform/auth/authentication/bearer-strategy.ts.tpl +29 -0
  370. package/templates/init/platform/auth/authentication/create-authenticator.passport.ts.tpl +13 -0
  371. package/templates/init/platform/composition/compose-application.manual.ts.tpl +30 -6
  372. package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +47 -65
  373. package/templates/init/platform/composition/context-selection.tsyringe.ts.tpl +17 -0
  374. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +16 -1
  375. package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
  376. package/templates/init/platform/composition/platform-error-mapper.ts.tpl +9 -0
  377. package/templates/init/platform/composition/platform-options.manual.ts.tpl +9 -0
  378. package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +11 -0
  379. package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +5 -2
  380. package/templates/init/platform/composition/routes-of.tsyringe.ts.tpl +51 -0
  381. package/templates/init/platform/config/app-config.ts.tpl +9 -2
  382. package/templates/init/platform/config/load-config.ts.tpl +27 -2
  383. package/templates/init/platform/database/open-persistence.memory.ts.tpl +10 -0
  384. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +5 -0
  385. package/templates/init/platform/database/persistence-over.knex.ts.tpl +5 -0
  386. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +5 -0
  387. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +5 -0
  388. package/templates/init/platform/database/persistence.contract.spec.ts.tpl +18 -0
  389. package/templates/init/platform/database/persistence.memory.ts.tpl +7 -1
  390. package/templates/init/platform/database/persistence.orm.ts.tpl +9 -1
  391. package/templates/init/platform/database/schema.drizzle.ts.tpl +11 -1
  392. package/templates/init/platform/database/schema.prisma.tpl +2 -1
  393. package/templates/init/platform/database/schema.typeorm.ts.tpl +1 -1
  394. package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +18 -6
  395. package/templates/init/platform/files/files.module.tsyringe.ts.tpl +6 -2
  396. package/templates/init/platform/http/start-http-server.express.ts.tpl +10 -1
  397. package/templates/init/platform/http/start-http-server.nest.ts.tpl +6 -1
  398. package/templates/init/platform/jobs/job-settings.ts.tpl +13 -3
  399. package/templates/init/platform/privacy/privacy.module.tsyringe.ts.tpl +9 -6
  400. package/templates/init/platform/redis/open-redis.ts.tpl +13 -8
  401. package/templates/init/rules/presentation.md.tpl +1 -1
  402. package/templates/integration-event/wiring.manual.tpl +1 -1
  403. package/templates/integration-handler/wiring.manual.tpl +1 -1
  404. package/templates/job/job.declared.ts.tpl +1 -1
  405. package/templates/job/job.spec.buses.ts.tpl +3 -0
  406. package/templates/job/job.spec.tsyringe.ts.tpl +29 -1
  407. package/templates/job/wiring.manual.tpl +4 -1
  408. package/templates/job/wiring.tsyringe.tpl +1 -1
  409. package/templates/nest-controller/controller.search.ts.tpl +38 -0
  410. package/templates/nest-controller/controller.ts.tpl +1 -17
  411. package/templates/nest-controller/upload.spec.ts.tpl +47 -0
  412. package/templates/nest-controller/upload.ts.tpl +25 -0
  413. package/templates/pipeline/biome.json.tpl +9 -2
  414. package/templates/pipeline/eslint.config.mjs.tpl +6 -0
  415. package/templates/pipeline/knip.json.tpl +1 -0
  416. package/templates/pipeline/package-scripts.json +2 -2
  417. package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +17 -0
  418. package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/deactivate-account.controller.nest-routes.ts.tpl +31 -0
  419. package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.controller.nest-routes.ts.tpl +44 -0
  420. package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +56 -0
  421. package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.controller.nest-routes.ts.tpl +54 -0
  422. package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.controller.nest-routes.ts.tpl +32 -0
  423. package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.controller.nest-routes.ts.tpl +43 -0
  424. package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.controller.nest-routes.ts.tpl +25 -0
  425. package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.controller.nest-routes.ts.tpl +37 -0
  426. package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.controller.nest-routes.ts.tpl +31 -0
  427. package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.controller.nest-routes.ts.tpl +31 -0
  428. package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.controller.nest-routes.ts.tpl +31 -0
  429. package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.controller.nest-routes.ts.tpl +42 -0
  430. package/templates/presets/identity/context/test/integration/organisation.repository.contract.spec.ts.tpl +1 -1
  431. package/templates/presets/identity/context/test/unit/__context__.module.spec.explicit.ts.tpl +13 -0
  432. package/templates/presets/identity/context/test/unit/accept-invitation.controller.spec.nest-routes.ts.tpl +70 -0
  433. package/templates/presets/identity/context/test/unit/change-member-role.controller.spec.nest-routes.ts.tpl +70 -0
  434. package/templates/presets/identity/context/test/unit/deactivate-account.controller.spec.nest-routes.ts.tpl +57 -0
  435. package/templates/presets/identity/context/test/unit/decline-invitation.controller.spec.nest-routes.ts.tpl +70 -0
  436. package/templates/presets/identity/context/test/unit/grant-delegation.controller.spec.nest-routes.ts.tpl +70 -0
  437. package/templates/presets/identity/context/test/unit/invite-member.controller.spec.nest-routes.ts.tpl +70 -0
  438. package/templates/presets/identity/context/test/unit/open-organisation.controller.spec.nest-routes.ts.tpl +70 -0
  439. package/templates/presets/identity/context/test/unit/provision-account.controller.spec.nest-routes.ts.tpl +99 -0
  440. package/templates/presets/identity/context/test/unit/remove-member.controller.spec.nest-routes.ts.tpl +57 -0
  441. package/templates/presets/identity/context/test/unit/revoke-delegation.controller.spec.nest-routes.ts.tpl +57 -0
  442. package/templates/presets/identity/context/test/unit/revoke-invitation.controller.spec.nest-routes.ts.tpl +57 -0
  443. package/templates/presets/identity/context/test/unit/search-members.controller.spec.nest-routes.ts.tpl +54 -0
  444. package/templates/process/timeout-job.wiring.manual.tpl +1 -1
  445. package/templates/query/search.wiring.manual.tpl +1 -1
  446. package/templates/query/wiring.manual.tpl +1 -1
  447. package/templates/repository/contract.spec.ts.tpl +1 -3
  448. package/templates/repository/event-sourced/contract.spec.ts.tpl +36 -0
  449. package/templates/repository/event-sourced/fake.ts.tpl +24 -0
  450. package/templates/repository/event-sourced/repository.ts.tpl +38 -0
  451. package/templates/repository/event-sourced-first-use.wiring.manual.tpl +4 -0
  452. package/templates/repository/event-sourced.wiring.tsyringe.tpl +6 -0
  453. package/templates/repository/first-use.wiring.manual.tpl +1 -1
  454. package/templates/service/compose.tpl +1 -1
  455. package/templates/service/extracted-name.tpl +2 -0
  456. package/templates/service/extracted.declared.tpl +6 -0
  457. package/templates/service/extracted.manual.tpl +2 -0
  458. package/templates/service/extracted.tsyringe.tpl +6 -0
  459. package/templates/service/main.ts.tpl +5 -1
  460. package/templates/worker/main.ts.tpl +20 -13
  461. /package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/{deactivate-account.controller.ts.tpl → deactivate-account.controller.kit-routes.ts.tpl} +0 -0
  462. /package/templates/presets/identity/context/presentation/http/accounts/provision-account/{provision-account.controller.ts.tpl → provision-account.controller.kit-routes.ts.tpl} +0 -0
  463. /package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/{accept-invitation.controller.ts.tpl → accept-invitation.controller.kit-routes.ts.tpl} +0 -0
  464. /package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/{decline-invitation.controller.ts.tpl → decline-invitation.controller.kit-routes.ts.tpl} +0 -0
  465. /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
  466. /package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/{grant-delegation.controller.ts.tpl → grant-delegation.controller.kit-routes.ts.tpl} +0 -0
  467. /package/templates/presets/identity/context/presentation/http/organisations/invite-member/{invite-member.controller.ts.tpl → invite-member.controller.kit-routes.ts.tpl} +0 -0
  468. /package/templates/presets/identity/context/presentation/http/organisations/open-organisation/{open-organisation.controller.ts.tpl → open-organisation.controller.kit-routes.ts.tpl} +0 -0
  469. /package/templates/presets/identity/context/presentation/http/organisations/remove-member/{remove-member.controller.ts.tpl → remove-member.controller.kit-routes.ts.tpl} +0 -0
  470. /package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/{revoke-delegation.controller.ts.tpl → revoke-delegation.controller.kit-routes.ts.tpl} +0 -0
  471. /package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/{revoke-invitation.controller.ts.tpl → revoke-invitation.controller.kit-routes.ts.tpl} +0 -0
  472. /package/templates/presets/identity/context/presentation/http/organisations/search-members/{search-members.controller.ts.tpl → search-members.controller.kit-routes.ts.tpl} +0 -0
  473. /package/templates/presets/identity/context/test/unit/{accept-invitation.controller.spec.ts.tpl → accept-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  474. /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
  475. /package/templates/presets/identity/context/test/unit/{deactivate-account.controller.spec.ts.tpl → deactivate-account.controller.spec.kit-routes.ts.tpl} +0 -0
  476. /package/templates/presets/identity/context/test/unit/{decline-invitation.controller.spec.ts.tpl → decline-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  477. /package/templates/presets/identity/context/test/unit/{grant-delegation.controller.spec.ts.tpl → grant-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
  478. /package/templates/presets/identity/context/test/unit/{invite-member.controller.spec.ts.tpl → invite-member.controller.spec.kit-routes.ts.tpl} +0 -0
  479. /package/templates/presets/identity/context/test/unit/{open-organisation.controller.spec.ts.tpl → open-organisation.controller.spec.kit-routes.ts.tpl} +0 -0
  480. /package/templates/presets/identity/context/test/unit/{provision-account.controller.spec.ts.tpl → provision-account.controller.spec.kit-routes.ts.tpl} +0 -0
  481. /package/templates/presets/identity/context/test/unit/{remove-member.controller.spec.ts.tpl → remove-member.controller.spec.kit-routes.ts.tpl} +0 -0
  482. /package/templates/presets/identity/context/test/unit/{revoke-delegation.controller.spec.ts.tpl → revoke-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
  483. /package/templates/presets/identity/context/test/unit/{revoke-invitation.controller.spec.ts.tpl → revoke-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  484. /package/templates/presets/identity/context/test/unit/{search-members.controller.spec.ts.tpl → search-members.controller.spec.kit-routes.ts.tpl} +0 -0
@@ -1,5 +1,5 @@
1
1
  import type { OutboxStore } from '@ddd-ts-kit/events';
2
- import type { {{#if eventSourcing.on}}EventSourcingStores, {{/if}}{{#if queue.processTable}}ExecutionScope, {{/if}}ProcessedEventStore, {{#if queue.processTable}}ProcessStore, {{/if}}UnitOfWork } from '@ddd-ts-kit/kernel';
2
+ import type { {{#if eventSourcing.on}}EventSourcingStores, {{/if}}{{#if queue.processTable}}ExecutionScope, {{/if}}{{#unless queue.processTable}}{{#if tenancy.any}}{{#if eventSourcing.on}}ExecutionScope, {{/if}}{{/if}}{{/unless}}ProcessedEventStore, {{#if queue.processTable}}ProcessStore, {{/if}}UnitOfWork } from '@ddd-ts-kit/kernel';
3
3
  {{#if queue.database}}
4
4
  import type { JobStore } from '@ddd-ts-kit/scheduling';
5
5
  {{/if}}
@@ -35,8 +35,16 @@ export interface Persistence {
35
35
  * The event store, the snapshots, the checkpoints of the projections it feeds and the keys of the
36
36
  * data subjects, in the `event_store` schema: what an event-sourced aggregate is loaded and saved
37
37
  * through, and what seals its personal values. The platform binds each store to its port.
38
+ {{#if tenancy.any}}
39
+ * It is given the execution scope: each stream keeps the tenant of the work that first appended to it.
40
+ {{/if}}
38
41
  */
42
+ {{#if tenancy.any}}
43
+ readonly eventSourcing: (scope: ExecutionScope) => EventSourcingStores;
44
+ {{/if}}
45
+ {{#unless tenancy.any}}
39
46
  readonly eventSourcing: EventSourcingStores;
47
+ {{/unless}}
40
48
  {{/if}}
41
49
 
42
50
  close(): Promise<void>;
@@ -1,3 +1,4 @@
1
+ import { pgSchema } from 'drizzle-orm/pg-core';
1
2
  {{#if audit.on}}
2
3
  import { auditArchivesTable, auditChainsTable, auditEntriesTable } from '@ddd-ts-kit/audit/drizzle';
3
4
  {{/if}}
@@ -11,6 +12,9 @@ import { {{#if eventSourcing.on}}eventStoreTables, {{/if}}{{#if queue.database}}
11
12
  /** The schema of what the kit stores for the application: the outbox and the processed events{{#if queue.database}}, the background jobs{{/if}}{{#if queue.processTable}}, the process instances{{/if}}. */
12
13
  export const MESSAGING_SCHEMA = 'messaging';
13
14
 
15
+ /** Exported, so that drizzle-kit writes its `CREATE SCHEMA` before the first table it holds. */
16
+ export const messaging = pgSchema(MESSAGING_SCHEMA);
17
+
14
18
  {{#if tenancy.any}}
15
19
  /** It keeps the tenant of each event, so that its consumers run in that tenant. */
16
20
  export const outbox = tenantOutboxTable(MESSAGING_SCHEMA);
@@ -34,7 +38,10 @@ export const processes = processesTable(MESSAGING_SCHEMA);
34
38
  /** The schema of the audit trail. */
35
39
  export const AUDIT_SCHEMA = 'audit';
36
40
 
37
- // TODO(platform): drizzle-kit writes no trigger. After the first `npm run db:generate <name>`, add a custom migration (`npm run db:generate -- audit-guard --custom`) holding the statements `npm run db:audit-guard` prints: they make the entries refuse UPDATE, DELETE and TRUNCATE.
41
+ /** Exported, so that drizzle-kit writes its `CREATE SCHEMA` before the first table it holds. */
42
+ export const audit = pgSchema(AUDIT_SCHEMA);
43
+
44
+ // drizzle-kit writes no trigger: `npm run db:generate <name>` adds the statements that make the audit trail append-only (UPDATE, DELETE and TRUNCATE refused) to the migration that creates it; `npm run db:audit-guard` prints them for a migration written by hand.
38
45
  export const auditEntries = auditEntriesTable(AUDIT_SCHEMA);
39
46
  export const auditChains = auditChainsTable(AUDIT_SCHEMA);
40
47
  /** One row per range of a chain moved to the storage of files: the anchor the chain goes on from. */
@@ -45,6 +52,9 @@ export const auditArchives = auditArchivesTable(AUDIT_SCHEMA);
45
52
  /** The schema of the event store: the events, the snapshots, the checkpoints and the keys of the data subjects. It records no tenant. */
46
53
  export const EVENT_STORE_SCHEMA = 'event_store';
47
54
 
55
+ /** Exported, so that drizzle-kit writes its `CREATE SCHEMA` before the first table it holds. */
56
+ export const eventStoreSchema = pgSchema(EVENT_STORE_SCHEMA);
57
+
48
58
  const eventStore = eventStoreTables(EVENT_STORE_SCHEMA);
49
59
 
50
60
  export const storedEventsHead = eventStore.head;
@@ -126,6 +126,7 @@ model StoredEvent {
126
126
  data Json
127
127
  metadata Json
128
128
  occurredAt DateTime @map("occurred_at") @db.Timestamptz(3)
129
+ tenantId String? @map("tenant_id")
129
130
  recordedAt DateTime @default(now()) @map("recorded_at") @db.Timestamptz(3)
130
131
 
131
132
  @@unique([stream, version])
@@ -166,7 +167,7 @@ model SubjectKey {
166
167
  {{/if}}
167
168
  {{#if audit.on}}
168
169
 
169
- // TODO(platform): Prisma writes no trigger. After the first `npm run db:generate <name>`, add a migration (`npm run db:generate audit-guard`) holding the statements `npm run db:audit-guard` prints: they make the entries refuse UPDATE, DELETE and TRUNCATE.
170
+ // Prisma writes no trigger: `npm run db:generate <name>` adds the statements that make the audit trail append-only (UPDATE, DELETE and TRUNCATE refused) to the migration that creates it; `npm run db:audit-guard` prints them for a migration written by hand.
170
171
  /// The audit trail of @ddd-ts-kit/audit: written by PrismaAuditTrail with raw statements, append-only once the guard is migrated.
171
172
  model AuditEntry {
172
173
  id String @unique
@@ -38,7 +38,7 @@ export const eventStore = eventStoreEntities({ schema: EVENT_STORE_SCHEMA });
38
38
  /** The schema of the audit trail. */
39
39
  export const AUDIT_SCHEMA = 'audit';
40
40
 
41
- // TODO(platform): TypeORM writes no trigger. After the first `npm run db:generate migrations/<name>`, add a migration of your own that runs the statements `npm run db:audit-guard` prints: they make the entries refuse UPDATE, DELETE and TRUNCATE.
41
+ // TypeORM writes no trigger: `npm run db:generate migrations/<name>` adds the statements that make the audit trail append-only (UPDATE, DELETE and TRUNCATE refused) to the migration that creates it; `npm run db:audit-guard` prints them for a migration written by hand.
42
42
  export const auditTrail = auditEntities({ schema: AUDIT_SCHEMA });
43
43
 
44
44
  {{/if}}
@@ -1,7 +1,7 @@
1
1
  {{#if audit.on}}
2
2
  import { auditedSubjectKeys, type AuditSource } from '@ddd-ts-kit/audit';
3
3
  {{/if}}
4
- import { PersonalDataCipher, type EventSourcingStores } from '@ddd-ts-kit/kernel';
4
+ import { PersonalDataCipher, type EventSourcingStores{{#if tenancy.any}}, type ExecutionScope{{/if}} } from '@ddd-ts-kit/kernel';
5
5
  {{#if audit.on}}
6
6
  import type { Audit } from '{{alias.platform}}/audit/create-audit{{alias.ext}}';
7
7
  {{/if}}
@@ -22,15 +22,27 @@ export interface EventSourcing extends EventSourcingStores {
22
22
 
23
23
  {{#if audit.on}}
24
24
  export function createEventSourcing(persistence: Persistence, audit: Audit, source: AuditSource): EventSourcing {
25
- const subjectKeys = auditedSubjectKeys(persistence.eventSourcing.subjectKeys, audit.trail, source);
25
+ {{#if tenancy.any}}
26
+ const stores = persistence.eventSourcing(source.scope);
27
+ {{/if}}
28
+ {{#unless tenancy.any}}
29
+ const stores = persistence.eventSourcing;
30
+ {{/unless}}
31
+ const subjectKeys = auditedSubjectKeys(stores.subjectKeys, audit.trail, source);
26
32
 
27
- return { ...persistence.eventSourcing, subjectKeys, cipher: new PersonalDataCipher(subjectKeys) };
33
+ return { ...stores, subjectKeys, cipher: new PersonalDataCipher(subjectKeys) };
28
34
  }
29
35
  {{/if}}
30
36
  {{#unless audit.on}}
31
- export function createEventSourcing(persistence: Persistence): EventSourcing {
32
- const { subjectKeys } = persistence.eventSourcing;
37
+ export function createEventSourcing(persistence: Persistence{{#if tenancy.any}}, scope: ExecutionScope{{/if}}): EventSourcing {
38
+ {{#if tenancy.any}}
39
+ const stores = persistence.eventSourcing(scope);
40
+ {{/if}}
41
+ {{#unless tenancy.any}}
42
+ const stores = persistence.eventSourcing;
43
+ {{/unless}}
44
+ const { subjectKeys } = stores;
33
45
 
34
- return { ...persistence.eventSourcing, cipher: new PersonalDataCipher(subjectKeys) };
46
+ return { ...stores, cipher: new PersonalDataCipher(subjectKeys) };
35
47
  }
36
48
  {{/unless}}
@@ -7,12 +7,16 @@ import { bindFiles } from '{{alias.platform}}/files/bind-files{{alias.ext}}';
7
7
  * for the tools and the tests), its ports, and the hourly purge of what rolled-back commands left
8
8
  * in `staging/`.
9
9
  */
10
- export function filesModule(storage: FileStorage): ContextModule {
10
+ export function filesModule(storage: FileStorage, { jobs = true }: { readonly jobs?: boolean } = {}): ContextModule {
11
11
  return defineContextModule({
12
12
  name: 'files',
13
13
  register(builder) {
14
14
  bindFiles(builder, storage);
15
- builder.job('files.purge-staged', { every: '1h' }).handledBy(PurgeStagedFiles, [FileStaging, Clock]);
15
+
16
+ // Registered by the process that runs the jobs of the platform; a service of the deployment passes `jobs: false`.
17
+ if (jobs) {
18
+ builder.job('files.purge-staged', { every: '1h' }).handledBy(PurgeStagedFiles, [FileStaging, Clock]);
19
+ }
16
20
  },
17
21
  });
18
22
  }
@@ -48,7 +48,16 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
48
48
  // Before the JSON parser, which would read first a JSON file sent through a signed link.
49
49
  mountExpress(app, served.fileRoutes, served.boundary);
50
50
  {{/if}}
51
- app.use(express.json());
51
+
52
+ // The bytes of a JSON body are kept for a controller that declares `rawBody` (a signed webhook).
53
+ app.use(
54
+ express.json({
55
+ verify: (request, _response, bytes) => {
56
+ Object.assign(request, { rawBody: bytes });
57
+ },
58
+ }),
59
+ );
60
+
52
61
  {{#unless rpc.none}}
53
62
  serveProcedures(app, served);
54
63
  {{/unless}}
@@ -73,10 +73,15 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
73
73
  {{#if routes.nest}}
74
74
  const app = await NestFactory.create(createAppModule(routes, served.boundary, served.controllers), {
75
75
  logger: ['error', 'warn'],
76
+ // Keeps the bytes of the body for a controller that declares `rawBody` (a signed webhook).
77
+ rawBody: true,
76
78
  });
77
79
  {{/if}}
78
80
  {{#unless routes.nest}}
79
- const app = await NestFactory.create(createAppModule(routes, served.boundary), { logger: ['error', 'warn'] });
81
+ const app = await NestFactory.create(createAppModule(routes, served.boundary), {
82
+ logger: ['error', 'warn'],
83
+ rawBody: true,
84
+ });
80
85
  {{/unless}}
81
86
 
82
87
  {{#if cache.rateLimit}}
@@ -2,12 +2,20 @@ import type { JobSettings } from '@ddd-ts-kit/kernel';
2
2
 
3
3
  type Environment = Readonly<Record<string, string | undefined>>;
4
4
 
5
+ /** The contexts run as services of their own (`ddd-ts-kit generate service`): the whole application schedules none of their jobs. */
6
+ const extracted: readonly string[] = [
7
+ // ddd-ts-kit:extracted
8
+ // /ddd-ts-kit:extracted
9
+ ];
10
+
5
11
  /**
6
12
  * What configuration changes of each scheduled job, by job name: a job is switched off in one
7
13
  * environment with `JOB_<CONTEXT>_<JOB>_ENABLED=false`, never by a code change.
8
14
  * `ddd-ts-kit generate job` adds a line; a schedule or a timeout read from the environment goes
9
- * on the same line. Given a context, only its jobs are kept: the wiring refuses the settings of a
10
- * job no module declares (`UNKNOWN_JOB`), and a service that hosts one context declares only its own.
15
+ * on the same line. The wiring refuses the settings of a job no module declares (`UNKNOWN_JOB`), so each
16
+ * process is given those of the jobs it registers: a service that hosts one context is given a context
17
+ * and keeps its jobs only (the jobs of the platform run in the whole application); the whole application
18
+ * is given none, and leaves out the jobs of the contexts run as services of their own.
11
19
  */
12
20
  export function jobSettings(environment: Environment, context?: string): Readonly<Record<string, JobSettings>> {
13
21
  const settings: Readonly<Record<string, JobSettings>> = {
@@ -27,7 +35,9 @@ export function jobSettings(environment: Environment, context?: string): Readonl
27
35
  };
28
36
 
29
37
  if (context === undefined) {
30
- return settings;
38
+ return Object.fromEntries(
39
+ Object.entries(settings).filter(([name]) => !extracted.some((hosted) => name.startsWith(hosted + '.'))),
40
+ );
31
41
  }
32
42
 
33
43
  return Object.fromEntries(Object.entries(settings).filter(([name]) => name.startsWith(context + '.')));
@@ -6,15 +6,18 @@ import { runPurge } from '{{alias.platform}}/privacy/run-purge{{alias.ext}}';
6
6
  * retention their declaration gives are purged (`privacy.purge-expired`, switched off in one
7
7
  * environment with `JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false`).
8
8
  */
9
- export function privacyModule(): ContextModule {
9
+ export function privacyModule({ jobs = true }: { readonly jobs?: boolean } = {}): ContextModule {
10
10
  return defineContextModule({
11
11
  name: 'privacy',
12
12
  register(builder) {
13
- builder.job('privacy.purge-expired', { cron: '0 3 * * *' }).handledByFactory((resolve) => ({
14
- run: async () => {
15
- await runPurge(resolve);
16
- },
17
- }));
13
+ // Registered by the process that runs the jobs of the platform; a service of the deployment passes `jobs: false`.
14
+ if (jobs) {
15
+ builder.job('privacy.purge-expired', { cron: '0 3 * * *' }).handledByFactory((resolve) => ({
16
+ run: async () => {
17
+ await runPurge(resolve);
18
+ },
19
+ }));
20
+ }
18
21
  },
19
22
  });
20
23
  }
@@ -67,25 +67,30 @@ export interface RedisServices {
67
67
 
68
68
  interface RedisSettings {
69
69
  readonly redisUrl: string;
70
- /** Prefix of every key, so that several services share one server. */
71
- readonly serviceName: string;
70
+ /**
71
+ * Prefix of every key. The same for every process of one deployment (`DEPLOYMENT_NAME`), never
72
+ * the name of the container: the lock that keeps an occurrence of a job to one run, the cache
73
+ * a purge reaches and the jobs waiting in the store are shared by the API, the worker and the
74
+ * services, and each would otherwise find only its own keys.
75
+ */
76
+ readonly deploymentName: string;
72
77
  }
73
78
 
74
- export function openRedis({ redisUrl, serviceName }: RedisSettings): RedisServices {
79
+ export function openRedis({ redisUrl, deploymentName }: RedisSettings): RedisServices {
75
80
  const connection = connectRedis(redisUrl);
76
81
  {{#if cache.relaySignal}}
77
- const relaySignal = new RedisRelaySignal(connection.client, { channel: serviceName + ':outbox' });
82
+ const relaySignal = new RedisRelaySignal(connection.client, { channel: deploymentName + ':outbox' });
78
83
  {{/if}}
79
84
 
80
85
  return {
81
- cache: (metrics) => new RedisCache(connection.client, { namespace: serviceName, metrics }),
86
+ cache: (metrics) => new RedisCache(connection.client, { namespace: deploymentName, metrics }),
82
87
  // While the server is away the API keeps serving, without a limit: a limiter must not take the application down.
83
- rateLimiter: new RedisRateLimiter(connection.client, { namespace: serviceName + ':rate', onError: 'allow' }),
84
- lock: new RedisLock(connection.client, { namespace: serviceName + ':lock' }),
88
+ rateLimiter: new RedisRateLimiter(connection.client, { namespace: deploymentName + ':rate', onError: 'allow' }),
89
+ lock: new RedisLock(connection.client, { namespace: deploymentName + ':lock' }),
85
90
  {{#if queue.redis}}
86
91
  jobs: (logger, errors) =>
87
92
  new RedisJobStore(connection.client, {
88
- namespace: serviceName + ':jobs',
93
+ namespace: deploymentName + ':jobs',
89
94
  onLostJob: reportLostJobs(logger, errors),
90
95
  }),
91
96
  {{/if}}
@@ -19,7 +19,7 @@ paths:
19
19
  {{/if}}
20
20
  {{#if routes.nest}}
21
21
  - A route is a Nest controller the kit serves: `<use-case>.controller.ts` in `presentation/http/<resource>/<use-case>/`, `@Controller()` and `@KitRoutes({ group: <Resource>Routes })` on the class, `@Post`, `@Get`... of Nest on its method, which names the route (its `operationId`) after the method, and `@KitRoute({ request, response, errors })` of `@ddd-ts-kit/http/nest` for what Nest does not say. The method reads `@Param()`, `@Query()`, `@Headers()`, `@Body()` typed by the DTO classes beside it, and the caller with `@CurrentActor()`; it builds the command or the query and sends it through the bus the constructor injects (`@Inject(CommandBus)`), nothing else: the buses are the only providers the platform gives Nest for the controllers. Nest builds the controller (the module of the context lists it under `controllers`), the kit serves it: guards of the group, validation by `request`, problem documents, the contract.
22
- - A method answers what its signature says: a DTO class (`Promise<<UseCase>Answer>`), `Accepted` or `void`, which `ddd-ts-kit` reads into the generated `<context>.controllers.ts` the module lists (`nest/controllers-current` keeps it current); any other answer is said in `response` of `@KitRoute`. The raw request and answer of Nest (`@Req`, `@Res`, `@Header`), its guards, pipes, interceptors and filters are refused (`nest/no-parallel-pipeline`): the kit would not run them.
22
+ - A method takes and answers what its signature says: a part of the request taken whole by a DTO class (`@Body() body: <UseCase>Body`), an answer that is a DTO class (`Promise<<UseCase>Answer>`), `Accepted` or `void`, which `ddd-ts-kit` reads into the generated `<context>.controllers.ts` the module lists (`nest/controllers-current` keeps it current); any other type is given in `request` or `response` of `@KitRoute`. The raw request and answer of Nest (`@Req`, `@Res`, `@Header`), its guards, pipes, interceptors and filters are refused (`nest/no-parallel-pipeline`): the kit would not run them.
23
23
  {{/if}}
24
24
  {{#if routes.functions}}
25
25
  - A route validates the shape of the input, builds a command or a query with the actor, executes it through `CommandBus` or `QueryBus` (never a handler class) and maps the answer. Nothing else.
@@ -1,7 +1,7 @@
1
1
  @@imports
2
2
  import { {{publisher.pascal}}Publisher } from '{{alias.context}}/application/integration/publishers/{{publisher.kebab}}.publisher{{alias.ext}}';
3
3
  import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
4
- @@registrations
4
+ @@reactions
5
5
  const {{publisher.camel}}Publisher = platform.adapter(new {{publisher.pascal}}Publisher(platform.publisher, platform.ids), { kind: 'domain-event-handler', context: '{{context.kebab}}' });
6
6
 
7
7
  platform.domainEvents.on({{event.reference}}, async (event) => {
@@ -11,7 +11,7 @@ import { {{upstream.definition}} as {{name.camel}}Definition } from '{{alias.con
11
11
  import { idempotent, inEventScope } from '@ddd-ts-kit/kernel';
12
12
  {{/if}}
13
13
  import { {{name.pascal}}IntegrationHandler } from '{{alias.context}}/application/integration/handlers/{{name.kebab}}.integration-handler{{alias.ext}}';
14
- @@registrations
14
+ @@reactions
15
15
  const {{name.camel}}IntegrationHandler = new {{name.pascal}}IntegrationHandler(platform.commands);
16
16
 
17
17
  {{#if consumer.declarative}}
@@ -2,7 +2,7 @@
2
2
  import { Scheduled, type JobExecution, type ScheduledJob } from '@ddd-ts-kit/kernel/declarations';
3
3
  import { {{job.command}}Command } from '{{alias.context}}/application/commands/{{job.commandKebab}}/{{job.commandKebab}}.command{{alias.ext}}';
4
4
 
5
- @Scheduled('{{job.name}}', {{job.schedule}})
5
+ @Scheduled('{{job.name}}', {{job.scheduled}})
6
6
  export class {{name.pascal}}Job implements ScheduledJob {
7
7
  constructor(private readonly commands: CommandBus) {}
8
8
 
@@ -9,6 +9,9 @@ const occurrence = {
9
9
  startedAt: new Date('2026-01-01T07:00:02.000Z'),
10
10
  attempt: 1,
11
11
  signal: new AbortController().signal,
12
+ {{#if job.perTenant}}
13
+ tenantId: 'tenant-a',
14
+ {{/if}}
12
15
  };
13
16
 
14
17
  describe('{{name.title}}, when its time comes', () => {
@@ -21,16 +21,35 @@ describe('{{name.title}}, when its time comes', () => {
21
21
 
22
22
  await application.jobs.runNow('{{job.name}}');
23
23
 
24
+ {{#if job.perTenant}}
25
+ expect(sent).toHaveLength(2);
26
+ {{/if}}
27
+ {{#unless job.perTenant}}
24
28
  expect(sent).toHaveLength(1);
29
+ {{/unless}}
25
30
  expect(sent[0]).toBeInstanceOf({{job.command}}Command);
26
31
  {{#if job.protected}}
27
32
  expect(sent[0]).toMatchObject({ actor: { id: 'system:{{job.name}}', type: 'system' } });
28
33
  {{/if}}
29
34
  });
35
+ {{#if job.perTenant}}
36
+
37
+ it('runs once for each tenant, in the scope of that tenant', async () => {
38
+ const { application, tenants } = {{spec.await}}arrange();
39
+
40
+ await application.jobs.runNow('{{job.name}}');
41
+
42
+ expect(tenants).toEqual(['tenant-a', 'tenant-b']);
43
+ });
44
+ {{/if}}
30
45
 
31
46
  // TODO(domain): replace each entry below by a test of what "{{name.words}}" asks of the use case: the period it names from `scheduledAt`, and that a second run of the same occurrence changes nothing.
32
47
  it.todo('names the period of the occurrence, never the instant it really runs');
33
48
  it.todo('has the same outcome when the same occurrence runs twice');
49
+ {{#if job.perTenant}}
50
+ // TODO(domain): once the handler reads a tenant-scoped repository, run it for both tenants with their own rows and assert each run reads its own tenant only.
51
+ it.todo('reads and writes one tenant at a time');
52
+ {{/if}}
34
53
  });
35
54
 
36
55
  {{spec.async}}function arrange() {
@@ -40,13 +59,22 @@ describe('{{name.title}}, when its time comes', () => {
40
59
  {{/if}}
41
60
  const application = createTestApplication({
42
61
  modules: [{{spec.modules}}],
62
+ {{#if job.perTenant}}
63
+ tenants: ['tenant-a', 'tenant-b'],
64
+ {{/if}}
43
65
  });
44
66
 
45
67
  const sent: Message[] = [];
68
+ {{#if job.perTenant}}
69
+ const tenants: (string | undefined)[] = [];
70
+ {{/if}}
46
71
 
47
72
  application.commandBus.use(async (message) => {
48
73
  sent.push(message);
74
+ {{#if job.perTenant}}
75
+ tenants.push(application.executionScope.require().tenantId);
76
+ {{/if}}
49
77
  });
50
78
 
51
- return { application, sent };
79
+ return { application, sent{{#if job.perTenant}}, tenants{{/if}} };
52
80
  }
@@ -1,10 +1,13 @@
1
1
  @@imports
2
2
  import { {{name.pascal}}Job } from '{{alias.context}}/application/scheduling/{{name.kebab}}.job{{alias.ext}}';
3
- @@registrations
3
+ @@jobs
4
4
  const {{name.camel}}Job = new {{name.pascal}}Job(platform.commands);
5
5
 
6
6
  platform.jobs.register({
7
7
  name: '{{job.name}}',
8
8
  schedule: {{job.schedule}},
9
+ {{#if job.tenanted}}
10
+ tenancy: '{{job.tenancy}}',
11
+ {{/if}}
9
12
  run: (execution) => {{name.camel}}Job.run(execution),
10
13
  });
@@ -2,4 +2,4 @@
2
2
  import { CommandBus } from '@ddd-ts-kit/kernel';
3
3
  import { {{name.pascal}}Job } from '{{alias.context}}/application/scheduling/{{name.kebab}}.job{{alias.ext}}';
4
4
  @@registrations
5
- builder.job('{{job.name}}', {{job.schedule}}).handledBy({{name.pascal}}Job, [CommandBus]);
5
+ builder.job('{{job.name}}', {{job.scheduled}}).handledBy({{name.pascal}}Job, [CommandBus]);
@@ -0,0 +1,38 @@
1
+ import { {{search.nestImports}} } from '@nestjs/common';
2
+ import { {{search.kitImports}} } from '@ddd-ts-kit/http';
3
+ import { CurrentActor, KitRoute, KitRoutes } from '@ddd-ts-kit/http/nest';
4
+ import { QueryBus, type Actor } from '@ddd-ts-kit/kernel';
5
+ import type { Infer } from '@ddd-ts-kit/validation';
6
+ import { classSchema } from '@ddd-ts-kit/validation/class-validator';
7
+ {{route.imports}}
8
+
9
+ // TODO(domain): list here the fields of {{name.pascal}}Sort a client may sort by, and bound the size of a page.
10
+ const query = pageQuerySchema({ sortable: ['id'], maxSize: 100 });
11
+ const line = classSchema({{name.pascal}}Line);
12
+
13
+ /** Built by Nest with the bus it injects, served by the kit: a page is no DTO class, so @KitRoute gives its query and its answer. */
14
+ @Controller()
15
+ @KitRoutes({ {{route.nestShared}} })
16
+ export class {{name.pascal}}Controller {
17
+ constructor(@Inject(QueryBus) private readonly queries: QueryBus) {}
18
+
19
+ @{{route.nestMethod}}({{route.nestPath}})
20
+ @KitRoute({
21
+ request: { query },
22
+ response: { description: 'One page of the search.', body: pageSchemaOf(line) },
23
+ // TODO(domain): list the codes of the refusals "{{name.words}}" can raise, as their factories set them, so that they appear in the contract with their status (`errors/known-code`).
24
+ errors: [],
25
+ {{#if route.cached}}
26
+ cache: {{route.cache}},
27
+ {{/if}}
28
+ })
29
+ async {{name.camel}}(
30
+ @Query() criteria: Infer<typeof query>,
31
+ @CurrentActor() actor: Actor,
32
+ ): Promise<PageBody<Infer<typeof line>>> {
33
+ // TODO(domain): hand the criteria of the query over too, once the query schema declares them next to the page; map each line to its public fields.
34
+ const page = await this.queries.execute(new {{route.input}}(actor, criteria));
35
+
36
+ return pageResponse(page, ({{search.element}}) => ({ id: {{search.element}}.id }));
37
+ }
38
+ }
@@ -4,22 +4,9 @@ import { {{route.kitImports}} } from '@ddd-ts-kit/http';
4
4
  {{/if}}
5
5
  import { {{route.bridgeImports}} } from '@ddd-ts-kit/http/nest';
6
6
  import { {{route.kernelImports}} } from '@ddd-ts-kit/kernel';
7
- {{#if route.readsSchemas}}
8
- import { classSchema } from '@ddd-ts-kit/validation/class-validator';
9
- {{/if}}
10
7
  {{route.imports}}
11
8
 
12
- {{#if route.hasParams}}
13
- const paramsSchema = classSchema({{name.pascal}}Params);
14
- {{/if}}
15
- {{#if route.hasBody}}
16
- // TODO(domain): once {{name.pascal}}Body has its decorated fields, drop the second argument: it only lets a class without any decorated field through.
17
- const bodySchema = classSchema({{name.pascal}}Body, { validator: { forbidUnknownValues: false } });
18
- {{/if}}
19
- {{#if route.readsSchemas}}
20
-
21
- {{/if}}
22
- /** Built by Nest with the bus it injects, served by the kit: what each method answers is read from its signature. */
9
+ /** Built by Nest with the bus it injects, served by the kit: what each method takes and answers is read from its signature. */
23
10
  @Controller()
24
11
  @KitRoutes({ {{route.nestShared}} })
25
12
  export class {{name.pascal}}Controller {
@@ -30,9 +17,6 @@ export class {{name.pascal}}Controller {
30
17
  @HttpCode({{route.nestHttpCode}})
31
18
  {{/if}}
32
19
  @KitRoute({
33
- {{#if route.readsRequest}}
34
- request: { {{route.nestRequest}} },
35
- {{/if}}
36
20
  // TODO(domain): list the codes of the refusals "{{name.words}}" can raise, as their factories set them, so that they appear in the contract with their status (`errors/known-code`).
37
21
  errors: [],
38
22
  {{#if route.cached}}
@@ -0,0 +1,47 @@
1
+ import { Readable } from 'node:stream';
2
+ import { describe, expect, it } from '{{tests.module}}';
3
+ import { executeRoute } from '@ddd-ts-kit/http';
4
+ import { nestControllerRoute } from '@ddd-ts-kit/http/nest';
5
+ import { InMemoryCommandBus{{#if route.protected}}, type Actor{{/if}} } from '@ddd-ts-kit/kernel';
6
+ {{route.messageImport}}
7
+ {{route.specImports}}
8
+
9
+ {{#if route.protected}}
10
+ const caller: Actor = { id: 'user-1', type: 'user', roles: [], attributes: {} };
11
+
12
+ {{/if}}
13
+ describe('{{route.method}} {{route.path}}', () => {
14
+ it('declares the file it receives, and hands it to the command as it streams', async () => {
15
+ const received: string[] = [];
16
+
17
+ const commands = new InMemoryCommandBus().register({{route.input}}, {
18
+ execute: async ({ upload }) => {
19
+ received.push(upload.fileName);
20
+
21
+ return 'file-1';
22
+ },
23
+ });
24
+
25
+ const route = nestControllerRoute({{name.pascal}}Controller, { instanceOf: () => new {{name.pascal}}Controller(commands) });
26
+ const file = { fileName: 'scan.pdf', mediaType: 'application/pdf', stream: Readable.from([Buffer.from('%PDF-')]) };
27
+
28
+ const response = await executeRoute(
29
+ route,
30
+ { params: {{route.sampleParams}}, query: {}, headers: {}, body: {}, raw: undefined },
31
+ {
32
+ validateResponses: true,
33
+ uploads: async () => ({ fields: {}, file }),
34
+ {{#if route.protected}}
35
+ resolvePrincipal: () => caller,
36
+ {{/if}}
37
+ },
38
+ );
39
+
40
+ expect(response.status).toBe(201);
41
+ expect(received).toEqual(['scan.pdf']);
42
+ expect(route.upload?.field).toBe('file');
43
+ });
44
+
45
+ // TODO(domain): replace each entry below by a test of the contract a client relies on.
46
+ it.todo('answers the documented status for each error code of the use case');
47
+ });
@@ -0,0 +1,25 @@
1
+ import { Controller, Inject, {{route.nestMethod}} } from '@nestjs/common';
2
+ import { {{upload.kitImports}} } from '@ddd-ts-kit/http';
3
+ import { {{upload.bridgeImports}} } from '@ddd-ts-kit/http/nest';
4
+ import { {{upload.kernelImports}} } from '@ddd-ts-kit/kernel';
5
+ {{route.imports}}
6
+
7
+ /** Built by Nest with the bus it injects, served by the kit: the file is streamed and checked by the kit, never parsed by Nest. */
8
+ @Controller()
9
+ @KitRoutes({ {{route.nestShared}} })
10
+ export class {{name.pascal}}Controller {
11
+ constructor(@Inject(CommandBus) private readonly commands: CommandBus) {}
12
+
13
+ @{{route.nestMethod}}({{route.nestPath}})
14
+ @KitRoute({
15
+ // TODO(domain): the largest file and the media types "{{name.words}}" accepts: both are part of the contract, and the content is checked against them as it streams.
16
+ upload: { field: 'file', maxBytes: 10_485_760, mediaTypes: ['application/pdf', 'image/png', 'image/jpeg'] },
17
+ response: { status: 201, description: 'Stored; the file is visible once the command has committed.' },
18
+ // TODO(domain): list the codes of the refusals "{{name.words}}" can raise, as their factories set them, so that they appear in the contract with their status (`errors/known-code`).
19
+ errors: [],
20
+ })
21
+ async {{name.camel}}({{upload.parameters}}): Promise<void> {
22
+ // TODO(domain): hand the command the identifier of what the file is attached to, from the parameters of the path.
23
+ await this.commands.execute(new {{route.input}}({{upload.arguments}}));
24
+ }
25
+ }
@@ -1,5 +1,10 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.5.15/schema.json",
2
+ "$schema": "https://biomejs.dev/schemas/2.6.2/schema.json",
3
+ "vcs": {
4
+ "enabled": true,
5
+ "clientKind": "git",
6
+ "useIgnoreFile": true
7
+ },
3
8
  "files": {
4
9
  "includes": [
5
10
  "**/*.ts",
@@ -13,7 +18,9 @@
13
18
  "!**/dist",
14
19
  "!**/coverage",
15
20
  "!**/reports",
16
- "!**/.worktrees",
21
+ "!.worktrees",
22
+ "!**/.claude",
23
+ "!.mcp.json",
17
24
  "!**/.ddd-ts-kit",
18
25
  "!**/generated",
19
26
  "!**/package-lock.json",
@@ -1,9 +1,15 @@
1
1
  import { dddTsKit } from '@ddd-ts-kit/eslint-plugin';
2
2
 
3
3
  {{#unless orm.prisma}}
4
+ {{#unless orm.typeorm}}
4
5
  export default dddTsKit({ tsconfigRootDir: import.meta.dirname });
5
6
  {{/unless}}
7
+ {{/unless}}
6
8
  {{#if orm.prisma}}
7
9
  // The Prisma client under generated/ is a build product: it is not linted.
8
10
  export default dddTsKit({ tsconfigRootDir: import.meta.dirname, ignores: ['generated/**'] });
9
11
  {{/if}}
12
+ {{#if orm.typeorm}}
13
+ // The migrations TypeORM writes are the output of a tool, compiled by the build: they are not linted.
14
+ export default dddTsKit({ tsconfigRootDir: import.meta.dirname, ignores: ['migrations/**'] });
15
+ {{/if}}
@@ -11,6 +11,7 @@
11
11
  "ignoreDependencies": {{knip.ignored}},
12
12
  {{/if}}
13
13
  "ignoreExportsUsedInFile": true,
14
+ "mcp": false,
14
15
  {{#if refusals.named}}
15
16
  "ignoreIssues": {
16
17
  "{{config.contextsDir}}/*/*.codes.ts": ["types"]
@@ -20,10 +20,10 @@
20
20
  "ci:build": "npm run build"
21
21
  },
22
22
  "devDependencies": {
23
- "@biomejs/biome": "2.5.15",
23
+ "@biomejs/biome": "2.6.2",
24
24
  "@commitlint/cli": "^21.2.3",
25
25
  "@commitlint/config-conventional": "^21.2.3",
26
- "@ddd-ts-kit/eslint-plugin": "^0.91.0",
26
+ "@ddd-ts-kit/eslint-plugin": "^0.93.0",
27
27
  "@eslint/js": "^10.0.1",
28
28
  "@typescript/native": "npm:typescript@~7.0.2",
29
29
  "@vitest/coverage-v8": "5.0.3",