@ddd-ts-kit/kernel 0.8.0 → 0.10.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 (499) hide show
  1. package/README.md +207 -2
  2. package/dist/application/criteria/index.d.ts +33 -0
  3. package/dist/application/criteria/index.d.ts.map +1 -0
  4. package/dist/application/criteria/index.js +33 -0
  5. package/dist/application/criteria/index.js.map +1 -0
  6. package/dist/application/event-sourcing/appended.d.ts +8 -0
  7. package/dist/application/event-sourcing/appended.d.ts.map +1 -0
  8. package/dist/application/event-sourcing/appended.js +2 -0
  9. package/dist/application/event-sourcing/appended.js.map +1 -0
  10. package/dist/application/event-sourcing/define-stored-event.d.ts +10 -0
  11. package/dist/application/event-sourcing/define-stored-event.d.ts.map +1 -0
  12. package/dist/application/event-sourcing/define-stored-event.js +22 -0
  13. package/dist/application/event-sourcing/define-stored-event.js.map +1 -0
  14. package/dist/application/event-sourcing/erased-personal-data.d.ts +3 -0
  15. package/dist/application/event-sourcing/erased-personal-data.d.ts.map +1 -0
  16. package/dist/application/event-sourcing/erased-personal-data.js +3 -0
  17. package/dist/application/event-sourcing/erased-personal-data.js.map +1 -0
  18. package/dist/application/event-sourcing/event-envelope.d.ts +9 -0
  19. package/dist/application/event-sourcing/event-envelope.d.ts.map +1 -0
  20. package/dist/application/event-sourcing/event-envelope.js +2 -0
  21. package/dist/application/event-sourcing/event-envelope.js.map +1 -0
  22. package/dist/application/event-sourcing/event-to-append.d.ts +15 -0
  23. package/dist/application/event-sourcing/event-to-append.d.ts.map +1 -0
  24. package/dist/application/event-sourcing/event-to-append.js +2 -0
  25. package/dist/application/event-sourcing/event-to-append.js.map +1 -0
  26. package/dist/application/event-sourcing/index.d.ts +21 -0
  27. package/dist/application/event-sourcing/index.d.ts.map +1 -0
  28. package/dist/application/event-sourcing/index.js +21 -0
  29. package/dist/application/event-sourcing/index.js.map +1 -0
  30. package/dist/application/event-sourcing/is-stored-data.d.ts +5 -0
  31. package/dist/application/event-sourcing/is-stored-data.d.ts.map +1 -0
  32. package/dist/application/event-sourcing/is-stored-data.js +5 -0
  33. package/dist/application/event-sourcing/is-stored-data.js.map +1 -0
  34. package/dist/application/event-sourcing/is-stored-list.d.ts +4 -0
  35. package/dist/application/event-sourcing/is-stored-list.d.ts.map +1 -0
  36. package/dist/application/event-sourcing/is-stored-list.js +5 -0
  37. package/dist/application/event-sourcing/is-stored-list.js.map +1 -0
  38. package/dist/application/event-sourcing/personal-data.d.ts +14 -0
  39. package/dist/application/event-sourcing/personal-data.d.ts.map +1 -0
  40. package/dist/application/event-sourcing/personal-data.js +9 -0
  41. package/dist/application/event-sourcing/personal-data.js.map +1 -0
  42. package/dist/application/event-sourcing/stored-data-of.d.ts +9 -0
  43. package/dist/application/event-sourcing/stored-data-of.d.ts.map +1 -0
  44. package/dist/application/event-sourcing/stored-data-of.js +40 -0
  45. package/dist/application/event-sourcing/stored-data-of.js.map +1 -0
  46. package/dist/application/event-sourcing/stored-data.d.ts +6 -0
  47. package/dist/application/event-sourcing/stored-data.d.ts.map +1 -0
  48. package/dist/application/event-sourcing/stored-data.js +2 -0
  49. package/dist/application/event-sourcing/stored-data.js.map +1 -0
  50. package/dist/application/event-sourcing/stored-event-data.d.ts +25 -0
  51. package/dist/application/event-sourcing/stored-event-data.d.ts.map +1 -0
  52. package/dist/application/event-sourcing/stored-event-data.js +82 -0
  53. package/dist/application/event-sourcing/stored-event-data.js.map +1 -0
  54. package/dist/application/event-sourcing/stored-event-spec.d.ts +20 -0
  55. package/dist/application/event-sourcing/stored-event-spec.d.ts.map +1 -0
  56. package/dist/application/event-sourcing/stored-event-spec.js +2 -0
  57. package/dist/application/event-sourcing/stored-event-spec.js.map +1 -0
  58. package/dist/application/event-sourcing/stored-event-type.d.ts +14 -0
  59. package/dist/application/event-sourcing/stored-event-type.d.ts.map +1 -0
  60. package/dist/application/event-sourcing/stored-event-type.js +2 -0
  61. package/dist/application/event-sourcing/stored-event-type.js.map +1 -0
  62. package/dist/application/event-sourcing/stored-event-types.d.ts +9 -0
  63. package/dist/application/event-sourcing/stored-event-types.d.ts.map +1 -0
  64. package/dist/application/event-sourcing/stored-event-types.js +2 -0
  65. package/dist/application/event-sourcing/stored-event-types.js.map +1 -0
  66. package/dist/application/event-sourcing/stored-event.d.ts +12 -0
  67. package/dist/application/event-sourcing/stored-event.d.ts.map +1 -0
  68. package/dist/application/event-sourcing/stored-event.js +2 -0
  69. package/dist/application/event-sourcing/stored-event.js.map +1 -0
  70. package/dist/application/event-sourcing/stored-json.d.ts +5 -0
  71. package/dist/application/event-sourcing/stored-json.d.ts.map +1 -0
  72. package/dist/application/event-sourcing/stored-json.js +2 -0
  73. package/dist/application/event-sourcing/stored-json.js.map +1 -0
  74. package/dist/application/event-sourcing/stored-snapshot.d.ts +11 -0
  75. package/dist/application/event-sourcing/stored-snapshot.d.ts.map +1 -0
  76. package/dist/application/event-sourcing/stored-snapshot.js +2 -0
  77. package/dist/application/event-sourcing/stored-snapshot.js.map +1 -0
  78. package/dist/application/event-sourcing/subject-key.d.ts +10 -0
  79. package/dist/application/event-sourcing/subject-key.d.ts.map +1 -0
  80. package/dist/application/event-sourcing/subject-key.js +2 -0
  81. package/dist/application/event-sourcing/subject-key.js.map +1 -0
  82. package/dist/application/event-sourcing/unreadable-event-error.d.ts +5 -0
  83. package/dist/application/event-sourcing/unreadable-event-error.d.ts.map +1 -0
  84. package/dist/application/event-sourcing/unreadable-event-error.js +8 -0
  85. package/dist/application/event-sourcing/unreadable-event-error.js.map +1 -0
  86. package/dist/application/event-sourcing/upcaster.d.ts +4 -0
  87. package/dist/application/event-sourcing/upcaster.d.ts.map +1 -0
  88. package/dist/application/event-sourcing/upcaster.js +2 -0
  89. package/dist/application/event-sourcing/upcaster.js.map +1 -0
  90. package/dist/application/files/accepts-media-type.d.ts +3 -0
  91. package/dist/application/files/accepts-media-type.d.ts.map +1 -0
  92. package/dist/application/files/accepts-media-type.js +11 -0
  93. package/dist/application/files/accepts-media-type.js.map +1 -0
  94. package/dist/application/files/assert-expiry.d.ts +3 -0
  95. package/dist/application/files/assert-expiry.d.ts.map +1 -0
  96. package/dist/application/files/assert-expiry.js +10 -0
  97. package/dist/application/files/assert-expiry.js.map +1 -0
  98. package/dist/application/files/assert-file-key.d.ts +3 -0
  99. package/dist/application/files/assert-file-key.d.ts.map +1 -0
  100. package/dist/application/files/assert-file-key.js +10 -0
  101. package/dist/application/files/assert-file-key.js.map +1 -0
  102. package/dist/application/files/assert-final-key.d.ts +3 -0
  103. package/dist/application/files/assert-final-key.d.ts.map +1 -0
  104. package/dist/application/files/assert-final-key.js +11 -0
  105. package/dist/application/files/assert-final-key.js.map +1 -0
  106. package/dist/application/files/content-disposition.d.ts +3 -0
  107. package/dist/application/files/content-disposition.d.ts.map +1 -0
  108. package/dist/application/files/content-disposition.js +9 -0
  109. package/dist/application/files/content-disposition.js.map +1 -0
  110. package/dist/application/files/content-expectation.d.ts +6 -0
  111. package/dist/application/files/content-expectation.d.ts.map +1 -0
  112. package/dist/application/files/content-expectation.js +2 -0
  113. package/dist/application/files/content-expectation.js.map +1 -0
  114. package/dist/application/files/content-matches.d.ts +7 -0
  115. package/dist/application/files/content-matches.d.ts.map +1 -0
  116. package/dist/application/files/content-matches.js +39 -0
  117. package/dist/application/files/content-matches.js.map +1 -0
  118. package/dist/application/files/download-url-options.d.ts +7 -0
  119. package/dist/application/files/download-url-options.d.ts.map +1 -0
  120. package/dist/application/files/download-url-options.js +2 -0
  121. package/dist/application/files/download-url-options.js.map +1 -0
  122. package/dist/application/files/file-content.d.ts +8 -0
  123. package/dist/application/files/file-content.d.ts.map +1 -0
  124. package/dist/application/files/file-content.js +2 -0
  125. package/dist/application/files/file-content.js.map +1 -0
  126. package/dist/application/files/file-error.d.ts +28 -0
  127. package/dist/application/files/file-error.d.ts.map +1 -0
  128. package/dist/application/files/file-error.js +29 -0
  129. package/dist/application/files/file-error.js.map +1 -0
  130. package/dist/application/files/file-metadata.d.ts +10 -0
  131. package/dist/application/files/file-metadata.d.ts.map +1 -0
  132. package/dist/application/files/file-metadata.js +2 -0
  133. package/dist/application/files/file-metadata.js.map +1 -0
  134. package/dist/application/files/file-source.d.ts +4 -0
  135. package/dist/application/files/file-source.d.ts.map +1 -0
  136. package/dist/application/files/file-source.js +2 -0
  137. package/dist/application/files/file-source.js.map +1 -0
  138. package/dist/application/files/file-upload.d.ts +25 -0
  139. package/dist/application/files/file-upload.d.ts.map +1 -0
  140. package/dist/application/files/file-upload.js +36 -0
  141. package/dist/application/files/file-upload.js.map +1 -0
  142. package/dist/application/files/index.d.ts +31 -0
  143. package/dist/application/files/index.d.ts.map +1 -0
  144. package/dist/application/files/index.js +31 -0
  145. package/dist/application/files/index.js.map +1 -0
  146. package/dist/application/files/inspection-limits.d.ts +8 -0
  147. package/dist/application/files/inspection-limits.d.ts.map +1 -0
  148. package/dist/application/files/inspection-limits.js +2 -0
  149. package/dist/application/files/inspection-limits.js.map +1 -0
  150. package/dist/application/files/is-file-key.d.ts +7 -0
  151. package/dist/application/files/is-file-key.d.ts.map +1 -0
  152. package/dist/application/files/is-file-key.js +11 -0
  153. package/dist/application/files/is-file-key.js.map +1 -0
  154. package/dist/application/files/listed-file.d.ts +7 -0
  155. package/dist/application/files/listed-file.d.ts.map +1 -0
  156. package/dist/application/files/listed-file.js +2 -0
  157. package/dist/application/files/listed-file.js.map +1 -0
  158. package/dist/application/files/max-signed-url-seconds.d.ts +3 -0
  159. package/dist/application/files/max-signed-url-seconds.d.ts.map +1 -0
  160. package/dist/application/files/max-signed-url-seconds.js +3 -0
  161. package/dist/application/files/max-signed-url-seconds.js.map +1 -0
  162. package/dist/application/files/media-type-of.d.ts +3 -0
  163. package/dist/application/files/media-type-of.d.ts.map +1 -0
  164. package/dist/application/files/media-type-of.js +5 -0
  165. package/dist/application/files/media-type-of.js.map +1 -0
  166. package/dist/application/files/pending-upload-link.d.ts +10 -0
  167. package/dist/application/files/pending-upload-link.d.ts.map +1 -0
  168. package/dist/application/files/pending-upload-link.js +2 -0
  169. package/dist/application/files/pending-upload-link.js.map +1 -0
  170. package/dist/application/files/pending-upload.d.ts +15 -0
  171. package/dist/application/files/pending-upload.d.ts.map +1 -0
  172. package/dist/application/files/pending-upload.js +2 -0
  173. package/dist/application/files/pending-upload.js.map +1 -0
  174. package/dist/application/files/put-options.d.ts +7 -0
  175. package/dist/application/files/put-options.d.ts.map +1 -0
  176. package/dist/application/files/put-options.js +2 -0
  177. package/dist/application/files/put-options.js.map +1 -0
  178. package/dist/application/files/received-file.d.ts +15 -0
  179. package/dist/application/files/received-file.d.ts.map +1 -0
  180. package/dist/application/files/received-file.js +2 -0
  181. package/dist/application/files/received-file.js.map +1 -0
  182. package/dist/application/files/scan-verdict.d.ts +8 -0
  183. package/dist/application/files/scan-verdict.d.ts.map +1 -0
  184. package/dist/application/files/scan-verdict.js +2 -0
  185. package/dist/application/files/scan-verdict.js.map +1 -0
  186. package/dist/application/files/signature-of.d.ts +3 -0
  187. package/dist/application/files/signature-of.d.ts.map +1 -0
  188. package/dist/application/files/signature-of.js +28 -0
  189. package/dist/application/files/signature-of.js.map +1 -0
  190. package/dist/application/files/signed-download.d.ts +6 -0
  191. package/dist/application/files/signed-download.d.ts.map +1 -0
  192. package/dist/application/files/signed-download.js +2 -0
  193. package/dist/application/files/signed-download.js.map +1 -0
  194. package/dist/application/files/signed-upload.d.ts +9 -0
  195. package/dist/application/files/signed-upload.d.ts.map +1 -0
  196. package/dist/application/files/signed-upload.js +2 -0
  197. package/dist/application/files/signed-upload.js.map +1 -0
  198. package/dist/application/files/signed-url.d.ts +6 -0
  199. package/dist/application/files/signed-url.d.ts.map +1 -0
  200. package/dist/application/files/signed-url.js +2 -0
  201. package/dist/application/files/signed-url.js.map +1 -0
  202. package/dist/application/files/staged-key-of.d.ts +5 -0
  203. package/dist/application/files/staged-key-of.d.ts.map +1 -0
  204. package/dist/application/files/staged-key-of.js +7 -0
  205. package/dist/application/files/staged-key-of.js.map +1 -0
  206. package/dist/application/files/stored-file.d.ts +16 -0
  207. package/dist/application/files/stored-file.d.ts.map +1 -0
  208. package/dist/application/files/stored-file.js +2 -0
  209. package/dist/application/files/stored-file.js.map +1 -0
  210. package/dist/application/files/upload-url-options.d.ts +12 -0
  211. package/dist/application/files/upload-url-options.d.ts.map +1 -0
  212. package/dist/application/files/upload-url-options.js +2 -0
  213. package/dist/application/files/upload-url-options.js.map +1 -0
  214. package/dist/application/persistence/append-changes.d.ts +18 -0
  215. package/dist/application/persistence/append-changes.d.ts.map +1 -0
  216. package/dist/application/persistence/append-changes.js +17 -0
  217. package/dist/application/persistence/append-changes.js.map +1 -0
  218. package/dist/application/ports/checkpoint-store.d.ts +14 -0
  219. package/dist/application/ports/checkpoint-store.d.ts.map +1 -0
  220. package/dist/application/ports/checkpoint-store.js +10 -0
  221. package/dist/application/ports/checkpoint-store.js.map +1 -0
  222. package/dist/application/ports/event-store.d.ts +24 -0
  223. package/dist/application/ports/event-store.d.ts.map +1 -0
  224. package/dist/application/ports/event-store.js +12 -0
  225. package/dist/application/ports/event-store.js.map +1 -0
  226. package/dist/application/ports/file-keys.d.ts +9 -0
  227. package/dist/application/ports/file-keys.d.ts.map +1 -0
  228. package/dist/application/ports/file-keys.js +10 -0
  229. package/dist/application/ports/file-keys.js.map +1 -0
  230. package/dist/application/ports/file-scanner.d.ts +13 -0
  231. package/dist/application/ports/file-scanner.d.ts.map +1 -0
  232. package/dist/application/ports/file-scanner.js +12 -0
  233. package/dist/application/ports/file-scanner.js.map +1 -0
  234. package/dist/application/ports/file-storage.d.ts +40 -0
  235. package/dist/application/ports/file-storage.d.ts.map +1 -0
  236. package/dist/application/ports/file-storage.js +15 -0
  237. package/dist/application/ports/file-storage.js.map +1 -0
  238. package/dist/application/ports/served-file-storage.d.ts +16 -0
  239. package/dist/application/ports/served-file-storage.d.ts.map +1 -0
  240. package/dist/application/ports/served-file-storage.js +12 -0
  241. package/dist/application/ports/served-file-storage.js.map +1 -0
  242. package/dist/application/ports/snapshot-store.d.ts +8 -0
  243. package/dist/application/ports/snapshot-store.d.ts.map +1 -0
  244. package/dist/application/ports/snapshot-store.js +7 -0
  245. package/dist/application/ports/snapshot-store.js.map +1 -0
  246. package/dist/application/ports/subject-key-store.d.ts +17 -0
  247. package/dist/application/ports/subject-key-store.d.ts.map +1 -0
  248. package/dist/application/ports/subject-key-store.js +13 -0
  249. package/dist/application/ports/subject-key-store.js.map +1 -0
  250. package/dist/declarations/decorators/projection-options.d.ts +5 -0
  251. package/dist/declarations/decorators/projection-options.d.ts.map +1 -0
  252. package/dist/declarations/decorators/projection-options.js +2 -0
  253. package/dist/declarations/decorators/projection-options.js.map +1 -0
  254. package/dist/declarations/decorators/projection.d.ts +4 -0
  255. package/dist/declarations/decorators/projection.d.ts.map +1 -1
  256. package/dist/declarations/decorators/projection.js +16 -8
  257. package/dist/declarations/decorators/projection.js.map +1 -1
  258. package/dist/declarations/model/projection-declaration.d.ts +3 -0
  259. package/dist/declarations/model/projection-declaration.d.ts.map +1 -1
  260. package/dist/declarations/model/projection-feed.d.ts +8 -0
  261. package/dist/declarations/model/projection-feed.d.ts.map +1 -0
  262. package/dist/declarations/model/projection-feed.js +2 -0
  263. package/dist/declarations/model/projection-feed.js.map +1 -0
  264. package/dist/declarations/projection/applying-projection.d.ts +14 -0
  265. package/dist/declarations/projection/applying-projection.d.ts.map +1 -0
  266. package/dist/declarations/projection/applying-projection.js +32 -0
  267. package/dist/declarations/projection/applying-projection.js.map +1 -0
  268. package/dist/declarations.d.ts +3 -0
  269. package/dist/declarations.d.ts.map +1 -1
  270. package/dist/declarations.js +1 -0
  271. package/dist/declarations.js.map +1 -1
  272. package/dist/domain/event-sourcing/aggregate-history.d.ts +10 -0
  273. package/dist/domain/event-sourcing/aggregate-history.d.ts.map +1 -0
  274. package/dist/domain/event-sourcing/aggregate-history.js +2 -0
  275. package/dist/domain/event-sourcing/aggregate-history.js.map +1 -0
  276. package/dist/domain/event-sourcing/aggregate-snapshot.d.ts +6 -0
  277. package/dist/domain/event-sourcing/aggregate-snapshot.d.ts.map +1 -0
  278. package/dist/domain/event-sourcing/aggregate-snapshot.js +2 -0
  279. package/dist/domain/event-sourcing/aggregate-snapshot.js.map +1 -0
  280. package/dist/domain/event-sourcing/appliers.d.ts +12 -0
  281. package/dist/domain/event-sourcing/appliers.d.ts.map +1 -0
  282. package/dist/domain/event-sourcing/appliers.js +2 -0
  283. package/dist/domain/event-sourcing/appliers.js.map +1 -0
  284. package/dist/domain/event-sourcing/event-sourced-aggregate.d.ts +28 -0
  285. package/dist/domain/event-sourcing/event-sourced-aggregate.d.ts.map +1 -0
  286. package/dist/domain/event-sourcing/event-sourced-aggregate.js +51 -0
  287. package/dist/domain/event-sourcing/event-sourced-aggregate.js.map +1 -0
  288. package/dist/domain/event-sourcing/unstored-events.d.ts +8 -0
  289. package/dist/domain/event-sourcing/unstored-events.d.ts.map +1 -0
  290. package/dist/domain/event-sourcing/unstored-events.js +7 -0
  291. package/dist/domain/event-sourcing/unstored-events.js.map +1 -0
  292. package/dist/index.d.ts +52 -32
  293. package/dist/index.d.ts.map +1 -1
  294. package/dist/index.js +52 -32
  295. package/dist/index.js.map +1 -1
  296. package/dist/infrastructure/domain-events/after-commit.d.ts +10 -0
  297. package/dist/infrastructure/domain-events/after-commit.d.ts.map +1 -0
  298. package/dist/infrastructure/domain-events/after-commit.js +19 -0
  299. package/dist/infrastructure/domain-events/after-commit.js.map +1 -0
  300. package/dist/infrastructure/domain-events/at-commit.d.ts +11 -0
  301. package/dist/infrastructure/domain-events/at-commit.d.ts.map +1 -0
  302. package/dist/infrastructure/domain-events/at-commit.js +19 -0
  303. package/dist/infrastructure/domain-events/at-commit.js.map +1 -0
  304. package/dist/infrastructure/domain-events/commit-step.d.ts +10 -0
  305. package/dist/infrastructure/domain-events/commit-step.d.ts.map +1 -0
  306. package/dist/infrastructure/domain-events/commit-step.js +2 -0
  307. package/dist/infrastructure/domain-events/commit-step.js.map +1 -0
  308. package/dist/infrastructure/domain-events/unit-of-work-scope.d.ts +5 -0
  309. package/dist/infrastructure/domain-events/unit-of-work-scope.d.ts.map +1 -1
  310. package/dist/infrastructure/domain-events/unit-of-work-scope.js.map +1 -1
  311. package/dist/infrastructure/domain-events/within-unit-of-work.d.ts +3 -1
  312. package/dist/infrastructure/domain-events/within-unit-of-work.d.ts.map +1 -1
  313. package/dist/infrastructure/domain-events/within-unit-of-work.js +32 -5
  314. package/dist/infrastructure/domain-events/within-unit-of-work.js.map +1 -1
  315. package/dist/infrastructure/event-sourcing/catch-up-subscription.d.ts +33 -0
  316. package/dist/infrastructure/event-sourcing/catch-up-subscription.d.ts.map +1 -0
  317. package/dist/infrastructure/event-sourcing/catch-up-subscription.js +39 -0
  318. package/dist/infrastructure/event-sourcing/catch-up-subscription.js.map +1 -0
  319. package/dist/infrastructure/event-sourcing/event-serializer.d.ts +35 -0
  320. package/dist/infrastructure/event-sourcing/event-serializer.d.ts.map +1 -0
  321. package/dist/infrastructure/event-sourcing/event-serializer.js +104 -0
  322. package/dist/infrastructure/event-sourcing/event-serializer.js.map +1 -0
  323. package/dist/infrastructure/event-sourcing/event-sourced-repository.d.ts +32 -0
  324. package/dist/infrastructure/event-sourcing/event-sourced-repository.d.ts.map +1 -0
  325. package/dist/infrastructure/event-sourcing/event-sourced-repository.js +68 -0
  326. package/dist/infrastructure/event-sourcing/event-sourced-repository.js.map +1 -0
  327. package/dist/infrastructure/event-sourcing/event-sourcing-stores.d.ts +12 -0
  328. package/dist/infrastructure/event-sourcing/event-sourcing-stores.d.ts.map +1 -0
  329. package/dist/infrastructure/event-sourcing/event-sourcing-stores.js +2 -0
  330. package/dist/infrastructure/event-sourcing/event-sourcing-stores.js.map +1 -0
  331. package/dist/infrastructure/event-sourcing/event-store-projection-rebuild.d.ts +34 -0
  332. package/dist/infrastructure/event-sourcing/event-store-projection-rebuild.d.ts.map +1 -0
  333. package/dist/infrastructure/event-sourcing/event-store-projection-rebuild.js +48 -0
  334. package/dist/infrastructure/event-sourcing/event-store-projection-rebuild.js.map +1 -0
  335. package/dist/infrastructure/event-sourcing/personal-data-cipher.d.ts +19 -0
  336. package/dist/infrastructure/event-sourcing/personal-data-cipher.d.ts.map +1 -0
  337. package/dist/infrastructure/event-sourcing/personal-data-cipher.js +84 -0
  338. package/dist/infrastructure/event-sourcing/personal-data-cipher.js.map +1 -0
  339. package/dist/infrastructure/event-sourcing/postgres/event-store-tables-options.d.ts +6 -0
  340. package/dist/infrastructure/event-sourcing/postgres/event-store-tables-options.d.ts.map +1 -0
  341. package/dist/infrastructure/event-sourcing/postgres/event-store-tables-options.js +2 -0
  342. package/dist/infrastructure/event-sourcing/postgres/event-store-tables-options.js.map +1 -0
  343. package/dist/infrastructure/event-sourcing/postgres/event-store-tables-sql.d.ts +9 -0
  344. package/dist/infrastructure/event-sourcing/postgres/event-store-tables-sql.d.ts.map +1 -0
  345. package/dist/infrastructure/event-sourcing/postgres/event-store-tables-sql.js +32 -0
  346. package/dist/infrastructure/event-sourcing/postgres/event-store-tables-sql.js.map +1 -0
  347. package/dist/infrastructure/event-sourcing/postgres/event-store-tables.d.ts +9 -0
  348. package/dist/infrastructure/event-sourcing/postgres/event-store-tables.d.ts.map +1 -0
  349. package/dist/infrastructure/event-sourcing/postgres/event-store-tables.js +9 -0
  350. package/dist/infrastructure/event-sourcing/postgres/event-store-tables.js.map +1 -0
  351. package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.d.ts +3 -0
  352. package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.d.ts.map +1 -0
  353. package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.js +22 -0
  354. package/dist/infrastructure/event-sourcing/postgres/is-append-conflict.js.map +1 -0
  355. package/dist/infrastructure/event-sourcing/postgres/postgres-checkpoint-store.d.ts +12 -0
  356. package/dist/infrastructure/event-sourcing/postgres/postgres-checkpoint-store.d.ts.map +1 -0
  357. package/dist/infrastructure/event-sourcing/postgres/postgres-checkpoint-store.js +26 -0
  358. package/dist/infrastructure/event-sourcing/postgres/postgres-checkpoint-store.js.map +1 -0
  359. package/dist/infrastructure/event-sourcing/postgres/postgres-event-sourcing.d.ts +6 -0
  360. package/dist/infrastructure/event-sourcing/postgres/postgres-event-sourcing.d.ts.map +1 -0
  361. package/dist/infrastructure/event-sourcing/postgres/postgres-event-sourcing.js +14 -0
  362. package/dist/infrastructure/event-sourcing/postgres/postgres-event-sourcing.js.map +1 -0
  363. package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.d.ts +31 -0
  364. package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.d.ts.map +1 -0
  365. package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.js +120 -0
  366. package/dist/infrastructure/event-sourcing/postgres/postgres-event-store.js.map +1 -0
  367. package/dist/infrastructure/event-sourcing/postgres/postgres-snapshot-store.d.ts +13 -0
  368. package/dist/infrastructure/event-sourcing/postgres/postgres-snapshot-store.d.ts.map +1 -0
  369. package/dist/infrastructure/event-sourcing/postgres/postgres-snapshot-store.js +28 -0
  370. package/dist/infrastructure/event-sourcing/postgres/postgres-snapshot-store.js.map +1 -0
  371. package/dist/infrastructure/event-sourcing/postgres/postgres-subject-key-store.d.ts +21 -0
  372. package/dist/infrastructure/event-sourcing/postgres/postgres-subject-key-store.d.ts.map +1 -0
  373. package/dist/infrastructure/event-sourcing/postgres/postgres-subject-key-store.js +48 -0
  374. package/dist/infrastructure/event-sourcing/postgres/postgres-subject-key-store.js.map +1 -0
  375. package/dist/infrastructure/event-sourcing/postgres/qualified-table.d.ts +4 -0
  376. package/dist/infrastructure/event-sourcing/postgres/qualified-table.d.ts.map +1 -0
  377. package/dist/infrastructure/event-sourcing/postgres/qualified-table.js +10 -0
  378. package/dist/infrastructure/event-sourcing/postgres/qualified-table.js.map +1 -0
  379. package/dist/infrastructure/event-sourcing/postgres/stored-data-from.d.ts +4 -0
  380. package/dist/infrastructure/event-sourcing/postgres/stored-data-from.d.ts.map +1 -0
  381. package/dist/infrastructure/event-sourcing/postgres/stored-data-from.js +23 -0
  382. package/dist/infrastructure/event-sourcing/postgres/stored-data-from.js.map +1 -0
  383. package/dist/infrastructure/event-sourcing/rewrite-objects.d.ts +8 -0
  384. package/dist/infrastructure/event-sourcing/rewrite-objects.d.ts.map +1 -0
  385. package/dist/infrastructure/event-sourcing/rewrite-objects.js +16 -0
  386. package/dist/infrastructure/event-sourcing/rewrite-objects.js.map +1 -0
  387. package/dist/infrastructure/event-sourcing/snapshot-policy.d.ts +14 -0
  388. package/dist/infrastructure/event-sourcing/snapshot-policy.d.ts.map +1 -0
  389. package/dist/infrastructure/event-sourcing/snapshot-policy.js +2 -0
  390. package/dist/infrastructure/event-sourcing/snapshot-policy.js.map +1 -0
  391. package/dist/infrastructure/event-sourcing/stored-origins.d.ts +5 -0
  392. package/dist/infrastructure/event-sourcing/stored-origins.d.ts.map +1 -0
  393. package/dist/infrastructure/event-sourcing/stored-origins.js +3 -0
  394. package/dist/infrastructure/event-sourcing/stored-origins.js.map +1 -0
  395. package/dist/infrastructure/event-sourcing/stored-stamp-of.d.ts +10 -0
  396. package/dist/infrastructure/event-sourcing/stored-stamp-of.d.ts.map +1 -0
  397. package/dist/infrastructure/event-sourcing/stored-stamp-of.js +14 -0
  398. package/dist/infrastructure/event-sourcing/stored-stamp-of.js.map +1 -0
  399. package/dist/infrastructure/files/accept-every-file-scanner.d.ts +7 -0
  400. package/dist/infrastructure/files/accept-every-file-scanner.d.ts.map +1 -0
  401. package/dist/infrastructure/files/accept-every-file-scanner.js +7 -0
  402. package/dist/infrastructure/files/accept-every-file-scanner.js.map +1 -0
  403. package/dist/infrastructure/files/collect.d.ts +4 -0
  404. package/dist/infrastructure/files/collect.d.ts.map +1 -0
  405. package/dist/infrastructure/files/collect.js +11 -0
  406. package/dist/infrastructure/files/collect.js.map +1 -0
  407. package/dist/infrastructure/files/file-grant.d.ts +11 -0
  408. package/dist/infrastructure/files/file-grant.d.ts.map +1 -0
  409. package/dist/infrastructure/files/file-grant.js +2 -0
  410. package/dist/infrastructure/files/file-grant.js.map +1 -0
  411. package/dist/infrastructure/files/file-inspection.d.ts +22 -0
  412. package/dist/infrastructure/files/file-inspection.d.ts.map +1 -0
  413. package/dist/infrastructure/files/file-inspection.js +66 -0
  414. package/dist/infrastructure/files/file-inspection.js.map +1 -0
  415. package/dist/infrastructure/files/file-staging.d.ts +59 -0
  416. package/dist/infrastructure/files/file-staging.d.ts.map +1 -0
  417. package/dist/infrastructure/files/file-staging.js +142 -0
  418. package/dist/infrastructure/files/file-staging.js.map +1 -0
  419. package/dist/infrastructure/files/file-uploads-middleware.d.ts +11 -0
  420. package/dist/infrastructure/files/file-uploads-middleware.d.ts.map +1 -0
  421. package/dist/infrastructure/files/file-uploads-middleware.js +25 -0
  422. package/dist/infrastructure/files/file-uploads-middleware.js.map +1 -0
  423. package/dist/infrastructure/files/in-memory-file-storage.d.ts +25 -0
  424. package/dist/infrastructure/files/in-memory-file-storage.d.ts.map +1 -0
  425. package/dist/infrastructure/files/in-memory-file-storage.js +73 -0
  426. package/dist/infrastructure/files/in-memory-file-storage.js.map +1 -0
  427. package/dist/infrastructure/files/is-file-grant.d.ts +3 -0
  428. package/dist/infrastructure/files/is-file-grant.d.ts.map +1 -0
  429. package/dist/infrastructure/files/is-file-grant.js +16 -0
  430. package/dist/infrastructure/files/is-file-grant.js.map +1 -0
  431. package/dist/infrastructure/files/is-stored-metadata.d.ts +3 -0
  432. package/dist/infrastructure/files/is-stored-metadata.d.ts.map +1 -0
  433. package/dist/infrastructure/files/is-stored-metadata.js +8 -0
  434. package/dist/infrastructure/files/is-stored-metadata.js.map +1 -0
  435. package/dist/infrastructure/files/local-file-storage-options.d.ts +6 -0
  436. package/dist/infrastructure/files/local-file-storage-options.d.ts.map +1 -0
  437. package/dist/infrastructure/files/local-file-storage-options.js +2 -0
  438. package/dist/infrastructure/files/local-file-storage-options.js.map +1 -0
  439. package/dist/infrastructure/files/local-file-storage.d.ts +29 -0
  440. package/dist/infrastructure/files/local-file-storage.d.ts.map +1 -0
  441. package/dist/infrastructure/files/local-file-storage.js +103 -0
  442. package/dist/infrastructure/files/local-file-storage.js.map +1 -0
  443. package/dist/infrastructure/files/local-paths.d.ts +12 -0
  444. package/dist/infrastructure/files/local-paths.d.ts.map +1 -0
  445. package/dist/infrastructure/files/local-paths.js +33 -0
  446. package/dist/infrastructure/files/local-paths.js.map +1 -0
  447. package/dist/infrastructure/files/purge-staged-files.d.ts +16 -0
  448. package/dist/infrastructure/files/purge-staged-files.d.ts.map +1 -0
  449. package/dist/infrastructure/files/purge-staged-files.js +21 -0
  450. package/dist/infrastructure/files/purge-staged-files.js.map +1 -0
  451. package/dist/infrastructure/files/self-signed-file-storage.d.ts +23 -0
  452. package/dist/infrastructure/files/self-signed-file-storage.d.ts.map +1 -0
  453. package/dist/infrastructure/files/self-signed-file-storage.js +57 -0
  454. package/dist/infrastructure/files/self-signed-file-storage.js.map +1 -0
  455. package/dist/infrastructure/files/signed-file-tokens.d.ts +20 -0
  456. package/dist/infrastructure/files/signed-file-tokens.d.ts.map +1 -0
  457. package/dist/infrastructure/files/signed-file-tokens.js +45 -0
  458. package/dist/infrastructure/files/signed-file-tokens.js.map +1 -0
  459. package/dist/infrastructure/files/signed-link-options.d.ts +10 -0
  460. package/dist/infrastructure/files/signed-link-options.d.ts.map +1 -0
  461. package/dist/infrastructure/files/signed-link-options.js +2 -0
  462. package/dist/infrastructure/files/signed-link-options.js.map +1 -0
  463. package/dist/infrastructure/files/stored-metadata.d.ts +6 -0
  464. package/dist/infrastructure/files/stored-metadata.d.ts.map +1 -0
  465. package/dist/infrastructure/files/stored-metadata.js +2 -0
  466. package/dist/infrastructure/files/stored-metadata.js.map +1 -0
  467. package/dist/infrastructure/files/tenant-file-keys.d.ts +20 -0
  468. package/dist/infrastructure/files/tenant-file-keys.d.ts.map +1 -0
  469. package/dist/infrastructure/files/tenant-file-keys.js +27 -0
  470. package/dist/infrastructure/files/tenant-file-keys.js.map +1 -0
  471. package/dist/infrastructure/files/upload-desk.d.ts +8 -0
  472. package/dist/infrastructure/files/upload-desk.d.ts.map +1 -0
  473. package/dist/infrastructure/files/upload-desk.js +2 -0
  474. package/dist/infrastructure/files/upload-desk.js.map +1 -0
  475. package/dist/infrastructure/files/without-trailing-slashes.d.ts +3 -0
  476. package/dist/infrastructure/files/without-trailing-slashes.d.ts.map +1 -0
  477. package/dist/infrastructure/files/without-trailing-slashes.js +9 -0
  478. package/dist/infrastructure/files/without-trailing-slashes.js.map +1 -0
  479. package/dist/infrastructure/in-memory/in-memory-checkpoint-store.d.ts +8 -0
  480. package/dist/infrastructure/in-memory/in-memory-checkpoint-store.d.ts.map +1 -0
  481. package/dist/infrastructure/in-memory/in-memory-checkpoint-store.js +15 -0
  482. package/dist/infrastructure/in-memory/in-memory-checkpoint-store.js.map +1 -0
  483. package/dist/infrastructure/in-memory/in-memory-event-store.d.ts +14 -0
  484. package/dist/infrastructure/in-memory/in-memory-event-store.d.ts.map +1 -0
  485. package/dist/infrastructure/in-memory/in-memory-event-store.js +37 -0
  486. package/dist/infrastructure/in-memory/in-memory-event-store.js.map +1 -0
  487. package/dist/infrastructure/in-memory/in-memory-snapshot-store.d.ts +9 -0
  488. package/dist/infrastructure/in-memory/in-memory-snapshot-store.d.ts.map +1 -0
  489. package/dist/infrastructure/in-memory/in-memory-snapshot-store.js +15 -0
  490. package/dist/infrastructure/in-memory/in-memory-snapshot-store.js.map +1 -0
  491. package/dist/infrastructure/in-memory/in-memory-subject-key-store.d.ts +10 -0
  492. package/dist/infrastructure/in-memory/in-memory-subject-key-store.d.ts.map +1 -0
  493. package/dist/infrastructure/in-memory/in-memory-subject-key-store.js +21 -0
  494. package/dist/infrastructure/in-memory/in-memory-subject-key-store.js.map +1 -0
  495. package/dist/infrastructure/read-model/shadow-read-model-store.d.ts +20 -0
  496. package/dist/infrastructure/read-model/shadow-read-model-store.d.ts.map +1 -0
  497. package/dist/infrastructure/read-model/shadow-read-model-store.js +25 -0
  498. package/dist/infrastructure/read-model/shadow-read-model-store.js.map +1 -0
  499. package/package.json +1 -1
@@ -0,0 +1,28 @@
1
+ /** The leading bytes of the binary formats the kit recognises, written as latin1 strings. */
2
+ const SIGNATURES = [
3
+ { mediaType: 'application/pdf', parts: [[0, '%PDF-']] },
4
+ { mediaType: 'image/png', parts: [[0, '\x89PNG\r\n\x1a\n']] },
5
+ { mediaType: 'image/jpeg', parts: [[0, '\xff\xd8\xff']] },
6
+ { mediaType: 'image/gif', parts: [[0, 'GIF8']] },
7
+ {
8
+ mediaType: 'image/webp',
9
+ parts: [
10
+ [0, 'RIFF'],
11
+ [8, 'WEBP'],
12
+ ],
13
+ },
14
+ { mediaType: 'application/zip', parts: [[0, 'PK\x03\x04']] },
15
+ { mediaType: 'application/gzip', parts: [[0, '\x1f\x8b']] },
16
+ ];
17
+ /** The binary format the first bytes of a content announce, or `undefined` when none is recognised. */
18
+ export function signatureOf(head) {
19
+ return SIGNATURES.find((signature) => signature.parts.every(([offset, bytes]) => startsWith(head, offset, bytes)))
20
+ ?.mediaType;
21
+ }
22
+ function startsWith(head, offset, bytes) {
23
+ if (head.length < offset + bytes.length) {
24
+ return false;
25
+ }
26
+ return Array.from({ length: bytes.length }, (_, index) => index).every((index) => head[offset + index] === bytes.charCodeAt(index));
27
+ }
28
+ //# sourceMappingURL=signature-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature-of.js","sourceRoot":"","sources":["../../../src/application/files/signature-of.ts"],"names":[],"mappings":"AAMA,6FAA6F;AAC7F,MAAM,UAAU,GAAyB;IACvC,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE;IACvD,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,EAAE;IAC7D,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,EAAE;IACzD,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE;IAChD;QACE,SAAS,EAAE,YAAY;QACvB,KAAK,EAAE;YACL,CAAC,CAAC,EAAE,MAAM,CAAC;YACX,CAAC,CAAC,EAAE,MAAM,CAAC;SACZ;KACF;IACD,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,EAAE;IAC5D,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE;CAC5D,CAAC;AAEF,uGAAuG;AACvG,MAAM,UAAU,WAAW,CAAC,IAAgB;IAC1C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;QAChH,EAAE,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,IAAgB,EAAE,MAAc,EAAE,KAAa;IACjE,IAAI,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,CACpE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAC5D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { FileContent } from './file-content.js';
2
+ /** A download a signed link granted: the file, and the name to offer the browser when one was signed. */
3
+ export interface SignedDownload extends FileContent {
4
+ readonly fileName?: string;
5
+ }
6
+ //# sourceMappingURL=signed-download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signed-download.d.ts","sourceRoot":"","sources":["../../../src/application/files/signed-download.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,yGAAyG;AACzG,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=signed-download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signed-download.js","sourceRoot":"","sources":["../../../src/application/files/signed-download.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ /** What a client needs to send a file straight to the storage: the request to make, and until when. */
2
+ export interface SignedUpload {
3
+ readonly url: string;
4
+ readonly method: 'PUT';
5
+ /** To send as they are: the signature covers them. */
6
+ readonly headers: Readonly<Record<string, string>>;
7
+ readonly expiresAt: Date;
8
+ }
9
+ //# sourceMappingURL=signed-upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signed-upload.d.ts","sourceRoot":"","sources":["../../../src/application/files/signed-upload.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=signed-upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signed-upload.js","sourceRoot":"","sources":["../../../src/application/files/signed-upload.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ /** A link that grants one action on one file until it expires, without any other credential. */
2
+ export interface SignedUrl {
3
+ readonly url: string;
4
+ readonly expiresAt: Date;
5
+ }
6
+ //# sourceMappingURL=signed-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signed-url.d.ts","sourceRoot":"","sources":["../../../src/application/files/signed-url.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=signed-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signed-url.js","sourceRoot":"","sources":["../../../src/application/files/signed-url.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /** Where a file waits until the transaction that references it commits: nothing reads there, and no final key starts with it. */
2
+ export declare const STAGING_PREFIX = "staging/";
3
+ /** The staged key of a final key. */
4
+ export declare function stagedKeyOf(key: string): string;
5
+ //# sourceMappingURL=staged-key-of.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staged-key-of.d.ts","sourceRoot":"","sources":["../../../src/application/files/staged-key-of.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC,qCAAqC;AACrC,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C"}
@@ -0,0 +1,7 @@
1
+ /** Where a file waits until the transaction that references it commits: nothing reads there, and no final key starts with it. */
2
+ export const STAGING_PREFIX = 'staging/';
3
+ /** The staged key of a final key. */
4
+ export function stagedKeyOf(key) {
5
+ return `${STAGING_PREFIX}${key}`;
6
+ }
7
+ //# sourceMappingURL=staged-key-of.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"staged-key-of.js","sourceRoot":"","sources":["../../../src/application/files/staged-key-of.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AAEzC,qCAAqC;AACrC,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,GAAG,cAAc,GAAG,GAAG,EAAE,CAAC;AACnC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The reference to a file that an aggregate keeps, and all it keeps: the content lives in a
3
+ * `FileStorage`, never in the database. It names no provider, no bucket and no URL, so the
4
+ * connector can change without touching a row.
5
+ */
6
+ export interface StoredFile {
7
+ /** Generated by the server (`FileKeys`), never taken from the user. */
8
+ readonly key: string;
9
+ /** In bytes. */
10
+ readonly size: number;
11
+ /** Verified on the content, not only on the name the client gave. */
12
+ readonly mediaType: string;
13
+ /** `sha256:<hex>` of the content, computed while it streamed. */
14
+ readonly checksum: string;
15
+ }
16
+ //# sourceMappingURL=stored-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stored-file.d.ts","sourceRoot":"","sources":["../../../src/application/files/stored-file.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,uEAAuE;IACvE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stored-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stored-file.js","sourceRoot":"","sources":["../../../src/application/files/stored-file.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export interface UploadUrlOptions {
2
+ /** Short: at most `MAX_SIGNED_URL_SECONDS`. */
3
+ readonly expiresInSeconds: number;
4
+ /** The media type the client must send, as the `content-type` the signature covers. */
5
+ readonly mediaType: string;
6
+ /**
7
+ * In bytes. The storages the application serves refuse a larger upload; a presigned link of
8
+ * an object store cannot cap it, so `FileStaging.confirm` checks it again in every case.
9
+ */
10
+ readonly maxBytes: number;
11
+ }
12
+ //# sourceMappingURL=upload-url-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-url-options.d.ts","sourceRoot":"","sources":["../../../src/application/files/upload-url-options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=upload-url-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-url-options.js","sourceRoot":"","sources":["../../../src/application/files/upload-url-options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { DomainEvent } from '../../domain/domain-event.js';
2
+ import type { EventSourcedAggregate } from '../../domain/event-sourcing/event-sourced-aggregate.js';
3
+ export interface StreamChanges {
4
+ /** The version the stream must still have. */
5
+ readonly expected: number;
6
+ /** What the aggregate recorded since it was loaded, in order. */
7
+ readonly events: readonly DomainEvent[];
8
+ }
9
+ /**
10
+ * Optimistic concurrency for an event-sourced aggregate: hands what it recorded since it was
11
+ * loaded to `append`, with the version its stream must still have. Once `append` resolves, the
12
+ * aggregate is at the new version with nothing left to store, and can be saved again; when it
13
+ * rejects (a ConcurrencyError: somebody else appended first), the aggregate is left as it was.
14
+ * An aggregate that recorded nothing still hands its version over, with no event: the store
15
+ * refuses it when the stream moved meanwhile, so a stale copy is never taken for a current one.
16
+ */
17
+ export declare function appendChanges<E extends DomainEvent, S>(aggregate: EventSourcedAggregate<E, S>, append: (changes: StreamChanges) => Promise<void>): Promise<void>;
18
+ //# sourceMappingURL=append-changes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"append-changes.d.ts","sourceRoot":"","sources":["../../../src/application/persistence/append-changes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAGpG,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,EAC1D,SAAS,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,EACtC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,GAChD,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -0,0 +1,17 @@
1
+ import { unstoredEvents } from '../../domain/event-sourcing/unstored-events.js';
2
+ /**
3
+ * Optimistic concurrency for an event-sourced aggregate: hands what it recorded since it was
4
+ * loaded to `append`, with the version its stream must still have. Once `append` resolves, the
5
+ * aggregate is at the new version with nothing left to store, and can be saved again; when it
6
+ * rejects (a ConcurrencyError: somebody else appended first), the aggregate is left as it was.
7
+ * An aggregate that recorded nothing still hands its version over, with no event: the store
8
+ * refuses it when the stream moved meanwhile, so a stale copy is never taken for a current one.
9
+ */
10
+ export async function appendChanges(aggregate, append) {
11
+ const unstored = unstoredEvents.get(aggregate) ?? [];
12
+ const events = [...unstored];
13
+ await append({ expected: aggregate.version, events });
14
+ unstored.splice(0, events.length);
15
+ aggregate.version += events.length;
16
+ }
17
+ //# sourceMappingURL=append-changes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"append-changes.js","sourceRoot":"","sources":["../../../src/application/persistence/append-changes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAShF;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,SAAsC,EACtC,MAAiD;IAEjD,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IACrD,MAAM,MAAM,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC;IAE7B,MAAM,MAAM,CAAC,EAAE,QAAQ,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACtD,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,SAAS,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC;AACrC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * How far each subscription to an event store has applied the store. Kept in the database of what
3
+ * the subscription writes, a checkpoint commits with what it applied.
4
+ */
5
+ export declare abstract class CheckpointStore {
6
+ /** The last position the subscriber applied, 0 when it applied nothing yet. */
7
+ abstract position(subscriber: string): Promise<number>;
8
+ /**
9
+ * Moves the checkpoint from `from` to `to`, and refuses with a ConcurrencyError when it is no
10
+ * longer at `from`: another run of the same subscriber applied the same events first.
11
+ */
12
+ abstract advance(subscriber: string, from: number, to: number): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=checkpoint-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-store.d.ts","sourceRoot":"","sources":["../../../src/application/ports/checkpoint-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,8BAAsB,eAAe;IAKnC,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvD;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * How far each subscription to an event store has applied the store. Kept in the database of what
3
+ * the subscription writes, a checkpoint commits with what it applied.
4
+ */
5
+ export class CheckpointStore {
6
+ static {
7
+ Object.defineProperty(this, 'tokenKey', { value: 'kernel.CheckpointStore' });
8
+ }
9
+ }
10
+ //# sourceMappingURL=checkpoint-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-store.js","sourceRoot":"","sources":["../../../src/application/ports/checkpoint-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAgB,eAAe;IACnC;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAC/E,CAAC;CAUF"}
@@ -0,0 +1,24 @@
1
+ import type { Appended } from '../event-sourcing/appended.js';
2
+ import type { EventToAppend } from '../event-sourcing/event-to-append.js';
3
+ import type { StoredEvent } from '../event-sourcing/stored-event.js';
4
+ /**
5
+ * Where event-sourced aggregates keep their streams: one stream per aggregate, read in order,
6
+ * and the whole store read in the order the appends committed, for the subscriptions. Stored
7
+ * events are never changed. Only repository adapters and subscriptions use it: the domain and the
8
+ * use cases never read a stream.
9
+ */
10
+ export declare abstract class EventStore {
11
+ /**
12
+ * Appends the events to the stream if it still has `expectedVersion` events (0: the stream does
13
+ * not exist yet), and refuses with a ConcurrencyError otherwise: somebody else appended since it
14
+ * was read. Joins the transaction of the current unit of work when the store is transactional.
15
+ */
16
+ abstract append(stream: string, expectedVersion: number, events: readonly EventToAppend[]): Promise<Appended>;
17
+ /** The events of the stream after version `after` (default 0: all of them), in their order. */
18
+ abstract readStream(stream: string, after?: number): Promise<readonly StoredEvent[]>;
19
+ /** Up to `limit` events of the whole store after position `after`, in the order of their positions. */
20
+ abstract readAll(after: number, limit: number): Promise<readonly StoredEvent[]>;
21
+ /** The position of the last event stored, 0 when there is none. */
22
+ abstract head(): Promise<number>;
23
+ }
24
+ //# sourceMappingURL=event-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-store.d.ts","sourceRoot":"","sources":["../../../src/application/ports/event-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAErE;;;;;GAKG;AACH,8BAAsB,UAAU;IAK9B;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE9G,+FAA+F;IAC/F,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAAC;IAErF,uGAAuG;IACvG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAAC;IAEhF,mEAAmE;IACnE,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAClC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Where event-sourced aggregates keep their streams: one stream per aggregate, read in order,
3
+ * and the whole store read in the order the appends committed, for the subscriptions. Stored
4
+ * events are never changed. Only repository adapters and subscriptions use it: the domain and the
5
+ * use cases never read a stream.
6
+ */
7
+ export class EventStore {
8
+ static {
9
+ Object.defineProperty(this, 'tokenKey', { value: 'kernel.EventStore' });
10
+ }
11
+ }
12
+ //# sourceMappingURL=event-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-store.js","sourceRoot":"","sources":["../../../src/application/ports/event-store.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,OAAgB,UAAU;IAC9B;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAC1E,CAAC;CAiBF"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Names the files: a key is always generated on the server, never built from what a user sent
3
+ * (a file name, a path), so a request can neither choose where it writes nor guess another key.
4
+ */
5
+ export declare abstract class FileKeys {
6
+ /** A new key under `area`, a key prefix of the project such as `appointment-documents`. */
7
+ abstract next(area: string): string;
8
+ }
9
+ //# sourceMappingURL=file-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-keys.d.ts","sourceRoot":"","sources":["../../../src/application/ports/file-keys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,8BAAsB,QAAQ;IAK5B,2FAA2F;IAC3F,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Names the files: a key is always generated on the server, never built from what a user sent
3
+ * (a file name, a path), so a request can neither choose where it writes nor guess another key.
4
+ */
5
+ export class FileKeys {
6
+ static {
7
+ Object.defineProperty(this, 'tokenKey', { value: 'kernel.FileKeys' });
8
+ }
9
+ }
10
+ //# sourceMappingURL=file-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-keys.js","sourceRoot":"","sources":["../../../src/application/ports/file-keys.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IAC5B;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACxE,CAAC;CAIF"}
@@ -0,0 +1,13 @@
1
+ import type { Readable } from 'node:stream';
2
+ import type { ScanVerdict } from '../files/scan-verdict.js';
3
+ import type { StoredFile } from '../files/stored-file.js';
4
+ /**
5
+ * The check a file passes before it is accepted: an antivirus (ClamAV over its socket, a cloud
6
+ * scanning service), a parser that refuses a malformed document, a policy on archives. Called on
7
+ * the staged file, so a refused file is never visible. `open` reads the content again; a scanner
8
+ * that needs none of it does not call it.
9
+ */
10
+ export declare abstract class FileScanner {
11
+ abstract scan(file: StoredFile, open: () => Promise<Readable>): Promise<ScanVerdict>;
12
+ }
13
+ //# sourceMappingURL=file-scanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-scanner.d.ts","sourceRoot":"","sources":["../../../src/application/ports/file-scanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;;;;GAKG;AACH,8BAAsB,WAAW;IAK/B,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACtF"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The check a file passes before it is accepted: an antivirus (ClamAV over its socket, a cloud
3
+ * scanning service), a parser that refuses a malformed document, a policy on archives. Called on
4
+ * the staged file, so a refused file is never visible. `open` reads the content again; a scanner
5
+ * that needs none of it does not call it.
6
+ */
7
+ export class FileScanner {
8
+ static {
9
+ Object.defineProperty(this, 'tokenKey', { value: 'kernel.FileScanner' });
10
+ }
11
+ }
12
+ //# sourceMappingURL=file-scanner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-scanner.js","sourceRoot":"","sources":["../../../src/application/ports/file-scanner.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,OAAgB,WAAW;IAC/B;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC3E,CAAC;CAGF"}
@@ -0,0 +1,40 @@
1
+ import type { DownloadUrlOptions } from '../files/download-url-options.js';
2
+ import type { FileContent } from '../files/file-content.js';
3
+ import type { FileMetadata } from '../files/file-metadata.js';
4
+ import type { FileSource } from '../files/file-source.js';
5
+ import type { ListedFile } from '../files/listed-file.js';
6
+ import type { PutOptions } from '../files/put-options.js';
7
+ import type { SignedUpload } from '../files/signed-upload.js';
8
+ import type { SignedUrl } from '../files/signed-url.js';
9
+ import type { StoredFile } from '../files/stored-file.js';
10
+ import type { UploadUrlOptions } from '../files/upload-url-options.js';
11
+ /**
12
+ * Where the content of files lives: an object store, a directory, the memory of a test. Never
13
+ * the database, whose backups, replicas and memory are sized for rows. Content always streams in
14
+ * and out: no method takes or returns a whole file. A key that `isFileKey` refuses is refused
15
+ * with `INVALID_FILE_KEY` before anything is touched.
16
+ *
17
+ * A write is not part of a transaction: see `FileStaging` for the order that keeps the database
18
+ * and the storage consistent.
19
+ */
20
+ export declare abstract class FileStorage {
21
+ /** Writes the content under the key, replacing what was there; rejects with `FILE_TOO_LARGE` beyond `maxBytes`, leaving nothing. */
22
+ abstract put(key: string, content: FileSource, options: PutOptions): Promise<StoredFile>;
23
+ /** The content as a stream, or `undefined` when nothing is stored under the key. */
24
+ abstract get(key: string): Promise<FileContent | undefined>;
25
+ /** What is known of the file without reading it, or `undefined`: how a caller asks whether it exists. */
26
+ abstract stat(key: string): Promise<FileMetadata | undefined>;
27
+ /** Removes the file; removing a file that is not there is not an error. */
28
+ abstract delete(key: string): Promise<void>;
29
+ /** Rejects with `FILE_NOT_FOUND` when nothing is stored under `from`. */
30
+ abstract copy(from: string, to: string): Promise<void>;
31
+ /** Rejects with `FILE_NOT_FOUND` when nothing is stored under `from`. */
32
+ abstract move(from: string, to: string): Promise<void>;
33
+ /** Every file whose key starts with the prefix, in no promised order. */
34
+ abstract list(prefix: string): AsyncIterable<ListedFile>;
35
+ /** A link that downloads the file until it expires. Signing does not check that the file exists. */
36
+ abstract signedDownloadUrl(key: string, options: DownloadUrlOptions): Promise<SignedUrl>;
37
+ /** A request that uploads one file under the key, straight to the storage, until it expires. */
38
+ abstract signedUploadUrl(key: string, options: UploadUrlOptions): Promise<SignedUpload>;
39
+ }
40
+ //# sourceMappingURL=file-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-storage.d.ts","sourceRoot":"","sources":["../../../src/application/ports/file-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvE;;;;;;;;GAQG;AACH,8BAAsB,WAAW;IAK/B,oIAAoI;IACpI,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEzF,oFAAoF;IACpF,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAE5D,yGAAyG;IACzG,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAAC;IAE9D,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C,yEAAyE;IACzE,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD,yEAAyE;IACzE,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD,yEAAyE;IACzE,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAEzD,oGAAoG;IACpG,QAAQ,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAEzF,gGAAgG;IAChG,QAAQ,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACzF"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Where the content of files lives: an object store, a directory, the memory of a test. Never
3
+ * the database, whose backups, replicas and memory are sized for rows. Content always streams in
4
+ * and out: no method takes or returns a whole file. A key that `isFileKey` refuses is refused
5
+ * with `INVALID_FILE_KEY` before anything is touched.
6
+ *
7
+ * A write is not part of a transaction: see `FileStaging` for the order that keeps the database
8
+ * and the storage consistent.
9
+ */
10
+ export class FileStorage {
11
+ static {
12
+ Object.defineProperty(this, 'tokenKey', { value: 'kernel.FileStorage' });
13
+ }
14
+ }
15
+ //# sourceMappingURL=file-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-storage.js","sourceRoot":"","sources":["../../../src/application/ports/file-storage.ts"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,MAAM,OAAgB,WAAW;IAC/B;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC3E,CAAC;CA4BF"}
@@ -0,0 +1,16 @@
1
+ import type { FileSource } from '../files/file-source.js';
2
+ import type { SignedDownload } from '../files/signed-download.js';
3
+ import type { StoredFile } from '../files/stored-file.js';
4
+ import { FileStorage } from './file-storage.js';
5
+ /**
6
+ * A storage whose signed links point at the application itself, which must then answer them:
7
+ * the local directory of development and the memory of the tests. `signedFileRoutes` of
8
+ * `@ddd-ts-kit/http` mounts that answer. An object store answers its own links and is not one.
9
+ */
10
+ export declare abstract class ServedFileStorage extends FileStorage {
11
+ /** The file a download link grants, or `undefined` for a link that is forged, expired or for another action. */
12
+ abstract openSigned(token: string): Promise<SignedDownload | undefined>;
13
+ /** Stores what an upload link grants, sent with the media type it was signed for; `undefined` when the link does not grant it. */
14
+ abstract acceptSigned(token: string, content: FileSource, mediaType: string): Promise<StoredFile | undefined>;
15
+ }
16
+ //# sourceMappingURL=served-file-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"served-file-storage.d.ts","sourceRoot":"","sources":["../../../src/application/ports/served-file-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,8BAAsB,iBAAkB,SAAQ,WAAW;IAKzD,gHAAgH;IAChH,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAExE,kIAAkI;IAClI,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CAC/G"}
@@ -0,0 +1,12 @@
1
+ import { FileStorage } from './file-storage.js';
2
+ /**
3
+ * A storage whose signed links point at the application itself, which must then answer them:
4
+ * the local directory of development and the memory of the tests. `signedFileRoutes` of
5
+ * `@ddd-ts-kit/http` mounts that answer. An object store answers its own links and is not one.
6
+ */
7
+ export class ServedFileStorage extends FileStorage {
8
+ static {
9
+ Object.defineProperty(this, 'tokenKey', { value: 'kernel.ServedFileStorage' });
10
+ }
11
+ }
12
+ //# sourceMappingURL=served-file-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"served-file-storage.js","sourceRoot":"","sources":["../../../src/application/ports/served-file-storage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAgB,iBAAkB,SAAQ,WAAW;IACzD;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;IACjF,CAAC;CAOF"}
@@ -0,0 +1,8 @@
1
+ import type { StoredSnapshot } from '../event-sourcing/stored-snapshot.js';
2
+ /** The last snapshot of each stream. Only the event-sourced repository uses it. */
3
+ export declare abstract class SnapshotStore {
4
+ abstract find(stream: string): Promise<StoredSnapshot | undefined>;
5
+ /** Keeps the snapshot unless the stream already has one of a later version. */
6
+ abstract save(snapshot: StoredSnapshot): Promise<void>;
7
+ }
8
+ //# sourceMappingURL=snapshot-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-store.d.ts","sourceRoot":"","sources":["../../../src/application/ports/snapshot-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAE3E,mFAAmF;AACnF,8BAAsB,aAAa;IAKjC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IAEnE,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD"}
@@ -0,0 +1,7 @@
1
+ /** The last snapshot of each stream. Only the event-sourced repository uses it. */
2
+ export class SnapshotStore {
3
+ static {
4
+ Object.defineProperty(this, 'tokenKey', { value: 'kernel.SnapshotStore' });
5
+ }
6
+ }
7
+ //# sourceMappingURL=snapshot-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-store.js","sourceRoot":"","sources":["../../../src/application/ports/snapshot-store.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,MAAM,OAAgB,aAAa;IACjC;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAC7E,CAAC;CAMF"}
@@ -0,0 +1,17 @@
1
+ import type { SubjectKey } from '../event-sourcing/subject-key.js';
2
+ /**
3
+ * The keys personal data is sealed with, one per data subject (crypto-shredding). Erasing a
4
+ * subject destroys its key: every value sealed with it can no longer be read from the live
5
+ * events and snapshots, nor from a backup of them that does not hold the key. A backup that
6
+ * holds the events and the keys together still opens them until it expires, so keep the keys
7
+ * apart from the events in production, with a shorter backup retention.
8
+ */
9
+ export declare abstract class SubjectKeyStore {
10
+ /** The current key of the subject, created when it has none, a first time or after an erasure. */
11
+ abstract keyFor(subject: string): Promise<SubjectKey>;
12
+ /** The key of this id, `undefined` once its subject was erased. */
13
+ abstract find(keyId: string): Promise<SubjectKey | undefined>;
14
+ /** Destroys the keys of the subject. Answers whether there was one. */
15
+ abstract erase(subject: string): Promise<boolean>;
16
+ }
17
+ //# sourceMappingURL=subject-key-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subject-key-store.d.ts","sourceRoot":"","sources":["../../../src/application/ports/subject-key-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAEnE;;;;;;GAMG;AACH,8BAAsB,eAAe;IAKnC,kGAAkG;IAClG,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEtD,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAE9D,uEAAuE;IACvE,QAAQ,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACnD"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The keys personal data is sealed with, one per data subject (crypto-shredding). Erasing a
3
+ * subject destroys its key: every value sealed with it can no longer be read from the live
4
+ * events and snapshots, nor from a backup of them that does not hold the key. A backup that
5
+ * holds the events and the keys together still opens them until it expires, so keep the keys
6
+ * apart from the events in production, with a shorter backup retention.
7
+ */
8
+ export class SubjectKeyStore {
9
+ static {
10
+ Object.defineProperty(this, 'tokenKey', { value: 'kernel.SubjectKeyStore' });
11
+ }
12
+ }
13
+ //# sourceMappingURL=subject-key-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subject-key-store.js","sourceRoot":"","sources":["../../../src/application/ports/subject-key-store.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,OAAgB,eAAe;IACnC;QACE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAC/E,CAAC;CAUF"}
@@ -0,0 +1,5 @@
1
+ import type { ProjectionFeed } from '../model/projection-feed.js';
2
+ export interface ProjectionOptions {
3
+ readonly feed: ProjectionFeed;
4
+ }
5
+ //# sourceMappingURL=projection-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection-options.d.ts","sourceRoot":"","sources":["../../../src/declarations/decorators/projection-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=projection-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection-options.js","sourceRoot":"","sources":["../../../src/declarations/decorators/projection-options.ts"],"names":[],"mappings":""}
@@ -1,11 +1,15 @@
1
1
  import type { ClassDeclarator } from '../dependencies/class-declarator.js';
2
2
  import type { DeclaredDependencies } from '../dependencies/declared-dependencies.js';
3
3
  import type { DependenciesFromSignature } from '../dependencies/dependencies-from-signature.js';
4
+ import type { ProjectionOptions } from './projection-options.js';
4
5
  /**
5
6
  * A projector: the class that keeps one read model up to date, each of its `@On` methods
6
7
  * applying one event through a port of its own read model:
7
8
  * `@Projection('scheduling.appointment-list')`. The name is the consumer
8
9
  * it is subscribed as: stable, `<context>.<name>`, unique in the application.
10
+ * `@Projection('scheduling.attendance-history', { feed: 'event-store' })` is fed from the event
11
+ * store by a catch-up subscription instead of where the domain events are dispatched.
9
12
  */
10
13
  export declare function Projection<const D extends DeclaredDependencies = DependenciesFromSignature>(name: `${string}.${string}`, dependencies?: D): ClassDeclarator<object, D>;
14
+ export declare function Projection<const D extends DeclaredDependencies = DependenciesFromSignature>(name: `${string}.${string}`, options: ProjectionOptions, dependencies?: D): ClassDeclarator<object, D>;
11
15
  //# sourceMappingURL=projection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../src/declarations/decorators/projection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAOhG;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,oBAAoB,GAAG,yBAAyB,EACzF,IAAI,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAC3B,YAAY,CAAC,EAAE,CAAC,GACf,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAgB5B"}
1
+ {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../../../src/declarations/decorators/projection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAOhG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,oBAAoB,GAAG,yBAAyB,EACzF,IAAI,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAC3B,YAAY,CAAC,EAAE,CAAC,GACf,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAC9B,wBAAgB,UAAU,CAAC,KAAK,CAAC,CAAC,SAAS,oBAAoB,GAAG,yBAAyB,EACzF,IAAI,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAC3B,OAAO,EAAE,iBAAiB,EAC1B,YAAY,CAAC,EAAE,CAAC,GACf,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC"}