@enbox/dwn-sdk-js 0.0.7 → 0.1.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 (368) hide show
  1. package/dist/browser.mjs +8 -8
  2. package/dist/browser.mjs.map +4 -4
  3. package/dist/esm/generated/precompiled-validators.js +817 -911
  4. package/dist/esm/generated/precompiled-validators.js.map +1 -1
  5. package/dist/esm/src/core/constants.js +11 -0
  6. package/dist/esm/src/core/constants.js.map +1 -0
  7. package/dist/esm/src/core/core-protocol.js +44 -0
  8. package/dist/esm/src/core/core-protocol.js.map +1 -0
  9. package/dist/esm/src/core/dwn-error.js +12 -12
  10. package/dist/esm/src/core/dwn-error.js.map +1 -1
  11. package/dist/esm/src/core/grant-authorization.js +16 -3
  12. package/dist/esm/src/core/grant-authorization.js.map +1 -1
  13. package/dist/esm/src/core/protocol-authorization-action.js +5 -0
  14. package/dist/esm/src/core/protocol-authorization-action.js.map +1 -1
  15. package/dist/esm/src/core/protocol-authorization-validation.js +91 -0
  16. package/dist/esm/src/core/protocol-authorization-validation.js.map +1 -1
  17. package/dist/esm/src/core/protocol-authorization.js +53 -30
  18. package/dist/esm/src/core/protocol-authorization.js.map +1 -1
  19. package/dist/esm/src/core/records-grant-authorization.js +6 -8
  20. package/dist/esm/src/core/records-grant-authorization.js.map +1 -1
  21. package/dist/esm/src/core/resumable-task-manager.js +2 -0
  22. package/dist/esm/src/core/resumable-task-manager.js.map +1 -1
  23. package/dist/esm/src/dwn.js +42 -18
  24. package/dist/esm/src/dwn.js.map +1 -1
  25. package/dist/esm/src/event-stream/event-emitter-event-log.js +204 -0
  26. package/dist/esm/src/event-stream/event-emitter-event-log.js.map +1 -0
  27. package/dist/esm/src/handlers/messages-read.js +7 -11
  28. package/dist/esm/src/handlers/messages-read.js.map +1 -1
  29. package/dist/esm/src/handlers/messages-subscribe.js +22 -24
  30. package/dist/esm/src/handlers/messages-subscribe.js.map +1 -1
  31. package/dist/esm/src/handlers/messages-sync.js +11 -15
  32. package/dist/esm/src/handlers/messages-sync.js.map +1 -1
  33. package/dist/esm/src/handlers/protocols-configure.js +37 -27
  34. package/dist/esm/src/handlers/protocols-configure.js.map +1 -1
  35. package/dist/esm/src/handlers/protocols-query.js +7 -11
  36. package/dist/esm/src/handlers/protocols-query.js.map +1 -1
  37. package/dist/esm/src/handlers/records-count.js +10 -12
  38. package/dist/esm/src/handlers/records-count.js.map +1 -1
  39. package/dist/esm/src/handlers/records-delete.js +10 -18
  40. package/dist/esm/src/handlers/records-delete.js.map +1 -1
  41. package/dist/esm/src/handlers/records-query.js +11 -15
  42. package/dist/esm/src/handlers/records-query.js.map +1 -1
  43. package/dist/esm/src/handlers/records-read.js +31 -26
  44. package/dist/esm/src/handlers/records-read.js.map +1 -1
  45. package/dist/esm/src/handlers/records-subscribe.js +39 -26
  46. package/dist/esm/src/handlers/records-subscribe.js.map +1 -1
  47. package/dist/esm/src/handlers/records-write.js +128 -105
  48. package/dist/esm/src/handlers/records-write.js.map +1 -1
  49. package/dist/esm/src/index.js +5 -2
  50. package/dist/esm/src/index.js.map +1 -1
  51. package/dist/esm/src/interfaces/messages-subscribe.js +1 -0
  52. package/dist/esm/src/interfaces/messages-subscribe.js.map +1 -1
  53. package/dist/esm/src/interfaces/protocols-configure.js +33 -3
  54. package/dist/esm/src/interfaces/protocols-configure.js.map +1 -1
  55. package/dist/esm/src/interfaces/records-count.js +1 -1
  56. package/dist/esm/src/interfaces/records-count.js.map +1 -1
  57. package/dist/esm/src/interfaces/records-delete.js +1 -1
  58. package/dist/esm/src/interfaces/records-delete.js.map +1 -1
  59. package/dist/esm/src/interfaces/records-query.js +1 -1
  60. package/dist/esm/src/interfaces/records-query.js.map +1 -1
  61. package/dist/esm/src/interfaces/records-read.js +1 -1
  62. package/dist/esm/src/interfaces/records-read.js.map +1 -1
  63. package/dist/esm/src/interfaces/records-subscribe.js +2 -1
  64. package/dist/esm/src/interfaces/records-subscribe.js.map +1 -1
  65. package/dist/esm/src/interfaces/records-write-signing.js +1 -12
  66. package/dist/esm/src/interfaces/records-write-signing.js.map +1 -1
  67. package/dist/esm/src/interfaces/records-write.js +25 -41
  68. package/dist/esm/src/interfaces/records-write.js.map +1 -1
  69. package/dist/esm/src/protocols/permission-grant.js +1 -1
  70. package/dist/esm/src/protocols/permission-grant.js.map +1 -1
  71. package/dist/esm/src/protocols/permission-request.js +1 -1
  72. package/dist/esm/src/protocols/permission-request.js.map +1 -1
  73. package/dist/esm/src/protocols/permissions.js +113 -5
  74. package/dist/esm/src/protocols/permissions.js.map +1 -1
  75. package/dist/esm/src/state-index/state-index-level.js +5 -7
  76. package/dist/esm/src/state-index/state-index-level.js.map +1 -1
  77. package/dist/esm/src/store/data-store-level.js +110 -33
  78. package/dist/esm/src/store/data-store-level.js.map +1 -1
  79. package/dist/esm/src/store/index-level.js +42 -32
  80. package/dist/esm/src/store/index-level.js.map +1 -1
  81. package/dist/esm/src/store/storage-controller.js +70 -6
  82. package/dist/esm/src/store/storage-controller.js.map +1 -1
  83. package/dist/esm/src/types/permission-types.js.map +1 -1
  84. package/dist/esm/src/types/protocols-types.js +11 -0
  85. package/dist/esm/src/types/protocols-types.js.map +1 -1
  86. package/dist/esm/src/types/records-types.js.map +1 -1
  87. package/dist/esm/src/utils/hd-key.js +0 -8
  88. package/dist/esm/src/utils/hd-key.js.map +1 -1
  89. package/dist/esm/src/utils/messages.js +16 -34
  90. package/dist/esm/src/utils/messages.js.map +1 -1
  91. package/dist/esm/src/utils/records.js +5 -43
  92. package/dist/esm/src/utils/records.js.map +1 -1
  93. package/dist/esm/tests/core/protocol-authorization.spec.js +2 -1
  94. package/dist/esm/tests/core/protocol-authorization.spec.js.map +1 -1
  95. package/dist/esm/tests/dwn.spec.js +32 -43
  96. package/dist/esm/tests/dwn.spec.js.map +1 -1
  97. package/dist/esm/tests/event-emitter-event-log.spec.js +305 -0
  98. package/dist/esm/tests/event-emitter-event-log.spec.js.map +1 -0
  99. package/dist/esm/tests/features/author-delegated-grant.spec.js +14 -7
  100. package/dist/esm/tests/features/author-delegated-grant.spec.js.map +1 -1
  101. package/dist/esm/tests/features/owner-delegated-grant.spec.js +9 -5
  102. package/dist/esm/tests/features/owner-delegated-grant.spec.js.map +1 -1
  103. package/dist/esm/tests/features/owner-signature.spec.js +14 -7
  104. package/dist/esm/tests/features/owner-signature.spec.js.map +1 -1
  105. package/dist/esm/tests/features/permissions.spec.js +12 -12
  106. package/dist/esm/tests/features/permissions.spec.js.map +1 -1
  107. package/dist/esm/tests/features/protocol-composition.spec.js +636 -5
  108. package/dist/esm/tests/features/protocol-composition.spec.js.map +1 -1
  109. package/dist/esm/tests/features/protocol-create-action.spec.js +4 -4
  110. package/dist/esm/tests/features/protocol-create-action.spec.js.map +1 -1
  111. package/dist/esm/tests/features/protocol-delete-action.spec.js +7 -7
  112. package/dist/esm/tests/features/protocol-delete-action.spec.js.map +1 -1
  113. package/dist/esm/tests/features/protocol-update-action.spec.js +4 -4
  114. package/dist/esm/tests/features/protocol-update-action.spec.js.map +1 -1
  115. package/dist/esm/tests/features/records-delivery.spec.js +236 -0
  116. package/dist/esm/tests/features/records-delivery.spec.js.map +1 -0
  117. package/dist/esm/tests/features/records-immutable.spec.js +315 -0
  118. package/dist/esm/tests/features/records-immutable.spec.js.map +1 -0
  119. package/dist/esm/tests/features/records-prune.spec.js +4 -4
  120. package/dist/esm/tests/features/records-prune.spec.js.map +1 -1
  121. package/dist/esm/tests/features/records-record-limit.spec.js +542 -0
  122. package/dist/esm/tests/features/records-record-limit.spec.js.map +1 -0
  123. package/dist/esm/tests/features/records-squash.spec.js +1055 -0
  124. package/dist/esm/tests/features/records-squash.spec.js.map +1 -0
  125. package/dist/esm/tests/features/records-tags.spec.js +16 -4
  126. package/dist/esm/tests/features/records-tags.spec.js.map +1 -1
  127. package/dist/esm/tests/features/resumable-tasks.spec.js +7 -8
  128. package/dist/esm/tests/features/resumable-tasks.spec.js.map +1 -1
  129. package/dist/esm/tests/handlers/messages-read.spec.js +11 -5
  130. package/dist/esm/tests/handlers/messages-read.spec.js.map +1 -1
  131. package/dist/esm/tests/handlers/messages-subscribe.spec.js +169 -22
  132. package/dist/esm/tests/handlers/messages-subscribe.spec.js.map +1 -1
  133. package/dist/esm/tests/handlers/messages-sync.spec.js +103 -21
  134. package/dist/esm/tests/handlers/messages-sync.spec.js.map +1 -1
  135. package/dist/esm/tests/handlers/protocols-configure.spec.js +5 -5
  136. package/dist/esm/tests/handlers/protocols-configure.spec.js.map +1 -1
  137. package/dist/esm/tests/handlers/protocols-query.spec.js +5 -5
  138. package/dist/esm/tests/handlers/protocols-query.spec.js.map +1 -1
  139. package/dist/esm/tests/handlers/records-count.spec.js +9 -4
  140. package/dist/esm/tests/handlers/records-count.spec.js.map +1 -1
  141. package/dist/esm/tests/handlers/records-delete.spec.js +24 -25
  142. package/dist/esm/tests/handlers/records-delete.spec.js.map +1 -1
  143. package/dist/esm/tests/handlers/records-query.spec.js +68 -9
  144. package/dist/esm/tests/handlers/records-query.spec.js.map +1 -1
  145. package/dist/esm/tests/handlers/records-read.spec.js +24 -138
  146. package/dist/esm/tests/handlers/records-read.spec.js.map +1 -1
  147. package/dist/esm/tests/handlers/records-subscribe.spec.js +175 -35
  148. package/dist/esm/tests/handlers/records-subscribe.spec.js.map +1 -1
  149. package/dist/esm/tests/handlers/records-write.spec.js +176 -72
  150. package/dist/esm/tests/handlers/records-write.spec.js.map +1 -1
  151. package/dist/esm/tests/interfaces/records-write.spec.js +52 -68
  152. package/dist/esm/tests/interfaces/records-write.spec.js.map +1 -1
  153. package/dist/esm/tests/protocols/permission-grant.spec.js +6 -6
  154. package/dist/esm/tests/protocols/permission-grant.spec.js.map +1 -1
  155. package/dist/esm/tests/protocols/permission-request.spec.js +4 -4
  156. package/dist/esm/tests/protocols/permission-request.spec.js.map +1 -1
  157. package/dist/esm/tests/protocols/permissions.spec.js +4 -4
  158. package/dist/esm/tests/protocols/permissions.spec.js.map +1 -1
  159. package/dist/esm/tests/scenarios/aggregator.spec.js +4 -4
  160. package/dist/esm/tests/scenarios/aggregator.spec.js.map +1 -1
  161. package/dist/esm/tests/scenarios/deleted-record.spec.js +350 -5
  162. package/dist/esm/tests/scenarios/deleted-record.spec.js.map +1 -1
  163. package/dist/esm/tests/scenarios/end-to-end-tests.spec.js +4 -4
  164. package/dist/esm/tests/scenarios/end-to-end-tests.spec.js.map +1 -1
  165. package/dist/esm/tests/scenarios/nested-roles.spec.js +4 -4
  166. package/dist/esm/tests/scenarios/nested-roles.spec.js.map +1 -1
  167. package/dist/esm/tests/scenarios/subscriptions.spec.js +93 -40
  168. package/dist/esm/tests/scenarios/subscriptions.spec.js.map +1 -1
  169. package/dist/esm/tests/store/data-store-level.spec.js +102 -41
  170. package/dist/esm/tests/store/data-store-level.spec.js.map +1 -1
  171. package/dist/esm/tests/test-event-stream.js +12 -13
  172. package/dist/esm/tests/test-event-stream.js.map +1 -1
  173. package/dist/esm/tests/test-suite.js +10 -4
  174. package/dist/esm/tests/test-suite.js.map +1 -1
  175. package/dist/esm/tests/utils/messages.spec.js +12 -5
  176. package/dist/esm/tests/utils/messages.spec.js.map +1 -1
  177. package/dist/esm/tests/utils/records.spec.js +8 -12
  178. package/dist/esm/tests/utils/records.spec.js.map +1 -1
  179. package/dist/esm/tests/utils/test-data-generator.js +36 -2
  180. package/dist/esm/tests/utils/test-data-generator.js.map +1 -1
  181. package/dist/esm/tests/validation/json-schemas/records/records-write.spec.js +37 -8
  182. package/dist/esm/tests/validation/json-schemas/records/records-write.spec.js.map +1 -1
  183. package/dist/types/generated/precompiled-validators.d.ts +49 -40
  184. package/dist/types/generated/precompiled-validators.d.ts.map +1 -1
  185. package/dist/types/src/core/constants.d.ts +11 -0
  186. package/dist/types/src/core/constants.d.ts.map +1 -0
  187. package/dist/types/src/core/core-protocol.d.ts +89 -0
  188. package/dist/types/src/core/core-protocol.d.ts.map +1 -0
  189. package/dist/types/src/core/dwn-error.d.ts +12 -12
  190. package/dist/types/src/core/dwn-error.d.ts.map +1 -1
  191. package/dist/types/src/core/grant-authorization.d.ts +6 -2
  192. package/dist/types/src/core/grant-authorization.d.ts.map +1 -1
  193. package/dist/types/src/core/protocol-authorization-action.d.ts.map +1 -1
  194. package/dist/types/src/core/protocol-authorization-validation.d.ts +30 -0
  195. package/dist/types/src/core/protocol-authorization-validation.d.ts.map +1 -1
  196. package/dist/types/src/core/protocol-authorization.d.ts +19 -11
  197. package/dist/types/src/core/protocol-authorization.d.ts.map +1 -1
  198. package/dist/types/src/core/records-grant-authorization.d.ts.map +1 -1
  199. package/dist/types/src/core/resumable-task-manager.d.ts +2 -1
  200. package/dist/types/src/core/resumable-task-manager.d.ts.map +1 -1
  201. package/dist/types/src/dwn.d.ts +19 -7
  202. package/dist/types/src/dwn.d.ts.map +1 -1
  203. package/dist/types/src/event-stream/event-emitter-event-log.d.ts +50 -0
  204. package/dist/types/src/event-stream/event-emitter-event-log.d.ts.map +1 -0
  205. package/dist/types/src/handlers/messages-read.d.ts +3 -8
  206. package/dist/types/src/handlers/messages-read.d.ts.map +1 -1
  207. package/dist/types/src/handlers/messages-subscribe.d.ts +6 -10
  208. package/dist/types/src/handlers/messages-subscribe.d.ts.map +1 -1
  209. package/dist/types/src/handlers/messages-sync.d.ts +3 -8
  210. package/dist/types/src/handlers/messages-sync.d.ts.map +1 -1
  211. package/dist/types/src/handlers/protocols-configure.d.ts +3 -10
  212. package/dist/types/src/handlers/protocols-configure.d.ts.map +1 -1
  213. package/dist/types/src/handlers/protocols-query.d.ts +3 -8
  214. package/dist/types/src/handlers/protocols-query.d.ts.map +1 -1
  215. package/dist/types/src/handlers/records-count.d.ts +3 -6
  216. package/dist/types/src/handlers/records-count.d.ts.map +1 -1
  217. package/dist/types/src/handlers/records-delete.d.ts +3 -8
  218. package/dist/types/src/handlers/records-delete.d.ts.map +1 -1
  219. package/dist/types/src/handlers/records-query.d.ts +3 -8
  220. package/dist/types/src/handlers/records-query.d.ts.map +1 -1
  221. package/dist/types/src/handlers/records-read.d.ts +3 -8
  222. package/dist/types/src/handlers/records-read.d.ts.map +1 -1
  223. package/dist/types/src/handlers/records-subscribe.d.ts +8 -10
  224. package/dist/types/src/handlers/records-subscribe.d.ts.map +1 -1
  225. package/dist/types/src/handlers/records-write.d.ts +12 -25
  226. package/dist/types/src/handlers/records-write.d.ts.map +1 -1
  227. package/dist/types/src/index.d.ts +8 -4
  228. package/dist/types/src/index.d.ts.map +1 -1
  229. package/dist/types/src/interfaces/messages-subscribe.d.ts +5 -0
  230. package/dist/types/src/interfaces/messages-subscribe.d.ts.map +1 -1
  231. package/dist/types/src/interfaces/protocols-configure.d.ts.map +1 -1
  232. package/dist/types/src/interfaces/records-subscribe.d.ts +5 -0
  233. package/dist/types/src/interfaces/records-subscribe.d.ts.map +1 -1
  234. package/dist/types/src/interfaces/records-write-signing.d.ts +3 -4
  235. package/dist/types/src/interfaces/records-write-signing.d.ts.map +1 -1
  236. package/dist/types/src/interfaces/records-write.d.ts +11 -11
  237. package/dist/types/src/interfaces/records-write.d.ts.map +1 -1
  238. package/dist/types/src/protocols/permission-grant.d.ts +1 -1
  239. package/dist/types/src/protocols/permission-grant.d.ts.map +1 -1
  240. package/dist/types/src/protocols/permission-request.d.ts +1 -1
  241. package/dist/types/src/protocols/permission-request.d.ts.map +1 -1
  242. package/dist/types/src/protocols/permissions.d.ts +40 -3
  243. package/dist/types/src/protocols/permissions.d.ts.map +1 -1
  244. package/dist/types/src/state-index/state-index-level.d.ts.map +1 -1
  245. package/dist/types/src/store/data-store-level.d.ts +20 -4
  246. package/dist/types/src/store/data-store-level.d.ts.map +1 -1
  247. package/dist/types/src/store/index-level.d.ts +4 -0
  248. package/dist/types/src/store/index-level.d.ts.map +1 -1
  249. package/dist/types/src/store/storage-controller.d.ts +20 -6
  250. package/dist/types/src/store/storage-controller.d.ts.map +1 -1
  251. package/dist/types/src/types/message-types.d.ts +3 -3
  252. package/dist/types/src/types/message-types.d.ts.map +1 -1
  253. package/dist/types/src/types/messages-types.d.ts +12 -3
  254. package/dist/types/src/types/messages-types.d.ts.map +1 -1
  255. package/dist/types/src/types/method-handler.d.ts +24 -3
  256. package/dist/types/src/types/method-handler.d.ts.map +1 -1
  257. package/dist/types/src/types/permission-types.d.ts +7 -0
  258. package/dist/types/src/types/permission-types.d.ts.map +1 -1
  259. package/dist/types/src/types/protocols-types.d.ts +69 -2
  260. package/dist/types/src/types/protocols-types.d.ts.map +1 -1
  261. package/dist/types/src/types/records-types.d.ts +23 -6
  262. package/dist/types/src/types/records-types.d.ts.map +1 -1
  263. package/dist/types/src/types/subscriptions.d.ts +151 -13
  264. package/dist/types/src/types/subscriptions.d.ts.map +1 -1
  265. package/dist/types/src/utils/hd-key.d.ts +1 -9
  266. package/dist/types/src/utils/hd-key.d.ts.map +1 -1
  267. package/dist/types/src/utils/messages.d.ts +7 -5
  268. package/dist/types/src/utils/messages.d.ts.map +1 -1
  269. package/dist/types/src/utils/records.d.ts +1 -11
  270. package/dist/types/src/utils/records.d.ts.map +1 -1
  271. package/dist/types/tests/dwn.spec.d.ts.map +1 -1
  272. package/dist/types/tests/event-emitter-event-log.spec.d.ts +2 -0
  273. package/dist/types/tests/event-emitter-event-log.spec.d.ts.map +1 -0
  274. package/dist/types/tests/features/author-delegated-grant.spec.d.ts.map +1 -1
  275. package/dist/types/tests/features/owner-delegated-grant.spec.d.ts.map +1 -1
  276. package/dist/types/tests/features/owner-signature.spec.d.ts.map +1 -1
  277. package/dist/types/tests/features/protocol-composition.spec.d.ts.map +1 -1
  278. package/dist/types/tests/features/records-delivery.spec.d.ts +2 -0
  279. package/dist/types/tests/features/records-delivery.spec.d.ts.map +1 -0
  280. package/dist/types/tests/features/records-immutable.spec.d.ts +2 -0
  281. package/dist/types/tests/features/records-immutable.spec.d.ts.map +1 -0
  282. package/dist/types/tests/features/records-record-limit.spec.d.ts +2 -0
  283. package/dist/types/tests/features/records-record-limit.spec.d.ts.map +1 -0
  284. package/dist/types/tests/features/records-squash.spec.d.ts +2 -0
  285. package/dist/types/tests/features/records-squash.spec.d.ts.map +1 -0
  286. package/dist/types/tests/features/records-tags.spec.d.ts.map +1 -1
  287. package/dist/types/tests/features/resumable-tasks.spec.d.ts.map +1 -1
  288. package/dist/types/tests/handlers/messages-read.spec.d.ts.map +1 -1
  289. package/dist/types/tests/handlers/messages-subscribe.spec.d.ts.map +1 -1
  290. package/dist/types/tests/handlers/messages-sync.spec.d.ts.map +1 -1
  291. package/dist/types/tests/handlers/records-count.spec.d.ts.map +1 -1
  292. package/dist/types/tests/handlers/records-delete.spec.d.ts.map +1 -1
  293. package/dist/types/tests/handlers/records-query.spec.d.ts.map +1 -1
  294. package/dist/types/tests/handlers/records-read.spec.d.ts.map +1 -1
  295. package/dist/types/tests/handlers/records-subscribe.spec.d.ts.map +1 -1
  296. package/dist/types/tests/handlers/records-write.spec.d.ts.map +1 -1
  297. package/dist/types/tests/scenarios/deleted-record.spec.d.ts.map +1 -1
  298. package/dist/types/tests/scenarios/subscriptions.spec.d.ts.map +1 -1
  299. package/dist/types/tests/test-event-stream.d.ts +11 -12
  300. package/dist/types/tests/test-event-stream.d.ts.map +1 -1
  301. package/dist/types/tests/test-suite.d.ts +2 -2
  302. package/dist/types/tests/test-suite.d.ts.map +1 -1
  303. package/dist/types/tests/utils/test-data-generator.d.ts +19 -0
  304. package/dist/types/tests/utils/test-data-generator.d.ts.map +1 -1
  305. package/package.json +5 -4
  306. package/src/core/constants.ts +11 -0
  307. package/src/core/core-protocol.ts +129 -0
  308. package/src/core/dwn-error.ts +18 -12
  309. package/src/core/grant-authorization.ts +20 -3
  310. package/src/core/protocol-authorization-action.ts +5 -0
  311. package/src/core/protocol-authorization-validation.ts +133 -0
  312. package/src/core/protocol-authorization.ts +71 -23
  313. package/src/core/records-grant-authorization.ts +6 -8
  314. package/src/core/resumable-task-manager.ts +3 -1
  315. package/src/dwn.ts +58 -73
  316. package/src/event-stream/event-emitter-event-log.ts +283 -0
  317. package/src/handlers/messages-read.ts +8 -9
  318. package/src/handlers/messages-subscribe.ts +24 -28
  319. package/src/handlers/messages-sync.ts +10 -16
  320. package/src/handlers/protocols-configure.ts +47 -32
  321. package/src/handlers/protocols-query.ts +6 -9
  322. package/src/handlers/records-count.ts +11 -10
  323. package/src/handlers/records-delete.ts +12 -21
  324. package/src/handlers/records-query.ts +12 -12
  325. package/src/handlers/records-read.ts +34 -22
  326. package/src/handlers/records-subscribe.ts +47 -26
  327. package/src/handlers/records-write.ts +152 -119
  328. package/src/index.ts +9 -5
  329. package/src/interfaces/messages-subscribe.ts +7 -1
  330. package/src/interfaces/protocols-configure.ts +51 -3
  331. package/src/interfaces/records-count.ts +1 -1
  332. package/src/interfaces/records-delete.ts +1 -1
  333. package/src/interfaces/records-query.ts +1 -1
  334. package/src/interfaces/records-read.ts +1 -1
  335. package/src/interfaces/records-subscribe.ts +8 -1
  336. package/src/interfaces/records-write-signing.ts +2 -22
  337. package/src/interfaces/records-write.ts +35 -48
  338. package/src/protocols/permission-grant.ts +1 -1
  339. package/src/protocols/permission-request.ts +1 -1
  340. package/src/protocols/permissions.ts +148 -6
  341. package/src/state-index/state-index-level.ts +5 -7
  342. package/src/store/data-store-level.ts +124 -34
  343. package/src/store/index-level.ts +44 -35
  344. package/src/store/storage-controller.ts +89 -12
  345. package/src/types/message-types.ts +3 -3
  346. package/src/types/messages-types.ts +12 -3
  347. package/src/types/method-handler.ts +26 -4
  348. package/src/types/mitt.d.ts +28 -0
  349. package/src/types/permission-types.ts +7 -0
  350. package/src/types/protocols-types.ts +78 -1
  351. package/src/types/records-types.ts +24 -6
  352. package/src/types/subscriptions.ts +178 -14
  353. package/src/utils/hd-key.ts +0 -9
  354. package/src/utils/messages.ts +17 -37
  355. package/src/utils/records.ts +7 -58
  356. package/dist/esm/src/event-stream/event-emitter-stream.js +0 -46
  357. package/dist/esm/src/event-stream/event-emitter-stream.js.map +0 -1
  358. package/dist/esm/tests/event-stream/event-emitter-stream.spec.js +0 -68
  359. package/dist/esm/tests/event-stream/event-emitter-stream.spec.js.map +0 -1
  360. package/dist/esm/tests/event-stream/event-stream.spec.js +0 -114
  361. package/dist/esm/tests/event-stream/event-stream.spec.js.map +0 -1
  362. package/dist/types/src/event-stream/event-emitter-stream.d.ts +0 -23
  363. package/dist/types/src/event-stream/event-emitter-stream.d.ts.map +0 -1
  364. package/dist/types/tests/event-stream/event-emitter-stream.spec.d.ts +0 -2
  365. package/dist/types/tests/event-stream/event-emitter-stream.spec.d.ts.map +0 -1
  366. package/dist/types/tests/event-stream/event-stream.spec.d.ts +0 -2
  367. package/dist/types/tests/event-stream/event-stream.spec.d.ts.map +0 -1
  368. package/src/event-stream/event-emitter-stream.ts +0 -69
@@ -1 +1 @@
1
- {"version":3,"file":"permission-types.d.ts","sourceRoot":"","sources":["../../../../src/types/permission-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAExF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAElC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB,UAAU,CAAC,EAAE,oBAAoB,CAAA;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;SAEK;IACL,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC;IAEvB,UAAU,CAAC,EAAE,oBAAoB,CAAA;CAClC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC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C,OAAO,CAAC;IACpC,MAAM,EAAE,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC;IAC9I,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,8BAA8B;IACxC,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;;OAIG;IACH,WAAW,CAAC,EAAE,8BAA8B,CAAC;CAC9C,CAAC"}
@@ -65,6 +65,7 @@ export declare enum ProtocolAction {
65
65
  Delete = "delete",
66
66
  Prune = "prune",
67
67
  Read = "read",
68
+ Squash = "squash",
68
69
  Update = "update"
69
70
  }
70
71
  /**
@@ -136,6 +137,43 @@ export type ProtocolSizeDefinition = {
136
137
  min?: number;
137
138
  max?: number;
138
139
  };
140
+ /**
141
+ * Supported strategies for handling writes that would exceed a `$recordLimit`.
142
+ */
143
+ export declare enum ProtocolRecordLimitStrategy {
144
+ /** Reject the incoming write with an error. The author must delete old records first. */
145
+ Reject = "reject",
146
+ /** Automatically delete the oldest record(s) (by `dateCreated`) to make room for the new one. */
147
+ PurgeOldest = "purgeOldest"
148
+ }
149
+ /**
150
+ * Limits the number of records at a given protocol path within the same parent context.
151
+ *
152
+ * For root-level records, the count is across the entire protocol for the tenant.
153
+ * For nested records, the count is scoped to the parent record's context.
154
+ *
155
+ * Only initial writes (new records) count toward the limit; updates to existing records do not.
156
+ */
157
+ export type ProtocolRecordLimitDefinition = {
158
+ /** Maximum number of records allowed at this path within the same parent context. Must be >= 1. */
159
+ max: number;
160
+ /**
161
+ * Strategy when the limit is reached.
162
+ * Currently only `'reject'` is implemented. Future strategies (e.g. `'purgeOldest'`)
163
+ * are defined in the wire format but not yet enforced.
164
+ */
165
+ strategy: ProtocolRecordLimitStrategy | `${ProtocolRecordLimitStrategy}` | (string & {});
166
+ };
167
+ /**
168
+ * Delivery strategy for records at a given protocol path.
169
+ * Controls how a DWN server proactively distributes records to participants' DWN endpoints.
170
+ *
171
+ * - `'direct'` — The origin DWN pushes new records to all participants' DWN endpoints.
172
+ * Best for small participant sets (2–50).
173
+ * - `'subscribe'` — Participant providers establish `RecordsSubscribe` connections to the
174
+ * origin DWN. Best for asymmetric fan-out or unbounded audiences.
175
+ */
176
+ export type ProtocolDeliveryStrategy = 'direct' | 'subscribe';
139
177
  /**
140
178
  * Tag rules for records at a given protocol path. Each non-`$`-prefixed property
141
179
  * is a JSON Schema object constraining that tag's value.
@@ -176,10 +214,10 @@ export type ProtocolTagSchema = {
176
214
  /**
177
215
  * Union of all value types that can appear as properties of a `ProtocolRuleSet`.
178
216
  * This includes:
179
- * - `$`-prefixed directive values (`$encryption`, `$actions`, `$role`, `$ref`, `$size`, `$tags`)
217
+ * - `$`-prefixed directive values (`$encryption`, `$actions`, `$role`, `$ref`, `$size`, `$tags`, `$delivery`)
180
218
  * - Child `ProtocolRuleSet` entries (non-`$` keys)
181
219
  */
182
- type ProtocolRuleSetValue = ProtocolRuleSet | ProtocolActionRule[] | ProtocolPathEncryption | ProtocolTagsDefinition | ProtocolSizeDefinition | boolean | string | undefined;
220
+ type ProtocolRuleSetValue = ProtocolRuleSet | ProtocolActionRule[] | ProtocolPathEncryption | ProtocolTagsDefinition | ProtocolSizeDefinition | ProtocolRecordLimitDefinition | ProtocolDeliveryStrategy | boolean | string | undefined;
183
221
  export type ProtocolRuleSet = {
184
222
  /**
185
223
  * Encryption setting for objects that are in this protocol path.
@@ -217,6 +255,35 @@ export type ProtocolRuleSet = {
217
255
  * If $tags is set, the record must conform to the tag rules.
218
256
  */
219
257
  $tags?: ProtocolTagsDefinition;
258
+ /**
259
+ * If $recordLimit is set, the number of records at this protocol path within the same
260
+ * parent context is constrained. When the limit is reached, the `strategy` determines
261
+ * whether the write is rejected or the oldest record is purged.
262
+ */
263
+ $recordLimit?: ProtocolRecordLimitDefinition;
264
+ /**
265
+ * If `$immutable` is `true`, records at this protocol path are write-once: they can be
266
+ * created but never updated after the initial write. `RecordsDelete` is still governed
267
+ * by `$actions` — immutability means the record's data cannot change, not that it
268
+ * cannot be removed.
269
+ */
270
+ $immutable?: boolean;
271
+ /**
272
+ * Delivery strategy hint for records at this protocol path.
273
+ * When set, the DWN server SHOULD proactively deliver records to participants' DWN endpoints.
274
+ *
275
+ * - `'direct'` — Origin DWN pushes to all participant DWN endpoints upon receipt.
276
+ * - `'subscribe'` — Participant providers subscribe to the origin DWN via `RecordsSubscribe`.
277
+ */
278
+ $delivery?: ProtocolDeliveryStrategy;
279
+ /**
280
+ * If `$squash` is `true`, enables squash writes at this protocol path.
281
+ * A squash write is a `RecordsWrite` with `squash: true` in the descriptor that
282
+ * atomically creates a new record (the snapshot) and deletes all sibling records
283
+ * at the same protocol path within the same parent context that have a
284
+ * `messageTimestamp` strictly older than the squash record's `messageTimestamp`.
285
+ */
286
+ $squash?: boolean;
220
287
  /**
221
288
  * Non-`$`-prefixed keys are nested child `ProtocolRuleSet` entries.
222
289
  * At runtime, JSON Schema validation ensures only valid child rule sets appear here.
@@ -1 +1 @@
1
- {"version":3,"file":"protocols-types.d.ts","sourceRoot":"","sources":["../../../../src/types/protocols-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAExF,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAG,gBAAgB,CAAC,SAAS,CAAC;IACvC,MAAM,EAAE,aAAa,CAAC,SAAS,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GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAG,gBAAgB,CAAC,SAAS,CAAC;IACvC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IACnD,UAAU,EAAE,wBAAwB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,GAAG;IACtD,OAAO,CAAC,EAAE,yBAAyB,EAAE,CAAC;CACvC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { GeneralJws } from './jws-types.js';
2
2
  import type { JweEncryption } from '../utils/encryption.js';
3
+ import type { SubscriptionListener } from './subscriptions.js';
3
4
  import type { AuthorizationModel, GenericMessage, GenericMessageReply, GenericSignaturePayload, MessageSubscription, Pagination } from './message-types.js';
4
5
  import type { DwnInterfaceName, DwnMethodName } from '../enums/dwn-interface-method.js';
5
6
  import type { PaginationCursor, RangeCriterion, RangeFilter, StartsWithFilter } from './query-types.js';
@@ -19,8 +20,8 @@ export type RecordsWriteTagsFilter = StartsWithFilter | RangeFilter | string | n
19
20
  export type RecordsWriteDescriptor = {
20
21
  interface: DwnInterfaceName.Records;
21
22
  method: DwnMethodName.Write;
22
- protocol?: string;
23
- protocolPath?: string;
23
+ protocol: string;
24
+ protocolPath: string;
24
25
  recipient?: string;
25
26
  schema?: string;
26
27
  tags?: RecordsWriteTags;
@@ -33,6 +34,13 @@ export type RecordsWriteDescriptor = {
33
34
  datePublished?: string;
34
35
  dataFormat: string;
35
36
  permissionGrantId?: string;
37
+ /**
38
+ * When `true`, this record is a squash (snapshot) write. The protocol rule set at this record's
39
+ * `protocolPath` must have `$squash: true`; otherwise the message is rejected.
40
+ * A squash write must be an initial write (a new record, not an update).
41
+ * This is an immutable property.
42
+ */
43
+ squash?: true;
36
44
  };
37
45
  export type RecordsWriteMessageOptions = {
38
46
  dataStream?: ReadableStream<Uint8Array>;
@@ -50,7 +58,7 @@ export type InternalRecordsWriteMessage = GenericMessage & {
50
58
  export type RecordsWriteMessage = {
51
59
  authorization: AuthorizationModel;
52
60
  recordId: string;
53
- contextId?: string;
61
+ contextId: string;
54
62
  descriptor: RecordsWriteDescriptor;
55
63
  attestation?: GeneralJws;
56
64
  encryption?: JweEncryption;
@@ -107,6 +115,12 @@ export type RecordsSubscribeDescriptor = {
107
115
  filter: RecordsFilter;
108
116
  dateSort?: DateSort;
109
117
  pagination?: Pagination;
118
+ /**
119
+ * Opaque EventLog cursor string to resume from. When provided, the handler replays
120
+ * events from the EventLog starting after this cursor instead of querying the
121
+ * MessageStore for an initial snapshot. An EOSE marker is sent after catch-up.
122
+ */
123
+ cursor?: string;
110
124
  };
111
125
  export type RecordsFilter = {
112
126
  /**
@@ -140,7 +154,7 @@ export type RecordsWriteAttestationPayload = {
140
154
  };
141
155
  export type RecordsWriteSignaturePayload = GenericSignaturePayload & {
142
156
  recordId: string;
143
- contextId?: string;
157
+ contextId: string;
144
158
  attestationCid?: string;
145
159
  encryptionCid?: string;
146
160
  };
@@ -155,9 +169,12 @@ export type RecordEvent = {
155
169
  message: RecordsWriteMessage | RecordsDeleteMessage;
156
170
  initialWrite?: RecordsWriteMessage;
157
171
  };
158
- export type RecordSubscriptionHandler = (event: RecordEvent) => void;
172
+ /**
173
+ * @deprecated Use {@link SubscriptionListener} directly. Retained as an alias for migration.
174
+ */
175
+ export type RecordSubscriptionHandler = SubscriptionListener;
159
176
  export type RecordsSubscribeMessageOptions = {
160
- subscriptionHandler: RecordSubscriptionHandler;
177
+ subscriptionHandler: SubscriptionListener;
161
178
  };
162
179
  export type RecordsSubscribeMessage = GenericMessage & {
163
180
  descriptor: RecordsSubscribeDescriptor;
@@ -1 +1 @@
1
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,IAAI,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG;IAClD,aAAa,EAAE,kBAAkB,CAAC;IAClC,UAAU,EAAE,uBAAuB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,gBAAgB,CAAC,OAAO,CAAC;IACpC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAA;CACf,CAAC"}
@@ -1,8 +1,12 @@
1
- import type { GenericMessageReply } from '../types/message-types.js';
2
- import type { KeyValues } from './query-types.js';
3
1
  import type { RecordsWriteMessage } from './records-types.js';
4
- import type { GenericMessage, MessageSubscription } from './message-types.js';
5
- export type EventListener = (tenant: string, event: MessageEvent, indexes: KeyValues) => void;
2
+ import type { Filter, KeyValues } from './query-types.js';
3
+ import type { GenericMessage, GenericMessageReply, MessageSubscription } from './message-types.js';
4
+ /**
5
+ * Internal listener type used by {@link EventLog.emit} to notify in-process
6
+ * subscribers. Not intended for direct consumer use — consumers should use
7
+ * {@link SubscriptionListener} via {@link EventLog.subscribe}.
8
+ */
9
+ export type EventListener = (tenant: string, event: MessageEvent, indexes: KeyValues, seq: number) => void;
6
10
  /**
7
11
  * MessageEvent contains the message being emitted and an optional initial write message.
8
12
  */
@@ -11,15 +15,6 @@ export type MessageEvent = {
11
15
  /** the initial write of the RecordsWrite or RecordsDelete message */
12
16
  initialWrite?: RecordsWriteMessage;
13
17
  };
14
- /**
15
- * The EventStream interface implements a pub/sub system based on Message filters.
16
- */
17
- export interface EventStream {
18
- subscribe(tenant: string, id: string, listener: EventListener): Promise<EventSubscription>;
19
- emit(tenant: string, event: MessageEvent, indexes: KeyValues): void;
20
- open(): Promise<void>;
21
- close(): Promise<void>;
22
- }
23
18
  export interface EventSubscription {
24
19
  id: string;
25
20
  close: () => Promise<void>;
@@ -27,4 +22,147 @@ export interface EventSubscription {
27
22
  export type SubscriptionReply = GenericMessageReply & {
28
23
  subscription?: MessageSubscription;
29
24
  };
25
+ /**
26
+ * A regular subscription event carrying a message and its EventLog cursor.
27
+ */
28
+ export type SubscriptionEvent = {
29
+ type: 'event';
30
+ /**
31
+ * Opaque cursor string assigned by the EventLog implementation. Clients should
32
+ * persist this value and pass it back to `subscribe()` or `read()` to resume
33
+ * from this point. The format is implementation-defined (e.g. numeric sequence
34
+ * for in-memory, Redis stream ID, NATS stream sequence, etc.).
35
+ */
36
+ cursor: string;
37
+ /** The event payload (message + optional initialWrite). */
38
+ event: MessageEvent;
39
+ };
40
+ /**
41
+ * End-of-Stored-Events marker. Sent after all catch-up events have been replayed
42
+ * from the EventLog. After EOSE, all subsequent events are live.
43
+ *
44
+ * Only delivered when a subscription is created with a `cursor`. Subscriptions
45
+ * without a cursor never receive EOSE.
46
+ */
47
+ export type SubscriptionEose = {
48
+ type: 'eose';
49
+ /**
50
+ * Opaque cursor string of the last stored event that was replayed.
51
+ * Echoes the input cursor when no stored events matched (i.e. already caught up).
52
+ */
53
+ cursor: string;
54
+ };
55
+ /**
56
+ * Discriminated union of subscription event types delivered to
57
+ * {@link SubscriptionListener} callbacks.
58
+ */
59
+ export type SubscriptionMessage = SubscriptionEvent | SubscriptionEose;
60
+ /**
61
+ * Callback for {@link EventLog.subscribe}. Receives either a regular event
62
+ * (with cursor) or an EOSE marker indicating catch-up replay is complete.
63
+ */
64
+ export type SubscriptionListener = (message: SubscriptionMessage) => void;
65
+ /**
66
+ * Options for {@link EventLog.subscribe}.
67
+ */
68
+ export type EventLogSubscribeOptions = {
69
+ /**
70
+ * Opaque cursor string to resume from (exclusive — events after this cursor
71
+ * are replayed). When provided, stored events are replayed first, followed by
72
+ * an EOSE marker, then live events. When omitted, only live events are delivered.
73
+ *
74
+ * Cursor values are implementation-defined and must be obtained from a prior
75
+ * interaction with the same EventLog instance (e.g. `SubscriptionEvent.cursor`,
76
+ * `EventLogReadResult.cursor`, or the return value of `emit()`).
77
+ */
78
+ cursor?: string;
79
+ /**
80
+ * Filters evaluated against event indexes. Events must match at least one
81
+ * filter (OR semantics). When omitted, all events are delivered.
82
+ */
83
+ filters?: Filter[];
84
+ };
85
+ /**
86
+ * A single entry returned by {@link EventLog.read}.
87
+ */
88
+ export type EventLogEntry = {
89
+ /** Monotonic sequence number scoped to (instance, tenant). */
90
+ seq: number;
91
+ /** The event payload. */
92
+ event: MessageEvent;
93
+ /** Indexes associated with the event (used for filter matching). */
94
+ indexes: KeyValues;
95
+ };
96
+ /**
97
+ * Options accepted by {@link EventLog.read}.
98
+ */
99
+ export type EventLogReadOptions = {
100
+ /** Opaque cursor string to resume from (exclusive — returns events after this cursor). */
101
+ cursor?: string;
102
+ /** Maximum number of events to return. */
103
+ limit?: number;
104
+ /** Optional filters evaluated server-side. Events must match at least one filter (OR semantics). */
105
+ filters?: Filter[];
106
+ };
107
+ /**
108
+ * Result returned by {@link EventLog.read}.
109
+ */
110
+ export type EventLogReadResult = {
111
+ /** Events matching the read request, ordered by ascending seq. */
112
+ events: EventLogEntry[];
113
+ /**
114
+ * Opaque cursor string for resuming subsequent reads or subscriptions.
115
+ *
116
+ * - When events are returned: cursor of the last event.
117
+ * - When no events are returned but a cursor was provided: the input cursor
118
+ * (meaning "you are caught up, nothing new since this point").
119
+ * - When no events exist and no cursor was provided: `undefined`.
120
+ */
121
+ cursor?: string;
122
+ };
123
+ /**
124
+ * The EventLog interface provides persistent, ordered event storage with
125
+ * cursor-based reads and subscription support.
126
+ *
127
+ * It persists events before delivery, exposing opaque cursor strings
128
+ * that enable cursor-based resume after disconnects.
129
+ *
130
+ * The interface is intentionally transport-agnostic — implementations can be
131
+ * backed by LevelDB (embedded), SQL, NATS JetStream, Redis Streams, etc.
132
+ * Each implementation owns the catch-up + live transition strategy appropriate
133
+ * to its backend (e.g., NATS pull consumers, Redis XREAD, in-memory buffering).
134
+ */
135
+ export interface EventLog {
136
+ /**
137
+ * Persist an event and notify in-process subscribers.
138
+ * @returns The opaque cursor string assigned to the event, or empty string on failure.
139
+ */
140
+ emit(tenant: string, event: MessageEvent, indexes: KeyValues): Promise<string>;
141
+ /**
142
+ * Read events from the log starting after `cursor`, optionally filtered.
143
+ */
144
+ read(tenant: string, options?: EventLogReadOptions): Promise<EventLogReadResult>;
145
+ /**
146
+ * Subscribe to events for a tenant.
147
+ *
148
+ * When `options.cursor` is provided, the implementation replays stored events
149
+ * from that cursor through the listener, delivers an EOSE marker, then
150
+ * continues with live events. The catch-up → live transition (including
151
+ * buffering and deduplication) is owned by the implementation.
152
+ *
153
+ * When `options.cursor` is omitted, only live events are delivered.
154
+ *
155
+ * @param tenant The tenant DID to subscribe to.
156
+ * @param id A unique subscription identifier (used for close/tracking).
157
+ * @param listener Callback that receives {@link SubscriptionMessage} events.
158
+ * @param options Optional cursor and filters for catch-up replay.
159
+ */
160
+ subscribe(tenant: string, id: string, listener: SubscriptionListener, options?: EventLogSubscribeOptions): Promise<EventSubscription>;
161
+ /**
162
+ * Delete events older than the given sequence number or ISO-8601 timestamp.
163
+ */
164
+ trim(tenant: string, olderThan: number | string): Promise<void>;
165
+ open(): Promise<void>;
166
+ close(): Promise<void>;
167
+ }
30
168
  //# sourceMappingURL=subscriptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../../src/types/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OA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KeyJwk } from '../types/jose-types.js';
2
2
  export declare enum KeyDerivationScheme {
3
- /**
4
- * Key derivation using the `dataFormat` value for Flat-space records.
5
- */
6
- DataFormats = "dataFormats",
7
3
  ProtocolContext = "protocolContext",
8
- ProtocolPath = "protocolPath",
9
- /**
10
- * Key derivation using the `schema` value for Flat-space records.
11
- */
12
- Schemas = "schemas"
4
+ ProtocolPath = "protocolPath"
13
5
  }
14
6
  export type DerivedPrivateJwk = {
15
7
  rootKeyId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"hd-key.d.ts","sourceRoot":"","sources":["../../../../src/utils/hd-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAO1E,oBAAY,mBAAmB;IAC7B;;OAEG;IACH,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAE7B;;OAEG;IACH,OAAO,YAAY;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,EAAE,aAAa,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,qBAAa,KAAK;IAChB;;;OAGG;WACiB,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAe7H;;;OAGG;WACiB,eAAe,CAAC,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAOvH;;OAEG;WACiB,qBAAqB,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IAiB9G;;OAEG;WACiB,kBAAkB,CAAC,MAAM,EAAE;QAC7C,aAAa,EAAE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OAAO,CAAC,UAAU,CAAC;IAyBvB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;CAKzC"}
@@ -1,3 +1,4 @@
1
+ import type { CoreProtocolRegistry } from '../core/core-protocol.js';
1
2
  import type { Filter } from '../types/query-types.js';
2
3
  import type { MessagesFilter } from '../types/messages-types.js';
3
4
  /**
@@ -11,14 +12,15 @@ export declare class Messages {
11
12
  /**
12
13
  * Converts an incoming array of MessagesFilter into an array of Filter usable by MessageLog.
13
14
  *
15
+ * When a `CoreProtocolRegistry` is provided, each registered core protocol's
16
+ * `constructAdditionalMessageFilter` hook is invoked per filter. This replaces the previous
17
+ * hardcoded permission-records shadow filter with a generic loop over all core protocols.
18
+ *
14
19
  * @param filters An array of MessagesFilter
20
+ * @param coreProtocols Optional registry of core protocols whose additional filters are injected.
15
21
  * @returns {Filter[]} an array of generic Filter able to be used when querying.
16
22
  */
17
- static convertFilters(filters: MessagesFilter[]): Filter[];
18
- /**
19
- * Constructs a filter that gets associated permission records if protocol is in the given filter.
20
- */
21
- private static constructPermissionRecordsFilter;
23
+ static convertFilters(filters: MessagesFilter[], coreProtocols?: CoreProtocolRegistry): Filter[];
22
24
  /**
23
25
  * Converts an external-facing filter model into an internal-facing filer model used by data store.
24
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/utils/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASjE;;GAEG;AACH,qBAAa,QAAQ;IACnB;;OAEG;WACW,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;IAwB3E;;;;;OAKG;WACW,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,MAAM,EAAE;IAwBjE;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gCAAgC;IAoB/C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;CAW7B"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/utils/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAOjE;;GAEG;AACH,qBAAa,QAAQ;IACnB;;OAEG;WACW,gBAAgB,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;IAwB3E;;;;;;;;;;OAUG;WACW,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,aAAa,CAAC,EAAE,oBAAoB,GAAG,MAAM,EAAE;IAuBvG;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;CAW7B"}
@@ -29,12 +29,6 @@ export declare class Records {
29
29
  * Constructs full key derivation path using the specified scheme.
30
30
  */
31
31
  static constructKeyDerivationPath(keyDerivationScheme: KeyDerivationScheme, recordsWriteMessage: RecordsWriteMessage): string[];
32
- /**
33
- * Constructs the full key derivation path using `dataFormats` scheme.
34
- * The derivation path is always `["dataFormats", "<mime-type>"]` regardless of whether
35
- * a schema is present. This matches the spec: keys are derived purely from the MIME type.
36
- */
37
- static constructKeyDerivationPathUsingDataFormatsScheme(dataFormat: string): string[];
38
32
  /**
39
33
  * Constructs the full key derivation path using `protocolPath` scheme.
40
34
  *
@@ -54,11 +48,7 @@ export declare class Records {
54
48
  * a shared context (e.g., thread participants can decrypt messages from both the threads protocol
55
49
  * and composing protocols that attach to those threads).
56
50
  */
57
- static constructKeyDerivationPathUsingProtocolContextScheme(contextId: string | undefined): string[];
58
- /**
59
- * Constructs the full key derivation path using `schemas` scheme.
60
- */
61
- static constructKeyDerivationPathUsingSchemasScheme(schema: string | undefined): string[];
51
+ static constructKeyDerivationPathUsingProtocolContextScheme(contextId: string): string[];
62
52
  /**
63
53
  * Derives a descendant private key given an ancestor private key and the full absolute derivation path.
64
54
  * Uses X25519 keys for encryption key derivation.
@@ -1 +1 @@
1
- {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../../src/utils/records.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACtG,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnQ,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAYrD,OAAO,EAAS,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGzD;;GAEG;AACH,qBAAa,OAAO;IAElB;;OAEG;WACW,cAAc,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,IAAI,mBAAmB;IAQrF;;;;;OAKG;WACiB,OAAO,CACzB,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,cAAc,CAAC,UAAU,CAAC,GACvC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAEtC;;;OAGG;WACiB,OAAO,CACzB,YAAY,EAAE,mBAAmB,EACjC,kBAAkB,EAAE,iBAAiB,EACrC,YAAY,EAAE,cAAc,CAAC,UAAU,CAAC,GACvC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAuEtC;;OAEG;W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AAO;CAO1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"dwn.spec.d.ts","sourceRoot":"","sources":["../../../tests/dwn.spec.ts"],"names":[],"mappings":"AAgBA,wBAAgB,YAAY,IAAI,IAAI,CAqKnC"}
1
+ {"version":3,"file":"dwn.spec.d.ts","sourceRoot":"","sources":["../../../tests/dwn.spec.ts"],"names":[],"mappings":"AAeA,wBAAgB,YAAY,IAAI,IAAI,CAuJnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=event-emitter-event-log.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-emitter-event-log.spec.d.ts","sourceRoot":"","sources":["../../../tests/event-emitter-event-log.spec.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"author-delegated-grant.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/author-delegated-grant.spec.ts"],"names":[],"mappings":"AA2BA,wBAAgB,wBAAwB,IAAI,IAAI,CAkiD/C"}
1
+ {"version":3,"file":"author-delegated-grant.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/author-delegated-grant.spec.ts"],"names":[],"mappings":"AA2BA,wBAAgB,wBAAwB,IAAI,IAAI,CAuiD/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"owner-delegated-grant.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/owner-delegated-grant.spec.ts"],"names":[],"mappings":"AAsBA,wBAAgB,uBAAuB,IAAI,IAAI,CAirB9C"}
1
+ {"version":3,"file":"owner-delegated-grant.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/owner-delegated-grant.spec.ts"],"names":[],"mappings":"AAsBA,wBAAgB,uBAAuB,IAAI,IAAI,CAqrB9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"owner-signature.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/owner-signature.spec.ts"],"names":[],"mappings":"AAqBA,wBAAgB,kBAAkB,IAAI,IAAI,CAwMzC"}
1
+ {"version":3,"file":"owner-signature.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/owner-signature.spec.ts"],"names":[],"mappings":"AAqBA,wBAAgB,kBAAkB,IAAI,IAAI,CAkNzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-composition.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/protocol-composition.spec.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAo1D9C"}
1
+ {"version":3,"file":"protocol-composition.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/protocol-composition.spec.ts"],"names":[],"mappings":"AAyBA;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAgiF9C"}
@@ -0,0 +1,2 @@
1
+ export declare function testRecordsDelivery(): void;
2
+ //# sourceMappingURL=records-delivery.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records-delivery.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/records-delivery.spec.ts"],"names":[],"mappings":"AAiBA,wBAAgB,mBAAmB,IAAI,IAAI,CAmQ1C"}
@@ -0,0 +1,2 @@
1
+ export declare function testRecordsImmutable(): void;
2
+ //# sourceMappingURL=records-immutable.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records-immutable.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/records-immutable.spec.ts"],"names":[],"mappings":"AAiBA,wBAAgB,oBAAoB,IAAI,IAAI,CAsW3C"}
@@ -0,0 +1,2 @@
1
+ export declare function testRecordsRecordLimit(): void;
2
+ //# sourceMappingURL=records-record-limit.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records-record-limit.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/records-record-limit.spec.ts"],"names":[],"mappings":"AAiBA,wBAAgB,sBAAsB,IAAI,IAAI,CAknB7C"}
@@ -0,0 +1,2 @@
1
+ export declare function testRecordsSquash(): void;
2
+ //# sourceMappingURL=records-squash.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records-squash.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/records-squash.spec.ts"],"names":[],"mappings":"AAqBA,wBAAgB,iBAAiB,IAAI,IAAI,CA4oCxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"records-tags.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/records-tags.spec.ts"],"names":[],"mappings":"AAsBA,wBAAgB,eAAe,IAAI,IAAI,CA+wFtC"}
1
+ {"version":3,"file":"records-tags.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/records-tags.spec.ts"],"names":[],"mappings":"AAsBA,wBAAgB,eAAe,IAAI,IAAI,CA2xFtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"resumable-tasks.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/resumable-tasks.spec.ts"],"names":[],"mappings":"AAyBA,wBAAgB,kBAAkB,IAAI,IAAI,CA2XzC"}
1
+ {"version":3,"file":"resumable-tasks.spec.d.ts","sourceRoot":"","sources":["../../../../tests/features/resumable-tasks.spec.ts"],"names":[],"mappings":"AAwBA,wBAAgB,kBAAkB,IAAI,IAAI,CA2XzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages-read.spec.d.ts","sourceRoot":"","sources":["../../../../tests/handlers/messages-read.spec.ts"],"names":[],"mappings":"AAqBA,wBAAgB,uBAAuB,IAAI,IAAI,CAqwB9C"}
1
+ {"version":3,"file":"messages-read.spec.d.ts","sourceRoot":"","sources":["../../../../tests/handlers/messages-read.spec.ts"],"names":[],"mappings":"AAqBA,wBAAgB,uBAAuB,IAAI,IAAI,CAgxB9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages-subscribe.spec.d.ts","sourceRoot":"","sources":["../../../../tests/handlers/messages-subscribe.spec.ts"],"names":[],"mappings":"AAoBA,wBAAgB,4BAA4B,IAAI,IAAI,CAmenD"}
1
+ {"version":3,"file":"messages-subscribe.spec.d.ts","sourceRoot":"","sources":["../../../../tests/handlers/messages-subscribe.spec.ts"],"names":[],"mappings":"AAsBA,wBAAgB,4BAA4B,IAAI,IAAI,CAioBnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages-sync.spec.d.ts","sourceRoot":"","sources":["../../../../tests/handlers/messages-sync.spec.ts"],"names":[],"mappings":"AAwBA,wBAAgB,uBAAuB,IAAI,IAAI,CAmlB9C"}
1
+ {"version":3,"file":"messages-sync.spec.d.ts","sourceRoot":"","sources":["../../../../tests/handlers/messages-sync.spec.ts"],"names":[],"mappings":"AAwBA,wBAAgB,uBAAuB,IAAI,IAAI,CAirB9C"}