ddd-ts-kit 0.27.0 → 0.83.1

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 (626) hide show
  1. package/CHANGELOG.md +232 -0
  2. package/README.fr.md +186 -72
  3. package/README.md +177 -71
  4. package/dist/check/canonical/role.d.ts +2 -0
  5. package/dist/check/canonical/role.d.ts.map +1 -1
  6. package/dist/check/canonical/roles.js +1 -1
  7. package/dist/check/canonical/roles.js.map +1 -1
  8. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  9. package/dist/check/catalogue/architecture-rules.js +6 -0
  10. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  11. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  12. package/dist/check/catalogue/default-severities.js +2 -0
  13. package/dist/check/catalogue/default-severities.js.map +1 -1
  14. package/dist/check/catalogue/eslint-only-rules.js +3 -3
  15. package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
  16. package/dist/check/commands/check-command.d.ts.map +1 -1
  17. package/dist/check/commands/check-command.js +4 -1
  18. package/dist/check/commands/check-command.js.map +1 -1
  19. package/dist/check/commands/explain-command.d.ts.map +1 -1
  20. package/dist/check/commands/explain-command.js +2 -9
  21. package/dist/check/commands/explain-command.js.map +1 -1
  22. package/dist/check/engine/format-check.d.ts +6 -1
  23. package/dist/check/engine/format-check.d.ts.map +1 -1
  24. package/dist/check/engine/format-check.js +33 -11
  25. package/dist/check/engine/format-check.js.map +1 -1
  26. package/dist/check/errors/builds-through-factories.d.ts +4 -1
  27. package/dist/check/errors/builds-through-factories.d.ts.map +1 -1
  28. package/dist/check/errors/builds-through-factories.js +6 -2
  29. package/dist/check/errors/builds-through-factories.js.map +1 -1
  30. package/dist/check/errors/code-entry.d.ts +8 -0
  31. package/dist/check/errors/code-entry.d.ts.map +1 -0
  32. package/dist/check/errors/code-entry.js +2 -0
  33. package/dist/check/errors/code-entry.js.map +1 -0
  34. package/dist/check/errors/code-list-name.d.ts +3 -0
  35. package/dist/check/errors/code-list-name.d.ts.map +1 -0
  36. package/dist/check/errors/code-list-name.js +6 -0
  37. package/dist/check/errors/code-list-name.js.map +1 -0
  38. package/dist/check/errors/code-list.d.ts +10 -0
  39. package/dist/check/errors/code-list.d.ts.map +1 -0
  40. package/dist/check/errors/code-list.js +2 -0
  41. package/dist/check/errors/code-list.js.map +1 -0
  42. package/dist/check/errors/codes-set-in.d.ts +9 -0
  43. package/dist/check/errors/codes-set-in.d.ts.map +1 -0
  44. package/dist/check/errors/codes-set-in.js +15 -0
  45. package/dist/check/errors/codes-set-in.js.map +1 -0
  46. package/dist/check/errors/error-codes.d.ts +2 -0
  47. package/dist/check/errors/error-codes.d.ts.map +1 -1
  48. package/dist/check/errors/error-codes.js +8 -0
  49. package/dist/check/errors/error-codes.js.map +1 -1
  50. package/dist/check/errors/is-codes-file.d.ts +4 -0
  51. package/dist/check/errors/is-codes-file.d.ts.map +1 -0
  52. package/dist/check/errors/is-codes-file.js +11 -0
  53. package/dist/check/errors/is-codes-file.js.map +1 -0
  54. package/dist/check/errors/is-error-file.d.ts +4 -0
  55. package/dist/check/errors/is-error-file.d.ts.map +1 -0
  56. package/dist/check/errors/is-error-file.js +6 -0
  57. package/dist/check/errors/is-error-file.js.map +1 -0
  58. package/dist/check/errors/listed-codes.d.ts +5 -0
  59. package/dist/check/errors/listed-codes.d.ts.map +1 -0
  60. package/dist/check/errors/listed-codes.js +12 -0
  61. package/dist/check/errors/listed-codes.js.map +1 -0
  62. package/dist/check/errors/names-refusals.d.ts +4 -0
  63. package/dist/check/errors/names-refusals.d.ts.map +1 -0
  64. package/dist/check/errors/names-refusals.js +5 -0
  65. package/dist/check/errors/names-refusals.js.map +1 -0
  66. package/dist/check/errors/read-code-list.d.ts +5 -0
  67. package/dist/check/errors/read-code-list.d.ts.map +1 -0
  68. package/dist/check/errors/read-code-list.js +32 -0
  69. package/dist/check/errors/read-code-list.js.map +1 -0
  70. package/dist/check/errors/refusal-classes.d.ts +8 -0
  71. package/dist/check/errors/refusal-classes.d.ts.map +1 -0
  72. package/dist/check/errors/refusal-classes.js +9 -0
  73. package/dist/check/errors/refusal-classes.js.map +1 -0
  74. package/dist/check/event-sourcing/declared-shape.d.ts +7 -1
  75. package/dist/check/event-sourcing/declared-shape.d.ts.map +1 -1
  76. package/dist/check/event-sourcing/declared-shape.js +12 -4
  77. package/dist/check/event-sourcing/declared-shape.js.map +1 -1
  78. package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
  79. package/dist/check/event-sourcing/read-stored-shape.js +10 -2
  80. package/dist/check/event-sourcing/read-stored-shape.js.map +1 -1
  81. package/dist/check/event-sourcing/stored-event-declaration.d.ts +2 -0
  82. package/dist/check/event-sourcing/stored-event-declaration.d.ts.map +1 -1
  83. package/dist/check/event-sourcing/stored-event-declarations.js +1 -0
  84. package/dist/check/event-sourcing/stored-event-declarations.js.map +1 -1
  85. package/dist/check/event-sourcing/stored-shape.d.ts +2 -0
  86. package/dist/check/event-sourcing/stored-shape.d.ts.map +1 -1
  87. package/dist/check/explain/documented-rule.d.ts +8 -0
  88. package/dist/check/explain/documented-rule.d.ts.map +1 -0
  89. package/dist/check/explain/documented-rule.js +14 -0
  90. package/dist/check/explain/documented-rule.js.map +1 -0
  91. package/dist/check/explain/errors-docs.d.ts.map +1 -1
  92. package/dist/check/explain/errors-docs.js +30 -2
  93. package/dist/check/explain/errors-docs.js.map +1 -1
  94. package/dist/check/explain/explanations-of.d.ts +5 -0
  95. package/dist/check/explain/explanations-of.d.ts.map +1 -0
  96. package/dist/check/explain/explanations-of.js +16 -0
  97. package/dist/check/explain/explanations-of.js.map +1 -0
  98. package/dist/check/explain/language-docs.js +1 -1
  99. package/dist/check/explain/language-docs.js.map +1 -1
  100. package/dist/check/explain/persistence-docs.d.ts.map +1 -1
  101. package/dist/check/explain/persistence-docs.js +7 -0
  102. package/dist/check/explain/persistence-docs.js.map +1 -1
  103. package/dist/check/explain/wiring-docs.d.ts.map +1 -1
  104. package/dist/check/explain/wiring-docs.js +13 -0
  105. package/dist/check/explain/wiring-docs.js.map +1 -1
  106. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
  107. package/dist/check/fixtures/authz-policy-fixtures.js +11 -0
  108. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
  109. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  110. package/dist/check/fixtures/declarations-fixtures.js +78 -1
  111. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  112. package/dist/check/fixtures/errors-fixtures.d.ts.map +1 -1
  113. package/dist/check/fixtures/errors-fixtures.js +1 -1
  114. package/dist/check/fixtures/errors-fixtures.js.map +1 -1
  115. package/dist/check/fixtures/errors-route.d.ts +3 -0
  116. package/dist/check/fixtures/errors-route.d.ts.map +1 -0
  117. package/dist/check/fixtures/errors-route.js +6 -0
  118. package/dist/check/fixtures/errors-route.js.map +1 -0
  119. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  120. package/dist/check/fixtures/fixtures.js +2 -0
  121. package/dist/check/fixtures/fixtures.js.map +1 -1
  122. package/dist/check/fixtures/named-refusal-fixtures.d.ts +4 -0
  123. package/dist/check/fixtures/named-refusal-fixtures.d.ts.map +1 -0
  124. package/dist/check/fixtures/named-refusal-fixtures.js +210 -0
  125. package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -0
  126. package/dist/check/fixtures/persistence-fixtures.d.ts.map +1 -1
  127. package/dist/check/fixtures/persistence-fixtures.js +25 -0
  128. package/dist/check/fixtures/persistence-fixtures.js.map +1 -1
  129. package/dist/check/language/refusal-qualifiers.d.ts +8 -0
  130. package/dist/check/language/refusal-qualifiers.d.ts.map +1 -0
  131. package/dist/check/language/refusal-qualifiers.js +16 -0
  132. package/dist/check/language/refusal-qualifiers.js.map +1 -0
  133. package/dist/check/language/unknown-words.d.ts +2 -2
  134. package/dist/check/language/unknown-words.d.ts.map +1 -1
  135. package/dist/check/language/unknown-words.js +3 -2
  136. package/dist/check/language/unknown-words.js.map +1 -1
  137. package/dist/check/model/rule-explanation.d.ts +10 -0
  138. package/dist/check/model/rule-explanation.d.ts.map +1 -0
  139. package/dist/check/model/rule-explanation.js +2 -0
  140. package/dist/check/model/rule-explanation.js.map +1 -0
  141. package/dist/check/rules/authz-policy-asked.js +5 -2
  142. package/dist/check/rules/authz-policy-asked.js.map +1 -1
  143. package/dist/check/rules/declarations-port-adapter-wired.d.ts +3 -0
  144. package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -0
  145. package/dist/check/rules/declarations-port-adapter-wired.js +104 -0
  146. package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -0
  147. package/dist/check/rules/errors-code-listed.d.ts +3 -0
  148. package/dist/check/rules/errors-code-listed.d.ts.map +1 -0
  149. package/dist/check/rules/errors-code-listed.js +160 -0
  150. package/dist/check/rules/errors-code-listed.js.map +1 -0
  151. package/dist/check/rules/errors-code-unique.d.ts.map +1 -1
  152. package/dist/check/rules/errors-code-unique.js +13 -8
  153. package/dist/check/rules/errors-code-unique.js.map +1 -1
  154. package/dist/check/rules/errors-known-code.d.ts.map +1 -1
  155. package/dist/check/rules/errors-known-code.js +17 -7
  156. package/dist/check/rules/errors-known-code.js.map +1 -1
  157. package/dist/check/rules/event-sourcing-upcaster-required.js +14 -4
  158. package/dist/check/rules/event-sourcing-upcaster-required.js.map +1 -1
  159. package/dist/check/rules/language-glossary-term.d.ts.map +1 -1
  160. package/dist/check/rules/language-glossary-term.js +10 -3
  161. package/dist/check/rules/language-glossary-term.js.map +1 -1
  162. package/dist/check/rules/naming-suffix.js +1 -1
  163. package/dist/check/rules/naming-suffix.js.map +1 -1
  164. package/dist/check/rules/persistence-primary-key-order.d.ts +3 -0
  165. package/dist/check/rules/persistence-primary-key-order.d.ts.map +1 -0
  166. package/dist/check/rules/persistence-primary-key-order.js +31 -0
  167. package/dist/check/rules/persistence-primary-key-order.js.map +1 -0
  168. package/dist/commands/docs.d.ts.map +1 -1
  169. package/dist/commands/docs.js +16 -7
  170. package/dist/commands/docs.js.map +1 -1
  171. package/dist/commands/doctor.d.ts +4 -1
  172. package/dist/commands/doctor.d.ts.map +1 -1
  173. package/dist/commands/doctor.js +20 -4
  174. package/dist/commands/doctor.js.map +1 -1
  175. package/dist/commands/error-factories.d.ts +4 -2
  176. package/dist/commands/error-factories.d.ts.map +1 -1
  177. package/dist/commands/error-factories.js +74 -17
  178. package/dist/commands/error-factories.js.map +1 -1
  179. package/dist/commands/lint.d.ts +7 -0
  180. package/dist/commands/lint.d.ts.map +1 -0
  181. package/dist/commands/lint.js +55 -0
  182. package/dist/commands/lint.js.map +1 -0
  183. package/dist/config/config.d.ts +2 -0
  184. package/dist/config/config.d.ts.map +1 -1
  185. package/dist/config/open-api-problems.js +7 -6
  186. package/dist/config/open-api-problems.js.map +1 -1
  187. package/dist/config/parse-config.d.ts.map +1 -1
  188. package/dist/config/parse-config.js +2 -0
  189. package/dist/config/parse-config.js.map +1 -1
  190. package/dist/config/restack-config-text.d.ts +3 -2
  191. package/dist/config/restack-config-text.d.ts.map +1 -1
  192. package/dist/config/restack-config-text.js +5 -3
  193. package/dist/config/restack-config-text.js.map +1 -1
  194. package/dist/config/serialize-config.d.ts.map +1 -1
  195. package/dist/config/serialize-config.js +2 -1
  196. package/dist/config/serialize-config.js.map +1 -1
  197. package/dist/config/stack.d.ts +9 -6
  198. package/dist/config/stack.d.ts.map +1 -1
  199. package/dist/config/stack.js +1 -1
  200. package/dist/config/stack.js.map +1 -1
  201. package/dist/describe/context-description.d.ts +7 -2
  202. package/dist/describe/context-description.d.ts.map +1 -1
  203. package/dist/describe/exposed-by.d.ts +7 -0
  204. package/dist/describe/exposed-by.d.ts.map +1 -0
  205. package/dist/describe/exposed-by.js +11 -0
  206. package/dist/describe/exposed-by.js.map +1 -0
  207. package/dist/describe/read-errors.d.ts +3 -1
  208. package/dist/describe/read-errors.d.ts.map +1 -1
  209. package/dist/describe/read-errors.js +18 -11
  210. package/dist/describe/read-errors.js.map +1 -1
  211. package/dist/describe/read-refusals.d.ts +11 -0
  212. package/dist/describe/read-refusals.d.ts.map +1 -0
  213. package/dist/describe/read-refusals.js +41 -0
  214. package/dist/describe/read-refusals.js.map +1 -0
  215. package/dist/describe/reference-lines.d.ts.map +1 -1
  216. package/dist/describe/reference-lines.js +18 -2
  217. package/dist/describe/reference-lines.js.map +1 -1
  218. package/dist/docs/formerly-recorded-stored-events.d.ts +9 -0
  219. package/dist/docs/formerly-recorded-stored-events.d.ts.map +1 -0
  220. package/dist/docs/formerly-recorded-stored-events.js +17 -0
  221. package/dist/docs/formerly-recorded-stored-events.js.map +1 -0
  222. package/dist/docs/write-stored-events-lock.d.ts +3 -2
  223. package/dist/docs/write-stored-events-lock.d.ts.map +1 -1
  224. package/dist/docs/write-stored-events-lock.js +10 -4
  225. package/dist/docs/write-stored-events-lock.js.map +1 -1
  226. package/dist/doctor/diagnose.d.ts +2 -0
  227. package/dist/doctor/diagnose.d.ts.map +1 -1
  228. package/dist/doctor/diagnose.js +22 -3
  229. package/dist/doctor/diagnose.js.map +1 -1
  230. package/dist/doctor/doctor-finding.d.ts +13 -5
  231. package/dist/doctor/doctor-finding.d.ts.map +1 -1
  232. package/dist/doctor/format-diagnosis.d.ts +4 -1
  233. package/dist/doctor/format-diagnosis.d.ts.map +1 -1
  234. package/dist/doctor/format-diagnosis.js +49 -3
  235. package/dist/doctor/format-diagnosis.js.map +1 -1
  236. package/dist/doctor/in-range.d.ts +7 -0
  237. package/dist/doctor/in-range.d.ts.map +1 -0
  238. package/dist/doctor/in-range.js +90 -0
  239. package/dist/doctor/in-range.js.map +1 -0
  240. package/dist/doctor/install-findings.d.ts +11 -0
  241. package/dist/doctor/install-findings.d.ts.map +1 -0
  242. package/dist/doctor/install-findings.js +119 -0
  243. package/dist/doctor/install-findings.js.map +1 -0
  244. package/dist/doctor/node-findings.d.ts +7 -0
  245. package/dist/doctor/node-findings.d.ts.map +1 -0
  246. package/dist/doctor/node-findings.js +19 -0
  247. package/dist/doctor/node-findings.js.map +1 -0
  248. package/dist/doctor/package-findings.d.ts +2 -0
  249. package/dist/doctor/package-findings.d.ts.map +1 -1
  250. package/dist/doctor/package-findings.js +1 -1
  251. package/dist/doctor/package-findings.js.map +1 -1
  252. package/dist/doctor/submodule-findings.d.ts +7 -0
  253. package/dist/doctor/submodule-findings.d.ts.map +1 -0
  254. package/dist/doctor/submodule-findings.js +22 -0
  255. package/dist/doctor/submodule-findings.js.map +1 -0
  256. package/dist/generate/concept.d.ts.map +1 -1
  257. package/dist/generate/concept.js +3 -29
  258. package/dist/generate/concept.js.map +1 -1
  259. package/dist/generate/errors/add-code.d.ts +13 -0
  260. package/dist/generate/errors/add-code.d.ts.map +1 -0
  261. package/dist/generate/errors/add-code.js +18 -0
  262. package/dist/generate/errors/add-code.js.map +1 -0
  263. package/dist/generate/errors/codes-list.d.ts +10 -0
  264. package/dist/generate/errors/codes-list.d.ts.map +1 -0
  265. package/dist/generate/errors/codes-list.js +25 -0
  266. package/dist/generate/errors/codes-list.js.map +1 -0
  267. package/dist/generate/errors/error-code-pattern.d.ts +3 -0
  268. package/dist/generate/errors/error-code-pattern.d.ts.map +1 -0
  269. package/dist/generate/errors/error-code-pattern.js +3 -0
  270. package/dist/generate/errors/error-code-pattern.js.map +1 -0
  271. package/dist/generate/errors/factory-prefix.d.ts +3 -0
  272. package/dist/generate/errors/factory-prefix.d.ts.map +1 -0
  273. package/dist/generate/errors/factory-prefix.js +3 -0
  274. package/dist/generate/errors/factory-prefix.js.map +1 -0
  275. package/dist/generate/errors/named-refusal-code.d.ts +17 -0
  276. package/dist/generate/errors/named-refusal-code.d.ts.map +1 -0
  277. package/dist/generate/errors/named-refusal-code.js +42 -0
  278. package/dist/generate/errors/named-refusal-code.js.map +1 -0
  279. package/dist/generate/errors/refusal-class-name.d.ts +8 -0
  280. package/dist/generate/errors/refusal-class-name.d.ts.map +1 -0
  281. package/dist/generate/errors/refusal-class-name.js +16 -0
  282. package/dist/generate/errors/refusal-class-name.js.map +1 -0
  283. package/dist/generate/errors/refusal-factory-name.d.ts +4 -0
  284. package/dist/generate/errors/refusal-factory-name.d.ts.map +1 -0
  285. package/dist/generate/errors/refusal-factory-name.js +15 -0
  286. package/dist/generate/errors/refusal-factory-name.js.map +1 -0
  287. package/dist/generate/errors/write-named-refusal.d.ts +18 -0
  288. package/dist/generate/errors/write-named-refusal.d.ts.map +1 -0
  289. package/dist/generate/errors/write-named-refusal.js +89 -0
  290. package/dist/generate/errors/write-named-refusal.js.map +1 -0
  291. package/dist/generate/kinds/domain-error-kind.d.ts.map +1 -1
  292. package/dist/generate/kinds/domain-error-kind.js +12 -5
  293. package/dist/generate/kinds/domain-error-kind.js.map +1 -1
  294. package/dist/generate/kinds/error-kind.d.ts.map +1 -1
  295. package/dist/generate/kinds/error-kind.js +27 -12
  296. package/dist/generate/kinds/error-kind.js.map +1 -1
  297. package/dist/generate/schedule/cron-problem.d.ts.map +1 -1
  298. package/dist/generate/schedule/cron-problem.js +16 -1
  299. package/dist/generate/schedule/cron-problem.js.map +1 -1
  300. package/dist/generate/spoken-in-language.d.ts +9 -0
  301. package/dist/generate/spoken-in-language.d.ts.map +1 -0
  302. package/dist/generate/spoken-in-language.js +39 -0
  303. package/dist/generate/spoken-in-language.js.map +1 -0
  304. package/dist/help/notes.d.ts +1 -1
  305. package/dist/help/notes.d.ts.map +1 -1
  306. package/dist/help/notes.js +32 -13
  307. package/dist/help/notes.js.map +1 -1
  308. package/dist/help/usage.d.ts +1 -1
  309. package/dist/help/usage.d.ts.map +1 -1
  310. package/dist/help/usage.js +4 -3
  311. package/dist/help/usage.js.map +1 -1
  312. package/dist/init/manifest/versions.js +24 -24
  313. package/dist/init/run-init.d.ts.map +1 -1
  314. package/dist/init/run-init.js +4 -2
  315. package/dist/init/run-init.js.map +1 -1
  316. package/dist/init/stack/resolve-stack.js +2 -2
  317. package/dist/init/stack/resolve-stack.js.map +1 -1
  318. package/dist/lint/eslint-in-project.d.ts +8 -0
  319. package/dist/lint/eslint-in-project.d.ts.map +1 -0
  320. package/dist/lint/eslint-in-project.js +33 -0
  321. package/dist/lint/eslint-in-project.js.map +1 -0
  322. package/dist/lint/format-verdict.d.ts +4 -0
  323. package/dist/lint/format-verdict.d.ts.map +1 -0
  324. package/dist/lint/format-verdict.js +11 -0
  325. package/dist/lint/format-verdict.js.map +1 -0
  326. package/dist/lint/lint-run.d.ts +8 -0
  327. package/dist/lint/lint-run.d.ts.map +1 -0
  328. package/dist/lint/lint-run.js +2 -0
  329. package/dist/lint/lint-run.js.map +1 -0
  330. package/dist/lint/lint-verdict.d.ts +19 -0
  331. package/dist/lint/lint-verdict.d.ts.map +1 -0
  332. package/dist/lint/lint-verdict.js +25 -0
  333. package/dist/lint/lint-verdict.js.map +1 -0
  334. package/dist/lint/parse-lint-answer.d.ts +13 -0
  335. package/dist/lint/parse-lint-answer.d.ts.map +1 -0
  336. package/dist/lint/parse-lint-answer.js +18 -0
  337. package/dist/lint/parse-lint-answer.js.map +1 -0
  338. package/dist/migration/plan-replay.d.ts +4 -3
  339. package/dist/migration/plan-replay.d.ts.map +1 -1
  340. package/dist/migration/plan-replay.js +21 -6
  341. package/dist/migration/plan-replay.js.map +1 -1
  342. package/dist/migration/rename-branch-migrations.d.ts +13 -0
  343. package/dist/migration/rename-branch-migrations.d.ts.map +1 -0
  344. package/dist/migration/rename-branch-migrations.js +25 -0
  345. package/dist/migration/rename-branch-migrations.js.map +1 -0
  346. package/dist/migration/replay-drizzle-migrations.d.ts +6 -3
  347. package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
  348. package/dist/migration/replay-drizzle-migrations.js +48 -4
  349. package/dist/migration/replay-drizzle-migrations.js.map +1 -1
  350. package/dist/migration/replay-plan.d.ts +8 -0
  351. package/dist/migration/replay-plan.d.ts.map +1 -1
  352. package/dist/migration/restore-migration-folder.d.ts +4 -0
  353. package/dist/migration/restore-migration-folder.d.ts.map +1 -0
  354. package/dist/migration/restore-migration-folder.js +15 -0
  355. package/dist/migration/restore-migration-folder.js.map +1 -0
  356. package/dist/package-manager/lockfiles.d.ts +2 -0
  357. package/dist/package-manager/lockfiles.d.ts.map +1 -1
  358. package/dist/package-manager/lockfiles.js +5 -0
  359. package/dist/package-manager/lockfiles.js.map +1 -1
  360. package/dist/presets/identity-refusal.js +1 -1
  361. package/dist/presets/identity-refusal.js.map +1 -1
  362. package/dist/presets/identity-terms.d.ts.map +1 -1
  363. package/dist/presets/identity-terms.js +30 -0
  364. package/dist/presets/identity-terms.js.map +1 -1
  365. package/dist/presets/preset-files.d.ts.map +1 -1
  366. package/dist/presets/preset-files.js +4 -1
  367. package/dist/presets/preset-files.js.map +1 -1
  368. package/dist/refusals/aggregates-of.d.ts +10 -0
  369. package/dist/refusals/aggregates-of.d.ts.map +1 -0
  370. package/dist/refusals/aggregates-of.js +9 -0
  371. package/dist/refusals/aggregates-of.js.map +1 -0
  372. package/dist/refusals/applied-moves.d.ts +7 -0
  373. package/dist/refusals/applied-moves.d.ts.map +1 -0
  374. package/dist/refusals/applied-moves.js +2 -0
  375. package/dist/refusals/applied-moves.js.map +1 -0
  376. package/dist/refusals/apply-named-plan.d.ts +19 -0
  377. package/dist/refusals/apply-named-plan.d.ts.map +1 -0
  378. package/dist/refusals/apply-named-plan.js +46 -0
  379. package/dist/refusals/apply-named-plan.js.map +1 -0
  380. package/dist/refusals/apply-plan.d.ts.map +1 -1
  381. package/dist/refusals/apply-plan.js +21 -25
  382. package/dist/refusals/apply-plan.js.map +1 -1
  383. package/dist/refusals/code-without-imports.d.ts +3 -0
  384. package/dist/refusals/code-without-imports.d.ts.map +1 -0
  385. package/dist/refusals/code-without-imports.js +9 -0
  386. package/dist/refusals/code-without-imports.js.map +1 -0
  387. package/dist/refusals/concept-error-class.d.ts +26 -0
  388. package/dist/refusals/concept-error-class.d.ts.map +1 -0
  389. package/dist/refusals/concept-error-class.js +2 -0
  390. package/dist/refusals/concept-error-class.js.map +1 -0
  391. package/dist/refusals/concept-errors.d.ts +6 -0
  392. package/dist/refusals/concept-errors.d.ts.map +1 -0
  393. package/dist/refusals/concept-errors.js +16 -0
  394. package/dist/refusals/concept-errors.js.map +1 -0
  395. package/dist/refusals/concept-imports.d.ts +8 -0
  396. package/dist/refusals/concept-imports.d.ts.map +1 -0
  397. package/dist/refusals/concept-imports.js +33 -0
  398. package/dist/refusals/concept-imports.js.map +1 -0
  399. package/dist/refusals/concept-leftovers.d.ts +5 -0
  400. package/dist/refusals/concept-leftovers.d.ts.map +1 -0
  401. package/dist/refusals/concept-leftovers.js +26 -0
  402. package/dist/refusals/concept-leftovers.js.map +1 -0
  403. package/dist/refusals/concept-named.d.ts +3 -0
  404. package/dist/refusals/concept-named.d.ts.map +1 -0
  405. package/dist/refusals/concept-named.js +13 -0
  406. package/dist/refusals/concept-named.js.map +1 -0
  407. package/dist/refusals/concerns.d.ts +16 -0
  408. package/dist/refusals/concerns.d.ts.map +1 -0
  409. package/dist/refusals/concerns.js +9 -0
  410. package/dist/refusals/concerns.js.map +1 -0
  411. package/dist/refusals/cut-factories.d.ts +7 -0
  412. package/dist/refusals/cut-factories.d.ts.map +1 -0
  413. package/dist/refusals/cut-factories.js +30 -0
  414. package/dist/refusals/cut-factories.js.map +1 -0
  415. package/dist/refusals/earlier-guidance.d.ts +8 -0
  416. package/dist/refusals/earlier-guidance.d.ts.map +1 -0
  417. package/dist/refusals/earlier-guidance.js +21 -0
  418. package/dist/refusals/earlier-guidance.js.map +1 -0
  419. package/dist/refusals/factory-for-parameter.d.ts +7 -0
  420. package/dist/refusals/factory-for-parameter.d.ts.map +1 -0
  421. package/dist/refusals/factory-for-parameter.js +17 -0
  422. package/dist/refusals/factory-for-parameter.js.map +1 -0
  423. package/dist/refusals/first-parameter.d.ts +6 -0
  424. package/dist/refusals/first-parameter.d.ts.map +1 -0
  425. package/dist/refusals/first-parameter.js +12 -0
  426. package/dist/refusals/first-parameter.js.map +1 -0
  427. package/dist/refusals/ignore-code-types.d.ts +10 -0
  428. package/dist/refusals/ignore-code-types.d.ts.map +1 -0
  429. package/dist/refusals/ignore-code-types.js +53 -0
  430. package/dist/refusals/ignore-code-types.js.map +1 -0
  431. package/dist/refusals/imports-used-by.d.ts +6 -0
  432. package/dist/refusals/imports-used-by.d.ts.map +1 -0
  433. package/dist/refusals/imports-used-by.js +32 -0
  434. package/dist/refusals/imports-used-by.js.map +1 -0
  435. package/dist/refusals/leave-origins.d.ts +10 -0
  436. package/dist/refusals/leave-origins.d.ts.map +1 -0
  437. package/dist/refusals/leave-origins.js +35 -0
  438. package/dist/refusals/leave-origins.js.map +1 -0
  439. package/dist/refusals/legacy-move.d.ts +5 -0
  440. package/dist/refusals/legacy-move.d.ts.map +1 -0
  441. package/dist/refusals/legacy-move.js +14 -0
  442. package/dist/refusals/legacy-move.js.map +1 -0
  443. package/dist/refusals/markdown-files.d.ts +4 -0
  444. package/dist/refusals/markdown-files.d.ts.map +1 -0
  445. package/dist/refusals/markdown-files.js +13 -0
  446. package/dist/refusals/markdown-files.js.map +1 -0
  447. package/dist/refusals/member-start.d.ts +3 -0
  448. package/dist/refusals/member-start.d.ts.map +1 -0
  449. package/dist/refusals/member-start.js +14 -0
  450. package/dist/refusals/member-start.js.map +1 -0
  451. package/dist/refusals/migration-targets.d.ts +3 -0
  452. package/dist/refusals/migration-targets.d.ts.map +1 -0
  453. package/dist/refusals/migration-targets.js +3 -0
  454. package/dist/refusals/migration-targets.js.map +1 -0
  455. package/dist/refusals/move-named-specs.d.ts +16 -0
  456. package/dist/refusals/move-named-specs.d.ts.map +1 -0
  457. package/dist/refusals/move-named-specs.js +119 -0
  458. package/dist/refusals/move-named-specs.js.map +1 -0
  459. package/dist/refusals/move.d.ts +6 -1
  460. package/dist/refusals/move.d.ts.map +1 -1
  461. package/dist/refusals/named-move.d.ts +23 -0
  462. package/dist/refusals/named-move.d.ts.map +1 -0
  463. package/dist/refusals/named-move.js +2 -0
  464. package/dist/refusals/named-move.js.map +1 -0
  465. package/dist/refusals/named-moves.d.ts +10 -0
  466. package/dist/refusals/named-moves.d.ts.map +1 -0
  467. package/dist/refusals/named-moves.js +64 -0
  468. package/dist/refusals/named-moves.js.map +1 -0
  469. package/dist/refusals/named-plan.d.ts +7 -0
  470. package/dist/refusals/named-plan.d.ts.map +1 -0
  471. package/dist/refusals/named-plan.js +2 -0
  472. package/dist/refusals/named-plan.js.map +1 -0
  473. package/dist/refusals/own-factory.d.ts +14 -0
  474. package/dist/refusals/own-factory.d.ts.map +1 -0
  475. package/dist/refusals/own-factory.js +38 -0
  476. package/dist/refusals/own-factory.js.map +1 -0
  477. package/dist/refusals/plan-target.d.ts +7 -0
  478. package/dist/refusals/plan-target.d.ts.map +1 -0
  479. package/dist/refusals/plan-target.js +13 -0
  480. package/dist/refusals/plan-target.js.map +1 -0
  481. package/dist/refusals/planned-refusal.d.ts +13 -0
  482. package/dist/refusals/planned-refusal.d.ts.map +1 -0
  483. package/dist/refusals/planned-refusal.js +2 -0
  484. package/dist/refusals/planned-refusal.js.map +1 -0
  485. package/dist/refusals/propose-named-plan.d.ts +25 -0
  486. package/dist/refusals/propose-named-plan.d.ts.map +1 -0
  487. package/dist/refusals/propose-named-plan.js +67 -0
  488. package/dist/refusals/propose-named-plan.js.map +1 -0
  489. package/dist/refusals/propose-plan.d.ts.map +1 -1
  490. package/dist/refusals/propose-plan.js +3 -19
  491. package/dist/refusals/propose-plan.js.map +1 -1
  492. package/dist/refusals/read-concept-error.d.ts +9 -0
  493. package/dist/refusals/read-concept-error.d.ts.map +1 -0
  494. package/dist/refusals/read-concept-error.js +51 -0
  495. package/dist/refusals/read-concept-error.js.map +1 -0
  496. package/dist/refusals/read-named-plan.d.ts +4 -0
  497. package/dist/refusals/read-named-plan.d.ts.map +1 -0
  498. package/dist/refusals/read-named-plan.js +57 -0
  499. package/dist/refusals/read-named-plan.js.map +1 -0
  500. package/dist/refusals/refusal-class-file.d.ts +15 -0
  501. package/dist/refusals/refusal-class-file.d.ts.map +1 -0
  502. package/dist/refusals/refusal-class-file.js +38 -0
  503. package/dist/refusals/refusal-class-file.js.map +1 -0
  504. package/dist/refusals/rename-concept.d.ts +7 -0
  505. package/dist/refusals/rename-concept.d.ts.map +1 -0
  506. package/dist/refusals/rename-concept.js +15 -0
  507. package/dist/refusals/rename-concept.js.map +1 -0
  508. package/dist/refusals/render-factory.d.ts +1 -1
  509. package/dist/refusals/render-factory.d.ts.map +1 -1
  510. package/dist/refusals/render-factory.js +3 -2
  511. package/dist/refusals/render-factory.js.map +1 -1
  512. package/dist/refusals/rewrite-concept-usages.d.ts +11 -0
  513. package/dist/refusals/rewrite-concept-usages.d.ts.map +1 -0
  514. package/dist/refusals/rewrite-concept-usages.js +61 -0
  515. package/dist/refusals/rewrite-concept-usages.js.map +1 -0
  516. package/dist/refusals/rewrite-named-usages.d.ts +9 -0
  517. package/dist/refusals/rewrite-named-usages.d.ts.map +1 -0
  518. package/dist/refusals/rewrite-named-usages.js +14 -0
  519. package/dist/refusals/rewrite-named-usages.js.map +1 -0
  520. package/dist/refusals/rewrite-usages.d.ts.map +1 -1
  521. package/dist/refusals/rewrite-usages.js +10 -6
  522. package/dist/refusals/rewrite-usages.js.map +1 -1
  523. package/dist/refusals/say-refusals.d.ts +3 -0
  524. package/dist/refusals/say-refusals.d.ts.map +1 -0
  525. package/dist/refusals/say-refusals.js +8 -0
  526. package/dist/refusals/say-refusals.js.map +1 -0
  527. package/dist/refusals/split-concept-spec.d.ts +19 -0
  528. package/dist/refusals/split-concept-spec.d.ts.map +1 -0
  529. package/dist/refusals/split-concept-spec.js +74 -0
  530. package/dist/refusals/split-concept-spec.js.map +1 -0
  531. package/dist/refusals/stale-mentions.d.ts +10 -0
  532. package/dist/refusals/stale-mentions.d.ts.map +1 -0
  533. package/dist/refusals/stale-mentions.js +41 -0
  534. package/dist/refusals/stale-mentions.js.map +1 -0
  535. package/dist/refusals/undefined-words.d.ts +15 -0
  536. package/dist/refusals/undefined-words.d.ts.map +1 -0
  537. package/dist/refusals/undefined-words.js +26 -0
  538. package/dist/refusals/undefined-words.js.map +1 -0
  539. package/dist/refusals/with-codes.d.ts +11 -0
  540. package/dist/refusals/with-codes.d.ts.map +1 -0
  541. package/dist/refusals/with-codes.js +46 -0
  542. package/dist/refusals/with-codes.js.map +1 -0
  543. package/dist/refusals/with-imports.d.ts +3 -0
  544. package/dist/refusals/with-imports.d.ts.map +1 -0
  545. package/dist/refusals/with-imports.js +8 -0
  546. package/dist/refusals/with-imports.js.map +1 -0
  547. package/dist/refusals/write-refusal-classes.d.ts +9 -0
  548. package/dist/refusals/write-refusal-classes.d.ts.map +1 -0
  549. package/dist/refusals/write-refusal-classes.js +23 -0
  550. package/dist/refusals/write-refusal-classes.js.map +1 -0
  551. package/dist/run.d.ts.map +1 -1
  552. package/dist/run.js +2 -0
  553. package/dist/run.js.map +1 -1
  554. package/dist/stack/stack-vars.js +1 -1
  555. package/dist/stack/stack-vars.js.map +1 -1
  556. package/dist/version.d.ts +1 -1
  557. package/dist/version.js +1 -1
  558. package/package.json +2 -2
  559. package/templates/aggregate/aggregate.ts.tpl +3 -0
  560. package/templates/aggregate/event-sourced.aggregate.ts.tpl +3 -0
  561. package/templates/command/handler.declared.ts.tpl +3 -0
  562. package/templates/command/handler.ts.tpl +3 -0
  563. package/templates/entity/entity.ts.tpl +3 -0
  564. package/templates/error/codes.ts.tpl +5 -0
  565. package/templates/error/refusal-case.spec.ts.tpl +8 -0
  566. package/templates/error/refusal-factory.ts.tpl +4 -0
  567. package/templates/error/refusal.spec.ts.tpl +7 -0
  568. package/templates/error/refusal.ts.tpl +8 -0
  569. package/templates/init/rules/domain.md.tpl +9 -2
  570. package/templates/init/rules/presentation.md.tpl +3 -0
  571. package/templates/pipeline/knip.json.tpl +5 -0
  572. package/templates/pipeline/package-scripts.json +3 -3
  573. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +22 -0
  574. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +16 -0
  575. package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.handler.ts.tpl +16 -0
  576. package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.handler.ts.tpl +16 -0
  577. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +10 -0
  578. package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.handler.ts.tpl +16 -0
  579. package/templates/presets/identity/context/application/commands/provision-account/provision-account.handler.ts.tpl +10 -0
  580. package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +16 -0
  581. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +10 -0
  582. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +10 -0
  583. package/templates/presets/identity/context/domain/aggregates/account.aggregate.ts.tpl +16 -0
  584. package/templates/presets/identity/context/domain/aggregates/delegation.aggregate.ts.tpl +28 -0
  585. package/templates/presets/identity/context/domain/aggregates/invitation.aggregate.ts.tpl +27 -0
  586. package/templates/presets/identity/context/domain/aggregates/member.aggregate.ts.tpl +31 -0
  587. package/templates/presets/identity/context/domain/errors/above-own-role.error.named.ts.tpl +13 -0
  588. package/templates/presets/identity/context/domain/errors/account-already-deactivated.error.named.ts.tpl +10 -0
  589. package/templates/presets/identity/context/domain/errors/already-member.error.named.ts.tpl +13 -0
  590. package/templates/presets/identity/context/domain/errors/codes.named.ts.tpl +33 -0
  591. package/templates/presets/identity/context/domain/errors/deactivated-account.error.named.ts.tpl +10 -0
  592. package/templates/presets/identity/context/domain/errors/delegation-not-active.error.named.ts.tpl +10 -0
  593. package/templates/presets/identity/context/domain/errors/delegation-period-inverted.error.named.ts.tpl +13 -0
  594. package/templates/presets/identity/context/domain/errors/delegation-to-oneself.error.named.ts.tpl +10 -0
  595. package/templates/presets/identity/context/domain/errors/delegation-too-long.error.named.ts.tpl +12 -0
  596. package/templates/presets/identity/context/domain/errors/delegation-with-no-right.error.named.ts.tpl +10 -0
  597. package/templates/presets/identity/context/domain/errors/email-not-verified.error.named.ts.tpl +13 -0
  598. package/templates/presets/identity/context/domain/errors/invalid-display-name.error.named.ts.tpl +10 -0
  599. package/templates/presets/identity/context/domain/errors/invalid-email-address.error.named.ts.tpl +10 -0
  600. package/templates/presets/identity/context/domain/errors/invalid-organisation-name.error.named.ts.tpl +10 -0
  601. package/templates/presets/identity/context/domain/errors/invalid-organisation-slug.error.named.ts.tpl +13 -0
  602. package/templates/presets/identity/context/domain/errors/invitation-expired.error.named.ts.tpl +13 -0
  603. package/templates/presets/identity/context/domain/errors/invitation-not-addressed-to-account.error.named.ts.tpl +13 -0
  604. package/templates/presets/identity/context/domain/errors/invitation-not-pending.error.named.ts.tpl +13 -0
  605. package/templates/presets/identity/context/domain/errors/last-owner.error.named.ts.tpl +12 -0
  606. package/templates/presets/identity/context/domain/errors/not-an-owner.error.named.ts.tpl +10 -0
  607. package/templates/presets/identity/context/domain/errors/organisation-slug-taken.error.named.ts.tpl +10 -0
  608. package/templates/presets/identity/context/domain/errors/own-role.error.named.ts.tpl +12 -0
  609. package/templates/presets/identity/context/domain/errors/right-not-in-role.error.named.ts.tpl +12 -0
  610. package/templates/presets/identity/context/domain/errors/unknown-account.error.named.ts.tpl +12 -0
  611. package/templates/presets/identity/context/domain/errors/unknown-delegation.error.named.ts.tpl +10 -0
  612. package/templates/presets/identity/context/domain/errors/unknown-invitation.error.named.ts.tpl +11 -0
  613. package/templates/presets/identity/context/domain/errors/unknown-member.error.named.ts.tpl +13 -0
  614. package/templates/presets/identity/context/domain/errors/unknown-organisation.error.named.ts.tpl +12 -0
  615. package/templates/presets/identity/context/domain/value-objects/delegation-period.vo.ts.tpl +16 -0
  616. package/templates/presets/identity/context/domain/value-objects/display-name.vo.ts.tpl +10 -0
  617. package/templates/presets/identity/context/domain/value-objects/email-address.vo.ts.tpl +10 -0
  618. package/templates/presets/identity/context/domain/value-objects/organisation-name.vo.ts.tpl +10 -0
  619. package/templates/presets/identity/context/domain/value-objects/organisation-slug.vo.ts.tpl +10 -0
  620. package/templates/state-machine/state-machine.ts.tpl +5 -0
  621. package/templates/value-object/value-object.ts.tpl +6 -0
  622. /package/templates/presets/identity/context/domain/errors/{account.error.ts.tpl → account.error.factories.ts.tpl} +0 -0
  623. /package/templates/presets/identity/context/domain/errors/{delegation.error.ts.tpl → delegation.error.factories.ts.tpl} +0 -0
  624. /package/templates/presets/identity/context/domain/errors/{invitation.error.ts.tpl → invitation.error.factories.ts.tpl} +0 -0
  625. /package/templates/presets/identity/context/domain/errors/{member.error.ts.tpl → member.error.factories.ts.tpl} +0 -0
  626. /package/templates/presets/identity/context/domain/errors/{organisation.error.ts.tpl → organisation.error.factories.ts.tpl} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,238 @@ What each version changes for someone who uses the kit. The packages of `package
4
4
  together, under one version; the notes of each [GitHub release](https://github.com/gbourgeat/ddd-ts-kit/releases)
5
5
  list the pull requests behind it.
6
6
 
7
+ ## 0.83.1
8
+
9
+ 0.83.0 was set but never published: four fixes reached `main` before its version did, and 0.83.1 holds them with the rest. No version 0.83.0 is on the registry.
10
+
11
+ **`DomainRefusal` in the kernel: one class per refusal, named after it, built by static factories named after what it is about.**
12
+ `class InsufficientFunds extends DomainRefusal { readonly code = BankingCodes.InsufficientFunds; static forAccountId(..) { return InsufficientFunds.refusal(message, facts) } }`,
13
+ thrown as `InsufficientFunds.forAccountId(account.id, missing)`. The class sets the code, read from a
14
+ closed list of the codes of the context; `refusal(message, facts?)` types the facts of each factory,
15
+ `.exposing(..)` and `.causedBy(..)` work as on `ConceptError`, and `InsufficientFunds.is(error)` narrows
16
+ with those facts. `ConceptError` and `DomainRefusal` now share `FactualRefusal`, which `@ddd-ts-kit/http`
17
+ reads to write the exposed facts of either form in the problem document. `isRefusal(error, SchedulingCodes)`
18
+ takes the closed list of the codes of a context and narrows to one of them, so that a `switch` on the code
19
+ is exhaustive. Nothing changes for a project that writes `ConceptError`.
20
+
21
+ **`init` writes `"stack.refusals": "named"`: a refusal is a class of its own, named after what is refused, built by static factories named after what it is about, its code read from the closed list of its context.**
22
+ `throw SlotTaken.forCalendar(calendar.id, slot.startsAt)`, where `SlotTaken` extends `DomainRefusal` in
23
+ `domain/errors/slot-taken.error.ts` and reads `readonly code = SchedulingCodes.SlotTaken` from
24
+ `domain/errors/codes.ts`, the list `SchedulingCodes` of every code of the context and its union type
25
+ `SchedulingCode`. `ddd-ts-kit generate error <context> <Refusal> <factory> [--code CODE]`
26
+ (`generate error banking InsufficientFunds forAccountId`) writes the class, its entry in `codes.ts`, the
27
+ factory and its spec case, each when absent; run again, it changes nothing. A factory starts with `for`,
28
+ `with`, `because`, `on` or `at` (`forCalendar`, `withNotice`, `becauseOf`); the code defaults to the refusal
29
+ in constant case and is unique in the context. Under `named`, `errors/through-factory`,
30
+ `errors/constructor-not-public`, `errors/code-unique` and `errors/known-code` judge the classes of
31
+ `DomainRefusal` and the values of `codes.ts`; `errors/factory-name` refuses a class named `...Error` and a
32
+ factory without one of the five prefixes; the new `errors/code-listed` of `ddd-ts-kit check` holds the list
33
+ (each refusal class reads its code under its own name, `codes.ts` exists as soon as one does, every key is a
34
+ refusal class of the context, every value a string literal in constant case, the list is `as const`);
35
+ `language/glossary-term` judges every class of `domain/errors/` under `named` as it judges an aggregate,
36
+ each word of its name a term of the glossary of its context, a refusal class allowed the qualifiers
37
+ `invalid`, `unknown`, `already`, `too`, `no`, `missing` and `required` besides (`SlotTaken`, `BookingTooLate`
38
+ and `InvalidAppointment` pass with `Slot`, `Take`, `Booking`, `Late` and `Appointment` in the glossary);
39
+ `codes.ts` is not judged. `generate error` refuses a refusal named with a word the glossary does not define,
40
+ and `--term "<Term>=<meaning>"` adds it in the same command. `generate domain-error` is refused under
41
+ `named`, pointing to `generate error`. The two earlier
42
+ forms keep working as they are: a project that says `"factories"` (one `ConceptError` class per concept)
43
+ is judged by the rules of that form, and a config without the key is still `classes`.
44
+ `ddd-ts-kit error-factories` now moves a project to `named` (`--to named`, the default), from either form: `--plan`
45
+ proposes, per refusal, a class (the PascalCase of its code, which it keeps) and a factory (`for<Concept>`),
46
+ both editable; `--apply` writes `codes.ts` in each context, one class file per refusal and its spec,
47
+ rewrites every usage (`AppointmentError.ended(a, b)` becomes `AppointmentEnded.forAppointment(a, b)`,
48
+ `AppointmentError.is(error, 'APPOINTMENT_ENDED')` becomes `AppointmentEnded.is(error)`, imports included),
49
+ removes the concept classes left empty, sets the key, and lists what it cannot rewrite (a bare
50
+ `AppointmentError.is(error)`, `CodeOf<typeof AppointmentError>`); `--plan` and `--apply` both list each class
51
+ whose name uses words the glossary of its context does not define. `--to factories` keeps the earlier move
52
+ from one class per error to concept classes.
53
+
54
+ To move: nothing is required, a project keeps its form. To adopt named refusals, run
55
+ `npx ddd-ts-kit error-factories --plan`, edit the class and factory names in `error-factories.plan.json`,
56
+ then `npx ddd-ts-kit error-factories --apply`, run the formatter and `npx ddd-ts-kit check`, and settle
57
+ the lines it lists as left to you.
58
+
59
+ **`event-sourcing/upcaster-required` sees a change inside the type arguments of a stored shape.** The fingerprint of a stored event read a member such as `totals: Record<string, number>` as two pieces split at its comma, and sorted them with the other members: `{ a: Record<string, number>; b: Record<number, string> }` and `{ a: Record<string, string>; b: Record<number, number> }` had one fingerprint, so a stored event could change in place unseen. A member is now read whole, an arrow `=>` inside its type arguments included. A version recorded by 0.82.0 or earlier for such a type is still taken for the same shape, `docs --stored-events` records it again as the kit reads it now, and `docs --check` reports it (`formerly recorded <event> version <n> in stored-events.lock.json`, `formerlyRecorded` in JSON) until it is.
60
+
61
+ To move: in a project whose stored events hold a type argument list with a comma, a semicolon or a line break (`Record<string, number>`, `Map<K, V>`), `docs --check` fails right after the upgrade, and with it the generated pipeline (`npm run docs:check`), until the lock is recorded again: run `npx ddd-ts-kit docs --stored-events` once, with the codecs as they are, and commit `stored-events.lock.json` in the same pull request as the upgrade. It rewrites only the versions `docs --check` lists as formerly recorded. Any other shape keeps its fingerprint, and its project sees no change.
62
+
63
+ **`signedDownloadUrl` and `signedUploadUrl` of `LocalFileStorage` and `InMemoryFileStorage` reject the promise they return for a key or an expiry they refuse.** They threw at the call, before any promise, so a `.catch(...)` chained on the call missed the `FileError` (`INVALID_FILE_KEY`, `INVALID_FILE_URL_EXPIRY`). They now behave as `S3FileStorage` always did; code that awaits the call sees no difference.
64
+
65
+ **`authz/policy-asked` reads the permission of `definePolicy` from the object written as its first argument only.** It took the first `{` anywhere after `definePolicy(`: in a file holding `definePolicy(options)` and, further on, any object with a `permission` entry, that permission counted as refined by a policy, and every handler of a use case requiring it was reported as never asking it. A policy whose options are not written in the call refines no permission the rule can see, as before.
66
+
67
+ **The `decorators()` plugin of `@ddd-ts-kit/testing/vitest` compiles again a cache entry that lost its output or its map, and replaces it.** An entry whose directory was left without its emitted file or its source map failed every compile of its file with `ENOENT` until the cache directory was removed by hand.
68
+
69
+ **`config/valid` no longer says the contracts are written in YAML only.** An unknown `openapi.format` was reported with "the contracts are written in YAML" although `json` is accepted too; it now reads "a format the contracts are not written in", its fix listing `yaml` and `json`. A document of `openapi.documents` with a wrong name is told its file is `openapi/<name>.json` when the contracts are written in JSON, instead of `.yaml` whatever the format.
70
+
71
+ **`InMemoryReadModelTable` refuses to insert an entry without a `row`, as the Knex, Prisma, Drizzle and TypeORM tables do.** Its `insert` stored such an entry as the trace of a deleted row and answered `true`, where every ORM adapter answers `false` and writes nothing, so a test over the fake could pass where the real table did not. `TableReadModelStore` never inserts such an entry, so a read model written through it sees no difference. `readModelStoreContract` of `@ddd-ts-kit/testing` now holds every adapter of `ReadModelTable` to it.
72
+
73
+ **`@ddd-ts-kit/audit`: inside a unit of work, `KnexAuditTrail` and `DrizzleAuditTrail` write the entries at its commit, so an append no longer ends in a PostgreSQL deadlock (`40P01`).**
74
+ An append used to lock the head of its chain at the call to `record` and hold it until the commit. A
75
+ unit of work that recorded (an authorization decision, an entry by hand) and then locked a row could
76
+ deadlock with another unit of work of the same tenant that held the row and appended to the same chain,
77
+ the head being created or not: PostgreSQL killed one of them with `40P01`, which reached the caller as an
78
+ error 500. The same happened between two units of work that appended to two chains in opposite orders.
79
+ The records of a unit of work now wait for its commit (`atCommit` of the kernel): they are written last,
80
+ after the work and its `before-commit` handlers, each chain once, the chains in the order of their names.
81
+ The head is the last lock a transaction takes, every transaction takes the heads in one order, and a unit
82
+ of work still at its work no longer makes the other writers of its tenant wait. Outside a unit of work an
83
+ entry is written at once, as before. Nothing changes in the tables, the hashes or the chains already
84
+ written.
85
+
86
+ To move: nothing for most projects. An entry recorded inside a unit of work is no longer visible inside it
87
+ before the commit, and a refusal of the store (an `id` written twice) now fails the commit instead of the
88
+ call to `record`: a test or a handler that read the trail back inside the same unit of work reads it after
89
+ the commit.
90
+
91
+ **A deadlock or a serialization failure anywhere in the transaction of a unit of work rejects it with `TransactionConflictError`, a `ConcurrencyError`, instead of the raw error of the driver, and `@ddd-ts-kit/http` answers `CONCURRENCY_CONFLICT` with 409.**
92
+ When two transactions take the same locks in opposite orders, PostgreSQL gives up one statement of the
93
+ cycle with `40P01`, the one it chooses: an append of the event store or of the audit trail, which the
94
+ store already turned into a `ConcurrencyError`, but just as well the update of a row of the other
95
+ transaction, which reached the caller as an unexpected error (a 500 through `@ddd-ts-kit/http`). The same
96
+ went for a serialization failure (`40001`) under REPEATABLE READ or SERIALIZABLE. `withinUnitOfWork`, which
97
+ the units of work of `@ddd-ts-kit/knex`, `@ddd-ts-kit/drizzle`, `@ddd-ts-kit/prisma` and
98
+ `@ddd-ts-kit/typeorm` are built on, now rejects the outermost unit of work with `TransactionConflictError`
99
+ (code `CONCURRENCY_CONFLICT`, the error of the driver as `cause`) for `40P01` and `40001` of PostgreSQL,
100
+ the `40001` of a MySQL deadlock and `P2034` of Prisma, whatever wraps them. Nothing of the transaction
101
+ committed, so the command can run again. `ConcurrencyError` takes an optional `cause`. `DEFAULT_ERROR_MAPPING`
102
+ of `@ddd-ts-kit/http` now maps `CONCURRENCY_CONFLICT`, a lost update included, to 409 Conflict: it fell
103
+ back on 422, which a client reads as a request to correct, not to send again.
104
+
105
+ To move: a project that recognised `40P01` or `40001` itself, around a command or in its error mapping,
106
+ reads `ConcurrencyError` (or the code `CONCURRENCY_CONFLICT`) instead. A client or a test that expected 422
107
+ for `CONCURRENCY_CONFLICT` expects 409; a project that wants 422 back passes `{ CONCURRENCY_CONFLICT: 422 }`
108
+ to `createErrorMapper`.
109
+
110
+ ## 0.82.0
111
+
112
+ **`drizzle-generate --replay` replays only what forks, and refuses to lose a migration edited by
113
+ hand.** The replay first reads the history on disk: when the journal lists every migration in
114
+ order, each snapshot from the one before, the branch's already follow the trunk, and nothing is
115
+ generated again (a name that changes, `working-` dropped, is renamed in place). Otherwise it
116
+ deletes the branch's migrations and generates them again on top as before, then compares each
117
+ generated one with what the branch had: when drizzle-kit now writes other statements (its SQL was
118
+ edited by hand, or the trunk changed what it changes), it puts the migrations folder back as it
119
+ found it and refuses, naming the statement that differs; the fix is to generate that migration on
120
+ top by hand and write the edit again, after which a replay, or `merge-trunk --continue`, finds
121
+ nothing forked. Several migrations of a branch that change the schema and fork are still
122
+ refused rather than joined: drizzle-kit diffs the final schema and cannot split them again, and
123
+ one migration in their place would join steps planned apart (a table, then a constraint once it
124
+ is filled, fails on a database that holds rows). Its fix said to generate them as one; it now
125
+ says to generate them again one at a time, in their order. Measured with the real drizzle-kit
126
+ 0.31.11: the replayed history is applied by `drizzle-kit migrate`.
127
+
128
+ **`persistence/primary-key-order` (a warning).** Under drizzle-kit, a migration that adds the new
129
+ primary key of a table before its old one is dropped, or drops a column before the key that holds
130
+ it, is reported on the line of the statement that runs too early: PostgreSQL refuses it when it
131
+ runs. `drizzle-generate` already warned once when it wrote one; the rule keeps reporting it. Fix:
132
+ drop the old key first, in that migration while it is still unapplied, or write it with
133
+ `--custom`. `ddd-ts-kit check --rule persistence/primary-key-order` lists the migrations to take
134
+ up; the rule stays a warning in this version.
135
+
136
+ **Two migrations kept apart.** The `persistence` skill and the persistence page say how: change
137
+ the schema in two steps, with a `db:generate` after each, since one `db:generate` writes every
138
+ change since the last migration as one.
139
+
140
+ **A cron accepts the shorthands `@hourly`, `@daily`, `@weekly`, `@monthly` and `@yearly`.**
141
+ `@Scheduled` and `ddd-ts-kit generate job --cron` read `@yearly` and `@annually` as `0 0 1 1 *`,
142
+ `@monthly` as `0 0 1 * *`, `@weekly` as `0 0 * * 0`, `@daily` and `@midnight` as `0 0 * * *` and
143
+ `@hourly` as `0 * * * *`, in any case, and fire on the occurrences of those five fields (`@hourly`
144
+ keeps its rhythm when clocks change, as `0 * * * *` does). A diagnostic and `ddd-ts-kit docs` show
145
+ the shorthand as written. `@reboot` and any other `@word` are refused by both with the same
146
+ message, which lists the shorthands accepted: a scheduled job has no occurrence at start.
147
+
148
+ **A lint warning fails the lint of a generated project.** `lint` and `ci:lint` ran `eslint .`,
149
+ which exits 0 on warnings: `verify` and the pipeline passed them, a new one as well, and they
150
+ piled up. `init` now writes `ddd-ts-kit lint` for both, and the example application runs the
151
+ same: the ESLint of the project, through its API (its paths, `--format` and `--fix` as ESLint
152
+ takes them), failing on an error and on a warning alike, but on a warning of a rule of the kit in
153
+ transition. A rule a version adds, or what a rule judges more, is a warning for one minor version
154
+ and an error at the next; its documentation names that version (`transition`), and `ddd-ts-kit
155
+ lint` shows its warnings and lists them after the report, one line per rule with the version that
156
+ makes it an error, without failing on them. An upgrade of the kit therefore never turns a green
157
+ lint red, which a plain `eslint . --max-warnings 0` would. The preset keeps its warnings as warnings (`complexity`, `max-depth`,
158
+ `clean/function-size`, `clean/no-flag-argument`, ...) and `init` writes no suppressions file: a
159
+ new project has no warning, so the first one fails `npm run lint`, `verify` and the lint job on
160
+ GitHub and GitLab. The hook before a commit is unchanged: it shows a warning without stopping the
161
+ commit. The quality-gate skill says so; the workflow is in
162
+ [Quality baseline](docs/tools/quality-baseline.md#warnings-fail-the-lint).
163
+
164
+ To move: nothing changes until the project acts. `npx ddd-ts-kit init` keeps an existing `lint`
165
+ and `ci:lint` and notes what the kit expects; `doctor` lists them as written otherwise, which
166
+ `doctor --strict` does not fail on. To take the limit, run `npx eslint .` and settle each
167
+ warning: fix it, or raise its rule to `error` (its id in the `rules` key of
168
+ `ddd-ts-kit.config.json` for a rule of the kit, a block after the preset in `eslint.config.mjs`
169
+ for `complexity` or `max-depth`) and record the existing findings with
170
+ `npx eslint . --suppress-rule <rule>` (or `--suppress-all`) in `eslint-suppressions.json`,
171
+ committed; once one is fixed, `npx eslint . --prune-suppressions` removes its entry, and the lint
172
+ fails until it does. Then set the two scripts to `ddd-ts-kit lint`, or run
173
+ `npx ddd-ts-kit init --force`, which also writes every other file and script of the kit over the
174
+ project's. Update the plugin.
175
+
176
+ **`check --explain` follows the violations with the reason of each rule they report.** A reviewer
177
+ of a pull request ran `ddd-ts-kit explain <rule-id>` for each rule `check --changed-since` named.
178
+ `--explain` prints, after the violations, one block per rule reported, however many times: its
179
+ id, its description and why it exists, as `explain` gives it without the examples; for a rule
180
+ another tool decides, where it is checked. `--format json` adds an `explanations` array.
181
+ `--format github` and `--format gitlab` keep one annotation per violation and end the message of
182
+ each with `Why: <reason>`, since a pull request shows an annotation alone on its line and a Code
183
+ Quality report has no place for text beside its issues; the fingerprints do not change. It
184
+ combines with paths, `--rule`, `--changed-since` and `--clean-only`. Without it, the output is
185
+ the same as before.
186
+
187
+ **`doctor` checks the environment of a checkout.** A new worktree starts from nothing, and what
188
+ goes wrong there is its environment: `verify` failed late, on a symptom. After what an upgrade
189
+ left to do, `npx ddd-ts-kit doctor` now says what this checkout lacks to run the project, read
190
+ from its files without network: the running Node against `engines.node` (`node engines.node:
191
+ unsupported`) and the version `.nvmrc` names; `node_modules` missing or installed before the
192
+ lockfile last changed (`install node_modules: missing`, `outdated`); `ddd-ts-kit` and every
193
+ `@ddd-ts-kit/*` package installed at the version of the running CLI (`install <package>: not
194
+ installed`, `other version`), where the package findings read the ranges of `package.json`, in
195
+ the install of its workspace for a project inside one; and,
196
+ with a `.gitmodules`, every submodule initialised (`submodule <path>: not initialised`). Each comes
197
+ with its fix (`nvm use`, `npm ci` in the dialect of the project, `git submodule update --init
198
+ --recursive`). `--strict` now also exits 1 while the checkout cannot run the project: a Node
199
+ outside `engines.node`, no `node_modules`, a package of the kit not installed or at another
200
+ version, a submodule not initialised. A Node `.nvmrc` does not name and a lockfile changed since
201
+ the install are said without failing it. A project or a pipeline that runs `doctor --strict` where
202
+ no dependencies are installed fails from this version: install first. `--json` gains the areas
203
+ `node`, `install` and `submodule`. The `parallel-work` skill runs it in a worktree made otherwise.
204
+
205
+ **`init` records the version that wrote the files of the platform.** `ddd-ts-kit.config.json`
206
+ now starts with `"initVersion"`, the version of the CLI whose `init` wrote the files it owns;
207
+ `init --force` rewrites it, and `init` run again to add a context leaves it. Nothing reads it yet:
208
+ it is the first step of an `init` that tells, after an upgrade, a change of its templates from an
209
+ adaptation of the team. A config without the key stays valid.
210
+
211
+ To move: nothing; `init --force` adds the key to a project initialised before it existed.
212
+
213
+ **An adapter that nothing wires is reported.** `declarations/port-adapter-wired`
214
+ (`ddd-ts-kit check`, a warning) reports a class of `infrastructure/` that implements a port of
215
+ `domain/repositories/` or `application/ports/` and that nothing wires: in the declared style it
216
+ carries no `@Repository`, `@Gateway` or `@Adapter`, and in both styles no file of the composition
217
+ root (`<context>.module.ts`, `main.ts`, `apps/<context>/main.ts`, the platform directory) imports
218
+ it. `declarations/role-declared` reads a role file by its suffix, so such a class in a file without
219
+ one was reported by no rule and only showed at run time as a missing binding. A file that still
220
+ carries a `TODO(domain)` or `TODO(platform)` is not judged yet: an adapter the generator wrote
221
+ before the outside system is ready is listed by `ddd-ts-kit todo` until it is wired. To move, run
222
+ `ddd-ts-kit check --rule declarations/port-adapter-wired`, then declare each reported class
223
+ (`@Gateway(Port)` in a `*.gateway.ts`, for example) or bind it in the module file; one kept
224
+ unwired on purpose gets its decision record in `docs/adr/` and
225
+ `// ddd-ts-kit-disable-next-line declarations/port-adapter-wired -- ADR-NNNN: <why>` above the class.
226
+ It becomes an error in the next minor version.
227
+
228
+ **The plugin and the packages share one version: 0.82.0.** The plugin numbered itself apart
229
+ (0.81.0 while the packages were at 0.27.0), so one agent showed a version and another the other.
230
+ From this release on, the release sets the version of the plugin with the version of the
231
+ packages; the version its skills describe already was that of the packages. The packages jump
232
+ from 0.27.0 to 0.82.0, above the last version of the plugin, so that an installed plugin is still
233
+ updated; no version between them was published. The plugin now changes with each release of the
234
+ kit, and an urgent fix of it is a patch release of the kit.
235
+
236
+ To move: upgrade the packages of the kit to 0.82.0 together, as at every release, and update the
237
+ plugin; from now on its version is the version of the kit.
238
+
7
239
  ## 0.27.0
8
240
 
9
241
  **The worktrees of a project live inside it, and a new project writes its code in a worktree.**