ddd-ts-kit 0.87.0 → 0.89.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 (1029) hide show
  1. package/CHANGELOG.md +616 -0
  2. package/README.fr.md +79 -38
  3. package/README.md +74 -35
  4. package/dist/check/canonical/earlier-context-file.d.ts +15 -0
  5. package/dist/check/canonical/earlier-context-file.d.ts.map +1 -0
  6. package/dist/check/canonical/earlier-context-file.js +33 -0
  7. package/dist/check/canonical/earlier-context-file.js.map +1 -0
  8. package/dist/check/canonical/roles.d.ts.map +1 -1
  9. package/dist/check/canonical/roles.js +4 -1
  10. package/dist/check/canonical/roles.js.map +1 -1
  11. package/dist/check/canonical/stray-entry.d.ts.map +1 -1
  12. package/dist/check/canonical/stray-entry.js +11 -9
  13. package/dist/check/canonical/stray-entry.js.map +1 -1
  14. package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
  15. package/dist/check/catalogue/architecture-rules.js +12 -0
  16. package/dist/check/catalogue/architecture-rules.js.map +1 -1
  17. package/dist/check/catalogue/default-severities.d.ts.map +1 -1
  18. package/dist/check/catalogue/default-severities.js +9 -0
  19. package/dist/check/catalogue/default-severities.js.map +1 -1
  20. package/dist/check/catalogue/delegated-rules.js +1 -1
  21. package/dist/check/catalogue/delegated-rules.js.map +1 -1
  22. package/dist/check/catalogue/eslint-only-rules.d.ts.map +1 -1
  23. package/dist/check/catalogue/eslint-only-rules.js +24 -0
  24. package/dist/check/catalogue/eslint-only-rules.js.map +1 -1
  25. package/dist/check/configuration/config-inspection.d.ts +2 -2
  26. package/dist/check/configuration/config-inspection.d.ts.map +1 -1
  27. package/dist/check/configuration/config-inspection.js +5 -4
  28. package/dist/check/configuration/config-inspection.js.map +1 -1
  29. package/dist/check/configuration/measure-settings.d.ts +10 -0
  30. package/dist/check/configuration/measure-settings.d.ts.map +1 -0
  31. package/dist/check/configuration/measure-settings.js +17 -0
  32. package/dist/check/configuration/measure-settings.js.map +1 -0
  33. package/dist/check/configuration/module-problems.js +2 -2
  34. package/dist/check/configuration/module-problems.js.map +1 -1
  35. package/dist/check/errors/code-list.d.ts +1 -1
  36. package/dist/check/errors/code-list.d.ts.map +1 -1
  37. package/dist/check/errors/is-codes-file.d.ts +1 -1
  38. package/dist/check/errors/is-codes-file.d.ts.map +1 -1
  39. package/dist/check/errors/is-codes-file.js +1 -1
  40. package/dist/check/errors/is-codes-file.js.map +1 -1
  41. package/dist/check/explain/errors-docs.js +5 -5
  42. package/dist/check/explain/errors-docs.js.map +1 -1
  43. package/dist/check/explain/language-docs.js +1 -1
  44. package/dist/check/explain/language-docs.js.map +1 -1
  45. package/dist/check/explain/module-docs.d.ts.map +1 -1
  46. package/dist/check/explain/module-docs.js +16 -12
  47. package/dist/check/explain/module-docs.js.map +1 -1
  48. package/dist/check/explain/privacy-docs.d.ts +3 -0
  49. package/dist/check/explain/privacy-docs.d.ts.map +1 -0
  50. package/dist/check/explain/privacy-docs.js +52 -0
  51. package/dist/check/explain/privacy-docs.js.map +1 -0
  52. package/dist/check/explain/rule-docs.d.ts.map +1 -1
  53. package/dist/check/explain/rule-docs.js +2 -0
  54. package/dist/check/explain/rule-docs.js.map +1 -1
  55. package/dist/check/explain/tenancy-docs.d.ts.map +1 -1
  56. package/dist/check/explain/tenancy-docs.js +13 -3
  57. package/dist/check/explain/tenancy-docs.js.map +1 -1
  58. package/dist/check/explain/tree-docs.d.ts.map +1 -1
  59. package/dist/check/explain/tree-docs.js +11 -0
  60. package/dist/check/explain/tree-docs.js.map +1 -1
  61. package/dist/check/explain/wiring-docs.js +1 -1
  62. package/dist/check/explain/wiring-docs.js.map +1 -1
  63. package/dist/check/fixtures/authz-granted-fixtures.js +2 -2
  64. package/dist/check/fixtures/authz-granted-fixtures.js.map +1 -1
  65. package/dist/check/fixtures/authz-scope-narrows-fixtures.js +4 -4
  66. package/dist/check/fixtures/authz-scope-narrows-fixtures.js.map +1 -1
  67. package/dist/check/fixtures/budget-fixtures.d.ts +3 -0
  68. package/dist/check/fixtures/budget-fixtures.d.ts.map +1 -0
  69. package/dist/check/fixtures/budget-fixtures.js +43 -0
  70. package/dist/check/fixtures/budget-fixtures.js.map +1 -0
  71. package/dist/check/fixtures/context-file-fixtures.d.ts +4 -0
  72. package/dist/check/fixtures/context-file-fixtures.d.ts.map +1 -0
  73. package/dist/check/fixtures/context-file-fixtures.js +36 -0
  74. package/dist/check/fixtures/context-file-fixtures.js.map +1 -0
  75. package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
  76. package/dist/check/fixtures/declarations-fixtures.js +17 -3
  77. package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
  78. package/dist/check/fixtures/fixtures.d.ts.map +1 -1
  79. package/dist/check/fixtures/fixtures.js +8 -0
  80. package/dist/check/fixtures/fixtures.js.map +1 -1
  81. package/dist/check/fixtures/module-fixtures.d.ts.map +1 -1
  82. package/dist/check/fixtures/module-fixtures.js +50 -17
  83. package/dist/check/fixtures/module-fixtures.js.map +1 -1
  84. package/dist/check/fixtures/mutation-fixtures.d.ts +3 -0
  85. package/dist/check/fixtures/mutation-fixtures.d.ts.map +1 -0
  86. package/dist/check/fixtures/mutation-fixtures.js +81 -0
  87. package/dist/check/fixtures/mutation-fixtures.js.map +1 -0
  88. package/dist/check/fixtures/named-refusal-fixtures.js +5 -5
  89. package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -1
  90. package/dist/check/fixtures/privacy-fixtures.d.ts +3 -0
  91. package/dist/check/fixtures/privacy-fixtures.d.ts.map +1 -0
  92. package/dist/check/fixtures/privacy-fixtures.js +198 -0
  93. package/dist/check/fixtures/privacy-fixtures.js.map +1 -0
  94. package/dist/check/fixtures/tenancy-bypass.d.ts +24 -0
  95. package/dist/check/fixtures/tenancy-bypass.d.ts.map +1 -0
  96. package/dist/check/fixtures/tenancy-bypass.js +22 -0
  97. package/dist/check/fixtures/tenancy-bypass.js.map +1 -0
  98. package/dist/check/fixtures/tenancy-config.d.ts +3 -0
  99. package/dist/check/fixtures/tenancy-config.d.ts.map +1 -0
  100. package/dist/check/fixtures/tenancy-config.js +7 -0
  101. package/dist/check/fixtures/tenancy-config.js.map +1 -0
  102. package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
  103. package/dist/check/fixtures/tenancy-fixtures.js +31 -41
  104. package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
  105. package/dist/check/fixtures/tenancy-prisma-fixtures.d.ts +4 -0
  106. package/dist/check/fixtures/tenancy-prisma-fixtures.d.ts.map +1 -0
  107. package/dist/check/fixtures/tenancy-prisma-fixtures.js +73 -0
  108. package/dist/check/fixtures/tenancy-prisma-fixtures.js.map +1 -0
  109. package/dist/check/fixtures/tenancy-typeorm-fixtures.d.ts +4 -0
  110. package/dist/check/fixtures/tenancy-typeorm-fixtures.d.ts.map +1 -0
  111. package/dist/check/fixtures/tenancy-typeorm-fixtures.js +88 -0
  112. package/dist/check/fixtures/tenancy-typeorm-fixtures.js.map +1 -0
  113. package/dist/check/fixtures/vocabulary-fixtures.js +2 -2
  114. package/dist/check/fixtures/vocabulary-fixtures.js.map +1 -1
  115. package/dist/check/mutation/stryker-settings.d.ts +8 -0
  116. package/dist/check/mutation/stryker-settings.d.ts.map +1 -0
  117. package/dist/check/mutation/stryker-settings.js +74 -0
  118. package/dist/check/mutation/stryker-settings.js.map +1 -0
  119. package/dist/check/privacy/column-definitions-in.d.ts +15 -0
  120. package/dist/check/privacy/column-definitions-in.d.ts.map +1 -0
  121. package/dist/check/privacy/column-definitions-in.js +32 -0
  122. package/dist/check/privacy/column-definitions-in.js.map +1 -0
  123. package/dist/check/privacy/declares-name.d.ts +4 -0
  124. package/dist/check/privacy/declares-name.d.ts.map +1 -0
  125. package/dist/check/privacy/declares-name.js +7 -0
  126. package/dist/check/privacy/declares-name.js.map +1 -0
  127. package/dist/check/privacy/personal-declarations-of.d.ts +15 -0
  128. package/dist/check/privacy/personal-declarations-of.d.ts.map +1 -0
  129. package/dist/check/privacy/personal-declarations-of.js +33 -0
  130. package/dist/check/privacy/personal-declarations-of.js.map +1 -0
  131. package/dist/check/privacy/personal-term-of.d.ts +3 -0
  132. package/dist/check/privacy/personal-term-of.d.ts.map +1 -0
  133. package/dist/check/privacy/personal-term-of.js +10 -0
  134. package/dist/check/privacy/personal-term-of.js.map +1 -0
  135. package/dist/check/privacy/personal-vocabulary.d.ts +9 -0
  136. package/dist/check/privacy/personal-vocabulary.d.ts.map +1 -0
  137. package/dist/check/privacy/personal-vocabulary.js +37 -0
  138. package/dist/check/privacy/personal-vocabulary.js.map +1 -0
  139. package/dist/check/privacy/prisma-columns-of.d.ts +17 -0
  140. package/dist/check/privacy/prisma-columns-of.d.ts.map +1 -0
  141. package/dist/check/privacy/prisma-columns-of.js +58 -0
  142. package/dist/check/privacy/prisma-columns-of.js.map +1 -0
  143. package/dist/check/privacy/privacy-judged.d.ts +8 -0
  144. package/dist/check/privacy/privacy-judged.d.ts.map +1 -0
  145. package/dist/check/privacy/privacy-judged.js +9 -0
  146. package/dist/check/privacy/privacy-judged.js.map +1 -0
  147. package/dist/check/privacy/published-events-of.d.ts +29 -0
  148. package/dist/check/privacy/published-events-of.d.ts.map +1 -0
  149. package/dist/check/privacy/published-events-of.js +80 -0
  150. package/dist/check/privacy/published-events-of.js.map +1 -0
  151. package/dist/check/privacy/same-name.d.ts +3 -0
  152. package/dist/check/privacy/same-name.d.ts.map +1 -0
  153. package/dist/check/privacy/same-name.js +6 -0
  154. package/dist/check/privacy/same-name.js.map +1 -0
  155. package/dist/check/privacy/vocabulary-of.d.ts +4 -0
  156. package/dist/check/privacy/vocabulary-of.d.ts.map +1 -0
  157. package/dist/check/privacy/vocabulary-of.js +10 -0
  158. package/dist/check/privacy/vocabulary-of.js.map +1 -0
  159. package/dist/check/privacy/words-of-name.d.ts +3 -0
  160. package/dist/check/privacy/words-of-name.d.ts.map +1 -0
  161. package/dist/check/privacy/words-of-name.js +9 -0
  162. package/dist/check/privacy/words-of-name.js.map +1 -0
  163. package/dist/check/project/locate.d.ts.map +1 -1
  164. package/dist/check/project/locate.js +18 -9
  165. package/dist/check/project/locate.js.map +1 -1
  166. package/dist/check/rules/config-valid.js +1 -1
  167. package/dist/check/rules/config-valid.js.map +1 -1
  168. package/dist/check/rules/declarations-port-adapter-wired.d.ts.map +1 -1
  169. package/dist/check/rules/declarations-port-adapter-wired.js +21 -2
  170. package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -1
  171. package/dist/check/rules/errors-code-listed.js +6 -8
  172. package/dist/check/rules/errors-code-listed.js.map +1 -1
  173. package/dist/check/rules/errors-code-unique.js +2 -2
  174. package/dist/check/rules/errors-code-unique.js.map +1 -1
  175. package/dist/check/rules/errors-known-code.js +2 -2
  176. package/dist/check/rules/errors-known-code.js.map +1 -1
  177. package/dist/check/rules/governance-recorded-deviation.d.ts.map +1 -1
  178. package/dist/check/rules/governance-recorded-deviation.js +20 -2
  179. package/dist/check/rules/governance-recorded-deviation.js.map +1 -1
  180. package/dist/check/rules/language-glossary-term.js +1 -1
  181. package/dist/check/rules/language-glossary-term.js.map +1 -1
  182. package/dist/check/rules/module-complete.d.ts.map +1 -1
  183. package/dist/check/rules/module-complete.js +67 -13
  184. package/dist/check/rules/module-complete.js.map +1 -1
  185. package/dist/check/rules/naming-suffix.d.ts.map +1 -1
  186. package/dist/check/rules/naming-suffix.js +12 -9
  187. package/dist/check/rules/naming-suffix.js.map +1 -1
  188. package/dist/check/rules/privacy-declared-field.d.ts +11 -0
  189. package/dist/check/rules/privacy-declared-field.d.ts.map +1 -0
  190. package/dist/check/rules/privacy-declared-field.js +63 -0
  191. package/dist/check/rules/privacy-declared-field.js.map +1 -0
  192. package/dist/check/rules/privacy-erasure-reaches-copies.d.ts +10 -0
  193. package/dist/check/rules/privacy-erasure-reaches-copies.d.ts.map +1 -0
  194. package/dist/check/rules/privacy-erasure-reaches-copies.js +46 -0
  195. package/dist/check/rules/privacy-erasure-reaches-copies.js.map +1 -0
  196. package/dist/check/rules/privacy-event-payload-declared.d.ts +10 -0
  197. package/dist/check/rules/privacy-event-payload-declared.d.ts.map +1 -0
  198. package/dist/check/rules/privacy-event-payload-declared.js +39 -0
  199. package/dist/check/rules/privacy-event-payload-declared.js.map +1 -0
  200. package/dist/check/rules/privacy-no-personal-data-in-logs.d.ts +12 -0
  201. package/dist/check/rules/privacy-no-personal-data-in-logs.d.ts.map +1 -0
  202. package/dist/check/rules/privacy-no-personal-data-in-logs.js +57 -0
  203. package/dist/check/rules/privacy-no-personal-data-in-logs.js.map +1 -0
  204. package/dist/check/rules/privacy-subject-is-opaque.d.ts +9 -0
  205. package/dist/check/rules/privacy-subject-is-opaque.d.ts.map +1 -0
  206. package/dist/check/rules/privacy-subject-is-opaque.js +50 -0
  207. package/dist/check/rules/privacy-subject-is-opaque.js.map +1 -0
  208. package/dist/check/rules/tenancy-scoped-statement.d.ts.map +1 -1
  209. package/dist/check/rules/tenancy-scoped-statement.js +6 -2
  210. package/dist/check/rules/tenancy-scoped-statement.js.map +1 -1
  211. package/dist/check/rules/test-mutation-governed.d.ts +3 -0
  212. package/dist/check/rules/test-mutation-governed.d.ts.map +1 -0
  213. package/dist/check/rules/test-mutation-governed.js +12 -0
  214. package/dist/check/rules/test-mutation-governed.js.map +1 -0
  215. package/dist/check/rules/tree-closed.d.ts.map +1 -1
  216. package/dist/check/rules/tree-closed.js +8 -1
  217. package/dist/check/rules/tree-closed.js.map +1 -1
  218. package/dist/check/support/path-in-context.d.ts +5 -1
  219. package/dist/check/support/path-in-context.d.ts.map +1 -1
  220. package/dist/check/support/path-in-context.js +12 -3
  221. package/dist/check/support/path-in-context.js.map +1 -1
  222. package/dist/check/tenancy/accessor-uses.d.ts +13 -0
  223. package/dist/check/tenancy/accessor-uses.d.ts.map +1 -0
  224. package/dist/check/tenancy/accessor-uses.js +19 -0
  225. package/dist/check/tenancy/accessor-uses.js.map +1 -0
  226. package/dist/check/tenancy/declaration-of.d.ts +7 -0
  227. package/dist/check/tenancy/declaration-of.d.ts.map +1 -0
  228. package/dist/check/tenancy/declaration-of.js +11 -0
  229. package/dist/check/tenancy/declaration-of.js.map +1 -0
  230. package/dist/check/tenancy/declared-in-arguments.d.ts +13 -0
  231. package/dist/check/tenancy/declared-in-arguments.d.ts.map +1 -0
  232. package/dist/check/tenancy/declared-in-arguments.js +25 -0
  233. package/dist/check/tenancy/declared-in-arguments.js.map +1 -0
  234. package/dist/check/tenancy/declared-with.d.ts +3 -1
  235. package/dist/check/tenancy/declared-with.d.ts.map +1 -1
  236. package/dist/check/tenancy/declared-with.js +4 -3
  237. package/dist/check/tenancy/declared-with.js.map +1 -1
  238. package/dist/check/tenancy/drizzle-unscoped.d.ts.map +1 -1
  239. package/dist/check/tenancy/drizzle-unscoped.js +4 -3
  240. package/dist/check/tenancy/drizzle-unscoped.js.map +1 -1
  241. package/dist/check/tenancy/executor-uses.d.ts +3 -10
  242. package/dist/check/tenancy/executor-uses.d.ts.map +1 -1
  243. package/dist/check/tenancy/executor-uses.js +3 -11
  244. package/dist/check/tenancy/executor-uses.js.map +1 -1
  245. package/dist/check/tenancy/prisma-unscoped.d.ts +7 -0
  246. package/dist/check/tenancy/prisma-unscoped.d.ts.map +1 -0
  247. package/dist/check/tenancy/prisma-unscoped.js +60 -0
  248. package/dist/check/tenancy/prisma-unscoped.js.map +1 -0
  249. package/dist/check/tenancy/typeorm-unscoped.d.ts +7 -0
  250. package/dist/check/tenancy/typeorm-unscoped.d.ts.map +1 -0
  251. package/dist/check/tenancy/typeorm-unscoped.js +103 -0
  252. package/dist/check/tenancy/typeorm-unscoped.js.map +1 -0
  253. package/dist/check/tenancy/unscoped-read-models.js +2 -2
  254. package/dist/check/tenancy/unscoped-read-models.js.map +1 -1
  255. package/dist/commands/context-layout.d.ts +4 -0
  256. package/dist/commands/context-layout.d.ts.map +1 -0
  257. package/dist/commands/context-layout.js +48 -0
  258. package/dist/commands/context-layout.js.map +1 -0
  259. package/dist/commands/docs.d.ts.map +1 -1
  260. package/dist/commands/docs.js +23 -1
  261. package/dist/commands/docs.js.map +1 -1
  262. package/dist/commands/generate.js +11 -3
  263. package/dist/commands/generate.js.map +1 -1
  264. package/dist/commands/init.d.ts.map +1 -1
  265. package/dist/commands/init.js +4 -0
  266. package/dist/commands/init.js.map +1 -1
  267. package/dist/commands/lint.d.ts +3 -2
  268. package/dist/commands/lint.d.ts.map +1 -1
  269. package/dist/commands/lint.js +16 -4
  270. package/dist/commands/lint.js.map +1 -1
  271. package/dist/commands/move-to-module.d.ts.map +1 -1
  272. package/dist/commands/move-to-module.js +2 -0
  273. package/dist/commands/move-to-module.js.map +1 -1
  274. package/dist/commands/mutation.d.ts +14 -0
  275. package/dist/commands/mutation.d.ts.map +1 -0
  276. package/dist/commands/mutation.js +62 -0
  277. package/dist/commands/mutation.js.map +1 -0
  278. package/dist/config/budget-levels.d.ts +3 -0
  279. package/dist/config/budget-levels.d.ts.map +1 -0
  280. package/dist/config/budget-levels.js +3 -0
  281. package/dist/config/budget-levels.js.map +1 -0
  282. package/dist/config/budget-problems.d.ts +10 -0
  283. package/dist/config/budget-problems.d.ts.map +1 -0
  284. package/dist/config/budget-problems.js +61 -0
  285. package/dist/config/budget-problems.js.map +1 -0
  286. package/dist/config/budget.d.ts +10 -0
  287. package/dist/config/budget.d.ts.map +1 -0
  288. package/dist/config/budget.js +2 -0
  289. package/dist/config/budget.js.map +1 -0
  290. package/dist/config/config.d.ts +16 -0
  291. package/dist/config/config.d.ts.map +1 -1
  292. package/dist/config/index.d.ts +7 -1
  293. package/dist/config/index.d.ts.map +1 -1
  294. package/dist/config/index.js +7 -1
  295. package/dist/config/index.js.map +1 -1
  296. package/dist/config/is-duration.d.ts +3 -0
  297. package/dist/config/is-duration.d.ts.map +1 -0
  298. package/dist/config/is-duration.js +5 -0
  299. package/dist/config/is-duration.js.map +1 -0
  300. package/dist/config/is-reference-budget.d.ts +4 -0
  301. package/dist/config/is-reference-budget.d.ts.map +1 -0
  302. package/dist/config/is-reference-budget.js +8 -0
  303. package/dist/config/is-reference-budget.js.map +1 -0
  304. package/dist/config/is-reference-mutation.d.ts +4 -0
  305. package/dist/config/is-reference-mutation.d.ts.map +1 -0
  306. package/dist/config/is-reference-mutation.js +7 -0
  307. package/dist/config/is-reference-mutation.js.map +1 -0
  308. package/dist/config/mutation-layers.d.ts +3 -0
  309. package/dist/config/mutation-layers.d.ts.map +1 -0
  310. package/dist/config/mutation-layers.js +3 -0
  311. package/dist/config/mutation-layers.js.map +1 -0
  312. package/dist/config/mutation-problems.d.ts +10 -0
  313. package/dist/config/mutation-problems.d.ts.map +1 -0
  314. package/dist/config/mutation-problems.js +46 -0
  315. package/dist/config/mutation-problems.js.map +1 -0
  316. package/dist/config/mutation.d.ts +4 -0
  317. package/dist/config/mutation.d.ts.map +1 -0
  318. package/dist/config/mutation.js +2 -0
  319. package/dist/config/mutation.js.map +1 -0
  320. package/dist/config/parse-budget.d.ts +4 -0
  321. package/dist/config/parse-budget.d.ts.map +1 -0
  322. package/dist/config/parse-budget.js +17 -0
  323. package/dist/config/parse-budget.js.map +1 -0
  324. package/dist/config/parse-config.d.ts.map +1 -1
  325. package/dist/config/parse-config.js +6 -0
  326. package/dist/config/parse-config.js.map +1 -1
  327. package/dist/config/parse-mutation.d.ts +4 -0
  328. package/dist/config/parse-mutation.d.ts.map +1 -0
  329. package/dist/config/parse-mutation.js +16 -0
  330. package/dist/config/parse-mutation.js.map +1 -0
  331. package/dist/config/parse-privacy.d.ts +4 -0
  332. package/dist/config/parse-privacy.d.ts.map +1 -0
  333. package/dist/config/parse-privacy.js +12 -0
  334. package/dist/config/parse-privacy.js.map +1 -0
  335. package/dist/config/parse-stack.d.ts.map +1 -1
  336. package/dist/config/parse-stack.js +4 -1
  337. package/dist/config/parse-stack.js.map +1 -1
  338. package/dist/config/reference-budget.d.ts +8 -0
  339. package/dist/config/reference-budget.d.ts.map +1 -0
  340. package/dist/config/reference-budget.js +7 -0
  341. package/dist/config/reference-budget.js.map +1 -0
  342. package/dist/config/reference-mutation.d.ts +10 -0
  343. package/dist/config/reference-mutation.d.ts.map +1 -0
  344. package/dist/config/reference-mutation.js +9 -0
  345. package/dist/config/reference-mutation.js.map +1 -0
  346. package/dist/config/serialize-config.d.ts.map +1 -1
  347. package/dist/config/serialize-config.js +13 -1
  348. package/dist/config/serialize-config.js.map +1 -1
  349. package/dist/config/stack.d.ts +18 -1
  350. package/dist/config/stack.d.ts.map +1 -1
  351. package/dist/config/stack.js +2 -0
  352. package/dist/config/stack.js.map +1 -1
  353. package/dist/context-files/context-file-at.d.ts +7 -0
  354. package/dist/context-files/context-file-at.d.ts.map +1 -0
  355. package/dist/context-files/context-file-at.js +9 -0
  356. package/dist/context-files/context-file-at.js.map +1 -0
  357. package/dist/context-files/context-file-placement.d.ts +8 -0
  358. package/dist/context-files/context-file-placement.d.ts.map +1 -0
  359. package/dist/context-files/context-file-placement.js +23 -0
  360. package/dist/context-files/context-file-placement.js.map +1 -0
  361. package/dist/context-files/context-file.d.ts +16 -0
  362. package/dist/context-files/context-file.d.ts.map +1 -0
  363. package/dist/context-files/context-file.js +12 -0
  364. package/dist/context-files/context-file.js.map +1 -0
  365. package/dist/context-files/earlier-place-of.d.ts +7 -0
  366. package/dist/context-files/earlier-place-of.d.ts.map +1 -0
  367. package/dist/context-files/earlier-place-of.js +10 -0
  368. package/dist/context-files/earlier-place-of.js.map +1 -0
  369. package/dist/context-files/index.d.ts +5 -0
  370. package/dist/context-files/index.d.ts.map +1 -0
  371. package/dist/context-files/index.js +5 -0
  372. package/dist/context-files/index.js.map +1 -0
  373. package/dist/context-layout/context-layout.d.ts +19 -0
  374. package/dist/context-layout/context-layout.d.ts.map +1 -0
  375. package/dist/context-layout/context-layout.js +55 -0
  376. package/dist/context-layout/context-layout.js.map +1 -0
  377. package/dist/context-layout/index.d.ts +2 -0
  378. package/dist/context-layout/index.d.ts.map +1 -0
  379. package/dist/context-layout/index.js +2 -0
  380. package/dist/context-layout/index.js.map +1 -0
  381. package/dist/context-layout/module-moves.d.ts +21 -0
  382. package/dist/context-layout/module-moves.d.ts.map +1 -0
  383. package/dist/context-layout/module-moves.js +146 -0
  384. package/dist/context-layout/module-moves.js.map +1 -0
  385. package/dist/controllers/migrate-context.js +20 -15
  386. package/dist/controllers/migrate-context.js.map +1 -1
  387. package/dist/controllers/plan-context.d.ts +5 -1
  388. package/dist/controllers/plan-context.d.ts.map +1 -1
  389. package/dist/controllers/plan-context.js +19 -5
  390. package/dist/controllers/plan-context.js.map +1 -1
  391. package/dist/depcruise/layer-rules.js +21 -7
  392. package/dist/depcruise/layer-rules.js.map +1 -1
  393. package/dist/describe/read-adapters.d.ts.map +1 -1
  394. package/dist/describe/read-adapters.js +6 -4
  395. package/dist/describe/read-adapters.js.map +1 -1
  396. package/dist/describe/read-controllers.d.ts.map +1 -1
  397. package/dist/describe/read-controllers.js +5 -3
  398. package/dist/describe/read-controllers.js.map +1 -1
  399. package/dist/describe/read-errors.d.ts +1 -1
  400. package/dist/describe/read-errors.d.ts.map +1 -1
  401. package/dist/describe/read-errors.js +5 -3
  402. package/dist/describe/read-errors.js.map +1 -1
  403. package/dist/describe/read-routes.d.ts.map +1 -1
  404. package/dist/describe/read-routes.js +5 -5
  405. package/dist/describe/read-routes.js.map +1 -1
  406. package/dist/docs/behaviour-page.d.ts +8 -0
  407. package/dist/docs/behaviour-page.d.ts.map +1 -0
  408. package/dist/docs/behaviour-page.js +83 -0
  409. package/dist/docs/behaviour-page.js.map +1 -0
  410. package/dist/docs/context-facts.d.ts +9 -1
  411. package/dist/docs/context-facts.d.ts.map +1 -1
  412. package/dist/docs/counts-of.d.ts +10 -0
  413. package/dist/docs/counts-of.d.ts.map +1 -0
  414. package/dist/docs/counts-of.js +14 -0
  415. package/dist/docs/counts-of.js.map +1 -0
  416. package/dist/docs/declared-table-of.d.ts +14 -0
  417. package/dist/docs/declared-table-of.d.ts.map +1 -0
  418. package/dist/docs/declared-table-of.js +39 -0
  419. package/dist/docs/declared-table-of.js.map +1 -0
  420. package/dist/docs/ensure-personal-data-region.d.ts +7 -0
  421. package/dist/docs/ensure-personal-data-region.d.ts.map +1 -0
  422. package/dist/docs/ensure-personal-data-region.js +21 -0
  423. package/dist/docs/ensure-personal-data-region.js.map +1 -0
  424. package/dist/docs/page-section.d.ts +12 -0
  425. package/dist/docs/page-section.d.ts.map +1 -0
  426. package/dist/docs/page-section.js +2 -0
  427. package/dist/docs/page-section.js.map +1 -0
  428. package/dist/docs/personal-data-lines.d.ts +7 -0
  429. package/dist/docs/personal-data-lines.d.ts.map +1 -0
  430. package/dist/docs/personal-data-lines.js +29 -0
  431. package/dist/docs/personal-data-lines.js.map +1 -0
  432. package/dist/docs/personal-declarations-in.d.ts +13 -0
  433. package/dist/docs/personal-declarations-in.d.ts.map +1 -0
  434. package/dist/docs/personal-declarations-in.js +66 -0
  435. package/dist/docs/personal-declarations-in.js.map +1 -0
  436. package/dist/docs/personal-table-cells.d.ts +12 -0
  437. package/dist/docs/personal-table-cells.d.ts.map +1 -0
  438. package/dist/docs/personal-table-cells.js +13 -0
  439. package/dist/docs/personal-table-cells.js.map +1 -0
  440. package/dist/docs/personal-table-facts.d.ts +17 -0
  441. package/dist/docs/personal-table-facts.d.ts.map +1 -0
  442. package/dist/docs/personal-table-facts.js +2 -0
  443. package/dist/docs/personal-table-facts.js.map +1 -0
  444. package/dist/docs/privacy-register-lines.d.ts +7 -0
  445. package/dist/docs/privacy-register-lines.d.ts.map +1 -0
  446. package/dist/docs/privacy-register-lines.js +34 -0
  447. package/dist/docs/privacy-register-lines.js.map +1 -0
  448. package/dist/docs/read-context.d.ts.map +1 -1
  449. package/dist/docs/read-context.js +19 -2
  450. package/dist/docs/read-context.js.map +1 -1
  451. package/dist/docs/read-personal-data.d.ts +12 -0
  452. package/dist/docs/read-personal-data.d.ts.map +1 -0
  453. package/dist/docs/read-personal-data.js +22 -0
  454. package/dist/docs/read-personal-data.js.map +1 -0
  455. package/dist/docs/refresh-context-doc.d.ts.map +1 -1
  456. package/dist/docs/refresh-context-doc.js +10 -2
  457. package/dist/docs/refresh-context-doc.js.map +1 -1
  458. package/dist/docs/rules-in.d.ts +25 -0
  459. package/dist/docs/rules-in.d.ts.map +1 -0
  460. package/dist/docs/rules-in.js +83 -0
  461. package/dist/docs/rules-in.js.map +1 -0
  462. package/dist/docs/state-machine-lines.d.ts +1 -1
  463. package/dist/docs/state-machine-lines.d.ts.map +1 -1
  464. package/dist/docs/state-machine-lines.js +6 -2
  465. package/dist/docs/state-machine-lines.js.map +1 -1
  466. package/dist/docs/write-behaviour.d.ts +10 -0
  467. package/dist/docs/write-behaviour.d.ts.map +1 -0
  468. package/dist/docs/write-behaviour.js +97 -0
  469. package/dist/docs/write-behaviour.js.map +1 -0
  470. package/dist/docs/write-docs.d.ts +12 -2
  471. package/dist/docs/write-docs.d.ts.map +1 -1
  472. package/dist/docs/write-docs.js +8 -2
  473. package/dist/docs/write-docs.js.map +1 -1
  474. package/dist/docs/write-privacy-register.d.ts +9 -0
  475. package/dist/docs/write-privacy-register.d.ts.map +1 -0
  476. package/dist/docs/write-privacy-register.js +26 -0
  477. package/dist/docs/write-privacy-register.js.map +1 -0
  478. package/dist/file-moves/file-move.d.ts +6 -0
  479. package/dist/file-moves/file-move.d.ts.map +1 -0
  480. package/dist/file-moves/file-move.js +2 -0
  481. package/dist/file-moves/file-move.js.map +1 -0
  482. package/dist/file-moves/index.d.ts +3 -0
  483. package/dist/file-moves/index.d.ts.map +1 -0
  484. package/dist/file-moves/index.js +2 -0
  485. package/dist/file-moves/index.js.map +1 -0
  486. package/dist/file-moves/move-files.d.ts +15 -0
  487. package/dist/file-moves/move-files.d.ts.map +1 -0
  488. package/dist/file-moves/move-files.js +37 -0
  489. package/dist/file-moves/move-files.js.map +1 -0
  490. package/dist/generate/errors/codes-list.d.ts +1 -1
  491. package/dist/generate/errors/codes-list.d.ts.map +1 -1
  492. package/dist/generate/errors/write-named-refusal.d.ts +1 -1
  493. package/dist/generate/errors/write-named-refusal.d.ts.map +1 -1
  494. package/dist/generate/errors/write-named-refusal.js +3 -2
  495. package/dist/generate/errors/write-named-refusal.js.map +1 -1
  496. package/dist/generate/kind.d.ts +15 -1
  497. package/dist/generate/kind.d.ts.map +1 -1
  498. package/dist/generate/kinds/acceptance-kind.js +5 -1
  499. package/dist/generate/kinds/acceptance-kind.js.map +1 -1
  500. package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
  501. package/dist/generate/kinds/adapter-kind.js +22 -2
  502. package/dist/generate/kinds/adapter-kind.js.map +1 -1
  503. package/dist/generate/kinds/background/spec-family.d.ts +8 -0
  504. package/dist/generate/kinds/background/spec-family.d.ts.map +1 -0
  505. package/dist/generate/kinds/background/spec-family.js +9 -0
  506. package/dist/generate/kinds/background/spec-family.js.map +1 -0
  507. package/dist/generate/kinds/background-job-kind.d.ts.map +1 -1
  508. package/dist/generate/kinds/background-job-kind.js +6 -4
  509. package/dist/generate/kinds/background-job-kind.js.map +1 -1
  510. package/dist/generate/kinds/command-kind.d.ts.map +1 -1
  511. package/dist/generate/kinds/command-kind.js +4 -0
  512. package/dist/generate/kinds/command-kind.js.map +1 -1
  513. package/dist/generate/kinds/erasure-handler-kind.d.ts +3 -0
  514. package/dist/generate/kinds/erasure-handler-kind.d.ts.map +1 -0
  515. package/dist/generate/kinds/erasure-handler-kind.js +46 -0
  516. package/dist/generate/kinds/erasure-handler-kind.js.map +1 -0
  517. package/dist/generate/kinds/error-kind.js +1 -1
  518. package/dist/generate/kinds/error-kind.js.map +1 -1
  519. package/dist/generate/kinds/generate-repository.d.ts +2 -1
  520. package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
  521. package/dist/generate/kinds/generate-repository.js +14 -11
  522. package/dist/generate/kinds/generate-repository.js.map +1 -1
  523. package/dist/generate/kinds/module-kind.js +1 -1
  524. package/dist/generate/kinds/module-kind.js.map +1 -1
  525. package/dist/generate/kinds/personal-data/class-header.d.ts +3 -0
  526. package/dist/generate/kinds/personal-data/class-header.d.ts.map +1 -0
  527. package/dist/generate/kinds/personal-data/class-header.js +7 -0
  528. package/dist/generate/kinds/personal-data/class-header.js.map +1 -0
  529. package/dist/generate/kinds/personal-data/column-lines.d.ts +4 -0
  530. package/dist/generate/kinds/personal-data/column-lines.d.ts.map +1 -0
  531. package/dist/generate/kinds/personal-data/column-lines.js +5 -0
  532. package/dist/generate/kinds/personal-data/column-lines.js.map +1 -0
  533. package/dist/generate/kinds/personal-data/declare-personal-data.d.ts +12 -0
  534. package/dist/generate/kinds/personal-data/declare-personal-data.d.ts.map +1 -0
  535. package/dist/generate/kinds/personal-data/declare-personal-data.js +73 -0
  536. package/dist/generate/kinds/personal-data/declare-personal-data.js.map +1 -0
  537. package/dist/generate/kinds/personal-data/fields-line.d.ts +3 -0
  538. package/dist/generate/kinds/personal-data/fields-line.d.ts.map +1 -0
  539. package/dist/generate/kinds/personal-data/fields-line.js +7 -0
  540. package/dist/generate/kinds/personal-data/fields-line.js.map +1 -0
  541. package/dist/generate/kinds/personal-data/personal-column.d.ts +7 -0
  542. package/dist/generate/kinds/personal-data/personal-column.d.ts.map +1 -0
  543. package/dist/generate/kinds/personal-data/personal-column.js +5 -0
  544. package/dist/generate/kinds/personal-data/personal-column.js.map +1 -0
  545. package/dist/generate/kinds/personal-data/personal-names.d.ts +21 -0
  546. package/dist/generate/kinds/personal-data/personal-names.d.ts.map +1 -0
  547. package/dist/generate/kinds/personal-data/personal-names.js +41 -0
  548. package/dist/generate/kinds/personal-data/personal-names.js.map +1 -0
  549. package/dist/generate/kinds/personal-data/personal-request-of.d.ts +18 -0
  550. package/dist/generate/kinds/personal-data/personal-request-of.d.ts.map +1 -0
  551. package/dist/generate/kinds/personal-data/personal-request-of.js +109 -0
  552. package/dist/generate/kinds/personal-data/personal-request-of.js.map +1 -0
  553. package/dist/generate/kinds/personal-data/personal-vars.d.ts +9 -0
  554. package/dist/generate/kinds/personal-data/personal-vars.d.ts.map +1 -0
  555. package/dist/generate/kinds/personal-data/personal-vars.js +107 -0
  556. package/dist/generate/kinds/personal-data/personal-vars.js.map +1 -0
  557. package/dist/generate/kinds/personal-data/property-of.d.ts +3 -0
  558. package/dist/generate/kinds/personal-data/property-of.d.ts.map +1 -0
  559. package/dist/generate/kinds/personal-data/property-of.js +5 -0
  560. package/dist/generate/kinds/personal-data/property-of.js.map +1 -0
  561. package/dist/generate/kinds/personal-data/row-object.d.ts +3 -0
  562. package/dist/generate/kinds/personal-data/row-object.d.ts.map +1 -0
  563. package/dist/generate/kinds/personal-data/row-object.js +5 -0
  564. package/dist/generate/kinds/personal-data/row-object.js.map +1 -0
  565. package/dist/generate/kinds/port-kind.d.ts.map +1 -1
  566. package/dist/generate/kinds/port-kind.js +3 -1
  567. package/dist/generate/kinds/port-kind.js.map +1 -1
  568. package/dist/generate/kinds/presentation/controller-of.d.ts +1 -1
  569. package/dist/generate/kinds/presentation/controller-of.d.ts.map +1 -1
  570. package/dist/generate/kinds/presentation/controller-of.js +7 -5
  571. package/dist/generate/kinds/presentation/controller-of.js.map +1 -1
  572. package/dist/generate/kinds/process-kind.d.ts.map +1 -1
  573. package/dist/generate/kinds/process-kind.js +5 -3
  574. package/dist/generate/kinds/process-kind.js.map +1 -1
  575. package/dist/generate/kinds/repository-kind.d.ts.map +1 -1
  576. package/dist/generate/kinds/repository-kind.js +6 -3
  577. package/dist/generate/kinds/repository-kind.js.map +1 -1
  578. package/dist/generate/kinds/repository-prefix.d.ts +5 -0
  579. package/dist/generate/kinds/repository-prefix.d.ts.map +1 -0
  580. package/dist/generate/kinds/repository-prefix.js +11 -0
  581. package/dist/generate/kinds/repository-prefix.js.map +1 -0
  582. package/dist/generate/kinds/state-machine/state-machine-vars.js +3 -1
  583. package/dist/generate/kinds/state-machine/state-machine-vars.js.map +1 -1
  584. package/dist/generate/kinds/wire-repository-on-first-use.d.ts +10 -0
  585. package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -0
  586. package/dist/generate/kinds/wire-repository-on-first-use.js +14 -0
  587. package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -0
  588. package/dist/generate/kinds/write-event-sourced-aggregate.d.ts +2 -1
  589. package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
  590. package/dist/generate/kinds/write-event-sourced-aggregate.js +13 -2
  591. package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
  592. package/dist/generate/kinds.d.ts.map +1 -1
  593. package/dist/generate/kinds.js +2 -0
  594. package/dist/generate/kinds.js.map +1 -1
  595. package/dist/generate/permissions-file.d.ts +4 -1
  596. package/dist/generate/permissions-file.d.ts.map +1 -1
  597. package/dist/generate/permissions-file.js +6 -2
  598. package/dist/generate/permissions-file.js.map +1 -1
  599. package/dist/generate/place-context-files.d.ts +9 -0
  600. package/dist/generate/place-context-files.d.ts.map +1 -0
  601. package/dist/generate/place-context-files.js +14 -0
  602. package/dist/generate/place-context-files.js.map +1 -0
  603. package/dist/generate/place-generated-files.d.ts +18 -0
  604. package/dist/generate/place-generated-files.d.ts.map +1 -0
  605. package/dist/generate/{place-in-modules.js → place-generated-files.js} +42 -17
  606. package/dist/generate/place-generated-files.js.map +1 -0
  607. package/dist/generate/refresh-docs.d.ts +2 -1
  608. package/dist/generate/refresh-docs.d.ts.map +1 -1
  609. package/dist/generate/refresh-docs.js +5 -2
  610. package/dist/generate/refresh-docs.js.map +1 -1
  611. package/dist/generate/refuse-earlier-layout.d.ts +9 -0
  612. package/dist/generate/refuse-earlier-layout.d.ts.map +1 -0
  613. package/dist/generate/refuse-earlier-layout.js +15 -0
  614. package/dist/generate/refuse-earlier-layout.js.map +1 -0
  615. package/dist/help/notes.d.ts +1 -1
  616. package/dist/help/notes.d.ts.map +1 -1
  617. package/dist/help/notes.js +40 -9
  618. package/dist/help/notes.js.map +1 -1
  619. package/dist/help/usage.d.ts +1 -1
  620. package/dist/help/usage.d.ts.map +1 -1
  621. package/dist/help/usage.js +5 -3
  622. package/dist/help/usage.js.map +1 -1
  623. package/dist/init/files/event-sourcing-files.d.ts +9 -0
  624. package/dist/init/files/event-sourcing-files.d.ts.map +1 -0
  625. package/dist/init/files/event-sourcing-files.js +18 -0
  626. package/dist/init/files/event-sourcing-files.js.map +1 -0
  627. package/dist/init/files/init-files.d.ts.map +1 -1
  628. package/dist/init/files/init-files.js +4 -0
  629. package/dist/init/files/init-files.js.map +1 -1
  630. package/dist/init/files/platform-files.js +6 -1
  631. package/dist/init/files/platform-files.js.map +1 -1
  632. package/dist/init/files/privacy-files.d.ts +10 -0
  633. package/dist/init/files/privacy-files.d.ts.map +1 -0
  634. package/dist/init/files/privacy-files.js +24 -0
  635. package/dist/init/files/privacy-files.js.map +1 -0
  636. package/dist/init/files/project-files.d.ts.map +1 -1
  637. package/dist/init/files/project-files.js +5 -0
  638. package/dist/init/files/project-files.js.map +1 -1
  639. package/dist/init/files/script-files.d.ts +1 -0
  640. package/dist/init/files/script-files.d.ts.map +1 -1
  641. package/dist/init/files/script-files.js +8 -0
  642. package/dist/init/files/script-files.js.map +1 -1
  643. package/dist/init/knip-vars.d.ts.map +1 -1
  644. package/dist/init/knip-vars.js +1 -0
  645. package/dist/init/knip-vars.js.map +1 -1
  646. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  647. package/dist/init/manifest/database-scripts.js +9 -3
  648. package/dist/init/manifest/database-scripts.js.map +1 -1
  649. package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
  650. package/dist/init/manifest/dependencies-for.js +6 -2
  651. package/dist/init/manifest/dependencies-for.js.map +1 -1
  652. package/dist/init/manifest/scripts-for.js +17 -0
  653. package/dist/init/manifest/scripts-for.js.map +1 -1
  654. package/dist/init/manifest/test-scripts.d.ts.map +1 -1
  655. package/dist/init/manifest/test-scripts.js +3 -0
  656. package/dist/init/manifest/test-scripts.js.map +1 -1
  657. package/dist/init/manifest/versions.d.ts.map +1 -1
  658. package/dist/init/manifest/versions.js +27 -24
  659. package/dist/init/manifest/versions.js.map +1 -1
  660. package/dist/init/rewire-personal-data.d.ts +10 -0
  661. package/dist/init/rewire-personal-data.d.ts.map +1 -0
  662. package/dist/init/rewire-personal-data.js +32 -0
  663. package/dist/init/rewire-personal-data.js.map +1 -0
  664. package/dist/init/run-init.d.ts.map +1 -1
  665. package/dist/init/run-init.js +9 -1
  666. package/dist/init/run-init.js.map +1 -1
  667. package/dist/init/stack/resolve-personal-data.d.ts +10 -0
  668. package/dist/init/stack/resolve-personal-data.d.ts.map +1 -0
  669. package/dist/init/stack/resolve-personal-data.js +22 -0
  670. package/dist/init/stack/resolve-personal-data.js.map +1 -0
  671. package/dist/init/stack/resolve-queue.d.ts +4 -3
  672. package/dist/init/stack/resolve-queue.d.ts.map +1 -1
  673. package/dist/init/stack/resolve-queue.js +4 -6
  674. package/dist/init/stack/resolve-queue.js.map +1 -1
  675. package/dist/init/stack/resolve-stack.d.ts.map +1 -1
  676. package/dist/init/stack/resolve-stack.js +2 -0
  677. package/dist/init/stack/resolve-stack.js.map +1 -1
  678. package/dist/init/stack/resolve-tenancy.d.ts +3 -3
  679. package/dist/init/stack/resolve-tenancy.js +5 -5
  680. package/dist/init/stack/resolve-tenancy.js.map +1 -1
  681. package/dist/init/stack/stack-options.d.ts +4 -0
  682. package/dist/init/stack/stack-options.d.ts.map +1 -1
  683. package/dist/init/write-contracts.d.ts +2 -1
  684. package/dist/init/write-contracts.d.ts.map +1 -1
  685. package/dist/init/write-contracts.js +6 -3
  686. package/dist/init/write-contracts.js.map +1 -1
  687. package/dist/knip/ignore-code-types-where-they-are.d.ts +11 -0
  688. package/dist/knip/ignore-code-types-where-they-are.d.ts.map +1 -0
  689. package/dist/knip/ignore-code-types-where-they-are.js +56 -0
  690. package/dist/knip/ignore-code-types-where-they-are.js.map +1 -0
  691. package/dist/knip/index.d.ts +2 -0
  692. package/dist/knip/index.d.ts.map +1 -0
  693. package/dist/knip/index.js +2 -0
  694. package/dist/knip/index.js.map +1 -0
  695. package/dist/lint/eslint-in-project.d.ts +3 -2
  696. package/dist/lint/eslint-in-project.d.ts.map +1 -1
  697. package/dist/lint/eslint-in-project.js +5 -3
  698. package/dist/lint/eslint-in-project.js.map +1 -1
  699. package/dist/lint/lint-cache-of.d.ts +7 -0
  700. package/dist/lint/lint-cache-of.d.ts.map +1 -0
  701. package/dist/lint/lint-cache-of.js +47 -0
  702. package/dist/lint/lint-cache-of.js.map +1 -0
  703. package/dist/lint/lint-run.d.ts +2 -0
  704. package/dist/lint/lint-run.d.ts.map +1 -1
  705. package/dist/model-modules/index.d.ts +1 -1
  706. package/dist/model-modules/index.d.ts.map +1 -1
  707. package/dist/model-modules/index.js +1 -1
  708. package/dist/model-modules/index.js.map +1 -1
  709. package/dist/model-modules/into-module.d.ts +5 -1
  710. package/dist/model-modules/into-module.d.ts.map +1 -1
  711. package/dist/model-modules/into-module.js +12 -5
  712. package/dist/model-modules/into-module.js.map +1 -1
  713. package/dist/model-modules/is-context-level.d.ts +5 -3
  714. package/dist/model-modules/is-context-level.d.ts.map +1 -1
  715. package/dist/model-modules/is-context-level.js +17 -4
  716. package/dist/model-modules/is-context-level.js.map +1 -1
  717. package/dist/model-modules/module-layers.d.ts +7 -1
  718. package/dist/model-modules/module-layers.d.ts.map +1 -1
  719. package/dist/model-modules/module-layers.js +8 -2
  720. package/dist/model-modules/module-layers.js.map +1 -1
  721. package/dist/model-modules/module-name-flaw.d.ts +2 -2
  722. package/dist/model-modules/module-name-flaw.js +4 -4
  723. package/dist/model-modules/module-name-flaw.js.map +1 -1
  724. package/dist/model-modules/module-placement.d.ts +5 -1
  725. package/dist/model-modules/module-placement.d.ts.map +1 -1
  726. package/dist/model-modules/module-placement.js +47 -18
  727. package/dist/model-modules/module-placement.js.map +1 -1
  728. package/dist/model-modules/module-split.d.ts +9 -5
  729. package/dist/model-modules/module-split.d.ts.map +1 -1
  730. package/dist/model-modules/module-split.js +30 -13
  731. package/dist/model-modules/module-split.js.map +1 -1
  732. package/dist/model-modules/role-directories-of.d.ts.map +1 -1
  733. package/dist/model-modules/role-directories-of.js +6 -1
  734. package/dist/model-modules/role-directories-of.js.map +1 -1
  735. package/dist/model-modules/role-folders-of.d.ts +1 -1
  736. package/dist/model-modules/role-folders-of.d.ts.map +1 -1
  737. package/dist/model-modules/role-folders-of.js +15 -5
  738. package/dist/model-modules/role-folders-of.js.map +1 -1
  739. package/dist/model-modules/role-folders.d.ts +2 -2
  740. package/dist/model-modules/role-folders.js +2 -2
  741. package/dist/move-to-module/module-move.d.ts +2 -4
  742. package/dist/move-to-module/module-move.d.ts.map +1 -1
  743. package/dist/move-to-module/move-to-module.d.ts +2 -6
  744. package/dist/move-to-module/move-to-module.d.ts.map +1 -1
  745. package/dist/move-to-module/move-to-module.js +2 -31
  746. package/dist/move-to-module/move-to-module.js.map +1 -1
  747. package/dist/move-to-module/moves-into-module.d.ts +1 -1
  748. package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
  749. package/dist/move-to-module/moves-into-module.js +25 -6
  750. package/dist/move-to-module/moves-into-module.js.map +1 -1
  751. package/dist/mutation/changed-files.d.ts +7 -0
  752. package/dist/mutation/changed-files.d.ts.map +1 -0
  753. package/dist/mutation/changed-files.js +15 -0
  754. package/dist/mutation/changed-files.js.map +1 -0
  755. package/dist/mutation/format-mutation.d.ts +4 -0
  756. package/dist/mutation/format-mutation.d.ts.map +1 -0
  757. package/dist/mutation/format-mutation.js +29 -0
  758. package/dist/mutation/format-mutation.js.map +1 -0
  759. package/dist/mutation/format-survivors.d.ts +8 -0
  760. package/dist/mutation/format-survivors.d.ts.map +1 -0
  761. package/dist/mutation/format-survivors.js +19 -0
  762. package/dist/mutation/format-survivors.js.map +1 -0
  763. package/dist/mutation/mutation-report-file.d.ts +3 -0
  764. package/dist/mutation/mutation-report-file.d.ts.map +1 -0
  765. package/dist/mutation/mutation-report-file.js +3 -0
  766. package/dist/mutation/mutation-report-file.js.map +1 -0
  767. package/dist/mutation/mutation-scores.d.ts +35 -0
  768. package/dist/mutation/mutation-scores.d.ts.map +1 -0
  769. package/dist/mutation/mutation-scores.js +55 -0
  770. package/dist/mutation/mutation-scores.js.map +1 -0
  771. package/dist/mutation/read-mutation-report.d.ts +16 -0
  772. package/dist/mutation/read-mutation-report.d.ts.map +1 -0
  773. package/dist/mutation/read-mutation-report.js +38 -0
  774. package/dist/mutation/read-mutation-report.js.map +1 -0
  775. package/dist/mutation/survivors.d.ts +19 -0
  776. package/dist/mutation/survivors.d.ts.map +1 -0
  777. package/dist/mutation/survivors.js +24 -0
  778. package/dist/mutation/survivors.js.map +1 -0
  779. package/dist/platform-layout/platform-layout.d.ts +2 -0
  780. package/dist/platform-layout/platform-layout.d.ts.map +1 -1
  781. package/dist/platform-layout/platform-layout.js +2 -0
  782. package/dist/platform-layout/platform-layout.js.map +1 -1
  783. package/dist/presets/apply-preset.js +2 -1
  784. package/dist/presets/apply-preset.js.map +1 -1
  785. package/dist/presets/identity-preset.d.ts.map +1 -1
  786. package/dist/presets/identity-preset.js +17 -1
  787. package/dist/presets/identity-preset.js.map +1 -1
  788. package/dist/presets/preset-files.d.ts.map +1 -1
  789. package/dist/presets/preset-files.js +1 -0
  790. package/dist/presets/preset-files.js.map +1 -1
  791. package/dist/presets/preset-step.d.ts +3 -1
  792. package/dist/presets/preset-step.d.ts.map +1 -1
  793. package/dist/refusals/code-types-pattern.d.ts +4 -0
  794. package/dist/refusals/code-types-pattern.d.ts.map +1 -0
  795. package/dist/refusals/code-types-pattern.js +6 -0
  796. package/dist/refusals/code-types-pattern.js.map +1 -0
  797. package/dist/refusals/ignore-code-types.d.ts +1 -1
  798. package/dist/refusals/ignore-code-types.d.ts.map +1 -1
  799. package/dist/refusals/ignore-code-types.js +3 -2
  800. package/dist/refusals/ignore-code-types.js.map +1 -1
  801. package/dist/refusals/path-from-contexts.d.ts +1 -1
  802. package/dist/refusals/path-from-contexts.js +2 -2
  803. package/dist/refusals/path-from-contexts.js.map +1 -1
  804. package/dist/refusals/with-codes.d.ts +1 -1
  805. package/dist/refusals/with-codes.d.ts.map +1 -1
  806. package/dist/refusals/with-codes.js +1 -1
  807. package/dist/refusals/with-codes.js.map +1 -1
  808. package/dist/refusals/write-refusal-classes.d.ts.map +1 -1
  809. package/dist/refusals/write-refusal-classes.js +4 -2
  810. package/dist/refusals/write-refusal-classes.js.map +1 -1
  811. package/dist/run.d.ts.map +1 -1
  812. package/dist/run.js +4 -0
  813. package/dist/run.js.map +1 -1
  814. package/dist/stack/audit-vars.d.ts +1 -1
  815. package/dist/stack/audit-vars.d.ts.map +1 -1
  816. package/dist/stack/audit-vars.js +26 -8
  817. package/dist/stack/audit-vars.js.map +1 -1
  818. package/dist/stack/stack-vars.d.ts.map +1 -1
  819. package/dist/stack/stack-vars.js +44 -2
  820. package/dist/stack/stack-vars.js.map +1 -1
  821. package/dist/version.d.ts +1 -1
  822. package/dist/version.js +1 -1
  823. package/package.json +4 -2
  824. package/templates/background-job/background-job.spec.buses.ts.tpl +57 -0
  825. package/templates/background-job/wiring.manual.tpl +4 -0
  826. package/templates/command/handler.spec.buses.ts.tpl +1 -1
  827. package/templates/command/handler.spec.tsyringe.ts.tpl +1 -1
  828. package/templates/context/CONTEXT.md.tpl +5 -0
  829. package/templates/context/permission-set.tpl +1 -1
  830. package/templates/context/permissions.spec.ts.tpl +1 -1
  831. package/templates/controller/guard.spec.ts.tpl +2 -2
  832. package/templates/docs/asyncapi.privacy.json.tpl +100 -0
  833. package/templates/docs/event-catalog.privacy.md +18 -0
  834. package/templates/docs/privacy-register.md.tpl +25 -0
  835. package/templates/erasure-handler/erasure-handler.declared.ts.tpl +22 -0
  836. package/templates/erasure-handler/erasure-handler.spec.ts.tpl +36 -0
  837. package/templates/erasure-handler/erasure-handler.ts.tpl +20 -0
  838. package/templates/erasure-handler/wiring.manual.tpl +23 -0
  839. package/templates/erasure-handler/wiring.tsyringe.tpl +6 -0
  840. package/templates/error/refusal.ts.tpl +1 -1
  841. package/templates/file-upload/handler.spec.ts.tpl +1 -1
  842. package/templates/init/README.md.tpl +43 -3
  843. package/templates/init/gitignore.tpl +3 -0
  844. package/templates/init/jest.config.js.tpl +2 -0
  845. package/templates/init/platform/audit/audit.module.tsyringe.ts.tpl +19 -1
  846. package/templates/init/platform/audit/create-audit.ts.tpl +28 -6
  847. package/templates/init/platform/composition/compose-application.manual.ts.tpl +64 -6
  848. package/templates/init/platform/composition/compose-application.tsyringe.ts.tpl +12 -0
  849. package/templates/init/platform/composition/create-platform.manual.ts.tpl +7 -3
  850. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +14 -2
  851. package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +17 -1
  852. package/templates/init/platform/composition/platform-options.manual.ts.tpl +4 -1
  853. package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +36 -0
  854. package/templates/init/platform/composition/platform.manual.ts.tpl +16 -0
  855. package/templates/init/platform/database/open-persistence.memory.ts.tpl +20 -0
  856. package/templates/init/platform/database/open-test-database.prisma.ts.tpl +13 -2
  857. package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +21 -1
  858. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +17 -1
  859. package/templates/init/platform/database/persistence-over.knex.ts.tpl +20 -1
  860. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +21 -0
  861. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +14 -1
  862. package/templates/init/platform/database/persistence.memory.ts.tpl +9 -0
  863. package/templates/init/platform/database/persistence.orm.ts.tpl +9 -1
  864. package/templates/init/platform/database/schema.drizzle.ts.tpl +18 -3
  865. package/templates/init/platform/database/schema.knex.ts.tpl +8 -1
  866. package/templates/init/platform/database/schema.prisma.tpl +131 -1
  867. package/templates/init/platform/database/schema.typeorm.ts.tpl +32 -1
  868. package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +36 -0
  869. package/templates/init/platform/event-sourcing/event-sourcing.module.ts.tpl +22 -0
  870. package/templates/init/platform/jobs/background-jobs.ts.tpl +21 -0
  871. package/templates/init/platform/jobs/create-background-work.ts.tpl +147 -0
  872. package/templates/init/platform/jobs/job-settings.ts.tpl +11 -0
  873. package/templates/init/platform/privacy/data-subject-copies.manual.ts.tpl +14 -0
  874. package/templates/init/platform/privacy/data-subject-copies.tsyringe.ts.tpl +13 -0
  875. package/templates/init/platform/privacy/data-subject-exports.manual.ts.tpl +14 -0
  876. package/templates/init/platform/privacy/data-subject-exports.tsyringe.ts.tpl +13 -0
  877. package/templates/init/platform/privacy/privacy.module.tsyringe.ts.tpl +20 -0
  878. package/templates/init/platform/privacy/run-erasure.manual.ts.tpl +100 -0
  879. package/templates/init/platform/privacy/run-erasure.tsyringe.ts.tpl +104 -0
  880. package/templates/init/platform/privacy/run-export.manual.ts.tpl +64 -0
  881. package/templates/init/platform/privacy/run-export.tsyringe.ts.tpl +71 -0
  882. package/templates/init/platform/privacy/run-purge.manual.ts.tpl +39 -0
  883. package/templates/init/platform/privacy/run-purge.tsyringe.ts.tpl +45 -0
  884. package/templates/init/rules/application.md.tpl +3 -2
  885. package/templates/init/rules/domain.md.tpl +3 -2
  886. package/templates/init/rules/infrastructure.md.tpl +2 -1
  887. package/templates/init/rules/presentation.md.tpl +2 -1
  888. package/templates/init/rules/tests.md.tpl +1 -1
  889. package/templates/init/scripts/events.ts.tpl +12 -0
  890. package/templates/init/scripts/privacy-erase.manual.ts.tpl +78 -0
  891. package/templates/init/scripts/privacy-erase.tsyringe.ts.tpl +78 -0
  892. package/templates/init/scripts/privacy-export.manual.ts.tpl +79 -0
  893. package/templates/init/scripts/privacy-export.tsyringe.ts.tpl +79 -0
  894. package/templates/init/scripts/privacy-purge.manual.ts.tpl +48 -0
  895. package/templates/init/scripts/privacy-purge.tsyringe.ts.tpl +48 -0
  896. package/templates/personal-data/adapter-field.tpl +4 -0
  897. package/templates/personal-data/copies.manual.tpl +4 -0
  898. package/templates/personal-data/copies.tsyringe.tpl +4 -0
  899. package/templates/personal-data/declaration.drizzle.ts.tpl +22 -0
  900. package/templates/personal-data/declaration.knex.ts.tpl +24 -0
  901. package/templates/personal-data/declaration.prisma.ts.tpl +24 -0
  902. package/templates/personal-data/declaration.typeorm.ts.tpl +21 -0
  903. package/templates/personal-data/erasure.drizzle.ts.tpl +43 -0
  904. package/templates/personal-data/erasure.knex.ts.tpl +41 -0
  905. package/templates/personal-data/erasure.prisma.ts.tpl +43 -0
  906. package/templates/personal-data/erasure.typeorm.ts.tpl +41 -0
  907. package/templates/personal-data/export-fake.ts.tpl +24 -0
  908. package/templates/personal-data/export-port.ts.tpl +8 -0
  909. package/templates/personal-data/export.drizzle.ts.tpl +43 -0
  910. package/templates/personal-data/export.knex.ts.tpl +41 -0
  911. package/templates/personal-data/export.prisma.ts.tpl +43 -0
  912. package/templates/personal-data/export.typeorm.ts.tpl +41 -0
  913. package/templates/personal-data/exports.manual.tpl +4 -0
  914. package/templates/personal-data/exports.tsyringe.tpl +4 -0
  915. package/templates/personal-data/fake.ts.tpl +26 -0
  916. package/templates/personal-data/port.ts.tpl +8 -0
  917. package/templates/personal-data/spec.ts.tpl +280 -0
  918. package/templates/personal-data/wiring.tsyringe.tpl +12 -0
  919. package/templates/pipeline/github/workflows/ci.yml.tpl +62 -0
  920. package/templates/pipeline/gitlab/gitlab-ci.yml.tpl +64 -2
  921. package/templates/pipeline/jest.mutation.config.js.tpl +8 -0
  922. package/templates/pipeline/knip.json.tpl +2 -2
  923. package/templates/pipeline/lefthook.yml +6 -0
  924. package/templates/pipeline/package-scripts.json +1 -1
  925. package/templates/pipeline/stryker.config.mjs.tpl +25 -0
  926. package/templates/pipeline/vitest.config.ts.tpl +2 -0
  927. package/templates/pipeline/vitest.mutation.config.ts.tpl +29 -0
  928. package/templates/policy/policy.declared.ts.tpl +1 -1
  929. package/templates/policy/policy.ts.tpl +1 -1
  930. package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +1 -1
  931. package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +1 -1
  932. package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +1 -1
  933. package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +1 -1
  934. package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +1 -1
  935. package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +1 -1
  936. package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +1 -1
  937. package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +1 -1
  938. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +1 -1
  939. package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +1 -1
  940. package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +1 -1
  941. package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +1 -1
  942. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +1 -1
  943. package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +1 -1
  944. package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +1 -1
  945. package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +1 -1
  946. package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +1 -1
  947. package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +1 -1
  948. package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +1 -1
  949. package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +1 -1
  950. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +1 -1
  951. package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +1 -1
  952. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +1 -1
  953. package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +1 -1
  954. package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +1 -1
  955. package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +1 -1
  956. package/templates/presets/identity/context/domain/errors/above-own-role.error.named.ts.tpl +1 -1
  957. package/templates/presets/identity/context/domain/errors/account-already-deactivated.error.named.ts.tpl +1 -1
  958. package/templates/presets/identity/context/domain/errors/already-member.error.named.ts.tpl +1 -1
  959. package/templates/presets/identity/context/domain/errors/deactivated-account.error.named.ts.tpl +1 -1
  960. package/templates/presets/identity/context/domain/errors/delegation-not-active.error.named.ts.tpl +1 -1
  961. package/templates/presets/identity/context/domain/errors/delegation-period-inverted.error.named.ts.tpl +1 -1
  962. package/templates/presets/identity/context/domain/errors/delegation-to-oneself.error.named.ts.tpl +1 -1
  963. package/templates/presets/identity/context/domain/errors/delegation-too-long.error.named.ts.tpl +1 -1
  964. package/templates/presets/identity/context/domain/errors/delegation-with-no-right.error.named.ts.tpl +1 -1
  965. package/templates/presets/identity/context/domain/errors/email-not-verified.error.named.ts.tpl +1 -1
  966. package/templates/presets/identity/context/domain/errors/invalid-display-name.error.named.ts.tpl +1 -1
  967. package/templates/presets/identity/context/domain/errors/invalid-email-address.error.named.ts.tpl +1 -1
  968. package/templates/presets/identity/context/domain/errors/invalid-organisation-name.error.named.ts.tpl +1 -1
  969. package/templates/presets/identity/context/domain/errors/invalid-organisation-slug.error.named.ts.tpl +1 -1
  970. package/templates/presets/identity/context/domain/errors/invitation-expired.error.named.ts.tpl +1 -1
  971. package/templates/presets/identity/context/domain/errors/invitation-not-addressed-to-account.error.named.ts.tpl +1 -1
  972. package/templates/presets/identity/context/domain/errors/invitation-not-pending.error.named.ts.tpl +1 -1
  973. package/templates/presets/identity/context/domain/errors/last-owner.error.named.ts.tpl +1 -1
  974. package/templates/presets/identity/context/domain/errors/not-an-owner.error.named.ts.tpl +1 -1
  975. package/templates/presets/identity/context/domain/errors/organisation-slug-taken.error.named.ts.tpl +1 -1
  976. package/templates/presets/identity/context/domain/errors/own-role.error.named.ts.tpl +1 -1
  977. package/templates/presets/identity/context/domain/errors/right-not-in-role.error.named.ts.tpl +1 -1
  978. package/templates/presets/identity/context/domain/errors/unknown-account.error.named.ts.tpl +1 -1
  979. package/templates/presets/identity/context/domain/errors/unknown-delegation.error.named.ts.tpl +1 -1
  980. package/templates/presets/identity/context/domain/errors/unknown-invitation.error.named.ts.tpl +1 -1
  981. package/templates/presets/identity/context/domain/errors/unknown-member.error.named.ts.tpl +1 -1
  982. package/templates/presets/identity/context/domain/errors/unknown-organisation.error.named.ts.tpl +1 -1
  983. package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.drizzle.ts.tpl +17 -0
  984. package/templates/presets/identity/context/infrastructure/persistence/account.personal-fields.privacy.knex.ts.tpl +19 -0
  985. package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.drizzle.ts.tpl +18 -0
  986. package/templates/presets/identity/context/infrastructure/persistence/invitation.personal-fields.privacy.knex.ts.tpl +20 -0
  987. package/templates/presets/identity/context/test/unit/account-deactivated.integration-handler.spec.ts.tpl +4 -2
  988. package/templates/presets/identity/context/test/unit/deactivate-account.handler.spec.ts.tpl +7 -5
  989. package/templates/presets/identity/context/test/unit/environment-identity-provider-connection.adapter.spec.ts.tpl +7 -3
  990. package/templates/presets/identity/context/test/unit/invite-member.handler.spec.ts.tpl +7 -7
  991. package/templates/presets/identity/context/test/unit/member-joined.integration-handler.spec.ts.tpl +4 -2
  992. package/templates/presets/identity/context/test/unit/member-removed.integration-handler.spec.ts.tpl +5 -3
  993. package/templates/presets/identity/context/test/unit/organisation-opened.integration-handler.spec.ts.tpl +4 -2
  994. package/templates/presets/identity/context/test/unit/revoke-invitation.handler.spec.ts.tpl +7 -5
  995. package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -1
  996. package/templates/process/process.spec.ts.tpl +6 -3
  997. package/templates/process/timeout-job.spec.buses.ts.tpl +42 -0
  998. package/templates/process/timeout-job.wiring.manual.tpl +4 -0
  999. package/templates/query/handler.spec.buses.ts.tpl +1 -1
  1000. package/templates/query/handler.spec.tsyringe.ts.tpl +1 -1
  1001. package/templates/query/search.handler.declared.ts.tpl +1 -1
  1002. package/templates/query/search.handler.spec.buses.ts.tpl +1 -1
  1003. package/templates/query/search.handler.spec.tsyringe.ts.tpl +1 -1
  1004. package/templates/query/search.handler.ts.tpl +1 -1
  1005. package/templates/repository/drizzle/mapper.ts.tpl +10 -0
  1006. package/templates/repository/drizzle/table.tpl +6 -0
  1007. package/templates/repository/knex/mapper.ts.tpl +10 -0
  1008. package/templates/repository/knex/row.ts.tpl +3 -0
  1009. package/templates/repository/knex/table.tpl +3 -0
  1010. package/templates/repository/prisma/mapper.ts.tpl +16 -1
  1011. package/templates/repository/prisma/model.tpl +9 -0
  1012. package/templates/repository/prisma/repository.ts.tpl +55 -0
  1013. package/templates/repository/typeorm/mapper.ts.tpl +10 -0
  1014. package/templates/repository/typeorm/repository.ts.tpl +48 -0
  1015. package/templates/repository/typeorm/row.ts.tpl +9 -1
  1016. package/templates/repository/typeorm/table.tpl +27 -0
  1017. package/templates/value-object/value-object.spec.ts.tpl +1 -0
  1018. package/dist/generate/kinds/background/require-container.d.ts +0 -7
  1019. package/dist/generate/kinds/background/require-container.d.ts.map +0 -1
  1020. package/dist/generate/kinds/background/require-container.js +0 -13
  1021. package/dist/generate/kinds/background/require-container.js.map +0 -1
  1022. package/dist/generate/place-in-modules.d.ts +0 -16
  1023. package/dist/generate/place-in-modules.d.ts.map +0 -1
  1024. package/dist/generate/place-in-modules.js.map +0 -1
  1025. /package/templates/background-job/{background-job.spec.ts.tpl → background-job.spec.tsyringe.ts.tpl} +0 -0
  1026. /package/templates/presets/identity/context/{domain/errors/codes.named.ts.tpl → __context__.codes.named.ts.tpl} +0 -0
  1027. /package/templates/presets/identity/context/{application/authorization/__context__.permissions.ts.tpl → __context__.permissions.ts.tpl} +0 -0
  1028. /package/templates/process/{timeout-job.spec.ts.tpl → timeout-job.spec.tsyringe.ts.tpl} +0 -0
  1029. /package/templates/repository/{wiring.manual.tpl → first-use.wiring.manual.tpl} +0 -0
@@ -0,0 +1,22 @@
1
+ import { dataSubjectErasedV1, type DataSubjectErasedPayload, type IntegrationEvent } from '@ddd-ts-kit/kernel';
2
+ import { IntegrationEventHandler } from '@ddd-ts-kit/kernel/declarations';
3
+ import type { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
4
+
5
+ /**
6
+ * What {{context.kebab}} keeps of a person, erased when the platform announces the erasure of that person
7
+ * (`privacy.data-subject.erased`, published by `npm run privacy:erase` once every copy it reaches is
8
+ * erased): the way a context that runs as a service of its own, or that copied the person from an
9
+ * integration event, erases its copy (GDPR article 19). Delivery is at least once and the erasure is
10
+ * idempotent: a second delivery reaches nothing. In the tenant of the event{{#if tenant.scoped}}, to which every statement
11
+ * of the erasure is confined{{/if}}.
12
+ */
13
+ @IntegrationEventHandler(dataSubjectErasedV1, { consumer: '{{context.kebab}}.data-subject-erased' })
14
+ export class DataSubjectErasedIntegrationHandler {
15
+ static readonly eventType = dataSubjectErasedV1.type;
16
+
17
+ constructor(private readonly erasure: {{personal.names.port}}) {}
18
+
19
+ async handle(event: IntegrationEvent<DataSubjectErasedPayload>): Promise<void> {
20
+ await this.erasure.erase(event.payload.subjectId);
21
+ }
22
+ }
@@ -0,0 +1,36 @@
1
+ import { describe, expect, it } from '{{tests.module}}';
2
+ import { dataSubjectErasedV1 } from '@ddd-ts-kit/kernel';
3
+ import { DataSubjectErasedIntegrationHandler } from '{{alias.context}}/application/integration/handlers/data-subject-erased.integration-handler{{alias.ext}}';
4
+ import { {{personal.names.fake}} } from '{{alias.context}}/test/fakes/{{personal.names.portKebab}}.fake{{alias.ext}}';
5
+
6
+ const at = '2026-01-01T00:00:00.000Z';
7
+
8
+ describe('When the platform announces the erasure of a person', () => {
9
+ it('listens to the type the platform publishes', () => {
10
+ expect(DataSubjectErasedIntegrationHandler.eventType).toBe('privacy.data-subject.erased');
11
+ });
12
+
13
+ it('erases what {{context.kebab}} keeps of that person, and of nobody else', async () => {
14
+ const erasure = new {{personal.names.fake}}().holds('person-1', 2).holds('person-2', 1);
15
+
16
+ await new DataSubjectErasedIntegrationHandler(erasure).handle(erasureOf('person-1'));
17
+
18
+ expect(erasure.erased).toEqual(['person-1']);
19
+ expect(await erasure.erase('person-2')).toBe(1);
20
+ });
21
+
22
+ it('reaches nothing when the same erasure is delivered again: delivery is at least once', async () => {
23
+ const erasure = new {{personal.names.fake}}().holds('person-1', 2);
24
+ const handler = new DataSubjectErasedIntegrationHandler(erasure);
25
+
26
+ await handler.handle(erasureOf('person-1'));
27
+ await handler.handle(erasureOf('person-1'));
28
+
29
+ expect(await erasure.erase('person-1')).toBe(0);
30
+ });
31
+ });
32
+
33
+ /** The erasure of a person as the platform announces it. */
34
+ function erasureOf(subjectId: string, id = 'event-1') {
35
+ return dataSubjectErasedV1.create({ subjectId, erasedAt: at }, { id, occurredAt: at });
36
+ }
@@ -0,0 +1,20 @@
1
+ import { dataSubjectErasedV1, type DataSubjectErasedPayload, type IntegrationEvent } from '@ddd-ts-kit/kernel';
2
+ import type { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
3
+
4
+ /**
5
+ * What {{context.kebab}} keeps of a person, erased when the platform announces the erasure of that person
6
+ * (`privacy.data-subject.erased`, published by `npm run privacy:erase` once every copy it reaches is
7
+ * erased): the way a context that runs as a service of its own, or that copied the person from an
8
+ * integration event, erases its copy (GDPR article 19). Delivery is at least once and the erasure is
9
+ * idempotent: a second delivery reaches nothing. In the tenant of the event{{#if tenant.scoped}}, to which every statement
10
+ * of the erasure is confined{{/if}}.
11
+ */
12
+ export class DataSubjectErasedIntegrationHandler {
13
+ static readonly eventType = dataSubjectErasedV1.type;
14
+
15
+ constructor(private readonly erasure: {{personal.names.port}}) {}
16
+
17
+ async handle(event: IntegrationEvent<DataSubjectErasedPayload>): Promise<void> {
18
+ await this.erasure.erase(event.payload.subjectId);
19
+ }
20
+ }
@@ -0,0 +1,23 @@
1
+ @@imports
2
+ {{#if consumer.transactional}}
3
+ import { consume, subscribeAll } from '@ddd-ts-kit/events';
4
+ {{/if}}
5
+ {{#unless consumer.transactional}}
6
+ import { on, subscribeAll } from '@ddd-ts-kit/events';
7
+ {{/unless}}
8
+ import { dataSubjectErasedV1 } from '@ddd-ts-kit/kernel';
9
+ import { {{personal.names.adapter}} } from '{{alias.context}}/infrastructure/persistence/{{personal.names.adapterKebab}}.repository{{alias.ext}}';
10
+ import { DataSubjectErasedIntegrationHandler } from '{{alias.context}}/application/integration/handlers/data-subject-erased.integration-handler{{alias.ext}}';
11
+ @@registrations
12
+ const dataSubjectErasedIntegrationHandler = new DataSubjectErasedIntegrationHandler(platform.adapter(new {{personal.names.adapter}}(platform.persistence.database{{#if tenant.scoped}}, platform.scope{{/if}}), { kind: 'repository', context: '{{context.kebab}}', token: '{{personal.names.port}}' }));
13
+
14
+ {{#if consumer.transactional}}
15
+ subscribeAll({{consumer.subscriber}}, [
16
+ consume(dataSubjectErasedV1, { consumer: '{{context.kebab}}.data-subject-erased', processed: platform.persistence.processedEvents, unitOfWork: platform.persistence.unitOfWork, scope: platform.scope }, (event) => dataSubjectErasedIntegrationHandler.handle(event)),
17
+ ]);
18
+ {{/if}}
19
+ {{#unless consumer.transactional}}
20
+ subscribeAll({{consumer.subscriber}}, [
21
+ on(dataSubjectErasedV1, (event) => dataSubjectErasedIntegrationHandler.handle(event), { consumer: '{{context.kebab}}.data-subject-erased', processed: platform.persistence.processedEvents, scope: platform.scope }),
22
+ ]);
23
+ {{/unless}}
@@ -0,0 +1,6 @@
1
+ @@imports
2
+ import { dataSubjectErasedV1 } from '@ddd-ts-kit/kernel';
3
+ import { {{personal.names.port}} } from '{{alias.context}}/application/ports/{{personal.names.portKebab}}.port{{alias.ext}}';
4
+ import { DataSubjectErasedIntegrationHandler } from '{{alias.context}}/application/integration/handlers/data-subject-erased.integration-handler{{alias.ext}}';
5
+ @@registrations
6
+ builder.on(dataSubjectErasedV1, { consumer: '{{context.kebab}}.data-subject-erased' }).handledBy(DataSubjectErasedIntegrationHandler, [{{personal.names.port}}]);
@@ -1,5 +1,5 @@
1
1
  import { DomainRefusal } from '@ddd-ts-kit/kernel';
2
- import { {{codes.list}} } from '{{alias.context}}/domain/errors/codes{{alias.ext}}';
2
+ import { {{codes.list}} } from '{{alias.context}}/{{context.kebab}}.codes{{alias.ext}}';
3
3
 
4
4
  export class {{name.pascal}} extends DomainRefusal {
5
5
  readonly code = {{codes.list}}.{{name.pascal}};
@@ -14,7 +14,7 @@ import {
14
14
  } from '@ddd-ts-kit/kernel';
15
15
  import { createTestBuses } from '@ddd-ts-kit/testing';
16
16
  {{#if access.protected}}
17
- import { {{context.camel}}Permissions } from '{{alias.context}}/application/authorization/{{context.kebab}}.permissions{{alias.ext}}';
17
+ import { {{context.camel}}Permissions } from '{{alias.context}}/{{context.kebab}}.permissions{{alias.ext}}';
18
18
  {{/if}}
19
19
  import { {{name.pascal}}Command } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.command{{alias.ext}}';
20
20
  import { {{name.pascal}}Handler } from '{{alias.context}}/application/commands/{{name.kebab}}/{{name.kebab}}.handler{{alias.ext}}';
@@ -245,6 +245,44 @@ the port, and the DSN the logs print then names it. This instance is for local d
245
245
  its secret key, its `DEBUG` mode and its account are public.
246
246
  {{/if}}
247
247
 
248
+ {{#if privacy.on}}
249
+ ## Personal data
250
+
251
+ {{#if eventSourcing.on}}
252
+ The stored events of an event-sourced aggregate seal each personal value with the key of its data
253
+ subject (`personalData(subject, value)` in the codec); `{{config.platformDir}}/event-sourcing/` holds
254
+ those keys and the cipher{{#if audit.on}}, and every erasure leaves a dated entry in the audit trail{{/if}}. A context that keeps a
255
+ copy of a person in clear (a row, a contact, a note) declares it next to its mapper with
256
+ {{/if}}
257
+ {{#unless eventSourcing.on}}
258
+ A context that keeps a copy of a person in clear (a row, a contact, a note) declares it next to its
259
+ mapper with
260
+ {{/unless}}
261
+ `personalFields` of `@ddd-ts-kit/kernel`, erases it through a port that extends
262
+ `PersonalDataErasure`, listed in `{{config.platformDir}}/privacy/data-subject-copies.ts`, and hands it
263
+ over through a port that extends `PersonalDataExport`, listed in `data-subject-exports.ts`;
264
+ `npx ddd-ts-kit generate repository <context> <Aggregate> --personal <column>,...` writes the
265
+ columns, the declaration and, once per context, both ports, their adapters, their fakes, their spec
266
+ and their lines here. Two scripts answer the requests of a person, on the sources, with the
267
+ variables of `.env`:
268
+
269
+ ```bash
270
+ npm run privacy:erase -- <subject-id> --operator <who-asks> # {{#if eventSourcing.on}}the key, then {{/if}}every declared copy{{#if tenancy.any}}, in each tenant of TENANTS{{/if}}
271
+ npm run privacy:export -- <subject-id> > export.json # one dated document of every declared record{{#if audit.on}}, audited{{/if}}
272
+ npm run privacy:purge # what outlived its retention, as the nightly job does
273
+ ```
274
+
275
+ A declaration with `retention` (`generate repository ... --retention ended_at:36m`) is purged every night at
276
+ 03:00 UTC by the job `privacy.purge-expired`{{#if audit.on}}, each purge recorded in the audit trail{{/if}}; `JOB_PRIVACY_PURGE_EXPIRED_ENABLED=false`
277
+ switches it off in one environment. How long is your decision: write it in your register with its reason.
278
+
279
+ Running an erasure again completes one that failed half way.{{#if audit.on}} Every run of either script is
280
+ recorded in the audit trail, a trial included: try them on a test subject, never on a real person.{{/if}}
281
+ Neither script reaches backups, logs, exports or a copy no context declared: say so in your register{{#if eventSourcing.on}}, and keep the keys in a
282
+ store of their own in production, with a shorter backup retention than the events
283
+ (docs/concepts/event-sourcing.md of ddd-ts-kit, "Personal data"){{/if}}.
284
+
285
+ {{/if}}
248
286
  ## Tooling
249
287
 
250
288
  The compiler is the native TypeScript 7, installed under the alias `@typescript/native` and
@@ -274,10 +312,12 @@ declaration that no longer follows `importAlias` and `importExtension` of
274
312
  | structure | `npm run check:arch` | `ddd-ts-kit check` |
275
313
  | import graph | `npm run depcruise` | dependency-cruiser, on `.dependency-cruiser.cjs` (generated from `ddd-ts-kit.config.json`) |
276
314
  | dead code | `npm run deadcode` | knip |
315
+ | mutation score | `npm run test:mutation` | Stryker on the domain and application layers of every context, the texts of their refusals left out, each layer of each context held to its `mutation` floor of `ddd-ts-kit.config.json`; the pipeline runs it every night, and on a pull request lists the survivors of the files the change touched |
277
316
  | drift | `npm run docs:check` | context map, OpenAPI, AsyncAPI, event catalog |
278
317
 
279
318
  `npm run verify` chains them with the tests. Git hooks: `npm run hooks:install` once per clone
280
- (lefthook: lint and architecture on staged files, conventional commit messages).
319
+ (lefthook: lint and architecture on staged files, the pages of what the tests state regenerated when a
320
+ spec is staged, conventional commit messages).
281
321
  {{#if ci.any}}
282
322
  The pipeline calls the same `ci:*` scripts; what makes it binding is described in
283
323
  {{#if ci.github}}
@@ -317,9 +357,9 @@ for each moment of the project: https://github.com/gbourgeat/ddd-ts-kit/blob/mai
317
357
  | Script | Does |
318
358
  |---|---|
319
359
  | `npm run dev` | the application with auto reload |
320
- | `npm test` | domain, application and adapter specs |
360
+ | `npm test` | domain, application and adapter specs, each spec file held to the time budget of its level |
321
361
  | `npm run test:e2e` | the whole application through HTTP, on an in-process database unless `DATABASE_URL` is set |
322
362
  | `npm run check:arch` | `ddd-ts-kit check` |
323
- | `npm run docs:generate` | context map, OpenAPI, AsyncAPI and event catalog{{#if sdk.on}}, the clients under `clients/`{{/if}} |
363
+ | `npm run docs:generate` | context map, OpenAPI, AsyncAPI and event catalog, the pages of what the tests state (`docs/behaviour/`){{#if sdk.on}}, the clients under `clients/`{{/if}} |
324
364
  | `npm run regenerate` | every derived file after a change: `.dependency-cruiser.cjs`, then `docs:generate` |
325
365
  | `npm run verify` | everything CI runs |
@@ -4,7 +4,10 @@ dist
4
4
  .env
5
5
  *.tsbuildinfo
6
6
  .ddd-ts-kit/
7
+ .eslintcache/
7
8
  .worktrees/
9
+ .stryker-tmp/
10
+ /reports/mutation/
8
11
  {{#if orm.prisma}}
9
12
  generated
10
13
  {{/if}}
@@ -8,6 +8,8 @@ export default {
8
8
  {{alias.jestMapper}}
9
9
  },
10
10
  testMatch: ['<rootDir>/{{config.sourceRoot}}/**/*.spec.ts', '<rootDir>/test/architecture/**/*.spec.ts'],
11
+ // Each spec file is held to the time budget of its level ("budget" in ddd-ts-kit.config.json, the reference when it is absent): the slowest named at the end of the run, a file over its budget fails it.
12
+ reporters: ['default', '@ddd-ts-kit/testing/budget/jest'],
11
13
  // A pull request names the contexts its change reaches (DDD_TS_KIT_AFFECTED, from `ddd-ts-kit affected`): the specs of the others are left to the default branch.
12
14
  testPathIgnorePatterns: ['/node_modules/', ...unaffectedContexts().map((directory) => `/${directory}`)],
13
15
  extensionsToTreatAsEsm: ['.ts'],
@@ -1,7 +1,17 @@
1
+ {{#if audit.archive}}
2
+ import { ArchiveAuditEntries, AuditReader, AuditTrail } from '@ddd-ts-kit/audit';
3
+ {{/if}}
4
+ {{#unless audit.archive}}
1
5
  import { AuditReader, AuditTrail } from '@ddd-ts-kit/audit';
6
+ {{/unless}}
2
7
  import { defineContextModule, type ContextModule } from '@ddd-ts-kit/di';
3
8
  import { subscribeAll } from '@ddd-ts-kit/events';
9
+ {{#if audit.archive}}
10
+ import { Clock, EventSubscribers, FileStorage } from '@ddd-ts-kit/kernel';
11
+ {{/if}}
12
+ {{#unless audit.archive}}
4
13
  import { EventSubscribers } from '@ddd-ts-kit/kernel';
14
+ {{/unless}}
5
15
  {{#if audit.route}}
6
16
  import { auditPermissions } from '{{alias.platform}}/audit/audit.permissions{{alias.ext}}';
7
17
  {{/if}}
@@ -15,7 +25,9 @@ import { SearchAuditEntriesQuery } from '{{alias.platform}}/audit/search-audit-e
15
25
  * The audit trail as a capability of the platform, not a bounded context: the store behind its
16
26
  * two ports, the subscription to every declared integration event, under a name of its own{{#if audit.route}}, and
17
27
  * its read side, one protected query registered like any use case so that reading the trail is
18
- * authorized and recorded{{/if}}.
28
+ * authorized and recorded{{/if}}{{#if audit.archive}}; and on the first day of every month at 04:00 UTC,
29
+ * the entries older than the twelve whole months kept online moved to the storage of files,
30
+ * verified and anchored (`audit.archive`){{/if}}.
19
31
  */
20
32
  export function auditModule(audit: Audit): ContextModule {
21
33
  return defineContextModule({
@@ -43,6 +55,12 @@ export function auditModule(audit: Audit): ContextModule {
43
55
  .requires(auditPermissions['trail.read'])
44
56
  .handledBy(SearchAuditEntriesHandler, [AuditReader]);
45
57
  {{/unless}}
58
+ {{/if}}
59
+ {{#if audit.archive}}
60
+
61
+ builder
62
+ .job('audit.archive', { cron: '0 4 1 * *' })
63
+ .handledByFactory((resolve) => new ArchiveAuditEntries(audit.trail, resolve(FileStorage), resolve(Clock)));
46
64
  {{/if}}
47
65
  },
48
66
  onStart({ resolve }) {
@@ -7,6 +7,7 @@ import {
7
7
  auditGuardRefusals,
8
8
  auditIntegrationEvents,
9
9
  auditMiddleware,
10
+ type ArchivableAuditTrail,
10
11
  type AuditReader,
11
12
  type AuditSource,
12
13
  type AuditTrail,
@@ -23,6 +24,7 @@ import {
23
24
  auditGuardRefusals,
24
25
  auditIntegrationEvents,
25
26
  auditMiddleware,
27
+ type ArchivableAuditTrail,
26
28
  type AuditReader,
27
29
  type AuditSource,
28
30
  type AuditTrail,
@@ -35,11 +37,17 @@ import { KnexAuditTrail } from '@ddd-ts-kit/audit/knex';
35
37
  {{#if audit.drizzle}}
36
38
  import { DrizzleAuditTrail } from '@ddd-ts-kit/audit/drizzle';
37
39
  {{/if}}
40
+ {{#if audit.prisma}}
41
+ import { PrismaAuditTrail } from '@ddd-ts-kit/audit/prisma';
42
+ {{/if}}
43
+ {{#if audit.typeorm}}
44
+ import { TypeOrmAuditTrail } from '@ddd-ts-kit/audit/typeorm';
45
+ {{/if}}
38
46
  import type { OnDecision } from '@ddd-ts-kit/auth';
39
47
  import type { EventSubscription } from '@ddd-ts-kit/events';
40
48
  import type { BusMiddleware } from '@ddd-ts-kit/kernel';
41
49
  import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
42
- {{#if audit.sql}}
50
+ {{#if audit.schemaFile}}
43
51
  import { AUDIT_SCHEMA } from '{{alias.platform}}/database/schema{{alias.ext}}';
44
52
  {{/if}}
45
53
  {{#if audit.route}}
@@ -59,7 +67,8 @@ const consumer = 'audit';
59
67
  * each one carries the correlation id, the actor and the tenant of the execution scope.
60
68
  */
61
69
  export interface Audit {
62
- readonly trail: AuditTrail & AuditReader;
70
+ /** The store of the entries: written by the three sources, searched, its oldest entries archived. */
71
+ readonly trail: AuditTrail & AuditReader & ArchivableAuditTrail;
63
72
  {{#if tenancy.any}}
64
73
  /**
65
74
  * The trail as the read side searches it: confined to the tenant of the work in progress,
@@ -118,18 +127,31 @@ export function createAudit(persistence: Persistence, source: AuditSource): Audi
118
127
  }
119
128
 
120
129
  {{#if audit.knex}}
121
- function createAuditTrail(persistence: Persistence): AuditTrail & AuditReader {
130
+ function createAuditTrail(persistence: Persistence): AuditTrail & AuditReader & ArchivableAuditTrail {
122
131
  return new KnexAuditTrail(persistence.database, { schema: AUDIT_SCHEMA });
123
132
  }
124
133
  {{/if}}
125
134
  {{#if audit.drizzle}}
126
- function createAuditTrail(persistence: Persistence): AuditTrail & AuditReader {
135
+ function createAuditTrail(persistence: Persistence): AuditTrail & AuditReader & ArchivableAuditTrail {
127
136
  return new DrizzleAuditTrail(persistence.database, { schema: AUDIT_SCHEMA });
128
137
  }
129
138
  {{/if}}
139
+ {{#if audit.prisma}}
140
+ /** The schema the models of the trail declare in prisma/schema.prisma (`@@schema("audit")`). */
141
+ const AUDIT_SCHEMA = 'audit';
142
+
143
+ function createAuditTrail(persistence: Persistence): AuditTrail & AuditReader & ArchivableAuditTrail {
144
+ return new PrismaAuditTrail(persistence.database, { schema: AUDIT_SCHEMA });
145
+ }
146
+ {{/if}}
147
+ {{#if audit.typeorm}}
148
+ function createAuditTrail(persistence: Persistence): AuditTrail & AuditReader & ArchivableAuditTrail {
149
+ return new TypeOrmAuditTrail(persistence.database, { schema: AUDIT_SCHEMA });
150
+ }
151
+ {{/if}}
130
152
  {{#if audit.memory}}
131
- // TODO(platform): the audit package stores on knex and drizzle only: write an adapter of AuditTrail and AuditReader for your storage, hold it to `auditTrailContract` of @ddd-ts-kit/audit/testing and answer it here. Until then the entries live in the memory of the process and are lost when it stops.
132
- function createAuditTrail(): AuditTrail & AuditReader {
153
+ // TODO(platform): the audit package stores on the four ORMs only: write an adapter of AuditTrail and AuditReader for your storage, hold it to `auditTrailContract` of @ddd-ts-kit/audit/testing and answer it here. Until then the entries live in the memory of the process and are lost when it stops.
154
+ function createAuditTrail(): AuditTrail & AuditReader & ArchivableAuditTrail {
133
155
  return new InMemoryAuditTrail();
134
156
  }
135
157
  {{/if}}
@@ -11,6 +11,9 @@ import { subscribeAll } from '@ddd-ts-kit/events';
11
11
  {{#if http.any}}
12
12
  import { createErrorMapper, defineRoutes, type Route } from '@ddd-ts-kit/http';
13
13
  {{/if}}
14
+ {{#if audit.archive}}
15
+ import { ArchiveAuditEntries } from '@ddd-ts-kit/audit';
16
+ {{/if}}
14
17
  {{#if files.any}}
15
18
  import { PurgeStagedFiles } from '@ddd-ts-kit/kernel';
16
19
  {{/if}}
@@ -42,6 +45,9 @@ import { fileRoutes } from '{{alias.platform}}/files/file-routes{{alias.ext}}';
42
45
  {{/if}}
43
46
  import type { Platform } from '{{alias.platform}}/composition/platform{{alias.ext}}';
44
47
  import type { PlatformOptions } from '{{alias.platform}}/composition/platform-options{{alias.ext}}';
48
+ {{#if privacy.on}}
49
+ import { runPurge } from '{{alias.platform}}/privacy/run-purge{{alias.ext}}';
50
+ {{/if}}
45
51
  // ddd-ts-kit:imports
46
52
  // /ddd-ts-kit:imports
47
53
 
@@ -118,8 +124,8 @@ export function composeApplication(
118
124
  const { logger, metrics, cache, clock } = platform;
119
125
 
120
126
  installAspectRuntime({ logger, metrics, cache, clock });
121
- {{#if files.any}}
122
- purgeStagedFiles(platform);
127
+ {{#if platformJobs.any}}
128
+ registerPlatformJobs(platform);
123
129
  {{/if}}
124
130
 
125
131
  {{#if audit.route}}
@@ -188,7 +194,11 @@ export function composeApplication(
188
194
  };
189
195
  }
190
196
 
191
- /** The consumers first, then the jobs: a job sends commands whose events must find their handlers. */
197
+ /**
198
+ * The consumers first, then the jobs: a job sends commands whose events must find their handlers.
199
+ * The worker of the background jobs runs in the process that runs the jobs{{#if queue.memory}}, and in every
200
+ * process while the queue is kept in its memory: no other process would see what this one enqueues{{/if}}.
201
+ */
192
202
  async function start(platform: Platform, options: ApplicationOptions): Promise<void> {
193
203
  {{#if authz.rebac}}
194
204
  await relateSystemActors();
@@ -207,22 +217,45 @@ async function start(platform: Platform, options: ApplicationOptions): Promise<v
207
217
 
208
218
  if (options.jobs?.start === true) {
209
219
  await platform.jobs.start();
220
+ {{#unless queue.memory}}
221
+ await platform.backgroundJobs.start();
222
+ {{/unless}}
210
223
  }
224
+ {{#if queue.memory}}
225
+
226
+ await platform.backgroundJobs.start();
227
+ {{/if}}
211
228
  }
212
229
 
213
230
  /**
214
- * The jobs first, then the provider{{#if errors.sentry}}; what failed on the way is given two seconds to reach the
215
- * tracker{{/if}}; the logger last, flushed by hand since nothing here does it: whatever logs has closed
216
- * before, and nothing may log after `stop()` returned.
231
+ * The jobs first, the worker next (a job may still enqueue), then the provider{{#if errors.sentry}}; what failed on the
232
+ * way is given two seconds to reach the tracker{{/if}}; the logger last, flushed by hand since nothing here
233
+ * does it: whatever logs has closed before, and nothing may log after `stop()` returned.
217
234
  */
218
235
  async function stop(platform: Platform, options: ApplicationOptions): Promise<void> {
219
236
  await platform.jobs.stop();
237
+ await platform.backgroundJobs.stop();
220
238
  await options.events.close();
221
239
  {{#if errors.sentry}}
222
240
  await platform.errors.flush(2_000);
223
241
  {{/if}}
224
242
  await platform.logger.flush();
225
243
  }
244
+ {{#if platformJobs.any}}
245
+
246
+ /** The jobs of the platform itself, run by the process that runs the jobs. */
247
+ function registerPlatformJobs(platform: Platform): void {
248
+ {{#if files.any}}
249
+ purgeStagedFiles(platform);
250
+ {{/if}}
251
+ {{#if audit.archive}}
252
+ archiveAuditEntries(platform);
253
+ {{/if}}
254
+ {{#if privacy.on}}
255
+ purgeExpiredEveryNight(platform);
256
+ {{/if}}
257
+ }
258
+ {{/if}}
226
259
  {{#if files.any}}
227
260
 
228
261
  /** What rolled-back commands left in `staging/`, removed every hour by the process that runs the jobs. */
@@ -232,3 +265,28 @@ function purgeStagedFiles(platform: Platform): void {
232
265
  platform.jobs.register({ name: 'files.purge-staged', schedule: { every: '1h' }, run: () => purge.run() });
233
266
  }
234
267
  {{/if}}
268
+ {{#if audit.archive}}
269
+
270
+ /**
271
+ * The entries of the audit trail older than the twelve whole months it keeps online, moved to the
272
+ * storage on the first day of every month at 04:00 UTC, verified and anchored.
273
+ */
274
+ function archiveAuditEntries(platform: Platform): void {
275
+ const archive = new ArchiveAuditEntries(platform.audit.trail, platform.files.storage, platform.clock);
276
+
277
+ platform.jobs.register({ name: 'audit.archive', schedule: { cron: '0 4 1 * *' }, run: () => archive.run() });
278
+ }
279
+ {{/if}}
280
+ {{#if privacy.on}}
281
+
282
+ /** What outlived the retention its declaration gives, purged every night at 03:00 UTC by the process that runs the jobs. */
283
+ function purgeExpiredEveryNight(platform: Platform): void {
284
+ platform.jobs.register({
285
+ name: 'privacy.purge-expired',
286
+ schedule: { cron: '0 3 * * *' },
287
+ run: async () => {
288
+ await runPurge(platform);
289
+ },
290
+ });
291
+ }
292
+ {{/if}}
@@ -103,12 +103,18 @@ import { relateSystemActors } from '{{alias.platform}}/auth/relationships/relate
103
103
  import { createCommandBus } from '{{alias.platform}}/buses/create-command-bus{{alias.ext}}';
104
104
  import { createQueryBus } from '{{alias.platform}}/buses/create-query-bus{{alias.ext}}';
105
105
  import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
106
+ {{#if eventSourcing.on}}
107
+ import { eventSourcingModule } from '{{alias.platform}}/event-sourcing/event-sourcing.module{{alias.ext}}';
108
+ {{/if}}
106
109
  {{#if files.http}}
107
110
  import { fileRoutes } from '{{alias.platform}}/files/file-routes{{alias.ext}}';
108
111
  {{/if}}
109
112
  {{#if files.any}}
110
113
  import { filesModule } from '{{alias.platform}}/files/files.module{{alias.ext}}';
111
114
  {{/if}}
115
+ {{#if privacy.on}}
116
+ import { privacyModule } from '{{alias.platform}}/privacy/privacy.module{{alias.ext}}';
117
+ {{/if}}
112
118
  import { layFoundations, type Foundations } from '{{alias.platform}}/composition/lay-foundations{{alias.ext}}';
113
119
  import { platformModule, type PlatformOptions } from '{{alias.platform}}/composition/platform.module{{alias.ext}}';
114
120
  // ddd-ts-kit:imports
@@ -198,12 +204,18 @@ export function composeApplication(
198
204
  modules: [
199
205
  kernel(foundations, persistence, options),
200
206
  platformModule(persistence, options),
207
+ {{#if eventSourcing.on}}
208
+ eventSourcingModule(foundations.eventSourcing),
209
+ {{/if}}
201
210
  guard,
202
211
  {{#if audit.on}}
203
212
  auditModule(foundations.audit),
204
213
  {{/if}}
205
214
  {{#if files.any}}
206
215
  filesModule(options.files ?? new InMemoryFileStorage()),
216
+ {{/if}}
217
+ {{#if privacy.on}}
218
+ privacyModule(),
207
219
  {{/if}}
208
220
  ...contexts.modules,
209
221
  ],
@@ -31,6 +31,7 @@ import { platformEvents } from '{{alias.platform}}/events/platform-events{{alias
31
31
  {{#if files.any}}
32
32
  import { createFiles, type Files } from '{{alias.platform}}/files/create-files{{alias.ext}}';
33
33
  {{/if}}
34
+ import { createBackgroundWork } from '{{alias.platform}}/jobs/create-background-work{{alias.ext}}';
34
35
  import { defaultPolicy } from '{{alias.platform}}/resilience/default-policy{{alias.ext}}';
35
36
  import { defaultResilienceSettings } from '{{alias.platform}}/resilience/default-resilience-settings{{alias.ext}}';
36
37
  import { ownPolicy } from '{{alias.platform}}/resilience/own-policy{{alias.ext}}';
@@ -38,8 +39,8 @@ import type { ResilienceSettings } from '{{alias.platform}}/resilience/resilienc
38
39
 
39
40
  /**
40
41
  * The platform, assembled: the foundations, the domain events, the guard of the use cases, the
41
- * two buses, the event ports{{#if files.any}}, the files{{/if}} and what every adapter is wrapped in. Replacing a provider
42
- * (another broker, another clock) happens here and nowhere else.
42
+ * two buses, the event ports, the background work{{#if files.any}}, the files{{/if}} and what every adapter is wrapped in.
43
+ * Replacing a provider (another broker, another clock) happens here and nowhere else.
43
44
  */
44
45
  export function createPlatform(persistence: Persistence, options: PlatformOptions): Platform {
45
46
  const foundations = layFoundations(persistence, options);
@@ -65,11 +66,14 @@ export function createPlatform(persistence: Persistence, options: PlatformOption
65
66
  {{#if files.any}}
66
67
  const files = filesOf(options, foundations);
67
68
  {{/if}}
69
+ const commands = createCommandBus(foundations, { guard: protection.guard, persistence{{#if files.any}}, files{{/if}}{{#if cache.relaySignal}}, redis: options.redis{{/if}} });
68
70
 
69
71
  return {
70
72
  ...founded,
71
73
  ...platformEvents(persistence, options, foundations),
72
- commands: createCommandBus(foundations, { guard: protection.guard, persistence{{#if files.any}}, files{{/if}}{{#if cache.relaySignal}}, redis: options.redis{{/if}} }),
74
+ // The queue, its worker and the runner of the process managers: a timeout is a command the runner sends on the bus.
75
+ ...createBackgroundWork({ persistence, options, foundations, commands }),
76
+ commands,
73
77
  queries: createQueryBus(foundations, protection.guard),
74
78
  domainEvents,
75
79
  persistence,
@@ -31,11 +31,14 @@ import { logDecisions } from '{{alias.platform}}/auth/authorization/log-decision
31
31
  import type { Platform } from '{{alias.platform}}/composition/platform{{alias.ext}}';
32
32
  import type { PlatformOptions } from '{{alias.platform}}/composition/platform-options{{alias.ext}}';
33
33
  import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
34
+ {{#if eventSourcing.on}}
35
+ import { createEventSourcing } from '{{alias.platform}}/event-sourcing/create-event-sourcing{{alias.ext}}';
36
+ {{/if}}
34
37
  import { ConfiguredJobScheduler } from '{{alias.platform}}/jobs/configured-job-scheduler{{alias.ext}}';
35
38
  import { createLogger } from '{{alias.platform}}/observability/create-logger{{alias.ext}}';
36
39
  import { createMetrics } from '{{alias.platform}}/observability/create-metrics{{alias.ext}}';
37
40
 
38
- type Founded = 'scope' | 'clock' | 'ids' | 'logger' | 'metrics'{{#if errors.sentry}} | 'errors'{{/if}} | 'cache' | 'jobs'{{#if cache.rateLimit}} | 'rateLimiter'{{/if}}{{#if audit.on}} | 'audit'{{/if}};
41
+ {{foundations.founded}}
39
42
 
40
43
  /**
41
44
  * What exists before anything else: one execution scope, one clock and one generator for the
@@ -72,6 +75,9 @@ export function layFoundations(persistence: Persistence, options: PlatformOption
72
75
  // TODO(platform): this lock excludes inside one process only. Before running several instances, give the scheduler a lock between processes (`RedisLock` of @ddd-ts-kit/redis), or each instance runs every job.
73
76
  const lock = new InMemoryLock(clock);
74
77
  {{/unless}}
78
+ {{#if audit.on}}
79
+ const audit = createAudit(persistence, { scope, clock, ids });
80
+ {{/if}}
75
81
 
76
82
  return {
77
83
  traced,
@@ -100,10 +106,16 @@ export function layFoundations(persistence: Persistence, options: PlatformOption
100
106
  jobs: schedulerOf(options, traced, { clock, lock, scope, ids, logger, metrics, onRun: reportFailedRuns(errors) }),
101
107
  {{/if}}
102
108
  {{#if audit.on}}
103
- audit: createAudit(persistence, { scope, clock, ids }),
109
+ audit,
110
+ {{#if eventSourcing.on}}
111
+ eventSourcing: createEventSourcing(persistence, audit, { scope, clock, ids }),
112
+ {{/if}}
104
113
  {{/if}}
105
114
  {{#unless audit.on}}
106
115
  decisions: logDecisions(logger),
116
+ {{#if eventSourcing.on}}
117
+ eventSourcing: createEventSourcing(persistence),
118
+ {{/if}}
107
119
  {{/unless}}
108
120
  };
109
121
  }
@@ -19,6 +19,9 @@ import { createAudit, type Audit } from '{{alias.platform}}/audit/create-audit{{
19
19
  import { logDecisions } from '{{alias.platform}}/auth/authorization/log-decisions{{alias.ext}}';
20
20
  {{/unless}}
21
21
  import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
22
+ {{#if eventSourcing.on}}
23
+ import { createEventSourcing, type EventSourcing } from '{{alias.platform}}/event-sourcing/create-event-sourcing{{alias.ext}}';
24
+ {{/if}}
22
25
  import { createLogger, type LogSettings } from '{{alias.platform}}/observability/create-logger{{alias.ext}}';
23
26
  import { createMetrics } from '{{alias.platform}}/observability/create-metrics{{alias.ext}}';
24
27
 
@@ -42,6 +45,10 @@ export interface Foundations {
42
45
  /** What every authorization decision is told to: the log, since the audit trail is off. */
43
46
  readonly decisions: OnDecision;
44
47
  {{/unless}}
48
+ {{#if eventSourcing.on}}
49
+ /** The event store, the keys of the data subjects{{#if audit.on}}, audited,{{/if}} and the cipher of the personal values of the stored events. */
50
+ readonly eventSourcing: EventSourcing;
51
+ {{/if}}
45
52
  }
46
53
 
47
54
  interface Observed {
@@ -56,6 +63,9 @@ export function layFoundations(persistence: Persistence, options: Observed): Fou
56
63
  const clock = new SystemClock();
57
64
  const ids = new UuidGenerator();
58
65
  const logger = createLogger(scope, options.log);
66
+ {{#if audit.on}}
67
+ const audit = createAudit(persistence, { scope, clock, ids });
68
+ {{/if}}
59
69
 
60
70
  return {
61
71
  scope,
@@ -65,10 +75,16 @@ export function layFoundations(persistence: Persistence, options: Observed): Fou
65
75
  metrics: createMetrics(),
66
76
  traced: traceApplication({ consumers: options.traceConsumers ?? 'continue' }),
67
77
  {{#if audit.on}}
68
- audit: createAudit(persistence, { scope, clock, ids }),
78
+ audit,
79
+ {{#if eventSourcing.on}}
80
+ eventSourcing: createEventSourcing(persistence, audit, { scope, clock, ids }),
81
+ {{/if}}
69
82
  {{/if}}
70
83
  {{#unless audit.on}}
71
84
  decisions: logDecisions(logger),
85
+ {{#if eventSourcing.on}}
86
+ eventSourcing: createEventSourcing(persistence),
87
+ {{/if}}
72
88
  {{/unless}}
73
89
  };
74
90
  }