@enbox/dwn-sdk-js 0.4.0 → 0.4.2

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 (522) hide show
  1. package/README.md +4 -4
  2. package/dist/browser.mjs +3 -10
  3. package/dist/browser.mjs.map +4 -4
  4. package/dist/esm/generated/precompiled-validators.js +799 -885
  5. package/dist/esm/generated/precompiled-validators.js.map +1 -1
  6. package/dist/esm/src/core/dwn-constant.js +5 -0
  7. package/dist/esm/src/core/dwn-constant.js.map +1 -1
  8. package/dist/esm/src/core/dwn-error.js +12 -4
  9. package/dist/esm/src/core/dwn-error.js.map +1 -1
  10. package/dist/esm/src/core/grant-authorization.js +9 -18
  11. package/dist/esm/src/core/grant-authorization.js.map +1 -1
  12. package/dist/esm/src/core/message-reply.js.map +1 -1
  13. package/dist/esm/src/core/messages-grant-authorization.js +28 -45
  14. package/dist/esm/src/core/messages-grant-authorization.js.map +1 -1
  15. package/dist/esm/src/core/protocol-authorization-action.js +25 -27
  16. package/dist/esm/src/core/protocol-authorization-action.js.map +1 -1
  17. package/dist/esm/src/core/protocol-authorization-validation.js +34 -89
  18. package/dist/esm/src/core/protocol-authorization-validation.js.map +1 -1
  19. package/dist/esm/src/core/protocol-authorization.js +44 -118
  20. package/dist/esm/src/core/protocol-authorization.js.map +1 -1
  21. package/dist/esm/src/core/protocols-grant-authorization.js +5 -5
  22. package/dist/esm/src/core/protocols-grant-authorization.js.map +1 -1
  23. package/dist/esm/src/core/recording-validation-state-reader.js +84 -0
  24. package/dist/esm/src/core/recording-validation-state-reader.js.map +1 -0
  25. package/dist/esm/src/core/records-grant-authorization.js +11 -11
  26. package/dist/esm/src/core/records-grant-authorization.js.map +1 -1
  27. package/dist/esm/src/core/replication-apply.js +123 -28
  28. package/dist/esm/src/core/replication-apply.js.map +1 -1
  29. package/dist/esm/src/core/resumable-task-manager.js +5 -4
  30. package/dist/esm/src/core/resumable-task-manager.js.map +1 -1
  31. package/dist/esm/src/core/validation-state-reader.js +237 -0
  32. package/dist/esm/src/core/validation-state-reader.js.map +1 -0
  33. package/dist/esm/src/dwn.js +165 -132
  34. package/dist/esm/src/dwn.js.map +1 -1
  35. package/dist/esm/src/enums/dwn-interface-method.js +0 -1
  36. package/dist/esm/src/enums/dwn-interface-method.js.map +1 -1
  37. package/dist/esm/src/event-stream/durable-event-log.js +365 -0
  38. package/dist/esm/src/event-stream/durable-event-log.js.map +1 -0
  39. package/dist/esm/src/event-stream/event-emitter-wake-publisher.js +25 -0
  40. package/dist/esm/src/event-stream/event-emitter-wake-publisher.js.map +1 -0
  41. package/dist/esm/src/handlers/messages-query.js +159 -0
  42. package/dist/esm/src/handlers/messages-query.js.map +1 -0
  43. package/dist/esm/src/handlers/messages-read.js +5 -5
  44. package/dist/esm/src/handlers/messages-read.js.map +1 -1
  45. package/dist/esm/src/handlers/messages-subscribe.js +8 -8
  46. package/dist/esm/src/handlers/messages-subscribe.js.map +1 -1
  47. package/dist/esm/src/handlers/protocols-configure.js +30 -49
  48. package/dist/esm/src/handlers/protocols-configure.js.map +1 -1
  49. package/dist/esm/src/handlers/protocols-query.js +1 -1
  50. package/dist/esm/src/handlers/protocols-query.js.map +1 -1
  51. package/dist/esm/src/handlers/records-count.js +20 -11
  52. package/dist/esm/src/handlers/records-count.js.map +1 -1
  53. package/dist/esm/src/handlers/records-delete.js +20 -16
  54. package/dist/esm/src/handlers/records-delete.js.map +1 -1
  55. package/dist/esm/src/handlers/records-query.js +35 -11
  56. package/dist/esm/src/handlers/records-query.js.map +1 -1
  57. package/dist/esm/src/handlers/records-read.js +52 -42
  58. package/dist/esm/src/handlers/records-read.js.map +1 -1
  59. package/dist/esm/src/handlers/records-subscribe.js +107 -11
  60. package/dist/esm/src/handlers/records-subscribe.js.map +1 -1
  61. package/dist/esm/src/handlers/records-write.js +62 -116
  62. package/dist/esm/src/handlers/records-write.js.map +1 -1
  63. package/dist/esm/src/index.js +6 -7
  64. package/dist/esm/src/index.js.map +1 -1
  65. package/dist/esm/src/interfaces/{messages-sync.js → messages-query.js} +21 -15
  66. package/dist/esm/src/interfaces/messages-query.js.map +1 -0
  67. package/dist/esm/src/interfaces/protocols-configure.js +12 -9
  68. package/dist/esm/src/interfaces/protocols-configure.js.map +1 -1
  69. package/dist/esm/src/interfaces/protocols-query.js +3 -4
  70. package/dist/esm/src/interfaces/protocols-query.js.map +1 -1
  71. package/dist/esm/src/interfaces/records-count.js +4 -3
  72. package/dist/esm/src/interfaces/records-count.js.map +1 -1
  73. package/dist/esm/src/interfaces/records-delete.js +21 -4
  74. package/dist/esm/src/interfaces/records-delete.js.map +1 -1
  75. package/dist/esm/src/interfaces/records-query.js +4 -3
  76. package/dist/esm/src/interfaces/records-query.js.map +1 -1
  77. package/dist/esm/src/interfaces/records-read.js +3 -3
  78. package/dist/esm/src/interfaces/records-read.js.map +1 -1
  79. package/dist/esm/src/interfaces/records-subscribe.js +4 -3
  80. package/dist/esm/src/interfaces/records-subscribe.js.map +1 -1
  81. package/dist/esm/src/interfaces/records-write.js +27 -13
  82. package/dist/esm/src/interfaces/records-write.js.map +1 -1
  83. package/dist/esm/src/protocols/permissions.js +27 -34
  84. package/dist/esm/src/protocols/permissions.js.map +1 -1
  85. package/dist/esm/src/store/index-level.js +24 -9
  86. package/dist/esm/src/store/index-level.js.map +1 -1
  87. package/dist/esm/src/store/level-wrapper.js +7 -0
  88. package/dist/esm/src/store/level-wrapper.js.map +1 -1
  89. package/dist/esm/src/store/message-store-level.js +536 -42
  90. package/dist/esm/src/store/message-store-level.js.map +1 -1
  91. package/dist/esm/src/store/storage-controller.js +58 -49
  92. package/dist/esm/src/store/storage-controller.js.map +1 -1
  93. package/dist/esm/src/types/message-types.js.map +1 -1
  94. package/dist/esm/src/types/validation-state-reader.js +2 -0
  95. package/dist/esm/src/types/validation-state-reader.js.map +1 -0
  96. package/dist/esm/src/utils/messages.js +17 -0
  97. package/dist/esm/src/utils/messages.js.map +1 -1
  98. package/dist/esm/src/utils/protocol-tags.js +262 -0
  99. package/dist/esm/src/utils/protocol-tags.js.map +1 -0
  100. package/dist/esm/src/utils/record-limit-occupancy.js +244 -0
  101. package/dist/esm/src/utils/record-limit-occupancy.js.map +1 -0
  102. package/dist/esm/src/utils/records.js +50 -14
  103. package/dist/esm/src/utils/records.js.map +1 -1
  104. package/dist/esm/src/utils/replication.js +85 -0
  105. package/dist/esm/src/utils/replication.js.map +1 -0
  106. package/dist/esm/tests/core/grant-authorization.spec.js +4 -4
  107. package/dist/esm/tests/core/grant-authorization.spec.js.map +1 -1
  108. package/dist/esm/tests/core/process-message-parity.spec.js +222 -0
  109. package/dist/esm/tests/core/process-message-parity.spec.js.map +1 -0
  110. package/dist/esm/tests/core/protocol-authorization.spec.js +5 -2
  111. package/dist/esm/tests/core/protocol-authorization.spec.js.map +1 -1
  112. package/dist/esm/tests/core/records-grant-authorization.spec.js +5 -5
  113. package/dist/esm/tests/core/records-grant-authorization.spec.js.map +1 -1
  114. package/dist/esm/tests/core/replication-apply.spec.js +55 -1
  115. package/dist/esm/tests/core/replication-apply.spec.js.map +1 -1
  116. package/dist/esm/tests/core/replication-replay-property.spec.js +350 -0
  117. package/dist/esm/tests/core/replication-replay-property.spec.js.map +1 -0
  118. package/dist/esm/tests/core/validation-read-closure.spec.js +469 -0
  119. package/dist/esm/tests/core/validation-read-closure.spec.js.map +1 -0
  120. package/dist/esm/tests/core/validation-state-reader.spec.js +716 -0
  121. package/dist/esm/tests/core/validation-state-reader.spec.js.map +1 -0
  122. package/dist/esm/tests/durable-event-log.spec.js +373 -0
  123. package/dist/esm/tests/durable-event-log.spec.js.map +1 -0
  124. package/dist/esm/tests/dwn.spec.js +504 -35
  125. package/dist/esm/tests/dwn.spec.js.map +1 -1
  126. package/dist/esm/tests/features/author-delegated-grant.spec.js +9 -6
  127. package/dist/esm/tests/features/author-delegated-grant.spec.js.map +1 -1
  128. package/dist/esm/tests/features/owner-delegated-grant.spec.js +1 -4
  129. package/dist/esm/tests/features/owner-delegated-grant.spec.js.map +1 -1
  130. package/dist/esm/tests/features/owner-signature.spec.js +1 -4
  131. package/dist/esm/tests/features/owner-signature.spec.js.map +1 -1
  132. package/dist/esm/tests/features/permissions.spec.js +165 -4
  133. package/dist/esm/tests/features/permissions.spec.js.map +1 -1
  134. package/dist/esm/tests/features/protocol-composition.spec.js +8 -11
  135. package/dist/esm/tests/features/protocol-composition.spec.js.map +1 -1
  136. package/dist/esm/tests/features/protocol-create-action.spec.js +1 -4
  137. package/dist/esm/tests/features/protocol-create-action.spec.js.map +1 -1
  138. package/dist/esm/tests/features/protocol-delete-action.spec.js +3 -5
  139. package/dist/esm/tests/features/protocol-delete-action.spec.js.map +1 -1
  140. package/dist/esm/tests/features/protocol-update-action.spec.js +3 -6
  141. package/dist/esm/tests/features/protocol-update-action.spec.js.map +1 -1
  142. package/dist/esm/tests/features/records-delivery.spec.js +1 -4
  143. package/dist/esm/tests/features/records-delivery.spec.js.map +1 -1
  144. package/dist/esm/tests/features/records-immutable.spec.js +1 -4
  145. package/dist/esm/tests/features/records-immutable.spec.js.map +1 -1
  146. package/dist/esm/tests/features/records-nested-query-scope.spec.js +281 -0
  147. package/dist/esm/tests/features/records-nested-query-scope.spec.js.map +1 -0
  148. package/dist/esm/tests/features/records-prune-cross-protocol.spec.js +3 -7
  149. package/dist/esm/tests/features/records-prune-cross-protocol.spec.js.map +1 -1
  150. package/dist/esm/tests/features/records-prune.spec.js +11 -22
  151. package/dist/esm/tests/features/records-prune.spec.js.map +1 -1
  152. package/dist/esm/tests/features/records-record-limit.spec.js +441 -231
  153. package/dist/esm/tests/features/records-record-limit.spec.js.map +1 -1
  154. package/dist/esm/tests/features/records-squash.spec.js +6 -4
  155. package/dist/esm/tests/features/records-squash.spec.js.map +1 -1
  156. package/dist/esm/tests/features/records-tags.spec.js +1 -4
  157. package/dist/esm/tests/features/records-tags.spec.js.map +1 -1
  158. package/dist/esm/tests/features/resumable-tasks.spec.js +3 -5
  159. package/dist/esm/tests/features/resumable-tasks.spec.js.map +1 -1
  160. package/dist/esm/tests/fuzz/message-store.fuzz.spec.js +1 -2
  161. package/dist/esm/tests/fuzz/message-store.fuzz.spec.js.map +1 -1
  162. package/dist/esm/tests/fuzz/process-message.fuzz.spec.js +2 -4
  163. package/dist/esm/tests/fuzz/process-message.fuzz.spec.js.map +1 -1
  164. package/dist/esm/tests/fuzz/schema-validation.fuzz.spec.js +1 -1
  165. package/dist/esm/tests/fuzz/schema-validation.fuzz.spec.js.map +1 -1
  166. package/dist/esm/tests/handlers/messages-query.spec.js +246 -0
  167. package/dist/esm/tests/handlers/messages-query.spec.js.map +1 -0
  168. package/dist/esm/tests/handlers/messages-read.spec.js +2 -5
  169. package/dist/esm/tests/handlers/messages-read.spec.js.map +1 -1
  170. package/dist/esm/tests/handlers/messages-subscribe.spec.js +3 -14
  171. package/dist/esm/tests/handlers/messages-subscribe.spec.js.map +1 -1
  172. package/dist/esm/tests/handlers/protocols-configure.spec.js +27 -26
  173. package/dist/esm/tests/handlers/protocols-configure.spec.js.map +1 -1
  174. package/dist/esm/tests/handlers/protocols-query.spec.js +1 -4
  175. package/dist/esm/tests/handlers/protocols-query.spec.js.map +1 -1
  176. package/dist/esm/tests/handlers/records-count.spec.js +1 -4
  177. package/dist/esm/tests/handlers/records-count.spec.js.map +1 -1
  178. package/dist/esm/tests/handlers/records-delete.spec.js +312 -30
  179. package/dist/esm/tests/handlers/records-delete.spec.js.map +1 -1
  180. package/dist/esm/tests/handlers/records-query.spec.js +32 -9
  181. package/dist/esm/tests/handlers/records-query.spec.js.map +1 -1
  182. package/dist/esm/tests/handlers/records-read.spec.js +4 -4
  183. package/dist/esm/tests/handlers/records-read.spec.js.map +1 -1
  184. package/dist/esm/tests/handlers/records-subscribe.spec.js +33 -14
  185. package/dist/esm/tests/handlers/records-subscribe.spec.js.map +1 -1
  186. package/dist/esm/tests/handlers/records-write.spec.js +82 -36
  187. package/dist/esm/tests/handlers/records-write.spec.js.map +1 -1
  188. package/dist/esm/tests/interfaces/records-delete.spec.js +69 -2
  189. package/dist/esm/tests/interfaces/records-delete.spec.js.map +1 -1
  190. package/dist/esm/tests/interfaces/records-write.spec.js +4 -3
  191. package/dist/esm/tests/interfaces/records-write.spec.js.map +1 -1
  192. package/dist/esm/tests/protocols/permissions.spec.js +55 -6
  193. package/dist/esm/tests/protocols/permissions.spec.js.map +1 -1
  194. package/dist/esm/tests/scenarios/aggregator.spec.js +1 -4
  195. package/dist/esm/tests/scenarios/aggregator.spec.js.map +1 -1
  196. package/dist/esm/tests/scenarios/deleted-record.spec.js +1 -4
  197. package/dist/esm/tests/scenarios/deleted-record.spec.js.map +1 -1
  198. package/dist/esm/tests/scenarios/end-to-end-tests.spec.js +1 -4
  199. package/dist/esm/tests/scenarios/end-to-end-tests.spec.js.map +1 -1
  200. package/dist/esm/tests/scenarios/nested-roles.spec.js +1 -4
  201. package/dist/esm/tests/scenarios/nested-roles.spec.js.map +1 -1
  202. package/dist/esm/tests/scenarios/subscriptions.spec.js +1 -4
  203. package/dist/esm/tests/scenarios/subscriptions.spec.js.map +1 -1
  204. package/dist/esm/tests/store/message-store-level.spec.js +361 -5
  205. package/dist/esm/tests/store/message-store-level.spec.js.map +1 -1
  206. package/dist/esm/tests/store/message-store.spec.js +60 -0
  207. package/dist/esm/tests/store/message-store.spec.js.map +1 -1
  208. package/dist/esm/tests/test-event-stream.js +7 -3
  209. package/dist/esm/tests/test-event-stream.js.map +1 -1
  210. package/dist/esm/tests/test-stores.js +19 -9
  211. package/dist/esm/tests/test-stores.js.map +1 -1
  212. package/dist/esm/tests/test-suite.js +4 -2
  213. package/dist/esm/tests/test-suite.js.map +1 -1
  214. package/dist/esm/tests/utils/protocol-tags.spec.js +96 -0
  215. package/dist/esm/tests/utils/protocol-tags.spec.js.map +1 -0
  216. package/dist/esm/tests/utils/test-data-generator.js +25 -0
  217. package/dist/esm/tests/utils/test-data-generator.js.map +1 -1
  218. package/dist/esm/tests/utils/test-stub-generator.js.map +1 -1
  219. package/dist/esm/tests/utils/test-validation-state-reader.js +16 -0
  220. package/dist/esm/tests/utils/test-validation-state-reader.js.map +1 -0
  221. package/dist/types/generated/precompiled-validators.d.ts +6 -6
  222. package/dist/types/generated/precompiled-validators.d.ts.map +1 -1
  223. package/dist/types/src/core/core-protocol.d.ts +3 -3
  224. package/dist/types/src/core/core-protocol.d.ts.map +1 -1
  225. package/dist/types/src/core/dwn-constant.d.ts +5 -0
  226. package/dist/types/src/core/dwn-constant.d.ts.map +1 -1
  227. package/dist/types/src/core/dwn-error.d.ts +12 -4
  228. package/dist/types/src/core/dwn-error.d.ts.map +1 -1
  229. package/dist/types/src/core/grant-authorization.d.ts +5 -5
  230. package/dist/types/src/core/grant-authorization.d.ts.map +1 -1
  231. package/dist/types/src/core/message-reply.d.ts +5 -4
  232. package/dist/types/src/core/message-reply.d.ts.map +1 -1
  233. package/dist/types/src/core/messages-grant-authorization.d.ts +12 -14
  234. package/dist/types/src/core/messages-grant-authorization.d.ts.map +1 -1
  235. package/dist/types/src/core/protocol-authorization-action.d.ts +4 -5
  236. package/dist/types/src/core/protocol-authorization-action.d.ts.map +1 -1
  237. package/dist/types/src/core/protocol-authorization-validation.d.ts +14 -17
  238. package/dist/types/src/core/protocol-authorization-validation.d.ts.map +1 -1
  239. package/dist/types/src/core/protocol-authorization.d.ts +8 -33
  240. package/dist/types/src/core/protocol-authorization.d.ts.map +1 -1
  241. package/dist/types/src/core/protocols-grant-authorization.d.ts +4 -4
  242. package/dist/types/src/core/protocols-grant-authorization.d.ts.map +1 -1
  243. package/dist/types/src/core/recording-validation-state-reader.d.ts +75 -0
  244. package/dist/types/src/core/recording-validation-state-reader.d.ts.map +1 -0
  245. package/dist/types/src/core/records-grant-authorization.d.ts +8 -8
  246. package/dist/types/src/core/records-grant-authorization.d.ts.map +1 -1
  247. package/dist/types/src/core/replication-apply.d.ts +36 -0
  248. package/dist/types/src/core/replication-apply.d.ts.map +1 -1
  249. package/dist/types/src/core/resumable-task-manager.d.ts +1 -1
  250. package/dist/types/src/core/resumable-task-manager.d.ts.map +1 -1
  251. package/dist/types/src/core/validation-state-reader.d.ts +79 -0
  252. package/dist/types/src/core/validation-state-reader.d.ts.map +1 -0
  253. package/dist/types/src/dwn.d.ts +33 -20
  254. package/dist/types/src/dwn.d.ts.map +1 -1
  255. package/dist/types/src/enums/dwn-interface-method.d.ts +0 -1
  256. package/dist/types/src/enums/dwn-interface-method.d.ts.map +1 -1
  257. package/dist/types/src/event-stream/durable-event-log.d.ts +69 -0
  258. package/dist/types/src/event-stream/durable-event-log.d.ts.map +1 -0
  259. package/dist/types/src/event-stream/event-emitter-wake-publisher.d.ts +13 -0
  260. package/dist/types/src/event-stream/event-emitter-wake-publisher.d.ts.map +1 -0
  261. package/dist/types/src/handlers/messages-query.d.ts +20 -0
  262. package/dist/types/src/handlers/messages-query.d.ts.map +1 -0
  263. package/dist/types/src/handlers/messages-read.d.ts +1 -1
  264. package/dist/types/src/handlers/messages-read.d.ts.map +1 -1
  265. package/dist/types/src/handlers/messages-subscribe.d.ts.map +1 -1
  266. package/dist/types/src/handlers/protocols-configure.d.ts +0 -5
  267. package/dist/types/src/handlers/protocols-configure.d.ts.map +1 -1
  268. package/dist/types/src/handlers/records-count.d.ts +2 -1
  269. package/dist/types/src/handlers/records-count.d.ts.map +1 -1
  270. package/dist/types/src/handlers/records-delete.d.ts +2 -2
  271. package/dist/types/src/handlers/records-delete.d.ts.map +1 -1
  272. package/dist/types/src/handlers/records-query.d.ts +1 -1
  273. package/dist/types/src/handlers/records-query.d.ts.map +1 -1
  274. package/dist/types/src/handlers/records-read.d.ts +2 -1
  275. package/dist/types/src/handlers/records-read.d.ts.map +1 -1
  276. package/dist/types/src/handlers/records-subscribe.d.ts +4 -5
  277. package/dist/types/src/handlers/records-subscribe.d.ts.map +1 -1
  278. package/dist/types/src/handlers/records-write.d.ts +3 -11
  279. package/dist/types/src/handlers/records-write.d.ts.map +1 -1
  280. package/dist/types/src/index.d.ts +14 -16
  281. package/dist/types/src/index.d.ts.map +1 -1
  282. package/dist/types/src/interfaces/messages-query.d.ts +23 -0
  283. package/dist/types/src/interfaces/messages-query.d.ts.map +1 -0
  284. package/dist/types/src/interfaces/protocols-configure.d.ts +3 -3
  285. package/dist/types/src/interfaces/protocols-configure.d.ts.map +1 -1
  286. package/dist/types/src/interfaces/protocols-query.d.ts +2 -2
  287. package/dist/types/src/interfaces/protocols-query.d.ts.map +1 -1
  288. package/dist/types/src/interfaces/records-count.d.ts +3 -3
  289. package/dist/types/src/interfaces/records-count.d.ts.map +1 -1
  290. package/dist/types/src/interfaces/records-delete.d.ts +11 -3
  291. package/dist/types/src/interfaces/records-delete.d.ts.map +1 -1
  292. package/dist/types/src/interfaces/records-query.d.ts +3 -3
  293. package/dist/types/src/interfaces/records-query.d.ts.map +1 -1
  294. package/dist/types/src/interfaces/records-read.d.ts +3 -3
  295. package/dist/types/src/interfaces/records-read.d.ts.map +1 -1
  296. package/dist/types/src/interfaces/records-subscribe.d.ts +3 -3
  297. package/dist/types/src/interfaces/records-subscribe.d.ts.map +1 -1
  298. package/dist/types/src/interfaces/records-write.d.ts +15 -7
  299. package/dist/types/src/interfaces/records-write.d.ts.map +1 -1
  300. package/dist/types/src/protocols/permissions.d.ts +9 -12
  301. package/dist/types/src/protocols/permissions.d.ts.map +1 -1
  302. package/dist/types/src/store/index-level.d.ts +10 -1
  303. package/dist/types/src/store/index-level.d.ts.map +1 -1
  304. package/dist/types/src/store/level-wrapper.d.ts +5 -0
  305. package/dist/types/src/store/level-wrapper.d.ts.map +1 -1
  306. package/dist/types/src/store/message-store-level.d.ts +94 -14
  307. package/dist/types/src/store/message-store-level.d.ts.map +1 -1
  308. package/dist/types/src/store/storage-controller.d.ts +17 -14
  309. package/dist/types/src/store/storage-controller.d.ts.map +1 -1
  310. package/dist/types/src/types/message-store.d.ts +29 -1
  311. package/dist/types/src/types/message-store.d.ts.map +1 -1
  312. package/dist/types/src/types/message-types.d.ts +2 -0
  313. package/dist/types/src/types/message-types.d.ts.map +1 -1
  314. package/dist/types/src/types/messages-types.d.ts +21 -37
  315. package/dist/types/src/types/messages-types.d.ts.map +1 -1
  316. package/dist/types/src/types/method-handler.d.ts +2 -2
  317. package/dist/types/src/types/method-handler.d.ts.map +1 -1
  318. package/dist/types/src/types/permission-types.d.ts +1 -1
  319. package/dist/types/src/types/subscriptions.d.ts +50 -39
  320. package/dist/types/src/types/subscriptions.d.ts.map +1 -1
  321. package/dist/types/src/types/validation-state-reader.d.ts +116 -0
  322. package/dist/types/src/types/validation-state-reader.d.ts.map +1 -0
  323. package/dist/types/src/utils/messages.d.ts +10 -0
  324. package/dist/types/src/utils/messages.d.ts.map +1 -1
  325. package/dist/types/src/utils/protocol-tags.d.ts +15 -0
  326. package/dist/types/src/utils/protocol-tags.d.ts.map +1 -0
  327. package/dist/types/src/utils/record-limit-occupancy.d.ts +40 -0
  328. package/dist/types/src/utils/record-limit-occupancy.d.ts.map +1 -0
  329. package/dist/types/src/utils/records.d.ts +25 -3
  330. package/dist/types/src/utils/records.d.ts.map +1 -1
  331. package/dist/types/src/utils/replication.d.ts +22 -0
  332. package/dist/types/src/utils/replication.d.ts.map +1 -0
  333. package/dist/types/tests/core/process-message-parity.spec.d.ts +2 -0
  334. package/dist/types/tests/core/process-message-parity.spec.d.ts.map +1 -0
  335. package/dist/types/tests/core/replication-replay-property.spec.d.ts +2 -0
  336. package/dist/types/tests/core/replication-replay-property.spec.d.ts.map +1 -0
  337. package/dist/types/tests/core/validation-read-closure.spec.d.ts +2 -0
  338. package/dist/types/tests/core/validation-read-closure.spec.d.ts.map +1 -0
  339. package/dist/types/tests/core/validation-state-reader.spec.d.ts +2 -0
  340. package/dist/types/tests/core/validation-state-reader.spec.d.ts.map +1 -0
  341. package/dist/types/tests/durable-event-log.spec.d.ts +2 -0
  342. package/dist/types/tests/durable-event-log.spec.d.ts.map +1 -0
  343. package/dist/types/tests/dwn.spec.d.ts.map +1 -1
  344. package/dist/types/tests/features/author-delegated-grant.spec.d.ts.map +1 -1
  345. package/dist/types/tests/features/owner-delegated-grant.spec.d.ts.map +1 -1
  346. package/dist/types/tests/features/owner-signature.spec.d.ts.map +1 -1
  347. package/dist/types/tests/features/permissions.spec.d.ts.map +1 -1
  348. package/dist/types/tests/features/protocol-composition.spec.d.ts.map +1 -1
  349. package/dist/types/tests/features/protocol-create-action.spec.d.ts.map +1 -1
  350. package/dist/types/tests/features/protocol-delete-action.spec.d.ts.map +1 -1
  351. package/dist/types/tests/features/protocol-update-action.spec.d.ts.map +1 -1
  352. package/dist/types/tests/features/records-delivery.spec.d.ts.map +1 -1
  353. package/dist/types/tests/features/records-immutable.spec.d.ts.map +1 -1
  354. package/dist/types/tests/features/records-nested-query-scope.spec.d.ts +2 -0
  355. package/dist/types/tests/features/records-nested-query-scope.spec.d.ts.map +1 -0
  356. package/dist/types/tests/features/records-prune-cross-protocol.spec.d.ts.map +1 -1
  357. package/dist/types/tests/features/records-prune.spec.d.ts.map +1 -1
  358. package/dist/types/tests/features/records-record-limit.spec.d.ts.map +1 -1
  359. package/dist/types/tests/features/records-squash.spec.d.ts.map +1 -1
  360. package/dist/types/tests/features/records-tags.spec.d.ts.map +1 -1
  361. package/dist/types/tests/features/resumable-tasks.spec.d.ts.map +1 -1
  362. package/dist/types/tests/handlers/messages-query.spec.d.ts +2 -0
  363. package/dist/types/tests/handlers/messages-query.spec.d.ts.map +1 -0
  364. package/dist/types/tests/handlers/messages-read.spec.d.ts.map +1 -1
  365. package/dist/types/tests/handlers/messages-subscribe.spec.d.ts.map +1 -1
  366. package/dist/types/tests/handlers/protocols-configure.spec.d.ts.map +1 -1
  367. package/dist/types/tests/handlers/protocols-query.spec.d.ts.map +1 -1
  368. package/dist/types/tests/handlers/records-count.spec.d.ts.map +1 -1
  369. package/dist/types/tests/handlers/records-delete.spec.d.ts.map +1 -1
  370. package/dist/types/tests/handlers/records-query.spec.d.ts.map +1 -1
  371. package/dist/types/tests/handlers/records-read.spec.d.ts.map +1 -1
  372. package/dist/types/tests/handlers/records-subscribe.spec.d.ts.map +1 -1
  373. package/dist/types/tests/handlers/records-write.spec.d.ts.map +1 -1
  374. package/dist/types/tests/scenarios/deleted-record.spec.d.ts.map +1 -1
  375. package/dist/types/tests/scenarios/end-to-end-tests.spec.d.ts.map +1 -1
  376. package/dist/types/tests/scenarios/nested-roles.spec.d.ts.map +1 -1
  377. package/dist/types/tests/scenarios/subscriptions.spec.d.ts.map +1 -1
  378. package/dist/types/tests/store/message-store.spec.d.ts.map +1 -1
  379. package/dist/types/tests/test-event-stream.d.ts +1 -1
  380. package/dist/types/tests/test-event-stream.d.ts.map +1 -1
  381. package/dist/types/tests/test-stores.d.ts +5 -4
  382. package/dist/types/tests/test-stores.d.ts.map +1 -1
  383. package/dist/types/tests/test-suite.d.ts +1 -2
  384. package/dist/types/tests/test-suite.d.ts.map +1 -1
  385. package/dist/types/tests/utils/protocol-tags.spec.d.ts +2 -0
  386. package/dist/types/tests/utils/protocol-tags.spec.d.ts.map +1 -0
  387. package/dist/types/tests/utils/test-data-generator.d.ts +20 -1
  388. package/dist/types/tests/utils/test-data-generator.d.ts.map +1 -1
  389. package/dist/types/tests/utils/test-validation-state-reader.d.ts +15 -0
  390. package/dist/types/tests/utils/test-validation-state-reader.d.ts.map +1 -0
  391. package/package.json +2 -2
  392. package/src/core/core-protocol.ts +3 -3
  393. package/src/core/dwn-constant.ts +7 -1
  394. package/src/core/dwn-error.ts +12 -4
  395. package/src/core/grant-authorization.ts +11 -20
  396. package/src/core/message-reply.ts +6 -5
  397. package/src/core/messages-grant-authorization.ts +37 -70
  398. package/src/core/protocol-authorization-action.ts +29 -38
  399. package/src/core/protocol-authorization-validation.ts +47 -121
  400. package/src/core/protocol-authorization.ts +56 -202
  401. package/src/core/protocols-grant-authorization.ts +9 -9
  402. package/src/core/recording-validation-state-reader.ts +130 -0
  403. package/src/core/records-grant-authorization.ts +16 -16
  404. package/src/core/replication-apply.ts +172 -32
  405. package/src/core/resumable-task-manager.ts +10 -8
  406. package/src/core/validation-state-reader.ts +350 -0
  407. package/src/dwn.ts +285 -192
  408. package/src/enums/dwn-interface-method.ts +0 -1
  409. package/src/event-stream/durable-event-log.ts +509 -0
  410. package/src/event-stream/event-emitter-wake-publisher.ts +34 -0
  411. package/src/handlers/messages-query.ts +203 -0
  412. package/src/handlers/messages-read.ts +9 -10
  413. package/src/handlers/messages-subscribe.ts +12 -13
  414. package/src/handlers/protocols-configure.ts +37 -58
  415. package/src/handlers/protocols-query.ts +1 -1
  416. package/src/handlers/records-count.ts +24 -17
  417. package/src/handlers/records-delete.ts +29 -27
  418. package/src/handlers/records-query.ts +38 -17
  419. package/src/handlers/records-read.ts +63 -50
  420. package/src/handlers/records-subscribe.ts +132 -19
  421. package/src/handlers/records-write.ts +77 -168
  422. package/src/index.ts +14 -17
  423. package/src/interfaces/messages-query.ts +70 -0
  424. package/src/interfaces/protocols-configure.ts +20 -10
  425. package/src/interfaces/protocols-query.ts +4 -5
  426. package/src/interfaces/records-count.ts +9 -4
  427. package/src/interfaces/records-delete.ts +25 -5
  428. package/src/interfaces/records-query.ts +9 -4
  429. package/src/interfaces/records-read.ts +4 -4
  430. package/src/interfaces/records-subscribe.ts +9 -4
  431. package/src/interfaces/records-write.ts +41 -13
  432. package/src/protocols/permissions.ts +32 -52
  433. package/src/store/index-level.ts +30 -9
  434. package/src/store/level-wrapper.ts +9 -1
  435. package/src/store/message-store-level.ts +757 -47
  436. package/src/store/storage-controller.ts +74 -63
  437. package/src/types/message-store.ts +45 -2
  438. package/src/types/message-types.ts +3 -1
  439. package/src/types/messages-types.ts +26 -45
  440. package/src/types/method-handler.ts +3 -3
  441. package/src/types/permission-types.ts +1 -1
  442. package/src/types/subscriptions.ts +53 -42
  443. package/src/types/validation-state-reader.ts +127 -0
  444. package/src/utils/messages.ts +25 -1
  445. package/src/utils/protocol-tags.ts +366 -0
  446. package/src/utils/record-limit-occupancy.ts +377 -0
  447. package/src/utils/records.ts +69 -13
  448. package/src/utils/replication.ts +122 -0
  449. package/dist/esm/src/core/record-chain.js +0 -64
  450. package/dist/esm/src/core/record-chain.js.map +0 -1
  451. package/dist/esm/src/event-stream/event-emitter-event-log.js +0 -334
  452. package/dist/esm/src/event-stream/event-emitter-event-log.js.map +0 -1
  453. package/dist/esm/src/handlers/messages-sync.js +0 -278
  454. package/dist/esm/src/handlers/messages-sync.js.map +0 -1
  455. package/dist/esm/src/interfaces/messages-sync.js.map +0 -1
  456. package/dist/esm/src/smt/smt-store-level.js +0 -103
  457. package/dist/esm/src/smt/smt-store-level.js.map +0 -1
  458. package/dist/esm/src/smt/smt-store-memory.js +0 -41
  459. package/dist/esm/src/smt/smt-store-memory.js.map +0 -1
  460. package/dist/esm/src/smt/smt-utils.js +0 -129
  461. package/dist/esm/src/smt/smt-utils.js.map +0 -1
  462. package/dist/esm/src/smt/sparse-merkle-tree.js +0 -577
  463. package/dist/esm/src/smt/sparse-merkle-tree.js.map +0 -1
  464. package/dist/esm/src/state-index/state-index-level.js +0 -191
  465. package/dist/esm/src/state-index/state-index-level.js.map +0 -1
  466. package/dist/esm/src/types/smt-types.js +0 -5
  467. package/dist/esm/src/types/smt-types.js.map +0 -1
  468. package/dist/esm/src/types/state-index.js +0 -2
  469. package/dist/esm/src/types/state-index.js.map +0 -1
  470. package/dist/esm/tests/event-emitter-event-log.spec.js +0 -499
  471. package/dist/esm/tests/event-emitter-event-log.spec.js.map +0 -1
  472. package/dist/esm/tests/handlers/messages-sync.spec.js +0 -1088
  473. package/dist/esm/tests/handlers/messages-sync.spec.js.map +0 -1
  474. package/dist/esm/tests/smt/smt-store-level.spec.js +0 -132
  475. package/dist/esm/tests/smt/smt-store-level.spec.js.map +0 -1
  476. package/dist/esm/tests/smt/sparse-merkle-tree.spec.js +0 -732
  477. package/dist/esm/tests/smt/sparse-merkle-tree.spec.js.map +0 -1
  478. package/dist/esm/tests/state-index/state-index-level.spec.js +0 -245
  479. package/dist/esm/tests/state-index/state-index-level.spec.js.map +0 -1
  480. package/dist/types/src/core/record-chain.d.ts +0 -24
  481. package/dist/types/src/core/record-chain.d.ts.map +0 -1
  482. package/dist/types/src/event-stream/event-emitter-event-log.d.ts +0 -80
  483. package/dist/types/src/event-stream/event-emitter-event-log.d.ts.map +0 -1
  484. package/dist/types/src/handlers/messages-sync.d.ts +0 -39
  485. package/dist/types/src/handlers/messages-sync.d.ts.map +0 -1
  486. package/dist/types/src/interfaces/messages-sync.d.ts +0 -20
  487. package/dist/types/src/interfaces/messages-sync.d.ts.map +0 -1
  488. package/dist/types/src/smt/smt-store-level.d.ts +0 -32
  489. package/dist/types/src/smt/smt-store-level.d.ts.map +0 -1
  490. package/dist/types/src/smt/smt-store-memory.d.ts +0 -22
  491. package/dist/types/src/smt/smt-store-memory.d.ts.map +0 -1
  492. package/dist/types/src/smt/smt-utils.d.ts +0 -58
  493. package/dist/types/src/smt/smt-utils.d.ts.map +0 -1
  494. package/dist/types/src/smt/sparse-merkle-tree.d.ts +0 -124
  495. package/dist/types/src/smt/sparse-merkle-tree.d.ts.map +0 -1
  496. package/dist/types/src/state-index/state-index-level.d.ts +0 -83
  497. package/dist/types/src/state-index/state-index-level.d.ts.map +0 -1
  498. package/dist/types/src/types/smt-types.d.ts +0 -81
  499. package/dist/types/src/types/smt-types.d.ts.map +0 -1
  500. package/dist/types/src/types/state-index.d.ts +0 -90
  501. package/dist/types/src/types/state-index.d.ts.map +0 -1
  502. package/dist/types/tests/event-emitter-event-log.spec.d.ts +0 -2
  503. package/dist/types/tests/event-emitter-event-log.spec.d.ts.map +0 -1
  504. package/dist/types/tests/handlers/messages-sync.spec.d.ts +0 -2
  505. package/dist/types/tests/handlers/messages-sync.spec.d.ts.map +0 -1
  506. package/dist/types/tests/smt/smt-store-level.spec.d.ts +0 -2
  507. package/dist/types/tests/smt/smt-store-level.spec.d.ts.map +0 -1
  508. package/dist/types/tests/smt/sparse-merkle-tree.spec.d.ts +0 -2
  509. package/dist/types/tests/smt/sparse-merkle-tree.spec.d.ts.map +0 -1
  510. package/dist/types/tests/state-index/state-index-level.spec.d.ts +0 -2
  511. package/dist/types/tests/state-index/state-index-level.spec.d.ts.map +0 -1
  512. package/src/core/record-chain.ts +0 -99
  513. package/src/event-stream/event-emitter-event-log.ts +0 -430
  514. package/src/handlers/messages-sync.ts +0 -403
  515. package/src/interfaces/messages-sync.ts +0 -69
  516. package/src/smt/smt-store-level.ts +0 -143
  517. package/src/smt/smt-store-memory.ts +0 -53
  518. package/src/smt/smt-utils.ts +0 -149
  519. package/src/smt/sparse-merkle-tree.ts +0 -698
  520. package/src/state-index/state-index-level.ts +0 -239
  521. package/src/types/smt-types.ts +0 -95
  522. package/src/types/state-index.ts +0 -100
@@ -237,12 +237,12 @@ export namespace MessagesFilter {
237
237
  }
238
238
  export { evaluated_14 as evaluated };
239
239
  }
240
- export function MessagesRead(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
240
+ export function MessagesQuery(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
241
241
  instancePath?: string | undefined;
242
242
  rootData?: any;
243
243
  dynamicAnchors?: {} | undefined;
244
244
  }): boolean;
245
- export namespace MessagesRead {
245
+ export namespace MessagesQuery {
246
246
  export namespace evaluated_15 {
247
247
  let props_13: boolean;
248
248
  export { props_13 as props };
@@ -253,12 +253,12 @@ export namespace MessagesRead {
253
253
  }
254
254
  export { evaluated_15 as evaluated };
255
255
  }
256
- export function MessagesSubscribe(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
256
+ export function MessagesRead(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
257
257
  instancePath?: string | undefined;
258
258
  rootData?: any;
259
259
  dynamicAnchors?: {} | undefined;
260
260
  }): boolean;
261
- export namespace MessagesSubscribe {
261
+ export namespace MessagesRead {
262
262
  export namespace evaluated_16 {
263
263
  let props_14: boolean;
264
264
  export { props_14 as props };
@@ -269,12 +269,12 @@ export namespace MessagesSubscribe {
269
269
  }
270
270
  export { evaluated_16 as evaluated };
271
271
  }
272
- export function MessagesSync(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
272
+ export function MessagesSubscribe(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
273
273
  instancePath?: string | undefined;
274
274
  rootData?: any;
275
275
  dynamicAnchors?: {} | undefined;
276
276
  }): boolean;
277
- export namespace MessagesSync {
277
+ export namespace MessagesSubscribe {
278
278
  export namespace evaluated_17 {
279
279
  let props_15: boolean;
280
280
  export { props_15 as props };
@@ -1 +1 @@
1
- {"version":3,"file":"precompiled-validators.d.ts","sourceRoot":"","sources":["../../../generated/precompiled-validators.js"],"names":[],"mappings":"AAC66K;;;;YAA+tC;;;;;;;;AAMs+Z;;;;YAA2wD;;;;;;;;;;;;AANinhB;;;;YAGt9jC;;;;;;;;;;;;AAG0jrE;;;;YAA8kM;;;;;;;;;;;;AAAm5B;;;;YAA+lN;;;;;;;;;;;;AAAukD;;;;YAAovW;;;;;;;;;;;;AAAgxD;;;;YAA61f;;;;;;;;;;;;AAA8X;;;;YAAgkD;;;;;;;;;;;;AAAx+rG;;;;YAAkhE;;;;;;;;;;;;AAH17e;;;;YAG8ua;;;;;;;;;;;;;;;;;;;AAAshuG;;;;YAAinB;;;;;;;;;;AAAwG;;;;YAAk5e;;;;;;;;;;AAN38uI;;;;YAAi1I;;;;;;;;;;;;AAMwxnI;;;;YAAsnH;;;;;;;;;;;;AAAm2B;;;;YAA2hN;;;;;;;;;;;;AAA25B;;;;YAAo7O;;;;;;;;;;;;AAA4gC;;;;YAA85X;;;;;;;;;;;;AAAykD;;;;YAAw4c;;;;;;;;;;;;AAA4H;;;;YAA8sK;;;;;;;;;;;;AAA2H;;;;YAAqvE;;;;;;;;;;;;AAAwH;;;;YAAq2H;;;;;;;;;;;;AAA+kiD;;;;YAAk8O;;;;;;;;;;;;AAAm/5C;;;;YAAyiI;;;;;;;;;;;;AAA6X;;;;YAAgtC;;;;;;;;;;;;AAAi6C;;;;YAA6nB;;;;;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;;;;;;;;;;;AAAi6C;;;;YAA6nB;;;;;;;;;;AAA4/F;;;;YAA+nB;;;;;;;;;;AAAis/B;;;;YAAm2P;;;;;;;;;;;;AAAj4kC;;;;YAA880B;;;;;;;;;;;;AAAg6R;;;;YAAksM;;;;;;;;;;;;AAA2/B;;;;YAAovQ;;;;;;;;;;;;AAAgjC;;;;YAA8/N;;;;;;;;;;;;AAAvj1V;;;;YAAo2/C;;;;;;;;;;;;AANtq2D;;;;YAAwivB;;;;;;;;;;AAMw++U;;;;YAAg1I;;;;;;;;;;;;AAAmsB;;;;YAA6mJ;;;;;;;;;;;;AAA4H;;;;YAAkiK"}
@@ -5,14 +5,13 @@ import type { MessageStore } from '../types/message-store.js';
5
5
  import type { ProtocolDefinition } from '../types/protocols-types.js';
6
6
  import type { RecordsWrite } from '../interfaces/records-write.js';
7
7
  import type { RecordsWriteMessage } from '../types/records-types.js';
8
- import type { StateIndex } from '../types/state-index.js';
8
+ import type { ValidationStateReader } from '../types/validation-state-reader.js';
9
9
  /**
10
10
  * Bundled store references passed to core protocol post-processing hooks.
11
11
  */
12
12
  export type CoreProtocolStores = {
13
13
  messageStore: MessageStore;
14
14
  dataStore: DataStore;
15
- stateIndex: StateIndex;
16
15
  };
17
16
  /**
18
17
  * A core protocol is a hardcoded, immutable, always-installed DWN protocol
@@ -36,9 +35,10 @@ export interface CoreProtocol {
36
35
  /**
37
36
  * Pre-processing hook: runs before storing a record under this protocol.
38
37
  * Can perform cross-record validation (e.g., revocation tag consistency checks).
38
+ * State reads are validation-time reads and must route through the `ValidationStateReader`.
39
39
  * @throws DwnError to reject the write.
40
40
  */
41
- preProcessWrite?(tenant: string, message: RecordsWriteMessage, messageStore: MessageStore): Promise<void>;
41
+ preProcessWrite?(tenant: string, message: RecordsWriteMessage, validationStateReader: ValidationStateReader): Promise<void>;
42
42
  /**
43
43
  * Post-processing hook: runs after successfully storing a record under this protocol.
44
44
  * Can perform cascading side effects (e.g., cleanup of grant-authorized messages on revocation).
@@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AM,GAAG,OAAO;IAIhC,yCAAyC;IAClC,GAAG,IAAI,YAAY,EAAE;IAI5B;;;OAGG;IACI,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CASnE"}
@@ -6,5 +6,10 @@ export declare class DwnConstant {
6
6
  * We currently encode using base64url which is a 33% increase in size.
7
7
  */
8
8
  static readonly maxDataSizeAllowedToBeEncoded = 30000;
9
+ /**
10
+ * Maximum supported `$recordLimit.max`. Read-time occupancy projection may load
11
+ * up to this many occupants per scope before applying the caller's filter/page.
12
+ */
13
+ static readonly maxRecordLimit = 1000;
9
14
  }
10
15
  //# sourceMappingURL=dwn-constant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dwn-constant.d.ts","sourceRoot":"","sources":["../../../../src/core/dwn-constant.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACtB;;;;;OAKG;IACH,gBAAuB,6BAA6B,SAAU;CAC/D"}
1
+ {"version":3,"file":"dwn-constant.d.ts","sourceRoot":"","sources":["../../../../src/core/dwn-constant.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACtB;;;;;OAKG;IACH,gBAAuB,6BAA6B,SAAU;IAE9D;;;OAGG;IACH,gBAAuB,cAAc,QAAQ;CAC9C"}
@@ -19,7 +19,6 @@ export declare enum DwnErrorCode {
19
19
  EventLogNotOpenError = "EventLogNotOpenError",
20
20
  EventLogProgressGap = "EventLogProgressGap",
21
21
  MessagesGrantAuthorizationMismatchedProtocol = "MessagesGrantAuthorizationMismatchedProtocol",
22
- MessagesGrantAuthorizationProtocolSyncInfrastructureProtocol = "MessagesGrantAuthorizationProtocolSyncInfrastructureProtocol",
23
22
  MessagesGrantAuthorizationSubscribeProtocolMismatch = "MessagesGrantAuthorizationSubscribeProtocolMismatch",
24
23
  MessagesGrantAuthorizationUnfilteredSubscribeProtocolScope = "MessagesGrantAuthorizationUnfilteredSubscribeProtocolScope",
25
24
  MessagesSubscribeAuthorizationFailed = "MessagesSubscribeAuthorizationFailed",
@@ -44,6 +43,13 @@ export declare enum DwnErrorCode {
44
43
  IndexInvalidSortPropertyInMemory = "IndexInvalidSortPropertyInMemory",
45
44
  IndexMissingIndexableProperty = "IndexMissingIndexableProperty",
46
45
  JwsDecodePlainObjectPayloadInvalid = "JwsDecodePlainObjectPayloadInvalid",
46
+ MessageStoreDeleteLogEntryMissing = "MessageStoreDeleteLogEntryMissing",
47
+ MessageStoreFingerprintScopeMutation = "MessageStoreFingerprintScopeMutation",
48
+ MessageStorePreSubstrateLayout = "MessageStorePreSubstrateLayout",
49
+ MessageStoreReplicationPositionOverflow = "MessageStoreReplicationPositionOverflow",
50
+ MessageStoreUpdateMessageAndIndexesCidMismatch = "MessageStoreUpdateMessageAndIndexesCidMismatch",
51
+ MessageStoreUpdateMessageAndIndexesMessageNotFound = "MessageStoreUpdateMessageAndIndexesMessageNotFound",
52
+ MessageStoreUpdateIndexesMessageNotFound = "MessageStoreUpdateIndexesMessageNotFound",
47
53
  MessagePermissionGrantCreateInvocationAmbiguous = "MessagePermissionGrantCreateInvocationAmbiguous",
48
54
  MessagePermissionGrantDescriptorPayloadMismatch = "MessagePermissionGrantDescriptorPayloadMismatch",
49
55
  MessagePermissionGrantIdsDescriptorPayloadMismatch = "MessagePermissionGrantIdsDescriptorPayloadMismatch",
@@ -51,11 +57,11 @@ export declare enum DwnErrorCode {
51
57
  MessagePermissionGrantIdsNotCanonical = "MessagePermissionGrantIdsNotCanonical",
52
58
  MessagePermissionGrantValidateInvocationAmbiguous = "MessagePermissionGrantValidateInvocationAmbiguous",
53
59
  MessagesReadInvalidCid = "MessagesReadInvalidCid",
60
+ MessagesQueryAuthorizationFailed = "MessagesQueryAuthorizationFailed",
61
+ MessagesQueryReplicationFeedUnimplemented = "MessagesQueryReplicationFeedUnimplemented",
54
62
  MessagesReadAuthorizationFailed = "MessagesReadAuthorizationFailed",
55
63
  MessageGetInvalidCid = "MessageGetInvalidCid",
56
64
  MessagesReadVerifyScopeFailed = "MessagesReadVerifyScopeFailed",
57
- MessagesSyncAuthorizationFailed = "MessagesSyncAuthorizationFailed",
58
- MessagesSyncInvalidPrefix = "MessagesSyncInvalidPrefix",
59
65
  ParseCidCodecNotSupported = "ParseCidCodecNotSupported",
60
66
  ParseCidMultihashNotSupported = "ParseCidMultihashNotSupported",
61
67
  PermissionsProtocolCreateGrantScopeContextIdProtocolPathConflict = "PermissionsProtocolCreateGrantScopeContextIdProtocolPathConflict",
@@ -97,7 +103,6 @@ export declare enum DwnErrorCode {
97
103
  ProtocolAuthorizationMatchingRoleRecordNotFound = "ProtocolAuthorizationMatchingRoleRecordNotFound",
98
104
  ProtocolAuthorizationMaxSizeInvalid = "ProtocolAuthorizationMaxSizeInvalid",
99
105
  ProtocolAuthorizationMinSizeInvalid = "ProtocolAuthorizationMinSizeInvalid",
100
- ProtocolAuthorizationRecordLimitExceeded = "ProtocolAuthorizationRecordLimitExceeded",
101
106
  ProtocolAuthorizationRecordLimitStrategyNotImplemented = "ProtocolAuthorizationRecordLimitStrategyNotImplemented",
102
107
  ProtocolAuthorizationSquashNotEnabled = "ProtocolAuthorizationSquashNotEnabled",
103
108
  ProtocolAuthorizationSquashNotInitialWrite = "ProtocolAuthorizationSquashNotInitialWrite",
@@ -150,6 +155,7 @@ export declare enum DwnErrorCode {
150
155
  RecordsAuthorDelegatedGrantNotADelegatedGrant = "RecordsAuthorDelegatedGrantNotADelegatedGrant",
151
156
  RecordsDecryptNoMatchingKeyEncryptedFound = "RecordsDecryptNoMatchingKeyEncryptedFound",
152
157
  RecordsCountFilterMissingRequiredProperties = "RecordsCountFilterMissingRequiredProperties",
158
+ RecordsCountNestedProtocolPathContextIdInvalid = "RecordsCountNestedProtocolPathContextIdInvalid",
153
159
  RecordsQueryCreateFilterPublishedSortInvalid = "RecordsQueryCreateFilterPublishedSortInvalid",
154
160
  RecordsQueryParseFilterPublishedSortInvalid = "RecordsQueryParseFilterPublishedSortInvalid",
155
161
  RecordsGrantAuthorizationConditionPublicationProhibited = "RecordsGrantAuthorizationConditionPublicationProhibited",
@@ -167,10 +173,12 @@ export declare enum DwnErrorCode {
167
173
  RecordsOwnerDelegatedGrantGrantedToAndOwnerSignatureMismatch = "RecordsOwnerDelegatedGrantGrantedToAndOwnerSignatureMismatch",
168
174
  RecordsOwnerDelegatedGrantNotADelegatedGrant = "RecordsOwnerDelegatedGrantNotADelegatedGrant",
169
175
  RecordsQueryFilterMissingRequiredProperties = "RecordsQueryFilterMissingRequiredProperties",
176
+ RecordsQueryNestedProtocolPathContextIdInvalid = "RecordsQueryNestedProtocolPathContextIdInvalid",
170
177
  RecordsReadCreateFilterPublishedSortInvalid = "RecordsReadCreateFilterPublishedSortInvalid",
171
178
  RecordsReadParseFilterPublishedSortInvalid = "RecordsReadParseFilterPublishedSortInvalid",
172
179
  RecordsSubscribeEventLogUnimplemented = "RecordsSubscribeEventLogUnimplemented",
173
180
  RecordsSubscribeFilterMissingRequiredProperties = "RecordsSubscribeFilterMissingRequiredProperties",
181
+ RecordsSubscribeNestedProtocolPathContextIdInvalid = "RecordsSubscribeNestedProtocolPathContextIdInvalid",
174
182
  RecordsWriteAttestationIntegrityMoreThanOneSignature = "RecordsWriteAttestationIntegrityMoreThanOneSignature",
175
183
  RecordsWriteAttestationIntegrityDescriptorCidMismatch = "RecordsWriteAttestationIntegrityDescriptorCidMismatch",
176
184
  RecordsWriteAttestationIntegrityInvalidPayloadProperty = "RecordsWriteAttestationIntegrityInvalidPayloadProperty",
@@ -1 +1 @@
1
- {"version":3,"file":"dwn-error.d.ts","sourceRoot":"","sources":["../../../../src/core/dwn-error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACb,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAKlD;AAED;;GAEG;AACH,oBAAY,YAAY;IACtB,sBAAsB,2BAA2B;IACjD,iCAAiC,sCAAsC;IACvE,8CAA8C,mDAAmD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,4CAA4C,iDAAiD;IAE7F,2CAA2C,gDAAgD;IAC3F,8CAA8C,mDAAmD;IAEjG,2CAA2C,gDAAgD;IAC3F,0CAA0C,+CAA+C;IACzF,qCAAqC,0CAA0C;IAC/E,+CAA+C,oDAAoD;IACnG,kDAAkD,uDAAuD;IAEzG,oDAAoD,yDAAyD;IAC7G,qDAAqD,0DAA0D;IAC/G,sDAAsD,2DAA2D;IAEjH,+BAA+B,oCAAoC;IACnE,iDAAiD,sDAAsD;IACvG,qDAAqD,0DAA0D;IAC/G,iCAAiC,sCAAsC;IACvE,2BAA2B,gCAAgC;IAC3D,4BAA4B,iCAAiC;IAC7D,qCAAqC,0CAA0C;IAC/E,wCAAwC,6CAA6C;IACrF,mCAAmC,wCAAwC;IAC3E,oCAAoC,yCAAyC;IAC7E,yBAAyB,8BAA8B;IACvD,iCAAiC,sCAAsC;IACvE,wCAAwC,6CAA6C;IACrF,6BAA6B,kCAAkC;IAE/D,iCAAiC,sCAAsC;IACvE,kCAAkC,uCAAuC;IACzE,4CAA4C,iDAAiD;IAC7F,oCAAoC,yCAAyC;IAC7E,gDAAgD,qDAAqD;IACrG,8CAA8C,mDAAmD;IACjG,iEAAiE,sEAAsE;IACvI,gDAAgD,qDAAqD;IACrG,kDAAkD,uDAAuD;IACzG,iDAAiD,sDAAsD;IACvG,2CAA2C,gDAAgD;IAC3F,sBAAsB,2BAA2B;IACjD,6BAA6B,kCAAkC;IAC/D,4CAA4C,iDAAiD;IAC7F,oBAAoB,yBAAyB;IAC7C,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,wBAAwB,6BAA6B;IACrD,0BAA0B,+BAA+B;IACzD,sBAAsB,2BAA2B;IACjD,+BAA+B,oCAAoC;CACpE"}
@@ -1,6 +1,6 @@
1
1
  import type { GenericMessage } from '../types/message-types.js';
2
- import type { MessageStore } from '../types/message-store.js';
3
2
  import type { PermissionGrant } from '../protocols/permission-grant.js';
3
+ import type { ValidationStateReader } from '../types/validation-state-reader.js';
4
4
  export declare class GrantAuthorization {
5
5
  /**
6
6
  * Performs base permissions-grant-based authorization against the given message:
@@ -10,7 +10,7 @@ export declare class GrantAuthorization {
10
10
  *
11
11
  * NOTE: Does not validate grant `conditions` or `scope` beyond `interface` and `method`
12
12
  *
13
- * @param messageStore Used to check if the grant has been revoked.
13
+ * @param validationStateReader Used to check if the grant has been revoked.
14
14
  * @throws {DwnError} if validation fails
15
15
  */
16
16
  static performBaseValidation(input: {
@@ -18,7 +18,7 @@ export declare class GrantAuthorization {
18
18
  expectedGrantor: string;
19
19
  expectedGrantee: string;
20
20
  permissionGrant: PermissionGrant;
21
- messageStore: MessageStore;
21
+ validationStateReader: ValidationStateReader;
22
22
  }): Promise<void>;
23
23
  /**
24
24
  * Verifies the given `expectedGrantor` and `expectedGrantee` values against
@@ -29,7 +29,7 @@ export declare class GrantAuthorization {
29
29
  /**
30
30
  * Verify that the incoming message is within the allowed time frame of the grant,
31
31
  * and the grant has not been revoked.
32
- * @param messageStore Used to check if the grant has been revoked.
32
+ * @param validationStateReader Used to check if the grant has been revoked.
33
33
  * @throws {DwnError} if incomingMessage has timestamp for a time in which the grant is not active.
34
34
  */
35
35
  private static verifyGrantActive;
@@ -37,7 +37,7 @@ export declare class GrantAuthorization {
37
37
  * Verify that the `interface` and `method` grant scopes match the incoming message.
38
38
  *
39
39
  * For the Messages interface, a `Read` scope is treated as a unified scope that also authorizes
40
- * `Subscribe` and `Sync` operations.
40
+ * `Query`, `Subscribe`, and `Sync` operations.
41
41
  *
42
42
  * @throws {DwnError} if the `interface` and `method` of the incoming message do not match the scope of the permission grant.
43
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"grant-authorization.d.ts","sourceRoot":"","sources":["../../../../src/core/grant-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAOxE,qBAAa,kBAAkB;IAE7B;;;;;;;;;;OAUG;WACiB,qBAAqB,CAAC,KAAK,EAAE;QAC/C,eAAe,EAAE,cAAc,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,eAAe,CAAC;QACjC,YAAY,EAAE,YAAY,CAAC;KAC1B,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBnB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAuB9C;;;;;OAKG;mBACkB,iBAAiB;IAwCtC;;;;;;;OAOG;mBACkB,kCAAkC;CAuCxD"}
1
+ {"version":3,"file":"grant-authorization.d.ts","sourceRoot":"","sources":["../../../../src/core/grant-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAKjF,qBAAa,kBAAkB;IAE7B;;;;;;;;;;OAUG;WACiB,qBAAqB,CAAC,KAAK,EAAE;QAC/C,eAAe,EAAE,cAAc,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,eAAe,CAAC;QACjC,qBAAqB,EAAE,qBAAqB,CAAC;KAC5C,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBnB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAuB9C;;;;;OAKG;mBACkB,iBAAiB;IAiCtC;;;;;;;OAOG;mBACkB,kCAAkC;CAuCxD"}
@@ -1,8 +1,9 @@
1
- import type { MessagesReadReplyEntry } from '../types/messages-types.js';
2
1
  import type { PaginationCursor } from '../types/query-types.js';
2
+ import type { ProgressToken } from '../types/subscriptions.js';
3
3
  import type { ProtocolsConfigureMessage } from '../types/protocols-types.js';
4
4
  import type { RecordsReadReplyEntry } from '../types/records-types.js';
5
5
  import type { GenericMessageReply, MessageSubscription, QueryResultEntry } from '../types/message-types.js';
6
+ import type { MessagesQueryReplyEntry, MessagesReadReplyEntry } from '../types/messages-types.js';
6
7
  export declare function messageReplyFromError(e: unknown, code: number): GenericMessageReply;
7
8
  /**
8
9
  * Catch-all message reply type. It is recommended to use GenericMessageReply or a message-specific reply type wherever possible.
@@ -15,15 +16,15 @@ export type UnionMessageReply = GenericMessageReply & {
15
16
  entry?: MessagesReadReplyEntry & RecordsReadReplyEntry;
16
17
  /**
17
18
  * Resulting message entries or events returned from the invocation of the corresponding message.
18
- * e.g. the resulting messages from a RecordsQuery, or array of messageCid strings for MessagesSync
19
+ * e.g. the resulting messages from a RecordsQuery or MessagesQuery.
19
20
  * Mutually exclusive with `record`.
20
21
  */
21
- entries?: QueryResultEntry[] | ProtocolsConfigureMessage[] | string[];
22
+ entries?: QueryResultEntry[] | ProtocolsConfigureMessage[] | MessagesQueryReplyEntry[] | string[];
22
23
  /**
23
24
  * A cursor for pagination if applicable (e.g. RecordsQuery).
24
25
  * Mutually exclusive with `record`.
25
26
  */
26
- cursor?: PaginationCursor;
27
+ cursor?: PaginationCursor | ProgressToken;
27
28
  /**
28
29
  * A subscription object if a subscription was requested.
29
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"message-reply.d.ts","sourceRoot":"","sources":["../../../../src/core/message-reply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAA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,yBAAyB,EAAE,GAAG,uBAAuB,EAAE,GAAG,MAAM,EAAE,CAAC;IAElG;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,GAAG,aAAa,CAAC;IAE1C;;OAEG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC,CAAC"}
@@ -1,12 +1,12 @@
1
1
  import type { GenericMessage } from '../types/message-types.js';
2
- import type { MessageStore } from '../types/message-store.js';
3
2
  import type { PermissionGrant } from '../protocols/permission-grant.js';
4
- import type { MessagesReadMessage, MessagesSubscribeMessage, MessagesSyncMessage } from '../types/messages-types.js';
3
+ import type { ValidationStateReader } from '../types/validation-state-reader.js';
4
+ import type { MessagesQueryMessage, MessagesReadMessage, MessagesSubscribeMessage } from '../types/messages-types.js';
5
5
  export declare class MessagesGrantAuthorization {
6
- static fetchPermissionGrants(tenant: string, messageStore: MessageStore, permissionGrantIds: string[]): Promise<PermissionGrant[]>;
6
+ static fetchPermissionGrants(tenant: string, validationStateReader: ValidationStateReader, permissionGrantIds: string[]): Promise<PermissionGrant[]>;
7
7
  /**
8
8
  * Authorizes a MessagesReadMessage using the given permission grant.
9
- * @param messageStore Used to check if the given grant has been revoked; and to fetch related RecordsWrites if needed.
9
+ * @param validationStateReader Used to check grant revocation and fetch related RecordsWrites if needed.
10
10
  */
11
11
  static authorizeMessagesRead(input: {
12
12
  messagesReadMessage: MessagesReadMessage;
@@ -14,22 +14,20 @@ export declare class MessagesGrantAuthorization {
14
14
  expectedGrantor: string;
15
15
  expectedGrantee: string;
16
16
  permissionGrants: PermissionGrant[];
17
- messageStore: MessageStore;
17
+ validationStateReader: ValidationStateReader;
18
18
  }): Promise<void>;
19
19
  /**
20
- * Authorizes the scope of a permission grant for MessagesSubscribe or MessagesSync.
21
- * @param messageStore Used to check if the grant has been revoked.
20
+ * Authorizes the scope of a permission grant for MessagesQuery or MessagesSubscribe.
21
+ * @param validationStateReader Used to check if the grant has been revoked.
22
22
  */
23
- static authorizeSubscribeOrSync(input: {
24
- incomingMessage: MessagesSubscribeMessage | MessagesSyncMessage;
23
+ static authorizeQueryOrSubscribe(input: {
24
+ incomingMessage: MessagesQueryMessage | MessagesSubscribeMessage;
25
25
  expectedGrantor: string;
26
26
  expectedGrantee: string;
27
27
  permissionGrants: PermissionGrant[];
28
- messageStore: MessageStore;
28
+ validationStateReader: ValidationStateReader;
29
29
  }): Promise<void>;
30
- private static authorizeSyncScope;
31
- private static authorizeProtocolSyncScope;
32
- private static authorizeSubscribeScope;
30
+ private static authorizeFilterScope;
33
31
  private static someScopeMatches;
34
32
  private static hasUnscopedGrant;
35
33
  /**
@@ -43,7 +41,7 @@ export declare class MessagesGrantAuthorization {
43
41
  expectedGrantor: string;
44
42
  expectedGrantee: string;
45
43
  permissionGrants: PermissionGrant[];
46
- messageStore: MessageStore;
44
+ validationStateReader: ValidationStateReader;
47
45
  deliveryTimestamp: string;
48
46
  }): Promise<void>;
49
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"messages-grant-authorization.d.ts","sourceRoot":"","sources":["../../../../src/core/messages-grant-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAIxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAWrH,qBAAa,0BAA0B;WAEjB,qBAAqB,CACvC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,MAAM,EAAE,GAC3B,OAAO,CAAC,eAAe,EAAE,CAAC;IAM7B;;;OAGG;WACiB,qBAAqB,CAAC,KAAK,EAAE;QAC/C,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,aAAa,EAAE,cAAc,CAAC;QAC9B,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,eAAe,EAAE,CAAC;QACpC,YAAY,EAAE,YAAY,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBjB;;;OAGG;WACiB,wBAAwB,CAAC,KAAK,EAAE;QAClD,eAAe,EAAE,wBAAwB,GAAG,mBAAmB,CAAC;QAChE,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,eAAe,EAAE,CAAC;QACpC,YAAY,EAAE,YAAY,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBjB,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAOjC,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAmBzC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAyBtC,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAI/B;;;;;OAKG;WACiB,0BAA0B,CAAC,KAAK,EAAE;QACpD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,eAAe,EAAE,MAAM,CAAC;QACxB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,eAAe,EAAE,CAAC;QACpC,YAAY,EAAE,YAAY,CAAC;QAC3B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BjB;;;OAGG;mBACkB,gCAAgC;IAsBrD;;OAEG;mBACkB,iBAAiB;mBA6BjB,+BAA+B;mBAwB/B,iCAAiC;IAoBtD,OAAO,CAAC,MAAM,CAAC,mCAAmC;mBAU7B,yBAAyB;IAY9C,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAMpC,OAAO,CAAC,MAAM,CAAC,cAAc;CAG9B"}
1
+ {"version":3,"file":"messages-grant-authorization.d.ts","sourceRoot":"","sources":["../../../../src/core/messages-grant-authorization.ts"],"names":[],"mappings":"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MAAM,CAAC;QACxB,gBAAgB,EAAE,eAAe,EAAE,CAAC;QACpC,qBAAqB,EAAE,qBAAqB,CAAC;QAC7C,iBAAiB,EAAE,MAAM,CAAC;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BjB;;;OAGG;mBACkB,gCAAgC;IAsBrD;;OAEG;mBACkB,iBAAiB;mBA6BjB,+BAA+B;mBAwB/B,iCAAiC;IAoBtD,OAAO,CAAC,MAAM,CAAC,mCAAmC;mBAU7B,yBAAyB;IAY9C,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAMpC,OAAO,CAAC,MAAM,CAAC,cAAc;CAG9B"}
@@ -1,20 +1,19 @@
1
- import type { MessageStore } from '../types/message-store.js';
2
1
  import type { RecordsCount } from '../interfaces/records-count.js';
3
2
  import type { RecordsDelete } from '../interfaces/records-delete.js';
4
3
  import type { RecordsQuery } from '../interfaces/records-query.js';
5
4
  import type { RecordsRead } from '../interfaces/records-read.js';
6
5
  import type { RecordsSubscribe } from '../interfaces/records-subscribe.js';
7
6
  import type { RecordsWriteMessage } from '../types/records-types.js';
7
+ import type { ValidationStateReader } from '../types/validation-state-reader.js';
8
8
  import type { ProtocolActionRule, ProtocolDefinition, ProtocolRuleSet } from '../types/protocols-types.js';
9
9
  import { RecordsWrite } from '../interfaces/records-write.js';
10
10
  import { ProtocolAction } from '../types/protocols-types.js';
11
- import type { FetchProtocolDefinitionFn } from './protocol-authorization.js';
12
11
  /**
13
12
  * Check if the incoming message is invoking a role. If so, validate the invoked role.
14
13
  * For cross-protocol role invocation, the role record may live in a different protocol
15
14
  * (resolved via the composing protocol's `uses` map).
16
15
  */
17
- export declare function verifyInvokedRole(tenant: string, incomingMessage: RecordsCount | RecordsDelete | RecordsQuery | RecordsRead | RecordsSubscribe | RecordsWrite, protocolUri: string, contextId: string | undefined, protocolDefinition: ProtocolDefinition, messageStore: MessageStore, fetchProtocolDefinition: FetchProtocolDefinitionFn, governingTimestamp?: string): Promise<void>;
16
+ export declare function verifyInvokedRole(tenant: string, incomingMessage: RecordsCount | RecordsDelete | RecordsQuery | RecordsRead | RecordsSubscribe | RecordsWrite, protocolUri: string, contextId: string | undefined, protocolDefinition: ProtocolDefinition, validationStateReader: ValidationStateReader, protocolDefinitionTimestamp?: string): Promise<void>;
18
17
  /**
19
18
  * Returns all the ProtocolActions that would authorized the incoming message
20
19
  * (but we still need to later verify if there is a rule defined that matches one of the actions).
@@ -25,13 +24,13 @@ export declare function verifyInvokedRole(tenant: string, incomingMessage: Recor
25
24
  * It is important to recognize that the `write` access that allowed the original record author to create the record maybe revoked
26
25
  * (e.g. by role revocation) by the time a "non-initial" write by the same author is attempted.
27
26
  */
28
- export declare function getActionsSeekingARuleMatch(tenant: string, incomingMessage: RecordsCount | RecordsDelete | RecordsQuery | RecordsRead | RecordsSubscribe | RecordsWrite, messageStore: MessageStore): Promise<ProtocolAction[]>;
27
+ export declare function getActionsSeekingARuleMatch(tenant: string, incomingMessage: RecordsCount | RecordsDelete | RecordsQuery | RecordsRead | RecordsSubscribe | RecordsWrite, validationStateReader: ValidationStateReader): Promise<ProtocolAction[]>;
29
28
  /**
30
29
  * Verifies the given message is authorized by one of the action rules in the given protocol rule set.
31
30
  * @param protocolDefinition Optional protocol definition for resolving cross-protocol `of` and `role` references.
32
31
  * @throws {Error} if action not allowed.
33
32
  */
34
- export declare function authorizeAgainstAllowedActions(tenant: string, incomingMessage: RecordsCount | RecordsDelete | RecordsQuery | RecordsRead | RecordsSubscribe | RecordsWrite, ruleSet: ProtocolRuleSet, recordChain: RecordsWriteMessage[], messageStore: MessageStore, protocolDefinition?: ProtocolDefinition): Promise<void>;
33
+ export declare function authorizeAgainstAllowedActions(tenant: string, incomingMessage: RecordsCount | RecordsDelete | RecordsQuery | RecordsRead | RecordsSubscribe | RecordsWrite, ruleSet: ProtocolRuleSet, recordChain: RecordsWriteMessage[], validationStateReader: ValidationStateReader, protocolDefinition?: ProtocolDefinition): Promise<void>;
35
34
  /**
36
35
  * Checks if the `who: 'author' | 'recipient'` action rule has a matching record in the record chain.
37
36
  * For cross-protocol `of` references (e.g., `"threads:thread"`), matches against both the protocol URI
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-authorization-action.d.ts","sourceRoot":"","sources":["../../../../src/core/protocol-authorization-action.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG3G,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAI9D,OAAO,EAAE,cAAc,EAAiB,MAAM,6BAA6B,CAAC;AAE5E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAE7E;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,gBAAgB,GAAG,YAAY,EAC5G,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,uBAAuB,EAAE,yBAAyB,EAClD,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,IAAI,CAAC,CA6Ff;AAED;;;;;;;;;GASG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,gBAAgB,GAAG,YAAY,EAC5G,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,cAAc,EAAE,CAAC,CAiF3B;AAED;;;;GAIG;AACH,wBAAsB,8BAA8B,CAClD,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,gBAAgB,GAAG,YAAY,EAC5G,OAAO,EAAE,eAAe,EACxB,WAAW,EAAE,mBAAmB,EAAE,EAClC,YAAY,EAAE,YAAY,EAC1B,kBAAkB,CAAC,EAAE,kBAAkB,GACtC,OAAO,CAAC,IAAI,CAAC,CAyFf;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,kBAAkB,EAC9B,WAAW,EAAE,mBAAmB,EAAE,EAClC,mBAAmB,CAAC,EAAE,kBAAkB,GACvC,OAAO,CAAC,OAAO,CAAC,CA0ClB"}
1
+ {"version":3,"file":"protocol-authorization-action.d.ts","sourceRoot":"","sources":["../../../../src/core/protocol-authorization-action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB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
- import type { MessageStore } from '../types/message-store.js';
1
+ import type { RecordsWrite } from '../interfaces/records-write.js';
2
2
  import type { RecordsWriteMessage } from '../types/records-types.js';
3
+ import type { ValidationStateReader } from '../types/validation-state-reader.js';
3
4
  import type { ProtocolDefinition, ProtocolRuleSet, ProtocolTypes } from '../types/protocols-types.js';
4
- import type { RecordsWrite } from '../interfaces/records-write.js';
5
- import type { FetchProtocolDefinitionFn } from './protocol-authorization.js';
6
5
  /**
7
6
  * Verifies the `protocolPath` declared in the given message matches the path of actual record chain.
8
7
  * For cross-protocol composition, the parent record may belong to a different protocol (resolved via `$ref` in the composing protocol).
9
8
  * @throws {DwnError} if fails verification.
10
9
  */
11
- export declare function verifyProtocolPathAndContextId(tenant: string, inboundMessage: RecordsWrite, messageStore: MessageStore, fetchProtocolDefinition: FetchProtocolDefinitionFn, governingTimestamp?: string): Promise<void>;
10
+ export declare function verifyProtocolPathAndContextId(tenant: string, inboundMessage: RecordsWrite, validationStateReader: ValidationStateReader, protocolDefinitionTimestamp?: string): Promise<void>;
12
11
  /**
13
12
  * Resolves the protocol URI that should be used when querying for the parent record.
14
13
  * For standard (non-composed) records, this is the same as the child's protocol.
@@ -21,19 +20,19 @@ export declare function verifyProtocolPathAndContextId(tenant: string, inboundMe
21
20
  * live in the referenced protocol. Specifically, the `$ref` at the topmost ancestor tells us
22
21
  * the parent's protocol URI.
23
22
  */
24
- export declare function resolveParentProtocolUri(tenant: string, childProtocolUri: string, childProtocolPath: string, messageStore: MessageStore, fetchProtocolDefinition: FetchProtocolDefinitionFn, governingTimestamp?: string): Promise<string>;
23
+ export declare function resolveParentProtocolUri(tenant: string, childProtocolUri: string, childProtocolPath: string, validationStateReader: ValidationStateReader, protocolDefinitionTimestamp?: string): Promise<string>;
25
24
  /**
26
25
  * Verifies the `dataFormat` and `schema` declared in the given message matches the type in the protocol.
27
26
  * For cross-protocol composition, if the type is at a `$ref` position in the structure,
28
27
  * the type definition is looked up in the referenced protocol's `types` map instead.
29
28
  */
30
- export declare function verifyTypeWithComposition(tenant: string, inboundMessage: RecordsWriteMessage, protocolDefinition: ProtocolDefinition, messageStore: MessageStore, fetchProtocolDefinition: FetchProtocolDefinitionFn, governingTimestamp?: string): Promise<void>;
29
+ export declare function verifyTypeWithComposition(tenant: string, inboundMessage: RecordsWriteMessage, protocolDefinition: ProtocolDefinition, validationStateReader: ValidationStateReader, protocolDefinitionTimestamp?: string): Promise<void>;
31
30
  /**
32
31
  * Resolves the `ProtocolTypes` map that contains the type definition for the given protocol path.
33
32
  * For non-composed records, this is the protocol definition's own `types` map.
34
33
  * For records at a `$ref` position, this is the referenced protocol's `types` map.
35
34
  */
36
- export declare function resolveProtocolTypesForPath(tenant: string, protocolPath: string, protocolDefinition: ProtocolDefinition, messageStore: MessageStore, fetchProtocolDefinition: FetchProtocolDefinitionFn, governingTimestamp?: string): Promise<ProtocolTypes>;
35
+ export declare function resolveProtocolTypesForPath(tenant: string, protocolPath: string, protocolDefinition: ProtocolDefinition, validationStateReader: ValidationStateReader, protocolDefinitionTimestamp?: string): Promise<ProtocolTypes>;
37
36
  /**
38
37
  * Verifies the `dataFormat` and `schema` declared in the given message (if it is a RecordsWrite) matches dataFormat
39
38
  * and schema of the type in the given protocol.
@@ -46,7 +45,7 @@ export declare function verifyType(inboundMessage: RecordsWriteMessage, protocol
46
45
  */
47
46
  export declare function verifySizeLimit(incomingMessage: RecordsWrite, ruleSet: ProtocolRuleSet): void;
48
47
  /**
49
- * Verifies record tags against the `$tags` schema in the rule set using JSON Schema (Ajv).
48
+ * Verifies record tags against the `$tags` schema in the rule set.
50
49
  * Checks required tags, additional properties, and schema conformance.
51
50
  */
52
51
  export declare function verifyTagsIfNeeded(incomingMessage: RecordsWrite, ruleSet: ProtocolRuleSet): void;
@@ -56,19 +55,17 @@ export declare function verifyTagsIfNeeded(incomingMessage: RecordsWrite, ruleSe
56
55
  * Else it verifies the validity of the given `RecordsWrite` as a role record, including:
57
56
  * 1. The same role has not been assigned to the same entity/recipient.
58
57
  */
59
- export declare function verifyAsRoleRecordIfNeeded(tenant: string, incomingMessage: RecordsWrite, ruleSet: ProtocolRuleSet, messageStore: MessageStore): Promise<void>;
58
+ export declare function verifyAsRoleRecordIfNeeded(tenant: string, incomingMessage: RecordsWrite, ruleSet: ProtocolRuleSet, validationStateReader: ValidationStateReader): Promise<void>;
60
59
  /**
61
- * Verifies that a new record creation does not exceed the `$recordLimit` defined in the rule set.
60
+ * Verifies that the `$recordLimit` strategy is supported for a new record creation.
62
61
  *
63
- * This check only applies to initial writes (new records). Updates to existing records are not counted.
64
- * The count is scoped to the same `protocol + protocolPath` within the parent context:
65
- * - For root-level records: counted across the entire protocol for the tenant.
66
- * - For nested records: counted within the parent record's context.
62
+ * This check only applies to initial writes (new records). Updates to existing records do not
63
+ * affect record-limit occupancy. The supported `reject` strategy admits every candidate and
64
+ * projects the visible occupant set at read time, so validation stays independent of arrival order.
67
65
  *
68
- * @throws {DwnError} with `ProtocolAuthorizationRecordLimitExceeded` if the limit is reached and strategy is `reject`.
69
- * @throws {DwnError} with `ProtocolAuthorizationRecordLimitStrategyNotImplemented` if strategy is not yet implemented.
66
+ * @throws {DwnError} with `ProtocolAuthorizationRecordLimitStrategyNotImplemented` if strategy is not implemented.
70
67
  */
71
- export declare function verifyRecordLimit(tenant: string, incomingMessage: RecordsWrite, ruleSet: ProtocolRuleSet, messageStore: MessageStore): Promise<void>;
68
+ export declare function verifyRecordLimit(incomingMessage: RecordsWrite, ruleSet: ProtocolRuleSet): Promise<void>;
72
69
  /**
73
70
  * Verifies that a `RecordsWrite` with `squash: true` is eligible:
74
71
  * 1. The protocol rule set at the record's `protocolPath` must have `$squash: true`.
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-authorization-validation.d.ts","sourceRoot":"","sources":["../../../../src/core/protocol-authorization-validation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAA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a,EAAE,aAAa,EAC5B,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAsCN;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,GACvB,IAAI,CAgBN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,GACvB,IAAI,CA8BN;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CA6Cf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC,IAAI,CAAC,CAiDf;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAcf"}
1
+ {"version":3,"file":"protocol-authorization-validation.d.ts","sourceRoot":"","sources":["../../../../src/core/protocol-authorization-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAgB,aAAa,EAAE,MAAM,6BAA6B,CAAC;AASp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AM,EACd,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,EACxB,qBAAqB,EAAE,qBAAqB,GAC3C,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -1,23 +1,17 @@
1
- import type { CoreProtocolRegistry } from './core-protocol.js';
2
- import type { MessageStore } from '../types/message-store.js';
3
1
  import type { RecordsCount } from '../interfaces/records-count.js';
4
2
  import type { RecordsDelete } from '../interfaces/records-delete.js';
5
3
  import type { RecordsQuery } from '../interfaces/records-query.js';
6
4
  import type { RecordsRead } from '../interfaces/records-read.js';
7
5
  import type { RecordsSubscribe } from '../interfaces/records-subscribe.js';
8
6
  import type { RecordsWrite } from '../interfaces/records-write.js';
9
- import type { ProtocolDefinition } from '../types/protocols-types.js';
10
- /**
11
- * Function signature for fetching a protocol definition.
12
- * Used by extracted modules to break the circular dependency on `ProtocolAuthorization`.
13
- */
14
- export type FetchProtocolDefinitionFn = (tenant: string, protocolUri: string, messageStore: MessageStore, messageTimestamp?: string) => Promise<ProtocolDefinition>;
7
+ import type { ValidationStateReader } from '../types/validation-state-reader.js';
8
+ import type { ProtocolRuleSet } from '../types/protocols-types.js';
15
9
  export declare class ProtocolAuthorization {
16
10
  /**
17
11
  * Performs validation on the structure of RecordsWrite messages that use a protocol.
18
12
  * @throws {Error} if validation fails.
19
13
  */
20
- static validateReferentialIntegrity(tenant: string, incomingMessage: RecordsWrite, messageStore: MessageStore, coreProtocols?: CoreProtocolRegistry): Promise<void>;
14
+ static validateReferentialIntegrity(tenant: string, incomingMessage: RecordsWrite, validationStateReader: ValidationStateReader): Promise<ProtocolRuleSet>;
21
15
  /**
22
16
  * Revalidates a stored initial write against the protocol definition that governed its creation timestamp.
23
17
  *
@@ -25,43 +19,24 @@ export declare class ProtocolAuthorization {
25
19
  * structure and avoids live dependency checks. Missing grant, role, or parent records must not cause
26
20
  * an already-admitted record to be hard-purged.
27
21
  */
28
- static validateStoredInitialWrite(tenant: string, incomingMessage: RecordsWrite, messageStore: MessageStore, coreProtocols?: CoreProtocolRegistry): Promise<void>;
22
+ static validateStoredInitialWrite(tenant: string, incomingMessage: RecordsWrite, validationStateReader: ValidationStateReader): Promise<void>;
29
23
  /**
30
24
  * Performs protocol-based authorization against the incoming RecordsWrite message.
31
25
  * @throws {Error} if authorization fails.
32
26
  */
33
- static authorizeWrite(tenant: string, incomingMessage: RecordsWrite, messageStore: MessageStore, coreProtocols?: CoreProtocolRegistry): Promise<void>;
27
+ static authorizeWrite(tenant: string, incomingMessage: RecordsWrite, validationStateReader: ValidationStateReader): Promise<void>;
34
28
  /**
35
29
  * Performs protocol-based authorization against the incoming `RecordsRead` message.
36
30
  * @param newestRecordsWrite The latest RecordsWrite associated with the recordId being read.
37
31
  * @throws {Error} if authorization fails.
38
32
  */
39
- static authorizeRead(tenant: string, incomingMessage: RecordsRead, newestRecordsWrite: RecordsWrite, messageStore: MessageStore, coreProtocols?: CoreProtocolRegistry): Promise<void>;
40
- static authorizeQueryOrSubscribe(tenant: string, incomingMessage: RecordsCount | RecordsQuery | RecordsSubscribe, messageStore: MessageStore, coreProtocols?: CoreProtocolRegistry): Promise<void>;
33
+ static authorizeRead(tenant: string, incomingMessage: RecordsRead, newestRecordsWrite: RecordsWrite, validationStateReader: ValidationStateReader): Promise<void>;
34
+ static authorizeQueryOrSubscribe(tenant: string, incomingMessage: RecordsCount | RecordsQuery | RecordsSubscribe, validationStateReader: ValidationStateReader): Promise<void>;
41
35
  /**
42
36
  * Performs protocol-based authorization against the incoming `RecordsDelete` message.
43
37
  * @param recordsWrite A `RecordsWrite` of the record being deleted.
44
38
  */
45
- static authorizeDelete(tenant: string, incomingMessage: RecordsDelete, recordsWrite: RecordsWrite, messageStore: MessageStore, coreProtocols?: CoreProtocolRegistry): Promise<void>;
46
- /**
47
- * Fetches the protocol definition based on the protocol specified in the given message.
48
- * When `messageTimestamp` is provided, returns the protocol definition that was active at that
49
- * point in time — i.e. the ProtocolsConfigure with the greatest `messageTimestamp` that is <= the
50
- * given timestamp. When not provided, returns the latest (current) protocol definition.
51
- *
52
- * When `coreProtocols` is provided, core protocol definitions are returned directly from the
53
- * registry without a message store query. The extra parameter does not affect the
54
- * `FetchProtocolDefinitionFn` callback type — callers that pass this function as a callback
55
- * should bind the registry via a closure (see `createBoundFetchDefinition`).
56
- */
57
- static fetchProtocolDefinition(tenant: string, protocolUri: string, messageStore: MessageStore, messageTimestamp?: string, coreProtocols?: CoreProtocolRegistry): Promise<ProtocolDefinition>;
58
- /**
59
- * Creates a `FetchProtocolDefinitionFn` closure that binds the given `CoreProtocolRegistry`.
60
- * This allows core protocol definitions to be resolved from the registry without changing
61
- * the `FetchProtocolDefinitionFn` type signature — zero ripple to downstream consumers
62
- * like `protocol-authorization-action.ts` and `protocol-authorization-validation.ts`.
63
- */
64
- private static createBoundFetchDefinition;
39
+ static authorizeDelete(tenant: string, incomingMessage: RecordsDelete, recordsWrite: RecordsWrite, validationStateReader: ValidationStateReader): Promise<void>;
65
40
  /**
66
41
  * Gets the rule set corresponding to the given protocolPath.
67
42
  */
@@ -1 +1 @@
1
- {"version":3,"file":"protocol-authorization.d.ts","sourceRoot":"","sources":["../../../../src/core/protocol-authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,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