@ddd-ts-kit/kernel 0.114.1 → 0.115.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 (319) hide show
  1. package/README.fr.md +67 -59
  2. package/README.md +62 -54
  3. package/dist/application/audit/restamped.d.ts +9 -0
  4. package/dist/application/audit/restamped.d.ts.map +1 -0
  5. package/dist/application/audit/restamped.js +9 -0
  6. package/dist/application/audit/restamped.js.map +1 -0
  7. package/dist/application/audit/stamp-update.d.ts +1 -6
  8. package/dist/application/audit/stamp-update.d.ts.map +1 -1
  9. package/dist/application/audit/stamp-update.js +2 -8
  10. package/dist/application/audit/stamp-update.js.map +1 -1
  11. package/dist/application/background/enqueued-job.d.ts +1 -1
  12. package/dist/application/background/enqueued-job.d.ts.map +1 -1
  13. package/dist/application/error-reporting/report-once.d.ts.map +1 -1
  14. package/dist/application/error-reporting/report-once.js +2 -6
  15. package/dist/application/error-reporting/report-once.js.map +1 -1
  16. package/dist/application/event-sourcing/event-envelope.d.ts +2 -1
  17. package/dist/application/event-sourcing/event-envelope.d.ts.map +1 -1
  18. package/dist/application/event-sourcing/event-to-append.d.ts +1 -1
  19. package/dist/application/event-sourcing/event-to-append.d.ts.map +1 -1
  20. package/dist/application/execution/with-actor.d.ts +2 -2
  21. package/dist/application/execution/with-actor.js +3 -3
  22. package/dist/application/execution/with-actor.js.map +1 -1
  23. package/dist/application/files/stored-file.d.ts +3 -3
  24. package/dist/application/files/stored-file.d.ts.map +1 -1
  25. package/dist/application/hydration/hydration.d.ts.map +1 -1
  26. package/dist/application/hydration/hydration.js +3 -2
  27. package/dist/application/hydration/hydration.js.map +1 -1
  28. package/dist/application/logging/hidden-keys.d.ts +8 -0
  29. package/dist/application/logging/hidden-keys.d.ts.map +1 -0
  30. package/dist/application/logging/hidden-keys.js +10 -0
  31. package/dist/application/logging/hidden-keys.js.map +1 -0
  32. package/dist/application/logging/index.d.ts +1 -0
  33. package/dist/application/logging/index.d.ts.map +1 -1
  34. package/dist/application/logging/index.js +1 -0
  35. package/dist/application/logging/index.js.map +1 -1
  36. package/dist/application/observation/safely.d.ts +6 -0
  37. package/dist/application/observation/safely.d.ts.map +1 -0
  38. package/dist/application/observation/safely.js +13 -0
  39. package/dist/application/observation/safely.js.map +1 -0
  40. package/dist/application/persistence/append-changes.d.ts +1 -0
  41. package/dist/application/persistence/append-changes.d.ts.map +1 -1
  42. package/dist/application/persistence/append-changes.js +7 -6
  43. package/dist/application/persistence/append-changes.js.map +1 -1
  44. package/dist/application/persistence/optimistic-update.d.ts +6 -2
  45. package/dist/application/persistence/optimistic-update.d.ts.map +1 -1
  46. package/dist/application/persistence/optimistic-update.js +11 -3
  47. package/dist/application/persistence/optimistic-update.js.map +1 -1
  48. package/dist/application/ports/domain-event-dispatcher.d.ts +1 -1
  49. package/dist/application/ports/domain-event-dispatcher.js +1 -1
  50. package/dist/application/ports/logger.d.ts +3 -3
  51. package/dist/application/ports/unit-of-work.d.ts +1 -1
  52. package/dist/application/ports/unit-of-work.js +1 -1
  53. package/dist/application/read-model/stamp-of.d.ts +11 -4
  54. package/dist/application/read-model/stamp-of.d.ts.map +1 -1
  55. package/dist/application/read-model/stamp-of.js +10 -8
  56. package/dist/application/read-model/stamp-of.js.map +1 -1
  57. package/dist/application/session/anonymous-session.d.ts.map +1 -1
  58. package/dist/application/session/anonymous-session.js +4 -2
  59. package/dist/application/session/anonymous-session.js.map +1 -1
  60. package/dist/application/session/never-issued.d.ts +2 -1
  61. package/dist/application/session/never-issued.d.ts.map +1 -1
  62. package/dist/application/session/never-issued.js +4 -1
  63. package/dist/application/session/never-issued.js.map +1 -1
  64. package/dist/application/session/system-session.d.ts.map +1 -1
  65. package/dist/application/session/system-session.js +2 -2
  66. package/dist/application/session/system-session.js.map +1 -1
  67. package/dist/application/undecided/index.d.ts +3 -0
  68. package/dist/application/undecided/index.d.ts.map +1 -0
  69. package/dist/application/undecided/index.js +3 -0
  70. package/dist/application/undecided/index.js.map +1 -0
  71. package/dist/application/undecided/undecided-error.d.ts +12 -0
  72. package/dist/application/undecided/undecided-error.d.ts.map +1 -0
  73. package/dist/application/undecided/undecided-error.js +15 -0
  74. package/dist/application/undecided/undecided-error.js.map +1 -0
  75. package/dist/application/undecided/undecided.d.ts +7 -0
  76. package/dist/application/undecided/undecided.d.ts.map +1 -0
  77. package/dist/application/undecided/undecided.js +9 -0
  78. package/dist/application/undecided/undecided.js.map +1 -0
  79. package/dist/domain/aggregate-root.d.ts +6 -13
  80. package/dist/domain/aggregate-root.d.ts.map +1 -1
  81. package/dist/domain/aggregate-root.js +10 -16
  82. package/dist/domain/aggregate-root.js.map +1 -1
  83. package/dist/domain/aggregate-tracking.d.ts +30 -0
  84. package/dist/domain/aggregate-tracking.d.ts.map +1 -0
  85. package/dist/domain/aggregate-tracking.js +48 -0
  86. package/dist/domain/aggregate-tracking.js.map +1 -0
  87. package/dist/domain/domain-event.d.ts +4 -0
  88. package/dist/domain/domain-event.d.ts.map +1 -1
  89. package/dist/domain/domain-event.js.map +1 -1
  90. package/dist/domain/errors/domain-error.d.ts.map +1 -1
  91. package/dist/domain/errors/domain-error.js +2 -1
  92. package/dist/domain/errors/domain-error.js.map +1 -1
  93. package/dist/domain/errors/factual-refusal.d.ts.map +1 -1
  94. package/dist/domain/errors/factual-refusal.js +3 -0
  95. package/dist/domain/errors/factual-refusal.js.map +1 -1
  96. package/dist/domain/errors/kit-codes.d.ts +2 -0
  97. package/dist/domain/errors/kit-codes.d.ts.map +1 -1
  98. package/dist/domain/errors/kit-codes.js +2 -0
  99. package/dist/domain/errors/kit-codes.js.map +1 -1
  100. package/dist/domain/event-id-of.d.ts +8 -0
  101. package/dist/domain/event-id-of.d.ts.map +1 -0
  102. package/dist/domain/event-id-of.js +10 -0
  103. package/dist/domain/event-id-of.js.map +1 -0
  104. package/dist/domain/event-rank.d.ts +8 -0
  105. package/dist/domain/event-rank.d.ts.map +1 -0
  106. package/dist/domain/event-rank.js +8 -0
  107. package/dist/domain/event-rank.js.map +1 -0
  108. package/dist/domain/event-sourcing/event-sourced-aggregate.d.ts +0 -1
  109. package/dist/domain/event-sourcing/event-sourced-aggregate.d.ts.map +1 -1
  110. package/dist/domain/event-sourcing/event-sourced-aggregate.js +4 -8
  111. package/dist/domain/event-sourcing/event-sourced-aggregate.js.map +1 -1
  112. package/dist/domain/named-domain-event.d.ts +11 -4
  113. package/dist/domain/named-domain-event.d.ts.map +1 -1
  114. package/dist/domain/named-domain-event.js +14 -3
  115. package/dist/domain/named-domain-event.js.map +1 -1
  116. package/dist/domain/rank-of.d.ts +8 -0
  117. package/dist/domain/rank-of.d.ts.map +1 -0
  118. package/dist/domain/rank-of.js +14 -0
  119. package/dist/domain/rank-of.js.map +1 -0
  120. package/dist/domain/ranked.d.ts +10 -0
  121. package/dist/domain/ranked.d.ts.map +1 -0
  122. package/dist/domain/ranked.js +19 -0
  123. package/dist/domain/ranked.js.map +1 -0
  124. package/dist/domain/result/unwrap.d.ts +1 -0
  125. package/dist/domain/result/unwrap.d.ts.map +1 -1
  126. package/dist/domain/result/unwrap.js +4 -1
  127. package/dist/domain/result/unwrap.js.map +1 -1
  128. package/dist/domain/state-machine/state-machine.d.ts +4 -0
  129. package/dist/domain/state-machine/state-machine.d.ts.map +1 -1
  130. package/dist/domain/state-machine/state-machine.js +14 -4
  131. package/dist/domain/state-machine/state-machine.js.map +1 -1
  132. package/dist/domain/value-object/frozen-copy.d.ts +8 -0
  133. package/dist/domain/value-object/frozen-copy.d.ts.map +1 -0
  134. package/dist/domain/value-object/frozen-copy.js +34 -0
  135. package/dist/domain/value-object/frozen-copy.js.map +1 -0
  136. package/dist/domain/value-object/index.d.ts +2 -0
  137. package/dist/domain/value-object/index.d.ts.map +1 -0
  138. package/dist/domain/value-object/index.js +2 -0
  139. package/dist/domain/value-object/index.js.map +1 -0
  140. package/dist/domain/value-object/is-plain-record.d.ts +3 -0
  141. package/dist/domain/value-object/is-plain-record.d.ts.map +1 -0
  142. package/dist/domain/value-object/is-plain-record.js +9 -0
  143. package/dist/domain/value-object/is-plain-record.js.map +1 -0
  144. package/dist/domain/value-object/same-value.d.ts +8 -0
  145. package/dist/domain/value-object/same-value.d.ts.map +1 -0
  146. package/dist/domain/value-object/same-value.js +43 -0
  147. package/dist/domain/value-object/same-value.js.map +1 -0
  148. package/dist/domain/value-object/value-object.d.ts +28 -0
  149. package/dist/domain/value-object/value-object.d.ts.map +1 -0
  150. package/dist/domain/value-object/value-object.js +24 -0
  151. package/dist/domain/value-object/value-object.js.map +1 -0
  152. package/dist/index.d.ts +9 -12
  153. package/dist/index.d.ts.map +1 -1
  154. package/dist/index.js +9 -12
  155. package/dist/index.js.map +1 -1
  156. package/dist/infrastructure/aggregates/aggregate-mapper.d.ts +21 -0
  157. package/dist/infrastructure/aggregates/aggregate-mapper.d.ts.map +1 -0
  158. package/dist/infrastructure/aggregates/aggregate-mapper.js +18 -0
  159. package/dist/infrastructure/aggregates/aggregate-mapper.js.map +1 -0
  160. package/dist/infrastructure/aggregates/aggregate-save.d.ts +22 -0
  161. package/dist/infrastructure/aggregates/aggregate-save.d.ts.map +1 -0
  162. package/dist/infrastructure/aggregates/aggregate-save.js +2 -0
  163. package/dist/infrastructure/aggregates/aggregate-save.js.map +1 -0
  164. package/dist/infrastructure/aggregates/as-found.d.ts +8 -0
  165. package/dist/infrastructure/aggregates/as-found.d.ts.map +1 -0
  166. package/dist/infrastructure/aggregates/as-found.js +2 -0
  167. package/dist/infrastructure/aggregates/as-found.js.map +1 -0
  168. package/dist/infrastructure/aggregates/give-back.d.ts +9 -0
  169. package/dist/infrastructure/aggregates/give-back.d.ts.map +1 -0
  170. package/dist/infrastructure/aggregates/give-back.js +13 -0
  171. package/dist/infrastructure/aggregates/give-back.js.map +1 -0
  172. package/dist/infrastructure/aggregates/index.d.ts +7 -0
  173. package/dist/infrastructure/aggregates/index.d.ts.map +1 -0
  174. package/dist/infrastructure/aggregates/index.js +7 -0
  175. package/dist/infrastructure/aggregates/index.js.map +1 -0
  176. package/dist/infrastructure/aggregates/loaded-at.d.ts +8 -0
  177. package/dist/infrastructure/aggregates/loaded-at.d.ts.map +1 -0
  178. package/dist/infrastructure/aggregates/loaded-at.js +12 -0
  179. package/dist/infrastructure/aggregates/loaded-at.js.map +1 -0
  180. package/dist/infrastructure/aggregates/noted-as-found.d.ts +8 -0
  181. package/dist/infrastructure/aggregates/noted-as-found.d.ts.map +1 -0
  182. package/dist/infrastructure/aggregates/noted-as-found.js +15 -0
  183. package/dist/infrastructure/aggregates/noted-as-found.js.map +1 -0
  184. package/dist/infrastructure/aggregates/recorded-events-of.d.ts +4 -0
  185. package/dist/infrastructure/aggregates/recorded-events-of.d.ts.map +1 -0
  186. package/dist/infrastructure/aggregates/recorded-events-of.js +6 -0
  187. package/dist/infrastructure/aggregates/recorded-events-of.js.map +1 -0
  188. package/dist/infrastructure/aggregates/save-aggregate-row.d.ts +23 -0
  189. package/dist/infrastructure/aggregates/save-aggregate-row.d.ts.map +1 -0
  190. package/dist/infrastructure/aggregates/save-aggregate-row.js +17 -0
  191. package/dist/infrastructure/aggregates/save-aggregate-row.js.map +1 -0
  192. package/dist/infrastructure/aggregates/stored-at.d.ts +7 -0
  193. package/dist/infrastructure/aggregates/stored-at.d.ts.map +1 -0
  194. package/dist/infrastructure/aggregates/stored-at.js +14 -0
  195. package/dist/infrastructure/aggregates/stored-at.js.map +1 -0
  196. package/dist/infrastructure/aggregates/take-recorded-events.d.ts +9 -0
  197. package/dist/infrastructure/aggregates/take-recorded-events.d.ts.map +1 -0
  198. package/dist/infrastructure/aggregates/take-recorded-events.js +17 -0
  199. package/dist/infrastructure/aggregates/take-recorded-events.js.map +1 -0
  200. package/dist/infrastructure/aggregates/unstored-events-of.d.ts +4 -0
  201. package/dist/infrastructure/aggregates/unstored-events-of.d.ts.map +1 -0
  202. package/dist/infrastructure/aggregates/unstored-events-of.js +7 -0
  203. package/dist/infrastructure/aggregates/unstored-events-of.js.map +1 -0
  204. package/dist/infrastructure/clock/fixed-clock.d.ts +2 -1
  205. package/dist/infrastructure/clock/fixed-clock.d.ts.map +1 -1
  206. package/dist/infrastructure/clock/fixed-clock.js +5 -4
  207. package/dist/infrastructure/clock/fixed-clock.js.map +1 -1
  208. package/dist/infrastructure/context/scoped-actor-context.d.ts.map +1 -1
  209. package/dist/infrastructure/context/scoped-actor-context.js +2 -6
  210. package/dist/infrastructure/context/scoped-actor-context.js.map +1 -1
  211. package/dist/infrastructure/domain-events/announce-domain-events.d.ts +1 -1
  212. package/dist/infrastructure/domain-events/announce-domain-events.js +1 -1
  213. package/dist/infrastructure/domain-events/dispatching-on-save.d.ts +1 -1
  214. package/dist/infrastructure/domain-events/dispatching-on-save.d.ts.map +1 -1
  215. package/dist/infrastructure/domain-events/dispatching-on-save.js +3 -2
  216. package/dist/infrastructure/domain-events/dispatching-on-save.js.map +1 -1
  217. package/dist/infrastructure/domain-events/index.d.ts +13 -0
  218. package/dist/infrastructure/domain-events/index.d.ts.map +1 -0
  219. package/dist/infrastructure/domain-events/index.js +13 -0
  220. package/dist/infrastructure/domain-events/index.js.map +1 -0
  221. package/dist/infrastructure/domain-events/recorded-aggregates.d.ts +2 -5
  222. package/dist/infrastructure/domain-events/recorded-aggregates.d.ts.map +1 -1
  223. package/dist/infrastructure/domain-events/recorded-aggregates.js +3 -5
  224. package/dist/infrastructure/domain-events/recorded-aggregates.js.map +1 -1
  225. package/dist/infrastructure/domain-events/unit-of-work-aborted-error.d.ts +10 -0
  226. package/dist/infrastructure/domain-events/unit-of-work-aborted-error.d.ts.map +1 -0
  227. package/dist/infrastructure/domain-events/unit-of-work-aborted-error.js +13 -0
  228. package/dist/infrastructure/domain-events/unit-of-work-aborted-error.js.map +1 -0
  229. package/dist/infrastructure/domain-events/unit-of-work-over.d.ts +43 -0
  230. package/dist/infrastructure/domain-events/unit-of-work-over.d.ts.map +1 -0
  231. package/dist/infrastructure/domain-events/unit-of-work-over.js +132 -0
  232. package/dist/infrastructure/domain-events/unit-of-work-over.js.map +1 -0
  233. package/dist/infrastructure/domain-events/unit-of-work-scope.d.ts +9 -1
  234. package/dist/infrastructure/domain-events/unit-of-work-scope.d.ts.map +1 -1
  235. package/dist/infrastructure/domain-events/unit-of-work-scope.js.map +1 -1
  236. package/dist/infrastructure/domain-events/unscoped-unit-of-work-error.d.ts +8 -0
  237. package/dist/infrastructure/domain-events/unscoped-unit-of-work-error.d.ts.map +1 -0
  238. package/dist/infrastructure/domain-events/unscoped-unit-of-work-error.js +11 -0
  239. package/dist/infrastructure/domain-events/unscoped-unit-of-work-error.js.map +1 -0
  240. package/dist/infrastructure/domain-events/when-committed.d.ts.map +1 -1
  241. package/dist/infrastructure/domain-events/when-committed.js +2 -9
  242. package/dist/infrastructure/domain-events/when-committed.js.map +1 -1
  243. package/dist/infrastructure/event-sourcing/aggregate-id-of.d.ts +4 -0
  244. package/dist/infrastructure/event-sourcing/aggregate-id-of.d.ts.map +1 -0
  245. package/dist/infrastructure/event-sourcing/aggregate-id-of.js +6 -0
  246. package/dist/infrastructure/event-sourcing/aggregate-id-of.js.map +1 -0
  247. package/dist/infrastructure/event-sourcing/event-serializer.d.ts +3 -4
  248. package/dist/infrastructure/event-sourcing/event-serializer.d.ts.map +1 -1
  249. package/dist/infrastructure/event-sourcing/event-serializer.js +10 -12
  250. package/dist/infrastructure/event-sourcing/event-serializer.js.map +1 -1
  251. package/dist/infrastructure/event-sourcing/event-store-personal-data-export.d.ts.map +1 -1
  252. package/dist/infrastructure/event-sourcing/event-store-personal-data-export.js +1 -5
  253. package/dist/infrastructure/event-sourcing/event-store-personal-data-export.js.map +1 -1
  254. package/dist/infrastructure/events/idempotent.d.ts.map +1 -1
  255. package/dist/infrastructure/events/idempotent.js +9 -3
  256. package/dist/infrastructure/events/idempotent.js.map +1 -1
  257. package/dist/infrastructure/in-memory/as-json-carries.d.ts +9 -0
  258. package/dist/infrastructure/in-memory/as-json-carries.d.ts.map +1 -0
  259. package/dist/infrastructure/in-memory/as-json-carries.js +12 -0
  260. package/dist/infrastructure/in-memory/as-json-carries.js.map +1 -0
  261. package/dist/infrastructure/in-memory/composite-key.d.ts +6 -0
  262. package/dist/infrastructure/in-memory/composite-key.d.ts.map +1 -0
  263. package/dist/infrastructure/in-memory/composite-key.js +8 -0
  264. package/dist/infrastructure/in-memory/composite-key.js.map +1 -0
  265. package/dist/infrastructure/in-memory/in-memory-cache.d.ts +3 -1
  266. package/dist/infrastructure/in-memory/in-memory-cache.d.ts.map +1 -1
  267. package/dist/infrastructure/in-memory/in-memory-cache.js +7 -3
  268. package/dist/infrastructure/in-memory/in-memory-cache.js.map +1 -1
  269. package/dist/infrastructure/in-memory/in-memory-domain-event-dispatcher.d.ts +0 -1
  270. package/dist/infrastructure/in-memory/in-memory-domain-event-dispatcher.d.ts.map +1 -1
  271. package/dist/infrastructure/in-memory/in-memory-domain-event-dispatcher.js +2 -9
  272. package/dist/infrastructure/in-memory/in-memory-domain-event-dispatcher.js.map +1 -1
  273. package/dist/infrastructure/in-memory/in-memory-event-bus.d.ts +7 -14
  274. package/dist/infrastructure/in-memory/in-memory-event-bus.d.ts.map +1 -1
  275. package/dist/infrastructure/in-memory/in-memory-event-bus.js +17 -9
  276. package/dist/infrastructure/in-memory/in-memory-event-bus.js.map +1 -1
  277. package/dist/infrastructure/in-memory/in-memory-event-store.d.ts +1 -0
  278. package/dist/infrastructure/in-memory/in-memory-event-store.d.ts.map +1 -1
  279. package/dist/infrastructure/in-memory/in-memory-event-store.js +11 -10
  280. package/dist/infrastructure/in-memory/in-memory-event-store.js.map +1 -1
  281. package/dist/infrastructure/in-memory/in-memory-process-store.d.ts.map +1 -1
  282. package/dist/infrastructure/in-memory/in-memory-process-store.js +4 -6
  283. package/dist/infrastructure/in-memory/in-memory-process-store.js.map +1 -1
  284. package/dist/infrastructure/in-memory/in-memory-processed-event-store.d.ts.map +1 -1
  285. package/dist/infrastructure/in-memory/in-memory-processed-event-store.js +3 -6
  286. package/dist/infrastructure/in-memory/in-memory-processed-event-store.js.map +1 -1
  287. package/dist/infrastructure/in-memory/in-memory-unit-of-work.d.ts +4 -2
  288. package/dist/infrastructure/in-memory/in-memory-unit-of-work.d.ts.map +1 -1
  289. package/dist/infrastructure/in-memory/in-memory-unit-of-work.js +6 -4
  290. package/dist/infrastructure/in-memory/in-memory-unit-of-work.js.map +1 -1
  291. package/dist/infrastructure/in-memory/in-process-bus.d.ts +1 -0
  292. package/dist/infrastructure/in-memory/in-process-bus.d.ts.map +1 -1
  293. package/dist/infrastructure/in-memory/in-process-bus.js +4 -3
  294. package/dist/infrastructure/in-memory/in-process-bus.js.map +1 -1
  295. package/dist/infrastructure/in-memory/unit-of-work-middleware.d.ts +5 -5
  296. package/dist/infrastructure/in-memory/unit-of-work-middleware.d.ts.map +1 -1
  297. package/dist/infrastructure/in-memory/unit-of-work-middleware.js +13 -4
  298. package/dist/infrastructure/in-memory/unit-of-work-middleware.js.map +1 -1
  299. package/package.json +1 -1
  300. package/dist/domain/event-sourcing/unstored-events.d.ts +0 -8
  301. package/dist/domain/event-sourcing/unstored-events.d.ts.map +0 -1
  302. package/dist/domain/event-sourcing/unstored-events.js +0 -7
  303. package/dist/domain/event-sourcing/unstored-events.js.map +0 -1
  304. package/dist/domain/value-object.d.ts +0 -12
  305. package/dist/domain/value-object.d.ts.map +0 -1
  306. package/dist/domain/value-object.js +0 -40
  307. package/dist/domain/value-object.js.map +0 -1
  308. package/dist/infrastructure/domain-events/within-unit-of-work.d.ts +0 -25
  309. package/dist/infrastructure/domain-events/within-unit-of-work.d.ts.map +0 -1
  310. package/dist/infrastructure/domain-events/within-unit-of-work.js +0 -85
  311. package/dist/infrastructure/domain-events/within-unit-of-work.js.map +0 -1
  312. package/dist/infrastructure/event-sourcing/stored-origins.d.ts +0 -5
  313. package/dist/infrastructure/event-sourcing/stored-origins.d.ts.map +0 -1
  314. package/dist/infrastructure/event-sourcing/stored-origins.js +0 -3
  315. package/dist/infrastructure/event-sourcing/stored-origins.js.map +0 -1
  316. package/dist/infrastructure/event-sourcing/stored-stamp-of.d.ts +0 -11
  317. package/dist/infrastructure/event-sourcing/stored-stamp-of.d.ts.map +0 -1
  318. package/dist/infrastructure/event-sourcing/stored-stamp-of.js +0 -15
  319. package/dist/infrastructure/event-sourcing/stored-stamp-of.js.map +0 -1
@@ -5,7 +5,7 @@ import type { DomainEvent } from '../../domain/domain-event.js';
5
5
  * Hands over the events a save pulled from its aggregates.
6
6
  *
7
7
  * Inside a unit of work they only join its queue, behind what earlier saves recorded: the unit
8
- * of work dispatches them at its end, before the commit (`withinUnitOfWork`), and the promise
8
+ * of work dispatches them at its end, before the commit (`unitOfWorkOver`), and the promise
9
9
  * resolves at once.
10
10
  *
11
11
  * Outside of any, the save is all there is to wait for: they are dispatched now, `before-commit`
@@ -9,7 +9,7 @@ import { unitOfWorkScope } from './unit-of-work-scope.js';
9
9
  * Hands over the events a save pulled from its aggregates.
10
10
  *
11
11
  * Inside a unit of work they only join its queue, behind what earlier saves recorded: the unit
12
- * of work dispatches them at its end, before the commit (`withinUnitOfWork`), and the promise
12
+ * of work dispatches them at its end, before the commit (`unitOfWorkOver`), and the promise
13
13
  * resolves at once.
14
14
  *
15
15
  * Outside of any, the save is all there is to wait for: they are dispatched now, `before-commit`
@@ -16,7 +16,7 @@ type Scoping = () => ExecutionScope | undefined;
16
16
  * The repository is wrapped in place, as tracing and the aspects do, so the same object is
17
17
  * answered and wrapping twice is a no-op; a sealed or frozen one is fronted by a proxy. The
18
18
  * dispatcher is asked for at each dispatch. An adapter contains no dispatch code: one that
19
- * pulls the events itself leaves nothing to dispatch here.
19
+ * takes the events itself leaves nothing to dispatch here.
20
20
  *
21
21
  * Given the execution scope, the handlers run in the execution context of the save (its tenant, its
22
22
  * actor, its correlation id), also when the unit of work that dispatches them was opened in another:
@@ -1 +1 @@
1
- {"version":3,"file":"dispatching-on-save.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/dispatching-on-save.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAQ9E,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;AAEjE,6GAA6G;AAC7G,KAAK,OAAO,GAAG,MAAM,cAAc,GAAG,SAAS,CAAC;AAIhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,CAgB9G"}
1
+ {"version":3,"file":"dispatching-on-save.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/dispatching-on-save.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAS9E,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;AAEjE,6GAA6G;AAC7G,KAAK,OAAO,GAAG,MAAM,cAAc,GAAG,SAAS,CAAC;AAIhD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,CAgB9G"}
@@ -1,3 +1,4 @@
1
+ import { takeRecordedEvents } from '../aggregates/take-recorded-events.js';
1
2
  import { announceDomainEvents } from './announce-domain-events.js';
2
3
  import { recordedAggregates } from './recorded-aggregates.js';
3
4
  import { SaveAfterCommitError } from './save-after-commit-error.js';
@@ -16,7 +17,7 @@ const wrapped = new WeakSet();
16
17
  * The repository is wrapped in place, as tracing and the aspects do, so the same object is
17
18
  * answered and wrapping twice is a no-op; a sealed or frozen one is fronted by a proxy. The
18
19
  * dispatcher is asked for at each dispatch. An adapter contains no dispatch code: one that
19
- * pulls the events itself leaves nothing to dispatch here.
20
+ * takes the events itself leaves nothing to dispatch here.
20
21
  *
21
22
  * Given the execution scope, the handlers run in the execution context of the save (its tenant, its
22
23
  * actor, its correlation id), also when the unit of work that dispatches them was opened in another:
@@ -58,7 +59,7 @@ function isMethod(value) {
58
59
  function announcing(original, dispatcher, scope) {
59
60
  const announced = async (args, result) => {
60
61
  const value = await result;
61
- await announceDomainEvents(recordedAggregates(args).flatMap((aggregate) => aggregate.pullEvents()), dispatcher(), scope?.());
62
+ await announceDomainEvents(recordedAggregates(args).flatMap(takeRecordedEvents), dispatcher(), scope?.());
62
63
  return value;
63
64
  };
64
65
  const wrapper = original.constructor.name === 'AsyncFunction'
@@ -1 +1 @@
1
- {"version":3,"file":"dispatching-on-save.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/dispatching-on-save.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AASvD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAU,CAAC;AAEtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,iBAAiB,CAAmB,UAAa,EAAE,UAAuB,EAAE,KAAe;IACzG,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE3C,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QACnD,QAAQ,CAAC,GAAG,CAA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C,EAAE,CAAC;QAChG,MAAM,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AAC5G,CAAC;AAED,SAAS,QAAQ,CAAmB,QAAW,EAAE,QAAqC;IACpF,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,UAAU,IAAI,KAAK,CAAC;QAExF,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,gHAAgH;AAChH,SAAS,OAAO,CAAmB,QAAW,EAAE,QAAqC;IACnF,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE;QACzB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAiB;YACrC,MAAM,OAAO,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAElF,OAAO,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC5D,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from './after-commit.js';
2
+ export * from './announce-domain-events.js';
3
+ export * from './at-commit.js';
4
+ export * from './commit-step.js';
5
+ export * from './dispatching-on-save.js';
6
+ export * from './report-after-commit-failures.js';
7
+ export * from './save-after-commit-error.js';
8
+ export * from './unit-of-work-aborted-error.js';
9
+ export * from './unit-of-work-over.js';
10
+ export * from './unit-of-work-stage.js';
11
+ export * from './unscoped-unit-of-work-error.js';
12
+ export * from './when-committed.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,13 @@
1
+ export * from './after-commit.js';
2
+ export * from './announce-domain-events.js';
3
+ export * from './at-commit.js';
4
+ export * from './commit-step.js';
5
+ export * from './dispatching-on-save.js';
6
+ export * from './report-after-commit-failures.js';
7
+ export * from './save-after-commit-error.js';
8
+ export * from './unit-of-work-aborted-error.js';
9
+ export * from './unit-of-work-over.js';
10
+ export * from './unit-of-work-stage.js';
11
+ export * from './unscoped-unit-of-work-error.js';
12
+ export * from './when-committed.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC"}
@@ -1,10 +1,7 @@
1
- import type { AggregateRoot } from '../../domain/aggregate-root.js';
2
- type EventSource = Pick<AggregateRoot<string | number>, 'pullEvents'>;
3
1
  /**
4
2
  * The aggregates among the arguments of a call, given as such or in arrays, in the order
5
- * written. Recognised by what they do, not by their class: a context compiled apart extends
3
+ * written. Recognised by what they carry, not by their class: a context compiled apart extends
6
4
  * its own copy of `AggregateRoot`.
7
5
  */
8
- export declare function recordedAggregates(args: readonly unknown[]): EventSource[];
9
- export {};
6
+ export declare function recordedAggregates(args: readonly unknown[]): object[];
10
7
  //# sourceMappingURL=recorded-aggregates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recorded-aggregates.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/recorded-aggregates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,KAAK,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,WAAW,EAAE,CAE1E"}
1
+ {"version":3,"file":"recorded-aggregates.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/recorded-aggregates.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,EAAE,CAErE"}
@@ -1,15 +1,13 @@
1
+ import { AggregateTracking } from '../../domain/aggregate-tracking.js';
1
2
  /**
2
3
  * The aggregates among the arguments of a call, given as such or in arrays, in the order
3
- * written. Recognised by what they do, not by their class: a context compiled apart extends
4
+ * written. Recognised by what they carry, not by their class: a context compiled apart extends
4
5
  * its own copy of `AggregateRoot`.
5
6
  */
6
7
  export function recordedAggregates(args) {
7
- return args.flatMap(listOf).filter(isEventSource);
8
+ return args.flatMap(listOf).filter((argument) => AggregateTracking.follows(argument));
8
9
  }
9
10
  function listOf(argument) {
10
11
  return Array.isArray(argument) ? argument : [argument];
11
12
  }
12
- function isEventSource(value) {
13
- return typeof value === 'object' && value !== null && 'pullEvents' in value && typeof value.pullEvents === 'function';
14
- }
15
13
  //# sourceMappingURL=recorded-aggregates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recorded-aggregates.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/recorded-aggregates.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAwB;IACzD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,MAAM,CAAC,QAAiB;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,YAAY,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,CAAC;AACxH,CAAC"}
1
+ {"version":3,"file":"recorded-aggregates.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/recorded-aggregates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAwB;IACzD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,SAAS,MAAM,CAAC,QAAiB;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A `run` that joined the unit of work failed, and its failure did not reach the outermost one:
3
+ * the work caught it and went on. What that run wrote before it failed is in the transaction, so
4
+ * committing would keep a part of it: the unit of work rolls back as a whole instead. The
5
+ * failure of the joined run is the `cause`.
6
+ */
7
+ export declare class UnitOfWorkAbortedError extends Error {
8
+ constructor(cause: unknown);
9
+ }
10
+ //# sourceMappingURL=unit-of-work-aborted-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit-of-work-aborted-error.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-aborted-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,KAAK,EAAE,OAAO,EAOzB;CACF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * A `run` that joined the unit of work failed, and its failure did not reach the outermost one:
3
+ * the work caught it and went on. What that run wrote before it failed is in the transaction, so
4
+ * committing would keep a part of it: the unit of work rolls back as a whole instead. The
5
+ * failure of the joined run is the `cause`.
6
+ */
7
+ export class UnitOfWorkAbortedError extends Error {
8
+ constructor(cause) {
9
+ super('A run that joined this unit of work failed and its failure was caught: nothing of the unit of work is committed. Let the failure reach the outermost run, or decide before the write instead of catching after it.', { cause });
10
+ this.name = 'UnitOfWorkAbortedError';
11
+ }
12
+ }
13
+ //# sourceMappingURL=unit-of-work-aborted-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit-of-work-aborted-error.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-aborted-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,KAAc;QACxB,KAAK,CACH,oNAAoN,EACpN,EAAE,KAAK,EAAE,CACV,CAAC;QAEF,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF"}
@@ -0,0 +1,43 @@
1
+ import type { UnitOfWork } from '../../application/ports/unit-of-work.js';
2
+ /** Runs what it is given atomically: it begins, calls it, and commits when it resolved or rolls back when it rejected. */
3
+ type Transaction = <T>(work: () => Promise<T>) => Promise<T>;
4
+ export interface UnitOfWorkOverOptions {
5
+ /**
6
+ * False when `transaction` undoes nothing of what the work wrote, as a unit of work in memory:
7
+ * the aggregates then stay as their saves left them, in step with what was stored.
8
+ */
9
+ readonly rollsBack?: boolean;
10
+ }
11
+ /**
12
+ * What every `UnitOfWork` is made of: the unit of work over the transactions of one database.
13
+ *
14
+ * The domain events of the aggregates saved by the work of a `run` wait in the scope of this
15
+ * unit of work, in recording order across the saves. Once the work has returned they are
16
+ * dispatched, still inside `transaction`: the handlers see every save, and what they save or
17
+ * append to the outbox commits with the rest. A handler that fails, like the work that fails,
18
+ * rejects the whole: the transaction rolls back, the waiting events reach no handler, and the
19
+ * aggregates the work saved are put back as it found them, at the version they were loaded at and
20
+ * with the events they had recorded, so the same instances can be saved again. The steps handed to
21
+ * `atCommit` are applied last, still inside
22
+ * `transaction`; when it rejects, those applied are undone. Once `transaction` has resolved, and
23
+ * only then, the `after-commit` handlers run, then the work handed to `afterCommit`.
24
+ *
25
+ * A deadlock or a serialization failure the database raised anywhere in the transaction, on the
26
+ * statement it chose, rejects the outermost `run` as a `TransactionConflictError`, a
27
+ * `ConcurrencyError` whose `cause` is the error of the driver: the caller runs it again. A
28
+ * transaction its ORM could not start in time, the pool being busy, or ended for running too
29
+ * long rejects it as a `TransactionTimeoutError` (`SERVICE_UNAVAILABLE`), the same way.
30
+ *
31
+ * `transaction` is called to open one, never to join: a `run` called while a transaction of
32
+ * this unit of work is open on the asynchronous call chain joins it, its work and nothing else,
33
+ * so one dispatch, at the end of the outermost. A unit of work over another database is another
34
+ * one, wherever it is called from: its own transaction, and its own events dispatched before its
35
+ * own commit. Two concurrent calls never share a scope.
36
+ *
37
+ * It commits or rolls back as a whole: once a `run` that joined has failed, the outermost one
38
+ * rejects, with that failure when it travelled up, with a `UnitOfWorkAbortedError` whose
39
+ * `cause` it is when the work caught it, a retry that then succeeded included.
40
+ */
41
+ export declare function unitOfWorkOver(transaction: Transaction, { rollsBack }?: UnitOfWorkOverOptions): UnitOfWork;
42
+ export {};
43
+ //# sourceMappingURL=unit-of-work-over.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit-of-work-over.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-over.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAYvE,0HAA0H;AAC1H,KAAK,WAAW,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7D,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,SAAgB,EAAE,GAAE,qBAA0B,GAAG,UAAU,CAmBrH"}
@@ -0,0 +1,132 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
2
+ import { TransactionConflictError } from '../../domain/errors/transaction-conflict-error.js';
3
+ import { isTransactionConflict } from '../persistence/is-transaction-conflict.js';
4
+ import { isTransactionTimeout } from '../persistence/is-transaction-timeout.js';
5
+ import { TransactionTimeoutError } from '../persistence/transaction-timeout-error.js';
6
+ import { giveBack } from '../aggregates/give-back.js';
7
+ import { dispatchAfterCommit } from './dispatch-after-commit.js';
8
+ import { dispatchBeforeCommit } from './dispatch-before-commit.js';
9
+ import { UnitOfWorkAbortedError } from './unit-of-work-aborted-error.js';
10
+ import { unitOfWorkScope } from './unit-of-work-scope.js';
11
+ /**
12
+ * What every `UnitOfWork` is made of: the unit of work over the transactions of one database.
13
+ *
14
+ * The domain events of the aggregates saved by the work of a `run` wait in the scope of this
15
+ * unit of work, in recording order across the saves. Once the work has returned they are
16
+ * dispatched, still inside `transaction`: the handlers see every save, and what they save or
17
+ * append to the outbox commits with the rest. A handler that fails, like the work that fails,
18
+ * rejects the whole: the transaction rolls back, the waiting events reach no handler, and the
19
+ * aggregates the work saved are put back as it found them, at the version they were loaded at and
20
+ * with the events they had recorded, so the same instances can be saved again. The steps handed to
21
+ * `atCommit` are applied last, still inside
22
+ * `transaction`; when it rejects, those applied are undone. Once `transaction` has resolved, and
23
+ * only then, the `after-commit` handlers run, then the work handed to `afterCommit`.
24
+ *
25
+ * A deadlock or a serialization failure the database raised anywhere in the transaction, on the
26
+ * statement it chose, rejects the outermost `run` as a `TransactionConflictError`, a
27
+ * `ConcurrencyError` whose `cause` is the error of the driver: the caller runs it again. A
28
+ * transaction its ORM could not start in time, the pool being busy, or ended for running too
29
+ * long rejects it as a `TransactionTimeoutError` (`SERVICE_UNAVAILABLE`), the same way.
30
+ *
31
+ * `transaction` is called to open one, never to join: a `run` called while a transaction of
32
+ * this unit of work is open on the asynchronous call chain joins it, its work and nothing else,
33
+ * so one dispatch, at the end of the outermost. A unit of work over another database is another
34
+ * one, wherever it is called from: its own transaction, and its own events dispatched before its
35
+ * own commit. Two concurrent calls never share a scope.
36
+ *
37
+ * It commits or rolls back as a whole: once a `run` that joined has failed, the outermost one
38
+ * rejects, with that failure when it travelled up, with a `UnitOfWorkAbortedError` whose
39
+ * `cause` it is when the work caught it, a retry that then succeeded included.
40
+ */
41
+ export function unitOfWorkOver(transaction, { rollsBack = true } = {}) {
42
+ // The scope of the transaction of this unit of work open on the asynchronous call chain.
43
+ const open = new AsyncLocalStorage();
44
+ return {
45
+ run(work) {
46
+ const joined = open.getStore();
47
+ if (isRunning(joined)) {
48
+ return joining(joined, work);
49
+ }
50
+ const scope = openScope(rollsBack);
51
+ return opened(work, scope, (scoped) => open.run(scope, () => unitOfWorkScope.run(scope, () => transaction(scoped))));
52
+ },
53
+ };
54
+ }
55
+ /** The work of a run that joined: its failure aborts the unit of work, whatever the caller does with it. */
56
+ async function joining(scope, work) {
57
+ try {
58
+ return await unitOfWorkScope.run(scope, work);
59
+ }
60
+ catch (error) {
61
+ scope.abortedBy ??= { failure: error };
62
+ throw error;
63
+ }
64
+ }
65
+ /** The outermost run: the work, the dispatch and the commit steps inside `transaction`, the rest once it resolved. */
66
+ async function opened(work, scope, transaction) {
67
+ const applied = [];
68
+ const result = await transaction(() => thenDispatched(work, scope, applied))
69
+ .catch(async (error) => {
70
+ giveBack(scope.found);
71
+ await undone(applied);
72
+ throw translated(error);
73
+ })
74
+ .finally(() => {
75
+ scope.stage = 'closed';
76
+ scope.queue.length = 0;
77
+ });
78
+ await afterTheCommit(scope);
79
+ return result;
80
+ }
81
+ /** What the database said of the transaction, in the words of the kernel; any other failure as it is. */
82
+ function translated(error) {
83
+ if (isTransactionConflict(error)) {
84
+ return new TransactionConflictError(error);
85
+ }
86
+ return isTransactionTimeout(error) ? new TransactionTimeoutError(error) : error;
87
+ }
88
+ function isRunning(scope) {
89
+ return scope?.kind === 'unit-of-work' && (scope.stage === 'open' || scope.stage === 'before-commit');
90
+ }
91
+ function openScope(rollsBack) {
92
+ const scope = {
93
+ kind: 'unit-of-work',
94
+ stage: 'open',
95
+ queue: [],
96
+ dispatched: [],
97
+ committed: [],
98
+ atCommit: [],
99
+ };
100
+ return rollsBack ? { ...scope, found: new Map() } : scope;
101
+ }
102
+ async function thenDispatched(work, scope, applied) {
103
+ const result = await work();
104
+ refuseAborted(scope);
105
+ await dispatchBeforeCommit(scope);
106
+ refuseAborted(scope);
107
+ for (const step of scope.atCommit ?? []) {
108
+ await step.apply();
109
+ applied.push(step);
110
+ }
111
+ return result;
112
+ }
113
+ /** Asked before the events leave and again before the commit: a handler may have caught such a failure too. */
114
+ function refuseAborted({ abortedBy }) {
115
+ if (abortedBy !== undefined) {
116
+ throw new UnitOfWorkAbortedError(abortedBy.failure);
117
+ }
118
+ }
119
+ /** Newest first; an undo that fails reported itself, and the others still run. */
120
+ async function undone(applied) {
121
+ for (const step of [...applied].reverse()) {
122
+ await step.undo().catch(() => undefined);
123
+ }
124
+ }
125
+ /** The `after-commit` handlers, then the work handed to `afterCommit`; a rejection is dropped, the work reported its own. */
126
+ async function afterTheCommit(scope) {
127
+ await dispatchAfterCommit(scope);
128
+ for (const work of scope.committed ?? []) {
129
+ await work().catch(() => undefined);
130
+ }
131
+ }
132
+ //# sourceMappingURL=unit-of-work-over.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unit-of-work-over.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-over.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAwB,MAAM,sBAAsB,CAAC;AAa7E;;;;;;;;;;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_hooks';
2
2
  import type { DomainEventDispatcher } from '../../application/ports/domain-event-dispatcher.js';
3
+ import type { AggregateTracking } from '../../domain/aggregate-tracking.js';
3
4
  import type { DomainEvent } from '../../domain/domain-event.js';
5
+ import type { AsFound } from '../aggregates/as-found.js';
4
6
  import type { CommitStep } from './commit-step.js';
5
7
  /** Runs the work somewhere: in an asynchronous context, in an execution context. */
6
8
  export type Within = <T>(work: () => T) => T;
@@ -15,7 +17,7 @@ export interface QueuedDomainEvent {
15
17
  readonly inContext: Within;
16
18
  }
17
19
  /**
18
- * What one unit of work has to dispatch. `unit-of-work` is opened by `withinUnitOfWork`; `save`
20
+ * What one unit of work has to dispatch. `unit-of-work` is opened by a unit of work (`unitOfWorkOver`); `save`
19
21
  * is the scope of a save made outside of any, which dispatches as soon as it resolved.
20
22
  */
21
23
  export interface UnitOfWorkScope {
@@ -25,10 +27,16 @@ export interface UnitOfWorkScope {
25
27
  readonly queue: QueuedDomainEvent[];
26
28
  /** Dispatched before the commit, in that order: what the `after-commit` phase is given. */
27
29
  readonly dispatched: QueuedDomainEvent[];
30
+ /** The first failure of a run that joined this unit of work: it no longer commits. */
31
+ abortedBy?: {
32
+ readonly failure: unknown;
33
+ };
28
34
  /** What `afterCommit` was handed in a unit of work: run after the `after-commit` handlers, never on a rollback. */
29
35
  readonly committed?: (() => Promise<void>)[];
30
36
  /** What `atCommit` was handed in a unit of work: applied last, inside the transaction. */
31
37
  readonly atCommit?: CommitStep[];
38
+ /** The aggregates saved in a unit of work whose transaction rolls back, as it found them: what a rollback gives back. */
39
+ readonly found?: Map<AggregateTracking, AsFound>;
32
40
  }
33
41
  export declare const unitOfWorkScope: AsyncLocalStorage<UnitOfWorkScope>;
34
42
  //# sourceMappingURL=unit-of-work-scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unit-of-work-scope.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAi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AAyH;IACzH,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;CAClD;AAGD,eAAO,MAAM,eAAe,oCAA2C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"unit-of-work-scope.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAoCrD,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAmB,CAAC"}
1
+ {"version":3,"file":"unit-of-work-scope.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unit-of-work-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA0CrD,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,iBAAiB,EAAmB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A command ran in a unit of work that opened no scope for the domain events: nothing would hold
3
+ * them until the end of the work, and their `after-commit` handlers would run before the commit.
4
+ */
5
+ export declare class UnscopedUnitOfWorkError extends Error {
6
+ constructor();
7
+ }
8
+ //# sourceMappingURL=unscoped-unit-of-work-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unscoped-unit-of-work-error.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unscoped-unit-of-work-error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,cAMC;CACF"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A command ran in a unit of work that opened no scope for the domain events: nothing would hold
3
+ * them until the end of the work, and their `after-commit` handlers would run before the commit.
4
+ */
5
+ export class UnscopedUnitOfWorkError extends Error {
6
+ constructor() {
7
+ super('The unit of work given to unitOfWorkMiddleware opened no scope for the domain events. Build it on unitOfWorkOver of @ddd-ts-kit/kernel, around what begins and commits its transaction, or give InMemoryUnitOfWork where there is none.');
8
+ this.name = 'UnscopedUnitOfWorkError';
9
+ }
10
+ }
11
+ //# sourceMappingURL=unscoped-unit-of-work-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unscoped-unit-of-work-error.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/unscoped-unit-of-work-error.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD;QACE,KAAK,CACH,yOAAyO,CAC1O,CAAC;QAEF,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"when-committed.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/when-committed.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC1B,MAAM,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAc,GACzC,OAAO,CAAC,IAAI,CAAC,CAUf"}
1
+ {"version":3,"file":"when-committed.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/when-committed.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC1B,MAAM,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAc,GACzC,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -1,3 +1,4 @@
1
+ import { safely } from '../../application/observation/safely.js';
1
2
  import { afterCommit } from './after-commit.js';
2
3
  import { unitOfWorkScope } from './unit-of-work-scope.js';
3
4
  /**
@@ -14,15 +15,7 @@ export async function whenCommitted(write, failed = ignored) {
14
15
  await write();
15
16
  return;
16
17
  }
17
- await afterCommit(() => write().catch((error) => tell(failed, error)));
18
- }
19
- function tell(failed, error) {
20
- try {
21
- failed(error);
22
- }
23
- catch {
24
- return;
25
- }
18
+ await afterCommit(() => write().catch((error) => safely(() => failed(error))));
26
19
  }
27
20
  function ignored() {
28
21
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"when-committed.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/when-committed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAA0B,EAC1B,MAAM,GAA6B,OAAO;IAE1C,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;IAEzC,IAAI,KAAK,EAAE,IAAI,KAAK,cAAc,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,eAAe,CAAC,EAAE,CAAC;QAClG,MAAM,KAAK,EAAE,CAAC;QAEd,OAAO;IACT,CAAC;IAED,MAAM,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,SAAS,IAAI,CAAC,MAAgC,EAAE,KAAc;IAC5D,IAAI,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;AACH,CAAC;AAED,SAAS,OAAO;IACd,OAAO,SAAS,CAAC;AACnB,CAAC"}
1
+ {"version":3,"file":"when-committed.js","sourceRoot":"","sources":["../../../src/infrastructure/domain-events/when-committed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAA0B,EAC1B,MAAM,GAA6B,OAAO;IAE1C,MAAM,KAAK,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;IAEzC,IAAI,KAAK,EAAE,IAAI,KAAK,cAAc,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,IAAI,KAAK,CAAC,KAAK,KAAK,eAAe,CAAC,EAAE,CAAC;QAClG,MAAM,KAAK,EAAE,CAAC;QAEd,OAAO;IACT,CAAC;IAED,MAAM,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1F,CAAC;AAED,SAAS,OAAO;IACd,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { StoredEvent } from '../../application/event-sourcing/stored-event.js';
2
+ /** The aggregate a stored event belongs to: the one its metadata names, else its stream. */
3
+ export declare function aggregateIdOf(stored: StoredEvent): string;
4
+ //# sourceMappingURL=aggregate-id-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate-id-of.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/event-sourcing/aggregate-id-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAEjF,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAIzD"}
@@ -0,0 +1,6 @@
1
+ /** The aggregate a stored event belongs to: the one its metadata names, else its stream. */
2
+ export function aggregateIdOf(stored) {
3
+ const declared = stored.metadata['aggregateId'];
4
+ return typeof declared === 'string' ? declared : stored.stream;
5
+ }
6
+ //# sourceMappingURL=aggregate-id-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate-id-of.js","sourceRoot":"","sources":["../../../src/infrastructure/event-sourcing/aggregate-id-of.ts"],"names":[],"mappings":"AAEA,4FAA4F;AAC5F,MAAM,UAAU,aAAa,CAAC,MAAmB;IAC/C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAEhD,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;AACjE,CAAC"}
@@ -2,25 +2,24 @@ import type { EventToAppend } from '../../application/event-sourcing/event-to-ap
2
2
  import type { StoredData } from '../../application/event-sourcing/stored-data.js';
3
3
  import type { StoredEventTypes } from '../../application/event-sourcing/stored-event-types.js';
4
4
  import type { StoredEvent } from '../../application/event-sourcing/stored-event.js';
5
- import type { IdGenerator } from '../../application/ports/id-generator.js';
6
5
  import type { DomainEvent } from '../../domain/domain-event.js';
7
6
  import { PersonalDataCipher } from './personal-data-cipher.js';
8
7
  export interface EventSerializerOptions {
9
8
  /** Seals and opens the personal values; without one, data holding a personal value is refused. */
10
9
  readonly cipher?: PersonalDataCipher;
11
- /** Gives each stored event its id. Default: a UUID. */
12
- readonly ids?: IdGenerator;
13
10
  }
14
11
  /**
15
12
  * Turns the domain events of one aggregate into stored events and back, as `defineStoredEvent`
16
13
  * declared them: the current version of their shape on the way in, and on the way out the
17
14
  * upcasters from the version they were stored with, then `decode`. Stored events are never
18
15
  * rewritten. Personal values are sealed on the way in and opened on the way out.
16
+ *
17
+ * An event is stored under its own identity (`eventIdOf`) and read back at the rank its stream
18
+ * holds it at: the event a save dispatched and the one a replay reads are stamped alike.
19
19
  */
20
20
  export declare class EventSerializer<E extends DomainEvent> {
21
21
  private readonly options;
22
22
  private readonly types;
23
- private readonly ids;
24
23
  constructor(types: StoredEventTypes<E>, options?: EventSerializerOptions);
25
24
  /** Whether events of this name are declared here: what a subscription skips otherwise. */
26
25
  declares(type: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"event-serializer.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/event-sourcing/event-serializer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAG/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAEjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,MAAM,WAAW,sBAAsB;IACrC,kGAAkG;IAClG,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IACrC,uDAAuD;IACvD,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED;;;;;GAKG;AACH,qBAAa,eAAe,CAAC,CAAC,SAAS,WAAW;IAO9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyC;IAE/D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;IAElC,YACE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,EACT,OAAO,GAAE,sBAA2B,EAWtD;IAED,0FAA0F;IAC1F,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9B;IAEK,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAW1D;IAEK,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAejD;IAED,yEAAyE;IACnE,IAA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