ddd-ts-kit 0.91.0 → 0.92.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 (399) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/README.fr.md +16 -12
  3. package/README.md +15 -10
  4. package/dist/acceptance/lock-acceptance.d.ts.map +1 -1
  5. package/dist/acceptance/lock-acceptance.js +2 -1
  6. package/dist/acceptance/lock-acceptance.js.map +1 -1
  7. package/dist/check/event-sourcing/read-stored-shape.d.ts +2 -0
  8. package/dist/check/event-sourcing/read-stored-shape.d.ts.map +1 -1
  9. package/dist/check/event-sourcing/read-stored-shape.js +3 -1
  10. package/dist/check/event-sourcing/read-stored-shape.js.map +1 -1
  11. package/dist/check/event-sourcing/stored-event-declaration.d.ts +2 -0
  12. package/dist/check/event-sourcing/stored-event-declaration.d.ts.map +1 -1
  13. package/dist/check/event-sourcing/stored-event-declarations.js +1 -0
  14. package/dist/check/event-sourcing/stored-event-declarations.js.map +1 -1
  15. package/dist/check/event-sourcing/stored-shape.d.ts +2 -0
  16. package/dist/check/event-sourcing/stored-shape.d.ts.map +1 -1
  17. package/dist/check/fixtures/nest-controllers-fixtures.d.ts.map +1 -1
  18. package/dist/check/fixtures/nest-controllers-fixtures.js +21 -3
  19. package/dist/check/fixtures/nest-controllers-fixtures.js.map +1 -1
  20. package/dist/check/nest/nest-equivalents-of.d.ts.map +1 -1
  21. package/dist/check/nest/nest-equivalents-of.js +7 -2
  22. package/dist/check/nest/nest-equivalents-of.js.map +1 -1
  23. package/dist/check/rules/nest-controllers-current.d.ts.map +1 -1
  24. package/dist/check/rules/nest-controllers-current.js +13 -2
  25. package/dist/check/rules/nest-controllers-current.js.map +1 -1
  26. package/dist/commands/docs.d.ts.map +1 -1
  27. package/dist/commands/docs.js +13 -5
  28. package/dist/commands/docs.js.map +1 -1
  29. package/dist/commands/drizzle-generate.d.ts.map +1 -1
  30. package/dist/commands/drizzle-generate.js +21 -1
  31. package/dist/commands/drizzle-generate.js.map +1 -1
  32. package/dist/commands/generate.js +2 -0
  33. package/dist/commands/generate.js.map +1 -1
  34. package/dist/commands/prisma-generate.d.ts +7 -0
  35. package/dist/commands/prisma-generate.d.ts.map +1 -0
  36. package/dist/commands/prisma-generate.js +23 -0
  37. package/dist/commands/prisma-generate.js.map +1 -0
  38. package/dist/commands/typeorm-generate.d.ts +10 -0
  39. package/dist/commands/typeorm-generate.d.ts.map +1 -0
  40. package/dist/commands/typeorm-generate.js +37 -0
  41. package/dist/commands/typeorm-generate.js.map +1 -0
  42. package/dist/config/stack.d.ts +1 -1
  43. package/dist/config/stack.d.ts.map +1 -1
  44. package/dist/config/stack.js +1 -1
  45. package/dist/config/stack.js.map +1 -1
  46. package/dist/describe/guard-errors.d.ts +3 -0
  47. package/dist/describe/guard-errors.d.ts.map +1 -0
  48. package/dist/describe/guard-errors.js +10 -0
  49. package/dist/describe/guard-errors.js.map +1 -0
  50. package/dist/describe/no-group.d.ts +4 -0
  51. package/dist/describe/no-group.d.ts.map +1 -0
  52. package/dist/describe/no-group.js +3 -0
  53. package/dist/describe/no-group.js.map +1 -0
  54. package/dist/describe/read-controllers.d.ts +1 -1
  55. package/dist/describe/read-controllers.d.ts.map +1 -1
  56. package/dist/describe/read-controllers.js +12 -19
  57. package/dist/describe/read-controllers.js.map +1 -1
  58. package/dist/describe/read-nest-controller-routes.d.ts +16 -0
  59. package/dist/describe/read-nest-controller-routes.d.ts.map +1 -0
  60. package/dist/describe/read-nest-controller-routes.js +117 -0
  61. package/dist/describe/read-nest-controller-routes.js.map +1 -0
  62. package/dist/describe/schema-class-of.d.ts +3 -0
  63. package/dist/describe/schema-class-of.d.ts.map +1 -0
  64. package/dist/describe/schema-class-of.js +10 -0
  65. package/dist/describe/schema-class-of.js.map +1 -0
  66. package/dist/docs/declared-stored-events.d.ts +6 -2
  67. package/dist/docs/declared-stored-events.d.ts.map +1 -1
  68. package/dist/docs/declared-stored-events.js +4 -3
  69. package/dist/docs/declared-stored-events.js.map +1 -1
  70. package/dist/docs/emptily-recorded-stored-events.d.ts +6 -0
  71. package/dist/docs/emptily-recorded-stored-events.d.ts.map +1 -0
  72. package/dist/docs/emptily-recorded-stored-events.js +12 -0
  73. package/dist/docs/emptily-recorded-stored-events.js.map +1 -0
  74. package/dist/docs/refuse-unreadable-stored-events.d.ts +7 -0
  75. package/dist/docs/refuse-unreadable-stored-events.d.ts.map +1 -0
  76. package/dist/docs/refuse-unreadable-stored-events.js +27 -0
  77. package/dist/docs/refuse-unreadable-stored-events.js.map +1 -0
  78. package/dist/docs/write-stored-events-lock.d.ts +3 -2
  79. package/dist/docs/write-stored-events-lock.d.ts.map +1 -1
  80. package/dist/docs/write-stored-events-lock.js +5 -2
  81. package/dist/docs/write-stored-events-lock.js.map +1 -1
  82. package/dist/generate/kind.d.ts +2 -0
  83. package/dist/generate/kind.d.ts.map +1 -1
  84. package/dist/generate/kinds/aggregate-kind.d.ts.map +1 -1
  85. package/dist/generate/kinds/aggregate-kind.js +6 -2
  86. package/dist/generate/kinds/aggregate-kind.js.map +1 -1
  87. package/dist/generate/kinds/assert-event-store.d.ts +4 -0
  88. package/dist/generate/kinds/assert-event-store.d.ts.map +1 -0
  89. package/dist/generate/kinds/assert-event-store.js +10 -0
  90. package/dist/generate/kinds/assert-event-store.js.map +1 -0
  91. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts +9 -0
  92. package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -0
  93. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +49 -0
  94. package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -0
  95. package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
  96. package/dist/generate/kinds/file-upload-kind.js +9 -2
  97. package/dist/generate/kinds/file-upload-kind.js.map +1 -1
  98. package/dist/generate/kinds/form-kind.d.ts.map +1 -1
  99. package/dist/generate/kinds/form-kind.js +15 -11
  100. package/dist/generate/kinds/form-kind.js.map +1 -1
  101. package/dist/generate/kinds/generate-event-sourced-repository.d.ts +11 -0
  102. package/dist/generate/kinds/generate-event-sourced-repository.d.ts.map +1 -0
  103. package/dist/generate/kinds/generate-event-sourced-repository.js +48 -0
  104. package/dist/generate/kinds/generate-event-sourced-repository.js.map +1 -0
  105. package/dist/generate/kinds/generate-repository.d.ts.map +1 -1
  106. package/dist/generate/kinds/generate-repository.js +5 -0
  107. package/dist/generate/kinds/generate-repository.js.map +1 -1
  108. package/dist/generate/kinds/is-event-sourced.d.ts +9 -0
  109. package/dist/generate/kinds/is-event-sourced.d.ts.map +1 -0
  110. package/dist/generate/kinds/is-event-sourced.js +11 -0
  111. package/dist/generate/kinds/is-event-sourced.js.map +1 -0
  112. package/dist/generate/kinds/presentation/controller-source.d.ts +11 -3
  113. package/dist/generate/kinds/presentation/controller-source.d.ts.map +1 -1
  114. package/dist/generate/kinds/presentation/controller-source.js +25 -4
  115. package/dist/generate/kinds/presentation/controller-source.js.map +1 -1
  116. package/dist/generate/kinds/repository-kind.js +1 -1
  117. package/dist/generate/kinds/repository-kind.js.map +1 -1
  118. package/dist/generate/kinds/representation-kind.d.ts.map +1 -1
  119. package/dist/generate/kinds/representation-kind.js +4 -3
  120. package/dist/generate/kinds/representation-kind.js.map +1 -1
  121. package/dist/generate/kinds/route/nest-controller-vars.d.ts +2 -2
  122. package/dist/generate/kinds/route/nest-controller-vars.js +3 -9
  123. package/dist/generate/kinds/route/nest-controller-vars.js.map +1 -1
  124. package/dist/generate/kinds/route/nest-search-vars.d.ts +6 -0
  125. package/dist/generate/kinds/route/nest-search-vars.d.ts.map +1 -0
  126. package/dist/generate/kinds/route/nest-search-vars.js +18 -0
  127. package/dist/generate/kinds/route/nest-search-vars.js.map +1 -0
  128. package/dist/generate/kinds/route/write-nest-controller.d.ts.map +1 -1
  129. package/dist/generate/kinds/route/write-nest-controller.js +6 -8
  130. package/dist/generate/kinds/route/write-nest-controller.js.map +1 -1
  131. package/dist/generate/kinds/route-kind.js +1 -1
  132. package/dist/generate/kinds/route-kind.js.map +1 -1
  133. package/dist/generate/kinds/wire-repository-on-first-use.d.ts.map +1 -1
  134. package/dist/generate/kinds/wire-repository-on-first-use.js +2 -1
  135. package/dist/generate/kinds/wire-repository-on-first-use.js.map +1 -1
  136. package/dist/generate/kinds/write-event-sourced-aggregate.d.ts.map +1 -1
  137. package/dist/generate/kinds/write-event-sourced-aggregate.js +5 -13
  138. package/dist/generate/kinds/write-event-sourced-aggregate.js.map +1 -1
  139. package/dist/help/notes.d.ts +1 -1
  140. package/dist/help/notes.d.ts.map +1 -1
  141. package/dist/help/notes.js +3 -1
  142. package/dist/help/notes.js.map +1 -1
  143. package/dist/help/usage.d.ts +1 -1
  144. package/dist/help/usage.d.ts.map +1 -1
  145. package/dist/help/usage.js +3 -1
  146. package/dist/help/usage.js.map +1 -1
  147. package/dist/init/agent-permissions.js +10 -6
  148. package/dist/init/agent-permissions.js.map +1 -1
  149. package/dist/init/files/auth-files.js +4 -0
  150. package/dist/init/files/auth-files.js.map +1 -1
  151. package/dist/init/files/platform-files.js +1 -0
  152. package/dist/init/files/platform-files.js.map +1 -1
  153. package/dist/init/knip-vars.js +4 -3
  154. package/dist/init/knip-vars.js.map +1 -1
  155. package/dist/init/manifest/database-scripts.d.ts.map +1 -1
  156. package/dist/init/manifest/database-scripts.js +10 -4
  157. package/dist/init/manifest/database-scripts.js.map +1 -1
  158. package/dist/init/manifest/dependencies-against-stack.d.ts.map +1 -1
  159. package/dist/init/manifest/dependencies-against-stack.js +5 -1
  160. package/dist/init/manifest/dependencies-against-stack.js.map +1 -1
  161. package/dist/init/manifest/dependencies-for.d.ts.map +1 -1
  162. package/dist/init/manifest/dependencies-for.js +7 -1
  163. package/dist/init/manifest/dependencies-for.js.map +1 -1
  164. package/dist/init/manifest/versions.d.ts.map +1 -1
  165. package/dist/init/manifest/versions.js +34 -30
  166. package/dist/init/manifest/versions.js.map +1 -1
  167. package/dist/init/stack/resolve-stack.js +9 -7
  168. package/dist/init/stack/resolve-stack.js.map +1 -1
  169. package/dist/init/template-vars.js +1 -1
  170. package/dist/init/template-vars.js.map +1 -1
  171. package/dist/init/write-type-script-configs.d.ts.map +1 -1
  172. package/dist/init/write-type-script-configs.js +4 -1
  173. package/dist/init/write-type-script-configs.js.map +1 -1
  174. package/dist/markers/insert-in-region.js +1 -1
  175. package/dist/markers/insert-in-region.js.map +1 -1
  176. package/dist/merge/lost/untouched-by-branch.d.ts +12 -0
  177. package/dist/merge/lost/untouched-by-branch.d.ts.map +1 -0
  178. package/dist/merge/lost/untouched-by-branch.js +22 -0
  179. package/dist/merge/lost/untouched-by-branch.js.map +1 -0
  180. package/dist/merge/lost/verify-merge.d.ts.map +1 -1
  181. package/dist/merge/lost/verify-merge.js +6 -1
  182. package/dist/merge/lost/verify-merge.js.map +1 -1
  183. package/dist/migration/audit-guard/append-audit-guard.d.ts +18 -0
  184. package/dist/migration/audit-guard/append-audit-guard.d.ts.map +1 -0
  185. package/dist/migration/audit-guard/append-audit-guard.js +27 -0
  186. package/dist/migration/audit-guard/append-audit-guard.js.map +1 -0
  187. package/dist/migration/audit-guard/audit-guard-statements-of.d.ts +7 -0
  188. package/dist/migration/audit-guard/audit-guard-statements-of.d.ts.map +1 -0
  189. package/dist/migration/audit-guard/audit-guard-statements-of.js +18 -0
  190. package/dist/migration/audit-guard/audit-guard-statements-of.js.map +1 -0
  191. package/dist/migration/audit-guard/audit-schema-created.d.ts +3 -0
  192. package/dist/migration/audit-guard/audit-schema-created.d.ts.map +1 -0
  193. package/dist/migration/audit-guard/audit-schema-created.js +9 -0
  194. package/dist/migration/audit-guard/audit-schema-created.js.map +1 -0
  195. package/dist/migration/audit-guard/generate-guarded.d.ts +16 -0
  196. package/dist/migration/audit-guard/generate-guarded.d.ts.map +1 -0
  197. package/dist/migration/audit-guard/generate-guarded.js +22 -0
  198. package/dist/migration/audit-guard/generate-guarded.js.map +1 -0
  199. package/dist/migration/audit-guard/guard-marker.d.ts +3 -0
  200. package/dist/migration/audit-guard/guard-marker.d.ts.map +1 -0
  201. package/dist/migration/audit-guard/guard-marker.js +3 -0
  202. package/dist/migration/audit-guard/guard-marker.js.map +1 -0
  203. package/dist/migration/audit-guard/guarded-text.d.ts +5 -0
  204. package/dist/migration/audit-guard/guarded-text.d.ts.map +1 -0
  205. package/dist/migration/audit-guard/guarded-text.js +26 -0
  206. package/dist/migration/audit-guard/guarded-text.js.map +1 -0
  207. package/dist/migration/audit-guard/migrations-under.d.ts +3 -0
  208. package/dist/migration/audit-guard/migrations-under.d.ts.map +1 -0
  209. package/dist/migration/audit-guard/migrations-under.js +15 -0
  210. package/dist/migration/audit-guard/migrations-under.js.map +1 -0
  211. package/dist/migration/audit-guard/run-orm-tool.d.ts +3 -0
  212. package/dist/migration/audit-guard/run-orm-tool.d.ts.map +1 -0
  213. package/dist/migration/audit-guard/run-orm-tool.js +13 -0
  214. package/dist/migration/audit-guard/run-orm-tool.js.map +1 -0
  215. package/dist/migration/audit-guard/schemas-first.d.ts +6 -0
  216. package/dist/migration/audit-guard/schemas-first.d.ts.map +1 -0
  217. package/dist/migration/audit-guard/schemas-first.js +17 -0
  218. package/dist/migration/audit-guard/schemas-first.js.map +1 -0
  219. package/dist/migration/audit-guard/schemas-if-missing.d.ts +7 -0
  220. package/dist/migration/audit-guard/schemas-if-missing.d.ts.map +1 -0
  221. package/dist/migration/audit-guard/schemas-if-missing.js +9 -0
  222. package/dist/migration/audit-guard/schemas-if-missing.js.map +1 -0
  223. package/dist/migration/audit-guard/type-only-imports.d.ts +6 -0
  224. package/dist/migration/audit-guard/type-only-imports.d.ts.map +1 -0
  225. package/dist/migration/audit-guard/type-only-imports.js +8 -0
  226. package/dist/migration/audit-guard/type-only-imports.js.map +1 -0
  227. package/dist/migration/format-as-the-project.d.ts +4 -0
  228. package/dist/migration/format-as-the-project.d.ts.map +1 -0
  229. package/dist/migration/format-as-the-project.js +27 -0
  230. package/dist/migration/format-as-the-project.js.map +1 -0
  231. package/dist/migration/format-written-files.d.ts.map +1 -1
  232. package/dist/migration/format-written-files.js +2 -24
  233. package/dist/migration/format-written-files.js.map +1 -1
  234. package/dist/migration/index.d.ts +8 -0
  235. package/dist/migration/index.d.ts.map +1 -1
  236. package/dist/migration/index.js +8 -0
  237. package/dist/migration/index.js.map +1 -1
  238. package/dist/nest-controllers/nest-answer.d.ts +2 -10
  239. package/dist/nest-controllers/nest-answer.d.ts.map +1 -1
  240. package/dist/nest-controllers/nest-controller-entry.d.ts +4 -2
  241. package/dist/nest-controllers/nest-controller-entry.d.ts.map +1 -1
  242. package/dist/nest-controllers/nest-controllers-in.d.ts +6 -0
  243. package/dist/nest-controllers/nest-controllers-in.d.ts.map +1 -0
  244. package/dist/nest-controllers/nest-controllers-in.js +108 -0
  245. package/dist/nest-controllers/nest-controllers-in.js.map +1 -0
  246. package/dist/nest-controllers/nest-read-type.d.ts +12 -0
  247. package/dist/nest-controllers/nest-read-type.d.ts.map +1 -0
  248. package/dist/nest-controllers/nest-read-type.js +2 -0
  249. package/dist/nest-controllers/nest-read-type.js.map +1 -0
  250. package/dist/nest-controllers/nest-request-part.d.ts +9 -0
  251. package/dist/nest-controllers/nest-request-part.d.ts.map +1 -0
  252. package/dist/nest-controllers/nest-request-part.js +2 -0
  253. package/dist/nest-controllers/nest-request-part.js.map +1 -0
  254. package/dist/nest-controllers/parameters-of.d.ts +8 -0
  255. package/dist/nest-controllers/parameters-of.d.ts.map +1 -0
  256. package/dist/nest-controllers/parameters-of.js +32 -0
  257. package/dist/nest-controllers/parameters-of.js.map +1 -0
  258. package/dist/nest-controllers/project-files.d.ts +6 -0
  259. package/dist/nest-controllers/project-files.d.ts.map +1 -0
  260. package/dist/nest-controllers/project-files.js +2 -0
  261. package/dist/nest-controllers/project-files.js.map +1 -0
  262. package/dist/nest-controllers/read-nest-controllers.d.ts +6 -9
  263. package/dist/nest-controllers/read-nest-controllers.d.ts.map +1 -1
  264. package/dist/nest-controllers/read-nest-controllers.js +10 -82
  265. package/dist/nest-controllers/read-nest-controllers.js.map +1 -1
  266. package/dist/nest-controllers/render-controllers-file.d.ts +4 -3
  267. package/dist/nest-controllers/render-controllers-file.d.ts.map +1 -1
  268. package/dist/nest-controllers/render-controllers-file.js +45 -29
  269. package/dist/nest-controllers/render-controllers-file.js.map +1 -1
  270. package/dist/platform-layout/platform-layout.d.ts +3 -0
  271. package/dist/platform-layout/platform-layout.d.ts.map +1 -1
  272. package/dist/platform-layout/platform-layout.js +3 -0
  273. package/dist/platform-layout/platform-layout.js.map +1 -1
  274. package/dist/presets/identity-refusal.js +3 -3
  275. package/dist/presets/identity-refusal.js.map +1 -1
  276. package/dist/presets/preset-files.d.ts.map +1 -1
  277. package/dist/presets/preset-files.js +3 -1
  278. package/dist/presets/preset-files.js.map +1 -1
  279. package/dist/run.d.ts.map +1 -1
  280. package/dist/run.js +4 -0
  281. package/dist/run.js.map +1 -1
  282. package/dist/stack/authentication-vars.d.ts.map +1 -1
  283. package/dist/stack/authentication-vars.js +8 -2
  284. package/dist/stack/authentication-vars.js.map +1 -1
  285. package/dist/version.d.ts +1 -1
  286. package/dist/version.js +1 -1
  287. package/dist/worker/briefing-of.d.ts.map +1 -1
  288. package/dist/worker/briefing-of.js +2 -4
  289. package/dist/worker/briefing-of.js.map +1 -1
  290. package/dist/worker/resume-message.d.ts.map +1 -1
  291. package/dist/worker/resume-message.js +1 -2
  292. package/dist/worker/resume-message.js.map +1 -1
  293. package/package.json +6 -4
  294. package/templates/background-job/wiring.manual.tpl +1 -1
  295. package/templates/command/wiring.manual.tpl +1 -1
  296. package/templates/context/module.manual.ts.tpl +41 -10
  297. package/templates/erasure-handler/wiring.manual.tpl +1 -1
  298. package/templates/event-handler/wiring.manual.tpl +1 -1
  299. package/templates/file-upload/wiring.manual.tpl +1 -1
  300. package/templates/init/docker/env.example.tpl +1 -1
  301. package/templates/init/e2e/auth-environment.passport.ts.tpl +6 -0
  302. package/templates/init/e2e/create-credentials.passport.ts.tpl +47 -0
  303. package/templates/init/platform/auth/authentication/actor-of-token.ts.tpl +15 -0
  304. package/templates/init/platform/auth/authentication/bearer-strategy.ts.tpl +29 -0
  305. package/templates/init/platform/auth/authentication/create-authenticator.passport.ts.tpl +13 -0
  306. package/templates/init/platform/composition/compose-application.manual.ts.tpl +5 -2
  307. package/templates/init/platform/composition/lay-foundations.manual.ts.tpl +1 -1
  308. package/templates/init/platform/composition/lay-foundations.tsyringe.ts.tpl +1 -1
  309. package/templates/init/platform/composition/platform-error-mapper.ts.tpl +9 -0
  310. package/templates/init/platform/composition/platform-test.module.tsyringe.ts.tpl +11 -0
  311. package/templates/init/platform/composition/platform.module.tsyringe.ts.tpl +5 -2
  312. package/templates/init/platform/config/app-config.ts.tpl +2 -2
  313. package/templates/init/platform/config/load-config.ts.tpl +2 -2
  314. package/templates/init/platform/database/open-persistence.memory.ts.tpl +10 -0
  315. package/templates/init/platform/database/persistence-over.drizzle.ts.tpl +5 -0
  316. package/templates/init/platform/database/persistence-over.knex.ts.tpl +5 -0
  317. package/templates/init/platform/database/persistence-over.prisma.ts.tpl +5 -0
  318. package/templates/init/platform/database/persistence-over.typeorm.ts.tpl +5 -0
  319. package/templates/init/platform/database/persistence.contract.spec.ts.tpl +18 -0
  320. package/templates/init/platform/database/persistence.memory.ts.tpl +7 -1
  321. package/templates/init/platform/database/persistence.orm.ts.tpl +9 -1
  322. package/templates/init/platform/database/schema.drizzle.ts.tpl +11 -1
  323. package/templates/init/platform/database/schema.prisma.tpl +2 -1
  324. package/templates/init/platform/database/schema.typeorm.ts.tpl +1 -1
  325. package/templates/init/platform/event-sourcing/create-event-sourcing.ts.tpl +18 -6
  326. package/templates/init/platform/http/start-http-server.express.ts.tpl +10 -1
  327. package/templates/init/platform/http/start-http-server.nest.ts.tpl +6 -1
  328. package/templates/init/rules/presentation.md.tpl +1 -1
  329. package/templates/integration-event/wiring.manual.tpl +1 -1
  330. package/templates/integration-handler/wiring.manual.tpl +1 -1
  331. package/templates/job/wiring.manual.tpl +1 -1
  332. package/templates/nest-controller/controller.search.ts.tpl +38 -0
  333. package/templates/nest-controller/controller.ts.tpl +1 -17
  334. package/templates/nest-controller/upload.spec.ts.tpl +47 -0
  335. package/templates/nest-controller/upload.ts.tpl +25 -0
  336. package/templates/pipeline/biome.json.tpl +2 -2
  337. package/templates/pipeline/eslint.config.mjs.tpl +6 -0
  338. package/templates/pipeline/package-scripts.json +2 -2
  339. package/templates/presets/identity/context/__context__.module.explicit.ts.tpl +17 -0
  340. package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/deactivate-account.controller.nest-routes.ts.tpl +31 -0
  341. package/templates/presets/identity/context/presentation/http/accounts/provision-account/provision-account.controller.nest-routes.ts.tpl +44 -0
  342. package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/accept-invitation.controller.nest-routes.ts.tpl +56 -0
  343. package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/decline-invitation.controller.nest-routes.ts.tpl +54 -0
  344. package/templates/presets/identity/context/presentation/http/organisations/change-member-role/change-member-role.controller.nest-routes.ts.tpl +32 -0
  345. package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/grant-delegation.controller.nest-routes.ts.tpl +43 -0
  346. package/templates/presets/identity/context/presentation/http/organisations/invite-member/invite-member.controller.nest-routes.ts.tpl +25 -0
  347. package/templates/presets/identity/context/presentation/http/organisations/open-organisation/open-organisation.controller.nest-routes.ts.tpl +37 -0
  348. package/templates/presets/identity/context/presentation/http/organisations/remove-member/remove-member.controller.nest-routes.ts.tpl +31 -0
  349. package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/revoke-delegation.controller.nest-routes.ts.tpl +31 -0
  350. package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/revoke-invitation.controller.nest-routes.ts.tpl +31 -0
  351. package/templates/presets/identity/context/presentation/http/organisations/search-members/search-members.controller.nest-routes.ts.tpl +42 -0
  352. package/templates/presets/identity/context/test/integration/organisation.repository.contract.spec.ts.tpl +1 -1
  353. package/templates/presets/identity/context/test/unit/__context__.module.spec.explicit.ts.tpl +13 -0
  354. package/templates/presets/identity/context/test/unit/accept-invitation.controller.spec.nest-routes.ts.tpl +70 -0
  355. package/templates/presets/identity/context/test/unit/change-member-role.controller.spec.nest-routes.ts.tpl +70 -0
  356. package/templates/presets/identity/context/test/unit/deactivate-account.controller.spec.nest-routes.ts.tpl +57 -0
  357. package/templates/presets/identity/context/test/unit/decline-invitation.controller.spec.nest-routes.ts.tpl +70 -0
  358. package/templates/presets/identity/context/test/unit/grant-delegation.controller.spec.nest-routes.ts.tpl +70 -0
  359. package/templates/presets/identity/context/test/unit/invite-member.controller.spec.nest-routes.ts.tpl +70 -0
  360. package/templates/presets/identity/context/test/unit/open-organisation.controller.spec.nest-routes.ts.tpl +70 -0
  361. package/templates/presets/identity/context/test/unit/provision-account.controller.spec.nest-routes.ts.tpl +99 -0
  362. package/templates/presets/identity/context/test/unit/remove-member.controller.spec.nest-routes.ts.tpl +57 -0
  363. package/templates/presets/identity/context/test/unit/revoke-delegation.controller.spec.nest-routes.ts.tpl +57 -0
  364. package/templates/presets/identity/context/test/unit/revoke-invitation.controller.spec.nest-routes.ts.tpl +57 -0
  365. package/templates/presets/identity/context/test/unit/search-members.controller.spec.nest-routes.ts.tpl +54 -0
  366. package/templates/process/timeout-job.wiring.manual.tpl +1 -1
  367. package/templates/query/search.wiring.manual.tpl +1 -1
  368. package/templates/query/wiring.manual.tpl +1 -1
  369. package/templates/repository/contract.spec.ts.tpl +1 -3
  370. package/templates/repository/event-sourced/contract.spec.ts.tpl +36 -0
  371. package/templates/repository/event-sourced/fake.ts.tpl +24 -0
  372. package/templates/repository/event-sourced/repository.ts.tpl +38 -0
  373. package/templates/repository/event-sourced-first-use.wiring.manual.tpl +4 -0
  374. package/templates/repository/event-sourced.wiring.tsyringe.tpl +6 -0
  375. package/templates/repository/first-use.wiring.manual.tpl +1 -1
  376. /package/templates/presets/identity/context/presentation/http/accounts/deactivate-account/{deactivate-account.controller.ts.tpl → deactivate-account.controller.kit-routes.ts.tpl} +0 -0
  377. /package/templates/presets/identity/context/presentation/http/accounts/provision-account/{provision-account.controller.ts.tpl → provision-account.controller.kit-routes.ts.tpl} +0 -0
  378. /package/templates/presets/identity/context/presentation/http/invitations/accept-invitation/{accept-invitation.controller.ts.tpl → accept-invitation.controller.kit-routes.ts.tpl} +0 -0
  379. /package/templates/presets/identity/context/presentation/http/invitations/decline-invitation/{decline-invitation.controller.ts.tpl → decline-invitation.controller.kit-routes.ts.tpl} +0 -0
  380. /package/templates/presets/identity/context/presentation/http/organisations/change-member-role/{change-member-role.controller.ts.tpl → change-member-role.controller.kit-routes.ts.tpl} +0 -0
  381. /package/templates/presets/identity/context/presentation/http/organisations/grant-delegation/{grant-delegation.controller.ts.tpl → grant-delegation.controller.kit-routes.ts.tpl} +0 -0
  382. /package/templates/presets/identity/context/presentation/http/organisations/invite-member/{invite-member.controller.ts.tpl → invite-member.controller.kit-routes.ts.tpl} +0 -0
  383. /package/templates/presets/identity/context/presentation/http/organisations/open-organisation/{open-organisation.controller.ts.tpl → open-organisation.controller.kit-routes.ts.tpl} +0 -0
  384. /package/templates/presets/identity/context/presentation/http/organisations/remove-member/{remove-member.controller.ts.tpl → remove-member.controller.kit-routes.ts.tpl} +0 -0
  385. /package/templates/presets/identity/context/presentation/http/organisations/revoke-delegation/{revoke-delegation.controller.ts.tpl → revoke-delegation.controller.kit-routes.ts.tpl} +0 -0
  386. /package/templates/presets/identity/context/presentation/http/organisations/revoke-invitation/{revoke-invitation.controller.ts.tpl → revoke-invitation.controller.kit-routes.ts.tpl} +0 -0
  387. /package/templates/presets/identity/context/presentation/http/organisations/search-members/{search-members.controller.ts.tpl → search-members.controller.kit-routes.ts.tpl} +0 -0
  388. /package/templates/presets/identity/context/test/unit/{accept-invitation.controller.spec.ts.tpl → accept-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  389. /package/templates/presets/identity/context/test/unit/{change-member-role.controller.spec.ts.tpl → change-member-role.controller.spec.kit-routes.ts.tpl} +0 -0
  390. /package/templates/presets/identity/context/test/unit/{deactivate-account.controller.spec.ts.tpl → deactivate-account.controller.spec.kit-routes.ts.tpl} +0 -0
  391. /package/templates/presets/identity/context/test/unit/{decline-invitation.controller.spec.ts.tpl → decline-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  392. /package/templates/presets/identity/context/test/unit/{grant-delegation.controller.spec.ts.tpl → grant-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
  393. /package/templates/presets/identity/context/test/unit/{invite-member.controller.spec.ts.tpl → invite-member.controller.spec.kit-routes.ts.tpl} +0 -0
  394. /package/templates/presets/identity/context/test/unit/{open-organisation.controller.spec.ts.tpl → open-organisation.controller.spec.kit-routes.ts.tpl} +0 -0
  395. /package/templates/presets/identity/context/test/unit/{provision-account.controller.spec.ts.tpl → provision-account.controller.spec.kit-routes.ts.tpl} +0 -0
  396. /package/templates/presets/identity/context/test/unit/{remove-member.controller.spec.ts.tpl → remove-member.controller.spec.kit-routes.ts.tpl} +0 -0
  397. /package/templates/presets/identity/context/test/unit/{revoke-delegation.controller.spec.ts.tpl → revoke-delegation.controller.spec.kit-routes.ts.tpl} +0 -0
  398. /package/templates/presets/identity/context/test/unit/{revoke-invitation.controller.spec.ts.tpl → revoke-invitation.controller.spec.kit-routes.ts.tpl} +0 -0
  399. /package/templates/presets/identity/context/test/unit/{search-members.controller.spec.ts.tpl → search-members.controller.spec.kit-routes.ts.tpl} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"untouched-by-branch.d.ts","sourceRoot":"","sources":["../../../src/merge/lost/untouched-by-branch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAWpD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,YAAY,EAAE,EACjC,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAChG,YAAY,EAAE,CAIhB"}
@@ -0,0 +1,22 @@
1
+ /** The kinds that say a side's content is missing from the result: the others point at the result or at a removal. */
2
+ const MISSING = new Set([
3
+ 'lost-line',
4
+ 'superseded',
5
+ 'rewritten',
6
+ 'test-lost',
7
+ 'spec-deleted',
8
+ ]);
9
+ /**
10
+ * Drops what the branch cannot have lost: a finding on a line of the branch in a file that is the
11
+ * same on the branch and at the fork (where the branch left the trunk, or last took it in). The
12
+ * branch did not touch that file, so what the trunk removed or replaced there since is the
13
+ * trunk's change, even when the base the merge is computed from is older than the fork.
14
+ */
15
+ export function untouchedByBranch(findings, files) {
16
+ return findings.filter((finding) => !(MISSING.has(finding.kind) && finding.side === 'ours' && isUntouched(finding, files)));
17
+ }
18
+ function isUntouched({ file }, { ours, fork }) {
19
+ const kept = ours.get(file);
20
+ return kept !== undefined && kept === fork.get(file);
21
+ }
22
+ //# sourceMappingURL=untouched-by-branch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"untouched-by-branch.js","sourceRoot":"","sources":["../../../src/merge/lost/untouched-by-branch.ts"],"names":[],"mappings":"AAEA,sHAAsH;AACtH,MAAM,OAAO,GAAsC,IAAI,GAAG,CAAC;IACzD,WAAW;IACX,YAAY;IACZ,WAAW;IACX,WAAW;IACX,cAAc;CACf,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAiC,EACjC,KAAiG;IAEjG,OAAO,QAAQ,CAAC,MAAM,CACpB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CACpG,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAClB,EAAE,IAAI,EAAgB,EACtB,EAAE,IAAI,EAAE,IAAI,EAA8F;IAE1G,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAE5B,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"verify-merge.d.ts","sourceRoot":"","sources":["../../../src/merge/lost/verify-merge.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMvD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,UAAU,CAqBnF"}
1
+ {"version":3,"file":"verify-merge.d.ts","sourceRoot":"","sources":["../../../src/merge/lost/verify-merge.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOvD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,UAAU,CAqBnF"}
@@ -12,6 +12,7 @@ import { lostMigrations } from './lost-migrations.js';
12
12
  import { lostTests } from './lost-tests.js';
13
13
  import { revisionFiles, WORKTREE } from './revision-files.js';
14
14
  import { sideHunks } from './side-hunks.js';
15
+ import { untouchedByBranch } from './untouched-by-branch.js';
15
16
  const WARNINGS = new Set(['revived', 'rewritten', 'superseded']);
16
17
  /**
17
18
  * Checks one merge against its base and its two sides: the lines, rows, tests, spec files and
@@ -47,7 +48,7 @@ function findingsAt(repo, merge, at) {
47
48
  const paths = changedPaths(repo.top, pairs);
48
49
  const read = (revision) => revisionFiles(repo.top, revision, paths);
49
50
  const sides = { base: read(base), ours: read(ours), theirs: read(theirs), result: read(at.result) };
50
- return [
51
+ const findings = [
51
52
  ...lineFindings(linesOf(sides, repo), changesOf(repo.top, merge, at.result)),
52
53
  ...keptRows(sides, `${repo.prefix}${SLICES_FILE}`),
53
54
  ...lostTests(sides),
@@ -55,6 +56,10 @@ function findingsAt(repo, merge, at) {
55
56
  ...lostMigrations(sides),
56
57
  ...conflictMarkers(sides),
57
58
  ];
59
+ const fork = runGit(repo.top, ['merge-base', ours, theirs])?.trim();
60
+ return fork === undefined || fork === ''
61
+ ? findings
62
+ : untouchedByBranch(findings, { ours: sides.ours, fork: read(fork) });
58
63
  }
59
64
  /** The hunks of each side against the base, and from each side to the result. */
60
65
  function changesOf(top, { base, ours, theirs }, result) {
@@ -1 +1 @@
1
- {"version":3,"file":"verify-merge.js","sourceRoot":"","sources":["../../../src/merge/lost/verify-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAqB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAA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,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAgB,EAAE,OAA0B;IAC1E,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Io } from '../../commands/io.js';
2
+ import { type GuardedOrm } from './guarded-text.js';
3
+ export interface MigrationsWritten {
4
+ readonly root: string;
5
+ readonly orm: GuardedOrm;
6
+ /** What the tool of the ORM just wrote, relative to the root. */
7
+ readonly written: readonly string[];
8
+ /** Every migration of the project once written, relative to the root. */
9
+ readonly migrations: readonly string[];
10
+ }
11
+ /**
12
+ * Makes the audit trail append-only in the migration that creates it: the tools of Drizzle, Prisma
13
+ * and TypeORM write no trigger, so the statements of the guard follow the creation of the tables,
14
+ * once. A project whose migrations already hold them, or whose new migration creates no audit
15
+ * table, is left as it is.
16
+ */
17
+ export declare function appendAuditGuard(migrations: MigrationsWritten, statementsOf: (schema: string) => readonly string[], io: Io): void;
18
+ //# sourceMappingURL=append-audit-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"append-audit-guard.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/append-audit-guard.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,yEAAyE;IACzE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,iBAAiB,EAC7B,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,EACnD,EAAE,EAAE,EAAE,GACL,IAAI,CAkBN"}
@@ -0,0 +1,27 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { auditSchemaCreated } from './audit-schema-created.js';
4
+ import { GUARD_MARKER } from './guard-marker.js';
5
+ import { guardedText } from './guarded-text.js';
6
+ /**
7
+ * Makes the audit trail append-only in the migration that creates it: the tools of Drizzle, Prisma
8
+ * and TypeORM write no trigger, so the statements of the guard follow the creation of the tables,
9
+ * once. A project whose migrations already hold them, or whose new migration creates no audit
10
+ * table, is left as it is.
11
+ */
12
+ export function appendAuditGuard(migrations, statementsOf, io) {
13
+ const { root, orm, written } = migrations;
14
+ const read = (file) => fs.readFileSync(path.join(root, file), 'utf8');
15
+ if (migrations.migrations.some((file) => read(file).includes(GUARD_MARKER))) {
16
+ return;
17
+ }
18
+ for (const file of written) {
19
+ const schema = auditSchemaCreated(read(file));
20
+ if (schema !== undefined) {
21
+ fs.writeFileSync(path.join(root, file), guardedText(orm, read(file), statementsOf(schema)));
22
+ io.out(`audit guard ${file}: the entries and archives of the audit trail refuse UPDATE, DELETE and TRUNCATE`);
23
+ return;
24
+ }
25
+ }
26
+ }
27
+ //# sourceMappingURL=append-audit-guard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"append-audit-guard.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/append-audit-guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAmB,MAAM,gBAAgB,CAAC;AAW9D;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAA6B,EAC7B,YAAmD,EACnD,EAAM;IAEN,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAC1C,MAAM,IAAI,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAEtF,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QAC5E,OAAO;IACT,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAE9C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC5F,EAAE,CAAC,GAAG,CAAC,iBAAiB,IAAI,kFAAkF,CAAC,CAAC;YAEhH,OAAO;QACT,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { GuardedOrm } from './guarded-text.js';
2
+ /**
3
+ * The statements of the guard, from the `@ddd-ts-kit/audit` the project installed: the same that
4
+ * `npm run db:audit-guard` prints and that the in-process database of the tests runs.
5
+ */
6
+ export declare function auditGuardStatementsOf(root: string, orm: GuardedOrm): (schema: string) => string[];
7
+ //# sourceMappingURL=audit-guard-statements-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-guard-statements-of.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/audit-guard-statements-of.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,EAAE,CAelG"}
@@ -0,0 +1,18 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { CliError } from '../../cli-error.js';
3
+ /**
4
+ * The statements of the guard, from the `@ddd-ts-kit/audit` the project installed: the same that
5
+ * `npm run db:audit-guard` prints and that the in-process database of the tests runs.
6
+ */
7
+ export function auditGuardStatementsOf(root, orm) {
8
+ return (schema) => {
9
+ const script = `import { auditGuardStatements } from '@ddd-ts-kit/audit/${orm}'; process.stdout.write(JSON.stringify(auditGuardStatements(${JSON.stringify(schema)})));`;
10
+ const run = spawnSync(process.execPath, ['--input-type=module', '-e', script], { cwd: root, encoding: 'utf8' });
11
+ const statements = run.status === 0 ? JSON.parse(run.stdout) : undefined;
12
+ if (!Array.isArray(statements) || !statements.every((statement) => typeof statement === 'string')) {
13
+ throw new CliError(`The statements of the audit guard could not be read from @ddd-ts-kit/audit/${orm}.`, `Run \`npm install\` in the project, then \`npm run db:audit-guard\` to see them: ${run.stderr.trim()}`);
14
+ }
15
+ return statements;
16
+ };
17
+ }
18
+ //# sourceMappingURL=audit-guard-statements-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-guard-statements-of.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/audit-guard-statements-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAY,EAAE,GAAe;IAClE,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,MAAM,MAAM,GAAG,2DAA2D,GAAG,+DAA+D,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;QACzK,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAChH,MAAM,UAAU,GAAY,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAElF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC,EAAE,CAAC;YAClG,MAAM,IAAI,QAAQ,CAChB,8EAA8E,GAAG,GAAG,EACpF,oFAAoF,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CACxG,CAAC;QACJ,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The schema of the audit entries a migration creates, `undefined` when it creates none. */
2
+ export declare function auditSchemaCreated(migration: string): string | undefined;
3
+ //# sourceMappingURL=audit-schema-created.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-schema-created.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/audit-schema-created.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQxE"}
@@ -0,0 +1,9 @@
1
+ /** The schema of the audit entries a migration creates, `undefined` when it creates none. */
2
+ export function auditSchemaCreated(migration) {
3
+ const created = /create table (?:if not exists )?(?:"(\w+)"\.)?"audit_entries"/i.exec(migration);
4
+ if (created === null) {
5
+ return undefined;
6
+ }
7
+ return created[1] ?? 'public';
8
+ }
9
+ //# sourceMappingURL=audit-schema-created.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-schema-created.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/audit-schema-created.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,MAAM,OAAO,GAAG,gEAAgE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAEjG,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC;AAChC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Io } from '../../commands/io.js';
2
+ import type { GuardedOrm } from './guarded-text.js';
3
+ export interface GuardedGeneration {
4
+ readonly root: string;
5
+ readonly orm: GuardedOrm;
6
+ /** Where the tool writes its migrations, and what a migration is named. */
7
+ readonly folder: string;
8
+ readonly migration: RegExp;
9
+ /** Runs the tool of the ORM and answers its exit code. */
10
+ readonly generate: () => number;
11
+ /** Brings what the tool wrote to the rules of the project, the guard added: its imports, its format. */
12
+ readonly tidy?: (written: readonly string[]) => void;
13
+ }
14
+ /** The tool of the ORM writes a migration; with an audit trail, the one that creates it is made append-only; then it is tidied. */
15
+ export declare function generateGuarded(generation: GuardedGeneration, io: Io): number;
16
+ //# sourceMappingURL=generate-guarded.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-guarded.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/generate-guarded.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAI5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,CAAC;IAChC,wGAAwG;IACxG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;CACtD;AAED,mIAAmI;AACnI,wBAAgB,eAAe,CAAC,UAAU,EAAE,iBAAiB,EAAE,EAAE,EAAE,EAAE,GAAG,MAAM,CAmB7E"}
@@ -0,0 +1,22 @@
1
+ import { readConfig } from '../../config/index.js';
2
+ import { writtenPaths } from '../written-paths.js';
3
+ import { appendAuditGuard } from './append-audit-guard.js';
4
+ import { auditGuardStatementsOf } from './audit-guard-statements-of.js';
5
+ import { migrationsUnder } from './migrations-under.js';
6
+ /** The tool of the ORM writes a migration; with an audit trail, the one that creates it is made append-only; then it is tidied. */
7
+ export function generateGuarded(generation, io) {
8
+ const { root, orm, folder, migration } = generation;
9
+ const before = migrationsUnder(root, folder, migration);
10
+ const code = generation.generate();
11
+ if (code !== 0) {
12
+ return code;
13
+ }
14
+ const after = migrationsUnder(root, folder, migration);
15
+ const written = writtenPaths(before, after);
16
+ if (readConfig(root).config.stack.audit === 'on') {
17
+ appendAuditGuard({ root, orm, written, migrations: [...after.keys()] }, auditGuardStatementsOf(root, orm), io);
18
+ }
19
+ generation.tidy?.(written);
20
+ return code;
21
+ }
22
+ //# sourceMappingURL=generate-guarded.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-guarded.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/generate-guarded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAcrD,mIAAmI;AACnI,MAAM,UAAU,eAAe,CAAC,UAA6B,EAAE,EAAM;IACnE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;IACpD,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;IAEnC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE5C,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QACjD,gBAAgB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,sBAAsB,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IACjH,CAAC;IAED,UAAU,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC;IAE3B,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** A name the statements of the guard always hold: a migration that has it is guarded already. */
2
+ export declare const GUARD_MARKER = "audit_entries_append_only";
3
+ //# sourceMappingURL=guard-marker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guard-marker.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/guard-marker.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,eAAO,MAAM,YAAY,8BAA8B,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** A name the statements of the guard always hold: a migration that has it is guarded already. */
2
+ export const GUARD_MARKER = 'audit_entries_append_only';
3
+ //# sourceMappingURL=guard-marker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guard-marker.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/guard-marker.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,MAAM,CAAC,MAAM,YAAY,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** The tools whose migrations know no trigger: each is written in the dialect of its migrations. */
2
+ export type GuardedOrm = 'drizzle' | 'prisma' | 'typeorm';
3
+ /** The migration that creates the audit entries, the statements of the guard after what it does. */
4
+ export declare function guardedText(orm: GuardedOrm, migration: string, statements: readonly string[]): string;
5
+ //# sourceMappingURL=guarded-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guarded-text.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/guarded-text.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAI1D,oGAAoG;AACpG,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAUrG"}
@@ -0,0 +1,26 @@
1
+ const BREAKPOINT = '\n--> statement-breakpoint\n';
2
+ /** The migration that creates the audit entries, the statements of the guard after what it does. */
3
+ export function guardedText(orm, migration, statements) {
4
+ if (orm === 'drizzle') {
5
+ return `${migration.trimEnd()}${BREAKPOINT}${statements.map((statement) => `${statement};`).join(BREAKPOINT)}\n`;
6
+ }
7
+ if (orm === 'prisma') {
8
+ return `${migration.trimEnd()}\n\n-- The audit trail is append-only: @ddd-ts-kit/audit refuses to rewrite it.\n${statements.map((statement) => `${statement};`).join('\n\n')}\n`;
9
+ }
10
+ return inTheUpOfAClass(migration, statements);
11
+ }
12
+ /** A TypeORM migration: one `queryRunner.query` per statement, at the end of `up`. */
13
+ function inTheUpOfAClass(migration, statements) {
14
+ const down = migration.indexOf('public async down(');
15
+ const endOfUp = down === -1 ? -1 : migration.lastIndexOf('}', down);
16
+ if (endOfUp === -1) {
17
+ throw new Error('The migration holds no `up` and `down` methods to add the audit guard to.');
18
+ }
19
+ const line = migration.lastIndexOf('\n', endOfUp) + 1;
20
+ const calls = statements.map((statement) => ` await queryRunner.query(\`${escaped(statement)}\`);\n`).join('');
21
+ return `${migration.slice(0, line)}${calls}${migration.slice(line)}`;
22
+ }
23
+ function escaped(statement) {
24
+ return statement.replaceAll('\\', '\\\\').replaceAll('`', '\\`').replaceAll('${', '\\${');
25
+ }
26
+ //# sourceMappingURL=guarded-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guarded-text.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/guarded-text.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,GAAG,8BAA8B,CAAC;AAElD,oGAAoG;AACpG,MAAM,UAAU,WAAW,CAAC,GAAe,EAAE,SAAiB,EAAE,UAA6B;IAC3F,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,GAAG,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IACnH,CAAC;IAED,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;QACrB,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,oFAAoF,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACnL,CAAC;IAED,OAAO,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAChD,CAAC;AAED,sFAAsF;AACtF,SAAS,eAAe,CAAC,SAAiB,EAAE,UAA6B;IACvE,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAEpE,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;IAC/F,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,qCAAqC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEtH,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;AACvE,CAAC;AAED,SAAS,OAAO,CAAC,SAAiB;IAChC,OAAO,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC5F,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** The migrations under a folder of the project, by their path from the root (POSIX separators), with their content. */
2
+ export declare function migrationsUnder(root: string, folder: string, migration: RegExp): Map<string, string>;
3
+ //# sourceMappingURL=migrations-under.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations-under.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/migrations-under.ts"],"names":[],"mappings":"AAGA,wHAAwH;AACxH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAepG"}
@@ -0,0 +1,15 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ /** The migrations under a folder of the project, by their path from the root (POSIX separators), with their content. */
4
+ export function migrationsUnder(root, folder, migration) {
5
+ const directory = path.join(root, folder);
6
+ if (!fs.existsSync(directory)) {
7
+ return new Map();
8
+ }
9
+ const files = fs
10
+ .readdirSync(directory, { recursive: true, withFileTypes: true })
11
+ .filter((entry) => entry.isFile() && migration.test(entry.name))
12
+ .map((entry) => path.join(entry.parentPath, entry.name));
13
+ return new Map(files.sort().map((file) => [path.relative(root, file).split(path.sep).join('/'), fs.readFileSync(file, 'utf8')]));
14
+ }
15
+ //# sourceMappingURL=migrations-under.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations-under.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/migrations-under.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,wHAAwH;AACxH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,MAAc,EAAE,SAAiB;IAC7E,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE1C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,GAAG,EAAE,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAG,EAAE;SACb,WAAW,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;SAChE,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC/D,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAE3D,OAAO,IAAI,GAAG,CACZ,KAAK,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CACjH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Runs the CLI of an ORM installed in the project with the node that runs this one, in the terminal of the caller. */
2
+ export declare function runOrmTool(root: string, bin: string, args: readonly string[]): number;
3
+ //# sourceMappingURL=run-orm-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-orm-tool.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/run-orm-tool.ts"],"names":[],"mappings":"AAKA,uHAAuH;AACvH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAWrF"}
@@ -0,0 +1,13 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { CliError } from '../../cli-error.js';
5
+ /** Runs the CLI of an ORM installed in the project with the node that runs this one, in the terminal of the caller. */
6
+ export function runOrmTool(root, bin, args) {
7
+ const entry = path.join(root, 'node_modules', bin);
8
+ if (!fs.existsSync(entry)) {
9
+ throw new CliError(`${bin.split('/')[0] ?? bin} is not installed in ${root}.`, 'Run `npm install` in the project first.');
10
+ }
11
+ return spawnSync(process.execPath, [entry, ...args], { cwd: root, stdio: 'inherit' }).status ?? 1;
12
+ }
13
+ //# sourceMappingURL=run-orm-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-orm-tool.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/run-orm-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,uHAAuH;AACvH,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,GAAW,EAAE,IAAuB;IAC3E,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC;IAEnD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,QAAQ,CAChB,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,wBAAwB,IAAI,GAAG,EAC1D,yCAAyC,CAC1C,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;AACpG,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A migration TypeORM wrote, which creates tables in schemas it never creates (TypeORM writes no
3
+ * `CREATE SCHEMA`): each of them created first, if it does not exist, at the start of `up`.
4
+ */
5
+ export declare function schemasFirst(migration: string): string;
6
+ //# sourceMappingURL=schemas-first.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-first.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/schemas-first.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAetD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A migration TypeORM wrote, which creates tables in schemas it never creates (TypeORM writes no
3
+ * `CREATE SCHEMA`): each of them created first, if it does not exist, at the start of `up`.
4
+ */
5
+ export function schemasFirst(migration) {
6
+ const schemas = [...new Set([...migration.matchAll(/CREATE TABLE "(\w+)"\."\w+"/g)].map((match) => match[1] ?? ''))];
7
+ const up = /public async up\([^)]*\): Promise<void> \{\n/.exec(migration);
8
+ if (schemas.length === 0 || up === null) {
9
+ return migration;
10
+ }
11
+ const at = up.index + up[0].length;
12
+ const created = schemas
13
+ .map((schema) => ` await queryRunner.query(\`CREATE SCHEMA IF NOT EXISTS "${schema}"\`);\n`)
14
+ .join('');
15
+ return `${migration.slice(0, at)}${created}${migration.slice(at)}`;
16
+ }
17
+ //# sourceMappingURL=schemas-first.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-first.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/schemas-first.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,SAAiB;IAC5C,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACrH,MAAM,EAAE,GAAG,8CAA8C,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAE1E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAEnC,MAAM,OAAO,GAAG,OAAO;SACpB,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,kEAAkE,MAAM,SAAS,CAAC;SAClG,IAAI,CAAC,EAAE,CAAC,CAAC;IAEZ,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;AACrE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A migration drizzle-kit wrote, its `CREATE SCHEMA` made idempotent: a schema created before by
3
+ * hand, by another tool or by a migration of a project generated earlier, is left as it is
4
+ * instead of failing the migration.
5
+ */
6
+ export declare function schemasIfMissing(migration: string): string;
7
+ //# sourceMappingURL=schemas-if-missing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-if-missing.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/schemas-if-missing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A migration drizzle-kit wrote, its `CREATE SCHEMA` made idempotent: a schema created before by
3
+ * hand, by another tool or by a migration of a project generated earlier, is left as it is
4
+ * instead of failing the migration.
5
+ */
6
+ export function schemasIfMissing(migration) {
7
+ return migration.replace(/CREATE SCHEMA (?!IF NOT EXISTS)/g, 'CREATE SCHEMA IF NOT EXISTS ');
8
+ }
9
+ //# sourceMappingURL=schemas-if-missing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-if-missing.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/schemas-if-missing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,SAAS,CAAC,OAAO,CAAC,kCAAkC,EAAE,8BAA8B,CAAC,CAAC;AAC/F,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A migration TypeORM wrote, its import of `MigrationInterface` and `QueryRunner` made type-only,
3
+ * as `verbatimModuleSyntax` asks of an import that names types alone.
4
+ */
5
+ export declare function typeOnlyImports(migration: string): string;
6
+ //# sourceMappingURL=type-only-imports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-only-imports.d.ts","sourceRoot":"","sources":["../../../src/migration/audit-guard/type-only-imports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzD"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A migration TypeORM wrote, its import of `MigrationInterface` and `QueryRunner` made type-only,
3
+ * as `verbatimModuleSyntax` asks of an import that names types alone.
4
+ */
5
+ export function typeOnlyImports(migration) {
6
+ return migration.replace(/^import \{([^}]*)\} from ["']typeorm["'];?$/m, "import type {$1} from 'typeorm';");
7
+ }
8
+ //# sourceMappingURL=type-only-imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-only-imports.js","sourceRoot":"","sources":["../../../src/migration/audit-guard/type-only-imports.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,OAAO,SAAS,CAAC,OAAO,CAAC,8CAA8C,EAAE,kCAAkC,CAAC,CAAC;AAC/G,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Io } from '../commands/io.js';
2
+ /** Formats files with the formatter of the project, the way its format script does; a formatter that fails or is missing is reported. */
3
+ export declare function formatAsTheProject(root: string, files: readonly string[], io: Io): void;
4
+ //# sourceMappingURL=format-as-the-project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-as-the-project.d.ts","sourceRoot":"","sources":["../../src/migration/format-as-the-project.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAMzC,yIAAyI;AACzI,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,CA4BvF"}
@@ -0,0 +1,27 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { findProjectFormatter } from './find-project-formatter.js';
3
+ /** Enough of a failing formatter to read the cause. */
4
+ const TAIL_LINES = 20;
5
+ /** Formats files with the formatter of the project, the way its format script does; a formatter that fails or is missing is reported. */
6
+ export function formatAsTheProject(root, files, io) {
7
+ if (files.length === 0) {
8
+ return;
9
+ }
10
+ const formatter = findProjectFormatter(root);
11
+ if (typeof formatter === 'string') {
12
+ io.out(`Not formatted (${formatter}): ${files.join(', ')}.`);
13
+ return;
14
+ }
15
+ const run = spawnSync(process.execPath, [formatter.bin, ...formatter.args, ...files], {
16
+ cwd: root,
17
+ encoding: 'utf8',
18
+ stdio: ['ignore', 'pipe', 'pipe'],
19
+ });
20
+ if (run.status === 0) {
21
+ io.out(`Formatted with ${formatter.name}, as the format script does: ${files.join(', ')}.`);
22
+ return;
23
+ }
24
+ const printed = `${run.stdout}${run.stderr}`.trimEnd().split('\n').slice(-TAIL_LINES).join('\n');
25
+ io.err(`Warning: ${formatter.name} failed on ${files.join(', ')}; format them before committing.\n${printed}`);
26
+ }
27
+ //# sourceMappingURL=format-as-the-project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-as-the-project.js","sourceRoot":"","sources":["../../src/migration/format-as-the-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA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EAAE,CAAC,CAAC;AACjH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"format-written-files.d.ts","sourceRoot":"","sources":["../../src/migration/format-written-files.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAK5D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,CA8BlF"}
1
+ {"version":3,"file":"format-written-files.d.ts","sourceRoot":"","sources":["../../src/migration/format-written-files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,GAAG,IAAI,CAMlF"}
@@ -1,32 +1,10 @@
1
- import { spawnSync } from 'node:child_process';
2
- import { findProjectFormatter } from './find-project-formatter.js';
3
- /** Enough of a failing formatter to read the cause. */
4
- const TAIL_LINES = 20;
1
+ import { formatAsTheProject } from './format-as-the-project.js';
5
2
  /**
6
3
  * Formats the snapshot and the journal drizzle-kit wrote under `meta/` as the project formats its
7
4
  * files, so that its format gate passes on them; the SQL is left as drizzle-kit wrote it. A
8
5
  * formatter that fails or is missing is reported: the migration is written either way.
9
6
  */
10
7
  export function formatWrittenFiles({ root, paths }, io) {
11
- const json = paths.filter((file) => file.includes('/meta/') && file.endsWith('.json'));
12
- if (json.length === 0) {
13
- return;
14
- }
15
- const formatter = findProjectFormatter(root);
16
- if (typeof formatter === 'string') {
17
- io.out(`Not formatted (${formatter}): ${json.join(', ')}.`);
18
- return;
19
- }
20
- const run = spawnSync(process.execPath, [formatter.bin, ...formatter.args, ...json], {
21
- cwd: root,
22
- encoding: 'utf8',
23
- stdio: ['ignore', 'pipe', 'pipe'],
24
- });
25
- if (run.status === 0) {
26
- io.out(`Formatted with ${formatter.name}, as the format script does: ${json.join(', ')}.`);
27
- return;
28
- }
29
- const printed = `${run.stdout}${run.stderr}`.trimEnd().split('\n').slice(-TAIL_LINES).join('\n');
30
- io.err(`Warning: ${formatter.name} failed on ${json.join(', ')}; format them before committing.\n${printed}`);
8
+ formatAsTheProject(root, paths.filter((file) => file.includes('/meta/') && file.endsWith('.json')), io);
31
9
  }
32
10
  //# sourceMappingURL=format-written-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"format-written-files.js","sourceRoot":"","sources":["../../src/migration/format-written-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,uDAAuD;AACvD,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAoB,EAAE,EAAM;IAC1E,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IAEvF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAE7C,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAClC,EAAE,CAAC,GAAG,CAAC,kBAAkB,SAAS,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE5D,OAAO;IACT,CA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AACJ,CAAC"}
@@ -3,4 +3,12 @@ export { generateDrizzleMigration } from './generate-drizzle-migration.js';
3
3
  export { primaryKeyOrderFindings } from './primary-key-order-findings.js';
4
4
  export { replayDrizzleMigrations } from './replay-drizzle-migrations.js';
5
5
  export { tidyWrittenMigration } from './tidy-written-migration.js';
6
+ export { appendAuditGuard } from './audit-guard/append-audit-guard.js';
7
+ export { auditGuardStatementsOf } from './audit-guard/audit-guard-statements-of.js';
8
+ export { generateGuarded } from './audit-guard/generate-guarded.js';
9
+ export { runOrmTool } from './audit-guard/run-orm-tool.js';
10
+ export { formatAsTheProject } from './format-as-the-project.js';
11
+ export { typeOnlyImports } from './audit-guard/type-only-imports.js';
12
+ export { schemasFirst } from './audit-guard/schemas-first.js';
13
+ export { schemasIfMissing } from './audit-guard/schemas-if-missing.js';
6
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/migration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC"}