ddd-ts-kit 0.94.1 → 0.96.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 (731) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/README.fr.md +83 -21
  3. package/README.md +78 -22
  4. package/dist/build/rewrite-aliases.js +1 -1
  5. package/dist/build/rewrite-aliases.js.map +1 -1
  6. package/dist/check/canonical/stray-entry.js +7 -1
  7. package/dist/check/canonical/stray-entry.js.map +1 -1
  8. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  9. package/dist/check/configuration/config-inspection.js +2 -0
  10. package/dist/check/configuration/config-inspection.js.map +1 -1
  11. package/dist/check/configuration/context-tenancy.d.ts +10 -0
  12. package/dist/check/configuration/context-tenancy.d.ts.map +1 -0
  13. package/dist/check/configuration/context-tenancy.js +16 -0
  14. package/dist/check/configuration/context-tenancy.js.map +1 -0
  15. package/dist/check/errors/listed-codes.d.ts +1 -1
  16. package/dist/check/errors/listed-codes.d.ts.map +1 -1
  17. package/dist/check/errors/listed-codes.js +15 -3
  18. package/dist/check/errors/listed-codes.js.map +1 -1
  19. package/dist/check/explain/language-docs.js +1 -1
  20. package/dist/check/explain/language-docs.js.map +1 -1
  21. package/dist/check/explain/privacy-docs.js +1 -1
  22. package/dist/check/explain/privacy-docs.js.map +1 -1
  23. package/dist/check/explain/tenancy-docs.js +1 -1
  24. package/dist/check/explain/tenancy-docs.js.map +1 -1
  25. package/dist/check/explain/tree-docs.js +2 -2
  26. package/dist/check/explain/tree-docs.js.map +1 -1
  27. package/dist/check/fixtures/config-fixtures.d.ts.map +1 -1
  28. package/dist/check/fixtures/config-fixtures.js +13 -0
  29. package/dist/check/fixtures/config-fixtures.js.map +1 -1
  30. package/dist/check/fixtures/config.js +2 -1
  31. package/dist/check/fixtures/config.js.map +1 -1
  32. package/dist/check/fixtures/control-plane-fixtures.d.ts +4 -0
  33. package/dist/check/fixtures/control-plane-fixtures.d.ts.map +1 -0
  34. package/dist/check/fixtures/control-plane-fixtures.js +41 -0
  35. package/dist/check/fixtures/control-plane-fixtures.js.map +1 -0
  36. package/dist/check/fixtures/files-fixtures.js +2 -2
  37. package/dist/check/fixtures/files-fixtures.js.map +1 -1
  38. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  39. package/dist/check/fixtures/fixtures.js +2 -0
  40. package/dist/check/fixtures/fixtures.js.map +1 -1
  41. package/dist/check/fixtures/governance-fixtures.d.ts.map +1 -1
  42. package/dist/check/fixtures/governance-fixtures.js +15 -0
  43. package/dist/check/fixtures/governance-fixtures.js.map +1 -1
  44. package/dist/check/fixtures/language-fixtures.d.ts.map +1 -1
  45. package/dist/check/fixtures/language-fixtures.js +22 -0
  46. package/dist/check/fixtures/language-fixtures.js.map +1 -1
  47. package/dist/check/fixtures/privacy-fixtures.js +2 -2
  48. package/dist/check/fixtures/privacy-fixtures.js.map +1 -1
  49. package/dist/check/fixtures/shared-kernel-fixtures.d.ts +3 -0
  50. package/dist/check/fixtures/shared-kernel-fixtures.d.ts.map +1 -0
  51. package/dist/check/fixtures/shared-kernel-fixtures.js +60 -0
  52. package/dist/check/fixtures/shared-kernel-fixtures.js.map +1 -0
  53. package/dist/check/fixtures/shared-kernel-glossary.d.ts +7 -0
  54. package/dist/check/fixtures/shared-kernel-glossary.d.ts.map +1 -0
  55. package/dist/check/fixtures/shared-kernel-glossary.js +12 -0
  56. package/dist/check/fixtures/shared-kernel-glossary.js.map +1 -0
  57. package/dist/check/fixtures/standard-fixtures.d.ts.map +1 -1
  58. package/dist/check/fixtures/standard-fixtures.js +2 -0
  59. package/dist/check/fixtures/standard-fixtures.js.map +1 -1
  60. package/dist/check/fixtures/tenancy-adapters.d.ts +20 -0
  61. package/dist/check/fixtures/tenancy-adapters.d.ts.map +1 -0
  62. package/dist/check/fixtures/tenancy-adapters.js +10 -0
  63. package/dist/check/fixtures/tenancy-adapters.js.map +1 -0
  64. package/dist/check/fixtures/tenancy-bypass.d.ts +2 -21
  65. package/dist/check/fixtures/tenancy-bypass.d.ts.map +1 -1
  66. package/dist/check/fixtures/tenancy-bypass.js +2 -10
  67. package/dist/check/fixtures/tenancy-bypass.js.map +1 -1
  68. package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
  69. package/dist/check/fixtures/tenancy-fixtures.js +2 -0
  70. package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
  71. package/dist/check/fixtures/tree-fixtures.d.ts.map +1 -1
  72. package/dist/check/fixtures/tree-fixtures.js +17 -0
  73. package/dist/check/fixtures/tree-fixtures.js.map +1 -1
  74. package/dist/check/fixtures/value-object-file-fixtures.d.ts.map +1 -1
  75. package/dist/check/fixtures/value-object-file-fixtures.js +2 -0
  76. package/dist/check/fixtures/value-object-file-fixtures.js.map +1 -1
  77. package/dist/check/language/add-glossary-rows.d.ts +1 -0
  78. package/dist/check/language/add-glossary-rows.d.ts.map +1 -1
  79. package/dist/check/language/add-glossary-rows.js +7 -2
  80. package/dist/check/language/add-glossary-rows.js.map +1 -1
  81. package/dist/check/language/glossaries.d.ts +8 -2
  82. package/dist/check/language/glossaries.d.ts.map +1 -1
  83. package/dist/check/language/glossaries.js +28 -18
  84. package/dist/check/language/glossaries.js.map +1 -1
  85. package/dist/check/language/held-by-glossary.d.ts +8 -0
  86. package/dist/check/language/held-by-glossary.d.ts.map +1 -0
  87. package/dist/check/language/held-by-glossary.js +19 -0
  88. package/dist/check/language/held-by-glossary.js.map +1 -0
  89. package/dist/check/language/technical-words-of.d.ts +9 -0
  90. package/dist/check/language/technical-words-of.d.ts.map +1 -0
  91. package/dist/check/language/technical-words-of.js +15 -0
  92. package/dist/check/language/technical-words-of.js.map +1 -0
  93. package/dist/check/privacy/prisma-columns-of.d.ts +5 -5
  94. package/dist/check/privacy/prisma-columns-of.d.ts.map +1 -1
  95. package/dist/check/privacy/prisma-columns-of.js +25 -12
  96. package/dist/check/privacy/prisma-columns-of.js.map +1 -1
  97. package/dist/check/project/beside-the-sources.js +1 -1
  98. package/dist/check/project/beside-the-sources.js.map +1 -1
  99. package/dist/check/project/git-ignored.d.ts +11 -0
  100. package/dist/check/project/git-ignored.d.ts.map +1 -0
  101. package/dist/check/project/git-ignored.js +26 -0
  102. package/dist/check/project/git-ignored.js.map +1 -0
  103. package/dist/check/project/load-loose-project.js +1 -1
  104. package/dist/check/project/load-loose-project.js.map +1 -1
  105. package/dist/check/project/load-project.d.ts.map +1 -1
  106. package/dist/check/project/load-project.js +13 -2
  107. package/dist/check/project/load-project.js.map +1 -1
  108. package/dist/check/project/locate.js +2 -1
  109. package/dist/check/project/locate.js.map +1 -1
  110. package/dist/check/project/walk-directory.d.ts +10 -2
  111. package/dist/check/project/walk-directory.d.ts.map +1 -1
  112. package/dist/check/project/walk-directory.js +9 -4
  113. package/dist/check/project/walk-directory.js.map +1 -1
  114. package/dist/check/rules/governance-recorded-deviation.js +14 -1
  115. package/dist/check/rules/governance-recorded-deviation.js.map +1 -1
  116. package/dist/check/rules/language-glossary-term.js +38 -18
  117. package/dist/check/rules/language-glossary-term.js.map +1 -1
  118. package/dist/check/rules/language-no-technical-name.d.ts.map +1 -1
  119. package/dist/check/rules/language-no-technical-name.js +9 -7
  120. package/dist/check/rules/language-no-technical-name.js.map +1 -1
  121. package/dist/check/rules/privacy-declared-field.d.ts +1 -1
  122. package/dist/check/rules/privacy-declared-field.js +1 -1
  123. package/dist/check/rules/tenancy-scoped-statement.d.ts.map +1 -1
  124. package/dist/check/rules/tenancy-scoped-statement.js +8 -6
  125. package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
  126. package/dist/cli-error.d.ts +3 -3
  127. package/dist/cli-error.d.ts.map +1 -1
  128. package/dist/cli-error.js +4 -3
  129. package/dist/cli-error.js.map +1 -1
  130. package/dist/commands/acceptance.js +6 -2
  131. package/dist/commands/acceptance.js.map +1 -1
  132. package/dist/commands/context-layout.d.ts.map +1 -1
  133. package/dist/commands/context-layout.js +3 -2
  134. package/dist/commands/context-layout.js.map +1 -1
  135. package/dist/commands/depcruise-config.d.ts.map +1 -1
  136. package/dist/commands/depcruise-config.js +13 -5
  137. package/dist/commands/depcruise-config.js.map +1 -1
  138. package/dist/commands/docs.d.ts.map +1 -1
  139. package/dist/commands/docs.js +2 -4
  140. package/dist/commands/docs.js.map +1 -1
  141. package/dist/commands/doctor.d.ts.map +1 -1
  142. package/dist/commands/doctor.js +2 -0
  143. package/dist/commands/doctor.js.map +1 -1
  144. package/dist/commands/generate.d.ts +4 -0
  145. package/dist/commands/generate.d.ts.map +1 -1
  146. package/dist/commands/generate.js +16 -6
  147. package/dist/commands/generate.js.map +1 -1
  148. package/dist/commands/init.d.ts.map +1 -1
  149. package/dist/commands/init.js +10 -2
  150. package/dist/commands/init.js.map +1 -1
  151. package/dist/commands/move-to-module.d.ts.map +1 -1
  152. package/dist/commands/move-to-module.js +3 -2
  153. package/dist/commands/move-to-module.js.map +1 -1
  154. package/dist/commands/plan-waves.d.ts +2 -1
  155. package/dist/commands/plan-waves.d.ts.map +1 -1
  156. package/dist/commands/plan-waves.js +28 -2
  157. package/dist/commands/plan-waves.js.map +1 -1
  158. package/dist/commands/print-report.d.ts +3 -3
  159. package/dist/commands/print-report.d.ts.map +1 -1
  160. package/dist/commands/print-report.js +10 -3
  161. package/dist/commands/print-report.js.map +1 -1
  162. package/dist/commands/sdk.js +1 -2
  163. package/dist/commands/sdk.js.map +1 -1
  164. package/dist/config/config.d.ts +7 -0
  165. package/dist/config/config.d.ts.map +1 -1
  166. package/dist/config/context-tenancies.d.ts +7 -0
  167. package/dist/config/context-tenancies.d.ts.map +1 -0
  168. package/dist/config/context-tenancies.js +7 -0
  169. package/dist/config/context-tenancies.js.map +1 -0
  170. package/dist/config/index.d.ts +2 -0
  171. package/dist/config/index.d.ts.map +1 -1
  172. package/dist/config/index.js +2 -0
  173. package/dist/config/index.js.map +1 -1
  174. package/dist/config/is-control-plane.d.ts +4 -0
  175. package/dist/config/is-control-plane.d.ts.map +1 -0
  176. package/dist/config/is-control-plane.js +5 -0
  177. package/dist/config/is-control-plane.js.map +1 -0
  178. package/dist/config/parse-context.d.ts.map +1 -1
  179. package/dist/config/parse-context.js +1 -0
  180. package/dist/config/parse-context.js.map +1 -1
  181. package/dist/config/serialize-config.js +1 -0
  182. package/dist/config/serialize-config.js.map +1 -1
  183. package/dist/dev/refresh-declarations.d.ts.map +1 -1
  184. package/dist/dev/refresh-declarations.js +2 -1
  185. package/dist/dev/refresh-declarations.js.map +1 -1
  186. package/dist/doctor/diagnose.d.ts +2 -1
  187. package/dist/doctor/diagnose.d.ts.map +1 -1
  188. package/dist/doctor/diagnose.js +4 -1
  189. package/dist/doctor/diagnose.js.map +1 -1
  190. package/dist/doctor/doctor-finding.d.ts +1 -1
  191. package/dist/doctor/doctor-finding.d.ts.map +1 -1
  192. package/dist/doctor/format-diagnosis.js +25 -2
  193. package/dist/doctor/format-diagnosis.js.map +1 -1
  194. package/dist/doctor/install-script-findings.d.ts +11 -0
  195. package/dist/doctor/install-script-findings.d.ts.map +1 -0
  196. package/dist/doctor/install-script-findings.js +86 -0
  197. package/dist/doctor/install-script-findings.js.map +1 -0
  198. package/dist/doctor/installed-from.d.ts +3 -0
  199. package/dist/doctor/installed-from.d.ts.map +1 -0
  200. package/dist/doctor/installed-from.js +15 -0
  201. package/dist/doctor/installed-from.js.map +1 -0
  202. package/dist/doctor/override-findings.d.ts.map +1 -1
  203. package/dist/doctor/override-findings.js +1 -11
  204. package/dist/doctor/override-findings.js.map +1 -1
  205. package/dist/doctor/permission-findings.d.ts.map +1 -1
  206. package/dist/doctor/permission-findings.js +15 -2
  207. package/dist/doctor/permission-findings.js.map +1 -1
  208. package/dist/generate/concept.d.ts +2 -2
  209. package/dist/generate/concept.js +3 -3
  210. package/dist/generate/concept.js.map +1 -1
  211. package/dist/generate/context-vars.d.ts +5 -2
  212. package/dist/generate/context-vars.d.ts.map +1 -1
  213. package/dist/generate/context-vars.js +6 -3
  214. package/dist/generate/context-vars.js.map +1 -1
  215. package/dist/generate/errors/codes-of-context.d.ts +1 -1
  216. package/dist/generate/errors/codes-of-context.d.ts.map +1 -1
  217. package/dist/generate/errors/codes-of-context.js +10 -2
  218. package/dist/generate/errors/codes-of-context.js.map +1 -1
  219. package/dist/generate/errors/refusal-class-name.d.ts +1 -1
  220. package/dist/generate/errors/refusal-class-name.d.ts.map +1 -1
  221. package/dist/generate/errors/refusal-class-name.js +2 -2
  222. package/dist/generate/errors/refusal-class-name.js.map +1 -1
  223. package/dist/generate/glossary-of.d.ts +5 -0
  224. package/dist/generate/glossary-of.d.ts.map +1 -0
  225. package/dist/generate/glossary-of.js +6 -0
  226. package/dist/generate/glossary-of.js.map +1 -0
  227. package/dist/generate/is-shared-kernel.d.ts +4 -0
  228. package/dist/generate/is-shared-kernel.d.ts.map +1 -0
  229. package/dist/generate/is-shared-kernel.js +5 -0
  230. package/dist/generate/is-shared-kernel.js.map +1 -0
  231. package/dist/generate/kind.d.ts +11 -6
  232. package/dist/generate/kind.d.ts.map +1 -1
  233. package/dist/generate/kinds/acceptance-kind.d.ts.map +1 -1
  234. package/dist/generate/kinds/acceptance-kind.js +1 -0
  235. package/dist/generate/kinds/acceptance-kind.js.map +1 -1
  236. package/dist/generate/kinds/acl-kind.d.ts.map +1 -1
  237. package/dist/generate/kinds/acl-kind.js +1 -0
  238. package/dist/generate/kinds/acl-kind.js.map +1 -1
  239. package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
  240. package/dist/generate/kinds/adapter-kind.js +57 -7
  241. package/dist/generate/kinds/adapter-kind.js.map +1 -1
  242. package/dist/generate/kinds/adr-kind.d.ts.map +1 -1
  243. package/dist/generate/kinds/adr-kind.js +1 -0
  244. package/dist/generate/kinds/adr-kind.js.map +1 -1
  245. package/dist/generate/kinds/aggregate-kind.d.ts.map +1 -1
  246. package/dist/generate/kinds/aggregate-kind.js +1 -0
  247. package/dist/generate/kinds/aggregate-kind.js.map +1 -1
  248. package/dist/generate/kinds/background-job-kind.d.ts.map +1 -1
  249. package/dist/generate/kinds/background-job-kind.js +1 -0
  250. package/dist/generate/kinds/background-job-kind.js.map +1 -1
  251. package/dist/generate/kinds/builder-kind.d.ts.map +1 -1
  252. package/dist/generate/kinds/builder-kind.js +1 -0
  253. package/dist/generate/kinds/builder-kind.js.map +1 -1
  254. package/dist/generate/kinds/command-kind.d.ts.map +1 -1
  255. package/dist/generate/kinds/command-kind.js +1 -0
  256. package/dist/generate/kinds/command-kind.js.map +1 -1
  257. package/dist/generate/kinds/context-kind.d.ts.map +1 -1
  258. package/dist/generate/kinds/context-kind.js +3 -1
  259. package/dist/generate/kinds/context-kind.js.map +1 -1
  260. package/dist/generate/kinds/context-request.d.ts +2 -0
  261. package/dist/generate/kinds/context-request.d.ts.map +1 -1
  262. package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
  263. package/dist/generate/kinds/declare-storage.js +19 -9
  264. package/dist/generate/kinds/declare-storage.js.map +1 -1
  265. package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
  266. package/dist/generate/kinds/domain-error-kind.js +7 -4
  267. package/dist/generate/kinds/domain-error-kind.js.map +1 -1
  268. package/dist/generate/kinds/domain-event-kind.d.ts.map +1 -1
  269. package/dist/generate/kinds/domain-event-kind.js +1 -0
  270. package/dist/generate/kinds/domain-event-kind.js.map +1 -1
  271. package/dist/generate/kinds/domain-service-kind.d.ts.map +1 -1
  272. package/dist/generate/kinds/domain-service-kind.js +1 -0
  273. package/dist/generate/kinds/domain-service-kind.js.map +1 -1
  274. package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
  275. package/dist/generate/kinds/e2e-kind.js +1 -0
  276. package/dist/generate/kinds/e2e-kind.js.map +1 -1
  277. package/dist/generate/kinds/entity-kind.d.ts.map +1 -1
  278. package/dist/generate/kinds/entity-kind.js +1 -0
  279. package/dist/generate/kinds/entity-kind.js.map +1 -1
  280. package/dist/generate/kinds/erasure-handler-kind.d.ts.map +1 -1
  281. package/dist/generate/kinds/erasure-handler-kind.js +1 -0
  282. package/dist/generate/kinds/erasure-handler-kind.js.map +1 -1
  283. package/dist/generate/kinds/error-kind.d.ts.map +1 -1
  284. package/dist/generate/kinds/error-kind.js +6 -5
  285. package/dist/generate/kinds/error-kind.js.map +1 -1
  286. package/dist/generate/kinds/event-handler-kind.d.ts.map +1 -1
  287. package/dist/generate/kinds/event-handler-kind.js +1 -0
  288. package/dist/generate/kinds/event-handler-kind.js.map +1 -1
  289. package/dist/generate/kinds/extend-event-sourced-aggregate.d.ts +4 -2
  290. package/dist/generate/kinds/extend-event-sourced-aggregate.d.ts.map +1 -1
  291. package/dist/generate/kinds/extend-event-sourced-aggregate.js +45 -10
  292. package/dist/generate/kinds/extend-event-sourced-aggregate.js.map +1 -1
  293. package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
  294. package/dist/generate/kinds/file-upload-kind.js +1 -0
  295. package/dist/generate/kinds/file-upload-kind.js.map +1 -1
  296. package/dist/generate/kinds/form-kind.d.ts.map +1 -1
  297. package/dist/generate/kinds/form-kind.js +1 -0
  298. package/dist/generate/kinds/form-kind.js.map +1 -1
  299. package/dist/generate/kinds/gateway-kind.d.ts.map +1 -1
  300. package/dist/generate/kinds/gateway-kind.js +1 -0
  301. package/dist/generate/kinds/gateway-kind.js.map +1 -1
  302. package/dist/generate/kinds/generate-context.d.ts.map +1 -1
  303. package/dist/generate/kinds/generate-context.js +14 -0
  304. package/dist/generate/kinds/generate-context.js.map +1 -1
  305. package/dist/generate/kinds/generate-repository.js +11 -7
  306. package/dist/generate/kinds/generate-repository.js.map +1 -1
  307. package/dist/generate/kinds/guard-kind.d.ts.map +1 -1
  308. package/dist/generate/kinds/guard-kind.js +1 -0
  309. package/dist/generate/kinds/guard-kind.js.map +1 -1
  310. package/dist/generate/kinds/integration-event-kind.d.ts.map +1 -1
  311. package/dist/generate/kinds/integration-event-kind.js +1 -0
  312. package/dist/generate/kinds/integration-event-kind.js.map +1 -1
  313. package/dist/generate/kinds/integration-handler-kind.d.ts.map +1 -1
  314. package/dist/generate/kinds/integration-handler-kind.js +1 -0
  315. package/dist/generate/kinds/integration-handler-kind.js.map +1 -1
  316. package/dist/generate/kinds/job-kind.d.ts.map +1 -1
  317. package/dist/generate/kinds/job-kind.js +1 -0
  318. package/dist/generate/kinds/job-kind.js.map +1 -1
  319. package/dist/generate/kinds/module-kind.d.ts.map +1 -1
  320. package/dist/generate/kinds/module-kind.js +1 -0
  321. package/dist/generate/kinds/module-kind.js.map +1 -1
  322. package/dist/generate/kinds/plan-vars.d.ts.map +1 -1
  323. package/dist/generate/kinds/plan-vars.js +5 -2
  324. package/dist/generate/kinds/plan-vars.js.map +1 -1
  325. package/dist/generate/kinds/policy-kind.d.ts.map +1 -1
  326. package/dist/generate/kinds/policy-kind.js +1 -0
  327. package/dist/generate/kinds/policy-kind.js.map +1 -1
  328. package/dist/generate/kinds/port-kind.d.ts.map +1 -1
  329. package/dist/generate/kinds/port-kind.js +4 -2
  330. package/dist/generate/kinds/port-kind.js.map +1 -1
  331. package/dist/generate/kinds/process-kind.d.ts.map +1 -1
  332. package/dist/generate/kinds/process-kind.js +1 -0
  333. package/dist/generate/kinds/process-kind.js.map +1 -1
  334. package/dist/generate/kinds/projection-kind.d.ts.map +1 -1
  335. package/dist/generate/kinds/projection-kind.js +4 -5
  336. package/dist/generate/kinds/projection-kind.js.map +1 -1
  337. package/dist/generate/kinds/property-kind.d.ts.map +1 -1
  338. package/dist/generate/kinds/property-kind.js +1 -0
  339. package/dist/generate/kinds/property-kind.js.map +1 -1
  340. package/dist/generate/kinds/query-kind.d.ts.map +1 -1
  341. package/dist/generate/kinds/query-kind.js +1 -0
  342. package/dist/generate/kinds/query-kind.js.map +1 -1
  343. package/dist/generate/kinds/repository-kind.d.ts.map +1 -1
  344. package/dist/generate/kinds/repository-kind.js +1 -0
  345. package/dist/generate/kinds/repository-kind.js.map +1 -1
  346. package/dist/generate/kinds/representation-kind.d.ts.map +1 -1
  347. package/dist/generate/kinds/representation-kind.js +1 -0
  348. package/dist/generate/kinds/representation-kind.js.map +1 -1
  349. package/dist/generate/kinds/route-group-kind.d.ts.map +1 -1
  350. package/dist/generate/kinds/route-group-kind.js +1 -0
  351. package/dist/generate/kinds/route-group-kind.js.map +1 -1
  352. package/dist/generate/kinds/route-kind.d.ts.map +1 -1
  353. package/dist/generate/kinds/route-kind.js +1 -0
  354. package/dist/generate/kinds/route-kind.js.map +1 -1
  355. package/dist/generate/kinds/schema-kind.d.ts.map +1 -1
  356. package/dist/generate/kinds/schema-kind.js +4 -9
  357. package/dist/generate/kinds/schema-kind.js.map +1 -1
  358. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  359. package/dist/generate/kinds/service-kind.js +1 -0
  360. package/dist/generate/kinds/service-kind.js.map +1 -1
  361. package/dist/generate/kinds/state-machine-kind.d.ts.map +1 -1
  362. package/dist/generate/kinds/state-machine-kind.js +1 -0
  363. package/dist/generate/kinds/state-machine-kind.js.map +1 -1
  364. package/dist/generate/kinds/test-world-kind.d.ts.map +1 -1
  365. package/dist/generate/kinds/test-world-kind.js +1 -0
  366. package/dist/generate/kinds/test-world-kind.js.map +1 -1
  367. package/dist/generate/kinds/value-object-kind.d.ts.map +1 -1
  368. package/dist/generate/kinds/value-object-kind.js +5 -4
  369. package/dist/generate/kinds/value-object-kind.js.map +1 -1
  370. package/dist/generate/kinds/vocabulary-kind.d.ts.map +1 -1
  371. package/dist/generate/kinds/vocabulary-kind.js +1 -0
  372. package/dist/generate/kinds/vocabulary-kind.js.map +1 -1
  373. package/dist/generate/kinds/worker-kind.d.ts.map +1 -1
  374. package/dist/generate/kinds/worker-kind.js +1 -0
  375. package/dist/generate/kinds/worker-kind.js.map +1 -1
  376. package/dist/generate/kinds-help.d.ts +2 -0
  377. package/dist/generate/kinds-help.d.ts.map +1 -1
  378. package/dist/generate/kinds-help.js +5 -2
  379. package/dist/generate/kinds-help.js.map +1 -1
  380. package/dist/generate/label.d.ts +4 -1
  381. package/dist/generate/label.d.ts.map +1 -1
  382. package/dist/generate/label.js +24 -3
  383. package/dist/generate/label.js.map +1 -1
  384. package/dist/generate/language-probe.d.ts +16 -0
  385. package/dist/generate/language-probe.d.ts.map +1 -0
  386. package/dist/generate/language-probe.js +2 -0
  387. package/dist/generate/language-probe.js.map +1 -0
  388. package/dist/generate/learn-terms.d.ts.map +1 -1
  389. package/dist/generate/learn-terms.js +7 -1
  390. package/dist/generate/learn-terms.js.map +1 -1
  391. package/dist/generate/open-scope.d.ts +7 -2
  392. package/dist/generate/open-scope.d.ts.map +1 -1
  393. package/dist/generate/open-scope.js +14 -2
  394. package/dist/generate/open-scope.js.map +1 -1
  395. package/dist/generate/parse-terms.d.ts +7 -1
  396. package/dist/generate/parse-terms.d.ts.map +1 -1
  397. package/dist/generate/parse-terms.js +14 -4
  398. package/dist/generate/parse-terms.js.map +1 -1
  399. package/dist/generate/place-generated-files.d.ts +2 -2
  400. package/dist/generate/place-generated-files.d.ts.map +1 -1
  401. package/dist/generate/place-generated-files.js +7 -7
  402. package/dist/generate/place-generated-files.js.map +1 -1
  403. package/dist/generate/refuse-shared-writes.d.ts +2 -2
  404. package/dist/generate/refuse-shared-writes.d.ts.map +1 -1
  405. package/dist/generate/refuse-shared-writes.js +25 -4
  406. package/dist/generate/refuse-shared-writes.js.map +1 -1
  407. package/dist/generate/shared-kernel-placement.d.ts +9 -0
  408. package/dist/generate/shared-kernel-placement.d.ts.map +1 -0
  409. package/dist/generate/shared-kernel-placement.js +20 -0
  410. package/dist/generate/shared-kernel-placement.js.map +1 -0
  411. package/dist/generate/shared-kernel-scope.d.ts +11 -0
  412. package/dist/generate/shared-kernel-scope.d.ts.map +1 -0
  413. package/dist/generate/shared-kernel-scope.js +12 -0
  414. package/dist/generate/shared-kernel-scope.js.map +1 -0
  415. package/dist/generate/shared-writes.d.ts.map +1 -1
  416. package/dist/generate/shared-writes.js +26 -2
  417. package/dist/generate/shared-writes.js.map +1 -1
  418. package/dist/generate/spoken-in-language.d.ts +4 -3
  419. package/dist/generate/spoken-in-language.d.ts.map +1 -1
  420. package/dist/generate/spoken-in-language.js +19 -14
  421. package/dist/generate/spoken-in-language.js.map +1 -1
  422. package/dist/generate/usage-of.d.ts +6 -0
  423. package/dist/generate/usage-of.d.ts.map +1 -0
  424. package/dist/generate/usage-of.js +7 -0
  425. package/dist/generate/usage-of.js.map +1 -0
  426. package/dist/generate/vars.d.ts.map +1 -1
  427. package/dist/generate/vars.js +9 -1
  428. package/dist/generate/vars.js.map +1 -1
  429. package/dist/help/notes.d.ts +1 -1
  430. package/dist/help/notes.d.ts.map +1 -1
  431. package/dist/help/notes.js +31 -8
  432. package/dist/help/notes.js.map +1 -1
  433. package/dist/help/reference-text.d.ts.map +1 -1
  434. package/dist/help/reference-text.js +2 -1
  435. package/dist/help/reference-text.js.map +1 -1
  436. package/dist/help/usage.d.ts +1 -1
  437. package/dist/help/usage.d.ts.map +1 -1
  438. package/dist/help/usage.js +1 -1
  439. package/dist/init/agent-permissions.d.ts +7 -0
  440. package/dist/init/agent-permissions.d.ts.map +1 -1
  441. package/dist/init/agent-permissions.js +19 -8
  442. package/dist/init/agent-permissions.js.map +1 -1
  443. package/dist/init/files/persistence-files.d.ts.map +1 -1
  444. package/dist/init/files/persistence-files.js +2 -1
  445. package/dist/init/files/persistence-files.js.map +1 -1
  446. package/dist/init/first-install-note.d.ts +9 -0
  447. package/dist/init/first-install-note.d.ts.map +1 -0
  448. package/dist/init/first-install-note.js +52 -0
  449. package/dist/init/first-install-note.js.map +1 -0
  450. package/dist/init/managed-settings-note.d.ts.map +1 -1
  451. package/dist/init/managed-settings-note.js +1 -0
  452. package/dist/init/managed-settings-note.js.map +1 -1
  453. package/dist/init/manifest/allow-builds-block.d.ts +3 -0
  454. package/dist/init/manifest/allow-builds-block.d.ts.map +1 -0
  455. package/dist/init/manifest/allow-builds-block.js +5 -0
  456. package/dist/init/manifest/allow-builds-block.js.map +1 -0
  457. package/dist/init/manifest/allow-builds-entries.d.ts +8 -0
  458. package/dist/init/manifest/allow-builds-entries.d.ts.map +1 -0
  459. package/dist/init/manifest/allow-builds-entries.js +8 -0
  460. package/dist/init/manifest/allow-builds-entries.js.map +1 -0
  461. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  462. package/dist/init/manifest/database-scripts.js +4 -2
  463. package/dist/init/manifest/database-scripts.js.map +1 -1
  464. package/dist/init/manifest/install-scripts-of.d.ts +18 -0
  465. package/dist/init/manifest/install-scripts-of.d.ts.map +1 -0
  466. package/dist/init/manifest/install-scripts-of.js +25 -0
  467. package/dist/init/manifest/install-scripts-of.js.map +1 -0
  468. package/dist/init/manifest/names-package.d.ts +3 -0
  469. package/dist/init/manifest/names-package.d.ts.map +1 -0
  470. package/dist/init/manifest/names-package.js +5 -0
  471. package/dist/init/manifest/names-package.js.map +1 -0
  472. package/dist/init/manifest/prisma-client-script.d.ts +3 -0
  473. package/dist/init/manifest/prisma-client-script.d.ts.map +1 -0
  474. package/dist/init/manifest/prisma-client-script.js +5 -0
  475. package/dist/init/manifest/prisma-client-script.js.map +1 -0
  476. package/dist/init/manifest/versions.js +24 -24
  477. package/dist/init/manifest/write-install-scripts.d.ts +10 -0
  478. package/dist/init/manifest/write-install-scripts.d.ts.map +1 -0
  479. package/dist/init/manifest/write-install-scripts.js +78 -0
  480. package/dist/init/manifest/write-install-scripts.js.map +1 -0
  481. package/dist/init/manifest/write-manifest.d.ts.map +1 -1
  482. package/dist/init/manifest/write-manifest.js +9 -1
  483. package/dist/init/manifest/write-manifest.js.map +1 -1
  484. package/dist/init/merge-sandbox.d.ts +3 -1
  485. package/dist/init/merge-sandbox.d.ts.map +1 -1
  486. package/dist/init/merge-sandbox.js +25 -7
  487. package/dist/init/merge-sandbox.js.map +1 -1
  488. package/dist/init/regulated-sandbox.d.ts +6 -4
  489. package/dist/init/regulated-sandbox.d.ts.map +1 -1
  490. package/dist/init/regulated-sandbox.js +11 -5
  491. package/dist/init/regulated-sandbox.js.map +1 -1
  492. package/dist/init/run-init.d.ts +2 -0
  493. package/dist/init/run-init.d.ts.map +1 -1
  494. package/dist/init/run-init.js +47 -7
  495. package/dist/init/run-init.js.map +1 -1
  496. package/dist/init/stack-sandbox.d.ts +9 -0
  497. package/dist/init/stack-sandbox.d.ts.map +1 -0
  498. package/dist/init/stack-sandbox.js +28 -0
  499. package/dist/init/stack-sandbox.js.map +1 -0
  500. package/dist/init/write-agent-settings.d.ts.map +1 -1
  501. package/dist/init/write-agent-settings.js +26 -16
  502. package/dist/init/write-agent-settings.js.map +1 -1
  503. package/dist/merge/abort-merge.d.ts.map +1 -1
  504. package/dist/merge/abort-merge.js +38 -6
  505. package/dist/merge/abort-merge.js.map +1 -1
  506. package/dist/merge/commit-merge.d.ts.map +1 -1
  507. package/dist/merge/commit-merge.js +1 -16
  508. package/dist/merge/commit-merge.js.map +1 -1
  509. package/dist/merge/continue-merge.d.ts.map +1 -1
  510. package/dist/merge/continue-merge.js +2 -0
  511. package/dist/merge/continue-merge.js.map +1 -1
  512. package/dist/merge/ensure-mergeable.d.ts.map +1 -1
  513. package/dist/merge/ensure-mergeable.js +15 -0
  514. package/dist/merge/ensure-mergeable.js.map +1 -1
  515. package/dist/merge/ensure-writable.d.ts +9 -0
  516. package/dist/merge/ensure-writable.d.ts.map +1 -0
  517. package/dist/merge/ensure-writable.js +51 -0
  518. package/dist/merge/ensure-writable.js.map +1 -0
  519. package/dist/merge/is-merge-path.d.ts +4 -0
  520. package/dist/merge/is-merge-path.d.ts.map +1 -0
  521. package/dist/merge/is-merge-path.js +18 -0
  522. package/dist/merge/is-merge-path.js.map +1 -0
  523. package/dist/merge/is-sandbox-mask.d.ts +4 -0
  524. package/dist/merge/is-sandbox-mask.d.ts.map +1 -0
  525. package/dist/merge/is-sandbox-mask.js +5 -0
  526. package/dist/merge/is-sandbox-mask.js.map +1 -0
  527. package/dist/merge/merge-trunk.d.ts.map +1 -1
  528. package/dist/merge/merge-trunk.js +4 -0
  529. package/dist/merge/merge-trunk.js.map +1 -1
  530. package/dist/merge/modified-since-staged.d.ts +4 -0
  531. package/dist/merge/modified-since-staged.d.ts.map +1 -0
  532. package/dist/merge/modified-since-staged.js +8 -0
  533. package/dist/merge/modified-since-staged.js.map +1 -0
  534. package/dist/merge/stage-rewritten.d.ts +8 -0
  535. package/dist/merge/stage-rewritten.d.ts.map +1 -0
  536. package/dist/merge/stage-rewritten.js +15 -0
  537. package/dist/merge/stage-rewritten.js.map +1 -0
  538. package/dist/naming/parse-concept-name.d.ts +5 -3
  539. package/dist/naming/parse-concept-name.d.ts.map +1 -1
  540. package/dist/naming/parse-concept-name.js +6 -10
  541. package/dist/naming/parse-concept-name.js.map +1 -1
  542. package/dist/plan/format-plan.d.ts +2 -1
  543. package/dist/plan/format-plan.d.ts.map +1 -1
  544. package/dist/plan/format-plan.js +20 -2
  545. package/dist/plan/format-plan.js.map +1 -1
  546. package/dist/plan/plan-waves.d.ts.map +1 -1
  547. package/dist/plan/plan-waves.js +2 -1
  548. package/dist/plan/plan-waves.js.map +1 -1
  549. package/dist/plan/planned-commands.d.ts +10 -0
  550. package/dist/plan/planned-commands.d.ts.map +1 -0
  551. package/dist/plan/planned-commands.js +13 -0
  552. package/dist/plan/planned-commands.js.map +1 -0
  553. package/dist/plan/planned-words.d.ts +27 -0
  554. package/dist/plan/planned-words.d.ts.map +1 -0
  555. package/dist/plan/planned-words.js +170 -0
  556. package/dist/plan/planned-words.js.map +1 -0
  557. package/dist/plan/wave-plan.d.ts +11 -1
  558. package/dist/plan/wave-plan.d.ts.map +1 -1
  559. package/dist/presets/apply-preset.d.ts.map +1 -1
  560. package/dist/presets/apply-preset.js +6 -4
  561. package/dist/presets/apply-preset.js.map +1 -1
  562. package/dist/presets/identity-preset.d.ts.map +1 -1
  563. package/dist/presets/identity-preset.js +1 -4
  564. package/dist/presets/identity-preset.js.map +1 -1
  565. package/dist/presets/lay-out-prisma-models.d.ts +4 -4
  566. package/dist/presets/lay-out-prisma-models.d.ts.map +1 -1
  567. package/dist/presets/lay-out-prisma-models.js +15 -12
  568. package/dist/presets/lay-out-prisma-models.js.map +1 -1
  569. package/dist/presets/outside-the-tenancy.d.ts +10 -0
  570. package/dist/presets/outside-the-tenancy.d.ts.map +1 -0
  571. package/dist/presets/outside-the-tenancy.js +31 -0
  572. package/dist/presets/outside-the-tenancy.js.map +1 -0
  573. package/dist/presets/preset-decision.d.ts +1 -1
  574. package/dist/presets/preset-decision.js +1 -1
  575. package/dist/presets/preset.d.ts +1 -1
  576. package/dist/prisma-schema/index.d.ts +11 -0
  577. package/dist/prisma-schema/index.d.ts.map +1 -0
  578. package/dist/prisma-schema/index.js +11 -0
  579. package/dist/prisma-schema/index.js.map +1 -0
  580. package/dist/prisma-schema/keeps-single-prisma-schema.d.ts +7 -0
  581. package/dist/prisma-schema/keeps-single-prisma-schema.d.ts.map +1 -0
  582. package/dist/prisma-schema/keeps-single-prisma-schema.js +11 -0
  583. package/dist/prisma-schema/keeps-single-prisma-schema.js.map +1 -0
  584. package/dist/prisma-schema/prisma-blocks.d.ts +9 -0
  585. package/dist/prisma-schema/prisma-blocks.d.ts.map +1 -0
  586. package/dist/prisma-schema/prisma-blocks.js +15 -0
  587. package/dist/prisma-schema/prisma-blocks.js.map +1 -0
  588. package/dist/prisma-schema/prisma-main-schema.d.ts +3 -0
  589. package/dist/prisma-schema/prisma-main-schema.d.ts.map +1 -0
  590. package/dist/prisma-schema/prisma-main-schema.js +4 -0
  591. package/dist/prisma-schema/prisma-main-schema.js.map +1 -0
  592. package/dist/prisma-schema/prisma-schema-folder.d.ts +3 -0
  593. package/dist/prisma-schema/prisma-schema-folder.d.ts.map +1 -0
  594. package/dist/prisma-schema/prisma-schema-folder.js +3 -0
  595. package/dist/prisma-schema/prisma-schema-folder.js.map +1 -0
  596. package/dist/prisma-schema/prisma-schema-of.d.ts +7 -0
  597. package/dist/prisma-schema/prisma-schema-of.d.ts.map +1 -0
  598. package/dist/prisma-schema/prisma-schema-of.js +10 -0
  599. package/dist/prisma-schema/prisma-schema-of.js.map +1 -0
  600. package/dist/prisma-schema/schema-at.d.ts +4 -0
  601. package/dist/prisma-schema/schema-at.d.ts.map +1 -0
  602. package/dist/prisma-schema/schema-at.js +5 -0
  603. package/dist/prisma-schema/schema-at.js.map +1 -0
  604. package/dist/prisma-schema/schema-of-context.d.ts +3 -0
  605. package/dist/prisma-schema/schema-of-context.d.ts.map +1 -0
  606. package/dist/prisma-schema/schema-of-context.js +5 -0
  607. package/dist/prisma-schema/schema-of-context.js.map +1 -0
  608. package/dist/prisma-schema/single-prisma-schema-found.d.ts +3 -0
  609. package/dist/prisma-schema/single-prisma-schema-found.d.ts.map +1 -0
  610. package/dist/prisma-schema/single-prisma-schema-found.js +7 -0
  611. package/dist/prisma-schema/single-prisma-schema-found.js.map +1 -0
  612. package/dist/prisma-schema/single-prisma-schema-steps.d.ts +6 -0
  613. package/dist/prisma-schema/single-prisma-schema-steps.d.ts.map +1 -0
  614. package/dist/prisma-schema/single-prisma-schema-steps.js +25 -0
  615. package/dist/prisma-schema/single-prisma-schema-steps.js.map +1 -0
  616. package/dist/prisma-schema/single-prisma-schema.d.ts +3 -0
  617. package/dist/prisma-schema/single-prisma-schema.d.ts.map +1 -0
  618. package/dist/prisma-schema/single-prisma-schema.js +3 -0
  619. package/dist/prisma-schema/single-prisma-schema.js.map +1 -0
  620. package/dist/progress/read-remaining.d.ts.map +1 -1
  621. package/dist/progress/read-remaining.js +49 -6
  622. package/dist/progress/read-remaining.js.map +1 -1
  623. package/dist/slice/plan-staging.d.ts +7 -4
  624. package/dist/slice/plan-staging.d.ts.map +1 -1
  625. package/dist/slice/plan-staging.js +23 -5
  626. package/dist/slice/plan-staging.js.map +1 -1
  627. package/dist/slice/staging-scope.d.ts +9 -0
  628. package/dist/slice/staging-scope.d.ts.map +1 -0
  629. package/dist/slice/staging-scope.js +2 -0
  630. package/dist/slice/staging-scope.js.map +1 -0
  631. package/dist/slice/storage-of-slice.d.ts +14 -0
  632. package/dist/slice/storage-of-slice.d.ts.map +1 -0
  633. package/dist/slice/storage-of-slice.js +79 -0
  634. package/dist/slice/storage-of-slice.js.map +1 -0
  635. package/dist/slice/verify-slice.d.ts.map +1 -1
  636. package/dist/slice/verify-slice.js +3 -1
  637. package/dist/slice/verify-slice.js.map +1 -1
  638. package/dist/stack/audit-vars.js +1 -1
  639. package/dist/stack/audit-vars.js.map +1 -1
  640. package/dist/version.d.ts +1 -1
  641. package/dist/version.js +1 -1
  642. package/dist/worker/briefing-of.d.ts.map +1 -1
  643. package/dist/worker/briefing-of.js +7 -0
  644. package/dist/worker/briefing-of.js.map +1 -1
  645. package/dist/worker/progress-of.d.ts.map +1 -1
  646. package/dist/worker/progress-of.js +4 -1
  647. package/dist/worker/progress-of.js.map +1 -1
  648. package/dist/workspace/cannot-write.d.ts +7 -0
  649. package/dist/workspace/cannot-write.d.ts.map +1 -0
  650. package/dist/workspace/cannot-write.js +36 -0
  651. package/dist/workspace/cannot-write.js.map +1 -0
  652. package/dist/workspace/error-code-of.d.ts +3 -0
  653. package/dist/workspace/error-code-of.d.ts.map +1 -0
  654. package/dist/workspace/error-code-of.js +5 -0
  655. package/dist/workspace/error-code-of.js.map +1 -0
  656. package/dist/workspace/exit-code-of.d.ts +6 -0
  657. package/dist/workspace/exit-code-of.d.ts.map +1 -0
  658. package/dist/workspace/exit-code-of.js +7 -0
  659. package/dist/workspace/exit-code-of.js.map +1 -0
  660. package/dist/workspace/index.d.ts +2 -0
  661. package/dist/workspace/index.d.ts.map +1 -1
  662. package/dist/workspace/index.js +2 -0
  663. package/dist/workspace/index.js.map +1 -1
  664. package/dist/workspace/is-file-or-absent.d.ts +3 -0
  665. package/dist/workspace/is-file-or-absent.d.ts.map +1 -0
  666. package/dist/workspace/is-file-or-absent.js +11 -0
  667. package/dist/workspace/is-file-or-absent.js.map +1 -0
  668. package/dist/workspace/prune-emptied.d.ts +3 -0
  669. package/dist/workspace/prune-emptied.d.ts.map +1 -0
  670. package/dist/workspace/prune-emptied.js +12 -0
  671. package/dist/workspace/prune-emptied.js.map +1 -0
  672. package/dist/workspace/tell-unwritable.d.ts +9 -0
  673. package/dist/workspace/tell-unwritable.d.ts.map +1 -0
  674. package/dist/workspace/tell-unwritable.js +10 -0
  675. package/dist/workspace/tell-unwritable.js.map +1 -0
  676. package/dist/workspace/workspace-report.d.ts +3 -0
  677. package/dist/workspace/workspace-report.d.ts.map +1 -1
  678. package/dist/workspace/workspace.d.ts +15 -4
  679. package/dist/workspace/workspace.d.ts.map +1 -1
  680. package/dist/workspace/workspace.js +47 -27
  681. package/dist/workspace/workspace.js.map +1 -1
  682. package/dist/workspace/write-if-allowed.d.ts +3 -0
  683. package/dist/workspace/write-if-allowed.d.ts.map +1 -0
  684. package/dist/workspace/write-if-allowed.js +20 -0
  685. package/dist/workspace/write-if-allowed.js.map +1 -0
  686. package/package.json +4 -4
  687. package/templates/adapter/simulated.declared.ts.tpl +7 -0
  688. package/templates/adapter/simulated.spec.ts.tpl +12 -0
  689. package/templates/adapter/simulated.ts.tpl +5 -0
  690. package/templates/adapter/simulated.wiring.tsyringe.tpl +5 -0
  691. package/templates/aggregate/event-sourced.aggregate.spec.ts.tpl +8 -0
  692. package/templates/context/CONTEXT.md.tpl +1 -1
  693. package/templates/init/README.md.tpl +1 -1
  694. package/templates/init/platform/audit/create-audit.ts.tpl +1 -1
  695. package/templates/init/platform/composition/compose-application.manual.ts.tpl +24 -17
  696. package/templates/init/platform/database/create-client.prisma.ts.tpl +1 -1
  697. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +1 -1
  698. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +2 -2
  699. package/templates/init/platform/database/prisma.config.ts.tpl +2 -1
  700. package/templates/init/platform/database/schema.prisma.tpl +3 -4
  701. package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +1 -1
  702. package/templates/init/pnpm-workspace.yaml +2 -5
  703. package/templates/init/rules/infrastructure.md.tpl +2 -1
  704. package/templates/pipeline/github/actions/setup/action.yml.tpl +1 -1
  705. package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +1 -1
  706. package/templates/pipeline/package-scripts.json +1 -1
  707. package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +0 -3
  708. package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +0 -3
  709. package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +0 -3
  710. package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +0 -3
  711. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation-tenant-directory.reader.drizzle.ts.tpl +0 -3
  712. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +0 -3
  713. package/templates/presets/identity/context/infrastructure/persistence/drizzle-search-members-reader.repository.drizzle.ts.tpl +0 -3
  714. package/templates/presets/identity/context/infrastructure/persistence/knex-account.repository.knex.ts.tpl +0 -3
  715. package/templates/presets/identity/context/infrastructure/persistence/knex-delegation.repository.knex.ts.tpl +0 -3
  716. package/templates/presets/identity/context/infrastructure/persistence/knex-invitation.repository.knex.ts.tpl +0 -3
  717. package/templates/presets/identity/context/infrastructure/persistence/knex-member.repository.knex.ts.tpl +0 -3
  718. package/templates/presets/identity/context/infrastructure/persistence/knex-organisation-tenant-directory.reader.knex.ts.tpl +0 -3
  719. package/templates/presets/identity/context/infrastructure/persistence/knex-organisation.repository.knex.ts.tpl +0 -3
  720. package/templates/presets/identity/context/infrastructure/persistence/knex-search-members-reader.repository.knex.ts.tpl +0 -3
  721. package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +0 -3
  722. package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +0 -3
  723. package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +0 -3
  724. package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +0 -3
  725. package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation-tenant-directory.reader.prisma.ts.tpl +0 -3
  726. package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +0 -3
  727. package/templates/presets/identity/context/infrastructure/persistence/prisma-search-members-reader.repository.prisma.ts.tpl +0 -3
  728. package/templates/presets/identity/decision.md.tpl +9 -6
  729. package/templates/presets/identity/design.md.tpl +4 -1
  730. package/templates/repository/prisma/schema.prisma.tpl +4 -0
  731. package/templates/shared-kernel/CONTEXT.md.tpl +16 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-if-allowed.js","sourceRoot":"","sources":["../../src/workspace/write-if-allowed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,mHAAmH;AACnH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEvF,yGAAyG;AACzG,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,OAAe;IAC9D,IAAI,CAAC;QACH,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAEpC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YAC5C,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddd-ts-kit",
3
- "version": "0.94.1",
3
+ "version": "0.96.0",
4
4
  "description": "Bootstrap, scaffold and verify Domain-Driven Design (DDD), Clean Architecture and hexagonal TypeScript backends on Node.js: project and code generators, architecture checks, OpenAPI and AsyncAPI documents, for developers and AI coding agents (Claude Code, Codex, GitHub Copilot).",
5
5
  "keywords": [
6
6
  "ddd",
@@ -52,9 +52,9 @@
52
52
  "clean:packages": "node dist/bin.js check --clean-only ../kernel/src ../validation/src ../http/src ../tracing/src ../di/src ../events/src ../testing/src ../s3/src ../drizzle/src ../knex/src ../prisma/src ../typeorm/src ../aspects/src ../rabbitmq/src ../auth/src ../audit/src ../redis/src ../scheduling/src ../pino/src ../winston/src ../sentry/src ../kafka/src ../nats/src ../eslint-plugin/src"
53
53
  },
54
54
  "devDependencies": {
55
- "@ddd-ts-kit/audit": "^0.94.1",
56
- "@ddd-ts-kit/events": "^0.94.1",
57
- "@ddd-ts-kit/kernel": "^0.94.1",
55
+ "@ddd-ts-kit/audit": "^0.96.0",
56
+ "@ddd-ts-kit/events": "^0.96.0",
57
+ "@ddd-ts-kit/kernel": "^0.96.0",
58
58
  "@types/pg": "^8.23.1",
59
59
  "pg": "^8.23.1"
60
60
  }
@@ -0,0 +1,7 @@
1
+ import { Adapter } from '@ddd-ts-kit/kernel/declarations';
2
+ import { {{name.pascal}} } from '{{alias.context}}/application/ports/{{name.kebab}}.port{{alias.ext}}';
3
+
4
+ @Adapter({{name.pascal}}, { kind: 'external' })
5
+ export class Simulated{{name.pascal}} implements {{name.pascal}} {
6
+ // TODO(domain): this adapter stands in for the outside system where it is simulated (a sandbox, a demo), and nothing it does leaves the process. Answer each operation of {{name.pascal}} from records kept here, as the outside system would, in the types of {{context.kebab}}, and refuse what it would refuse; declare each one `async`. Keep the records in the shape the outside system sends and answer through its translator of infrastructure/anti-corruption when it has one, so that the simulation runs the same anti-corruption layer as the remote adapter.
7
+ }
@@ -0,0 +1,12 @@
1
+ import { describe, expect, it } from '{{tests.module}}';
2
+ import { Simulated{{name.pascal}} } from '{{alias.context}}/infrastructure/external/simulated-{{name.kebab}}.adapter{{alias.ext}}';
3
+
4
+ describe('Simulated{{name.pascal}}', () => {
5
+ it('is an adapter of the port, built without argument: it reaches nothing outside the process', () => {
6
+ expect(new Simulated{{name.pascal}}()).toBeInstanceOf(Simulated{{name.pascal}});
7
+ });
8
+
9
+ // TODO(domain): replace each entry below by a behaviour of {{name.pascal}}; hold this adapter, the remote one and the fake of test/fakes to the same expectations (a contract suite of the port, once two of them answer).
10
+ it.todo('answers what the outside system would answer, in the types of {{context.kebab}}');
11
+ it.todo('refuses what the outside system would refuse');
12
+ });
@@ -0,0 +1,5 @@
1
+ import type { {{name.pascal}} } from '{{alias.context}}/application/ports/{{name.kebab}}.port{{alias.ext}}';
2
+
3
+ export class Simulated{{name.pascal}} implements {{name.pascal}} {
4
+ // TODO(domain): this adapter stands in for the outside system where it is simulated (a sandbox, a demo), and nothing it does leaves the process. Answer each operation of {{name.pascal}} from records kept here, as the outside system would, in the types of {{context.kebab}}, and refuse what it would refuse; declare each one `async`. Keep the records in the shape the outside system sends and answer through its translator of infrastructure/anti-corruption when it has one, so that the simulation runs the same anti-corruption layer as the remote adapter.
5
+ }
@@ -0,0 +1,5 @@
1
+ @@imports
2
+ import { {{name.pascal}} } from '{{alias.context}}/application/ports/{{name.kebab}}.port{{alias.ext}}';
3
+ import { Simulated{{name.pascal}} } from '{{alias.context}}/infrastructure/external/simulated-{{name.kebab}}.adapter{{alias.ext}}';
4
+ @@registrations
5
+ builder.bind({{name.pascal}}).toClass(Simulated{{name.pascal}}).as('external');
@@ -2,6 +2,7 @@ import { describe, expect, it } from '{{tests.module}}';
2
2
  import { givenEvents } from '@ddd-ts-kit/testing';
3
3
  import { {{name.pascal}} } from '{{alias.context}}/domain/aggregates/{{name.kebab}}.aggregate{{alias.ext}}';
4
4
  import { {{event.pascal}} } from '{{alias.context}}/domain/events/{{event.kebab}}.event{{alias.ext}}';
5
+ import { {{name.article}}{{name.pascal}} } from '{{alias.context}}/test/builders/{{name.kebab}}.builder{{alias.ext}}';
5
6
 
6
7
  const bornAt = new Date('2026-03-01T00:00:00.000Z');
7
8
 
@@ -20,6 +21,13 @@ describe('{{name.pascal}}', () => {
20
21
  .thenState((loaded) => expect(loaded.version).toBe(1));
21
22
  });
22
23
 
24
+ it('is loaded by its builder in the state its birth gives, recording nothing', () => {
25
+ const loaded = {{name.article}}{{name.pascal}}().identifiedBy('{{name.kebab}}-7').bornAt(bornAt).build();
26
+
27
+ expect(loaded.registeredAt).toEqual(bornAt);
28
+ expect(loaded.pullEvents()).toEqual([]);
29
+ });
30
+
23
31
  // TODO(domain): replace each entry below by a test named after the business rule it proves: given the events of a history, when one command, then the events it records (`thenEvents`) or the refusal (`thenError`).
24
32
  it.todo('refuses to be born when a birth invariant is violated');
25
33
  it.todo('records a fact for each business intention, and changes state only through it');
@@ -8,7 +8,7 @@
8
8
 
9
9
  {{doc.classification}}
10
10
 
11
- TODO(domain): say in one sentence why this context is {{doc.classification}}.
11
+ {{doc.classificationReason}}
12
12
 
13
13
  ## Ubiquitous language
14
14
  {{doc.glossaryHint}}
@@ -20,7 +20,7 @@ npm run db:migrate
20
20
  npm run db:migrate # builds, then applies migrations/ (the first one creates every table)
21
21
  {{/if}}
22
22
  {{#if orm.prisma}}
23
- npm run db:client # the Prisma client and the schema of the tests, from prisma/schema.prisma
23
+ npm run db:client # the Prisma client and the schema of the tests, from the files of prisma/schema/
24
24
  npm run db:generate initial # prisma/migrations/<timestamp>_initial/, from the schema
25
25
  npm run db:migrate
26
26
  {{/if}}
@@ -137,7 +137,7 @@ function createAuditTrail(persistence: Persistence): AuditTrail & AuditReader &
137
137
  }
138
138
  {{/if}}
139
139
  {{#if audit.prisma}}
140
- /** The schema the models of the trail declare in prisma/schema.prisma (`@@schema("audit")`). */
140
+ /** The schema the models of the trail declare in prisma/schema/schema.prisma (`@@schema("audit")`). */
141
141
  const AUDIT_SCHEMA = 'audit';
142
142
 
143
143
  function createAuditTrail(persistence: Persistence): AuditTrail & AuditReader & ArchivableAuditTrail {
@@ -36,7 +36,7 @@ import { auditModule } from '{{alias.platform}}/audit/audit.module{{alias.ext}}'
36
36
  import { httpBoundary, type HttpBoundary } from '{{alias.platform}}/auth/authentication/http-boundary{{alias.ext}}';
37
37
  {{/if}}
38
38
  {{#if presentation.any}}
39
- import { presentationOf } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
39
+ import { presentationOf, type Presentation } from '{{alias.platform}}/http/presentation-of{{alias.ext}}';
40
40
  {{/if}}
41
41
  {{#if presentation.forms}}
42
42
  import { withForms } from '{{alias.platform}}/http/with-forms{{alias.ext}}';
@@ -199,22 +199,7 @@ export function composeApplication(
199
199
  {{#if routes.nest}}
200
200
  controllers,
201
201
  {{/if}}
202
- boundary: httpBoundary({
203
- authenticator: options.authenticator,
204
- executionScope: platform.scope,
205
- errorMapper: platformErrorMapper(),
206
- clock,
207
- logger,
208
- {{#if audit.on}}
209
- refusals: platform.audit.refusals,
210
- {{/if}}
211
- {{#if errors.sentry}}
212
- errors: platform.errors,
213
- {{/if}}
214
- {{#if presentation.any}}
215
- presentation,
216
- {{/if}}
217
- }),
202
+ boundary: boundaryOf(platform, options{{#if presentation.any}}, presentation{{/if}}),
218
203
  {{/if}}
219
204
  {{#unless http.any}}
220
205
  routes: [],
@@ -243,6 +228,28 @@ export function composeApplication(
243
228
  stop: () => stop(platform, options),
244
229
  };
245
230
  }
231
+ {{#if http.any}}
232
+
233
+ /** Who calls, in which scope, and how a refusal or an error is answered, at the edge of the HTTP server. */
234
+ function boundaryOf(platform: Platform, options: ApplicationOptions{{#if presentation.any}}, presentation: Presentation{{/if}}): HttpBoundary {
235
+ return httpBoundary({
236
+ authenticator: options.authenticator,
237
+ executionScope: platform.scope,
238
+ errorMapper: platformErrorMapper(),
239
+ clock: platform.clock,
240
+ logger: platform.logger,
241
+ {{#if audit.on}}
242
+ refusals: platform.audit.refusals,
243
+ {{/if}}
244
+ {{#if errors.sentry}}
245
+ errors: platform.errors,
246
+ {{/if}}
247
+ {{#if presentation.any}}
248
+ presentation,
249
+ {{/if}}
250
+ });
251
+ }
252
+ {{/if}}
246
253
 
247
254
  /**
248
255
  * The consumers first, then the jobs: a job sends commands whose events must find their handlers.
@@ -6,7 +6,7 @@ export interface ConnectionOptions {
6
6
  readonly poolSize?: number;
7
7
  }
8
8
 
9
- /** The client connects on the first query. Run `npm run db:client` after a change of prisma/schema.prisma. */
9
+ /** The client connects on the first query. Run `npm run db:client` after a change of a file of prisma/schema/. */
10
10
  export function createClient(url: string, options: ConnectionOptions = {}): PrismaClient {
11
11
  const pool = options.poolSize === undefined ? {} : { max: options.poolSize };
12
12
 
@@ -24,7 +24,7 @@ export interface TestDatabase {
24
24
 
25
25
  /**
26
26
  * PostgreSQL in process (PGlite, served over the wire protocol) by default, with the tables of
27
- * generated/schema.sql, which `npm run db:client` derives from prisma/schema.prisma: adapter
27
+ * generated/schema.sql, which `npm run db:client` derives from prisma/schema/: adapter
28
28
  * and end-to-end specs need no container. With a URL, the tests run on that server instead,
29
29
  * which must already be migrated (`npm run db:migrate`).
30
30
  */
@@ -28,10 +28,10 @@ import { createPrismaUnitOfWork, PrismaOutboxStore, PrismaProcessedEventStore }
28
28
  import type { PrismaClient } from '{{alias.generated}}/prisma/client{{alias.ext}}';
29
29
  import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
30
30
 
31
- /** The schema of the messaging tables{{#if queue.processTable}} and of the background work{{/if}}, as prisma/schema.prisma names it. */
31
+ /** The schema of the messaging tables{{#if queue.processTable}} and of the background work{{/if}}, as prisma/schema/schema.prisma names it. */
32
32
  const MESSAGING_SCHEMA = 'messaging';
33
33
  {{#if eventSourcing.on}}
34
- /** The schema of the event store, as prisma/schema.prisma names it. */
34
+ /** The schema of the event store, as prisma/schema/schema.prisma names it. */
35
35
  const EVENT_STORE_SCHEMA = 'event_store';
36
36
  {{/if}}
37
37
 
@@ -1,7 +1,8 @@
1
1
  import { defineConfig } from 'prisma/config';
2
2
 
3
3
  export default defineConfig({
4
- schema: './prisma/schema.prisma',
4
+ // Every .prisma file of the folder: schema.prisma (the client, the datasource, the platform) and one file per context.
5
+ schema: './prisma/schema',
5
6
  migrations: { path: './prisma/migrations' },
6
7
  // `generate` and `migrate diff` never connect: they work without a database.
7
8
  datasource: { url: process.env['DATABASE_URL'] ?? 'postgresql://unused:unused@127.0.0.1:1/unused' },
@@ -1,6 +1,6 @@
1
1
  generator client {
2
2
  provider = "prisma-client"
3
- output = "../generated/prisma"
3
+ output = "../../generated/prisma"
4
4
  moduleFormat = "esm"
5
5
  importFileExtension = "js"
6
6
  }
@@ -100,9 +100,8 @@ model ProcessInstance {
100
100
  }
101
101
  {{/if}}
102
102
 
103
- // One schema per bounded context, no relation across contexts.
104
- // ddd-ts-kit:models
105
- // /ddd-ts-kit:models
103
+ // The models of each bounded context are in a file of their own beside this one,
104
+ // prisma/schema/<context>.prisma, in the database schema of the context: no relation across contexts.
106
105
  {{#if eventSourcing.on}}
107
106
 
108
107
  // The event store of @ddd-ts-kit/prisma: the events, the snapshots, the checkpoints and the
@@ -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{{#if tenancy.any}}, type ExecutionScope{{/if}} } from '@ddd-ts-kit/kernel';
4
+ import { PersonalDataCipher, type EventSourcingStores{{#if tenancy.any}}{{#unless audit.on}}, type ExecutionScope{{/unless}}{{/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}}
@@ -1,8 +1,5 @@
1
- # No dependency runs a build script at install, as under npm: one whose script the
2
- # project needs (a native client, for instance) is allowed by name, once its script was read:
3
- #
4
- # allowBuilds:
5
- # '<package>': true
1
+ # pnpm runs the build script of a dependency only when `allowBuilds` names it (`'<package>': true`):
2
+ # init allows those the stack needs, and another one is added the same way, once its script was read.
6
3
  #
7
4
  # Without this line pnpm refuses to install as long as one script is neither allowed nor refused.
8
5
  strictDepBuilds: false
@@ -8,6 +8,7 @@ paths:
8
8
 
9
9
  - An adapter `implements` a port of `application/ports/` or a repository port of `domain/repositories/`, and never `extends` it (`ports/implements-never-extends`). It never imports `presentation/` (`layer/infrastructure-no-presentation`).
10
10
  - `persistence/` holds repository adapters, mappers and rows, `external/` the adapters of outside systems, `anti-corruption/` the translators of another model.
11
+ - An outside system the application runs without (a sandbox, a demo, a provider not ready yet) is answered by a simulated adapter of `external/`, `npx ddd-ts-kit generate adapter <context> <Port> --kind simulated`, which answers in memory as the system would, through its translator of `anti-corruption/`; never by a fake of `test/fakes/`, which production code never imports. A port has one adapter: the simulated one or the remote one.
11
12
  {{#if literals.named}}
12
13
  - A word of the other model stays its word: a translator keys its tables by the type of that model, `Record<TheirRecord['code'], InvoiceStatus>` (an annotation or `satisfies`), and compares with `'code' satisfies TheirRecord['code']`, so that the compiler holds its spelling; the value of the context it produces is read from its vocabulary (`language/declared-vocabulary`).
13
14
  {{/if}}
@@ -19,7 +20,7 @@ paths:
19
20
  - Own tables, in the schema of the context: no join, foreign key or transaction across contexts (`context/extractable`).
20
21
  - Audit columns and the tenant column are stamped from the execution scope with the kernel helpers (`stampCreation`, `stampUpdate`, `tenantScopeOf`), never handed over by a use case.
21
22
  {{#if tenancy.any}}
22
- - Tenant data is reached through the helpers of the ORM package, never straight from the executor: {{#if orm.knex}}`tenantTable` to read, `ownTenantTable` to update or delete{{/if}}{{#if orm.drizzle}}`tenantCondition` in the condition of a read, `ownTenantCondition` in that of an update or a delete{{/if}}{{#if orm.prisma}}`tenantWhere` spread into the where of a read (`findFirst`, never `findUnique`: the tenant is not part of the key), `ownTenantWhere` into that of an update or a delete{{/if}}{{#if orm.typeorm}}`tenantWhere` spread into the where of a read, `ownTenantWhere` into the criteria of an update or a delete, never `save` or `upsert`{{/if}}, the tenant named on every insert, a read model store built with its `tenant` (`tenancy/scoped-statement`). A table of no tenant is a recorded deviation. See `docs/concepts/multitenancy.md` of the kit.
23
+ - Tenant data is reached through the helpers of the ORM package, never straight from the executor: {{#if orm.knex}}`tenantTable` to read, `ownTenantTable` to update or delete{{/if}}{{#if orm.drizzle}}`tenantCondition` in the condition of a read, `ownTenantCondition` in that of an update or a delete{{/if}}{{#if orm.prisma}}`tenantWhere` spread into the where of a read (`findFirst`, never `findUnique`: the tenant is not part of the key), `ownTenantWhere` into that of an update or a delete{{/if}}{{#if orm.typeorm}}`tenantWhere` spread into the where of a read, `ownTenantWhere` into the criteria of an update or a delete, never `save` or `upsert`{{/if}}, the tenant named on every insert, a read model store built with its `tenant` (`tenancy/scoped-statement`). A table of no tenant is a recorded deviation; a context none of whose tables belongs to a tenant, since it decides who belongs to which, is declared `"tenancy": "control-plane"` in its entry of `contexts`, with its deviation, never suppressed statement by statement. See `docs/concepts/multitenancy.md` of the kit.
23
24
  {{/if}}
24
25
  {{#if style.declared}}
25
26
  - An adapter declares itself on its class, one per file (`declarations/role-declared`): `@Repository(InvoiceRepository)`, `@Gateway(Port)` or `@Adapter(Port, { kind })`. What it is given is what its constructor takes, each parameter typed by one class (`{{persistence.tokenOrNone}}`, `ExecutionScope`, `Clock`, a port, an abstract class the platform binds to a value) and nothing listed in the decorator (`declarations/constructor-injection`); an adapter that extends a class of a package writes its own constructor.
@@ -34,7 +34,7 @@ runs:
34
34
  shell: bash
35
35
  run: npm ci
36
36
  {{#if orm.prisma}}
37
- - name: The Prisma client and the schema of the tests, build products of prisma/schema.prisma
37
+ - name: The Prisma client and the schema of the tests, build products of prisma/schema/
38
38
  shell: bash
39
39
  run: npm run db:client
40
40
  {{/if}}
@@ -80,7 +80,7 @@ default:
80
80
  {{/if}}
81
81
  - test -d node_modules || npm ci
82
82
  {{#if orm.prisma}}
83
- # The Prisma client and the schema of the tests are build products of prisma/schema.prisma.
83
+ # The Prisma client and the schema of the tests are build products of prisma/schema/.
84
84
  - npm run db:client
85
85
  {{/if}}
86
86
 
@@ -23,7 +23,7 @@
23
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.94.1",
26
+ "@ddd-ts-kit/eslint-plugin": "^0.96.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",
@@ -61,8 +61,5 @@ export class DrizzleAccountRepository implements AccountRepository {
61
61
 
62
62
  /** The executor of the unit of work, which every statement of this file goes through. */
63
63
  function executorOf(database: Database): ReturnType<Database['executor']> {
64
- {{#if tenancy.any}}
65
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
66
- {{/if}}
67
64
  return database.executor();
68
65
  }
@@ -79,8 +79,5 @@ function unended(organisationId: string) {
79
79
 
80
80
  /** The executor of the unit of work, which every statement of this file goes through. */
81
81
  function executorOf(database: Database): ReturnType<Database['executor']> {
82
- {{#if tenancy.any}}
83
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
84
- {{/if}}
85
82
  return database.executor();
86
83
  }
@@ -67,8 +67,5 @@ export class DrizzleInvitationRepository implements InvitationRepository {
67
67
 
68
68
  /** The executor of the unit of work, which every statement of this file goes through. */
69
69
  function executorOf(database: Database): ReturnType<Database['executor']> {
70
- {{#if tenancy.any}}
71
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
72
- {{/if}}
73
70
  return database.executor();
74
71
  }
@@ -86,8 +86,5 @@ function current(organisationId: string, accountId: string) {
86
86
 
87
87
  /** The executor of the unit of work, which every statement of this file goes through. */
88
88
  function executorOf(database: Database): ReturnType<Database['executor']> {
89
- {{#if tenancy.any}}
90
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
91
- {{/if}}
92
89
  return database.executor();
93
90
  }
@@ -19,8 +19,5 @@ export class DrizzleOrganisationTenantDirectory implements TenantDirectory {
19
19
 
20
20
  /** The executor of the unit of work, which every statement of this file goes through. */
21
21
  function executorOf(database: Database): ReturnType<Database['executor']> {
22
- {{#if tenancy.any}}
23
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
24
- {{/if}}
25
22
  return database.executor();
26
23
  }
@@ -61,8 +61,5 @@ export class DrizzleOrganisationRepository implements OrganisationRepository {
61
61
 
62
62
  /** The executor of the unit of work, which every statement of this file goes through. */
63
63
  function executorOf(database: Database): ReturnType<Database['executor']> {
64
- {{#if tenancy.any}}
65
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
66
- {{/if}}
67
64
  return database.executor();
68
65
  }
@@ -55,8 +55,5 @@ export class DrizzleSearchMembersReader implements SearchMembersReader {
55
55
 
56
56
  /** The executor of the unit of work, which every statement of this file goes through. */
57
57
  function executorOf(database: Database): ReturnType<Database['executor']> {
58
- {{#if tenancy.any}}
59
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
60
- {{/if}}
61
58
  return database.executor();
62
59
  }
@@ -61,9 +61,6 @@ export class KnexAccountRepository implements AccountRepository {
61
61
 
62
62
  /** A function and not a method: a query builder is thenable, and a method that answers one is read as asynchronous by whatever wraps the adapter (tracing), which then answers a promise. */
63
63
  function tableOf(database: KnexContext): Knex.QueryBuilder<AccountRow, AccountRow[]> {
64
- {{#if tenancy.any}}
65
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
66
- {{/if}}
67
64
  const table = database.executor()<AccountRow, AccountRow[]>('accounts');
68
65
 
69
66
  return table.withSchema({{context.constant}}_SCHEMA);
@@ -80,9 +80,6 @@ export class KnexDelegationRepository implements DelegationRepository {
80
80
 
81
81
  /** A function and not a method: a query builder is thenable, and a method that answers one is read as asynchronous by whatever wraps the adapter (tracing), which then answers a promise. */
82
82
  function tableOf(database: KnexContext): Knex.QueryBuilder<DelegationRow, DelegationRow[]> {
83
- {{#if tenancy.any}}
84
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
85
- {{/if}}
86
83
  const table = database.executor()<DelegationRow, DelegationRow[]>('delegations');
87
84
 
88
85
  return table.withSchema({{context.constant}}_SCHEMA);
@@ -67,9 +67,6 @@ export class KnexInvitationRepository implements InvitationRepository {
67
67
 
68
68
  /** A function and not a method: a query builder is thenable, and a method that answers one is read as asynchronous by whatever wraps the adapter (tracing), which then answers a promise. */
69
69
  function tableOf(database: KnexContext): Knex.QueryBuilder<InvitationRow, InvitationRow[]> {
70
- {{#if tenancy.any}}
71
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
72
- {{/if}}
73
70
  const table = database.executor()<InvitationRow, InvitationRow[]>('invitations');
74
71
 
75
72
  return table.withSchema({{context.constant}}_SCHEMA);
@@ -82,9 +82,6 @@ export class KnexMemberRepository implements MemberRepository {
82
82
 
83
83
  /** A function and not a method: a query builder is thenable, and a method that answers one is read as asynchronous by whatever wraps the adapter (tracing), which then answers a promise. */
84
84
  function tableOf(database: KnexContext): Knex.QueryBuilder<MemberRow, MemberRow[]> {
85
- {{#if tenancy.any}}
86
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
87
- {{/if}}
88
85
  const table = database.executor()<MemberRow, MemberRow[]>('members');
89
86
 
90
87
  return table.withSchema({{context.constant}}_SCHEMA);
@@ -21,9 +21,6 @@ export class KnexOrganisationTenantDirectory implements TenantDirectory {
21
21
 
22
22
  /** A function and not a method: a query builder is thenable, and a method that answers one is read as asynchronous by whatever wraps the adapter (tracing), which then answers a promise. */
23
23
  function tableOf(database: KnexContext): Knex.QueryBuilder<OrganisationRow, OrganisationRow[]> {
24
- {{#if tenancy.any}}
25
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
26
- {{/if}}
27
24
  const table = database.executor()<OrganisationRow, OrganisationRow[]>('organisations');
28
25
 
29
26
  return table.withSchema({{context.constant}}_SCHEMA);
@@ -61,9 +61,6 @@ export class KnexOrganisationRepository implements OrganisationRepository {
61
61
 
62
62
  /** A function and not a method: a query builder is thenable, and a method that answers one is read as asynchronous by whatever wraps the adapter (tracing), which then answers a promise. */
63
63
  function tableOf(database: KnexContext): Knex.QueryBuilder<OrganisationRow, OrganisationRow[]> {
64
- {{#if tenancy.any}}
65
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
66
- {{/if}}
67
64
  const table = database.executor()<OrganisationRow, OrganisationRow[]>('organisations');
68
65
 
69
66
  return table.withSchema({{context.constant}}_SCHEMA);
@@ -66,9 +66,6 @@ export class KnexSearchMembersReader implements SearchMembersReader {
66
66
 
67
67
  /** A function and not a method: a query builder is thenable, and a method that answers one is read as asynchronous by whatever wraps the adapter (tracing), which then answers a promise. */
68
68
  function membersOf(database: KnexContext): Knex.QueryBuilder<MemberLine, MemberLine[]> {
69
- {{#if tenancy.any}}
70
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
71
- {{/if}}
72
69
  const members = database.executor()<MemberLine, MemberLine[]>('members');
73
70
 
74
71
  return members.withSchema({{context.constant}}_SCHEMA);
@@ -56,8 +56,5 @@ export class PrismaAccountRepository implements AccountRepository {
56
56
 
57
57
  /** The accounts on the client of the unit of work, which every statement of this file goes through. */
58
58
  function accountsOf(database: Database): ReturnType<Database['client']>['{{context.camel}}Account'] {
59
- {{#if tenancy.any}}
60
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
61
- {{/if}}
62
59
  return database.client().{{context.camel}}Account;
63
60
  }
@@ -74,8 +74,5 @@ export class PrismaDelegationRepository implements DelegationRepository {
74
74
 
75
75
  /** The delegations on the client of the unit of work, which every statement of this file goes through. */
76
76
  function delegationsOf(database: Database): ReturnType<Database['client']>['{{context.camel}}Delegation'] {
77
- {{#if tenancy.any}}
78
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
79
- {{/if}}
80
77
  return database.client().{{context.camel}}Delegation;
81
78
  }
@@ -62,8 +62,5 @@ export class PrismaInvitationRepository implements InvitationRepository {
62
62
 
63
63
  /** The invitations on the client of the unit of work, which every statement of this file goes through. */
64
64
  function invitationsOf(database: Database): ReturnType<Database['client']>['{{context.camel}}Invitation'] {
65
- {{#if tenancy.any}}
66
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
67
- {{/if}}
68
65
  return database.client().{{context.camel}}Invitation;
69
66
  }
@@ -73,8 +73,5 @@ export class PrismaMemberRepository implements MemberRepository {
73
73
 
74
74
  /** The members on the client of the unit of work, which every statement of this file goes through. */
75
75
  function membersOf(database: Database): ReturnType<Database['client']>['{{context.camel}}Member'] {
76
- {{#if tenancy.any}}
77
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
78
- {{/if}}
79
76
  return database.client().{{context.camel}}Member;
80
77
  }
@@ -18,8 +18,5 @@ export class PrismaOrganisationTenantDirectory implements TenantDirectory {
18
18
 
19
19
  /** The organisations on the client of the unit of work, which every statement of this file goes through. */
20
20
  function organisationsOf(database: Database): ReturnType<Database['client']>['{{context.camel}}Organisation'] {
21
- {{#if tenancy.any}}
22
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
23
- {{/if}}
24
21
  return database.client().{{context.camel}}Organisation;
25
22
  }
@@ -56,8 +56,5 @@ export class PrismaOrganisationRepository implements OrganisationRepository {
56
56
 
57
57
  /** The organisations on the client of the unit of work, which every statement of this file goes through. */
58
58
  function organisationsOf(database: Database): ReturnType<Database['client']>['{{context.camel}}Organisation'] {
59
- {{#if tenancy.any}}
60
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
61
- {{/if}}
62
59
  return database.client().{{context.camel}}Organisation;
63
60
  }
@@ -75,8 +75,5 @@ function withProfiles(members: readonly MemberRow[], accounts: readonly AccountR
75
75
 
76
76
  /** The client of the unit of work, which every statement of this file goes through. */
77
77
  function clientOf(database: Database): ReturnType<Database['client']> {
78
- {{#if tenancy.any}}
79
- // ddd-ts-kit-disable-next-line tenancy/scoped-statement -- {{preset.adr}}: the {{context.kebab}} context is the control plane of the tenants, and its rows belong to none of them.
80
- {{/if}}
81
78
  return database.client();
82
79
  }
@@ -15,18 +15,21 @@ one the request runs in.
15
15
  ## Decision
16
16
 
17
17
  The tables of `{{context.kebab}}` (accounts, organisations, members, invitations, delegations)
18
- belong to no tenant: they hold no tenant column, and each statement of their adapters carries a
19
- suppression of `tenancy/scoped-statement` that names this record. What one organisation may read
20
- of another is decided per use case instead: every use case of an organisation authorizes the
21
- actor on the rights of their membership in it (the policies of
22
- `application/authorization/`), and every read names that organisation.
18
+ belong to no tenant: they hold no tenant column, and `ddd-ts-kit.config.json` declares the context
19
+ the control plane of the tenants (`contexts.{{context.kebab}}.tenancy` set to `control-plane`),
20
+ with the entry of `deviations` that names this record. The generators then confine none of its
21
+ repositories, and `tenancy/scoped-statement` does not judge its adapters. What one organisation
22
+ may read of another is decided per use case instead: every use case of an organisation authorizes
23
+ the actor on the rights of their membership in it (the policies of `application/authorization/`),
24
+ and every read names that organisation.
23
25
 
24
26
  ## Consequences
25
27
 
26
28
  - Easier: a person, their memberships and their invitations are one model, whatever the tenant
27
29
  of the request; the provider is told of every change, so that tokens name the organisations.
28
30
  - Harder: isolation between the organisations of this context rests on its policies and on the
29
- organisation each statement names, not on the storage. A new statement names its organisation.
31
+ organisation each statement names, not on the storage, and no rule of the kit reads its
32
+ statements for a tenant. A new statement names its organisation.
30
33
  - The integration events of an organisation carry it as their tenant, so that the consumers of the
31
34
  other contexts run in it.
32
35
 
@@ -48,7 +48,10 @@ own model, or the tuples of OpenFGA, from these facts.
48
48
 
49
49
  **Tenants.** Each organisation is a tenant: its slug is the tenant id, the integration events of
50
50
  an organisation carry it as their tenant, and the consumers of the other contexts run in it. The
51
- tables of this context belong to no tenant, since it decides who belongs to which ({{preset.adr}}).
51
+ tables of this context belong to no tenant, since it decides who belongs to which ({{preset.adr}}):
52
+ `ddd-ts-kit.config.json` declares it the control plane of the tenants
53
+ (`contexts.{{context.kebab}}.tenancy` set to `control-plane`), so its repositories are generated
54
+ unconfined and `tenancy/scoped-statement` does not judge its adapters.
52
55
  The token names the organisations of the person: with Keycloak, the `organization` claim, which
53
56
  `createAuthenticator` reads (`tenantClaim: 'organization'`). One organisation is the tenant of
54
57
  every request; several are the `tenants` of the actor, and a request names the one it works in
@@ -0,0 +1,4 @@
1
+ // The models and enums of the bounded context {{context.kebab}}, in its database schema "{{context.schema}}":
2
+ // no relation to another context. A column changes here with the mapper of the context, in one commit.
3
+ // ddd-ts-kit:models
4
+ // /ddd-ts-kit:models