ddd-ts-kit 0.102.0 → 0.104.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 (724) hide show
  1. package/CHANGELOG.md +278 -0
  2. package/README.fr.md +26 -15
  3. package/README.md +26 -14
  4. package/dist/acceptance/check-locked-files.d.ts.map +1 -1
  5. package/dist/acceptance/check-locked-files.js +6 -3
  6. package/dist/acceptance/check-locked-files.js.map +1 -1
  7. package/dist/build/rewrite-aliases.d.ts.map +1 -1
  8. package/dist/build/rewrite-aliases.js +3 -0
  9. package/dist/build/rewrite-aliases.js.map +1 -1
  10. package/dist/check/baseline/write-baseline.d.ts.map +1 -1
  11. package/dist/check/baseline/write-baseline.js +2 -3
  12. package/dist/check/baseline/write-baseline.js.map +1 -1
  13. package/dist/check/canonical/stray-entry.d.ts.map +1 -1
  14. package/dist/check/canonical/stray-entry.js +14 -1
  15. package/dist/check/canonical/stray-entry.js.map +1 -1
  16. package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
  17. package/dist/check/catalogue/eslint-only-rules.js +1 -1
  18. package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
  19. package/dist/check/commands/check-command.d.ts.map +1 -1
  20. package/dist/check/commands/check-command.js +24 -1
  21. package/dist/check/commands/check-command.js.map +1 -1
  22. package/dist/check/commands/check-file-command.d.ts.map +1 -1
  23. package/dist/check/commands/check-file-command.js +3 -0
  24. package/dist/check/commands/check-file-command.js.map +1 -1
  25. package/dist/check/commands/explain-command.d.ts.map +1 -1
  26. package/dist/check/commands/explain-command.js +8 -21
  27. package/dist/check/commands/explain-command.js.map +1 -1
  28. package/dist/check/errors/kit-error-codes.d.ts.map +1 -1
  29. package/dist/check/errors/kit-error-codes.js +1 -0
  30. package/dist/check/errors/kit-error-codes.js.map +1 -1
  31. package/dist/check/explain/authz-docs.js +1 -1
  32. package/dist/check/explain/authz-docs.js.map +1 -1
  33. package/dist/check/explain/delegated-doc.d.ts +4 -0
  34. package/dist/check/explain/delegated-doc.d.ts.map +1 -0
  35. package/dist/check/explain/delegated-doc.js +11 -0
  36. package/dist/check/explain/delegated-doc.js.map +1 -0
  37. package/dist/check/explain/delegated-docs.d.ts +8 -0
  38. package/dist/check/explain/delegated-docs.d.ts.map +1 -0
  39. package/dist/check/explain/delegated-docs.js +292 -0
  40. package/dist/check/explain/delegated-docs.js.map +1 -0
  41. package/dist/check/explain/errors-docs.js +1 -1
  42. package/dist/check/explain/errors-docs.js.map +1 -1
  43. package/dist/check/explain/layer-docs.d.ts.map +1 -1
  44. package/dist/check/explain/layer-docs.js +6 -4
  45. package/dist/check/explain/layer-docs.js.map +1 -1
  46. package/dist/check/explain/ports-docs.js +1 -1
  47. package/dist/check/explain/ports-docs.js.map +1 -1
  48. package/dist/check/explain/tree-docs.js +2 -2
  49. package/dist/check/explain/tree-docs.js.map +1 -1
  50. package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
  51. package/dist/check/fixtures/authz-policy-fixtures.js +13 -1
  52. package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
  53. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  54. package/dist/check/fixtures/fixtures.js +4 -0
  55. package/dist/check/fixtures/fixtures.js.map +1 -1
  56. package/dist/check/fixtures/layer-entry-fixtures.d.ts +4 -0
  57. package/dist/check/fixtures/layer-entry-fixtures.d.ts.map +1 -0
  58. package/dist/check/fixtures/layer-entry-fixtures.js +35 -0
  59. package/dist/check/fixtures/layer-entry-fixtures.js.map +1 -0
  60. package/dist/check/fixtures/layer-fixtures.d.ts.map +1 -1
  61. package/dist/check/fixtures/layer-fixtures.js.map +1 -1
  62. package/dist/check/fixtures/other-language-fixtures.d.ts.map +1 -1
  63. package/dist/check/fixtures/other-language-fixtures.js +1 -1
  64. package/dist/check/fixtures/other-language-fixtures.js.map +1 -1
  65. package/dist/check/fixtures/ports-fixtures.d.ts.map +1 -1
  66. package/dist/check/fixtures/ports-fixtures.js +1 -0
  67. package/dist/check/fixtures/ports-fixtures.js.map +1 -1
  68. package/dist/check/fixtures/purity-fixtures.d.ts.map +1 -1
  69. package/dist/check/fixtures/purity-fixtures.js +18 -0
  70. package/dist/check/fixtures/purity-fixtures.js.map +1 -1
  71. package/dist/check/fixtures/role-folder-fixtures.d.ts +4 -0
  72. package/dist/check/fixtures/role-folder-fixtures.d.ts.map +1 -0
  73. package/dist/check/fixtures/role-folder-fixtures.js +31 -0
  74. package/dist/check/fixtures/role-folder-fixtures.js.map +1 -0
  75. package/dist/check/fixtures/test-fixtures.d.ts.map +1 -1
  76. package/dist/check/fixtures/test-fixtures.js +9 -0
  77. package/dist/check/fixtures/test-fixtures.js.map +1 -1
  78. package/dist/check/fixtures/tree-fixtures.d.ts.map +1 -1
  79. package/dist/check/fixtures/tree-fixtures.js +0 -1
  80. package/dist/check/fixtures/tree-fixtures.js.map +1 -1
  81. package/dist/check/layers/outer-entry.d.ts +13 -0
  82. package/dist/check/layers/outer-entry.d.ts.map +1 -0
  83. package/dist/check/layers/outer-entry.js +29 -0
  84. package/dist/check/layers/outer-entry.js.map +1 -0
  85. package/dist/check/rules/authz-policy-asked.d.ts.map +1 -1
  86. package/dist/check/rules/authz-policy-asked.js +45 -6
  87. package/dist/check/rules/authz-policy-asked.js.map +1 -1
  88. package/dist/check/rules/clean-braces.js +1 -1
  89. package/dist/check/rules/clean-braces.js.map +1 -1
  90. package/dist/check/rules/layer-application-inward.d.ts.map +1 -1
  91. package/dist/check/rules/layer-application-inward.js +3 -1
  92. package/dist/check/rules/layer-application-inward.js.map +1 -1
  93. package/dist/check/rules/layer-domain-purity.d.ts.map +1 -1
  94. package/dist/check/rules/layer-domain-purity.js +3 -1
  95. package/dist/check/rules/layer-domain-purity.js.map +1 -1
  96. package/dist/check/rules/naming-suffix.js +7 -1
  97. package/dist/check/rules/naming-suffix.js.map +1 -1
  98. package/dist/check/rules/ports-abstract-class.d.ts.map +1 -1
  99. package/dist/check/rules/ports-abstract-class.js +16 -2
  100. package/dist/check/rules/ports-abstract-class.js.map +1 -1
  101. package/dist/check/rules/purity-no-ambient-randomness.d.ts.map +1 -1
  102. package/dist/check/rules/purity-no-ambient-randomness.js +4 -0
  103. package/dist/check/rules/purity-no-ambient-randomness.js.map +1 -1
  104. package/dist/check/rules/purity-no-environment.d.ts.map +1 -1
  105. package/dist/check/rules/purity-no-environment.js +5 -0
  106. package/dist/check/rules/purity-no-environment.js.map +1 -1
  107. package/dist/check/rules/purity-no-system-clock.d.ts.map +1 -1
  108. package/dist/check/rules/purity-no-system-clock.js +4 -0
  109. package/dist/check/rules/purity-no-system-clock.js.map +1 -1
  110. package/dist/check/rules/test-no-mocks.d.ts.map +1 -1
  111. package/dist/check/rules/test-no-mocks.js +16 -6
  112. package/dist/check/rules/test-no-mocks.js.map +1 -1
  113. package/dist/check/rules/test-spec-required.d.ts.map +1 -1
  114. package/dist/check/rules/test-spec-required.js +3 -1
  115. package/dist/check/rules/test-spec-required.js.map +1 -1
  116. package/dist/check/scan/named-outside-imports.d.ts +3 -0
  117. package/dist/check/scan/named-outside-imports.d.ts.map +1 -0
  118. package/dist/check/scan/named-outside-imports.js +8 -0
  119. package/dist/check/scan/named-outside-imports.js.map +1 -0
  120. package/dist/check/scan/star-exports-of.d.ts +3 -0
  121. package/dist/check/scan/star-exports-of.d.ts.map +1 -0
  122. package/dist/check/scan/star-exports-of.js +8 -0
  123. package/dist/check/scan/star-exports-of.js.map +1 -0
  124. package/dist/check/scan/string-at.d.ts +3 -0
  125. package/dist/check/scan/string-at.d.ts.map +1 -0
  126. package/dist/check/scan/string-at.js +5 -0
  127. package/dist/check/scan/string-at.js.map +1 -0
  128. package/dist/check/text/closing-bracket.d.ts +6 -0
  129. package/dist/check/text/closing-bracket.d.ts.map +1 -0
  130. package/dist/check/text/closing-bracket.js +24 -0
  131. package/dist/check/text/closing-bracket.js.map +1 -0
  132. package/dist/commands/affected.d.ts.map +1 -1
  133. package/dist/commands/affected.js +5 -4
  134. package/dist/commands/affected.js.map +1 -1
  135. package/dist/commands/cited.d.ts.map +1 -1
  136. package/dist/commands/cited.js +2 -1
  137. package/dist/commands/cited.js.map +1 -1
  138. package/dist/commands/depcruise-config.d.ts.map +1 -1
  139. package/dist/commands/depcruise-config.js +14 -7
  140. package/dist/commands/depcruise-config.js.map +1 -1
  141. package/dist/commands/digest.d.ts.map +1 -1
  142. package/dist/commands/digest.js +2 -1
  143. package/dist/commands/digest.js.map +1 -1
  144. package/dist/commands/drizzle-generate.d.ts +3 -2
  145. package/dist/commands/drizzle-generate.d.ts.map +1 -1
  146. package/dist/commands/drizzle-generate.js +22 -7
  147. package/dist/commands/drizzle-generate.js.map +1 -1
  148. package/dist/commands/generate.d.ts.map +1 -1
  149. package/dist/commands/generate.js +3 -2
  150. package/dist/commands/generate.js.map +1 -1
  151. package/dist/commands/knex-generate.d.ts +10 -0
  152. package/dist/commands/knex-generate.d.ts.map +1 -0
  153. package/dist/commands/knex-generate.js +80 -0
  154. package/dist/commands/knex-generate.js.map +1 -0
  155. package/dist/commands/lint.d.ts +2 -1
  156. package/dist/commands/lint.d.ts.map +1 -1
  157. package/dist/commands/lint.js +42 -4
  158. package/dist/commands/lint.js.map +1 -1
  159. package/dist/commands/move-to-module.d.ts.map +1 -1
  160. package/dist/commands/move-to-module.js +3 -0
  161. package/dist/commands/move-to-module.js.map +1 -1
  162. package/dist/commands/mutation.d.ts.map +1 -1
  163. package/dist/commands/mutation.js +4 -3
  164. package/dist/commands/mutation.js.map +1 -1
  165. package/dist/commands/parse-migration-arguments.d.ts +11 -0
  166. package/dist/commands/parse-migration-arguments.d.ts.map +1 -0
  167. package/dist/commands/parse-migration-arguments.js +17 -0
  168. package/dist/commands/parse-migration-arguments.js.map +1 -0
  169. package/dist/commands/plan-waves.d.ts.map +1 -1
  170. package/dist/commands/plan-waves.js +2 -1
  171. package/dist/commands/plan-waves.js.map +1 -1
  172. package/dist/commands/prisma-generate.d.ts.map +1 -1
  173. package/dist/commands/prisma-generate.js +9 -14
  174. package/dist/commands/prisma-generate.js.map +1 -1
  175. package/dist/commands/typeorm-generate.d.ts +2 -1
  176. package/dist/commands/typeorm-generate.d.ts.map +1 -1
  177. package/dist/commands/typeorm-generate.js +22 -16
  178. package/dist/commands/typeorm-generate.js.map +1 -1
  179. package/dist/commands/verify-slice.d.ts.map +1 -1
  180. package/dist/commands/verify-slice.js +3 -2
  181. package/dist/commands/verify-slice.js.map +1 -1
  182. package/dist/commit/resolved-trunk.d.ts +3 -0
  183. package/dist/commit/resolved-trunk.d.ts.map +1 -0
  184. package/dist/commit/resolved-trunk.js +7 -0
  185. package/dist/commit/resolved-trunk.js.map +1 -0
  186. package/dist/commit/trunk-example.d.ts +3 -0
  187. package/dist/commit/trunk-example.d.ts.map +1 -0
  188. package/dist/commit/trunk-example.js +6 -0
  189. package/dist/commit/trunk-example.js.map +1 -0
  190. package/dist/describe/context-description.d.ts +2 -0
  191. package/dist/describe/context-description.d.ts.map +1 -1
  192. package/dist/describe/describe-context.d.ts.map +1 -1
  193. package/dist/describe/describe-context.js +6 -0
  194. package/dist/describe/describe-context.js.map +1 -1
  195. package/dist/describe/format-description.js +1 -1
  196. package/dist/describe/format-description.js.map +1 -1
  197. package/dist/digest/branch-points.d.ts.map +1 -1
  198. package/dist/digest/branch-points.js +3 -2
  199. package/dist/digest/branch-points.js.map +1 -1
  200. package/dist/doctor/permission-findings.d.ts.map +1 -1
  201. package/dist/doctor/permission-findings.js +68 -4
  202. package/dist/doctor/permission-findings.js.map +1 -1
  203. package/dist/generate/concept-role.d.ts +10 -0
  204. package/dist/generate/concept-role.d.ts.map +1 -1
  205. package/dist/generate/concept.d.ts.map +1 -1
  206. package/dist/generate/concept.js +5 -1
  207. package/dist/generate/concept.js.map +1 -1
  208. package/dist/generate/emit.d.ts +5 -2
  209. package/dist/generate/emit.d.ts.map +1 -1
  210. package/dist/generate/emit.js +5 -4
  211. package/dist/generate/emit.js.map +1 -1
  212. package/dist/generate/errors/refuse-taken-class-name.d.ts +9 -0
  213. package/dist/generate/errors/refuse-taken-class-name.d.ts.map +1 -0
  214. package/dist/generate/errors/refuse-taken-class-name.js +22 -0
  215. package/dist/generate/errors/refuse-taken-class-name.js.map +1 -0
  216. package/dist/generate/errors/write-named-refusal.d.ts.map +1 -1
  217. package/dist/generate/errors/write-named-refusal.js +2 -0
  218. package/dist/generate/errors/write-named-refusal.js.map +1 -1
  219. package/dist/generate/event-names.d.ts.map +1 -1
  220. package/dist/generate/event-names.js.map +1 -1
  221. package/dist/generate/files-without-modules.d.ts +8 -0
  222. package/dist/generate/files-without-modules.d.ts.map +1 -0
  223. package/dist/generate/files-without-modules.js +12 -0
  224. package/dist/generate/files-without-modules.js.map +1 -0
  225. package/dist/generate/grant-permission.js +2 -2
  226. package/dist/generate/grant-permission.js.map +1 -1
  227. package/dist/generate/kinds/aggregate-kind.js +4 -4
  228. package/dist/generate/kinds/aggregate-kind.js.map +1 -1
  229. package/dist/generate/kinds/command-kind.d.ts.map +1 -1
  230. package/dist/generate/kinds/command-kind.js +6 -1
  231. package/dist/generate/kinds/command-kind.js.map +1 -1
  232. package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
  233. package/dist/generate/kinds/declare-storage.js +4 -10
  234. package/dist/generate/kinds/declare-storage.js.map +1 -1
  235. package/dist/generate/kinds/domain-event-kind.d.ts.map +1 -1
  236. package/dist/generate/kinds/domain-event-kind.js +3 -1
  237. package/dist/generate/kinds/domain-event-kind.js.map +1 -1
  238. package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
  239. package/dist/generate/kinds/e2e-kind.js +8 -1
  240. package/dist/generate/kinds/e2e-kind.js.map +1 -1
  241. package/dist/generate/kinds/ensure-domain-event.d.ts.map +1 -1
  242. package/dist/generate/kinds/ensure-domain-event.js +2 -0
  243. package/dist/generate/kinds/ensure-domain-event.js.map +1 -1
  244. package/dist/generate/kinds/extraction/add-compose-service.js +1 -1
  245. package/dist/generate/kinds/extraction/add-compose-service.js.map +1 -1
  246. package/dist/generate/kinds/extraction/compose-service-of.d.ts +5 -0
  247. package/dist/generate/kinds/extraction/compose-service-of.d.ts.map +1 -0
  248. package/dist/generate/kinds/extraction/compose-service-of.js +8 -0
  249. package/dist/generate/kinds/extraction/compose-service-of.js.map +1 -0
  250. package/dist/generate/kinds/gateway-kind.js +9 -0
  251. package/dist/generate/kinds/gateway-kind.js.map +1 -1
  252. package/dist/generate/kinds/generate-context.d.ts.map +1 -1
  253. package/dist/generate/kinds/generate-context.js +37 -0
  254. package/dist/generate/kinds/generate-context.js.map +1 -1
  255. package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
  256. package/dist/generate/kinds/generate-repository.js +13 -0
  257. package/dist/generate/kinds/generate-repository.js.map +1 -1
  258. package/dist/generate/kinds/query-kind.d.ts.map +1 -1
  259. package/dist/generate/kinds/query-kind.js +24 -2
  260. package/dist/generate/kinds/query-kind.js.map +1 -1
  261. package/dist/generate/kinds/route/find-use-case.js +1 -1
  262. package/dist/generate/kinds/route/find-use-case.js.map +1 -1
  263. package/dist/generate/kinds/service-kind.d.ts.map +1 -1
  264. package/dist/generate/kinds/service-kind.js +3 -2
  265. package/dist/generate/kinds/service-kind.js.map +1 -1
  266. package/dist/generate/kinds/tables-files.d.ts +3 -0
  267. package/dist/generate/kinds/tables-files.d.ts.map +1 -0
  268. package/dist/generate/kinds/tables-files.js +7 -0
  269. package/dist/generate/kinds/tables-files.js.map +1 -0
  270. package/dist/generate/kinds/worker-kind.d.ts.map +1 -1
  271. package/dist/generate/kinds/worker-kind.js +12 -0
  272. package/dist/generate/kinds/worker-kind.js.map +1 -1
  273. package/dist/generate/kinds/write-birth.d.ts +8 -0
  274. package/dist/generate/kinds/write-birth.d.ts.map +1 -0
  275. package/dist/generate/kinds/write-birth.js +13 -0
  276. package/dist/generate/kinds/write-birth.js.map +1 -0
  277. package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
  278. package/dist/generate/kinds/write-event-sourced-aggregate.js +8 -1
  279. package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
  280. package/dist/generate/mark-policy-questions.js +2 -2
  281. package/dist/generate/mark-policy-questions.js.map +1 -1
  282. package/dist/generate/permission-name.d.ts +3 -0
  283. package/dist/generate/permission-name.d.ts.map +1 -0
  284. package/dist/generate/permission-name.js +3 -0
  285. package/dist/generate/permission-name.js.map +1 -0
  286. package/dist/generate/permission-named.d.ts.map +1 -1
  287. package/dist/generate/permission-named.js +1 -1
  288. package/dist/generate/permission-named.js.map +1 -1
  289. package/dist/generate/permission-words.d.ts +7 -0
  290. package/dist/generate/permission-words.d.ts.map +1 -0
  291. package/dist/generate/permission-words.js +11 -0
  292. package/dist/generate/permission-words.js.map +1 -0
  293. package/dist/generate/refined-by-policy.js +2 -2
  294. package/dist/generate/refined-by-policy.js.map +1 -1
  295. package/dist/generate/refuse-stuttering-event.d.ts +8 -0
  296. package/dist/generate/refuse-stuttering-event.d.ts.map +1 -0
  297. package/dist/generate/refuse-stuttering-event.js +14 -0
  298. package/dist/generate/refuse-stuttering-event.js.map +1 -0
  299. package/dist/generate/shared-writes.d.ts.map +1 -1
  300. package/dist/generate/shared-writes.js +1 -0
  301. package/dist/generate/shared-writes.js.map +1 -1
  302. package/dist/generate/spoken-in-language.d.ts +11 -2
  303. package/dist/generate/spoken-in-language.d.ts.map +1 -1
  304. package/dist/generate/spoken-in-language.js +27 -12
  305. package/dist/generate/spoken-in-language.js.map +1 -1
  306. package/dist/help/flag-notes.d.ts.map +1 -1
  307. package/dist/help/flag-notes.js +5 -1
  308. package/dist/help/flag-notes.js.map +1 -1
  309. package/dist/help/tool-notes.d.ts.map +1 -1
  310. package/dist/help/tool-notes.js +16 -0
  311. package/dist/help/tool-notes.js.map +1 -1
  312. package/dist/help/usage.d.ts.map +1 -1
  313. package/dist/help/usage.js +1 -0
  314. package/dist/help/usage.js.map +1 -1
  315. package/dist/init/agent-permissions.d.ts.map +1 -1
  316. package/dist/init/agent-permissions.js +18 -3
  317. package/dist/init/agent-permissions.js.map +1 -1
  318. package/dist/init/files/audit-files.d.ts.map +1 -1
  319. package/dist/init/files/audit-files.js +1 -0
  320. package/dist/init/files/audit-files.js.map +1 -1
  321. package/dist/init/files/persistence-files.d.ts.map +1 -1
  322. package/dist/init/files/persistence-files.js +2 -1
  323. package/dist/init/files/persistence-files.js.map +1 -1
  324. package/dist/init/files/script-files.d.ts +4 -1
  325. package/dist/init/files/script-files.d.ts.map +1 -1
  326. package/dist/init/files/script-files.js +6 -1
  327. package/dist/init/files/script-files.js.map +1 -1
  328. package/dist/init/is-team-file.d.ts +2 -2
  329. package/dist/init/is-team-file.d.ts.map +1 -1
  330. package/dist/init/is-team-file.js +5 -3
  331. package/dist/init/is-team-file.js.map +1 -1
  332. package/dist/init/keep-regions.d.ts +21 -0
  333. package/dist/init/keep-regions.d.ts.map +1 -0
  334. package/dist/init/keep-regions.js +63 -0
  335. package/dist/init/keep-regions.js.map +1 -0
  336. package/dist/init/kept-combination-notes.d.ts.map +1 -1
  337. package/dist/init/kept-combination-notes.js +6 -2
  338. package/dist/init/kept-combination-notes.js.map +1 -1
  339. package/dist/init/kept-compose-services.d.ts +6 -0
  340. package/dist/init/kept-compose-services.d.ts.map +1 -0
  341. package/dist/init/kept-compose-services.js +42 -0
  342. package/dist/init/kept-compose-services.js.map +1 -0
  343. package/dist/init/kept-role-vocabulary.d.ts +3 -0
  344. package/dist/init/kept-role-vocabulary.d.ts.map +1 -0
  345. package/dist/init/kept-role-vocabulary.js +7 -0
  346. package/dist/init/kept-role-vocabulary.js.map +1 -0
  347. package/dist/init/kept-roles.d.ts +12 -0
  348. package/dist/init/kept-roles.d.ts.map +1 -0
  349. package/dist/init/kept-roles.js +29 -0
  350. package/dist/init/kept-roles.js.map +1 -0
  351. package/dist/init/kept-wiring.d.ts +22 -0
  352. package/dist/init/kept-wiring.d.ts.map +1 -0
  353. package/dist/init/kept-wiring.js +91 -0
  354. package/dist/init/kept-wiring.js.map +1 -0
  355. package/dist/init/knip-vars.d.ts.map +1 -1
  356. package/dist/init/knip-vars.js +5 -1
  357. package/dist/init/knip-vars.js.map +1 -1
  358. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  359. package/dist/init/manifest/database-scripts.js +5 -3
  360. package/dist/init/manifest/database-scripts.js.map +1 -1
  361. package/dist/init/manifest/scripts-for.d.ts.map +1 -1
  362. package/dist/init/manifest/scripts-for.js +8 -0
  363. package/dist/init/manifest/scripts-for.js.map +1 -1
  364. package/dist/init/manifest/versions.js +24 -24
  365. package/dist/init/orphaned-wiring-notes.d.ts +13 -0
  366. package/dist/init/orphaned-wiring-notes.d.ts.map +1 -0
  367. package/dist/init/orphaned-wiring-notes.js +42 -0
  368. package/dist/init/orphaned-wiring-notes.js.map +1 -0
  369. package/dist/init/profile-hooks.js +1 -1
  370. package/dist/init/profile-hooks.js.map +1 -1
  371. package/dist/init/repositories-left-behind.d.ts +12 -0
  372. package/dist/init/repositories-left-behind.d.ts.map +1 -0
  373. package/dist/init/repositories-left-behind.js +26 -0
  374. package/dist/init/repositories-left-behind.js.map +1 -0
  375. package/dist/init/rewire-audited-events.d.ts +10 -0
  376. package/dist/init/rewire-audited-events.d.ts.map +1 -0
  377. package/dist/init/rewire-audited-events.js +32 -0
  378. package/dist/init/rewire-audited-events.js.map +1 -0
  379. package/dist/init/rewire-contexts.d.ts +15 -0
  380. package/dist/init/rewire-contexts.d.ts.map +1 -0
  381. package/dist/init/rewire-contexts.js +41 -0
  382. package/dist/init/rewire-contexts.js.map +1 -0
  383. package/dist/init/rewire-preset.d.ts +9 -0
  384. package/dist/init/rewire-preset.d.ts.map +1 -0
  385. package/dist/init/rewire-preset.js +29 -0
  386. package/dist/init/rewire-preset.js.map +1 -0
  387. package/dist/init/rewire-tables.d.ts +10 -0
  388. package/dist/init/rewire-tables.d.ts.map +1 -0
  389. package/dist/init/rewire-tables.js +54 -0
  390. package/dist/init/rewire-tables.js.map +1 -0
  391. package/dist/init/run-init.d.ts.map +1 -1
  392. package/dist/init/run-init.js +28 -28
  393. package/dist/init/run-init.js.map +1 -1
  394. package/dist/init/stack/kept-flag-notes.d.ts +7 -0
  395. package/dist/init/stack/kept-flag-notes.d.ts.map +1 -0
  396. package/dist/init/stack/kept-flag-notes.js +24 -0
  397. package/dist/init/stack/kept-flag-notes.js.map +1 -0
  398. package/dist/init/stack/refuse-unused-no-outbox.d.ts +4 -0
  399. package/dist/init/stack/refuse-unused-no-outbox.d.ts.map +1 -0
  400. package/dist/init/stack/refuse-unused-no-outbox.js +9 -0
  401. package/dist/init/stack/refuse-unused-no-outbox.js.map +1 -0
  402. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  403. package/dist/init/stack/resolve-stack.js +10 -0
  404. package/dist/init/stack/resolve-stack.js.map +1 -1
  405. package/dist/init/stack-before.d.ts +4 -0
  406. package/dist/init/stack-before.d.ts.map +1 -0
  407. package/dist/init/stack-before.js +11 -0
  408. package/dist/init/stack-before.js.map +1 -0
  409. package/dist/init/wiring-notes.d.ts +9 -0
  410. package/dist/init/wiring-notes.d.ts.map +1 -0
  411. package/dist/init/wiring-notes.js +22 -0
  412. package/dist/init/wiring-notes.js.map +1 -0
  413. package/dist/init/with-named-imports.d.ts +8 -0
  414. package/dist/init/with-named-imports.d.ts.map +1 -0
  415. package/dist/init/with-named-imports.js +69 -0
  416. package/dist/init/with-named-imports.js.map +1 -0
  417. package/dist/init/with-system-grants.d.ts +7 -0
  418. package/dist/init/with-system-grants.d.ts.map +1 -0
  419. package/dist/init/with-system-grants.js +26 -0
  420. package/dist/init/with-system-grants.js.map +1 -0
  421. package/dist/init/write-local-environment.d.ts +8 -0
  422. package/dist/init/write-local-environment.d.ts.map +1 -0
  423. package/dist/init/write-local-environment.js +18 -0
  424. package/dist/init/write-local-environment.js.map +1 -0
  425. package/dist/lint/eslint-in-project.d.ts +1 -1
  426. package/dist/lint/eslint-in-project.d.ts.map +1 -1
  427. package/dist/lint/eslint-in-project.js +11 -2
  428. package/dist/lint/eslint-in-project.js.map +1 -1
  429. package/dist/markers/index.d.ts +3 -0
  430. package/dist/markers/index.d.ts.map +1 -1
  431. package/dist/markers/index.js +3 -0
  432. package/dist/markers/index.js.map +1 -1
  433. package/dist/markers/region-marker.d.ts +3 -0
  434. package/dist/markers/region-marker.d.ts.map +1 -0
  435. package/dist/markers/region-marker.js +3 -0
  436. package/dist/markers/region-marker.js.map +1 -0
  437. package/dist/markers/regions-of.d.ts +9 -0
  438. package/dist/markers/regions-of.d.ts.map +1 -0
  439. package/dist/markers/regions-of.js +20 -0
  440. package/dist/markers/regions-of.js.map +1 -0
  441. package/dist/markers/unpaired-markers.d.ts +3 -0
  442. package/dist/markers/unpaired-markers.d.ts.map +1 -0
  443. package/dist/markers/unpaired-markers.js +13 -0
  444. package/dist/markers/unpaired-markers.js.map +1 -0
  445. package/dist/measures/format-measures.js +1 -1
  446. package/dist/measures/format-measures.js.map +1 -1
  447. package/dist/measures/measures-view.d.ts +1 -1
  448. package/dist/measures/measures-view.d.ts.map +1 -1
  449. package/dist/merge/apply-resolutions.d.ts.map +1 -1
  450. package/dist/merge/apply-resolutions.js +6 -4
  451. package/dist/merge/apply-resolutions.js.map +1 -1
  452. package/dist/merge/continue-merge.d.ts.map +1 -1
  453. package/dist/merge/continue-merge.js +1 -0
  454. package/dist/merge/continue-merge.js.map +1 -1
  455. package/dist/merge/ensure-mergeable.js +1 -1
  456. package/dist/merge/ensure-mergeable.js.map +1 -1
  457. package/dist/merge/lost/verify-merges.d.ts.map +1 -1
  458. package/dist/merge/lost/verify-merges.js +4 -0
  459. package/dist/merge/lost/verify-merges.js.map +1 -1
  460. package/dist/merge/merge-state.d.ts.map +1 -1
  461. package/dist/merge/merge-state.js +2 -2
  462. package/dist/merge/merge-state.js.map +1 -1
  463. package/dist/merge/merge-trunk.d.ts.map +1 -1
  464. package/dist/merge/merge-trunk.js +4 -0
  465. package/dist/merge/merge-trunk.js.map +1 -1
  466. package/dist/merge/refuse-shallow-history.d.ts +10 -0
  467. package/dist/merge/refuse-shallow-history.d.ts.map +1 -0
  468. package/dist/merge/refuse-shallow-history.js +15 -0
  469. package/dist/merge/refuse-shallow-history.js.map +1 -0
  470. package/dist/merge/resume-merge.js +2 -2
  471. package/dist/merge/resume-merge.js.map +1 -1
  472. package/dist/merge/settle-regions.d.ts.map +1 -1
  473. package/dist/merge/settle-regions.js +3 -4
  474. package/dist/merge/settle-regions.js.map +1 -1
  475. package/dist/migration/answered-as-json.d.ts +13 -0
  476. package/dist/migration/answered-as-json.d.ts.map +1 -0
  477. package/dist/migration/answered-as-json.js +38 -0
  478. package/dist/migration/answered-as-json.js.map +1 -0
  479. package/dist/migration/audit-guard/append-audit-guard.d.ts +4 -2
  480. package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -1
  481. package/dist/migration/audit-guard/append-audit-guard.js +18 -3
  482. package/dist/migration/audit-guard/append-audit-guard.js.map +1 -1
  483. package/dist/migration/audit-guard/run-orm-tool.d.ts.map +1 -1
  484. package/dist/migration/audit-guard/run-orm-tool.js +2 -1
  485. package/dist/migration/audit-guard/run-orm-tool.js.map +1 -1
  486. package/dist/migration/declared-tables.d.ts +8 -0
  487. package/dist/migration/declared-tables.d.ts.map +1 -0
  488. package/dist/migration/declared-tables.js +13 -0
  489. package/dist/migration/declared-tables.js.map +1 -0
  490. package/dist/migration/find-project-formatter.d.ts.map +1 -1
  491. package/dist/migration/find-project-formatter.js +2 -1
  492. package/dist/migration/find-project-formatter.js.map +1 -1
  493. package/dist/migration/index.d.ts +9 -0
  494. package/dist/migration/index.d.ts.map +1 -1
  495. package/dist/migration/index.js +9 -0
  496. package/dist/migration/index.js.map +1 -1
  497. package/dist/migration/knex-migration-text.d.ts +4 -0
  498. package/dist/migration/knex-migration-text.d.ts.map +1 -0
  499. package/dist/migration/knex-migration-text.js +24 -0
  500. package/dist/migration/knex-migration-text.js.map +1 -0
  501. package/dist/migration/knex-schema-difference.d.ts +12 -0
  502. package/dist/migration/knex-schema-difference.d.ts.map +1 -0
  503. package/dist/migration/knex-schema-difference.js +166 -0
  504. package/dist/migration/knex-schema-difference.js.map +1 -0
  505. package/dist/migration/listed-in-index.d.ts +6 -0
  506. package/dist/migration/listed-in-index.d.ts.map +1 -0
  507. package/dist/migration/listed-in-index.js +8 -0
  508. package/dist/migration/listed-in-index.js.map +1 -0
  509. package/dist/migration/refuse-other-orm.d.ts +8 -0
  510. package/dist/migration/refuse-other-orm.d.ts.map +1 -0
  511. package/dist/migration/refuse-other-orm.js +34 -0
  512. package/dist/migration/refuse-other-orm.js.map +1 -0
  513. package/dist/migration/required-migration-name.d.ts +3 -0
  514. package/dist/migration/required-migration-name.d.ts.map +1 -0
  515. package/dist/migration/required-migration-name.js +11 -0
  516. package/dist/migration/required-migration-name.js.map +1 -0
  517. package/dist/migration/run-on-in-process-database.d.ts.map +1 -1
  518. package/dist/migration/run-on-in-process-database.js +2 -1
  519. package/dist/migration/run-on-in-process-database.js.map +1 -1
  520. package/dist/migration/tool-stdio.d.ts +6 -0
  521. package/dist/migration/tool-stdio.d.ts.map +1 -0
  522. package/dist/migration/tool-stdio.js +17 -0
  523. package/dist/migration/tool-stdio.js.map +1 -0
  524. package/dist/migration/warn-dropped-context-tables.d.ts +12 -0
  525. package/dist/migration/warn-dropped-context-tables.d.ts.map +1 -0
  526. package/dist/migration/warn-dropped-context-tables.js +88 -0
  527. package/dist/migration/warn-dropped-context-tables.js.map +1 -0
  528. package/dist/package-manager/dialects.js +1 -1
  529. package/dist/package-manager/dialects.js.map +1 -1
  530. package/dist/package-manager/in-project-dialect.d.ts +8 -0
  531. package/dist/package-manager/in-project-dialect.d.ts.map +1 -0
  532. package/dist/package-manager/in-project-dialect.js +22 -0
  533. package/dist/package-manager/in-project-dialect.js.map +1 -0
  534. package/dist/plan/batched-waves.d.ts +2 -0
  535. package/dist/plan/batched-waves.d.ts.map +1 -1
  536. package/dist/plan/batched-waves.js +6 -4
  537. package/dist/plan/batched-waves.js.map +1 -1
  538. package/dist/plan/plan-problems.d.ts +5 -0
  539. package/dist/plan/plan-problems.d.ts.map +1 -1
  540. package/dist/plan/plan-problems.js +6 -1
  541. package/dist/plan/plan-problems.js.map +1 -1
  542. package/dist/plan/plan-waves.d.ts +2 -0
  543. package/dist/plan/plan-waves.d.ts.map +1 -1
  544. package/dist/plan/plan-waves.js +1 -1
  545. package/dist/plan/plan-waves.js.map +1 -1
  546. package/dist/presets/adapter-of.d.ts +5 -0
  547. package/dist/presets/adapter-of.d.ts.map +1 -0
  548. package/dist/presets/adapter-of.js +6 -0
  549. package/dist/presets/adapter-of.js.map +1 -0
  550. package/dist/presets/apply-preset.d.ts.map +1 -1
  551. package/dist/presets/apply-preset.js +1 -5
  552. package/dist/presets/apply-preset.js.map +1 -1
  553. package/dist/presets/grant-to-signed-in.d.ts.map +1 -1
  554. package/dist/presets/grant-to-signed-in.js +1 -24
  555. package/dist/presets/grant-to-signed-in.js.map +1 -1
  556. package/dist/presets/identity-terms.d.ts.map +1 -1
  557. package/dist/presets/identity-terms.js +4 -0
  558. package/dist/presets/identity-terms.js.map +1 -1
  559. package/dist/presets/lay-out-prisma-models.js +1 -19
  560. package/dist/presets/lay-out-prisma-models.js.map +1 -1
  561. package/dist/presets/organisations-as-tenants.d.ts +2 -2
  562. package/dist/presets/organisations-as-tenants.d.ts.map +1 -1
  563. package/dist/presets/organisations-as-tenants.js +46 -2
  564. package/dist/presets/organisations-as-tenants.js.map +1 -1
  565. package/dist/presets/preset-named.d.ts +2 -0
  566. package/dist/presets/preset-named.d.ts.map +1 -1
  567. package/dist/presets/preset-named.js +1 -1
  568. package/dist/presets/preset-named.js.map +1 -1
  569. package/dist/presets/wrap-authorizer.d.ts +4 -0
  570. package/dist/presets/wrap-authorizer.d.ts.map +1 -0
  571. package/dist/presets/wrap-authorizer.js +25 -0
  572. package/dist/presets/wrap-authorizer.js.map +1 -0
  573. package/dist/prisma-schema/datasource-schemas.d.ts +3 -0
  574. package/dist/prisma-schema/datasource-schemas.d.ts.map +1 -0
  575. package/dist/prisma-schema/datasource-schemas.js +5 -0
  576. package/dist/prisma-schema/datasource-schemas.js.map +1 -0
  577. package/dist/prisma-schema/index.d.ts +4 -0
  578. package/dist/prisma-schema/index.d.ts.map +1 -1
  579. package/dist/prisma-schema/index.js +4 -0
  580. package/dist/prisma-schema/index.js.map +1 -1
  581. package/dist/prisma-schema/preview-features-of.d.ts +3 -0
  582. package/dist/prisma-schema/preview-features-of.d.ts.map +1 -0
  583. package/dist/prisma-schema/preview-features-of.js +7 -0
  584. package/dist/prisma-schema/preview-features-of.js.map +1 -0
  585. package/dist/prisma-schema/with-datasource-schema.d.ts +3 -0
  586. package/dist/prisma-schema/with-datasource-schema.d.ts.map +1 -0
  587. package/dist/prisma-schema/with-datasource-schema.js +9 -0
  588. package/dist/prisma-schema/with-datasource-schema.js.map +1 -0
  589. package/dist/prisma-schema/with-preview-feature.d.ts +3 -0
  590. package/dist/prisma-schema/with-preview-feature.d.ts.map +1 -0
  591. package/dist/prisma-schema/with-preview-feature.js +19 -0
  592. package/dist/prisma-schema/with-preview-feature.js.map +1 -0
  593. package/dist/run.d.ts +2 -0
  594. package/dist/run.d.ts.map +1 -1
  595. package/dist/run.js +11 -2
  596. package/dist/run.js.map +1 -1
  597. package/dist/sdk/render-client.js +1 -1
  598. package/dist/sdk/render-client.js.map +1 -1
  599. package/dist/slice/record-verification.d.ts.map +1 -1
  600. package/dist/slice/record-verification.js +2 -5
  601. package/dist/slice/record-verification.js.map +1 -1
  602. package/dist/stack/stack-vars.js +6 -2
  603. package/dist/stack/stack-vars.js.map +1 -1
  604. package/dist/stories/open-story-scope.d.ts.map +1 -1
  605. package/dist/stories/open-story-scope.js +4 -5
  606. package/dist/stories/open-story-scope.js.map +1 -1
  607. package/dist/stories/origin-of.d.ts.map +1 -1
  608. package/dist/stories/origin-of.js +14 -2
  609. package/dist/stories/origin-of.js.map +1 -1
  610. package/dist/stories/origin-phase.js +4 -4
  611. package/dist/stories/origin-phase.js.map +1 -1
  612. package/dist/stories/read-story-phases.js +8 -4
  613. package/dist/stories/read-story-phases.js.map +1 -1
  614. package/dist/story/change-gated.d.ts +3 -3
  615. package/dist/story/change-gated.d.ts.map +1 -1
  616. package/dist/story/change-gated.js +13 -7
  617. package/dist/story/change-gated.js.map +1 -1
  618. package/dist/version.d.ts +1 -1
  619. package/dist/version.js +1 -1
  620. package/dist/worker/base-of.d.ts.map +1 -1
  621. package/dist/worker/base-of.js +2 -2
  622. package/dist/worker/base-of.js.map +1 -1
  623. package/dist/worker/briefing-of.js +2 -2
  624. package/dist/worker/briefing-of.js.map +1 -1
  625. package/dist/worker/open-worker-scope.d.ts.map +1 -1
  626. package/dist/worker/open-worker-scope.js +3 -4
  627. package/dist/worker/open-worker-scope.js.map +1 -1
  628. package/dist/workspace/workspace.d.ts.map +1 -1
  629. package/dist/workspace/workspace.js +2 -1
  630. package/dist/workspace/workspace.js.map +1 -1
  631. package/dist/workspace/write-inside-project.d.ts +8 -0
  632. package/dist/workspace/write-inside-project.d.ts.map +1 -0
  633. package/dist/workspace/write-inside-project.js +17 -0
  634. package/dist/workspace/write-inside-project.js.map +1 -0
  635. package/package.json +5 -5
  636. package/templates/aggregate/event-sourced.events.mapper.ts.tpl +5 -1
  637. package/templates/command/handler.declared.ts.tpl +4 -12
  638. package/templates/command/handler.ts.tpl +4 -12
  639. package/templates/e2e/e2e.spec.ts.tpl +2 -2
  640. package/templates/init/README.md.tpl +29 -5
  641. package/templates/init/docker/docker-compose.yml.tpl +5 -2
  642. package/templates/init/docker/dockerignore.tpl +1 -0
  643. package/templates/init/docker/env.example.tpl +8 -1
  644. package/templates/init/gitignore.tpl +1 -0
  645. package/templates/init/hooks/change-reference.mjs +96 -17
  646. package/templates/init/hooks/production-gate.mjs +65 -11
  647. package/templates/init/jest.config.js.tpl +4 -1
  648. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +25 -8
  649. package/templates/init/platform/audit/create-audit-trail.ts.tpl +59 -0
  650. package/templates/init/platform/audit/create-audit.ts.tpl +1 -46
  651. package/templates/init/platform/auth/authentication/development-header-authenticator.ts.tpl +7 -3
  652. package/templates/init/platform/auth/relationships/relationship-schema.ts.tpl +5 -0
  653. package/templates/init/platform/composition/compose-application.manual.ts.tpl +22 -7
  654. package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +2 -4
  655. package/templates/init/platform/config/app-config.ts.tpl +9 -0
  656. package/templates/init/platform/config/load-config.ts.tpl +24 -0
  657. package/templates/init/platform/database/data-source.typeorm.ts.tpl +6 -0
  658. package/templates/init/platform/database/gitkeep +0 -0
  659. package/templates/init/platform/database/knexfile.js.tpl +10 -3
  660. package/templates/init/platform/database/open-persistence.prisma.ts.tpl +5 -2
  661. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +11 -3
  662. package/templates/init/platform/database/prisma.config.ts.tpl +6 -0
  663. package/templates/init/platform/database/schema.knex.ts.tpl +4 -3
  664. package/templates/init/platform/http/start-http-server.express.ts.tpl +9 -6
  665. package/templates/init/platform/http/start-http-server.fastify.ts.tpl +5 -2
  666. package/templates/init/platform/http/start-http-server.hono.ts.tpl +5 -2
  667. package/templates/init/platform/jobs/job-settings.ts.tpl +3 -0
  668. package/templates/init/platform/privacy/run-export.manual.ts.tpl +24 -2
  669. package/templates/init/platform/privacy/run-export.tsyringe.ts.tpl +30 -1
  670. package/templates/init/scripts/audit-verify.ts.tpl +35 -0
  671. package/templates/init/scripts/privacy-export.manual.ts.tpl +1 -7
  672. package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +1 -7
  673. package/templates/pipeline/github/dependabot.yml +6 -0
  674. package/templates/pipeline/github/workflows/ci.yml.tpl +26 -1
  675. package/templates/pipeline/github/workflows/claude-review.yml +3 -2
  676. package/templates/pipeline/github/workflows/claude-triage.yml +1 -1
  677. package/templates/pipeline/github/workflows/codeql.yml +2 -0
  678. package/templates/pipeline/github/workflows/copilot-setup-steps.yml +2 -0
  679. package/templates/pipeline/github/workflows/intent-to-spec.yml +12 -4
  680. package/templates/pipeline/github/workflows/pr-title.yml +2 -0
  681. package/templates/pipeline/gitlab/claude-review.gitlab-ci.yml.tpl +1 -1
  682. package/templates/pipeline/knip.json.tpl +1 -4
  683. package/templates/pipeline/package-scripts.json +2 -2
  684. package/templates/pipeline/renovate.json +11 -0
  685. package/templates/pipeline/vitest.config.ts.tpl +3 -2
  686. package/templates/presets/identity/context/__context__.codes.named.ts.tpl +1 -0
  687. package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +1 -1
  688. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.handler.ts.tpl +28 -1
  689. package/templates/presets/identity/context/domain/aggregates/invitation.aggregate.ts.tpl +13 -1
  690. package/templates/presets/identity/context/domain/aggregates/member.aggregate.ts.tpl +6 -1
  691. package/templates/presets/identity/context/domain/errors/invitation-withdrawn.error.named.ts.tpl +13 -0
  692. package/templates/presets/identity/context/domain/errors/invitation.error.factories.ts.tpl +8 -0
  693. package/templates/presets/identity/context/domain/services/role-rights.service.ts.tpl +23 -1
  694. package/templates/presets/identity/context/infrastructure/persistence/__context__.schema.drizzle.ts.tpl +1 -0
  695. package/templates/presets/identity/context/infrastructure/persistence/create-__context__-tables.schema.knex.ts.tpl +1 -0
  696. package/templates/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +6 -2
  697. package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +6 -2
  698. package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +6 -2
  699. package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +6 -2
  700. package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +6 -2
  701. package/templates/presets/identity/context/infrastructure/persistence/invitation-row.schema.knex.ts.tpl +1 -0
  702. package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.drizzle.ts.tpl +2 -0
  703. package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.knex.ts.tpl +2 -0
  704. package/templates/presets/identity/context/infrastructure/persistence/invitation.mapper.prisma.ts.tpl +2 -0
  705. package/templates/presets/identity/context/infrastructure/persistence/prisma-account.repository.prisma.ts.tpl +8 -5
  706. package/templates/presets/identity/context/infrastructure/persistence/prisma-delegation.repository.prisma.ts.tpl +8 -5
  707. package/templates/presets/identity/context/infrastructure/persistence/prisma-invitation.repository.prisma.ts.tpl +8 -5
  708. package/templates/presets/identity/context/infrastructure/persistence/prisma-member.repository.prisma.ts.tpl +8 -5
  709. package/templates/presets/identity/context/infrastructure/persistence/prisma-organisation.repository.prisma.ts.tpl +8 -5
  710. package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.kit-routes.ts.tpl +1 -0
  711. package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +1 -0
  712. package/templates/presets/identity/context/test/builders/invitation.builder.ts.tpl +15 -2
  713. package/templates/presets/identity/context/test/integration/invitation.repository.contract.spec.ts.tpl +10 -0
  714. package/templates/presets/identity/context/test/unit/accept-invitation.handler.spec.ts.tpl +114 -4
  715. package/templates/presets/identity/context/test/worlds/__context__.world.explicit.ts.tpl +1 -1
  716. package/templates/presets/identity/design.md.tpl +3 -1
  717. package/templates/presets/identity/prisma/models.prisma.tpl +1 -0
  718. package/templates/query/reader.fake.ts.tpl +4 -6
  719. package/templates/query/reader.in-memory.ts.tpl +1 -1
  720. package/templates/repository/drizzle/repository.ts.tpl +4 -3
  721. package/templates/repository/knex/table.tpl +1 -1
  722. package/templates/repository/prisma/repository.ts.tpl +24 -18
  723. package/templates/state-machine/state-machine.spec.ts.tpl +5 -0
  724. package/templates/init/platform/database/migration.knex.js.tpl +0 -8
@@ -1,9 +1,16 @@
1
+ import { existsSync } from 'node:fs';
1
2
  import { createRequire } from 'node:module';
2
3
  import process from 'node:process';
3
4
 
4
- // Read by the knex CLI (`npm run db:migrate`, `npm run db:generate <what-it-does>`). The migrations
5
- // call the compiled schema of the application: run `npm run build` first. A new migration is
6
- // `<timestamp>_<what-it-does>.js`, written from the ES module stub of knex: the project is ESM.
5
+ // The knex CLI reads no .env: `npm run db:migrate` finds DATABASE_URL there, and what the shell sets wins.
6
+ if (existsSync('.env')) {
7
+ process.loadEnvFile('.env');
8
+ }
9
+
10
+ // Read by the knex CLI (`npm run db:migrate`) and by `npm run db:generate <what-it-does>`, which
11
+ // writes `<timestamp>_<what-it-does>.js`, its SQL held in the file: a migration calls nothing of the
12
+ // application, so that it builds the same tables whatever the schema becomes. With `--custom`, the
13
+ // file is the ES module stub of knex (the project is ESM), to fill by hand.
7
14
  export default {
8
15
  client: 'pg',
9
16
  connection: process.env.DATABASE_URL,
@@ -1,11 +1,14 @@
1
+ import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
1
2
  import { createClient } from '{{alias.platform}}/database/create-client{{alias.ext}}';
2
3
  import { persistenceOver } from '{{alias.platform}}/database/persistence-over{{alias.ext}}';
3
4
  import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
4
5
 
5
- export async function openPersistence(config: { readonly databaseUrl: string }): Promise<Persistence> {
6
+ export async function openPersistence(
7
+ config: Pick<AppConfig, 'databaseUrl' | 'databaseTransaction'>,
8
+ ): Promise<Persistence> {
6
9
  const client = createClient(config.databaseUrl);
7
10
 
8
11
  await client.$connect();
9
12
 
10
- return persistenceOver(client);
13
+ return persistenceOver(client, config.databaseTransaction);
11
14
  }
@@ -26,6 +26,7 @@ import { createPrismaUnitOfWork, PrismaOutboxStore, PrismaProcessedEventStore }
26
26
  {{/unless}}
27
27
  {{/unless}}
28
28
  import type { PrismaClient } from '{{alias.generated}}/prisma/client{{alias.ext}}';
29
+ import type { AppConfig } from '{{alias.platform}}/config/app-config{{alias.ext}}';
29
30
  import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
30
31
 
31
32
  /** The schema of the messaging tables{{#if queue.processTable}} and of the background work{{/if}}, as prisma/schema/schema.prisma names it. */
@@ -35,9 +36,16 @@ const MESSAGING_SCHEMA = 'messaging';
35
36
  const EVENT_STORE_SCHEMA = 'event_store';
36
37
  {{/if}}
37
38
 
38
- /** One object is the unit of work and what repositories query through; the stores are told how to reach their model. */
39
- export function persistenceOver(client: PrismaClient): Persistence {
40
- const unitOfWork = createPrismaUnitOfWork(client);
39
+ /**
40
+ * One object is the unit of work and what repositories query through; the stores are told how to reach their model.
41
+ * `transaction` bounds the wait and the run of each transaction (`maxWait`, `timeout`); left out, the defaults of
42
+ * Prisma apply (2 and 5 seconds), as in the tests.
43
+ */
44
+ export function persistenceOver(client: PrismaClient, transaction?: AppConfig['databaseTransaction']): Persistence {
45
+ const unitOfWork = createPrismaUnitOfWork(
46
+ client,
47
+ transaction === undefined ? undefined : { maxWait: transaction.waitMs, timeout: transaction.timeoutMs },
48
+ );
41
49
 
42
50
  return {
43
51
  unitOfWork,
@@ -1,5 +1,11 @@
1
+ import { existsSync } from 'node:fs';
1
2
  import { defineConfig } from 'prisma/config';
2
3
 
4
+ // The Prisma CLI reads no .env: `npm run db:migrate` finds DATABASE_URL there, and what the shell sets wins.
5
+ if (existsSync('.env')) {
6
+ process.loadEnvFile('.env');
7
+ }
8
+
3
9
  export default defineConfig({
4
10
  // Every .prisma file of the folder: schema.prisma (the client, the datasource, the platform) and one file per context.
5
11
  schema: './prisma/schema',
@@ -18,9 +18,10 @@ export const AUDIT_SCHEMA = 'audit';
18
18
  {{/if}}
19
19
 
20
20
  /**
21
- * Every table of the application. The first migration (migrations/00000000000000_initial.js) and the
22
- * in-process database of the tests both call it; once a database is shared, a change of an
23
- * existing table goes into a migration of its own (`npm run db:generate <what-it-does>`).
21
+ * Every table of the application: what the in-process database of the tests runs, and what
22
+ * `npm run db:generate <what-it-does>` compares with the migrations, to write the difference into a
23
+ * new one. No migration calls it: a migration holds its SQL, and builds the same tables whatever
24
+ * this function becomes.
24
25
  */
25
26
  export const createTables = async (knex: Knex): Promise<void> => {
26
27
  {{#if tenancy.any}}
@@ -1,7 +1,7 @@
1
1
  import type { Server } from 'node:http';
2
2
  import type { AddressInfo } from 'node:net';
3
3
  import express from 'express';
4
- import { mountExpress, problemErrorHandler } from '@ddd-ts-kit/http/express';
4
+ import { mountExpress, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/express';
5
5
  {{#if rpc.orpc}}
6
6
  import { orpcRouter } from '@ddd-ts-kit/http/orpc';
7
7
  import { RPCHandler } from '@orpc/server/node';
@@ -33,8 +33,8 @@ type Served = Pick<Application, 'routes' | 'boundary' | 'logger'{{#if cache.rate
33
33
  * Serves, in this order: the readiness probe and the limit of each caller (with a Redis protocol
34
34
  * server), the signed file links before any body parser (with a storage the application serves),
35
35
  * the routes of the contexts, then the pages of the contract (with documentation on), and last the
36
- * problem of a request refused before its route: a body that is not JSON or too large, a failed
37
- * middleware.{{#if rpc.orpc}} The same
36
+ * problem of a path no route serves and of a request refused before its route: a body that is not
37
+ * JSON or too large, a failed middleware.{{#if rpc.orpc}} The same
38
38
  * routes are served as oRPC procedures under /rpc, for the typed client of the contract.{{/if}}{{#if rpc.trpc}} The same
39
39
  * routes are served as tRPC procedures under /trpc, for the typed client of the contract.{{/if}}
40
40
  */
@@ -71,7 +71,9 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
71
71
  {{#unless docs.any}}
72
72
  mountExpress(app, served.routes, served.boundary);
73
73
  {{/unless}}
74
- // Instead of the final handler of Express, which answers HTML and writes the error, body included, to stderr.
74
+ // Instead of the final handler of Express, which answers HTML: a path no route serves, then an error, the
75
+ // one written to stderr with the body it quotes.
76
+ app.use(problemNotFoundHandler({ logger: served.logger }));
75
77
  app.use(problemErrorHandler({ logger: served.logger }));
76
78
 
77
79
  const server = await listen(app, config.port);
@@ -138,8 +140,9 @@ function serveProcedures(app: express.Express, served: Served): void {
138
140
  {{/if}}
139
141
 
140
142
  function listen(app: express.Express, port: number): Promise<Server> {
141
- return new Promise<Server>((resolve) => {
142
- const server = app.listen(port, () => resolve(server));
143
+ return new Promise<Server>((resolve, reject) => {
144
+ // Express 5 hands the error of listen to this callback, a port in use among them: the start fails with it.
145
+ const server = app.listen(port, (error) => (error === undefined ? resolve(server) : reject(error)));
143
146
  });
144
147
  }
145
148
 
@@ -1,5 +1,5 @@
1
1
  import Fastify{{#if cache.rateLimit}}, { type FastifyInstance }{{/if}}{{#unless cache.rateLimit}}{{#unless rpc.none}}, { type FastifyInstance }{{/unless}}{{/unless}} from 'fastify';
2
- import { mountFastify, problemErrorHandler } from '@ddd-ts-kit/http/fastify';
2
+ import { mountFastify, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/fastify';
3
3
  {{#if rpc.orpc}}
4
4
  import { orpcRouter } from '@ddd-ts-kit/http/orpc';
5
5
  import { RPCHandler } from '@orpc/server/fastify';
@@ -30,7 +30,8 @@ type Served = Pick<Application, 'routes' | 'boundary' | 'logger'{{#if cache.rate
30
30
  /**
31
31
  * Serves, in this order: the readiness probe and the limit of each caller (with a Redis protocol
32
32
  * server), the signed file links (with a storage the application serves), the routes of the
33
- * contexts, then the pages of the contract (with documentation on).{{#if rpc.orpc}} The same routes are served
33
+ * contexts, then the pages of the contract (with documentation on), and last the problem of a
34
+ * path no route serves.{{#if rpc.orpc}} The same routes are served
34
35
  * as oRPC procedures under /rpc, for the typed client of the contract.{{/if}}{{#if rpc.trpc}} The same routes are served
35
36
  * as tRPC procedures under /trpc, for the typed client of the contract.{{/if}}
36
37
  */
@@ -40,6 +41,8 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
40
41
 
41
42
  // Before any route: a body Fastify refuses and a failed hook are answered as problems, not with their message.
42
43
  app.setErrorHandler(problemErrorHandler({ logger: served.logger }));
44
+ // A path no route serves is answered 404 as a problem, not as `{ message, error, statusCode }`.
45
+ app.setNotFoundHandler(problemNotFoundHandler({ logger: served.logger }));
43
46
 
44
47
  {{#if cache.rateLimit}}
45
48
  answerReadiness(app, served);
@@ -4,7 +4,7 @@ import { serve, type ServerType } from '@hono/node-server';
4
4
  import { getConnInfo } from '@hono/node-server/conninfo';
5
5
  {{/if}}
6
6
  import { Hono } from 'hono';
7
- import { mountHono, problemErrorHandler } from '@ddd-ts-kit/http/hono';
7
+ import { mountHono, problemErrorHandler, problemNotFoundHandler } from '@ddd-ts-kit/http/hono';
8
8
  {{#if rpc.orpc}}
9
9
  import { orpcRouter } from '@ddd-ts-kit/http/orpc';
10
10
  import { RPCHandler } from '@orpc/server/fetch';
@@ -35,7 +35,8 @@ type Served = Pick<Application, 'routes' | 'boundary' | 'logger'{{#if cache.rate
35
35
  /**
36
36
  * Serves, in this order: the readiness probe and the limit of each caller (with a Redis protocol
37
37
  * server), the signed file links (with a storage the application serves), the routes of the
38
- * contexts, then the pages of the contract (with documentation on).{{#if rpc.orpc}} The same routes are served
38
+ * contexts, then the pages of the contract (with documentation on), and last the problem of a
39
+ * path no route serves.{{#if rpc.orpc}} The same routes are served
39
40
  * as oRPC procedures under /rpc, for the typed client of the contract.{{/if}}{{#if rpc.trpc}} The same routes are served
40
41
  * as tRPC procedures under /trpc, for the typed client of the contract.{{/if}}
41
42
  */
@@ -44,6 +45,8 @@ export async function startHttpServer(served: Served, config: AppConfig): Promis
44
45
 
45
46
  // A failed middleware is answered as a problem, not as a text with the error written to stderr.
46
47
  app.onError(problemErrorHandler({ logger: served.logger }));
48
+ // A path no route serves is answered 404 as a problem, not as the text of Hono.
49
+ app.notFound(problemNotFoundHandler({ logger: served.logger }));
47
50
 
48
51
  {{#if cache.rateLimit}}
49
52
  answerReadiness(app, served);
@@ -19,6 +19,9 @@ const extracted: readonly string[] = [
19
19
  */
20
20
  export function jobSettings(environment: Environment, context?: string): Readonly<Record<string, JobSettings>> {
21
21
  const settings: Readonly<Record<string, JobSettings>> = {
22
+ {{#if audit.sql}}
23
+ 'audit.verify': { enabled: environment['JOB_AUDIT_VERIFY_ENABLED'] !== 'false' },
24
+ {{/if}}
22
25
  {{#if audit.archiveByDefault}}
23
26
  'audit.archive': { enabled: environment['JOB_AUDIT_ARCHIVE_ENABLED'] !== 'false' },
24
27
  {{/if}}
@@ -2,6 +2,9 @@
2
2
  import { auditedPersonalDataExport } from '@ddd-ts-kit/audit';
3
3
  {{/if}}
4
4
  import {
5
+ {{#if eventSourcing.on}}
6
+ EventStorePersonalDataExport,
7
+ {{/if}}
5
8
  executionContext,
6
9
  exportDataSubject,
7
10
  {{#if tenancy.any}}
@@ -15,7 +18,7 @@ import type { Platform } from '{{alias.platform}}/composition/platform{{alias.ex
15
18
  import { dataSubjectExports } from '{{alias.platform}}/privacy/data-subject-exports{{alias.ext}}';
16
19
 
17
20
  export interface ExportRequest {
18
- /** The assembled platform: the scope, the clock{{#if audit.on}}, the trail{{/if}} and the exports come from it. */
21
+ /** The assembled platform: the scope, the clock{{#if audit.on}}, the trail{{/if}}{{#if eventSourcing.on}}, the event store{{/if}} and the exports come from it. */
19
22
  readonly platform: Platform;
20
23
  /** Who asks for the export, as typed: the actor of the work{{#if audit.on}}, named by the entry each export writes{{/if}}. */
21
24
  readonly operator: string;
@@ -30,7 +33,7 @@ export interface ExportRequest {
30
33
  /**
31
34
  * The right of access and to portability of one data subject (GDPR articles 15 and 20), in an
32
35
  * execution context of its own (origin `cli`): every record each context declared in
33
- * `data-subject-exports.ts` keeps of the person{{#if tenancy.any}}, in every tenant{{/if}}, gathered into one dated document
36
+ * `data-subject-exports.ts` keeps of the person{{#if eventSourcing.on}}, and every value the event store keeps sealed with the key of the person{{/if}}{{#if tenancy.any}}, in every tenant{{/if}}, gathered into one dated document
34
37
  * of a stable format{{#if audit.on}}; every export writes its entry to the audit trail, the operator, the subject and
35
38
  * the number of records, never the values{{/if}}. A subject that is not an opaque identifier is refused
36
39
  * before anything is read.
@@ -42,10 +45,20 @@ export function runExport(subject: string, request: ExportRequest): Promise<Pers
42
45
  const { trail, onLostRecord } = platform.audit;
43
46
  const source = { scope: platform.scope, clock: platform.clock, ids: platform.ids, onLostRecord };
44
47
  const audited = (port: PersonalDataExport): PersonalDataExport => auditedPersonalDataExport(port, trail, source);
48
+ {{#if eventSourcing.on}}
49
+ const exports = [...dataSubjectExports.map((exported) => exported(platform)), eventStoreExport(platform)].map(audited);
50
+ {{/if}}
51
+ {{#unless eventSourcing.on}}
45
52
  const exports = dataSubjectExports.map((exported) => audited(exported(platform)));
53
+ {{/unless}}
46
54
  {{/if}}
47
55
  {{#unless audit.on}}
56
+ {{#if eventSourcing.on}}
57
+ const exports: readonly PersonalDataExport[] = [...dataSubjectExports.map((exported) => exported(platform)), eventStoreExport(platform)];
58
+ {{/if}}
59
+ {{#unless eventSourcing.on}}
48
60
  const exports: readonly PersonalDataExport[] = dataSubjectExports.map((exported) => exported(platform));
61
+ {{/unless}}
49
62
  {{/unless}}
50
63
 
51
64
  return platform.scope.run(context, () =>
@@ -59,6 +72,15 @@ export function runExport(subject: string, request: ExportRequest): Promise<Pers
59
72
  );
60
73
  }
61
74
 
75
+ {{#if eventSourcing.on}}
76
+ /** What the event store keeps of the person: every value sealed with their key, opened, under `platform.event-store.<event type>`. Empty once the key is destroyed. */
77
+ function eventStoreExport(platform: Platform): PersonalDataExport {
78
+ const { events, subjectKeys } = platform.eventSourcing;
79
+
80
+ return new EventStorePersonalDataExport({ name: 'platform.event-store', events, keys: subjectKeys, scope: platform.scope });
81
+ }
82
+
83
+ {{/if}}
62
84
  function operatorActor(id: string): Actor {
63
85
  return { id, type: 'user', roles: [], attributes: {} };
64
86
  }
@@ -4,10 +4,17 @@ import { AuditTrail, auditedPersonalDataExport, logLostRecords } from '@ddd-ts-k
4
4
  import type { Application as Container } from '@ddd-ts-kit/di';
5
5
  import {
6
6
  Clock,
7
+ {{#if eventSourcing.on}}
8
+ EventStore,
9
+ EventStorePersonalDataExport,
10
+ {{/if}}
7
11
  ExecutionScope,
8
12
  {{#if audit.on}}
9
13
  IdGenerator,
10
14
  Logger,
15
+ {{/if}}
16
+ {{#if eventSourcing.on}}
17
+ SubjectKeyStore,
11
18
  {{/if}}
12
19
  executionContext,
13
20
  exportDataSubject,
@@ -36,7 +43,7 @@ export interface ExportRequest {
36
43
  /**
37
44
  * The right of access and to portability of one data subject (GDPR articles 15 and 20), in an
38
45
  * execution context of its own (origin `cli`): every record each context declared in
39
- * `data-subject-exports.ts` keeps of the person{{#if tenancy.any}}, in every tenant{{/if}}, gathered into one dated document
46
+ * `data-subject-exports.ts` keeps of the person{{#if eventSourcing.on}}, and every value the event store keeps sealed with the key of the person{{/if}}{{#if tenancy.any}}, in every tenant{{/if}}, gathered into one dated document
40
47
  * of a stable format{{#if audit.on}}; every export writes its entry to the audit trail, the operator, the subject and
41
48
  * the number of records, never the values{{/if}}. A subject that is not an opaque identifier is refused
42
49
  * before anything is read.
@@ -51,10 +58,20 @@ export function runExport(subject: string, request: ExportRequest): Promise<Pers
51
58
  const onLostRecord = logLostRecords(container.resolve(Logger));
52
59
  const source = { scope, clock, ids: container.resolve(IdGenerator), onLostRecord };
53
60
  const audited = (port: PersonalDataExport): PersonalDataExport => auditedPersonalDataExport(port, trail, source);
61
+ {{#if eventSourcing.on}}
62
+ const exports = [...dataSubjectExports.map((port) => container.resolve(port)), eventStoreExport(container)].map(audited);
63
+ {{/if}}
64
+ {{#unless eventSourcing.on}}
54
65
  const exports = dataSubjectExports.map((port) => audited(container.resolve(port)));
66
+ {{/unless}}
55
67
  {{/if}}
56
68
  {{#unless audit.on}}
69
+ {{#if eventSourcing.on}}
70
+ const exports: readonly PersonalDataExport[] = [...dataSubjectExports.map((port) => container.resolve(port)), eventStoreExport(container)];
71
+ {{/if}}
72
+ {{#unless eventSourcing.on}}
57
73
  const exports: readonly PersonalDataExport[] = dataSubjectExports.map((port) => container.resolve(port));
74
+ {{/unless}}
58
75
  {{/unless}}
59
76
 
60
77
  return scope.run(context, () =>
@@ -68,6 +85,18 @@ export function runExport(subject: string, request: ExportRequest): Promise<Pers
68
85
  );
69
86
  }
70
87
 
88
+ {{#if eventSourcing.on}}
89
+ /** What the event store keeps of the person: every value sealed with their key, opened, under `platform.event-store.<event type>`. Empty once the key is destroyed. */
90
+ function eventStoreExport(container: Container): PersonalDataExport {
91
+ return new EventStorePersonalDataExport({
92
+ name: 'platform.event-store',
93
+ events: container.resolve(EventStore),
94
+ keys: container.resolve(SubjectKeyStore),
95
+ scope: container.resolve(ExecutionScope),
96
+ });
97
+ }
98
+
99
+ {{/if}}
71
100
  function operatorActor(id: string): Actor {
72
101
  return { id, type: 'user', roles: [], attributes: {} };
73
102
  }
@@ -0,0 +1,35 @@
1
+ import { verifyTrail } from '@ddd-ts-kit/audit';
2
+ import { createAuditTrail } from '{{alias.platform}}/audit/create-audit-trail{{alias.ext}}';
3
+ import { loadConfig } from '{{alias.platform}}/config/load-config{{alias.ext}}';
4
+ import { openPersistence } from '{{alias.platform}}/database/open-persistence{{alias.ext}}';
5
+ {{#if audit.archive}}
6
+ import { openFiles } from '{{alias.platform}}/files/open-files{{alias.ext}}';
7
+ {{/if}}
8
+
9
+ // The verification of the audit trail, from the command line, as the job `audit.verify` runs it
10
+ // every night:
11
+ // npm run audit:verify
12
+ // Every chain, from its last archive to its head: an entry changed, removed, reordered or cut from
13
+ // the end of its chain is a break, reported with its chain and its sequence, and the exit code is 1.
14
+ {{#if audit.archive}}
15
+ // Every archive of each chain is read back from the storage and proved against its row first, then the
16
+ // entries left in the database are verified from the anchor of the last (docs/concepts/audit-trail.md of ddd-ts-kit).
17
+ const config = loadConfig(process.env);
18
+ const persistence = {{persistence.await}}openPersistence(config);
19
+
20
+ try {
21
+ const verification = await verifyTrail(createAuditTrail(persistence), { files: openFiles(config.files) });
22
+ {{/if}}
23
+ {{#unless audit.archive}}
24
+ // The entries left in the database are verified from the genesis of each chain (docs/concepts/audit-trail.md of ddd-ts-kit).
25
+ const persistence = {{persistence.await}}openPersistence(loadConfig(process.env));
26
+
27
+ try {
28
+ const verification = await verifyTrail(createAuditTrail(persistence));
29
+ {{/unless}}
30
+
31
+ console.log(JSON.stringify(verification, null, 2));
32
+ process.exitCode = verification.valid ? 0 : 1;
33
+ } finally {
34
+ await persistence.close();
35
+ }
@@ -20,16 +20,10 @@ import { runExport } from '{{alias.platform}}/privacy/run-export{{alias.ext}}';
20
20
  // npm run privacy:export -- <subject-id> [--operator <who-asks>] > export.json
21
21
  // One JSON document on the standard output (`format`, `subject`, `exportedAt`, `records`): every
22
22
  // record each context declared in src/platform/privacy/data-subject-exports.ts keeps of the
23
- // person{{#if tenancy.any}}, in each tenant the tenant directory lists (TENANTS, or the organisations of the identity context){{/if}}, as plain data. Hand it over to the person, then delete
23
+ // person{{#if eventSourcing.on}}, and every value the event store keeps sealed with the key of the person (`platform.event-store.<event type>`){{/if}}{{#if tenancy.any}}, in each tenant the tenant directory lists (TENANTS, or the organisations of the identity context){{/if}}, as plain data. Hand it over to the person, then delete
24
24
  // the file{{#if audit.on}}; the audit trail keeps the entry of each export, never the values. Every run is a
25
25
  // handover and leaves its entry, a trial included: try it on a test subject, never on a real person{{/if}}.
26
- {{#if eventSourcing.on}}
27
- // What this script cannot reach: the stored events (read them through the aggregate), backups,
28
- // logs and the copies no context declared.
29
- {{/if}}
30
- {{#unless eventSourcing.on}}
31
26
  // What this script cannot reach: backups, logs and the copies no context declared.
32
- {{/unless}}
33
27
  const { positionals, values } = parseArgs({
34
28
  allowPositionals: true,
35
29
  options: { operator: { type: 'string', default: os.userInfo().username } },
@@ -20,16 +20,10 @@ import { runExport } from '{{alias.platform}}/privacy/run-export{{alias.ext}}';
20
20
  // npm run privacy:export -- <subject-id> [--operator <who-asks>] > export.json
21
21
  // One JSON document on the standard output (`format`, `subject`, `exportedAt`, `records`): every
22
22
  // record each context declared in src/platform/privacy/data-subject-exports.ts keeps of the
23
- // person{{#if tenancy.any}}, in each tenant the tenant directory lists (TENANTS, or the organisations of the identity context){{/if}}, as plain data. Hand it over to the person, then delete
23
+ // person{{#if eventSourcing.on}}, and every value the event store keeps sealed with the key of the person (`platform.event-store.<event type>`){{/if}}{{#if tenancy.any}}, in each tenant the tenant directory lists (TENANTS, or the organisations of the identity context){{/if}}, as plain data. Hand it over to the person, then delete
24
24
  // the file{{#if audit.on}}; the audit trail keeps the entry of each export, never the values. Every run is a
25
25
  // handover and leaves its entry, a trial included: try it on a test subject, never on a real person{{/if}}.
26
- {{#if eventSourcing.on}}
27
- // What this script cannot reach: the stored events (read them through the aggregate), backups,
28
- // logs and the copies no context declared.
29
- {{/if}}
30
- {{#unless eventSourcing.on}}
31
26
  // What this script cannot reach: backups, logs and the copies no context declared.
32
- {{/unless}}
33
27
  const { positionals, values } = parseArgs({
34
28
  allowPositionals: true,
35
29
  options: { operator: { type: 'string', default: os.userInfo().username } },
@@ -5,6 +5,8 @@ updates:
5
5
  schedule:
6
6
  interval: weekly
7
7
  day: monday
8
+ cooldown:
9
+ default-days: 7
8
10
  open-pull-requests-limit: 5
9
11
  ignore:
10
12
  # typescript-eslint and dependency-cruiser need the TypeScript 6 API; the native
@@ -49,6 +51,8 @@ updates:
49
51
  schedule:
50
52
  interval: weekly
51
53
  day: monday
54
+ cooldown:
55
+ default-days: 7
52
56
  commit-message:
53
57
  prefix: ci
54
58
  groups:
@@ -59,6 +63,8 @@ updates:
59
63
  schedule:
60
64
  interval: weekly
61
65
  day: monday
66
+ cooldown:
67
+ default-days: 7
62
68
  commit-message:
63
69
  prefix: chore
64
70
  include: scope
@@ -29,6 +29,7 @@ jobs:
29
29
  steps:
30
30
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
31
  with:
32
+ persist-credentials: false
32
33
  # A pull request is checked out as its merge commit, whose first parent is the base it is compared with.
33
34
  fetch-depth: 2
34
35
  - uses: ./.github/actions/setup
@@ -45,6 +46,8 @@ jobs:
45
46
  timeout-minutes: 10
46
47
  steps:
47
48
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
49
+ with:
50
+ persist-credentials: false
48
51
  - uses: ./.github/actions/setup
49
52
  - run: npm run ci:typecheck
50
53
 
@@ -55,6 +58,8 @@ jobs:
55
58
  timeout-minutes: 10
56
59
  steps:
57
60
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
61
+ with:
62
+ persist-credentials: false
58
63
  - uses: ./.github/actions/setup
59
64
  # The cache of ESLint (`ddd-ts-kit lint` keys it by the content of each file): a pull request restores the one the
60
65
  # default branch wrote last for this lockfile and this config, and lints the files that changed since; the default
@@ -85,6 +90,8 @@ jobs:
85
90
  timeout-minutes: 10
86
91
  steps:
87
92
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
93
+ with:
94
+ persist-credentials: false
88
95
  - uses: ./.github/actions/setup
89
96
  - name: Architecture rules
90
97
  run: npm run ci:arch:check -- --format github
@@ -98,6 +105,8 @@ jobs:
98
105
  timeout-minutes: 10
99
106
  steps:
100
107
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
108
+ with:
109
+ persist-credentials: false
101
110
  - uses: ./.github/actions/setup
102
111
  - run: npm run ci:deadcode
103
112
 
@@ -108,6 +117,8 @@ jobs:
108
117
  timeout-minutes: 15
109
118
  steps:
110
119
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
120
+ with:
121
+ persist-credentials: false
111
122
  - uses: ./.github/actions/setup
112
123
  - name: Unit specs, each context held to its coverage thresholds
113
124
  if: ${{ needs.install.outputs.scope != 'none' }}
@@ -132,6 +143,8 @@ jobs:
132
143
  DATABASE_URL: postgres://app:app@localhost:5432/app
133
144
  steps:
134
145
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
146
+ with:
147
+ persist-credentials: false
135
148
  - uses: ./.github/actions/setup
136
149
  - name: PostgreSQL
137
150
  if: ${{ needs.install.outputs.scope != 'none' }}
@@ -154,6 +167,8 @@ jobs:
154
167
  DATABASE_URL: postgres://app:app@localhost:5432/app
155
168
  steps:
156
169
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
170
+ with:
171
+ persist-credentials: false
157
172
  - uses: ./.github/actions/setup
158
173
  - name: PostgreSQL
159
174
  if: ${{ needs.install.outputs.scope != 'none' }}
@@ -171,6 +186,8 @@ jobs:
171
186
  timeout-minutes: 10
172
187
  steps:
173
188
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
189
+ with:
190
+ persist-credentials: false
174
191
  - uses: ./.github/actions/setup
175
192
  - name: The production build
176
193
  run: npm run ci:build
@@ -185,6 +202,7 @@ jobs:
185
202
  steps:
186
203
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
187
204
  with:
205
+ persist-credentials: false
188
206
  fetch-depth: 0
189
207
  - uses: ./.github/actions/setup
190
208
  - name: Production dependencies audit
@@ -208,6 +226,8 @@ jobs:
208
226
  timeout-minutes: 20
209
227
  steps:
210
228
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
229
+ with:
230
+ persist-credentials: false
211
231
  - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
212
232
  - uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
213
233
  with:
@@ -226,6 +246,8 @@ jobs:
226
246
  timeout-minutes: 60
227
247
  steps:
228
248
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
249
+ with:
250
+ persist-credentials: false
229
251
  - uses: ./.github/actions/setup
230
252
  - name: Stryker on the domain and application layers of every context, each layer held to its "mutation" floor of ddd-ts-kit.config.json
231
253
  run: npm run test:mutation
@@ -247,6 +269,7 @@ jobs:
247
269
  steps:
248
270
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
249
271
  with:
272
+ persist-credentials: false
250
273
  # The whole history: the files of the change are those since its merge base with the base branch.
251
274
  fetch-depth: 0
252
275
  - uses: ./.github/actions/setup
@@ -259,9 +282,11 @@ jobs:
259
282
  # The night runs without a base and writes no incremental file: its json report is the same object, which Stryker reads back.
260
283
  if [ -f reports/mutation/mutation.json ]; then cp reports/mutation/mutation.json reports/mutation/incremental.json; fi
261
284
  - name: Stryker on what the change touches, then the survivors of its files
285
+ env:
286
+ BASE_REF: ${{ github.base_ref }}
262
287
  run: |
263
288
  mkdir -p reports/mutation
264
- base=$(git merge-base "origin/${{ github.base_ref }}" HEAD)
289
+ base=$(git merge-base "origin/$BASE_REF" HEAD)
265
290
  DDD_TS_KIT_MUTATION_SINCE="$base" npm run --silent test:mutation | tee reports/mutation/changed.txt
266
291
  { echo '```'; cat reports/mutation/changed.txt; echo '```'; } >> "$GITHUB_STEP_SUMMARY"
267
292
 
@@ -6,7 +6,8 @@ name: Claude review
6
6
  # API tokens on every run. The model is reached with ANTHROPIC_API_KEY, a secret of the repository,
7
7
  # or through Amazon Bedrock, Google Vertex AI or Microsoft Foundry: uncomment the matching input
8
8
  # below and add the credential step of the provider before the action, as its documentation
9
- # (docs/cloud-providers.md of anthropics/claude-code-action) shows.
9
+ # (docs/cloud-providers.md of anthropics/claude-code-action) shows; a provider reached with an
10
+ # identity token needs `id-token: write` in the permissions of the job, which holds none otherwise.
10
11
  on:
11
12
  pull_request:
12
13
  types: [opened, ready_for_review, synchronize]
@@ -31,10 +32,10 @@ jobs:
31
32
  contents: read
32
33
  pull-requests: write
33
34
  issues: write
34
- id-token: write
35
35
  steps:
36
36
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
37
37
  with:
38
+ persist-credentials: false
38
39
  # The whole history: the diff with the base and the story the branch names.
39
40
  fetch-depth: 0
40
41
  - name: The review policy and the story the branch names, when they exist
@@ -29,10 +29,10 @@ jobs:
29
29
  actions: read
30
30
  pull-requests: write
31
31
  issues: write
32
- id-token: write
33
32
  steps:
34
33
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
35
34
  with:
35
+ persist-credentials: false
36
36
  ref: ${{ github.event.workflow_run.head_sha }}
37
37
  - name: The names and the logs of the failed jobs, bounded
38
38
  env:
@@ -25,6 +25,8 @@ jobs:
25
25
  security-events: write
26
26
  steps:
27
27
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28
+ with:
29
+ persist-credentials: false
28
30
  - uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
29
31
  with:
30
32
  languages: javascript-typescript
@@ -23,4 +23,6 @@ jobs:
23
23
  contents: read
24
24
  steps:
25
25
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26
+ with:
27
+ persist-credentials: false
26
28
  - uses: ./.github/actions/setup