@enbox/dwn-sdk-js 0.0.6 → 0.0.8

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 (527) 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 +762 -911
  4. package/dist/esm/generated/precompiled-validators.js.map +1 -1
  5. package/dist/esm/src/core/abstract-message.js +4 -0
  6. package/dist/esm/src/core/abstract-message.js.map +1 -1
  7. package/dist/esm/src/core/auth.js +22 -33
  8. package/dist/esm/src/core/auth.js.map +1 -1
  9. package/dist/esm/src/core/constants.js +11 -0
  10. package/dist/esm/src/core/constants.js.map +1 -0
  11. package/dist/esm/src/core/core-protocol.js +44 -0
  12. package/dist/esm/src/core/core-protocol.js.map +1 -0
  13. package/dist/esm/src/core/dwn-constant.js +7 -7
  14. package/dist/esm/src/core/dwn-constant.js.map +1 -1
  15. package/dist/esm/src/core/dwn-error.js +10 -12
  16. package/dist/esm/src/core/dwn-error.js.map +1 -1
  17. package/dist/esm/src/core/grant-authorization.js +50 -52
  18. package/dist/esm/src/core/grant-authorization.js.map +1 -1
  19. package/dist/esm/src/core/message.js +85 -116
  20. package/dist/esm/src/core/message.js.map +1 -1
  21. package/dist/esm/src/core/messages-grant-authorization.js +63 -78
  22. package/dist/esm/src/core/messages-grant-authorization.js.map +1 -1
  23. package/dist/esm/src/core/protocol-authorization-action.js +266 -0
  24. package/dist/esm/src/core/protocol-authorization-action.js.map +1 -0
  25. package/dist/esm/src/core/protocol-authorization-validation.js +321 -0
  26. package/dist/esm/src/core/protocol-authorization-validation.js.map +1 -0
  27. package/dist/esm/src/core/protocol-authorization.js +144 -741
  28. package/dist/esm/src/core/protocol-authorization.js.map +1 -1
  29. package/dist/esm/src/core/protocols-grant-authorization.js +24 -38
  30. package/dist/esm/src/core/protocols-grant-authorization.js.map +1 -1
  31. package/dist/esm/src/core/record-chain.js +64 -0
  32. package/dist/esm/src/core/record-chain.js.map +1 -0
  33. package/dist/esm/src/core/records-grant-authorization.js +53 -72
  34. package/dist/esm/src/core/records-grant-authorization.js.map +1 -1
  35. package/dist/esm/src/core/resumable-task-manager.js +50 -65
  36. package/dist/esm/src/core/resumable-task-manager.js.map +1 -1
  37. package/dist/esm/src/core/tenant-gate.js +2 -13
  38. package/dist/esm/src/core/tenant-gate.js.map +1 -1
  39. package/dist/esm/src/dwn.js +108 -101
  40. package/dist/esm/src/dwn.js.map +1 -1
  41. package/dist/esm/src/event-stream/event-emitter-event-log.js +204 -0
  42. package/dist/esm/src/event-stream/event-emitter-event-log.js.map +1 -0
  43. package/dist/esm/src/handlers/messages-read.js +67 -81
  44. package/dist/esm/src/handlers/messages-read.js.map +1 -1
  45. package/dist/esm/src/handlers/messages-subscribe.js +51 -63
  46. package/dist/esm/src/handlers/messages-subscribe.js.map +1 -1
  47. package/dist/esm/src/handlers/messages-sync.js +75 -89
  48. package/dist/esm/src/handlers/messages-sync.js.map +1 -1
  49. package/dist/esm/src/handlers/protocols-configure.js +153 -163
  50. package/dist/esm/src/handlers/protocols-configure.js.map +1 -1
  51. package/dist/esm/src/handlers/protocols-query.js +52 -55
  52. package/dist/esm/src/handlers/protocols-query.js.map +1 -1
  53. package/dist/esm/src/handlers/records-count.js +97 -85
  54. package/dist/esm/src/handlers/records-count.js.map +1 -1
  55. package/dist/esm/src/handlers/records-delete.js +75 -93
  56. package/dist/esm/src/handlers/records-delete.js.map +1 -1
  57. package/dist/esm/src/handlers/records-query.js +116 -105
  58. package/dist/esm/src/handlers/records-query.js.map +1 -1
  59. package/dist/esm/src/handlers/records-read.js +130 -132
  60. package/dist/esm/src/handlers/records-read.js.map +1 -1
  61. package/dist/esm/src/handlers/records-subscribe.js +164 -104
  62. package/dist/esm/src/handlers/records-subscribe.js.map +1 -1
  63. package/dist/esm/src/handlers/records-write.js +213 -280
  64. package/dist/esm/src/handlers/records-write.js.map +1 -1
  65. package/dist/esm/src/index.js +5 -2
  66. package/dist/esm/src/index.js.map +1 -1
  67. package/dist/esm/src/interfaces/messages-read.js +24 -32
  68. package/dist/esm/src/interfaces/messages-read.js.map +1 -1
  69. package/dist/esm/src/interfaces/messages-subscribe.js +28 -41
  70. package/dist/esm/src/interfaces/messages-subscribe.js.map +1 -1
  71. package/dist/esm/src/interfaces/messages-sync.js +26 -40
  72. package/dist/esm/src/interfaces/messages-sync.js.map +1 -1
  73. package/dist/esm/src/interfaces/protocols-configure.js +87 -65
  74. package/dist/esm/src/interfaces/protocols-configure.js.map +1 -1
  75. package/dist/esm/src/interfaces/protocols-query.js +55 -68
  76. package/dist/esm/src/interfaces/protocols-query.js.map +1 -1
  77. package/dist/esm/src/interfaces/records-count.js +50 -66
  78. package/dist/esm/src/interfaces/records-count.js.map +1 -1
  79. package/dist/esm/src/interfaces/records-delete.js +45 -55
  80. package/dist/esm/src/interfaces/records-delete.js.map +1 -1
  81. package/dist/esm/src/interfaces/records-query.js +60 -76
  82. package/dist/esm/src/interfaces/records-query.js.map +1 -1
  83. package/dist/esm/src/interfaces/records-read.js +51 -67
  84. package/dist/esm/src/interfaces/records-read.js.map +1 -1
  85. package/dist/esm/src/interfaces/records-subscribe.js +53 -68
  86. package/dist/esm/src/interfaces/records-subscribe.js.map +1 -1
  87. package/dist/esm/src/interfaces/records-write-query.js +102 -0
  88. package/dist/esm/src/interfaces/records-write-query.js.map +1 -0
  89. package/dist/esm/src/interfaces/records-write-signing.js +81 -0
  90. package/dist/esm/src/interfaces/records-write-signing.js.map +1 -0
  91. package/dist/esm/src/interfaces/records-write.js +396 -610
  92. package/dist/esm/src/interfaces/records-write.js.map +1 -1
  93. package/dist/esm/src/jose/algorithms/signing/ed25519.js +10 -19
  94. package/dist/esm/src/jose/algorithms/signing/ed25519.js.map +1 -1
  95. package/dist/esm/src/jose/jws/general/builder.js +23 -35
  96. package/dist/esm/src/jose/jws/general/builder.js.map +1 -1
  97. package/dist/esm/src/jose/jws/general/verifier.js +56 -69
  98. package/dist/esm/src/jose/jws/general/verifier.js.map +1 -1
  99. package/dist/esm/src/protocols/permission-grant.js +43 -14
  100. package/dist/esm/src/protocols/permission-grant.js.map +1 -1
  101. package/dist/esm/src/protocols/permission-request.js +28 -14
  102. package/dist/esm/src/protocols/permission-request.js.map +1 -1
  103. package/dist/esm/src/protocols/permissions.js +325 -227
  104. package/dist/esm/src/protocols/permissions.js.map +1 -1
  105. package/dist/esm/src/smt/smt-store-level.js +42 -64
  106. package/dist/esm/src/smt/smt-store-level.js.map +1 -1
  107. package/dist/esm/src/smt/smt-store-memory.js +19 -45
  108. package/dist/esm/src/smt/smt-store-memory.js.map +1 -1
  109. package/dist/esm/src/smt/smt-utils.js +28 -45
  110. package/dist/esm/src/smt/smt-utils.js.map +1 -1
  111. package/dist/esm/src/smt/sparse-merkle-tree.js +426 -471
  112. package/dist/esm/src/smt/sparse-merkle-tree.js.map +1 -1
  113. package/dist/esm/src/state-index/state-index-level.js +113 -150
  114. package/dist/esm/src/state-index/state-index-level.js.map +1 -1
  115. package/dist/esm/src/store/blockstore-level.js +54 -156
  116. package/dist/esm/src/store/blockstore-level.js.map +1 -1
  117. package/dist/esm/src/store/blockstore-mock.js +48 -153
  118. package/dist/esm/src/store/blockstore-mock.js.map +1 -1
  119. package/dist/esm/src/store/data-store-level.js +137 -100
  120. package/dist/esm/src/store/data-store-level.js.map +1 -1
  121. package/dist/esm/src/store/index-level-compound.js +246 -0
  122. package/dist/esm/src/store/index-level-compound.js.map +1 -0
  123. package/dist/esm/src/store/index-level.js +307 -715
  124. package/dist/esm/src/store/index-level.js.map +1 -1
  125. package/dist/esm/src/store/level-wrapper.js +143 -244
  126. package/dist/esm/src/store/level-wrapper.js.map +1 -1
  127. package/dist/esm/src/store/message-store-level.js +71 -94
  128. package/dist/esm/src/store/message-store-level.js.map +1 -1
  129. package/dist/esm/src/store/resumable-task-store-level.js +62 -101
  130. package/dist/esm/src/store/resumable-task-store-level.js.map +1 -1
  131. package/dist/esm/src/store/storage-controller.js +131 -146
  132. package/dist/esm/src/store/storage-controller.js.map +1 -1
  133. package/dist/esm/src/types/permission-types.js.map +1 -1
  134. package/dist/esm/src/types/protocols-types.js +10 -0
  135. package/dist/esm/src/types/protocols-types.js.map +1 -1
  136. package/dist/esm/src/types/records-types.js.map +1 -1
  137. package/dist/esm/src/utils/abort.js +8 -19
  138. package/dist/esm/src/utils/abort.js.map +1 -1
  139. package/dist/esm/src/utils/array.js +15 -49
  140. package/dist/esm/src/utils/array.js.map +1 -1
  141. package/dist/esm/src/utils/cid.js +29 -77
  142. package/dist/esm/src/utils/cid.js.map +1 -1
  143. package/dist/esm/src/utils/data-stream.js +37 -65
  144. package/dist/esm/src/utils/data-stream.js.map +1 -1
  145. package/dist/esm/src/utils/encryption.js +136 -162
  146. package/dist/esm/src/utils/encryption.js.map +1 -1
  147. package/dist/esm/src/utils/filter.js +1 -12
  148. package/dist/esm/src/utils/filter.js.map +1 -1
  149. package/dist/esm/src/utils/hd-key.js +45 -71
  150. package/dist/esm/src/utils/hd-key.js.map +1 -1
  151. package/dist/esm/src/utils/jws.js +9 -20
  152. package/dist/esm/src/utils/jws.js.map +1 -1
  153. package/dist/esm/src/utils/memory-cache.js +12 -23
  154. package/dist/esm/src/utils/memory-cache.js.map +1 -1
  155. package/dist/esm/src/utils/messages.js +21 -33
  156. package/dist/esm/src/utils/messages.js.map +1 -1
  157. package/dist/esm/src/utils/private-key-signer.js +9 -17
  158. package/dist/esm/src/utils/private-key-signer.js.map +1 -1
  159. package/dist/esm/src/utils/protocols.js +62 -70
  160. package/dist/esm/src/utils/protocols.js.map +1 -1
  161. package/dist/esm/src/utils/records.js +103 -166
  162. package/dist/esm/src/utils/records.js.map +1 -1
  163. package/dist/esm/src/utils/secp256k1.js +60 -96
  164. package/dist/esm/src/utils/secp256k1.js.map +1 -1
  165. package/dist/esm/src/utils/secp256r1.js +54 -71
  166. package/dist/esm/src/utils/secp256r1.js.map +1 -1
  167. package/dist/esm/src/utils/time.js +5 -18
  168. package/dist/esm/src/utils/time.js.map +1 -1
  169. package/dist/esm/src/utils/url.js +3 -3
  170. package/dist/esm/src/utils/url.js.map +1 -1
  171. package/dist/esm/tests/core/auth.spec.js +3 -12
  172. package/dist/esm/tests/core/auth.spec.js.map +1 -1
  173. package/dist/esm/tests/core/message.spec.js +50 -59
  174. package/dist/esm/tests/core/message.spec.js.map +1 -1
  175. package/dist/esm/tests/core/protocol-authorization.spec.js +10 -18
  176. package/dist/esm/tests/core/protocol-authorization.spec.js.map +1 -1
  177. package/dist/esm/tests/dwn.spec.js +65 -89
  178. package/dist/esm/tests/dwn.spec.js.map +1 -1
  179. package/dist/esm/tests/event-emitter-event-log.spec.js +305 -0
  180. package/dist/esm/tests/event-emitter-event-log.spec.js.map +1 -0
  181. package/dist/esm/tests/features/author-delegated-grant.spec.js +337 -347
  182. package/dist/esm/tests/features/author-delegated-grant.spec.js.map +1 -1
  183. package/dist/esm/tests/features/owner-delegated-grant.spec.js +160 -172
  184. package/dist/esm/tests/features/owner-delegated-grant.spec.js.map +1 -1
  185. package/dist/esm/tests/features/owner-signature.spec.js +78 -82
  186. package/dist/esm/tests/features/owner-signature.spec.js.map +1 -1
  187. package/dist/esm/tests/features/permissions.spec.js +449 -184
  188. package/dist/esm/tests/features/permissions.spec.js.map +1 -1
  189. package/dist/esm/tests/features/protocol-composition.spec.js +981 -360
  190. package/dist/esm/tests/features/protocol-composition.spec.js.map +1 -1
  191. package/dist/esm/tests/features/protocol-create-action.spec.js +45 -54
  192. package/dist/esm/tests/features/protocol-create-action.spec.js.map +1 -1
  193. package/dist/esm/tests/features/protocol-delete-action.spec.js +99 -108
  194. package/dist/esm/tests/features/protocol-delete-action.spec.js.map +1 -1
  195. package/dist/esm/tests/features/protocol-update-action.spec.js +108 -117
  196. package/dist/esm/tests/features/protocol-update-action.spec.js.map +1 -1
  197. package/dist/esm/tests/features/records-immutable.spec.js +315 -0
  198. package/dist/esm/tests/features/records-immutable.spec.js.map +1 -0
  199. package/dist/esm/tests/features/records-prune.spec.js +178 -194
  200. package/dist/esm/tests/features/records-prune.spec.js.map +1 -1
  201. package/dist/esm/tests/features/records-record-limit.spec.js +542 -0
  202. package/dist/esm/tests/features/records-record-limit.spec.js.map +1 -0
  203. package/dist/esm/tests/features/records-tags.spec.js +456 -463
  204. package/dist/esm/tests/features/records-tags.spec.js.map +1 -1
  205. package/dist/esm/tests/features/resumable-tasks.spec.js +88 -98
  206. package/dist/esm/tests/features/resumable-tasks.spec.js.map +1 -1
  207. package/dist/esm/tests/handlers/messages-read.spec.js +215 -210
  208. package/dist/esm/tests/handlers/messages-read.spec.js.map +1 -1
  209. package/dist/esm/tests/handlers/messages-subscribe.spec.js +309 -171
  210. package/dist/esm/tests/handlers/messages-subscribe.spec.js.map +1 -1
  211. package/dist/esm/tests/handlers/messages-sync.spec.js +272 -199
  212. package/dist/esm/tests/handlers/messages-sync.spec.js.map +1 -1
  213. package/dist/esm/tests/handlers/protocols-configure.spec.js +247 -241
  214. package/dist/esm/tests/handlers/protocols-configure.spec.js.map +1 -1
  215. package/dist/esm/tests/handlers/protocols-query.spec.js +159 -172
  216. package/dist/esm/tests/handlers/protocols-query.spec.js.map +1 -1
  217. package/dist/esm/tests/handlers/records-count.spec.js +101 -105
  218. package/dist/esm/tests/handlers/records-count.spec.js.map +1 -1
  219. package/dist/esm/tests/handlers/records-delete.spec.js +266 -279
  220. package/dist/esm/tests/handlers/records-delete.spec.js.map +1 -1
  221. package/dist/esm/tests/handlers/records-query.spec.js +984 -996
  222. package/dist/esm/tests/handlers/records-query.spec.js.map +1 -1
  223. package/dist/esm/tests/handlers/records-read.spec.js +542 -671
  224. package/dist/esm/tests/handlers/records-read.spec.js.map +1 -1
  225. package/dist/esm/tests/handlers/records-subscribe.spec.js +433 -302
  226. package/dist/esm/tests/handlers/records-subscribe.spec.js.map +1 -1
  227. package/dist/esm/tests/handlers/records-write.spec.js +1216 -1140
  228. package/dist/esm/tests/handlers/records-write.spec.js.map +1 -1
  229. package/dist/esm/tests/interfaces/messages-get.spec.js +39 -48
  230. package/dist/esm/tests/interfaces/messages-get.spec.js.map +1 -1
  231. package/dist/esm/tests/interfaces/messages-subscribe.spec.js +4 -13
  232. package/dist/esm/tests/interfaces/messages-subscribe.spec.js.map +1 -1
  233. package/dist/esm/tests/interfaces/protocols-configure.spec.js +212 -88
  234. package/dist/esm/tests/interfaces/protocols-configure.spec.js.map +1 -1
  235. package/dist/esm/tests/interfaces/protocols-query.spec.js +8 -17
  236. package/dist/esm/tests/interfaces/protocols-query.spec.js.map +1 -1
  237. package/dist/esm/tests/interfaces/records-delete.spec.js +8 -17
  238. package/dist/esm/tests/interfaces/records-delete.spec.js.map +1 -1
  239. package/dist/esm/tests/interfaces/records-query.spec.js +20 -29
  240. package/dist/esm/tests/interfaces/records-query.spec.js.map +1 -1
  241. package/dist/esm/tests/interfaces/records-read.spec.js +42 -51
  242. package/dist/esm/tests/interfaces/records-read.spec.js.map +1 -1
  243. package/dist/esm/tests/interfaces/records-subscribe.spec.js +16 -25
  244. package/dist/esm/tests/interfaces/records-subscribe.spec.js.map +1 -1
  245. package/dist/esm/tests/interfaces/records-write.spec.js +190 -219
  246. package/dist/esm/tests/interfaces/records-write.spec.js.map +1 -1
  247. package/dist/esm/tests/jose/jws/general.spec.js +36 -45
  248. package/dist/esm/tests/jose/jws/general.spec.js.map +1 -1
  249. package/dist/esm/tests/protocols/permission-grant.spec.js +44 -50
  250. package/dist/esm/tests/protocols/permission-grant.spec.js.map +1 -1
  251. package/dist/esm/tests/protocols/permission-request.spec.js +23 -32
  252. package/dist/esm/tests/protocols/permission-request.spec.js.map +1 -1
  253. package/dist/esm/tests/protocols/permissions.spec.js +49 -55
  254. package/dist/esm/tests/protocols/permissions.spec.js.map +1 -1
  255. package/dist/esm/tests/scenarios/aggregator.spec.js +127 -138
  256. package/dist/esm/tests/scenarios/aggregator.spec.js.map +1 -1
  257. package/dist/esm/tests/scenarios/deleted-record.spec.js +372 -36
  258. package/dist/esm/tests/scenarios/deleted-record.spec.js.map +1 -1
  259. package/dist/esm/tests/scenarios/end-to-end-tests.spec.js +55 -64
  260. package/dist/esm/tests/scenarios/end-to-end-tests.spec.js.map +1 -1
  261. package/dist/esm/tests/scenarios/nested-roles.spec.js +66 -76
  262. package/dist/esm/tests/scenarios/nested-roles.spec.js.map +1 -1
  263. package/dist/esm/tests/scenarios/subscriptions.spec.js +451 -354
  264. package/dist/esm/tests/scenarios/subscriptions.spec.js.map +1 -1
  265. package/dist/esm/tests/smt/smt-store-level.spec.js +76 -87
  266. package/dist/esm/tests/smt/smt-store-level.spec.js.map +1 -1
  267. package/dist/esm/tests/smt/sparse-merkle-tree.spec.js +344 -353
  268. package/dist/esm/tests/smt/sparse-merkle-tree.spec.js.map +1 -1
  269. package/dist/esm/tests/state-index/state-index-level.spec.js +117 -126
  270. package/dist/esm/tests/state-index/state-index-level.spec.js.map +1 -1
  271. package/dist/esm/tests/store/blockstore-level.spec.js +44 -99
  272. package/dist/esm/tests/store/blockstore-level.spec.js.map +1 -1
  273. package/dist/esm/tests/store/blockstore-mock.spec.js +40 -120
  274. package/dist/esm/tests/store/blockstore-mock.spec.js.map +1 -1
  275. package/dist/esm/tests/store/data-store-level.spec.js +160 -108
  276. package/dist/esm/tests/store/data-store-level.spec.js.map +1 -1
  277. package/dist/esm/tests/store/index-level.spec.js +404 -414
  278. package/dist/esm/tests/store/index-level.spec.js.map +1 -1
  279. package/dist/esm/tests/store/message-store-level.spec.js +13 -22
  280. package/dist/esm/tests/store/message-store-level.spec.js.map +1 -1
  281. package/dist/esm/tests/store/message-store.spec.js +229 -238
  282. package/dist/esm/tests/store/message-store.spec.js.map +1 -1
  283. package/dist/esm/tests/test-event-stream.js +12 -13
  284. package/dist/esm/tests/test-event-stream.js.map +1 -1
  285. package/dist/esm/tests/test-stores.js +16 -13
  286. package/dist/esm/tests/test-stores.js.map +1 -1
  287. package/dist/esm/tests/test-suite.js +8 -15
  288. package/dist/esm/tests/test-suite.js.map +1 -1
  289. package/dist/esm/tests/utils/cid.spec.js +24 -33
  290. package/dist/esm/tests/utils/cid.spec.js.map +1 -1
  291. package/dist/esm/tests/utils/data-stream.spec.js +48 -57
  292. package/dist/esm/tests/utils/data-stream.spec.js.map +1 -1
  293. package/dist/esm/tests/utils/encryption-callbacks.spec.js +45 -54
  294. package/dist/esm/tests/utils/encryption-callbacks.spec.js.map +1 -1
  295. package/dist/esm/tests/utils/encryption.spec.js +229 -82
  296. package/dist/esm/tests/utils/encryption.spec.js.map +1 -1
  297. package/dist/esm/tests/utils/filters.spec.js +46 -55
  298. package/dist/esm/tests/utils/filters.spec.js.map +1 -1
  299. package/dist/esm/tests/utils/hd-key.spec.js +10 -19
  300. package/dist/esm/tests/utils/hd-key.spec.js.map +1 -1
  301. package/dist/esm/tests/utils/jws.spec.js +3 -12
  302. package/dist/esm/tests/utils/jws.spec.js.map +1 -1
  303. package/dist/esm/tests/utils/memory-cache.spec.js +9 -18
  304. package/dist/esm/tests/utils/memory-cache.spec.js.map +1 -1
  305. package/dist/esm/tests/utils/messages.spec.js +18 -20
  306. package/dist/esm/tests/utils/messages.spec.js.map +1 -1
  307. package/dist/esm/tests/utils/poller.js +22 -33
  308. package/dist/esm/tests/utils/poller.js.map +1 -1
  309. package/dist/esm/tests/utils/private-key-signer.spec.js +15 -24
  310. package/dist/esm/tests/utils/private-key-signer.spec.js.map +1 -1
  311. package/dist/esm/tests/utils/records.spec.js +14 -27
  312. package/dist/esm/tests/utils/records.spec.js.map +1 -1
  313. package/dist/esm/tests/utils/secp256k1.spec.js +16 -25
  314. package/dist/esm/tests/utils/secp256k1.spec.js.map +1 -1
  315. package/dist/esm/tests/utils/secp256r1.spec.js +18 -27
  316. package/dist/esm/tests/utils/secp256r1.spec.js.map +1 -1
  317. package/dist/esm/tests/utils/test-data-generator.js +446 -467
  318. package/dist/esm/tests/utils/test-data-generator.js.map +1 -1
  319. package/dist/esm/tests/validation/json-schemas/definitions.spec.js +2 -11
  320. package/dist/esm/tests/validation/json-schemas/definitions.spec.js.map +1 -1
  321. package/dist/esm/tests/validation/json-schemas/jwk/general-jwk.spec.js +4 -13
  322. package/dist/esm/tests/validation/json-schemas/jwk/general-jwk.spec.js.map +1 -1
  323. package/dist/esm/tests/validation/json-schemas/jwk/public-jwk.spec.js +8 -17
  324. package/dist/esm/tests/validation/json-schemas/jwk/public-jwk.spec.js.map +1 -1
  325. package/dist/esm/tests/validation/json-schemas/jwk-verification-method.spec.js +3 -12
  326. package/dist/esm/tests/validation/json-schemas/jwk-verification-method.spec.js.map +1 -1
  327. package/dist/esm/tests/validation/json-schemas/protocols/protocols-configure.spec.js +4 -13
  328. package/dist/esm/tests/validation/json-schemas/protocols/protocols-configure.spec.js.map +1 -1
  329. package/dist/esm/tests/validation/json-schemas/records/records-query.spec.js +2 -11
  330. package/dist/esm/tests/validation/json-schemas/records/records-query.spec.js.map +1 -1
  331. package/dist/esm/tests/validation/json-schemas/records/records-read.spec.js +2 -11
  332. package/dist/esm/tests/validation/json-schemas/records/records-read.spec.js.map +1 -1
  333. package/dist/esm/tests/validation/json-schemas/records/records-write.spec.js +44 -24
  334. package/dist/esm/tests/validation/json-schemas/records/records-write.spec.js.map +1 -1
  335. package/dist/types/generated/precompiled-validators.d.ts +49 -40
  336. package/dist/types/generated/precompiled-validators.d.ts.map +1 -1
  337. package/dist/types/src/core/constants.d.ts +11 -0
  338. package/dist/types/src/core/constants.d.ts.map +1 -0
  339. package/dist/types/src/core/core-protocol.d.ts +89 -0
  340. package/dist/types/src/core/core-protocol.d.ts.map +1 -0
  341. package/dist/types/src/core/dwn-error.d.ts +9 -12
  342. package/dist/types/src/core/dwn-error.d.ts.map +1 -1
  343. package/dist/types/src/core/grant-authorization.d.ts +6 -2
  344. package/dist/types/src/core/grant-authorization.d.ts.map +1 -1
  345. package/dist/types/src/core/protocol-authorization-action.d.ts +42 -0
  346. package/dist/types/src/core/protocol-authorization-action.d.ts.map +1 -0
  347. package/dist/types/src/core/protocol-authorization-validation.d.ts +81 -0
  348. package/dist/types/src/core/protocol-authorization-validation.d.ts.map +1 -0
  349. package/dist/types/src/core/protocol-authorization.d.ts +24 -106
  350. package/dist/types/src/core/protocol-authorization.d.ts.map +1 -1
  351. package/dist/types/src/core/record-chain.d.ts +24 -0
  352. package/dist/types/src/core/record-chain.d.ts.map +1 -0
  353. package/dist/types/src/core/records-grant-authorization.d.ts.map +1 -1
  354. package/dist/types/src/dwn.d.ts +19 -7
  355. package/dist/types/src/dwn.d.ts.map +1 -1
  356. package/dist/types/src/event-stream/event-emitter-event-log.d.ts +50 -0
  357. package/dist/types/src/event-stream/event-emitter-event-log.d.ts.map +1 -0
  358. package/dist/types/src/handlers/messages-read.d.ts +3 -8
  359. package/dist/types/src/handlers/messages-read.d.ts.map +1 -1
  360. package/dist/types/src/handlers/messages-subscribe.d.ts +6 -10
  361. package/dist/types/src/handlers/messages-subscribe.d.ts.map +1 -1
  362. package/dist/types/src/handlers/messages-sync.d.ts +3 -8
  363. package/dist/types/src/handlers/messages-sync.d.ts.map +1 -1
  364. package/dist/types/src/handlers/protocols-configure.d.ts +3 -10
  365. package/dist/types/src/handlers/protocols-configure.d.ts.map +1 -1
  366. package/dist/types/src/handlers/protocols-query.d.ts +3 -8
  367. package/dist/types/src/handlers/protocols-query.d.ts.map +1 -1
  368. package/dist/types/src/handlers/records-count.d.ts +3 -6
  369. package/dist/types/src/handlers/records-count.d.ts.map +1 -1
  370. package/dist/types/src/handlers/records-delete.d.ts +3 -8
  371. package/dist/types/src/handlers/records-delete.d.ts.map +1 -1
  372. package/dist/types/src/handlers/records-query.d.ts +3 -8
  373. package/dist/types/src/handlers/records-query.d.ts.map +1 -1
  374. package/dist/types/src/handlers/records-read.d.ts +3 -8
  375. package/dist/types/src/handlers/records-read.d.ts.map +1 -1
  376. package/dist/types/src/handlers/records-subscribe.d.ts +8 -10
  377. package/dist/types/src/handlers/records-subscribe.d.ts.map +1 -1
  378. package/dist/types/src/handlers/records-write.d.ts +4 -24
  379. package/dist/types/src/handlers/records-write.d.ts.map +1 -1
  380. package/dist/types/src/index.d.ts +8 -4
  381. package/dist/types/src/index.d.ts.map +1 -1
  382. package/dist/types/src/interfaces/messages-subscribe.d.ts +5 -0
  383. package/dist/types/src/interfaces/messages-subscribe.d.ts.map +1 -1
  384. package/dist/types/src/interfaces/protocols-configure.d.ts.map +1 -1
  385. package/dist/types/src/interfaces/records-subscribe.d.ts +5 -0
  386. package/dist/types/src/interfaces/records-subscribe.d.ts.map +1 -1
  387. package/dist/types/src/interfaces/records-write-query.d.ts +33 -0
  388. package/dist/types/src/interfaces/records-write-query.d.ts.map +1 -0
  389. package/dist/types/src/interfaces/records-write-signing.d.ts +34 -0
  390. package/dist/types/src/interfaces/records-write-signing.d.ts.map +1 -0
  391. package/dist/types/src/interfaces/records-write.d.ts +13 -53
  392. package/dist/types/src/interfaces/records-write.d.ts.map +1 -1
  393. package/dist/types/src/protocols/permission-grant.d.ts +1 -1
  394. package/dist/types/src/protocols/permission-grant.d.ts.map +1 -1
  395. package/dist/types/src/protocols/permission-request.d.ts +1 -1
  396. package/dist/types/src/protocols/permission-request.d.ts.map +1 -1
  397. package/dist/types/src/protocols/permissions.d.ts +40 -3
  398. package/dist/types/src/protocols/permissions.d.ts.map +1 -1
  399. package/dist/types/src/state-index/state-index-level.d.ts.map +1 -1
  400. package/dist/types/src/store/data-store-level.d.ts +20 -4
  401. package/dist/types/src/store/data-store-level.d.ts.map +1 -1
  402. package/dist/types/src/store/index-level-compound.d.ts +70 -0
  403. package/dist/types/src/store/index-level-compound.d.ts.map +1 -0
  404. package/dist/types/src/store/index-level.d.ts +4 -58
  405. package/dist/types/src/store/index-level.d.ts.map +1 -1
  406. package/dist/types/src/store/storage-controller.d.ts +4 -4
  407. package/dist/types/src/store/storage-controller.d.ts.map +1 -1
  408. package/dist/types/src/types/message-types.d.ts +3 -3
  409. package/dist/types/src/types/message-types.d.ts.map +1 -1
  410. package/dist/types/src/types/messages-types.d.ts +12 -3
  411. package/dist/types/src/types/messages-types.d.ts.map +1 -1
  412. package/dist/types/src/types/method-handler.d.ts +24 -3
  413. package/dist/types/src/types/method-handler.d.ts.map +1 -1
  414. package/dist/types/src/types/permission-types.d.ts +7 -0
  415. package/dist/types/src/types/permission-types.d.ts.map +1 -1
  416. package/dist/types/src/types/protocols-types.d.ts +41 -1
  417. package/dist/types/src/types/protocols-types.d.ts.map +1 -1
  418. package/dist/types/src/types/records-types.d.ts +16 -6
  419. package/dist/types/src/types/records-types.d.ts.map +1 -1
  420. package/dist/types/src/types/subscriptions.d.ts +151 -13
  421. package/dist/types/src/types/subscriptions.d.ts.map +1 -1
  422. package/dist/types/src/utils/hd-key.d.ts +1 -9
  423. package/dist/types/src/utils/hd-key.d.ts.map +1 -1
  424. package/dist/types/src/utils/messages.d.ts +7 -5
  425. package/dist/types/src/utils/messages.d.ts.map +1 -1
  426. package/dist/types/src/utils/protocols.d.ts +5 -0
  427. package/dist/types/src/utils/protocols.d.ts.map +1 -1
  428. package/dist/types/src/utils/records.d.ts +1 -11
  429. package/dist/types/src/utils/records.d.ts.map +1 -1
  430. package/dist/types/tests/dwn.spec.d.ts.map +1 -1
  431. package/dist/types/tests/event-emitter-event-log.spec.d.ts +2 -0
  432. package/dist/types/tests/event-emitter-event-log.spec.d.ts.map +1 -0
  433. package/dist/types/tests/features/author-delegated-grant.spec.d.ts.map +1 -1
  434. package/dist/types/tests/features/owner-delegated-grant.spec.d.ts.map +1 -1
  435. package/dist/types/tests/features/owner-signature.spec.d.ts.map +1 -1
  436. package/dist/types/tests/features/permissions.spec.d.ts.map +1 -1
  437. package/dist/types/tests/features/protocol-composition.spec.d.ts.map +1 -1
  438. package/dist/types/tests/features/records-immutable.spec.d.ts +2 -0
  439. package/dist/types/tests/features/records-immutable.spec.d.ts.map +1 -0
  440. package/dist/types/tests/features/records-record-limit.spec.d.ts +2 -0
  441. package/dist/types/tests/features/records-record-limit.spec.d.ts.map +1 -0
  442. package/dist/types/tests/features/records-tags.spec.d.ts.map +1 -1
  443. package/dist/types/tests/features/resumable-tasks.spec.d.ts.map +1 -1
  444. package/dist/types/tests/handlers/messages-read.spec.d.ts.map +1 -1
  445. package/dist/types/tests/handlers/messages-subscribe.spec.d.ts.map +1 -1
  446. package/dist/types/tests/handlers/messages-sync.spec.d.ts.map +1 -1
  447. package/dist/types/tests/handlers/records-count.spec.d.ts.map +1 -1
  448. package/dist/types/tests/handlers/records-delete.spec.d.ts.map +1 -1
  449. package/dist/types/tests/handlers/records-query.spec.d.ts.map +1 -1
  450. package/dist/types/tests/handlers/records-read.spec.d.ts.map +1 -1
  451. package/dist/types/tests/handlers/records-subscribe.spec.d.ts.map +1 -1
  452. package/dist/types/tests/handlers/records-write.spec.d.ts.map +1 -1
  453. package/dist/types/tests/scenarios/deleted-record.spec.d.ts.map +1 -1
  454. package/dist/types/tests/scenarios/subscriptions.spec.d.ts.map +1 -1
  455. package/dist/types/tests/test-event-stream.d.ts +11 -12
  456. package/dist/types/tests/test-event-stream.d.ts.map +1 -1
  457. package/dist/types/tests/test-suite.d.ts +2 -2
  458. package/dist/types/tests/test-suite.d.ts.map +1 -1
  459. package/dist/types/tests/utils/test-data-generator.d.ts +18 -0
  460. package/dist/types/tests/utils/test-data-generator.d.ts.map +1 -1
  461. package/package.json +5 -4
  462. package/src/core/constants.ts +11 -0
  463. package/src/core/core-protocol.ts +129 -0
  464. package/src/core/dwn-error.ts +15 -12
  465. package/src/core/grant-authorization.ts +20 -3
  466. package/src/core/protocol-authorization-action.ts +377 -0
  467. package/src/core/protocol-authorization-validation.ts +487 -0
  468. package/src/core/protocol-authorization.ts +111 -856
  469. package/src/core/record-chain.ts +99 -0
  470. package/src/core/records-grant-authorization.ts +6 -8
  471. package/src/dwn.ts +58 -73
  472. package/src/event-stream/event-emitter-event-log.ts +283 -0
  473. package/src/handlers/messages-read.ts +8 -9
  474. package/src/handlers/messages-subscribe.ts +24 -28
  475. package/src/handlers/messages-sync.ts +10 -16
  476. package/src/handlers/protocols-configure.ts +47 -32
  477. package/src/handlers/protocols-query.ts +6 -9
  478. package/src/handlers/records-count.ts +11 -10
  479. package/src/handlers/records-delete.ts +12 -21
  480. package/src/handlers/records-query.ts +12 -12
  481. package/src/handlers/records-read.ts +34 -22
  482. package/src/handlers/records-subscribe.ts +47 -26
  483. package/src/handlers/records-write.ts +47 -104
  484. package/src/index.ts +9 -5
  485. package/src/interfaces/messages-subscribe.ts +7 -1
  486. package/src/interfaces/protocols-configure.ts +73 -8
  487. package/src/interfaces/records-count.ts +1 -1
  488. package/src/interfaces/records-delete.ts +1 -1
  489. package/src/interfaces/records-query.ts +1 -1
  490. package/src/interfaces/records-read.ts +1 -1
  491. package/src/interfaces/records-subscribe.ts +8 -1
  492. package/src/interfaces/records-write-query.ts +139 -0
  493. package/src/interfaces/records-write-signing.ts +123 -0
  494. package/src/interfaces/records-write.ts +66 -261
  495. package/src/protocols/permission-grant.ts +1 -1
  496. package/src/protocols/permission-request.ts +1 -1
  497. package/src/protocols/permissions.ts +148 -6
  498. package/src/state-index/state-index-level.ts +5 -7
  499. package/src/store/data-store-level.ts +124 -34
  500. package/src/store/index-level-compound.ts +324 -0
  501. package/src/store/index-level.ts +68 -341
  502. package/src/store/storage-controller.ts +11 -11
  503. package/src/types/message-types.ts +3 -3
  504. package/src/types/messages-types.ts +12 -3
  505. package/src/types/method-handler.ts +26 -4
  506. package/src/types/mitt.d.ts +28 -0
  507. package/src/types/permission-types.ts +7 -0
  508. package/src/types/protocols-types.ts +46 -0
  509. package/src/types/records-types.ts +16 -6
  510. package/src/types/subscriptions.ts +178 -14
  511. package/src/utils/hd-key.ts +0 -9
  512. package/src/utils/messages.ts +17 -37
  513. package/src/utils/protocols.ts +8 -0
  514. package/src/utils/records.ts +8 -59
  515. package/dist/esm/src/event-stream/event-emitter-stream.js +0 -60
  516. package/dist/esm/src/event-stream/event-emitter-stream.js.map +0 -1
  517. package/dist/esm/tests/event-stream/event-emitter-stream.spec.js +0 -77
  518. package/dist/esm/tests/event-stream/event-emitter-stream.spec.js.map +0 -1
  519. package/dist/esm/tests/event-stream/event-stream.spec.js +0 -123
  520. package/dist/esm/tests/event-stream/event-stream.spec.js.map +0 -1
  521. package/dist/types/src/event-stream/event-emitter-stream.d.ts +0 -23
  522. package/dist/types/src/event-stream/event-emitter-stream.d.ts.map +0 -1
  523. package/dist/types/tests/event-stream/event-emitter-stream.spec.d.ts +0 -2
  524. package/dist/types/tests/event-stream/event-emitter-stream.spec.d.ts.map +0 -1
  525. package/dist/types/tests/event-stream/event-stream.spec.d.ts +0 -2
  526. package/dist/types/tests/event-stream/event-stream.spec.d.ts.map +0 -1
  527. package/src/event-stream/event-emitter-stream.ts +0 -69
@@ -1,4 +1,3 @@
1
- var _a;
2
1
  import func1Mod from "ajv/dist/runtime/ucs2length.js";
3
2
  "use strict";
4
3
  export const Authorization = validate20;
@@ -168,10 +167,10 @@ validate20.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": f
168
167
  export const AuthorizationDelegatedGrant = validate24;
169
168
  const schema37 = { "$id": "https://identity.foundation/dwn/json-schemas/authorization-delegated-grant.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "properties": { "signature": { "$ref": "https://identity.foundation/dwn/json-schemas/general-jws.json" }, "authorDelegatedGrant": { "$ref": "https://identity.foundation/dwn/json-schemas/records-write-data-encoded.json" } } };
170
169
  const schema38 = { "$id": "https://identity.foundation/dwn/json-schemas/records-write-data-encoded.json", "$ref": "https://identity.foundation/dwn/json-schemas/records-write-unidentified.json", "unevaluatedProperties": false, "type": "object", "required": ["recordId", "authorization", "encodedData"], "properties": { "encodedData": { "type": "string" } } };
171
- const schema39 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/records-write-unidentified.json", "type": "object", "required": ["descriptor"], "properties": { "recordId": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600, "pattern": "^[a-zA-Z0-9]+(/[a-zA-Z0-9]+)*$" }, "attestation": { "$ref": "https://identity.foundation/dwn/json-schemas/general-jws.json" }, "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization-owner.json" }, "encryption": { "type": "object", "properties": { "protected": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url" }, "iv": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url" }, "tag": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url" }, "recipients": { "type": "array", "minItems": 1, "items": { "type": "object", "properties": { "header": { "type": "object", "properties": { "kid": { "type": "string" }, "epk": { "$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json" }, "derivationScheme": { "type": "string", "enum": ["dataFormats", "protocolContext", "protocolPath", "schemas"] }, "derivedPublicKey": { "$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json" } }, "additionalProperties": false, "required": ["kid", "epk", "derivationScheme"] }, "encrypted_key": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url" } }, "additionalProperties": false, "required": ["header", "encrypted_key"] } } }, "additionalProperties": false, "required": ["protected", "iv", "tag", "recipients"] }, "descriptor": { "type": "object", "properties": { "interface": { "enum": ["Records"], "type": "string" }, "method": { "enum": ["Write"], "type": "string" }, "recipient": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did" }, "protocol": { "type": "string" }, "protocolPath": { "type": "string", "pattern": "^[a-zA-Z]+(/[a-zA-Z]+)*$" }, "schema": { "type": "string" }, "tags": { "type": "object", "minProperties": 1, "maxProperties": 10, "additionalProperties": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "number" } }] } }, "parentId": { "type": "string" }, "dataCid": { "type": "string" }, "dataSize": { "type": "number" }, "dateCreated": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "published": { "type": "boolean" }, "datePublished": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "dataFormat": { "type": "string" }, "permissionGrantId": { "type": "string" } }, "additionalProperties": false, "required": ["interface", "method", "dataCid", "dataSize", "dateCreated", "messageTimestamp", "dataFormat"], "dependencies": { "parentId": ["protocol"] }, "allOf": [{ "$comment": "rule defining `published` and `datePublished` relationship", "anyOf": [{ "properties": { "published": { "type": "boolean", "enum": [true] } }, "required": ["published", "datePublished"] }, { "properties": { "published": { "type": "boolean", "enum": [false] } }, "not": { "required": ["datePublished"] } }, { "allOf": [{ "not": { "required": ["published"] } }, { "not": { "required": ["datePublished"] } }] }] }] } }, "$comment": "rule defining `protocol` and `contextId` relationship", "anyOf": [{ "properties": { "descriptor": { "type": "object", "required": ["protocol", "protocolPath"] } }, "required": ["contextId"] }, { "allOf": [{ "not": { "required": ["contextId"] } }, { "properties": { "descriptor": { "type": "object", "not": { "required": ["protocol"] } } } }, { "properties": { "descriptor": { "type": "object", "not": { "required": ["protocolPath"] } } } }] }] };
170
+ const schema39 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/records-write-unidentified.json", "type": "object", "required": ["descriptor", "contextId"], "properties": { "recordId": { "type": "string" }, "contextId": { "type": "string", "maxLength": 600, "pattern": "^[a-zA-Z0-9]+(/[a-zA-Z0-9]+)*$" }, "attestation": { "$ref": "https://identity.foundation/dwn/json-schemas/general-jws.json" }, "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization-owner.json" }, "encryption": { "type": "object", "properties": { "protected": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url" }, "iv": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url" }, "tag": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url" }, "recipients": { "type": "array", "minItems": 1, "items": { "type": "object", "properties": { "header": { "type": "object", "properties": { "kid": { "type": "string" }, "epk": { "$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json" }, "derivationScheme": { "type": "string", "enum": ["protocolContext", "protocolPath"] }, "derivedPublicKey": { "$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json" } }, "additionalProperties": false, "required": ["kid", "epk", "derivationScheme"] }, "encrypted_key": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url" } }, "additionalProperties": false, "required": ["header", "encrypted_key"] } } }, "additionalProperties": false, "required": ["protected", "iv", "tag", "recipients"] }, "descriptor": { "type": "object", "properties": { "interface": { "enum": ["Records"], "type": "string" }, "method": { "enum": ["Write"], "type": "string" }, "recipient": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did" }, "protocol": { "type": "string" }, "protocolPath": { "type": "string", "pattern": "^[a-zA-Z]+(/[a-zA-Z]+)*$" }, "schema": { "type": "string" }, "tags": { "type": "object", "minProperties": 1, "maxProperties": 10, "additionalProperties": { "oneOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "string" } }, { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "number" } }] } }, "parentId": { "type": "string" }, "dataCid": { "type": "string" }, "dataSize": { "type": "number" }, "dateCreated": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "published": { "type": "boolean" }, "datePublished": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "dataFormat": { "type": "string" }, "permissionGrantId": { "type": "string" } }, "additionalProperties": false, "required": ["interface", "method", "protocol", "protocolPath", "dataCid", "dataSize", "dateCreated", "messageTimestamp", "dataFormat"], "dependencies": { "parentId": ["protocol"] }, "allOf": [{ "$comment": "rule defining `published` and `datePublished` relationship", "anyOf": [{ "properties": { "published": { "type": "boolean", "enum": [true] } }, "required": ["published", "datePublished"] }, { "properties": { "published": { "type": "boolean", "enum": [false] } }, "not": { "required": ["datePublished"] } }, { "allOf": [{ "not": { "required": ["published"] } }, { "not": { "required": ["datePublished"] } }] }] }] } } };
172
171
  const schema47 = { "type": "string", "pattern": "^did:([a-z0-9]+):((?:(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))*:)*((?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))+))((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$" };
173
172
  const schema48 = { "type": "string", "pattern": "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" };
174
- const func1 = (_a = func1Mod.default) !== null && _a !== void 0 ? _a : func1Mod;
173
+ const func1 = func1Mod.default ?? func1Mod;
175
174
  const func2 = Object.prototype.hasOwnProperty;
176
175
  const pattern7 = new RegExp("^[a-zA-Z0-9]+(/[a-zA-Z0-9]+)*$", "u");
177
176
  const pattern12 = new RegExp("^did:([a-z0-9]+):((?:(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))*:)*((?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))+))((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$", "u");
@@ -1435,282 +1434,37 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1435
1434
  if (evaluated0.dynamicItems) {
1436
1435
  evaluated0.items = undefined;
1437
1436
  }
1438
- const _errs2 = errors;
1439
- let valid0 = false;
1440
- const _errs3 = errors;
1441
- if (data && typeof data == "object" && !Array.isArray(data)) {
1442
- let missing0;
1443
- if ((data.contextId === undefined) && (missing0 = "contextId")) {
1444
- const err0 = { instancePath, schemaPath: "#/anyOf/0/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" };
1445
- if (vErrors === null) {
1446
- vErrors = [err0];
1447
- }
1448
- else {
1449
- vErrors.push(err0);
1450
- }
1451
- errors++;
1452
- }
1453
- else {
1454
- if (data.descriptor !== undefined) {
1455
- let data0 = data.descriptor;
1456
- const _errs4 = errors;
1457
- if (errors === _errs4) {
1458
- if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
1459
- let missing1;
1460
- if (((data0.protocol === undefined) && (missing1 = "protocol")) || ((data0.protocolPath === undefined) && (missing1 = "protocolPath"))) {
1461
- const err1 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/0/properties/descriptor/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" };
1462
- if (vErrors === null) {
1463
- vErrors = [err1];
1464
- }
1465
- else {
1466
- vErrors.push(err1);
1467
- }
1468
- errors++;
1469
- }
1470
- }
1471
- else {
1472
- const err2 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/0/properties/descriptor/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1473
- if (vErrors === null) {
1474
- vErrors = [err2];
1475
- }
1476
- else {
1477
- vErrors.push(err2);
1478
- }
1479
- errors++;
1480
- }
1481
- }
1482
- }
1483
- }
1484
- }
1485
- var _valid0 = _errs3 === errors;
1486
- valid0 = valid0 || _valid0;
1487
- if (_valid0) {
1488
- var props0 = {};
1489
- props0.descriptor = true;
1490
- }
1491
- const _errs6 = errors;
1492
- const _errs7 = errors;
1493
- const _errs8 = errors;
1494
- const _errs9 = errors;
1495
- if (data && typeof data == "object" && !Array.isArray(data)) {
1496
- let missing2;
1497
- if ((data.contextId === undefined) && (missing2 = "contextId")) {
1498
- const err3 = {};
1499
- if (vErrors === null) {
1500
- vErrors = [err3];
1501
- }
1502
- else {
1503
- vErrors.push(err3);
1504
- }
1505
- errors++;
1506
- }
1507
- }
1508
- var valid3 = _errs9 === errors;
1509
- if (valid3) {
1510
- const err4 = { instancePath, schemaPath: "#/anyOf/1/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
1511
- if (vErrors === null) {
1512
- vErrors = [err4];
1513
- }
1514
- else {
1515
- vErrors.push(err4);
1516
- }
1517
- errors++;
1518
- }
1519
- else {
1520
- errors = _errs8;
1521
- if (vErrors !== null) {
1522
- if (_errs8) {
1523
- vErrors.length = _errs8;
1524
- }
1525
- else {
1526
- vErrors = null;
1527
- }
1528
- }
1529
- }
1530
- var valid2 = _errs7 === errors;
1531
- if (valid2) {
1532
- const _errs10 = errors;
1533
- if (data && typeof data == "object" && !Array.isArray(data)) {
1534
- if (data.descriptor !== undefined) {
1535
- let data1 = data.descriptor;
1536
- if (!(data1 && typeof data1 == "object" && !Array.isArray(data1))) {
1537
- const err5 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/1/allOf/1/properties/descriptor/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1538
- if (vErrors === null) {
1539
- vErrors = [err5];
1540
- }
1541
- else {
1542
- vErrors.push(err5);
1543
- }
1544
- errors++;
1545
- }
1546
- const _errs13 = errors;
1547
- const _errs14 = errors;
1548
- if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
1549
- let missing3;
1550
- if ((data1.protocol === undefined) && (missing3 = "protocol")) {
1551
- const err6 = {};
1552
- if (vErrors === null) {
1553
- vErrors = [err6];
1554
- }
1555
- else {
1556
- vErrors.push(err6);
1557
- }
1558
- errors++;
1559
- }
1560
- }
1561
- var valid5 = _errs14 === errors;
1562
- if (valid5) {
1563
- const err7 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/1/allOf/1/properties/descriptor/not", keyword: "not", params: {}, message: "must NOT be valid" };
1564
- if (vErrors === null) {
1565
- vErrors = [err7];
1566
- }
1567
- else {
1568
- vErrors.push(err7);
1569
- }
1570
- errors++;
1571
- }
1572
- else {
1573
- errors = _errs13;
1574
- if (vErrors !== null) {
1575
- if (_errs13) {
1576
- vErrors.length = _errs13;
1577
- }
1578
- else {
1579
- vErrors = null;
1580
- }
1581
- }
1582
- }
1583
- }
1584
- }
1585
- var valid2 = _errs10 === errors;
1586
- if (valid2) {
1587
- const _errs15 = errors;
1588
- if (data && typeof data == "object" && !Array.isArray(data)) {
1589
- if (data.descriptor !== undefined) {
1590
- let data2 = data.descriptor;
1591
- if (!(data2 && typeof data2 == "object" && !Array.isArray(data2))) {
1592
- const err8 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/1/allOf/2/properties/descriptor/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1593
- if (vErrors === null) {
1594
- vErrors = [err8];
1595
- }
1596
- else {
1597
- vErrors.push(err8);
1598
- }
1599
- errors++;
1600
- }
1601
- const _errs18 = errors;
1602
- const _errs19 = errors;
1603
- if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
1604
- let missing4;
1605
- if ((data2.protocolPath === undefined) && (missing4 = "protocolPath")) {
1606
- const err9 = {};
1607
- if (vErrors === null) {
1608
- vErrors = [err9];
1609
- }
1610
- else {
1611
- vErrors.push(err9);
1612
- }
1613
- errors++;
1614
- }
1615
- }
1616
- var valid7 = _errs19 === errors;
1617
- if (valid7) {
1618
- const err10 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/1/allOf/2/properties/descriptor/not", keyword: "not", params: {}, message: "must NOT be valid" };
1619
- if (vErrors === null) {
1620
- vErrors = [err10];
1621
- }
1622
- else {
1623
- vErrors.push(err10);
1624
- }
1625
- errors++;
1626
- }
1627
- else {
1628
- errors = _errs18;
1629
- if (vErrors !== null) {
1630
- if (_errs18) {
1631
- vErrors.length = _errs18;
1632
- }
1633
- else {
1634
- vErrors = null;
1635
- }
1636
- }
1637
- }
1638
- }
1639
- }
1640
- var valid2 = _errs15 === errors;
1641
- }
1642
- }
1643
- var _valid0 = _errs6 === errors;
1644
- valid0 = valid0 || _valid0;
1645
- if (_valid0) {
1646
- if (props0 !== true) {
1647
- props0 = props0 || {};
1648
- props0.descriptor = true;
1649
- }
1650
- }
1651
- if (!valid0) {
1652
- const err11 = { instancePath, schemaPath: "#/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
1653
- if (vErrors === null) {
1654
- vErrors = [err11];
1655
- }
1656
- else {
1657
- vErrors.push(err11);
1658
- }
1659
- errors++;
1660
- validate27.errors = vErrors;
1661
- return false;
1662
- }
1663
- else {
1664
- errors = _errs2;
1665
- if (vErrors !== null) {
1666
- if (_errs2) {
1667
- vErrors.length = _errs2;
1668
- }
1669
- else {
1670
- vErrors = null;
1671
- }
1672
- }
1673
- }
1674
1437
  if (errors === 0) {
1675
1438
  if (data && typeof data == "object" && !Array.isArray(data)) {
1676
- let missing5;
1677
- if ((data.descriptor === undefined) && (missing5 = "descriptor")) {
1678
- validate27.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing5 }, message: "must have required property '" + missing5 + "'" }];
1439
+ let missing0;
1440
+ if (((data.descriptor === undefined) && (missing0 = "descriptor")) || ((data.contextId === undefined) && (missing0 = "contextId"))) {
1441
+ validate27.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
1679
1442
  return false;
1680
1443
  }
1681
1444
  else {
1682
- if (props0 !== true) {
1683
- props0 = props0 || {};
1684
- props0.recordId = true;
1685
- props0.contextId = true;
1686
- props0.attestation = true;
1687
- props0.authorization = true;
1688
- props0.encryption = true;
1689
- props0.descriptor = true;
1690
- }
1691
1445
  if (data.recordId !== undefined) {
1692
- const _errs20 = errors;
1446
+ const _errs1 = errors;
1693
1447
  if (typeof data.recordId !== "string") {
1694
1448
  validate27.errors = [{ instancePath: instancePath + "/recordId", schemaPath: "#/properties/recordId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1695
1449
  return false;
1696
1450
  }
1697
- var valid8 = _errs20 === errors;
1451
+ var valid0 = _errs1 === errors;
1698
1452
  }
1699
1453
  else {
1700
- var valid8 = true;
1454
+ var valid0 = true;
1701
1455
  }
1702
- if (valid8) {
1456
+ if (valid0) {
1703
1457
  if (data.contextId !== undefined) {
1704
- let data4 = data.contextId;
1705
- const _errs22 = errors;
1706
- if (errors === _errs22) {
1707
- if (typeof data4 === "string") {
1708
- if (func1(data4) > 600) {
1458
+ let data1 = data.contextId;
1459
+ const _errs3 = errors;
1460
+ if (errors === _errs3) {
1461
+ if (typeof data1 === "string") {
1462
+ if (func1(data1) > 600) {
1709
1463
  validate27.errors = [{ instancePath: instancePath + "/contextId", schemaPath: "#/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" }];
1710
1464
  return false;
1711
1465
  }
1712
1466
  else {
1713
- if (!pattern7.test(data4)) {
1467
+ if (!pattern7.test(data1)) {
1714
1468
  validate27.errors = [{ instancePath: instancePath + "/contextId", schemaPath: "#/properties/contextId/pattern", keyword: "pattern", params: { pattern: "^[a-zA-Z0-9]+(/[a-zA-Z0-9]+)*$" }, message: "must match pattern \"" + "^[a-zA-Z0-9]+(/[a-zA-Z0-9]+)*$" + "\"" }];
1715
1469
  return false;
1716
1470
  }
@@ -1721,63 +1475,63 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1721
1475
  return false;
1722
1476
  }
1723
1477
  }
1724
- var valid8 = _errs22 === errors;
1478
+ var valid0 = _errs3 === errors;
1725
1479
  }
1726
1480
  else {
1727
- var valid8 = true;
1481
+ var valid0 = true;
1728
1482
  }
1729
- if (valid8) {
1483
+ if (valid0) {
1730
1484
  if (data.attestation !== undefined) {
1731
- const _errs24 = errors;
1485
+ const _errs5 = errors;
1732
1486
  if (!(validate21(data.attestation, { instancePath: instancePath + "/attestation", parentData: data, parentDataProperty: "attestation", rootData, dynamicAnchors }))) {
1733
1487
  vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);
1734
1488
  errors = vErrors.length;
1735
1489
  }
1736
- var valid8 = _errs24 === errors;
1490
+ var valid0 = _errs5 === errors;
1737
1491
  }
1738
1492
  else {
1739
- var valid8 = true;
1493
+ var valid0 = true;
1740
1494
  }
1741
- if (valid8) {
1495
+ if (valid0) {
1742
1496
  if (data.authorization !== undefined) {
1743
- const _errs25 = errors;
1497
+ const _errs6 = errors;
1744
1498
  if (!(validate29(data.authorization, { instancePath: instancePath + "/authorization", parentData: data, parentDataProperty: "authorization", rootData, dynamicAnchors }))) {
1745
1499
  vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);
1746
1500
  errors = vErrors.length;
1747
1501
  }
1748
- var valid8 = _errs25 === errors;
1502
+ var valid0 = _errs6 === errors;
1749
1503
  }
1750
1504
  else {
1751
- var valid8 = true;
1505
+ var valid0 = true;
1752
1506
  }
1753
- if (valid8) {
1507
+ if (valid0) {
1754
1508
  if (data.encryption !== undefined) {
1755
- let data7 = data.encryption;
1756
- const _errs26 = errors;
1757
- if (errors === _errs26) {
1758
- if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
1759
- let missing6;
1760
- if (((((data7.protected === undefined) && (missing6 = "protected")) || ((data7.iv === undefined) && (missing6 = "iv"))) || ((data7.tag === undefined) && (missing6 = "tag"))) || ((data7.recipients === undefined) && (missing6 = "recipients"))) {
1761
- validate27.errors = [{ instancePath: instancePath + "/encryption", schemaPath: "#/properties/encryption/required", keyword: "required", params: { missingProperty: missing6 }, message: "must have required property '" + missing6 + "'" }];
1509
+ let data4 = data.encryption;
1510
+ const _errs7 = errors;
1511
+ if (errors === _errs7) {
1512
+ if (data4 && typeof data4 == "object" && !Array.isArray(data4)) {
1513
+ let missing1;
1514
+ if (((((data4.protected === undefined) && (missing1 = "protected")) || ((data4.iv === undefined) && (missing1 = "iv"))) || ((data4.tag === undefined) && (missing1 = "tag"))) || ((data4.recipients === undefined) && (missing1 = "recipients"))) {
1515
+ validate27.errors = [{ instancePath: instancePath + "/encryption", schemaPath: "#/properties/encryption/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
1762
1516
  return false;
1763
1517
  }
1764
1518
  else {
1765
- const _errs28 = errors;
1766
- for (const key0 in data7) {
1519
+ const _errs9 = errors;
1520
+ for (const key0 in data4) {
1767
1521
  if (!((((key0 === "protected") || (key0 === "iv")) || (key0 === "tag")) || (key0 === "recipients"))) {
1768
1522
  validate27.errors = [{ instancePath: instancePath + "/encryption", schemaPath: "#/properties/encryption/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
1769
1523
  return false;
1770
1524
  break;
1771
1525
  }
1772
1526
  }
1773
- if (_errs28 === errors) {
1774
- if (data7.protected !== undefined) {
1775
- let data8 = data7.protected;
1776
- const _errs29 = errors;
1777
- const _errs30 = errors;
1778
- if (errors === _errs30) {
1779
- if (typeof data8 === "string") {
1780
- if (!pattern4.test(data8)) {
1527
+ if (_errs9 === errors) {
1528
+ if (data4.protected !== undefined) {
1529
+ let data5 = data4.protected;
1530
+ const _errs10 = errors;
1531
+ const _errs11 = errors;
1532
+ if (errors === _errs11) {
1533
+ if (typeof data5 === "string") {
1534
+ if (!pattern4.test(data5)) {
1781
1535
  validate27.errors = [{ instancePath: instancePath + "/encryption/protected", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: "must match pattern \"" + "^[A-Za-z0-9_-]+$" + "\"" }];
1782
1536
  return false;
1783
1537
  }
@@ -1787,19 +1541,19 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1787
1541
  return false;
1788
1542
  }
1789
1543
  }
1790
- var valid9 = _errs29 === errors;
1544
+ var valid1 = _errs10 === errors;
1791
1545
  }
1792
1546
  else {
1793
- var valid9 = true;
1547
+ var valid1 = true;
1794
1548
  }
1795
- if (valid9) {
1796
- if (data7.iv !== undefined) {
1797
- let data9 = data7.iv;
1798
- const _errs32 = errors;
1799
- const _errs33 = errors;
1800
- if (errors === _errs33) {
1801
- if (typeof data9 === "string") {
1802
- if (!pattern4.test(data9)) {
1549
+ if (valid1) {
1550
+ if (data4.iv !== undefined) {
1551
+ let data6 = data4.iv;
1552
+ const _errs13 = errors;
1553
+ const _errs14 = errors;
1554
+ if (errors === _errs14) {
1555
+ if (typeof data6 === "string") {
1556
+ if (!pattern4.test(data6)) {
1803
1557
  validate27.errors = [{ instancePath: instancePath + "/encryption/iv", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: "must match pattern \"" + "^[A-Za-z0-9_-]+$" + "\"" }];
1804
1558
  return false;
1805
1559
  }
@@ -1809,19 +1563,19 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1809
1563
  return false;
1810
1564
  }
1811
1565
  }
1812
- var valid9 = _errs32 === errors;
1566
+ var valid1 = _errs13 === errors;
1813
1567
  }
1814
1568
  else {
1815
- var valid9 = true;
1569
+ var valid1 = true;
1816
1570
  }
1817
- if (valid9) {
1818
- if (data7.tag !== undefined) {
1819
- let data10 = data7.tag;
1820
- const _errs35 = errors;
1821
- const _errs36 = errors;
1822
- if (errors === _errs36) {
1823
- if (typeof data10 === "string") {
1824
- if (!pattern4.test(data10)) {
1571
+ if (valid1) {
1572
+ if (data4.tag !== undefined) {
1573
+ let data7 = data4.tag;
1574
+ const _errs16 = errors;
1575
+ const _errs17 = errors;
1576
+ if (errors === _errs17) {
1577
+ if (typeof data7 === "string") {
1578
+ if (!pattern4.test(data7)) {
1825
1579
  validate27.errors = [{ instancePath: instancePath + "/encryption/tag", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: "must match pattern \"" + "^[A-Za-z0-9_-]+$" + "\"" }];
1826
1580
  return false;
1827
1581
  }
@@ -1831,115 +1585,115 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1831
1585
  return false;
1832
1586
  }
1833
1587
  }
1834
- var valid9 = _errs35 === errors;
1588
+ var valid1 = _errs16 === errors;
1835
1589
  }
1836
1590
  else {
1837
- var valid9 = true;
1838
- }
1839
- if (valid9) {
1840
- if (data7.recipients !== undefined) {
1841
- let data11 = data7.recipients;
1842
- const _errs38 = errors;
1843
- if (errors === _errs38) {
1844
- if (Array.isArray(data11)) {
1845
- if (data11.length < 1) {
1591
+ var valid1 = true;
1592
+ }
1593
+ if (valid1) {
1594
+ if (data4.recipients !== undefined) {
1595
+ let data8 = data4.recipients;
1596
+ const _errs19 = errors;
1597
+ if (errors === _errs19) {
1598
+ if (Array.isArray(data8)) {
1599
+ if (data8.length < 1) {
1846
1600
  validate27.errors = [{ instancePath: instancePath + "/encryption/recipients", schemaPath: "#/properties/encryption/properties/recipients/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" }];
1847
1601
  return false;
1848
1602
  }
1849
1603
  else {
1850
- var valid13 = true;
1851
- const len0 = data11.length;
1604
+ var valid5 = true;
1605
+ const len0 = data8.length;
1852
1606
  for (let i0 = 0; i0 < len0; i0++) {
1853
- let data12 = data11[i0];
1854
- const _errs40 = errors;
1855
- if (errors === _errs40) {
1856
- if (data12 && typeof data12 == "object" && !Array.isArray(data12)) {
1857
- let missing7;
1858
- if (((data12.header === undefined) && (missing7 = "header")) || ((data12.encrypted_key === undefined) && (missing7 = "encrypted_key"))) {
1859
- validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0, schemaPath: "#/properties/encryption/properties/recipients/items/required", keyword: "required", params: { missingProperty: missing7 }, message: "must have required property '" + missing7 + "'" }];
1607
+ let data9 = data8[i0];
1608
+ const _errs21 = errors;
1609
+ if (errors === _errs21) {
1610
+ if (data9 && typeof data9 == "object" && !Array.isArray(data9)) {
1611
+ let missing2;
1612
+ if (((data9.header === undefined) && (missing2 = "header")) || ((data9.encrypted_key === undefined) && (missing2 = "encrypted_key"))) {
1613
+ validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0, schemaPath: "#/properties/encryption/properties/recipients/items/required", keyword: "required", params: { missingProperty: missing2 }, message: "must have required property '" + missing2 + "'" }];
1860
1614
  return false;
1861
1615
  }
1862
1616
  else {
1863
- const _errs42 = errors;
1864
- for (const key1 in data12) {
1617
+ const _errs23 = errors;
1618
+ for (const key1 in data9) {
1865
1619
  if (!((key1 === "header") || (key1 === "encrypted_key"))) {
1866
1620
  validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0, schemaPath: "#/properties/encryption/properties/recipients/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
1867
1621
  return false;
1868
1622
  break;
1869
1623
  }
1870
1624
  }
1871
- if (_errs42 === errors) {
1872
- if (data12.header !== undefined) {
1873
- let data13 = data12.header;
1874
- const _errs43 = errors;
1875
- if (errors === _errs43) {
1876
- if (data13 && typeof data13 == "object" && !Array.isArray(data13)) {
1877
- let missing8;
1878
- if ((((data13.kid === undefined) && (missing8 = "kid")) || ((data13.epk === undefined) && (missing8 = "epk"))) || ((data13.derivationScheme === undefined) && (missing8 = "derivationScheme"))) {
1879
- validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0 + "/header", schemaPath: "#/properties/encryption/properties/recipients/items/properties/header/required", keyword: "required", params: { missingProperty: missing8 }, message: "must have required property '" + missing8 + "'" }];
1625
+ if (_errs23 === errors) {
1626
+ if (data9.header !== undefined) {
1627
+ let data10 = data9.header;
1628
+ const _errs24 = errors;
1629
+ if (errors === _errs24) {
1630
+ if (data10 && typeof data10 == "object" && !Array.isArray(data10)) {
1631
+ let missing3;
1632
+ if ((((data10.kid === undefined) && (missing3 = "kid")) || ((data10.epk === undefined) && (missing3 = "epk"))) || ((data10.derivationScheme === undefined) && (missing3 = "derivationScheme"))) {
1633
+ validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0 + "/header", schemaPath: "#/properties/encryption/properties/recipients/items/properties/header/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" }];
1880
1634
  return false;
1881
1635
  }
1882
1636
  else {
1883
- const _errs45 = errors;
1884
- for (const key2 in data13) {
1637
+ const _errs26 = errors;
1638
+ for (const key2 in data10) {
1885
1639
  if (!((((key2 === "kid") || (key2 === "epk")) || (key2 === "derivationScheme")) || (key2 === "derivedPublicKey"))) {
1886
1640
  validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0 + "/header", schemaPath: "#/properties/encryption/properties/recipients/items/properties/header/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" }];
1887
1641
  return false;
1888
1642
  break;
1889
1643
  }
1890
1644
  }
1891
- if (_errs45 === errors) {
1892
- if (data13.kid !== undefined) {
1893
- const _errs46 = errors;
1894
- if (typeof data13.kid !== "string") {
1645
+ if (_errs26 === errors) {
1646
+ if (data10.kid !== undefined) {
1647
+ const _errs27 = errors;
1648
+ if (typeof data10.kid !== "string") {
1895
1649
  validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0 + "/header/kid", schemaPath: "#/properties/encryption/properties/recipients/items/properties/header/properties/kid/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1896
1650
  return false;
1897
1651
  }
1898
- var valid15 = _errs46 === errors;
1652
+ var valid7 = _errs27 === errors;
1899
1653
  }
1900
1654
  else {
1901
- var valid15 = true;
1655
+ var valid7 = true;
1902
1656
  }
1903
- if (valid15) {
1904
- if (data13.epk !== undefined) {
1905
- const _errs48 = errors;
1906
- if (!(validate32(data13.epk, { instancePath: instancePath + "/encryption/recipients/" + i0 + "/header/epk", parentData: data13, parentDataProperty: "epk", rootData, dynamicAnchors }))) {
1657
+ if (valid7) {
1658
+ if (data10.epk !== undefined) {
1659
+ const _errs29 = errors;
1660
+ if (!(validate32(data10.epk, { instancePath: instancePath + "/encryption/recipients/" + i0 + "/header/epk", parentData: data10, parentDataProperty: "epk", rootData, dynamicAnchors }))) {
1907
1661
  vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
1908
1662
  errors = vErrors.length;
1909
1663
  }
1910
- var valid15 = _errs48 === errors;
1664
+ var valid7 = _errs29 === errors;
1911
1665
  }
1912
1666
  else {
1913
- var valid15 = true;
1667
+ var valid7 = true;
1914
1668
  }
1915
- if (valid15) {
1916
- if (data13.derivationScheme !== undefined) {
1917
- let data16 = data13.derivationScheme;
1918
- const _errs49 = errors;
1919
- if (typeof data16 !== "string") {
1669
+ if (valid7) {
1670
+ if (data10.derivationScheme !== undefined) {
1671
+ let data13 = data10.derivationScheme;
1672
+ const _errs30 = errors;
1673
+ if (typeof data13 !== "string") {
1920
1674
  validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0 + "/header/derivationScheme", schemaPath: "#/properties/encryption/properties/recipients/items/properties/header/properties/derivationScheme/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1921
1675
  return false;
1922
1676
  }
1923
- if (!((((data16 === "dataFormats") || (data16 === "protocolContext")) || (data16 === "protocolPath")) || (data16 === "schemas"))) {
1677
+ if (!((data13 === "protocolContext") || (data13 === "protocolPath"))) {
1924
1678
  validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0 + "/header/derivationScheme", schemaPath: "#/properties/encryption/properties/recipients/items/properties/header/properties/derivationScheme/enum", keyword: "enum", params: { allowedValues: schema39.properties.encryption.properties.recipients.items.properties.header.properties.derivationScheme.enum }, message: "must be equal to one of the allowed values" }];
1925
1679
  return false;
1926
1680
  }
1927
- var valid15 = _errs49 === errors;
1681
+ var valid7 = _errs30 === errors;
1928
1682
  }
1929
1683
  else {
1930
- var valid15 = true;
1684
+ var valid7 = true;
1931
1685
  }
1932
- if (valid15) {
1933
- if (data13.derivedPublicKey !== undefined) {
1934
- const _errs51 = errors;
1935
- if (!(validate32(data13.derivedPublicKey, { instancePath: instancePath + "/encryption/recipients/" + i0 + "/header/derivedPublicKey", parentData: data13, parentDataProperty: "derivedPublicKey", rootData, dynamicAnchors }))) {
1686
+ if (valid7) {
1687
+ if (data10.derivedPublicKey !== undefined) {
1688
+ const _errs32 = errors;
1689
+ if (!(validate32(data10.derivedPublicKey, { instancePath: instancePath + "/encryption/recipients/" + i0 + "/header/derivedPublicKey", parentData: data10, parentDataProperty: "derivedPublicKey", rootData, dynamicAnchors }))) {
1936
1690
  vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
1937
1691
  errors = vErrors.length;
1938
1692
  }
1939
- var valid15 = _errs51 === errors;
1693
+ var valid7 = _errs32 === errors;
1940
1694
  }
1941
1695
  else {
1942
- var valid15 = true;
1696
+ var valid7 = true;
1943
1697
  }
1944
1698
  }
1945
1699
  }
@@ -1952,19 +1706,19 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1952
1706
  return false;
1953
1707
  }
1954
1708
  }
1955
- var valid14 = _errs43 === errors;
1709
+ var valid6 = _errs24 === errors;
1956
1710
  }
1957
1711
  else {
1958
- var valid14 = true;
1712
+ var valid6 = true;
1959
1713
  }
1960
- if (valid14) {
1961
- if (data12.encrypted_key !== undefined) {
1962
- let data18 = data12.encrypted_key;
1963
- const _errs52 = errors;
1964
- const _errs53 = errors;
1965
- if (errors === _errs53) {
1966
- if (typeof data18 === "string") {
1967
- if (!pattern4.test(data18)) {
1714
+ if (valid6) {
1715
+ if (data9.encrypted_key !== undefined) {
1716
+ let data15 = data9.encrypted_key;
1717
+ const _errs33 = errors;
1718
+ const _errs34 = errors;
1719
+ if (errors === _errs34) {
1720
+ if (typeof data15 === "string") {
1721
+ if (!pattern4.test(data15)) {
1968
1722
  validate27.errors = [{ instancePath: instancePath + "/encryption/recipients/" + i0 + "/encrypted_key", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/base64url/pattern", keyword: "pattern", params: { pattern: "^[A-Za-z0-9_-]+$" }, message: "must match pattern \"" + "^[A-Za-z0-9_-]+$" + "\"" }];
1969
1723
  return false;
1970
1724
  }
@@ -1974,10 +1728,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1974
1728
  return false;
1975
1729
  }
1976
1730
  }
1977
- var valid14 = _errs52 === errors;
1731
+ var valid6 = _errs33 === errors;
1978
1732
  }
1979
1733
  else {
1980
- var valid14 = true;
1734
+ var valid6 = true;
1981
1735
  }
1982
1736
  }
1983
1737
  }
@@ -1988,8 +1742,8 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1988
1742
  return false;
1989
1743
  }
1990
1744
  }
1991
- var valid13 = _errs40 === errors;
1992
- if (!valid13) {
1745
+ var valid5 = _errs21 === errors;
1746
+ if (!valid5) {
1993
1747
  break;
1994
1748
  }
1995
1749
  }
@@ -2000,10 +1754,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2000
1754
  return false;
2001
1755
  }
2002
1756
  }
2003
- var valid9 = _errs38 === errors;
1757
+ var valid1 = _errs19 === errors;
2004
1758
  }
2005
1759
  else {
2006
- var valid9 = true;
1760
+ var valid1 = true;
2007
1761
  }
2008
1762
  }
2009
1763
  }
@@ -2016,308 +1770,308 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2016
1770
  return false;
2017
1771
  }
2018
1772
  }
2019
- var valid8 = _errs26 === errors;
1773
+ var valid0 = _errs7 === errors;
2020
1774
  }
2021
1775
  else {
2022
- var valid8 = true;
1776
+ var valid0 = true;
2023
1777
  }
2024
- if (valid8) {
1778
+ if (valid0) {
2025
1779
  if (data.descriptor !== undefined) {
2026
- let data19 = data.descriptor;
2027
- const _errs55 = errors;
2028
- const _errs59 = errors;
2029
- let valid18 = false;
2030
- const _errs60 = errors;
2031
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2032
- let missing9;
2033
- if (((data19.published === undefined) && (missing9 = "published")) || ((data19.datePublished === undefined) && (missing9 = "datePublished"))) {
2034
- const err12 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf/0/required", keyword: "required", params: { missingProperty: missing9 }, message: "must have required property '" + missing9 + "'" };
1780
+ let data16 = data.descriptor;
1781
+ const _errs36 = errors;
1782
+ const _errs40 = errors;
1783
+ let valid10 = false;
1784
+ const _errs41 = errors;
1785
+ if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
1786
+ let missing4;
1787
+ if (((data16.published === undefined) && (missing4 = "published")) || ((data16.datePublished === undefined) && (missing4 = "datePublished"))) {
1788
+ const err0 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf/0/required", keyword: "required", params: { missingProperty: missing4 }, message: "must have required property '" + missing4 + "'" };
2035
1789
  if (vErrors === null) {
2036
- vErrors = [err12];
1790
+ vErrors = [err0];
2037
1791
  }
2038
1792
  else {
2039
- vErrors.push(err12);
1793
+ vErrors.push(err0);
2040
1794
  }
2041
1795
  errors++;
2042
1796
  }
2043
1797
  else {
2044
- if (data19.published !== undefined) {
2045
- let data20 = data19.published;
2046
- if (typeof data20 !== "boolean") {
2047
- const err13 = { instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/allOf/0/anyOf/0/properties/published/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
1798
+ if (data16.published !== undefined) {
1799
+ let data17 = data16.published;
1800
+ if (typeof data17 !== "boolean") {
1801
+ const err1 = { instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/allOf/0/anyOf/0/properties/published/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
2048
1802
  if (vErrors === null) {
2049
- vErrors = [err13];
1803
+ vErrors = [err1];
2050
1804
  }
2051
1805
  else {
2052
- vErrors.push(err13);
1806
+ vErrors.push(err1);
2053
1807
  }
2054
1808
  errors++;
2055
1809
  }
2056
- if (!(data20 === true)) {
2057
- const err14 = { instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/allOf/0/anyOf/0/properties/published/enum", keyword: "enum", params: { allowedValues: schema39.properties.descriptor.allOf[0].anyOf[0].properties.published.enum }, message: "must be equal to one of the allowed values" };
1810
+ if (!(data17 === true)) {
1811
+ const err2 = { instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/allOf/0/anyOf/0/properties/published/enum", keyword: "enum", params: { allowedValues: schema39.properties.descriptor.allOf[0].anyOf[0].properties.published.enum }, message: "must be equal to one of the allowed values" };
2058
1812
  if (vErrors === null) {
2059
- vErrors = [err14];
1813
+ vErrors = [err2];
2060
1814
  }
2061
1815
  else {
2062
- vErrors.push(err14);
1816
+ vErrors.push(err2);
2063
1817
  }
2064
1818
  errors++;
2065
1819
  }
2066
1820
  }
2067
1821
  }
2068
1822
  }
2069
- var _valid1 = _errs60 === errors;
2070
- valid18 = valid18 || _valid1;
2071
- if (_valid1) {
2072
- var props3 = {};
2073
- props3.published = true;
1823
+ var _valid0 = _errs41 === errors;
1824
+ valid10 = valid10 || _valid0;
1825
+ if (_valid0) {
1826
+ var props2 = {};
1827
+ props2.published = true;
2074
1828
  }
2075
- const _errs63 = errors;
2076
- const _errs64 = errors;
2077
- const _errs65 = errors;
2078
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2079
- let missing10;
2080
- if ((data19.datePublished === undefined) && (missing10 = "datePublished")) {
2081
- const err15 = {};
1829
+ const _errs44 = errors;
1830
+ const _errs45 = errors;
1831
+ const _errs46 = errors;
1832
+ if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
1833
+ let missing5;
1834
+ if ((data16.datePublished === undefined) && (missing5 = "datePublished")) {
1835
+ const err3 = {};
2082
1836
  if (vErrors === null) {
2083
- vErrors = [err15];
1837
+ vErrors = [err3];
2084
1838
  }
2085
1839
  else {
2086
- vErrors.push(err15);
1840
+ vErrors.push(err3);
2087
1841
  }
2088
1842
  errors++;
2089
1843
  }
2090
1844
  }
2091
- var valid20 = _errs65 === errors;
2092
- if (valid20) {
2093
- const err16 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf/1/not", keyword: "not", params: {}, message: "must NOT be valid" };
1845
+ var valid12 = _errs46 === errors;
1846
+ if (valid12) {
1847
+ const err4 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf/1/not", keyword: "not", params: {}, message: "must NOT be valid" };
2094
1848
  if (vErrors === null) {
2095
- vErrors = [err16];
1849
+ vErrors = [err4];
2096
1850
  }
2097
1851
  else {
2098
- vErrors.push(err16);
1852
+ vErrors.push(err4);
2099
1853
  }
2100
1854
  errors++;
2101
1855
  }
2102
1856
  else {
2103
- errors = _errs64;
1857
+ errors = _errs45;
2104
1858
  if (vErrors !== null) {
2105
- if (_errs64) {
2106
- vErrors.length = _errs64;
1859
+ if (_errs45) {
1860
+ vErrors.length = _errs45;
2107
1861
  }
2108
1862
  else {
2109
1863
  vErrors = null;
2110
1864
  }
2111
1865
  }
2112
1866
  }
2113
- if (errors === _errs63) {
2114
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2115
- if (data19.published !== undefined) {
2116
- let data21 = data19.published;
2117
- if (typeof data21 !== "boolean") {
2118
- const err17 = { instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/allOf/0/anyOf/1/properties/published/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
1867
+ if (errors === _errs44) {
1868
+ if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
1869
+ if (data16.published !== undefined) {
1870
+ let data18 = data16.published;
1871
+ if (typeof data18 !== "boolean") {
1872
+ const err5 = { instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/allOf/0/anyOf/1/properties/published/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
2119
1873
  if (vErrors === null) {
2120
- vErrors = [err17];
1874
+ vErrors = [err5];
2121
1875
  }
2122
1876
  else {
2123
- vErrors.push(err17);
1877
+ vErrors.push(err5);
2124
1878
  }
2125
1879
  errors++;
2126
1880
  }
2127
- if (!(data21 === false)) {
2128
- const err18 = { instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/allOf/0/anyOf/1/properties/published/enum", keyword: "enum", params: { allowedValues: schema39.properties.descriptor.allOf[0].anyOf[1].properties.published.enum }, message: "must be equal to one of the allowed values" };
1881
+ if (!(data18 === false)) {
1882
+ const err6 = { instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/allOf/0/anyOf/1/properties/published/enum", keyword: "enum", params: { allowedValues: schema39.properties.descriptor.allOf[0].anyOf[1].properties.published.enum }, message: "must be equal to one of the allowed values" };
2129
1883
  if (vErrors === null) {
2130
- vErrors = [err18];
1884
+ vErrors = [err6];
2131
1885
  }
2132
1886
  else {
2133
- vErrors.push(err18);
1887
+ vErrors.push(err6);
2134
1888
  }
2135
1889
  errors++;
2136
1890
  }
2137
1891
  }
2138
1892
  }
2139
1893
  }
2140
- var _valid1 = _errs63 === errors;
2141
- valid18 = valid18 || _valid1;
2142
- if (_valid1) {
2143
- if (props3 !== true) {
2144
- props3 = props3 || {};
2145
- props3.published = true;
1894
+ var _valid0 = _errs44 === errors;
1895
+ valid10 = valid10 || _valid0;
1896
+ if (_valid0) {
1897
+ if (props2 !== true) {
1898
+ props2 = props2 || {};
1899
+ props2.published = true;
2146
1900
  }
2147
1901
  }
2148
- const _errs68 = errors;
2149
- const _errs69 = errors;
2150
- const _errs70 = errors;
2151
- const _errs71 = errors;
2152
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2153
- let missing11;
2154
- if ((data19.published === undefined) && (missing11 = "published")) {
2155
- const err19 = {};
1902
+ const _errs49 = errors;
1903
+ const _errs50 = errors;
1904
+ const _errs51 = errors;
1905
+ const _errs52 = errors;
1906
+ if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
1907
+ let missing6;
1908
+ if ((data16.published === undefined) && (missing6 = "published")) {
1909
+ const err7 = {};
2156
1910
  if (vErrors === null) {
2157
- vErrors = [err19];
1911
+ vErrors = [err7];
2158
1912
  }
2159
1913
  else {
2160
- vErrors.push(err19);
1914
+ vErrors.push(err7);
2161
1915
  }
2162
1916
  errors++;
2163
1917
  }
2164
1918
  }
2165
- var valid23 = _errs71 === errors;
2166
- if (valid23) {
2167
- const err20 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf/2/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
1919
+ var valid15 = _errs52 === errors;
1920
+ if (valid15) {
1921
+ const err8 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf/2/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
2168
1922
  if (vErrors === null) {
2169
- vErrors = [err20];
1923
+ vErrors = [err8];
2170
1924
  }
2171
1925
  else {
2172
- vErrors.push(err20);
1926
+ vErrors.push(err8);
2173
1927
  }
2174
1928
  errors++;
2175
1929
  }
2176
1930
  else {
2177
- errors = _errs70;
1931
+ errors = _errs51;
2178
1932
  if (vErrors !== null) {
2179
- if (_errs70) {
2180
- vErrors.length = _errs70;
1933
+ if (_errs51) {
1934
+ vErrors.length = _errs51;
2181
1935
  }
2182
1936
  else {
2183
1937
  vErrors = null;
2184
1938
  }
2185
1939
  }
2186
1940
  }
2187
- var valid22 = _errs69 === errors;
2188
- if (valid22) {
2189
- const _errs72 = errors;
2190
- const _errs73 = errors;
2191
- const _errs74 = errors;
2192
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2193
- let missing12;
2194
- if ((data19.datePublished === undefined) && (missing12 = "datePublished")) {
2195
- const err21 = {};
1941
+ var valid14 = _errs50 === errors;
1942
+ if (valid14) {
1943
+ const _errs53 = errors;
1944
+ const _errs54 = errors;
1945
+ const _errs55 = errors;
1946
+ if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
1947
+ let missing7;
1948
+ if ((data16.datePublished === undefined) && (missing7 = "datePublished")) {
1949
+ const err9 = {};
2196
1950
  if (vErrors === null) {
2197
- vErrors = [err21];
1951
+ vErrors = [err9];
2198
1952
  }
2199
1953
  else {
2200
- vErrors.push(err21);
1954
+ vErrors.push(err9);
2201
1955
  }
2202
1956
  errors++;
2203
1957
  }
2204
1958
  }
2205
- var valid24 = _errs74 === errors;
2206
- if (valid24) {
2207
- const err22 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf/2/allOf/1/not", keyword: "not", params: {}, message: "must NOT be valid" };
1959
+ var valid16 = _errs55 === errors;
1960
+ if (valid16) {
1961
+ const err10 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf/2/allOf/1/not", keyword: "not", params: {}, message: "must NOT be valid" };
2208
1962
  if (vErrors === null) {
2209
- vErrors = [err22];
1963
+ vErrors = [err10];
2210
1964
  }
2211
1965
  else {
2212
- vErrors.push(err22);
1966
+ vErrors.push(err10);
2213
1967
  }
2214
1968
  errors++;
2215
1969
  }
2216
1970
  else {
2217
- errors = _errs73;
1971
+ errors = _errs54;
2218
1972
  if (vErrors !== null) {
2219
- if (_errs73) {
2220
- vErrors.length = _errs73;
1973
+ if (_errs54) {
1974
+ vErrors.length = _errs54;
2221
1975
  }
2222
1976
  else {
2223
1977
  vErrors = null;
2224
1978
  }
2225
1979
  }
2226
1980
  }
2227
- var valid22 = _errs72 === errors;
1981
+ var valid14 = _errs53 === errors;
2228
1982
  }
2229
- var _valid1 = _errs68 === errors;
2230
- valid18 = valid18 || _valid1;
2231
- if (!valid18) {
2232
- const err23 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
1983
+ var _valid0 = _errs49 === errors;
1984
+ valid10 = valid10 || _valid0;
1985
+ if (!valid10) {
1986
+ const err11 = { instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/allOf/0/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
2233
1987
  if (vErrors === null) {
2234
- vErrors = [err23];
1988
+ vErrors = [err11];
2235
1989
  }
2236
1990
  else {
2237
- vErrors.push(err23);
1991
+ vErrors.push(err11);
2238
1992
  }
2239
1993
  errors++;
2240
1994
  validate27.errors = vErrors;
2241
1995
  return false;
2242
1996
  }
2243
1997
  else {
2244
- errors = _errs59;
1998
+ errors = _errs40;
2245
1999
  if (vErrors !== null) {
2246
- if (_errs59) {
2247
- vErrors.length = _errs59;
2000
+ if (_errs40) {
2001
+ vErrors.length = _errs40;
2248
2002
  }
2249
2003
  else {
2250
2004
  vErrors = null;
2251
2005
  }
2252
2006
  }
2253
2007
  }
2254
- if (errors === _errs55) {
2255
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2256
- let missing13;
2257
- if ((((((((data19.interface === undefined) && (missing13 = "interface")) || ((data19.method === undefined) && (missing13 = "method"))) || ((data19.dataCid === undefined) && (missing13 = "dataCid"))) || ((data19.dataSize === undefined) && (missing13 = "dataSize"))) || ((data19.dateCreated === undefined) && (missing13 = "dateCreated"))) || ((data19.messageTimestamp === undefined) && (missing13 = "messageTimestamp"))) || ((data19.dataFormat === undefined) && (missing13 = "dataFormat"))) {
2258
- validate27.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/required", keyword: "required", params: { missingProperty: missing13 }, message: "must have required property '" + missing13 + "'" }];
2008
+ if (errors === _errs36) {
2009
+ if (data16 && typeof data16 == "object" && !Array.isArray(data16)) {
2010
+ let missing8;
2011
+ if ((((((((((data16.interface === undefined) && (missing8 = "interface")) || ((data16.method === undefined) && (missing8 = "method"))) || ((data16.protocol === undefined) && (missing8 = "protocol"))) || ((data16.protocolPath === undefined) && (missing8 = "protocolPath"))) || ((data16.dataCid === undefined) && (missing8 = "dataCid"))) || ((data16.dataSize === undefined) && (missing8 = "dataSize"))) || ((data16.dateCreated === undefined) && (missing8 = "dateCreated"))) || ((data16.messageTimestamp === undefined) && (missing8 = "messageTimestamp"))) || ((data16.dataFormat === undefined) && (missing8 = "dataFormat"))) {
2012
+ validate27.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/required", keyword: "required", params: { missingProperty: missing8 }, message: "must have required property '" + missing8 + "'" }];
2259
2013
  return false;
2260
2014
  }
2261
2015
  else {
2262
- const _errs75 = errors;
2263
- for (const key3 in data19) {
2016
+ const _errs56 = errors;
2017
+ for (const key3 in data16) {
2264
2018
  if (!(func2.call(schema39.properties.descriptor.properties, key3))) {
2265
2019
  validate27.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" }];
2266
2020
  return false;
2267
2021
  break;
2268
2022
  }
2269
2023
  }
2270
- if (_errs75 === errors) {
2271
- let missing14;
2272
- if (data19.parentId !== undefined && ((data19.protocol === undefined) && (missing14 = "protocol"))) {
2024
+ if (_errs56 === errors) {
2025
+ let missing9;
2026
+ if (data16.parentId !== undefined && ((data16.protocol === undefined) && (missing9 = "protocol"))) {
2273
2027
  validate27.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/dependencies", keyword: "dependencies", params: { property: "parentId",
2274
- missingProperty: missing14,
2028
+ missingProperty: missing9,
2275
2029
  depsCount: 1,
2276
2030
  deps: "protocol" }, message: "must have property protocol when property parentId is present" }];
2277
2031
  return false;
2278
2032
  }
2279
2033
  else {
2280
- if (data19.interface !== undefined) {
2281
- let data22 = data19.interface;
2282
- const _errs76 = errors;
2283
- if (typeof data22 !== "string") {
2034
+ if (data16.interface !== undefined) {
2035
+ let data19 = data16.interface;
2036
+ const _errs57 = errors;
2037
+ if (typeof data19 !== "string") {
2284
2038
  validate27.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2285
2039
  return false;
2286
2040
  }
2287
- if (!(data22 === "Records")) {
2041
+ if (!(data19 === "Records")) {
2288
2042
  validate27.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/enum", keyword: "enum", params: { allowedValues: schema39.properties.descriptor.properties.interface.enum }, message: "must be equal to one of the allowed values" }];
2289
2043
  return false;
2290
2044
  }
2291
- var valid26 = _errs76 === errors;
2045
+ var valid18 = _errs57 === errors;
2292
2046
  }
2293
2047
  else {
2294
- var valid26 = true;
2048
+ var valid18 = true;
2295
2049
  }
2296
- if (valid26) {
2297
- if (data19.method !== undefined) {
2298
- let data23 = data19.method;
2299
- const _errs78 = errors;
2300
- if (typeof data23 !== "string") {
2050
+ if (valid18) {
2051
+ if (data16.method !== undefined) {
2052
+ let data20 = data16.method;
2053
+ const _errs59 = errors;
2054
+ if (typeof data20 !== "string") {
2301
2055
  validate27.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2302
2056
  return false;
2303
2057
  }
2304
- if (!(data23 === "Write")) {
2058
+ if (!(data20 === "Write")) {
2305
2059
  validate27.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/enum", keyword: "enum", params: { allowedValues: schema39.properties.descriptor.properties.method.enum }, message: "must be equal to one of the allowed values" }];
2306
2060
  return false;
2307
2061
  }
2308
- var valid26 = _errs78 === errors;
2062
+ var valid18 = _errs59 === errors;
2309
2063
  }
2310
2064
  else {
2311
- var valid26 = true;
2065
+ var valid18 = true;
2312
2066
  }
2313
- if (valid26) {
2314
- if (data19.recipient !== undefined) {
2315
- let data24 = data19.recipient;
2316
- const _errs80 = errors;
2317
- const _errs81 = errors;
2318
- if (errors === _errs81) {
2319
- if (typeof data24 === "string") {
2320
- if (!pattern12.test(data24)) {
2067
+ if (valid18) {
2068
+ if (data16.recipient !== undefined) {
2069
+ let data21 = data16.recipient;
2070
+ const _errs61 = errors;
2071
+ const _errs62 = errors;
2072
+ if (errors === _errs62) {
2073
+ if (typeof data21 === "string") {
2074
+ if (!pattern12.test(data21)) {
2321
2075
  validate27.errors = [{ instancePath: instancePath + "/descriptor/recipient", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/did/pattern", keyword: "pattern", params: { pattern: "^did:([a-z0-9]+):((?:(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))*:)*((?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))+))((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$" }, message: "must match pattern \"" + "^did:([a-z0-9]+):((?:(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))*:)*((?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))+))((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$" + "\"" }];
2322
2076
  return false;
2323
2077
  }
@@ -2327,30 +2081,30 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2327
2081
  return false;
2328
2082
  }
2329
2083
  }
2330
- var valid26 = _errs80 === errors;
2084
+ var valid18 = _errs61 === errors;
2331
2085
  }
2332
2086
  else {
2333
- var valid26 = true;
2087
+ var valid18 = true;
2334
2088
  }
2335
- if (valid26) {
2336
- if (data19.protocol !== undefined) {
2337
- const _errs83 = errors;
2338
- if (typeof data19.protocol !== "string") {
2089
+ if (valid18) {
2090
+ if (data16.protocol !== undefined) {
2091
+ const _errs64 = errors;
2092
+ if (typeof data16.protocol !== "string") {
2339
2093
  validate27.errors = [{ instancePath: instancePath + "/descriptor/protocol", schemaPath: "#/properties/descriptor/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2340
2094
  return false;
2341
2095
  }
2342
- var valid26 = _errs83 === errors;
2096
+ var valid18 = _errs64 === errors;
2343
2097
  }
2344
2098
  else {
2345
- var valid26 = true;
2099
+ var valid18 = true;
2346
2100
  }
2347
- if (valid26) {
2348
- if (data19.protocolPath !== undefined) {
2349
- let data26 = data19.protocolPath;
2350
- const _errs85 = errors;
2351
- if (errors === _errs85) {
2352
- if (typeof data26 === "string") {
2353
- if (!pattern13.test(data26)) {
2101
+ if (valid18) {
2102
+ if (data16.protocolPath !== undefined) {
2103
+ let data23 = data16.protocolPath;
2104
+ const _errs66 = errors;
2105
+ if (errors === _errs66) {
2106
+ if (typeof data23 === "string") {
2107
+ if (!pattern13.test(data23)) {
2354
2108
  validate27.errors = [{ instancePath: instancePath + "/descriptor/protocolPath", schemaPath: "#/properties/descriptor/properties/protocolPath/pattern", keyword: "pattern", params: { pattern: "^[a-zA-Z]+(/[a-zA-Z]+)*$" }, message: "must match pattern \"" + "^[a-zA-Z]+(/[a-zA-Z]+)*$" + "\"" }];
2355
2109
  return false;
2356
2110
  }
@@ -2360,144 +2114,144 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2360
2114
  return false;
2361
2115
  }
2362
2116
  }
2363
- var valid26 = _errs85 === errors;
2117
+ var valid18 = _errs66 === errors;
2364
2118
  }
2365
2119
  else {
2366
- var valid26 = true;
2120
+ var valid18 = true;
2367
2121
  }
2368
- if (valid26) {
2369
- if (data19.schema !== undefined) {
2370
- const _errs87 = errors;
2371
- if (typeof data19.schema !== "string") {
2122
+ if (valid18) {
2123
+ if (data16.schema !== undefined) {
2124
+ const _errs68 = errors;
2125
+ if (typeof data16.schema !== "string") {
2372
2126
  validate27.errors = [{ instancePath: instancePath + "/descriptor/schema", schemaPath: "#/properties/descriptor/properties/schema/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2373
2127
  return false;
2374
2128
  }
2375
- var valid26 = _errs87 === errors;
2129
+ var valid18 = _errs68 === errors;
2376
2130
  }
2377
2131
  else {
2378
- var valid26 = true;
2132
+ var valid18 = true;
2379
2133
  }
2380
- if (valid26) {
2381
- if (data19.tags !== undefined) {
2382
- let data28 = data19.tags;
2383
- const _errs89 = errors;
2384
- if (errors === _errs89) {
2385
- if (data28 && typeof data28 == "object" && !Array.isArray(data28)) {
2386
- if (Object.keys(data28).length > 10) {
2134
+ if (valid18) {
2135
+ if (data16.tags !== undefined) {
2136
+ let data25 = data16.tags;
2137
+ const _errs70 = errors;
2138
+ if (errors === _errs70) {
2139
+ if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
2140
+ if (Object.keys(data25).length > 10) {
2387
2141
  validate27.errors = [{ instancePath: instancePath + "/descriptor/tags", schemaPath: "#/properties/descriptor/properties/tags/maxProperties", keyword: "maxProperties", params: { limit: 10 }, message: "must NOT have more than 10 properties" }];
2388
2142
  return false;
2389
2143
  }
2390
2144
  else {
2391
- if (Object.keys(data28).length < 1) {
2145
+ if (Object.keys(data25).length < 1) {
2392
2146
  validate27.errors = [{ instancePath: instancePath + "/descriptor/tags", schemaPath: "#/properties/descriptor/properties/tags/minProperties", keyword: "minProperties", params: { limit: 1 }, message: "must NOT have fewer than 1 properties" }];
2393
2147
  return false;
2394
2148
  }
2395
2149
  else {
2396
- for (const key4 in data28) {
2397
- let data29 = data28[key4];
2398
- const _errs92 = errors;
2399
- const _errs93 = errors;
2400
- let valid29 = false;
2150
+ for (const key4 in data25) {
2151
+ let data26 = data25[key4];
2152
+ const _errs73 = errors;
2153
+ const _errs74 = errors;
2154
+ let valid21 = false;
2401
2155
  let passing0 = null;
2402
- const _errs94 = errors;
2403
- if (typeof data29 !== "string") {
2404
- const err24 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2156
+ const _errs75 = errors;
2157
+ if (typeof data26 !== "string") {
2158
+ const err12 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2405
2159
  if (vErrors === null) {
2406
- vErrors = [err24];
2160
+ vErrors = [err12];
2407
2161
  }
2408
2162
  else {
2409
- vErrors.push(err24);
2163
+ vErrors.push(err12);
2410
2164
  }
2411
2165
  errors++;
2412
2166
  }
2413
- var _valid2 = _errs94 === errors;
2414
- if (_valid2) {
2415
- valid29 = true;
2167
+ var _valid1 = _errs75 === errors;
2168
+ if (_valid1) {
2169
+ valid21 = true;
2416
2170
  passing0 = 0;
2417
2171
  }
2418
- const _errs96 = errors;
2419
- if (!((typeof data29 == "number") && (isFinite(data29)))) {
2420
- const err25 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/1/type", keyword: "type", params: { type: "number" }, message: "must be number" };
2172
+ const _errs77 = errors;
2173
+ if (!((typeof data26 == "number") && (isFinite(data26)))) {
2174
+ const err13 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/1/type", keyword: "type", params: { type: "number" }, message: "must be number" };
2421
2175
  if (vErrors === null) {
2422
- vErrors = [err25];
2176
+ vErrors = [err13];
2423
2177
  }
2424
2178
  else {
2425
- vErrors.push(err25);
2179
+ vErrors.push(err13);
2426
2180
  }
2427
2181
  errors++;
2428
2182
  }
2429
- var _valid2 = _errs96 === errors;
2430
- if (_valid2 && valid29) {
2431
- valid29 = false;
2183
+ var _valid1 = _errs77 === errors;
2184
+ if (_valid1 && valid21) {
2185
+ valid21 = false;
2432
2186
  passing0 = [passing0, 1];
2433
2187
  }
2434
2188
  else {
2435
- if (_valid2) {
2436
- valid29 = true;
2189
+ if (_valid1) {
2190
+ valid21 = true;
2437
2191
  passing0 = 1;
2438
2192
  }
2439
- const _errs98 = errors;
2440
- if (typeof data29 !== "boolean") {
2441
- const err26 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/2/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
2193
+ const _errs79 = errors;
2194
+ if (typeof data26 !== "boolean") {
2195
+ const err14 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/2/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
2442
2196
  if (vErrors === null) {
2443
- vErrors = [err26];
2197
+ vErrors = [err14];
2444
2198
  }
2445
2199
  else {
2446
- vErrors.push(err26);
2200
+ vErrors.push(err14);
2447
2201
  }
2448
2202
  errors++;
2449
2203
  }
2450
- var _valid2 = _errs98 === errors;
2451
- if (_valid2 && valid29) {
2452
- valid29 = false;
2204
+ var _valid1 = _errs79 === errors;
2205
+ if (_valid1 && valid21) {
2206
+ valid21 = false;
2453
2207
  passing0 = [passing0, 2];
2454
2208
  }
2455
2209
  else {
2456
- if (_valid2) {
2457
- valid29 = true;
2210
+ if (_valid1) {
2211
+ valid21 = true;
2458
2212
  passing0 = 2;
2459
2213
  }
2460
- const _errs100 = errors;
2461
- if (errors === _errs100) {
2462
- if (Array.isArray(data29)) {
2463
- if (data29.length > 10) {
2464
- const err27 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/3/maxItems", keyword: "maxItems", params: { limit: 10 }, message: "must NOT have more than 10 items" };
2214
+ const _errs81 = errors;
2215
+ if (errors === _errs81) {
2216
+ if (Array.isArray(data26)) {
2217
+ if (data26.length > 10) {
2218
+ const err15 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/3/maxItems", keyword: "maxItems", params: { limit: 10 }, message: "must NOT have more than 10 items" };
2465
2219
  if (vErrors === null) {
2466
- vErrors = [err27];
2220
+ vErrors = [err15];
2467
2221
  }
2468
2222
  else {
2469
- vErrors.push(err27);
2223
+ vErrors.push(err15);
2470
2224
  }
2471
2225
  errors++;
2472
2226
  }
2473
2227
  else {
2474
- if (data29.length < 1) {
2475
- const err28 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/3/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
2228
+ if (data26.length < 1) {
2229
+ const err16 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/3/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
2476
2230
  if (vErrors === null) {
2477
- vErrors = [err28];
2231
+ vErrors = [err16];
2478
2232
  }
2479
2233
  else {
2480
- vErrors.push(err28);
2234
+ vErrors.push(err16);
2481
2235
  }
2482
2236
  errors++;
2483
2237
  }
2484
2238
  else {
2485
- var valid30 = true;
2486
- const len1 = data29.length;
2239
+ var valid22 = true;
2240
+ const len1 = data26.length;
2487
2241
  for (let i1 = 0; i1 < len1; i1++) {
2488
- const _errs102 = errors;
2489
- if (typeof data29[i1] !== "string") {
2490
- const err29 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/" + i1, schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/3/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2242
+ const _errs83 = errors;
2243
+ if (typeof data26[i1] !== "string") {
2244
+ const err17 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/" + i1, schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/3/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
2491
2245
  if (vErrors === null) {
2492
- vErrors = [err29];
2246
+ vErrors = [err17];
2493
2247
  }
2494
2248
  else {
2495
- vErrors.push(err29);
2249
+ vErrors.push(err17);
2496
2250
  }
2497
2251
  errors++;
2498
2252
  }
2499
- var valid30 = _errs102 === errors;
2500
- if (!valid30) {
2253
+ var valid22 = _errs83 === errors;
2254
+ if (!valid22) {
2501
2255
  break;
2502
2256
  }
2503
2257
  }
@@ -2505,69 +2259,69 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2505
2259
  }
2506
2260
  }
2507
2261
  else {
2508
- const err30 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/3/type", keyword: "type", params: { type: "array" }, message: "must be array" };
2262
+ const err18 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/3/type", keyword: "type", params: { type: "array" }, message: "must be array" };
2509
2263
  if (vErrors === null) {
2510
- vErrors = [err30];
2264
+ vErrors = [err18];
2511
2265
  }
2512
2266
  else {
2513
- vErrors.push(err30);
2267
+ vErrors.push(err18);
2514
2268
  }
2515
2269
  errors++;
2516
2270
  }
2517
2271
  }
2518
- var _valid2 = _errs100 === errors;
2519
- if (_valid2 && valid29) {
2520
- valid29 = false;
2272
+ var _valid1 = _errs81 === errors;
2273
+ if (_valid1 && valid21) {
2274
+ valid21 = false;
2521
2275
  passing0 = [passing0, 3];
2522
2276
  }
2523
2277
  else {
2524
- if (_valid2) {
2525
- valid29 = true;
2278
+ if (_valid1) {
2279
+ valid21 = true;
2526
2280
  passing0 = 3;
2527
2281
  var items0 = true;
2528
2282
  }
2529
- const _errs104 = errors;
2530
- if (errors === _errs104) {
2531
- if (Array.isArray(data29)) {
2532
- if (data29.length > 10) {
2533
- const err31 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/4/maxItems", keyword: "maxItems", params: { limit: 10 }, message: "must NOT have more than 10 items" };
2283
+ const _errs85 = errors;
2284
+ if (errors === _errs85) {
2285
+ if (Array.isArray(data26)) {
2286
+ if (data26.length > 10) {
2287
+ const err19 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/4/maxItems", keyword: "maxItems", params: { limit: 10 }, message: "must NOT have more than 10 items" };
2534
2288
  if (vErrors === null) {
2535
- vErrors = [err31];
2289
+ vErrors = [err19];
2536
2290
  }
2537
2291
  else {
2538
- vErrors.push(err31);
2292
+ vErrors.push(err19);
2539
2293
  }
2540
2294
  errors++;
2541
2295
  }
2542
2296
  else {
2543
- if (data29.length < 1) {
2544
- const err32 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/4/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
2297
+ if (data26.length < 1) {
2298
+ const err20 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/4/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
2545
2299
  if (vErrors === null) {
2546
- vErrors = [err32];
2300
+ vErrors = [err20];
2547
2301
  }
2548
2302
  else {
2549
- vErrors.push(err32);
2303
+ vErrors.push(err20);
2550
2304
  }
2551
2305
  errors++;
2552
2306
  }
2553
2307
  else {
2554
- var valid31 = true;
2555
- const len2 = data29.length;
2308
+ var valid23 = true;
2309
+ const len2 = data26.length;
2556
2310
  for (let i2 = 0; i2 < len2; i2++) {
2557
- let data31 = data29[i2];
2558
- const _errs106 = errors;
2559
- if (!((typeof data31 == "number") && (isFinite(data31)))) {
2560
- const err33 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/" + i2, schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/4/items/type", keyword: "type", params: { type: "number" }, message: "must be number" };
2311
+ let data28 = data26[i2];
2312
+ const _errs87 = errors;
2313
+ if (!((typeof data28 == "number") && (isFinite(data28)))) {
2314
+ const err21 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/" + i2, schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/4/items/type", keyword: "type", params: { type: "number" }, message: "must be number" };
2561
2315
  if (vErrors === null) {
2562
- vErrors = [err33];
2316
+ vErrors = [err21];
2563
2317
  }
2564
2318
  else {
2565
- vErrors.push(err33);
2319
+ vErrors.push(err21);
2566
2320
  }
2567
2321
  errors++;
2568
2322
  }
2569
- var valid31 = _errs106 === errors;
2570
- if (!valid31) {
2323
+ var valid23 = _errs87 === errors;
2324
+ if (!valid23) {
2571
2325
  break;
2572
2326
  }
2573
2327
  }
@@ -2575,24 +2329,24 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2575
2329
  }
2576
2330
  }
2577
2331
  else {
2578
- const err34 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/4/type", keyword: "type", params: { type: "array" }, message: "must be array" };
2332
+ const err22 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf/4/type", keyword: "type", params: { type: "array" }, message: "must be array" };
2579
2333
  if (vErrors === null) {
2580
- vErrors = [err34];
2334
+ vErrors = [err22];
2581
2335
  }
2582
2336
  else {
2583
- vErrors.push(err34);
2337
+ vErrors.push(err22);
2584
2338
  }
2585
2339
  errors++;
2586
2340
  }
2587
2341
  }
2588
- var _valid2 = _errs104 === errors;
2589
- if (_valid2 && valid29) {
2590
- valid29 = false;
2342
+ var _valid1 = _errs85 === errors;
2343
+ if (_valid1 && valid21) {
2344
+ valid21 = false;
2591
2345
  passing0 = [passing0, 4];
2592
2346
  }
2593
2347
  else {
2594
- if (_valid2) {
2595
- valid29 = true;
2348
+ if (_valid1) {
2349
+ valid21 = true;
2596
2350
  passing0 = 4;
2597
2351
  if (items0 !== true) {
2598
2352
  items0 = true;
@@ -2602,31 +2356,31 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2602
2356
  }
2603
2357
  }
2604
2358
  }
2605
- if (!valid29) {
2606
- const err35 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
2359
+ if (!valid21) {
2360
+ const err23 = { instancePath: instancePath + "/descriptor/tags/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/descriptor/properties/tags/additionalProperties/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" };
2607
2361
  if (vErrors === null) {
2608
- vErrors = [err35];
2362
+ vErrors = [err23];
2609
2363
  }
2610
2364
  else {
2611
- vErrors.push(err35);
2365
+ vErrors.push(err23);
2612
2366
  }
2613
2367
  errors++;
2614
2368
  validate27.errors = vErrors;
2615
2369
  return false;
2616
2370
  }
2617
2371
  else {
2618
- errors = _errs93;
2372
+ errors = _errs74;
2619
2373
  if (vErrors !== null) {
2620
- if (_errs93) {
2621
- vErrors.length = _errs93;
2374
+ if (_errs74) {
2375
+ vErrors.length = _errs74;
2622
2376
  }
2623
2377
  else {
2624
2378
  vErrors = null;
2625
2379
  }
2626
2380
  }
2627
2381
  }
2628
- var valid28 = _errs92 === errors;
2629
- if (!valid28) {
2382
+ var valid20 = _errs73 === errors;
2383
+ if (!valid20) {
2630
2384
  break;
2631
2385
  }
2632
2386
  }
@@ -2638,56 +2392,56 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2638
2392
  return false;
2639
2393
  }
2640
2394
  }
2641
- var valid26 = _errs89 === errors;
2395
+ var valid18 = _errs70 === errors;
2642
2396
  }
2643
2397
  else {
2644
- var valid26 = true;
2398
+ var valid18 = true;
2645
2399
  }
2646
- if (valid26) {
2647
- if (data19.parentId !== undefined) {
2648
- const _errs108 = errors;
2649
- if (typeof data19.parentId !== "string") {
2400
+ if (valid18) {
2401
+ if (data16.parentId !== undefined) {
2402
+ const _errs89 = errors;
2403
+ if (typeof data16.parentId !== "string") {
2650
2404
  validate27.errors = [{ instancePath: instancePath + "/descriptor/parentId", schemaPath: "#/properties/descriptor/properties/parentId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2651
2405
  return false;
2652
2406
  }
2653
- var valid26 = _errs108 === errors;
2407
+ var valid18 = _errs89 === errors;
2654
2408
  }
2655
2409
  else {
2656
- var valid26 = true;
2410
+ var valid18 = true;
2657
2411
  }
2658
- if (valid26) {
2659
- if (data19.dataCid !== undefined) {
2660
- const _errs110 = errors;
2661
- if (typeof data19.dataCid !== "string") {
2412
+ if (valid18) {
2413
+ if (data16.dataCid !== undefined) {
2414
+ const _errs91 = errors;
2415
+ if (typeof data16.dataCid !== "string") {
2662
2416
  validate27.errors = [{ instancePath: instancePath + "/descriptor/dataCid", schemaPath: "#/properties/descriptor/properties/dataCid/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2663
2417
  return false;
2664
2418
  }
2665
- var valid26 = _errs110 === errors;
2419
+ var valid18 = _errs91 === errors;
2666
2420
  }
2667
2421
  else {
2668
- var valid26 = true;
2422
+ var valid18 = true;
2669
2423
  }
2670
- if (valid26) {
2671
- if (data19.dataSize !== undefined) {
2672
- let data34 = data19.dataSize;
2673
- const _errs112 = errors;
2674
- if (!((typeof data34 == "number") && (isFinite(data34)))) {
2424
+ if (valid18) {
2425
+ if (data16.dataSize !== undefined) {
2426
+ let data31 = data16.dataSize;
2427
+ const _errs93 = errors;
2428
+ if (!((typeof data31 == "number") && (isFinite(data31)))) {
2675
2429
  validate27.errors = [{ instancePath: instancePath + "/descriptor/dataSize", schemaPath: "#/properties/descriptor/properties/dataSize/type", keyword: "type", params: { type: "number" }, message: "must be number" }];
2676
2430
  return false;
2677
2431
  }
2678
- var valid26 = _errs112 === errors;
2432
+ var valid18 = _errs93 === errors;
2679
2433
  }
2680
2434
  else {
2681
- var valid26 = true;
2435
+ var valid18 = true;
2682
2436
  }
2683
- if (valid26) {
2684
- if (data19.dateCreated !== undefined) {
2685
- let data35 = data19.dateCreated;
2686
- const _errs114 = errors;
2687
- const _errs115 = errors;
2688
- if (errors === _errs115) {
2689
- if (typeof data35 === "string") {
2690
- if (!pattern14.test(data35)) {
2437
+ if (valid18) {
2438
+ if (data16.dateCreated !== undefined) {
2439
+ let data32 = data16.dateCreated;
2440
+ const _errs95 = errors;
2441
+ const _errs96 = errors;
2442
+ if (errors === _errs96) {
2443
+ if (typeof data32 === "string") {
2444
+ if (!pattern14.test(data32)) {
2691
2445
  validate27.errors = [{ instancePath: instancePath + "/descriptor/dateCreated", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" }, message: "must match pattern \"" + "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" + "\"" }];
2692
2446
  return false;
2693
2447
  }
@@ -2697,19 +2451,19 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2697
2451
  return false;
2698
2452
  }
2699
2453
  }
2700
- var valid26 = _errs114 === errors;
2454
+ var valid18 = _errs95 === errors;
2701
2455
  }
2702
2456
  else {
2703
- var valid26 = true;
2457
+ var valid18 = true;
2704
2458
  }
2705
- if (valid26) {
2706
- if (data19.messageTimestamp !== undefined) {
2707
- let data36 = data19.messageTimestamp;
2708
- const _errs117 = errors;
2709
- const _errs118 = errors;
2710
- if (errors === _errs118) {
2711
- if (typeof data36 === "string") {
2712
- if (!pattern14.test(data36)) {
2459
+ if (valid18) {
2460
+ if (data16.messageTimestamp !== undefined) {
2461
+ let data33 = data16.messageTimestamp;
2462
+ const _errs98 = errors;
2463
+ const _errs99 = errors;
2464
+ if (errors === _errs99) {
2465
+ if (typeof data33 === "string") {
2466
+ if (!pattern14.test(data33)) {
2713
2467
  validate27.errors = [{ instancePath: instancePath + "/descriptor/messageTimestamp", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" }, message: "must match pattern \"" + "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" + "\"" }];
2714
2468
  return false;
2715
2469
  }
@@ -2719,31 +2473,31 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2719
2473
  return false;
2720
2474
  }
2721
2475
  }
2722
- var valid26 = _errs117 === errors;
2476
+ var valid18 = _errs98 === errors;
2723
2477
  }
2724
2478
  else {
2725
- var valid26 = true;
2479
+ var valid18 = true;
2726
2480
  }
2727
- if (valid26) {
2728
- if (data19.published !== undefined) {
2729
- const _errs120 = errors;
2730
- if (typeof data19.published !== "boolean") {
2481
+ if (valid18) {
2482
+ if (data16.published !== undefined) {
2483
+ const _errs101 = errors;
2484
+ if (typeof data16.published !== "boolean") {
2731
2485
  validate27.errors = [{ instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/properties/published/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
2732
2486
  return false;
2733
2487
  }
2734
- var valid26 = _errs120 === errors;
2488
+ var valid18 = _errs101 === errors;
2735
2489
  }
2736
2490
  else {
2737
- var valid26 = true;
2491
+ var valid18 = true;
2738
2492
  }
2739
- if (valid26) {
2740
- if (data19.datePublished !== undefined) {
2741
- let data38 = data19.datePublished;
2742
- const _errs122 = errors;
2743
- const _errs123 = errors;
2744
- if (errors === _errs123) {
2745
- if (typeof data38 === "string") {
2746
- if (!pattern14.test(data38)) {
2493
+ if (valid18) {
2494
+ if (data16.datePublished !== undefined) {
2495
+ let data35 = data16.datePublished;
2496
+ const _errs103 = errors;
2497
+ const _errs104 = errors;
2498
+ if (errors === _errs104) {
2499
+ if (typeof data35 === "string") {
2500
+ if (!pattern14.test(data35)) {
2747
2501
  validate27.errors = [{ instancePath: instancePath + "/descriptor/datePublished", schemaPath: "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time/pattern", keyword: "pattern", params: { pattern: "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" }, message: "must match pattern \"" + "^\\d{4}-[0-1]\\d-[0-3]\\dT(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)\\.\\d{6}Z$" + "\"" }];
2748
2502
  return false;
2749
2503
  }
@@ -2753,34 +2507,34 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2753
2507
  return false;
2754
2508
  }
2755
2509
  }
2756
- var valid26 = _errs122 === errors;
2510
+ var valid18 = _errs103 === errors;
2757
2511
  }
2758
2512
  else {
2759
- var valid26 = true;
2513
+ var valid18 = true;
2760
2514
  }
2761
- if (valid26) {
2762
- if (data19.dataFormat !== undefined) {
2763
- const _errs125 = errors;
2764
- if (typeof data19.dataFormat !== "string") {
2515
+ if (valid18) {
2516
+ if (data16.dataFormat !== undefined) {
2517
+ const _errs106 = errors;
2518
+ if (typeof data16.dataFormat !== "string") {
2765
2519
  validate27.errors = [{ instancePath: instancePath + "/descriptor/dataFormat", schemaPath: "#/properties/descriptor/properties/dataFormat/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2766
2520
  return false;
2767
2521
  }
2768
- var valid26 = _errs125 === errors;
2522
+ var valid18 = _errs106 === errors;
2769
2523
  }
2770
2524
  else {
2771
- var valid26 = true;
2525
+ var valid18 = true;
2772
2526
  }
2773
- if (valid26) {
2774
- if (data19.permissionGrantId !== undefined) {
2775
- const _errs127 = errors;
2776
- if (typeof data19.permissionGrantId !== "string") {
2527
+ if (valid18) {
2528
+ if (data16.permissionGrantId !== undefined) {
2529
+ const _errs108 = errors;
2530
+ if (typeof data16.permissionGrantId !== "string") {
2777
2531
  validate27.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantId", schemaPath: "#/properties/descriptor/properties/permissionGrantId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2778
2532
  return false;
2779
2533
  }
2780
- var valid26 = _errs127 === errors;
2534
+ var valid18 = _errs108 === errors;
2781
2535
  }
2782
2536
  else {
2783
- var valid26 = true;
2537
+ var valid18 = true;
2784
2538
  }
2785
2539
  }
2786
2540
  }
@@ -2806,10 +2560,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2806
2560
  return false;
2807
2561
  }
2808
2562
  }
2809
- var valid8 = _errs55 === errors;
2563
+ var valid0 = _errs36 === errors;
2810
2564
  }
2811
2565
  else {
2812
- var valid8 = true;
2566
+ var valid0 = true;
2813
2567
  }
2814
2568
  }
2815
2569
  }
@@ -2824,10 +2578,9 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2824
2578
  }
2825
2579
  }
2826
2580
  validate27.errors = vErrors;
2827
- evaluated0.props = props0;
2828
2581
  return errors === 0;
2829
2582
  }
2830
- validate27.evaluated = { "dynamicProps": true, "dynamicItems": false };
2583
+ validate27.evaluated = { "props": { "recordId": true, "contextId": true, "attestation": true, "authorization": true, "encryption": true, "descriptor": true }, "dynamicProps": false, "dynamicItems": false };
2831
2584
  function validate26(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/records-write-data-encoded.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate26.evaluated; if (evaluated0.dynamicProps) {
2832
2585
  evaluated0.props = undefined;
2833
2586
  } if (evaluated0.dynamicItems) {
@@ -2835,9 +2588,6 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
2835
2588
  } if (!(validate27(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
2836
2589
  vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
2837
2590
  errors = vErrors.length;
2838
- }
2839
- else {
2840
- var props0 = validate27.evaluated.props;
2841
2591
  } if (errors === 0) {
2842
2592
  if (data && typeof data == "object" && !Array.isArray(data)) {
2843
2593
  let missing0;
@@ -2846,10 +2596,6 @@ else {
2846
2596
  return false;
2847
2597
  }
2848
2598
  else {
2849
- if (props0 !== true) {
2850
- props0 = props0 || {};
2851
- props0.encodedData = true;
2852
- }
2853
2599
  if (data.encodedData !== undefined) {
2854
2600
  const _errs1 = errors;
2855
2601
  if (typeof data.encodedData !== "string") {
@@ -2862,13 +2608,11 @@ else {
2862
2608
  var valid0 = true;
2863
2609
  }
2864
2610
  if (valid0) {
2865
- if (props0 !== true) {
2866
- for (const key0 in data) {
2867
- if (!props0 || !props0[key0]) {
2868
- validate26.errors = [{ instancePath, schemaPath: "#/unevaluatedProperties", keyword: "unevaluatedProperties", params: { unevaluatedProperty: key0 }, message: "must NOT have unevaluated properties" }];
2869
- return false;
2870
- break;
2871
- }
2611
+ for (const key0 in data) {
2612
+ if (((((((key0 !== "encodedData") && (key0 !== "recordId")) && (key0 !== "contextId")) && (key0 !== "attestation")) && (key0 !== "authorization")) && (key0 !== "encryption")) && (key0 !== "descriptor")) {
2613
+ validate26.errors = [{ instancePath, schemaPath: "#/unevaluatedProperties", keyword: "unevaluatedProperties", params: { unevaluatedProperty: key0 }, message: "must NOT have unevaluated properties" }];
2614
+ return false;
2615
+ break;
2872
2616
  }
2873
2617
  }
2874
2618
  }
@@ -5378,7 +5122,7 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
5378
5122
  } validate45.errors = vErrors; return errors === 0; }
5379
5123
  validate45.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
5380
5124
  export const RecordsSubscribe = validate48;
5381
- const schema73 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/records-subscribe.json", "type": "object", "additionalProperties": false, "required": ["descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization-delegated-grant.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "filter"], "properties": { "interface": { "enum": ["Records"], "type": "string" }, "method": { "enum": ["Subscribe"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "filter": { "$ref": "https://identity.foundation/dwn/json-schemas/records-filter.json" }, "pagination": { "type": "object", "additionalProperties": false, "properties": { "limit": { "type": "number", "minimum": 1 }, "cursor": { "$ref": "https://identity.foundation/dwn/json-schemas/pagination-cursor.json" } } }, "dateSort": { "enum": ["createdAscending", "createdDescending", "publishedAscending", "publishedDescending", "updatedAscending", "updatedDescending"], "type": "string" } } } } };
5125
+ const schema73 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/records-subscribe.json", "type": "object", "additionalProperties": false, "required": ["descriptor"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization-delegated-grant.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "filter"], "properties": { "interface": { "enum": ["Records"], "type": "string" }, "method": { "enum": ["Subscribe"], "type": "string" }, "messageTimestamp": { "$ref": "https://identity.foundation/dwn/json-schemas/defs.json#/$defs/date-time" }, "filter": { "$ref": "https://identity.foundation/dwn/json-schemas/records-filter.json" }, "pagination": { "type": "object", "additionalProperties": false, "properties": { "limit": { "type": "number", "minimum": 1 }, "cursor": { "$ref": "https://identity.foundation/dwn/json-schemas/pagination-cursor.json" } } }, "dateSort": { "enum": ["createdAscending", "createdDescending", "publishedAscending", "publishedDescending", "updatedAscending", "updatedDescending"], "type": "string" }, "cursor": { "type": "string" } } } } };
5382
5126
  function validate48(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/records-subscribe.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate48.evaluated; if (evaluated0.dynamicProps) {
5383
5127
  evaluated0.props = undefined;
5384
5128
  } if (evaluated0.dynamicItems) {
@@ -5425,7 +5169,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
5425
5169
  else {
5426
5170
  const _errs5 = errors;
5427
5171
  for (const key1 in data1) {
5428
- if (!((((((key1 === "interface") || (key1 === "method")) || (key1 === "messageTimestamp")) || (key1 === "filter")) || (key1 === "pagination")) || (key1 === "dateSort"))) {
5172
+ if (!(((((((key1 === "interface") || (key1 === "method")) || (key1 === "messageTimestamp")) || (key1 === "filter")) || (key1 === "pagination")) || (key1 === "dateSort")) || (key1 === "cursor"))) {
5429
5173
  validate48.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
5430
5174
  return false;
5431
5175
  break;
@@ -5630,6 +5374,19 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
5630
5374
  else {
5631
5375
  var valid1 = true;
5632
5376
  }
5377
+ if (valid1) {
5378
+ if (data1.cursor !== undefined) {
5379
+ const _errs29 = errors;
5380
+ if (typeof data1.cursor !== "string") {
5381
+ validate48.errors = [{ instancePath: instancePath + "/descriptor/cursor", schemaPath: "#/properties/descriptor/properties/cursor/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
5382
+ return false;
5383
+ }
5384
+ var valid1 = _errs29 === errors;
5385
+ }
5386
+ else {
5387
+ var valid1 = true;
5388
+ }
5389
+ }
5633
5390
  }
5634
5391
  }
5635
5392
  }
@@ -5667,9 +5424,6 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
5667
5424
  } if (!(validate27(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
5668
5425
  vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
5669
5426
  errors = vErrors.length;
5670
- }
5671
- else {
5672
- var props0 = validate27.evaluated.props;
5673
5427
  } if (errors === 0) {
5674
5428
  if (data && typeof data == "object" && !Array.isArray(data)) {
5675
5429
  let missing0;
@@ -5678,13 +5432,11 @@ else {
5678
5432
  return false;
5679
5433
  }
5680
5434
  else {
5681
- if (props0 !== true) {
5682
- for (const key0 in data) {
5683
- if (!props0 || !props0[key0]) {
5684
- validate51.errors = [{ instancePath, schemaPath: "#/unevaluatedProperties", keyword: "unevaluatedProperties", params: { unevaluatedProperty: key0 }, message: "must NOT have unevaluated properties" }];
5685
- return false;
5686
- break;
5687
- }
5435
+ for (const key0 in data) {
5436
+ if ((((((key0 !== "recordId") && (key0 !== "contextId")) && (key0 !== "attestation")) && (key0 !== "authorization")) && (key0 !== "encryption")) && (key0 !== "descriptor")) {
5437
+ validate51.errors = [{ instancePath, schemaPath: "#/unevaluatedProperties", keyword: "unevaluatedProperties", params: { unevaluatedProperty: key0 }, message: "must NOT have unevaluated properties" }];
5438
+ return false;
5439
+ break;
5688
5440
  }
5689
5441
  }
5690
5442
  }
@@ -6822,7 +6574,7 @@ function validate57(data, { instancePath = "", parentData, parentDataProperty, r
6822
6574
  } validate57.errors = vErrors; return errors === 0; }
6823
6575
  validate57.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
6824
6576
  export const MessagesSubscribe = validate59;
6825
- const schema85 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/messages-subscribe.json", "type": "object", "additionalProperties": false, "required": ["descriptor", "authorization"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "filters"], "properties": { "interface": { "enum": ["Messages"], "type": "string" }, "method": { "enum": ["Subscribe"], "type": "string" }, "messageTimestamp": { "type": "string" }, "filters": { "type": "array", "items": { "$ref": "https://identity.foundation/dwn/json-schemas/messages-filter.json" } }, "permissionGrantId": { "type": "string" } } } } };
6577
+ const schema85 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://identity.foundation/dwn/json-schemas/messages-subscribe.json", "type": "object", "additionalProperties": false, "required": ["descriptor", "authorization"], "properties": { "authorization": { "$ref": "https://identity.foundation/dwn/json-schemas/authorization.json" }, "descriptor": { "type": "object", "additionalProperties": false, "required": ["interface", "method", "messageTimestamp", "filters"], "properties": { "interface": { "enum": ["Messages"], "type": "string" }, "method": { "enum": ["Subscribe"], "type": "string" }, "messageTimestamp": { "type": "string" }, "filters": { "type": "array", "items": { "$ref": "https://identity.foundation/dwn/json-schemas/messages-filter.json" } }, "permissionGrantId": { "type": "string" }, "cursor": { "type": "string" } } } } };
6826
6578
  function validate59(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://identity.foundation/dwn/json-schemas/messages-subscribe.json" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate59.evaluated; if (evaluated0.dynamicProps) {
6827
6579
  evaluated0.props = undefined;
6828
6580
  } if (evaluated0.dynamicItems) {
@@ -6869,7 +6621,7 @@ function validate59(data, { instancePath = "", parentData, parentDataProperty, r
6869
6621
  else {
6870
6622
  const _errs5 = errors;
6871
6623
  for (const key1 in data1) {
6872
- if (!(((((key1 === "interface") || (key1 === "method")) || (key1 === "messageTimestamp")) || (key1 === "filters")) || (key1 === "permissionGrantId"))) {
6624
+ if (!((((((key1 === "interface") || (key1 === "method")) || (key1 === "messageTimestamp")) || (key1 === "filters")) || (key1 === "permissionGrantId")) || (key1 === "cursor"))) {
6873
6625
  validate59.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
6874
6626
  return false;
6875
6627
  break;
@@ -6963,6 +6715,19 @@ function validate59(data, { instancePath = "", parentData, parentDataProperty, r
6963
6715
  else {
6964
6716
  var valid1 = true;
6965
6717
  }
6718
+ if (valid1) {
6719
+ if (data1.cursor !== undefined) {
6720
+ const _errs17 = errors;
6721
+ if (typeof data1.cursor !== "string") {
6722
+ validate59.errors = [{ instancePath: instancePath + "/descriptor/cursor", schemaPath: "#/properties/descriptor/properties/cursor/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
6723
+ return false;
6724
+ }
6725
+ var valid1 = _errs17 === errors;
6726
+ }
6727
+ else {
6728
+ var valid1 = true;
6729
+ }
6730
+ }
6966
6731
  }
6967
6732
  }
6968
6733
  }
@@ -11094,7 +10859,7 @@ export const ProtocolDefinition = validate75;
11094
10859
  const schema122 = { "$id": "https://identity.foundation/dwn/json-schemas/protocol-definition.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "required": ["protocol", "published", "types", "structure"], "properties": { "protocol": { "type": "string" }, "published": { "type": "boolean" }, "uses": { "$comment": "Maps alias names to external protocol URIs for composition. Each alias can be used in $ref values and cross-protocol role/of references using 'alias:path' syntax.", "type": "object", "minProperties": 1, "patternProperties": { "^[a-zA-Z][a-zA-Z0-9_-]*$": { "type": "string" } }, "additionalProperties": false }, "types": { "type": "object", "patternProperties": { ".*": { "type": "object", "additionalProperties": false, "properties": { "schema": { "type": "string" }, "dataFormats": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "encryptionRequired": { "type": "boolean" } } } } }, "structure": { "type": "object", "patternProperties": { ".*": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json" } } } } };
11095
10860
  const pattern39 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u");
11096
10861
  const pattern41 = new RegExp(".*", "u");
11097
- const schema123 = { "$id": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "properties": { "$encryption": { "type": "object", "additionalProperties": false, "properties": { "rootKeyId": { "type": "string" }, "publicKeyJwk": { "$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json" } }, "required": ["rootKeyId", "publicKeyJwk"] }, "$actions": { "type": "array", "minItems": 1, "items": { "type": "object", "oneOf": [{ "required": ["who", "can"], "additionalProperties": false, "properties": { "who": { "type": "string", "enum": ["anyone", "author", "recipient"] }, "of": { "type": "string" }, "can": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": ["co-delete", "co-prune", "co-update", "create", "delete", "prune", "read", "update"] } } } }, { "required": ["role", "can"], "additionalProperties": false, "properties": { "role": { "$comment": "Must be the protocol path of a role record type", "type": "string" }, "can": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": ["co-delete", "co-prune", "co-update", "create", "delete", "prune", "read", "update"] } } } }] } }, "$role": { "$comment": "When `true`, this turns a record into `role` that may be used within a context/sub-context", "type": "boolean" }, "$ref": { "$comment": "References a type from an external protocol declared in `uses`. Format: 'alias:typePath'. A $ref node is a pure attachment point and must not have $actions, $role, $size, $tags, or $encryption.", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*:.+$" }, "$size": { "type": "object", "additionalProperties": false, "properties": { "min": { "type": "number", "minimum": 0 }, "max": { "type": "number", "minimum": 0 } } }, "$tags": { "type": "object", "minProperties": 1, "properties": { "$requiredTags": { "type": "array", "items": { "type": "string" } }, "$allowUndefinedTags": { "type": "boolean" } }, "patternProperties": { "^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["string", "number", "integer", "boolean", "array"] }, "items": { "type": "object", "properties": { "type": { "enum": ["string", "number", "integer"] } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength)$": {} } }, "contains": { "type": "object", "properties": { "type": { "enum": ["string", "number", "integer"] } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength)$": {} } } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minContains|maxContains)$": {} } } } } }, "patternProperties": { "^[^$].*$": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json" } } };
10862
+ const schema123 = { "$id": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "additionalProperties": false, "properties": { "$encryption": { "type": "object", "additionalProperties": false, "properties": { "rootKeyId": { "type": "string" }, "publicKeyJwk": { "$ref": "https://identity.foundation/dwn/json-schemas/public-jwk.json" } }, "required": ["rootKeyId", "publicKeyJwk"] }, "$actions": { "type": "array", "minItems": 1, "items": { "type": "object", "oneOf": [{ "required": ["who", "can"], "additionalProperties": false, "properties": { "who": { "type": "string", "enum": ["anyone", "author", "recipient"] }, "of": { "type": "string" }, "can": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": ["co-delete", "co-prune", "co-update", "create", "delete", "prune", "read", "update"] } } } }, { "required": ["role", "can"], "additionalProperties": false, "properties": { "role": { "$comment": "Must be the protocol path of a role record type", "type": "string" }, "can": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": ["co-delete", "co-prune", "co-update", "create", "delete", "prune", "read", "update"] } } } }] } }, "$role": { "$comment": "When `true`, this turns a record into `role` that may be used within a context/sub-context", "type": "boolean" }, "$ref": { "$comment": "References a type from an external protocol declared in `uses`. Format: 'alias:typePath'. A $ref node is a pure attachment point and must not have $actions, $role, $size, $tags, or $encryption.", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9_-]*:.+$" }, "$size": { "type": "object", "additionalProperties": false, "properties": { "min": { "type": "number", "minimum": 0 }, "max": { "type": "number", "minimum": 0 } } }, "$recordLimit": { "type": "object", "additionalProperties": false, "required": ["max", "strategy"], "properties": { "max": { "type": "integer", "minimum": 1 }, "strategy": { "type": "string", "enum": ["reject", "purgeOldest"] } } }, "$immutable": { "$comment": "When true, records at this protocol path cannot be updated after initial write", "type": "boolean" }, "$tags": { "type": "object", "minProperties": 1, "properties": { "$requiredTags": { "type": "array", "items": { "type": "string" } }, "$allowUndefinedTags": { "type": "boolean" } }, "patternProperties": { "^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$": { "type": "object", "additionalProperties": false, "properties": { "type": { "enum": ["string", "number", "integer", "boolean", "array"] }, "items": { "type": "object", "properties": { "type": { "enum": ["string", "number", "integer"] } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength)$": {} } }, "contains": { "type": "object", "properties": { "type": { "enum": ["string", "number", "integer"] } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength)$": {} } } }, "patternProperties": { "^(enum|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minContains|maxContains)$": {} } } } } }, "patternProperties": { "^[^$].*$": { "$ref": "https://identity.foundation/dwn/json-schemas/protocol-rule-set.json" } } };
11098
10863
  const pattern43 = new RegExp("^[^$].*$", "u");
11099
10864
  const pattern44 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*:.+$", "u");
11100
10865
  const pattern45 = new RegExp("^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$", "u");
@@ -11109,7 +10874,7 @@ function validate76(data, { instancePath = "", parentData, parentDataProperty, r
11109
10874
  if (data && typeof data == "object" && !Array.isArray(data)) {
11110
10875
  const _errs1 = errors;
11111
10876
  for (const key0 in data) {
11112
- if (!(((((((key0 === "$encryption") || (key0 === "$actions")) || (key0 === "$role")) || (key0 === "$ref")) || (key0 === "$size")) || (key0 === "$tags")) || (pattern43.test(key0)))) {
10877
+ if (!(((((((((key0 === "$encryption") || (key0 === "$actions")) || (key0 === "$role")) || (key0 === "$ref")) || (key0 === "$size")) || (key0 === "$recordLimit")) || (key0 === "$immutable")) || (key0 === "$tags")) || (pattern43.test(key0)))) {
11113
10878
  validate76.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
11114
10879
  return false;
11115
10880
  break;
@@ -11619,202 +11384,288 @@ function validate76(data, { instancePath = "", parentData, parentDataProperty, r
11619
11384
  var valid0 = true;
11620
11385
  }
11621
11386
  if (valid0) {
11622
- if (data.$tags !== undefined) {
11623
- let data17 = data.$tags;
11387
+ if (data.$recordLimit !== undefined) {
11388
+ let data17 = data.$recordLimit;
11624
11389
  const _errs45 = errors;
11625
11390
  if (errors === _errs45) {
11626
11391
  if (data17 && typeof data17 == "object" && !Array.isArray(data17)) {
11627
- if (Object.keys(data17).length < 1) {
11628
- validate76.errors = [{ instancePath: instancePath + "/$tags", schemaPath: "#/properties/%24tags/minProperties", keyword: "minProperties", params: { limit: 1 }, message: "must NOT have fewer than 1 properties" }];
11392
+ let missing3;
11393
+ if (((data17.max === undefined) && (missing3 = "max")) || ((data17.strategy === undefined) && (missing3 = "strategy"))) {
11394
+ validate76.errors = [{ instancePath: instancePath + "/$recordLimit", schemaPath: "#/properties/%24recordLimit/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" }];
11629
11395
  return false;
11630
11396
  }
11631
11397
  else {
11632
- if (data17.$requiredTags !== undefined) {
11633
- let data18 = data17.$requiredTags;
11634
- const _errs47 = errors;
11635
- if (errors === _errs47) {
11636
- if (Array.isArray(data18)) {
11637
- var valid10 = true;
11638
- const len3 = data18.length;
11639
- for (let i3 = 0; i3 < len3; i3++) {
11640
- const _errs49 = errors;
11641
- if (typeof data18[i3] !== "string") {
11642
- validate76.errors = [{ instancePath: instancePath + "/$tags/$requiredTags/" + i3, schemaPath: "#/properties/%24tags/properties/%24requiredTags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11398
+ const _errs47 = errors;
11399
+ for (const key5 in data17) {
11400
+ if (!((key5 === "max") || (key5 === "strategy"))) {
11401
+ validate76.errors = [{ instancePath: instancePath + "/$recordLimit", schemaPath: "#/properties/%24recordLimit/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" }];
11402
+ return false;
11403
+ break;
11404
+ }
11405
+ }
11406
+ if (_errs47 === errors) {
11407
+ if (data17.max !== undefined) {
11408
+ let data18 = data17.max;
11409
+ const _errs48 = errors;
11410
+ if (!(((typeof data18 == "number") && (!(data18 % 1) && !isNaN(data18))) && (isFinite(data18)))) {
11411
+ validate76.errors = [{ instancePath: instancePath + "/$recordLimit/max", schemaPath: "#/properties/%24recordLimit/properties/max/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
11412
+ return false;
11413
+ }
11414
+ if (errors === _errs48) {
11415
+ if ((typeof data18 == "number") && (isFinite(data18))) {
11416
+ if (data18 < 1 || isNaN(data18)) {
11417
+ validate76.errors = [{ instancePath: instancePath + "/$recordLimit/max", schemaPath: "#/properties/%24recordLimit/properties/max/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" }];
11643
11418
  return false;
11644
11419
  }
11645
- var valid10 = _errs49 === errors;
11646
- if (!valid10) {
11647
- break;
11648
- }
11649
11420
  }
11650
11421
  }
11422
+ var valid9 = _errs48 === errors;
11423
+ }
11424
+ else {
11425
+ var valid9 = true;
11426
+ }
11427
+ if (valid9) {
11428
+ if (data17.strategy !== undefined) {
11429
+ let data19 = data17.strategy;
11430
+ const _errs50 = errors;
11431
+ if (typeof data19 !== "string") {
11432
+ validate76.errors = [{ instancePath: instancePath + "/$recordLimit/strategy", schemaPath: "#/properties/%24recordLimit/properties/strategy/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11433
+ return false;
11434
+ }
11435
+ if (!((data19 === "reject") || (data19 === "purgeOldest"))) {
11436
+ validate76.errors = [{ instancePath: instancePath + "/$recordLimit/strategy", schemaPath: "#/properties/%24recordLimit/properties/strategy/enum", keyword: "enum", params: { allowedValues: schema123.properties.$recordLimit.properties.strategy.enum }, message: "must be equal to one of the allowed values" }];
11437
+ return false;
11438
+ }
11439
+ var valid9 = _errs50 === errors;
11440
+ }
11651
11441
  else {
11652
- validate76.errors = [{ instancePath: instancePath + "/$tags/$requiredTags", schemaPath: "#/properties/%24tags/properties/%24requiredTags/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
11653
- return false;
11442
+ var valid9 = true;
11654
11443
  }
11655
11444
  }
11656
- var valid9 = _errs47 === errors;
11657
- }
11658
- else {
11659
- var valid9 = true;
11660
11445
  }
11661
- if (valid9) {
11662
- if (data17.$allowUndefinedTags !== undefined) {
11663
- const _errs51 = errors;
11664
- if (typeof data17.$allowUndefinedTags !== "boolean") {
11665
- validate76.errors = [{ instancePath: instancePath + "/$tags/$allowUndefinedTags", schemaPath: "#/properties/%24tags/properties/%24allowUndefinedTags/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
11666
- return false;
11667
- }
11668
- var valid9 = _errs51 === errors;
11446
+ }
11447
+ }
11448
+ else {
11449
+ validate76.errors = [{ instancePath: instancePath + "/$recordLimit", schemaPath: "#/properties/%24recordLimit/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11450
+ return false;
11451
+ }
11452
+ }
11453
+ var valid0 = _errs45 === errors;
11454
+ }
11455
+ else {
11456
+ var valid0 = true;
11457
+ }
11458
+ if (valid0) {
11459
+ if (data.$immutable !== undefined) {
11460
+ const _errs52 = errors;
11461
+ if (typeof data.$immutable !== "boolean") {
11462
+ validate76.errors = [{ instancePath: instancePath + "/$immutable", schemaPath: "#/properties/%24immutable/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
11463
+ return false;
11464
+ }
11465
+ var valid0 = _errs52 === errors;
11466
+ }
11467
+ else {
11468
+ var valid0 = true;
11469
+ }
11470
+ if (valid0) {
11471
+ if (data.$tags !== undefined) {
11472
+ let data21 = data.$tags;
11473
+ const _errs55 = errors;
11474
+ if (errors === _errs55) {
11475
+ if (data21 && typeof data21 == "object" && !Array.isArray(data21)) {
11476
+ if (Object.keys(data21).length < 1) {
11477
+ validate76.errors = [{ instancePath: instancePath + "/$tags", schemaPath: "#/properties/%24tags/minProperties", keyword: "minProperties", params: { limit: 1 }, message: "must NOT have fewer than 1 properties" }];
11478
+ return false;
11669
11479
  }
11670
11480
  else {
11671
- var valid9 = true;
11672
- }
11673
- if (valid9) {
11674
- var props2 = {};
11675
- props2.$requiredTags = true;
11676
- props2.$allowUndefinedTags = true;
11677
- for (const key5 in data17) {
11678
- if (pattern45.test(key5)) {
11679
- let data21 = data17[key5];
11680
- const _errs53 = errors;
11681
- if (errors === _errs53) {
11682
- if (data21 && typeof data21 == "object" && !Array.isArray(data21)) {
11683
- const _errs55 = errors;
11684
- for (const key6 in data21) {
11685
- if (!((((key6 === "type") || (key6 === "items")) || (key6 === "contains")) || (pattern46.test(key6)))) {
11686
- validate76.errors = [{ instancePath: instancePath + "/$tags/" + key5.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key6 }, message: "must NOT have additional properties" }];
11687
- return false;
11688
- break;
11689
- }
11481
+ if (data21.$requiredTags !== undefined) {
11482
+ let data22 = data21.$requiredTags;
11483
+ const _errs57 = errors;
11484
+ if (errors === _errs57) {
11485
+ if (Array.isArray(data22)) {
11486
+ var valid11 = true;
11487
+ const len3 = data22.length;
11488
+ for (let i3 = 0; i3 < len3; i3++) {
11489
+ const _errs59 = errors;
11490
+ if (typeof data22[i3] !== "string") {
11491
+ validate76.errors = [{ instancePath: instancePath + "/$tags/$requiredTags/" + i3, schemaPath: "#/properties/%24tags/properties/%24requiredTags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
11492
+ return false;
11690
11493
  }
11691
- if (_errs55 === errors) {
11692
- if (data21.type !== undefined) {
11693
- let data22 = data21.type;
11694
- const _errs56 = errors;
11695
- if (!(((((data22 === "string") || (data22 === "number")) || (data22 === "integer")) || (data22 === "boolean")) || (data22 === "array"))) {
11696
- validate76.errors = [{ instancePath: instancePath + "/$tags/" + key5.replace(/~/g, "~0").replace(/\//g, "~1") + "/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.type.enum }, message: "must be equal to one of the allowed values" }];
11697
- return false;
11494
+ var valid11 = _errs59 === errors;
11495
+ if (!valid11) {
11496
+ break;
11497
+ }
11498
+ }
11499
+ }
11500
+ else {
11501
+ validate76.errors = [{ instancePath: instancePath + "/$tags/$requiredTags", schemaPath: "#/properties/%24tags/properties/%24requiredTags/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
11502
+ return false;
11503
+ }
11504
+ }
11505
+ var valid10 = _errs57 === errors;
11506
+ }
11507
+ else {
11508
+ var valid10 = true;
11509
+ }
11510
+ if (valid10) {
11511
+ if (data21.$allowUndefinedTags !== undefined) {
11512
+ const _errs61 = errors;
11513
+ if (typeof data21.$allowUndefinedTags !== "boolean") {
11514
+ validate76.errors = [{ instancePath: instancePath + "/$tags/$allowUndefinedTags", schemaPath: "#/properties/%24tags/properties/%24allowUndefinedTags/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
11515
+ return false;
11516
+ }
11517
+ var valid10 = _errs61 === errors;
11518
+ }
11519
+ else {
11520
+ var valid10 = true;
11521
+ }
11522
+ if (valid10) {
11523
+ var props2 = {};
11524
+ props2.$requiredTags = true;
11525
+ props2.$allowUndefinedTags = true;
11526
+ for (const key6 in data21) {
11527
+ if (pattern45.test(key6)) {
11528
+ let data25 = data21[key6];
11529
+ const _errs63 = errors;
11530
+ if (errors === _errs63) {
11531
+ if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
11532
+ const _errs65 = errors;
11533
+ for (const key7 in data25) {
11534
+ if (!((((key7 === "type") || (key7 === "items")) || (key7 === "contains")) || (pattern46.test(key7)))) {
11535
+ validate76.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key7 }, message: "must NOT have additional properties" }];
11536
+ return false;
11537
+ break;
11538
+ }
11698
11539
  }
11699
- var valid12 = _errs56 === errors;
11700
- }
11701
- else {
11702
- var valid12 = true;
11703
- }
11704
- if (valid12) {
11705
- if (data21.items !== undefined) {
11706
- let data23 = data21.items;
11707
- const _errs57 = errors;
11708
- if (errors === _errs57) {
11709
- if (data23 && typeof data23 == "object" && !Array.isArray(data23)) {
11710
- if (data23.type !== undefined) {
11711
- let data24 = data23.type;
11712
- const _errs59 = errors;
11713
- if (!(((data24 === "string") || (data24 === "number")) || (data24 === "integer"))) {
11714
- validate76.errors = [{ instancePath: instancePath + "/$tags/" + key5.replace(/~/g, "~0").replace(/\//g, "~1") + "/items/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/items/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.items.properties.type.enum }, message: "must be equal to one of the allowed values" }];
11715
- return false;
11716
- }
11717
- var valid13 = _errs59 === errors;
11718
- }
11719
- else {
11720
- var valid13 = true;
11721
- }
11722
- if (valid13) {
11723
- var props3 = {};
11724
- props3.type = true;
11725
- for (const key7 in data23) {
11726
- if (pattern47.test(key7)) {
11727
- props3[key7] = true;
11728
- }
11729
- }
11730
- }
11731
- }
11732
- else {
11733
- validate76.errors = [{ instancePath: instancePath + "/$tags/" + key5.replace(/~/g, "~0").replace(/\//g, "~1") + "/items", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/items/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11540
+ if (_errs65 === errors) {
11541
+ if (data25.type !== undefined) {
11542
+ let data26 = data25.type;
11543
+ const _errs66 = errors;
11544
+ if (!(((((data26 === "string") || (data26 === "number")) || (data26 === "integer")) || (data26 === "boolean")) || (data26 === "array"))) {
11545
+ validate76.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.type.enum }, message: "must be equal to one of the allowed values" }];
11734
11546
  return false;
11735
11547
  }
11548
+ var valid13 = _errs66 === errors;
11736
11549
  }
11737
- var valid12 = _errs57 === errors;
11738
- }
11739
- else {
11740
- var valid12 = true;
11741
- }
11742
- if (valid12) {
11743
- if (data21.contains !== undefined) {
11744
- let data25 = data21.contains;
11745
- const _errs60 = errors;
11746
- if (errors === _errs60) {
11747
- if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
11748
- if (data25.type !== undefined) {
11749
- let data26 = data25.type;
11750
- const _errs62 = errors;
11751
- if (!(((data26 === "string") || (data26 === "number")) || (data26 === "integer"))) {
11752
- validate76.errors = [{ instancePath: instancePath + "/$tags/" + key5.replace(/~/g, "~0").replace(/\//g, "~1") + "/contains/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/contains/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.contains.properties.type.enum }, message: "must be equal to one of the allowed values" }];
11753
- return false;
11550
+ else {
11551
+ var valid13 = true;
11552
+ }
11553
+ if (valid13) {
11554
+ if (data25.items !== undefined) {
11555
+ let data27 = data25.items;
11556
+ const _errs67 = errors;
11557
+ if (errors === _errs67) {
11558
+ if (data27 && typeof data27 == "object" && !Array.isArray(data27)) {
11559
+ if (data27.type !== undefined) {
11560
+ let data28 = data27.type;
11561
+ const _errs69 = errors;
11562
+ if (!(((data28 === "string") || (data28 === "number")) || (data28 === "integer"))) {
11563
+ validate76.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/items/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/items/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.items.properties.type.enum }, message: "must be equal to one of the allowed values" }];
11564
+ return false;
11565
+ }
11566
+ var valid14 = _errs69 === errors;
11567
+ }
11568
+ else {
11569
+ var valid14 = true;
11570
+ }
11571
+ if (valid14) {
11572
+ var props3 = {};
11573
+ props3.type = true;
11574
+ for (const key8 in data27) {
11575
+ if (pattern47.test(key8)) {
11576
+ props3[key8] = true;
11577
+ }
11578
+ }
11754
11579
  }
11755
- var valid15 = _errs62 === errors;
11756
11580
  }
11757
11581
  else {
11758
- var valid15 = true;
11582
+ validate76.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/items", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/items/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11583
+ return false;
11759
11584
  }
11760
- if (valid15) {
11761
- var props4 = {};
11762
- props4.type = true;
11763
- for (const key8 in data25) {
11764
- if (pattern47.test(key8)) {
11765
- props4[key8] = true;
11585
+ }
11586
+ var valid13 = _errs67 === errors;
11587
+ }
11588
+ else {
11589
+ var valid13 = true;
11590
+ }
11591
+ if (valid13) {
11592
+ if (data25.contains !== undefined) {
11593
+ let data29 = data25.contains;
11594
+ const _errs70 = errors;
11595
+ if (errors === _errs70) {
11596
+ if (data29 && typeof data29 == "object" && !Array.isArray(data29)) {
11597
+ if (data29.type !== undefined) {
11598
+ let data30 = data29.type;
11599
+ const _errs72 = errors;
11600
+ if (!(((data30 === "string") || (data30 === "number")) || (data30 === "integer"))) {
11601
+ validate76.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/contains/type", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/contains/properties/type/enum", keyword: "enum", params: { allowedValues: schema123.properties.$tags.patternProperties["^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$"].properties.contains.properties.type.enum }, message: "must be equal to one of the allowed values" }];
11602
+ return false;
11603
+ }
11604
+ var valid16 = _errs72 === errors;
11605
+ }
11606
+ else {
11607
+ var valid16 = true;
11608
+ }
11609
+ if (valid16) {
11610
+ var props4 = {};
11611
+ props4.type = true;
11612
+ for (const key9 in data29) {
11613
+ if (pattern47.test(key9)) {
11614
+ props4[key9] = true;
11615
+ }
11616
+ }
11766
11617
  }
11767
11618
  }
11619
+ else {
11620
+ validate76.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1") + "/contains", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/contains/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11621
+ return false;
11622
+ }
11768
11623
  }
11624
+ var valid13 = _errs70 === errors;
11769
11625
  }
11770
11626
  else {
11771
- validate76.errors = [{ instancePath: instancePath + "/$tags/" + key5.replace(/~/g, "~0").replace(/\//g, "~1") + "/contains", schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/properties/contains/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11772
- return false;
11627
+ var valid13 = true;
11773
11628
  }
11774
11629
  }
11775
- var valid12 = _errs60 === errors;
11776
- }
11777
- else {
11778
- var valid12 = true;
11779
11630
  }
11780
11631
  }
11781
11632
  }
11633
+ else {
11634
+ validate76.errors = [{ instancePath: instancePath + "/$tags/" + key6.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11635
+ return false;
11636
+ }
11782
11637
  }
11783
- }
11784
- else {
11785
- validate76.errors = [{ instancePath: instancePath + "/$tags/" + key5.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/%24tags/patternProperties/%5E(%3F!%5C%24requiredTags%24%7C%5C%24allowUndefinedTags%24).*%24/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11786
- return false;
11638
+ props2[key6] = true;
11787
11639
  }
11788
11640
  }
11789
- props2[key5] = true;
11790
11641
  }
11791
11642
  }
11792
11643
  }
11793
11644
  }
11645
+ else {
11646
+ validate76.errors = [{ instancePath: instancePath + "/$tags", schemaPath: "#/properties/%24tags/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11647
+ return false;
11648
+ }
11794
11649
  }
11650
+ var valid0 = _errs55 === errors;
11795
11651
  }
11796
11652
  else {
11797
- validate76.errors = [{ instancePath: instancePath + "/$tags", schemaPath: "#/properties/%24tags/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11798
- return false;
11653
+ var valid0 = true;
11799
11654
  }
11800
- }
11801
- var valid0 = _errs45 === errors;
11802
- }
11803
- else {
11804
- var valid0 = true;
11805
- }
11806
- if (valid0) {
11807
- var valid17 = true;
11808
- for (const key9 in data) {
11809
- if (pattern43.test(key9)) {
11810
- const _errs63 = errors;
11811
- if (!(wrapper2.validate(data[key9], { instancePath: instancePath + "/" + key9.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data, parentDataProperty: key9, rootData, dynamicAnchors }))) {
11812
- vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);
11813
- errors = vErrors.length;
11814
- }
11815
- var valid17 = _errs63 === errors;
11816
- if (!valid17) {
11817
- break;
11655
+ if (valid0) {
11656
+ var valid18 = true;
11657
+ for (const key10 in data) {
11658
+ if (pattern43.test(key10)) {
11659
+ const _errs73 = errors;
11660
+ if (!(wrapper2.validate(data[key10], { instancePath: instancePath + "/" + key10.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data, parentDataProperty: key10, rootData, dynamicAnchors }))) {
11661
+ vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);
11662
+ errors = vErrors.length;
11663
+ }
11664
+ var valid18 = _errs73 === errors;
11665
+ if (!valid18) {
11666
+ break;
11667
+ }
11668
+ }
11818
11669
  }
11819
11670
  }
11820
11671
  }