@enbox/dwn-sdk-js 0.0.7 → 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 (351) 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 +761 -909
  4. package/dist/esm/generated/precompiled-validators.js.map +1 -1
  5. package/dist/esm/src/core/constants.js +11 -0
  6. package/dist/esm/src/core/constants.js.map +1 -0
  7. package/dist/esm/src/core/core-protocol.js +44 -0
  8. package/dist/esm/src/core/core-protocol.js.map +1 -0
  9. package/dist/esm/src/core/dwn-error.js +9 -12
  10. package/dist/esm/src/core/dwn-error.js.map +1 -1
  11. package/dist/esm/src/core/grant-authorization.js +16 -3
  12. package/dist/esm/src/core/grant-authorization.js.map +1 -1
  13. package/dist/esm/src/core/protocol-authorization-validation.js +67 -0
  14. package/dist/esm/src/core/protocol-authorization-validation.js.map +1 -1
  15. package/dist/esm/src/core/protocol-authorization.js +51 -30
  16. package/dist/esm/src/core/protocol-authorization.js.map +1 -1
  17. package/dist/esm/src/core/records-grant-authorization.js +6 -8
  18. package/dist/esm/src/core/records-grant-authorization.js.map +1 -1
  19. package/dist/esm/src/dwn.js +42 -18
  20. package/dist/esm/src/dwn.js.map +1 -1
  21. package/dist/esm/src/event-stream/event-emitter-event-log.js +204 -0
  22. package/dist/esm/src/event-stream/event-emitter-event-log.js.map +1 -0
  23. package/dist/esm/src/handlers/messages-read.js +7 -11
  24. package/dist/esm/src/handlers/messages-read.js.map +1 -1
  25. package/dist/esm/src/handlers/messages-subscribe.js +22 -24
  26. package/dist/esm/src/handlers/messages-subscribe.js.map +1 -1
  27. package/dist/esm/src/handlers/messages-sync.js +11 -15
  28. package/dist/esm/src/handlers/messages-sync.js.map +1 -1
  29. package/dist/esm/src/handlers/protocols-configure.js +37 -27
  30. package/dist/esm/src/handlers/protocols-configure.js.map +1 -1
  31. package/dist/esm/src/handlers/protocols-query.js +7 -11
  32. package/dist/esm/src/handlers/protocols-query.js.map +1 -1
  33. package/dist/esm/src/handlers/records-count.js +10 -12
  34. package/dist/esm/src/handlers/records-count.js.map +1 -1
  35. package/dist/esm/src/handlers/records-delete.js +10 -18
  36. package/dist/esm/src/handlers/records-delete.js.map +1 -1
  37. package/dist/esm/src/handlers/records-query.js +11 -15
  38. package/dist/esm/src/handlers/records-query.js.map +1 -1
  39. package/dist/esm/src/handlers/records-read.js +31 -26
  40. package/dist/esm/src/handlers/records-read.js.map +1 -1
  41. package/dist/esm/src/handlers/records-subscribe.js +39 -26
  42. package/dist/esm/src/handlers/records-subscribe.js.map +1 -1
  43. package/dist/esm/src/handlers/records-write.js +47 -105
  44. package/dist/esm/src/handlers/records-write.js.map +1 -1
  45. package/dist/esm/src/index.js +5 -2
  46. package/dist/esm/src/index.js.map +1 -1
  47. package/dist/esm/src/interfaces/messages-subscribe.js +1 -0
  48. package/dist/esm/src/interfaces/messages-subscribe.js.map +1 -1
  49. package/dist/esm/src/interfaces/protocols-configure.js +25 -3
  50. package/dist/esm/src/interfaces/protocols-configure.js.map +1 -1
  51. package/dist/esm/src/interfaces/records-count.js +1 -1
  52. package/dist/esm/src/interfaces/records-count.js.map +1 -1
  53. package/dist/esm/src/interfaces/records-delete.js +1 -1
  54. package/dist/esm/src/interfaces/records-delete.js.map +1 -1
  55. package/dist/esm/src/interfaces/records-query.js +1 -1
  56. package/dist/esm/src/interfaces/records-query.js.map +1 -1
  57. package/dist/esm/src/interfaces/records-read.js +1 -1
  58. package/dist/esm/src/interfaces/records-read.js.map +1 -1
  59. package/dist/esm/src/interfaces/records-subscribe.js +2 -1
  60. package/dist/esm/src/interfaces/records-subscribe.js.map +1 -1
  61. package/dist/esm/src/interfaces/records-write-signing.js +1 -12
  62. package/dist/esm/src/interfaces/records-write-signing.js.map +1 -1
  63. package/dist/esm/src/interfaces/records-write.js +22 -41
  64. package/dist/esm/src/interfaces/records-write.js.map +1 -1
  65. package/dist/esm/src/protocols/permission-grant.js +1 -1
  66. package/dist/esm/src/protocols/permission-grant.js.map +1 -1
  67. package/dist/esm/src/protocols/permission-request.js +1 -1
  68. package/dist/esm/src/protocols/permission-request.js.map +1 -1
  69. package/dist/esm/src/protocols/permissions.js +113 -5
  70. package/dist/esm/src/protocols/permissions.js.map +1 -1
  71. package/dist/esm/src/state-index/state-index-level.js +5 -7
  72. package/dist/esm/src/state-index/state-index-level.js.map +1 -1
  73. package/dist/esm/src/store/data-store-level.js +110 -33
  74. package/dist/esm/src/store/data-store-level.js.map +1 -1
  75. package/dist/esm/src/store/index-level.js +42 -32
  76. package/dist/esm/src/store/index-level.js.map +1 -1
  77. package/dist/esm/src/store/storage-controller.js +6 -6
  78. package/dist/esm/src/store/storage-controller.js.map +1 -1
  79. package/dist/esm/src/types/permission-types.js.map +1 -1
  80. package/dist/esm/src/types/protocols-types.js +10 -0
  81. package/dist/esm/src/types/protocols-types.js.map +1 -1
  82. package/dist/esm/src/types/records-types.js.map +1 -1
  83. package/dist/esm/src/utils/hd-key.js +0 -8
  84. package/dist/esm/src/utils/hd-key.js.map +1 -1
  85. package/dist/esm/src/utils/messages.js +16 -34
  86. package/dist/esm/src/utils/messages.js.map +1 -1
  87. package/dist/esm/src/utils/records.js +5 -43
  88. package/dist/esm/src/utils/records.js.map +1 -1
  89. package/dist/esm/tests/core/protocol-authorization.spec.js +2 -1
  90. package/dist/esm/tests/core/protocol-authorization.spec.js.map +1 -1
  91. package/dist/esm/tests/dwn.spec.js +32 -43
  92. package/dist/esm/tests/dwn.spec.js.map +1 -1
  93. package/dist/esm/tests/event-emitter-event-log.spec.js +305 -0
  94. package/dist/esm/tests/event-emitter-event-log.spec.js.map +1 -0
  95. package/dist/esm/tests/features/author-delegated-grant.spec.js +14 -7
  96. package/dist/esm/tests/features/author-delegated-grant.spec.js.map +1 -1
  97. package/dist/esm/tests/features/owner-delegated-grant.spec.js +9 -5
  98. package/dist/esm/tests/features/owner-delegated-grant.spec.js.map +1 -1
  99. package/dist/esm/tests/features/owner-signature.spec.js +14 -7
  100. package/dist/esm/tests/features/owner-signature.spec.js.map +1 -1
  101. package/dist/esm/tests/features/permissions.spec.js +12 -12
  102. package/dist/esm/tests/features/permissions.spec.js.map +1 -1
  103. package/dist/esm/tests/features/protocol-composition.spec.js +636 -5
  104. package/dist/esm/tests/features/protocol-composition.spec.js.map +1 -1
  105. package/dist/esm/tests/features/protocol-create-action.spec.js +4 -4
  106. package/dist/esm/tests/features/protocol-create-action.spec.js.map +1 -1
  107. package/dist/esm/tests/features/protocol-delete-action.spec.js +7 -7
  108. package/dist/esm/tests/features/protocol-delete-action.spec.js.map +1 -1
  109. package/dist/esm/tests/features/protocol-update-action.spec.js +4 -4
  110. package/dist/esm/tests/features/protocol-update-action.spec.js.map +1 -1
  111. package/dist/esm/tests/features/records-immutable.spec.js +315 -0
  112. package/dist/esm/tests/features/records-immutable.spec.js.map +1 -0
  113. package/dist/esm/tests/features/records-prune.spec.js +4 -4
  114. package/dist/esm/tests/features/records-prune.spec.js.map +1 -1
  115. package/dist/esm/tests/features/records-record-limit.spec.js +542 -0
  116. package/dist/esm/tests/features/records-record-limit.spec.js.map +1 -0
  117. package/dist/esm/tests/features/records-tags.spec.js +16 -4
  118. package/dist/esm/tests/features/records-tags.spec.js.map +1 -1
  119. package/dist/esm/tests/features/resumable-tasks.spec.js +7 -8
  120. package/dist/esm/tests/features/resumable-tasks.spec.js.map +1 -1
  121. package/dist/esm/tests/handlers/messages-read.spec.js +11 -5
  122. package/dist/esm/tests/handlers/messages-read.spec.js.map +1 -1
  123. package/dist/esm/tests/handlers/messages-subscribe.spec.js +169 -22
  124. package/dist/esm/tests/handlers/messages-subscribe.spec.js.map +1 -1
  125. package/dist/esm/tests/handlers/messages-sync.spec.js +103 -21
  126. package/dist/esm/tests/handlers/messages-sync.spec.js.map +1 -1
  127. package/dist/esm/tests/handlers/protocols-configure.spec.js +5 -5
  128. package/dist/esm/tests/handlers/protocols-configure.spec.js.map +1 -1
  129. package/dist/esm/tests/handlers/protocols-query.spec.js +5 -5
  130. package/dist/esm/tests/handlers/protocols-query.spec.js.map +1 -1
  131. package/dist/esm/tests/handlers/records-count.spec.js +9 -4
  132. package/dist/esm/tests/handlers/records-count.spec.js.map +1 -1
  133. package/dist/esm/tests/handlers/records-delete.spec.js +24 -25
  134. package/dist/esm/tests/handlers/records-delete.spec.js.map +1 -1
  135. package/dist/esm/tests/handlers/records-query.spec.js +68 -9
  136. package/dist/esm/tests/handlers/records-query.spec.js.map +1 -1
  137. package/dist/esm/tests/handlers/records-read.spec.js +24 -138
  138. package/dist/esm/tests/handlers/records-read.spec.js.map +1 -1
  139. package/dist/esm/tests/handlers/records-subscribe.spec.js +175 -35
  140. package/dist/esm/tests/handlers/records-subscribe.spec.js.map +1 -1
  141. package/dist/esm/tests/handlers/records-write.spec.js +173 -72
  142. package/dist/esm/tests/handlers/records-write.spec.js.map +1 -1
  143. package/dist/esm/tests/interfaces/records-write.spec.js +52 -68
  144. package/dist/esm/tests/interfaces/records-write.spec.js.map +1 -1
  145. package/dist/esm/tests/protocols/permission-grant.spec.js +6 -6
  146. package/dist/esm/tests/protocols/permission-grant.spec.js.map +1 -1
  147. package/dist/esm/tests/protocols/permission-request.spec.js +4 -4
  148. package/dist/esm/tests/protocols/permission-request.spec.js.map +1 -1
  149. package/dist/esm/tests/protocols/permissions.spec.js +4 -4
  150. package/dist/esm/tests/protocols/permissions.spec.js.map +1 -1
  151. package/dist/esm/tests/scenarios/aggregator.spec.js +4 -4
  152. package/dist/esm/tests/scenarios/aggregator.spec.js.map +1 -1
  153. package/dist/esm/tests/scenarios/deleted-record.spec.js +350 -5
  154. package/dist/esm/tests/scenarios/deleted-record.spec.js.map +1 -1
  155. package/dist/esm/tests/scenarios/end-to-end-tests.spec.js +4 -4
  156. package/dist/esm/tests/scenarios/end-to-end-tests.spec.js.map +1 -1
  157. package/dist/esm/tests/scenarios/nested-roles.spec.js +4 -4
  158. package/dist/esm/tests/scenarios/nested-roles.spec.js.map +1 -1
  159. package/dist/esm/tests/scenarios/subscriptions.spec.js +93 -40
  160. package/dist/esm/tests/scenarios/subscriptions.spec.js.map +1 -1
  161. package/dist/esm/tests/store/data-store-level.spec.js +102 -41
  162. package/dist/esm/tests/store/data-store-level.spec.js.map +1 -1
  163. package/dist/esm/tests/test-event-stream.js +12 -13
  164. package/dist/esm/tests/test-event-stream.js.map +1 -1
  165. package/dist/esm/tests/test-suite.js +6 -4
  166. package/dist/esm/tests/test-suite.js.map +1 -1
  167. package/dist/esm/tests/utils/messages.spec.js +12 -5
  168. package/dist/esm/tests/utils/messages.spec.js.map +1 -1
  169. package/dist/esm/tests/utils/records.spec.js +8 -12
  170. package/dist/esm/tests/utils/records.spec.js.map +1 -1
  171. package/dist/esm/tests/utils/test-data-generator.js +35 -2
  172. package/dist/esm/tests/utils/test-data-generator.js.map +1 -1
  173. package/dist/esm/tests/validation/json-schemas/records/records-write.spec.js +37 -8
  174. package/dist/esm/tests/validation/json-schemas/records/records-write.spec.js.map +1 -1
  175. package/dist/types/generated/precompiled-validators.d.ts +49 -40
  176. package/dist/types/generated/precompiled-validators.d.ts.map +1 -1
  177. package/dist/types/src/core/constants.d.ts +11 -0
  178. package/dist/types/src/core/constants.d.ts.map +1 -0
  179. package/dist/types/src/core/core-protocol.d.ts +89 -0
  180. package/dist/types/src/core/core-protocol.d.ts.map +1 -0
  181. package/dist/types/src/core/dwn-error.d.ts +9 -12
  182. package/dist/types/src/core/dwn-error.d.ts.map +1 -1
  183. package/dist/types/src/core/grant-authorization.d.ts +6 -2
  184. package/dist/types/src/core/grant-authorization.d.ts.map +1 -1
  185. package/dist/types/src/core/protocol-authorization-validation.d.ts +21 -0
  186. package/dist/types/src/core/protocol-authorization-validation.d.ts.map +1 -1
  187. package/dist/types/src/core/protocol-authorization.d.ts +19 -11
  188. package/dist/types/src/core/protocol-authorization.d.ts.map +1 -1
  189. package/dist/types/src/core/records-grant-authorization.d.ts.map +1 -1
  190. package/dist/types/src/dwn.d.ts +19 -7
  191. package/dist/types/src/dwn.d.ts.map +1 -1
  192. package/dist/types/src/event-stream/event-emitter-event-log.d.ts +50 -0
  193. package/dist/types/src/event-stream/event-emitter-event-log.d.ts.map +1 -0
  194. package/dist/types/src/handlers/messages-read.d.ts +3 -8
  195. package/dist/types/src/handlers/messages-read.d.ts.map +1 -1
  196. package/dist/types/src/handlers/messages-subscribe.d.ts +6 -10
  197. package/dist/types/src/handlers/messages-subscribe.d.ts.map +1 -1
  198. package/dist/types/src/handlers/messages-sync.d.ts +3 -8
  199. package/dist/types/src/handlers/messages-sync.d.ts.map +1 -1
  200. package/dist/types/src/handlers/protocols-configure.d.ts +3 -10
  201. package/dist/types/src/handlers/protocols-configure.d.ts.map +1 -1
  202. package/dist/types/src/handlers/protocols-query.d.ts +3 -8
  203. package/dist/types/src/handlers/protocols-query.d.ts.map +1 -1
  204. package/dist/types/src/handlers/records-count.d.ts +3 -6
  205. package/dist/types/src/handlers/records-count.d.ts.map +1 -1
  206. package/dist/types/src/handlers/records-delete.d.ts +3 -8
  207. package/dist/types/src/handlers/records-delete.d.ts.map +1 -1
  208. package/dist/types/src/handlers/records-query.d.ts +3 -8
  209. package/dist/types/src/handlers/records-query.d.ts.map +1 -1
  210. package/dist/types/src/handlers/records-read.d.ts +3 -8
  211. package/dist/types/src/handlers/records-read.d.ts.map +1 -1
  212. package/dist/types/src/handlers/records-subscribe.d.ts +8 -10
  213. package/dist/types/src/handlers/records-subscribe.d.ts.map +1 -1
  214. package/dist/types/src/handlers/records-write.d.ts +4 -25
  215. package/dist/types/src/handlers/records-write.d.ts.map +1 -1
  216. package/dist/types/src/index.d.ts +8 -4
  217. package/dist/types/src/index.d.ts.map +1 -1
  218. package/dist/types/src/interfaces/messages-subscribe.d.ts +5 -0
  219. package/dist/types/src/interfaces/messages-subscribe.d.ts.map +1 -1
  220. package/dist/types/src/interfaces/protocols-configure.d.ts.map +1 -1
  221. package/dist/types/src/interfaces/records-subscribe.d.ts +5 -0
  222. package/dist/types/src/interfaces/records-subscribe.d.ts.map +1 -1
  223. package/dist/types/src/interfaces/records-write-signing.d.ts +3 -4
  224. package/dist/types/src/interfaces/records-write-signing.d.ts.map +1 -1
  225. package/dist/types/src/interfaces/records-write.d.ts +5 -11
  226. package/dist/types/src/interfaces/records-write.d.ts.map +1 -1
  227. package/dist/types/src/protocols/permission-grant.d.ts +1 -1
  228. package/dist/types/src/protocols/permission-grant.d.ts.map +1 -1
  229. package/dist/types/src/protocols/permission-request.d.ts +1 -1
  230. package/dist/types/src/protocols/permission-request.d.ts.map +1 -1
  231. package/dist/types/src/protocols/permissions.d.ts +40 -3
  232. package/dist/types/src/protocols/permissions.d.ts.map +1 -1
  233. package/dist/types/src/state-index/state-index-level.d.ts.map +1 -1
  234. package/dist/types/src/store/data-store-level.d.ts +20 -4
  235. package/dist/types/src/store/data-store-level.d.ts.map +1 -1
  236. package/dist/types/src/store/index-level.d.ts +4 -0
  237. package/dist/types/src/store/index-level.d.ts.map +1 -1
  238. package/dist/types/src/store/storage-controller.d.ts +4 -4
  239. package/dist/types/src/store/storage-controller.d.ts.map +1 -1
  240. package/dist/types/src/types/message-types.d.ts +3 -3
  241. package/dist/types/src/types/message-types.d.ts.map +1 -1
  242. package/dist/types/src/types/messages-types.d.ts +12 -3
  243. package/dist/types/src/types/messages-types.d.ts.map +1 -1
  244. package/dist/types/src/types/method-handler.d.ts +24 -3
  245. package/dist/types/src/types/method-handler.d.ts.map +1 -1
  246. package/dist/types/src/types/permission-types.d.ts +7 -0
  247. package/dist/types/src/types/permission-types.d.ts.map +1 -1
  248. package/dist/types/src/types/protocols-types.d.ts +41 -1
  249. package/dist/types/src/types/protocols-types.d.ts.map +1 -1
  250. package/dist/types/src/types/records-types.d.ts +16 -6
  251. package/dist/types/src/types/records-types.d.ts.map +1 -1
  252. package/dist/types/src/types/subscriptions.d.ts +151 -13
  253. package/dist/types/src/types/subscriptions.d.ts.map +1 -1
  254. package/dist/types/src/utils/hd-key.d.ts +1 -9
  255. package/dist/types/src/utils/hd-key.d.ts.map +1 -1
  256. package/dist/types/src/utils/messages.d.ts +7 -5
  257. package/dist/types/src/utils/messages.d.ts.map +1 -1
  258. package/dist/types/src/utils/records.d.ts +1 -11
  259. package/dist/types/src/utils/records.d.ts.map +1 -1
  260. package/dist/types/tests/dwn.spec.d.ts.map +1 -1
  261. package/dist/types/tests/event-emitter-event-log.spec.d.ts +2 -0
  262. package/dist/types/tests/event-emitter-event-log.spec.d.ts.map +1 -0
  263. package/dist/types/tests/features/author-delegated-grant.spec.d.ts.map +1 -1
  264. package/dist/types/tests/features/owner-delegated-grant.spec.d.ts.map +1 -1
  265. package/dist/types/tests/features/owner-signature.spec.d.ts.map +1 -1
  266. package/dist/types/tests/features/protocol-composition.spec.d.ts.map +1 -1
  267. package/dist/types/tests/features/records-immutable.spec.d.ts +2 -0
  268. package/dist/types/tests/features/records-immutable.spec.d.ts.map +1 -0
  269. package/dist/types/tests/features/records-record-limit.spec.d.ts +2 -0
  270. package/dist/types/tests/features/records-record-limit.spec.d.ts.map +1 -0
  271. package/dist/types/tests/features/records-tags.spec.d.ts.map +1 -1
  272. package/dist/types/tests/features/resumable-tasks.spec.d.ts.map +1 -1
  273. package/dist/types/tests/handlers/messages-read.spec.d.ts.map +1 -1
  274. package/dist/types/tests/handlers/messages-subscribe.spec.d.ts.map +1 -1
  275. package/dist/types/tests/handlers/messages-sync.spec.d.ts.map +1 -1
  276. package/dist/types/tests/handlers/records-count.spec.d.ts.map +1 -1
  277. package/dist/types/tests/handlers/records-delete.spec.d.ts.map +1 -1
  278. package/dist/types/tests/handlers/records-query.spec.d.ts.map +1 -1
  279. package/dist/types/tests/handlers/records-read.spec.d.ts.map +1 -1
  280. package/dist/types/tests/handlers/records-subscribe.spec.d.ts.map +1 -1
  281. package/dist/types/tests/handlers/records-write.spec.d.ts.map +1 -1
  282. package/dist/types/tests/scenarios/deleted-record.spec.d.ts.map +1 -1
  283. package/dist/types/tests/scenarios/subscriptions.spec.d.ts.map +1 -1
  284. package/dist/types/tests/test-event-stream.d.ts +11 -12
  285. package/dist/types/tests/test-event-stream.d.ts.map +1 -1
  286. package/dist/types/tests/test-suite.d.ts +2 -2
  287. package/dist/types/tests/test-suite.d.ts.map +1 -1
  288. package/dist/types/tests/utils/test-data-generator.d.ts +18 -0
  289. package/dist/types/tests/utils/test-data-generator.d.ts.map +1 -1
  290. package/package.json +5 -4
  291. package/src/core/constants.ts +11 -0
  292. package/src/core/core-protocol.ts +129 -0
  293. package/src/core/dwn-error.ts +15 -12
  294. package/src/core/grant-authorization.ts +20 -3
  295. package/src/core/protocol-authorization-validation.ts +96 -0
  296. package/src/core/protocol-authorization.ts +67 -23
  297. package/src/core/records-grant-authorization.ts +6 -8
  298. package/src/dwn.ts +58 -73
  299. package/src/event-stream/event-emitter-event-log.ts +283 -0
  300. package/src/handlers/messages-read.ts +8 -9
  301. package/src/handlers/messages-subscribe.ts +24 -28
  302. package/src/handlers/messages-sync.ts +10 -16
  303. package/src/handlers/protocols-configure.ts +47 -32
  304. package/src/handlers/protocols-query.ts +6 -9
  305. package/src/handlers/records-count.ts +11 -10
  306. package/src/handlers/records-delete.ts +12 -21
  307. package/src/handlers/records-query.ts +12 -12
  308. package/src/handlers/records-read.ts +34 -22
  309. package/src/handlers/records-subscribe.ts +47 -26
  310. package/src/handlers/records-write.ts +47 -120
  311. package/src/index.ts +9 -5
  312. package/src/interfaces/messages-subscribe.ts +7 -1
  313. package/src/interfaces/protocols-configure.ts +40 -3
  314. package/src/interfaces/records-count.ts +1 -1
  315. package/src/interfaces/records-delete.ts +1 -1
  316. package/src/interfaces/records-query.ts +1 -1
  317. package/src/interfaces/records-read.ts +1 -1
  318. package/src/interfaces/records-subscribe.ts +8 -1
  319. package/src/interfaces/records-write-signing.ts +2 -22
  320. package/src/interfaces/records-write.ts +25 -48
  321. package/src/protocols/permission-grant.ts +1 -1
  322. package/src/protocols/permission-request.ts +1 -1
  323. package/src/protocols/permissions.ts +148 -6
  324. package/src/state-index/state-index-level.ts +5 -7
  325. package/src/store/data-store-level.ts +124 -34
  326. package/src/store/index-level.ts +44 -35
  327. package/src/store/storage-controller.ts +11 -11
  328. package/src/types/message-types.ts +3 -3
  329. package/src/types/messages-types.ts +12 -3
  330. package/src/types/method-handler.ts +26 -4
  331. package/src/types/mitt.d.ts +28 -0
  332. package/src/types/permission-types.ts +7 -0
  333. package/src/types/protocols-types.ts +46 -0
  334. package/src/types/records-types.ts +16 -6
  335. package/src/types/subscriptions.ts +178 -14
  336. package/src/utils/hd-key.ts +0 -9
  337. package/src/utils/messages.ts +17 -37
  338. package/src/utils/records.ts +7 -58
  339. package/dist/esm/src/event-stream/event-emitter-stream.js +0 -46
  340. package/dist/esm/src/event-stream/event-emitter-stream.js.map +0 -1
  341. package/dist/esm/tests/event-stream/event-emitter-stream.spec.js +0 -68
  342. package/dist/esm/tests/event-stream/event-emitter-stream.spec.js.map +0 -1
  343. package/dist/esm/tests/event-stream/event-stream.spec.js +0 -114
  344. package/dist/esm/tests/event-stream/event-stream.spec.js.map +0 -1
  345. package/dist/types/src/event-stream/event-emitter-stream.d.ts +0 -23
  346. package/dist/types/src/event-stream/event-emitter-stream.d.ts.map +0 -1
  347. package/dist/types/tests/event-stream/event-emitter-stream.spec.d.ts +0 -2
  348. package/dist/types/tests/event-stream/event-emitter-stream.spec.d.ts.map +0 -1
  349. package/dist/types/tests/event-stream/event-stream.spec.d.ts +0 -2
  350. package/dist/types/tests/event-stream/event-stream.spec.d.ts.map +0 -1
  351. package/src/event-stream/event-emitter-stream.ts +0 -69
@@ -167,7 +167,7 @@ validate20.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": f
167
167
  export const AuthorizationDelegatedGrant = validate24;
168
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" } } };
169
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" } } };
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"], "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"] } }] }] }] } } };
171
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_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$" };
172
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$" };
173
173
  const func1 = func1Mod.default ?? func1Mod;
@@ -1434,282 +1434,37 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1434
1434
  if (evaluated0.dynamicItems) {
1435
1435
  evaluated0.items = undefined;
1436
1436
  }
1437
- const _errs2 = errors;
1438
- let valid0 = false;
1439
- const _errs3 = errors;
1440
- if (data && typeof data == "object" && !Array.isArray(data)) {
1441
- let missing0;
1442
- if ((data.contextId === undefined) && (missing0 = "contextId")) {
1443
- const err0 = { instancePath, schemaPath: "#/anyOf/0/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" };
1444
- if (vErrors === null) {
1445
- vErrors = [err0];
1446
- }
1447
- else {
1448
- vErrors.push(err0);
1449
- }
1450
- errors++;
1451
- }
1452
- else {
1453
- if (data.descriptor !== undefined) {
1454
- let data0 = data.descriptor;
1455
- const _errs4 = errors;
1456
- if (errors === _errs4) {
1457
- if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
1458
- let missing1;
1459
- if (((data0.protocol === undefined) && (missing1 = "protocol")) || ((data0.protocolPath === undefined) && (missing1 = "protocolPath"))) {
1460
- const err1 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/0/properties/descriptor/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" };
1461
- if (vErrors === null) {
1462
- vErrors = [err1];
1463
- }
1464
- else {
1465
- vErrors.push(err1);
1466
- }
1467
- errors++;
1468
- }
1469
- }
1470
- else {
1471
- const err2 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/0/properties/descriptor/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1472
- if (vErrors === null) {
1473
- vErrors = [err2];
1474
- }
1475
- else {
1476
- vErrors.push(err2);
1477
- }
1478
- errors++;
1479
- }
1480
- }
1481
- }
1482
- }
1483
- }
1484
- var _valid0 = _errs3 === errors;
1485
- valid0 = valid0 || _valid0;
1486
- if (_valid0) {
1487
- var props0 = {};
1488
- props0.descriptor = true;
1489
- }
1490
- const _errs6 = errors;
1491
- const _errs7 = errors;
1492
- const _errs8 = errors;
1493
- const _errs9 = errors;
1494
- if (data && typeof data == "object" && !Array.isArray(data)) {
1495
- let missing2;
1496
- if ((data.contextId === undefined) && (missing2 = "contextId")) {
1497
- const err3 = {};
1498
- if (vErrors === null) {
1499
- vErrors = [err3];
1500
- }
1501
- else {
1502
- vErrors.push(err3);
1503
- }
1504
- errors++;
1505
- }
1506
- }
1507
- var valid3 = _errs9 === errors;
1508
- if (valid3) {
1509
- const err4 = { instancePath, schemaPath: "#/anyOf/1/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
1510
- if (vErrors === null) {
1511
- vErrors = [err4];
1512
- }
1513
- else {
1514
- vErrors.push(err4);
1515
- }
1516
- errors++;
1517
- }
1518
- else {
1519
- errors = _errs8;
1520
- if (vErrors !== null) {
1521
- if (_errs8) {
1522
- vErrors.length = _errs8;
1523
- }
1524
- else {
1525
- vErrors = null;
1526
- }
1527
- }
1528
- }
1529
- var valid2 = _errs7 === errors;
1530
- if (valid2) {
1531
- const _errs10 = errors;
1532
- if (data && typeof data == "object" && !Array.isArray(data)) {
1533
- if (data.descriptor !== undefined) {
1534
- let data1 = data.descriptor;
1535
- if (!(data1 && typeof data1 == "object" && !Array.isArray(data1))) {
1536
- const err5 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/1/allOf/1/properties/descriptor/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1537
- if (vErrors === null) {
1538
- vErrors = [err5];
1539
- }
1540
- else {
1541
- vErrors.push(err5);
1542
- }
1543
- errors++;
1544
- }
1545
- const _errs13 = errors;
1546
- const _errs14 = errors;
1547
- if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
1548
- let missing3;
1549
- if ((data1.protocol === undefined) && (missing3 = "protocol")) {
1550
- const err6 = {};
1551
- if (vErrors === null) {
1552
- vErrors = [err6];
1553
- }
1554
- else {
1555
- vErrors.push(err6);
1556
- }
1557
- errors++;
1558
- }
1559
- }
1560
- var valid5 = _errs14 === errors;
1561
- if (valid5) {
1562
- const err7 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/1/allOf/1/properties/descriptor/not", keyword: "not", params: {}, message: "must NOT be valid" };
1563
- if (vErrors === null) {
1564
- vErrors = [err7];
1565
- }
1566
- else {
1567
- vErrors.push(err7);
1568
- }
1569
- errors++;
1570
- }
1571
- else {
1572
- errors = _errs13;
1573
- if (vErrors !== null) {
1574
- if (_errs13) {
1575
- vErrors.length = _errs13;
1576
- }
1577
- else {
1578
- vErrors = null;
1579
- }
1580
- }
1581
- }
1582
- }
1583
- }
1584
- var valid2 = _errs10 === errors;
1585
- if (valid2) {
1586
- const _errs15 = errors;
1587
- if (data && typeof data == "object" && !Array.isArray(data)) {
1588
- if (data.descriptor !== undefined) {
1589
- let data2 = data.descriptor;
1590
- if (!(data2 && typeof data2 == "object" && !Array.isArray(data2))) {
1591
- const err8 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/1/allOf/2/properties/descriptor/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1592
- if (vErrors === null) {
1593
- vErrors = [err8];
1594
- }
1595
- else {
1596
- vErrors.push(err8);
1597
- }
1598
- errors++;
1599
- }
1600
- const _errs18 = errors;
1601
- const _errs19 = errors;
1602
- if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
1603
- let missing4;
1604
- if ((data2.protocolPath === undefined) && (missing4 = "protocolPath")) {
1605
- const err9 = {};
1606
- if (vErrors === null) {
1607
- vErrors = [err9];
1608
- }
1609
- else {
1610
- vErrors.push(err9);
1611
- }
1612
- errors++;
1613
- }
1614
- }
1615
- var valid7 = _errs19 === errors;
1616
- if (valid7) {
1617
- const err10 = { instancePath: instancePath + "/descriptor", schemaPath: "#/anyOf/1/allOf/2/properties/descriptor/not", keyword: "not", params: {}, message: "must NOT be valid" };
1618
- if (vErrors === null) {
1619
- vErrors = [err10];
1620
- }
1621
- else {
1622
- vErrors.push(err10);
1623
- }
1624
- errors++;
1625
- }
1626
- else {
1627
- errors = _errs18;
1628
- if (vErrors !== null) {
1629
- if (_errs18) {
1630
- vErrors.length = _errs18;
1631
- }
1632
- else {
1633
- vErrors = null;
1634
- }
1635
- }
1636
- }
1637
- }
1638
- }
1639
- var valid2 = _errs15 === errors;
1640
- }
1641
- }
1642
- var _valid0 = _errs6 === errors;
1643
- valid0 = valid0 || _valid0;
1644
- if (_valid0) {
1645
- if (props0 !== true) {
1646
- props0 = props0 || {};
1647
- props0.descriptor = true;
1648
- }
1649
- }
1650
- if (!valid0) {
1651
- const err11 = { instancePath, schemaPath: "#/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
1652
- if (vErrors === null) {
1653
- vErrors = [err11];
1654
- }
1655
- else {
1656
- vErrors.push(err11);
1657
- }
1658
- errors++;
1659
- validate27.errors = vErrors;
1660
- return false;
1661
- }
1662
- else {
1663
- errors = _errs2;
1664
- if (vErrors !== null) {
1665
- if (_errs2) {
1666
- vErrors.length = _errs2;
1667
- }
1668
- else {
1669
- vErrors = null;
1670
- }
1671
- }
1672
- }
1673
1437
  if (errors === 0) {
1674
1438
  if (data && typeof data == "object" && !Array.isArray(data)) {
1675
- let missing5;
1676
- if ((data.descriptor === undefined) && (missing5 = "descriptor")) {
1677
- 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 + "'" }];
1678
1442
  return false;
1679
1443
  }
1680
1444
  else {
1681
- if (props0 !== true) {
1682
- props0 = props0 || {};
1683
- props0.recordId = true;
1684
- props0.contextId = true;
1685
- props0.attestation = true;
1686
- props0.authorization = true;
1687
- props0.encryption = true;
1688
- props0.descriptor = true;
1689
- }
1690
1445
  if (data.recordId !== undefined) {
1691
- const _errs20 = errors;
1446
+ const _errs1 = errors;
1692
1447
  if (typeof data.recordId !== "string") {
1693
1448
  validate27.errors = [{ instancePath: instancePath + "/recordId", schemaPath: "#/properties/recordId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
1694
1449
  return false;
1695
1450
  }
1696
- var valid8 = _errs20 === errors;
1451
+ var valid0 = _errs1 === errors;
1697
1452
  }
1698
1453
  else {
1699
- var valid8 = true;
1454
+ var valid0 = true;
1700
1455
  }
1701
- if (valid8) {
1456
+ if (valid0) {
1702
1457
  if (data.contextId !== undefined) {
1703
- let data4 = data.contextId;
1704
- const _errs22 = errors;
1705
- if (errors === _errs22) {
1706
- if (typeof data4 === "string") {
1707
- 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) {
1708
1463
  validate27.errors = [{ instancePath: instancePath + "/contextId", schemaPath: "#/properties/contextId/maxLength", keyword: "maxLength", params: { limit: 600 }, message: "must NOT have more than 600 characters" }];
1709
1464
  return false;
1710
1465
  }
1711
1466
  else {
1712
- if (!pattern7.test(data4)) {
1467
+ if (!pattern7.test(data1)) {
1713
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]+)*$" + "\"" }];
1714
1469
  return false;
1715
1470
  }
@@ -1720,63 +1475,63 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1720
1475
  return false;
1721
1476
  }
1722
1477
  }
1723
- var valid8 = _errs22 === errors;
1478
+ var valid0 = _errs3 === errors;
1724
1479
  }
1725
1480
  else {
1726
- var valid8 = true;
1481
+ var valid0 = true;
1727
1482
  }
1728
- if (valid8) {
1483
+ if (valid0) {
1729
1484
  if (data.attestation !== undefined) {
1730
- const _errs24 = errors;
1485
+ const _errs5 = errors;
1731
1486
  if (!(validate21(data.attestation, { instancePath: instancePath + "/attestation", parentData: data, parentDataProperty: "attestation", rootData, dynamicAnchors }))) {
1732
1487
  vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);
1733
1488
  errors = vErrors.length;
1734
1489
  }
1735
- var valid8 = _errs24 === errors;
1490
+ var valid0 = _errs5 === errors;
1736
1491
  }
1737
1492
  else {
1738
- var valid8 = true;
1493
+ var valid0 = true;
1739
1494
  }
1740
- if (valid8) {
1495
+ if (valid0) {
1741
1496
  if (data.authorization !== undefined) {
1742
- const _errs25 = errors;
1497
+ const _errs6 = errors;
1743
1498
  if (!(validate29(data.authorization, { instancePath: instancePath + "/authorization", parentData: data, parentDataProperty: "authorization", rootData, dynamicAnchors }))) {
1744
1499
  vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);
1745
1500
  errors = vErrors.length;
1746
1501
  }
1747
- var valid8 = _errs25 === errors;
1502
+ var valid0 = _errs6 === errors;
1748
1503
  }
1749
1504
  else {
1750
- var valid8 = true;
1505
+ var valid0 = true;
1751
1506
  }
1752
- if (valid8) {
1507
+ if (valid0) {
1753
1508
  if (data.encryption !== undefined) {
1754
- let data7 = data.encryption;
1755
- const _errs26 = errors;
1756
- if (errors === _errs26) {
1757
- if (data7 && typeof data7 == "object" && !Array.isArray(data7)) {
1758
- let missing6;
1759
- if (((((data7.protected === undefined) && (missing6 = "protected")) || ((data7.iv === undefined) && (missing6 = "iv"))) || ((data7.tag === undefined) && (missing6 = "tag"))) || ((data7.recipients === undefined) && (missing6 = "recipients"))) {
1760
- 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 + "'" }];
1761
1516
  return false;
1762
1517
  }
1763
1518
  else {
1764
- const _errs28 = errors;
1765
- for (const key0 in data7) {
1519
+ const _errs9 = errors;
1520
+ for (const key0 in data4) {
1766
1521
  if (!((((key0 === "protected") || (key0 === "iv")) || (key0 === "tag")) || (key0 === "recipients"))) {
1767
1522
  validate27.errors = [{ instancePath: instancePath + "/encryption", schemaPath: "#/properties/encryption/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
1768
1523
  return false;
1769
1524
  break;
1770
1525
  }
1771
1526
  }
1772
- if (_errs28 === errors) {
1773
- if (data7.protected !== undefined) {
1774
- let data8 = data7.protected;
1775
- const _errs29 = errors;
1776
- const _errs30 = errors;
1777
- if (errors === _errs30) {
1778
- if (typeof data8 === "string") {
1779
- 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)) {
1780
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_-]+$" + "\"" }];
1781
1536
  return false;
1782
1537
  }
@@ -1786,19 +1541,19 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1786
1541
  return false;
1787
1542
  }
1788
1543
  }
1789
- var valid9 = _errs29 === errors;
1544
+ var valid1 = _errs10 === errors;
1790
1545
  }
1791
1546
  else {
1792
- var valid9 = true;
1547
+ var valid1 = true;
1793
1548
  }
1794
- if (valid9) {
1795
- if (data7.iv !== undefined) {
1796
- let data9 = data7.iv;
1797
- const _errs32 = errors;
1798
- const _errs33 = errors;
1799
- if (errors === _errs33) {
1800
- if (typeof data9 === "string") {
1801
- 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)) {
1802
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_-]+$" + "\"" }];
1803
1558
  return false;
1804
1559
  }
@@ -1808,19 +1563,19 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1808
1563
  return false;
1809
1564
  }
1810
1565
  }
1811
- var valid9 = _errs32 === errors;
1566
+ var valid1 = _errs13 === errors;
1812
1567
  }
1813
1568
  else {
1814
- var valid9 = true;
1569
+ var valid1 = true;
1815
1570
  }
1816
- if (valid9) {
1817
- if (data7.tag !== undefined) {
1818
- let data10 = data7.tag;
1819
- const _errs35 = errors;
1820
- const _errs36 = errors;
1821
- if (errors === _errs36) {
1822
- if (typeof data10 === "string") {
1823
- 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)) {
1824
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_-]+$" + "\"" }];
1825
1580
  return false;
1826
1581
  }
@@ -1830,115 +1585,115 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1830
1585
  return false;
1831
1586
  }
1832
1587
  }
1833
- var valid9 = _errs35 === errors;
1588
+ var valid1 = _errs16 === errors;
1834
1589
  }
1835
1590
  else {
1836
- var valid9 = true;
1837
- }
1838
- if (valid9) {
1839
- if (data7.recipients !== undefined) {
1840
- let data11 = data7.recipients;
1841
- const _errs38 = errors;
1842
- if (errors === _errs38) {
1843
- if (Array.isArray(data11)) {
1844
- 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) {
1845
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" }];
1846
1601
  return false;
1847
1602
  }
1848
1603
  else {
1849
- var valid13 = true;
1850
- const len0 = data11.length;
1604
+ var valid5 = true;
1605
+ const len0 = data8.length;
1851
1606
  for (let i0 = 0; i0 < len0; i0++) {
1852
- let data12 = data11[i0];
1853
- const _errs40 = errors;
1854
- if (errors === _errs40) {
1855
- if (data12 && typeof data12 == "object" && !Array.isArray(data12)) {
1856
- let missing7;
1857
- if (((data12.header === undefined) && (missing7 = "header")) || ((data12.encrypted_key === undefined) && (missing7 = "encrypted_key"))) {
1858
- 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 + "'" }];
1859
1614
  return false;
1860
1615
  }
1861
1616
  else {
1862
- const _errs42 = errors;
1863
- for (const key1 in data12) {
1617
+ const _errs23 = errors;
1618
+ for (const key1 in data9) {
1864
1619
  if (!((key1 === "header") || (key1 === "encrypted_key"))) {
1865
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" }];
1866
1621
  return false;
1867
1622
  break;
1868
1623
  }
1869
1624
  }
1870
- if (_errs42 === errors) {
1871
- if (data12.header !== undefined) {
1872
- let data13 = data12.header;
1873
- const _errs43 = errors;
1874
- if (errors === _errs43) {
1875
- if (data13 && typeof data13 == "object" && !Array.isArray(data13)) {
1876
- let missing8;
1877
- if ((((data13.kid === undefined) && (missing8 = "kid")) || ((data13.epk === undefined) && (missing8 = "epk"))) || ((data13.derivationScheme === undefined) && (missing8 = "derivationScheme"))) {
1878
- 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 + "'" }];
1879
1634
  return false;
1880
1635
  }
1881
1636
  else {
1882
- const _errs45 = errors;
1883
- for (const key2 in data13) {
1637
+ const _errs26 = errors;
1638
+ for (const key2 in data10) {
1884
1639
  if (!((((key2 === "kid") || (key2 === "epk")) || (key2 === "derivationScheme")) || (key2 === "derivedPublicKey"))) {
1885
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" }];
1886
1641
  return false;
1887
1642
  break;
1888
1643
  }
1889
1644
  }
1890
- if (_errs45 === errors) {
1891
- if (data13.kid !== undefined) {
1892
- const _errs46 = errors;
1893
- if (typeof data13.kid !== "string") {
1645
+ if (_errs26 === errors) {
1646
+ if (data10.kid !== undefined) {
1647
+ const _errs27 = errors;
1648
+ if (typeof data10.kid !== "string") {
1894
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" }];
1895
1650
  return false;
1896
1651
  }
1897
- var valid15 = _errs46 === errors;
1652
+ var valid7 = _errs27 === errors;
1898
1653
  }
1899
1654
  else {
1900
- var valid15 = true;
1655
+ var valid7 = true;
1901
1656
  }
1902
- if (valid15) {
1903
- if (data13.epk !== undefined) {
1904
- const _errs48 = errors;
1905
- 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 }))) {
1906
1661
  vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
1907
1662
  errors = vErrors.length;
1908
1663
  }
1909
- var valid15 = _errs48 === errors;
1664
+ var valid7 = _errs29 === errors;
1910
1665
  }
1911
1666
  else {
1912
- var valid15 = true;
1667
+ var valid7 = true;
1913
1668
  }
1914
- if (valid15) {
1915
- if (data13.derivationScheme !== undefined) {
1916
- let data16 = data13.derivationScheme;
1917
- const _errs49 = errors;
1918
- 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") {
1919
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" }];
1920
1675
  return false;
1921
1676
  }
1922
- if (!((((data16 === "dataFormats") || (data16 === "protocolContext")) || (data16 === "protocolPath")) || (data16 === "schemas"))) {
1677
+ if (!((data13 === "protocolContext") || (data13 === "protocolPath"))) {
1923
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" }];
1924
1679
  return false;
1925
1680
  }
1926
- var valid15 = _errs49 === errors;
1681
+ var valid7 = _errs30 === errors;
1927
1682
  }
1928
1683
  else {
1929
- var valid15 = true;
1684
+ var valid7 = true;
1930
1685
  }
1931
- if (valid15) {
1932
- if (data13.derivedPublicKey !== undefined) {
1933
- const _errs51 = errors;
1934
- 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 }))) {
1935
1690
  vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
1936
1691
  errors = vErrors.length;
1937
1692
  }
1938
- var valid15 = _errs51 === errors;
1693
+ var valid7 = _errs32 === errors;
1939
1694
  }
1940
1695
  else {
1941
- var valid15 = true;
1696
+ var valid7 = true;
1942
1697
  }
1943
1698
  }
1944
1699
  }
@@ -1951,19 +1706,19 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1951
1706
  return false;
1952
1707
  }
1953
1708
  }
1954
- var valid14 = _errs43 === errors;
1709
+ var valid6 = _errs24 === errors;
1955
1710
  }
1956
1711
  else {
1957
- var valid14 = true;
1712
+ var valid6 = true;
1958
1713
  }
1959
- if (valid14) {
1960
- if (data12.encrypted_key !== undefined) {
1961
- let data18 = data12.encrypted_key;
1962
- const _errs52 = errors;
1963
- const _errs53 = errors;
1964
- if (errors === _errs53) {
1965
- if (typeof data18 === "string") {
1966
- 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)) {
1967
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_-]+$" + "\"" }];
1968
1723
  return false;
1969
1724
  }
@@ -1973,10 +1728,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1973
1728
  return false;
1974
1729
  }
1975
1730
  }
1976
- var valid14 = _errs52 === errors;
1731
+ var valid6 = _errs33 === errors;
1977
1732
  }
1978
1733
  else {
1979
- var valid14 = true;
1734
+ var valid6 = true;
1980
1735
  }
1981
1736
  }
1982
1737
  }
@@ -1987,8 +1742,8 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1987
1742
  return false;
1988
1743
  }
1989
1744
  }
1990
- var valid13 = _errs40 === errors;
1991
- if (!valid13) {
1745
+ var valid5 = _errs21 === errors;
1746
+ if (!valid5) {
1992
1747
  break;
1993
1748
  }
1994
1749
  }
@@ -1999,10 +1754,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
1999
1754
  return false;
2000
1755
  }
2001
1756
  }
2002
- var valid9 = _errs38 === errors;
1757
+ var valid1 = _errs19 === errors;
2003
1758
  }
2004
1759
  else {
2005
- var valid9 = true;
1760
+ var valid1 = true;
2006
1761
  }
2007
1762
  }
2008
1763
  }
@@ -2015,308 +1770,308 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2015
1770
  return false;
2016
1771
  }
2017
1772
  }
2018
- var valid8 = _errs26 === errors;
1773
+ var valid0 = _errs7 === errors;
2019
1774
  }
2020
1775
  else {
2021
- var valid8 = true;
1776
+ var valid0 = true;
2022
1777
  }
2023
- if (valid8) {
1778
+ if (valid0) {
2024
1779
  if (data.descriptor !== undefined) {
2025
- let data19 = data.descriptor;
2026
- const _errs55 = errors;
2027
- const _errs59 = errors;
2028
- let valid18 = false;
2029
- const _errs60 = errors;
2030
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2031
- let missing9;
2032
- if (((data19.published === undefined) && (missing9 = "published")) || ((data19.datePublished === undefined) && (missing9 = "datePublished"))) {
2033
- 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 + "'" };
2034
1789
  if (vErrors === null) {
2035
- vErrors = [err12];
1790
+ vErrors = [err0];
2036
1791
  }
2037
1792
  else {
2038
- vErrors.push(err12);
1793
+ vErrors.push(err0);
2039
1794
  }
2040
1795
  errors++;
2041
1796
  }
2042
1797
  else {
2043
- if (data19.published !== undefined) {
2044
- let data20 = data19.published;
2045
- if (typeof data20 !== "boolean") {
2046
- 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" };
2047
1802
  if (vErrors === null) {
2048
- vErrors = [err13];
1803
+ vErrors = [err1];
2049
1804
  }
2050
1805
  else {
2051
- vErrors.push(err13);
1806
+ vErrors.push(err1);
2052
1807
  }
2053
1808
  errors++;
2054
1809
  }
2055
- if (!(data20 === true)) {
2056
- 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" };
2057
1812
  if (vErrors === null) {
2058
- vErrors = [err14];
1813
+ vErrors = [err2];
2059
1814
  }
2060
1815
  else {
2061
- vErrors.push(err14);
1816
+ vErrors.push(err2);
2062
1817
  }
2063
1818
  errors++;
2064
1819
  }
2065
1820
  }
2066
1821
  }
2067
1822
  }
2068
- var _valid1 = _errs60 === errors;
2069
- valid18 = valid18 || _valid1;
2070
- if (_valid1) {
2071
- var props3 = {};
2072
- props3.published = true;
1823
+ var _valid0 = _errs41 === errors;
1824
+ valid10 = valid10 || _valid0;
1825
+ if (_valid0) {
1826
+ var props2 = {};
1827
+ props2.published = true;
2073
1828
  }
2074
- const _errs63 = errors;
2075
- const _errs64 = errors;
2076
- const _errs65 = errors;
2077
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2078
- let missing10;
2079
- if ((data19.datePublished === undefined) && (missing10 = "datePublished")) {
2080
- 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 = {};
2081
1836
  if (vErrors === null) {
2082
- vErrors = [err15];
1837
+ vErrors = [err3];
2083
1838
  }
2084
1839
  else {
2085
- vErrors.push(err15);
1840
+ vErrors.push(err3);
2086
1841
  }
2087
1842
  errors++;
2088
1843
  }
2089
1844
  }
2090
- var valid20 = _errs65 === errors;
2091
- if (valid20) {
2092
- 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" };
2093
1848
  if (vErrors === null) {
2094
- vErrors = [err16];
1849
+ vErrors = [err4];
2095
1850
  }
2096
1851
  else {
2097
- vErrors.push(err16);
1852
+ vErrors.push(err4);
2098
1853
  }
2099
1854
  errors++;
2100
1855
  }
2101
1856
  else {
2102
- errors = _errs64;
1857
+ errors = _errs45;
2103
1858
  if (vErrors !== null) {
2104
- if (_errs64) {
2105
- vErrors.length = _errs64;
1859
+ if (_errs45) {
1860
+ vErrors.length = _errs45;
2106
1861
  }
2107
1862
  else {
2108
1863
  vErrors = null;
2109
1864
  }
2110
1865
  }
2111
1866
  }
2112
- if (errors === _errs63) {
2113
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2114
- if (data19.published !== undefined) {
2115
- let data21 = data19.published;
2116
- if (typeof data21 !== "boolean") {
2117
- 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" };
2118
1873
  if (vErrors === null) {
2119
- vErrors = [err17];
1874
+ vErrors = [err5];
2120
1875
  }
2121
1876
  else {
2122
- vErrors.push(err17);
1877
+ vErrors.push(err5);
2123
1878
  }
2124
1879
  errors++;
2125
1880
  }
2126
- if (!(data21 === false)) {
2127
- 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" };
2128
1883
  if (vErrors === null) {
2129
- vErrors = [err18];
1884
+ vErrors = [err6];
2130
1885
  }
2131
1886
  else {
2132
- vErrors.push(err18);
1887
+ vErrors.push(err6);
2133
1888
  }
2134
1889
  errors++;
2135
1890
  }
2136
1891
  }
2137
1892
  }
2138
1893
  }
2139
- var _valid1 = _errs63 === errors;
2140
- valid18 = valid18 || _valid1;
2141
- if (_valid1) {
2142
- if (props3 !== true) {
2143
- props3 = props3 || {};
2144
- 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;
2145
1900
  }
2146
1901
  }
2147
- const _errs68 = errors;
2148
- const _errs69 = errors;
2149
- const _errs70 = errors;
2150
- const _errs71 = errors;
2151
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2152
- let missing11;
2153
- if ((data19.published === undefined) && (missing11 = "published")) {
2154
- 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 = {};
2155
1910
  if (vErrors === null) {
2156
- vErrors = [err19];
1911
+ vErrors = [err7];
2157
1912
  }
2158
1913
  else {
2159
- vErrors.push(err19);
1914
+ vErrors.push(err7);
2160
1915
  }
2161
1916
  errors++;
2162
1917
  }
2163
1918
  }
2164
- var valid23 = _errs71 === errors;
2165
- if (valid23) {
2166
- 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" };
2167
1922
  if (vErrors === null) {
2168
- vErrors = [err20];
1923
+ vErrors = [err8];
2169
1924
  }
2170
1925
  else {
2171
- vErrors.push(err20);
1926
+ vErrors.push(err8);
2172
1927
  }
2173
1928
  errors++;
2174
1929
  }
2175
1930
  else {
2176
- errors = _errs70;
1931
+ errors = _errs51;
2177
1932
  if (vErrors !== null) {
2178
- if (_errs70) {
2179
- vErrors.length = _errs70;
1933
+ if (_errs51) {
1934
+ vErrors.length = _errs51;
2180
1935
  }
2181
1936
  else {
2182
1937
  vErrors = null;
2183
1938
  }
2184
1939
  }
2185
1940
  }
2186
- var valid22 = _errs69 === errors;
2187
- if (valid22) {
2188
- const _errs72 = errors;
2189
- const _errs73 = errors;
2190
- const _errs74 = errors;
2191
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2192
- let missing12;
2193
- if ((data19.datePublished === undefined) && (missing12 = "datePublished")) {
2194
- 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 = {};
2195
1950
  if (vErrors === null) {
2196
- vErrors = [err21];
1951
+ vErrors = [err9];
2197
1952
  }
2198
1953
  else {
2199
- vErrors.push(err21);
1954
+ vErrors.push(err9);
2200
1955
  }
2201
1956
  errors++;
2202
1957
  }
2203
1958
  }
2204
- var valid24 = _errs74 === errors;
2205
- if (valid24) {
2206
- 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" };
2207
1962
  if (vErrors === null) {
2208
- vErrors = [err22];
1963
+ vErrors = [err10];
2209
1964
  }
2210
1965
  else {
2211
- vErrors.push(err22);
1966
+ vErrors.push(err10);
2212
1967
  }
2213
1968
  errors++;
2214
1969
  }
2215
1970
  else {
2216
- errors = _errs73;
1971
+ errors = _errs54;
2217
1972
  if (vErrors !== null) {
2218
- if (_errs73) {
2219
- vErrors.length = _errs73;
1973
+ if (_errs54) {
1974
+ vErrors.length = _errs54;
2220
1975
  }
2221
1976
  else {
2222
1977
  vErrors = null;
2223
1978
  }
2224
1979
  }
2225
1980
  }
2226
- var valid22 = _errs72 === errors;
1981
+ var valid14 = _errs53 === errors;
2227
1982
  }
2228
- var _valid1 = _errs68 === errors;
2229
- valid18 = valid18 || _valid1;
2230
- if (!valid18) {
2231
- 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" };
2232
1987
  if (vErrors === null) {
2233
- vErrors = [err23];
1988
+ vErrors = [err11];
2234
1989
  }
2235
1990
  else {
2236
- vErrors.push(err23);
1991
+ vErrors.push(err11);
2237
1992
  }
2238
1993
  errors++;
2239
1994
  validate27.errors = vErrors;
2240
1995
  return false;
2241
1996
  }
2242
1997
  else {
2243
- errors = _errs59;
1998
+ errors = _errs40;
2244
1999
  if (vErrors !== null) {
2245
- if (_errs59) {
2246
- vErrors.length = _errs59;
2000
+ if (_errs40) {
2001
+ vErrors.length = _errs40;
2247
2002
  }
2248
2003
  else {
2249
2004
  vErrors = null;
2250
2005
  }
2251
2006
  }
2252
2007
  }
2253
- if (errors === _errs55) {
2254
- if (data19 && typeof data19 == "object" && !Array.isArray(data19)) {
2255
- let missing13;
2256
- 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"))) {
2257
- 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 + "'" }];
2258
2013
  return false;
2259
2014
  }
2260
2015
  else {
2261
- const _errs75 = errors;
2262
- for (const key3 in data19) {
2016
+ const _errs56 = errors;
2017
+ for (const key3 in data16) {
2263
2018
  if (!(func2.call(schema39.properties.descriptor.properties, key3))) {
2264
2019
  validate27.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" }];
2265
2020
  return false;
2266
2021
  break;
2267
2022
  }
2268
2023
  }
2269
- if (_errs75 === errors) {
2270
- let missing14;
2271
- 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"))) {
2272
2027
  validate27.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/dependencies", keyword: "dependencies", params: { property: "parentId",
2273
- missingProperty: missing14,
2028
+ missingProperty: missing9,
2274
2029
  depsCount: 1,
2275
2030
  deps: "protocol" }, message: "must have property protocol when property parentId is present" }];
2276
2031
  return false;
2277
2032
  }
2278
2033
  else {
2279
- if (data19.interface !== undefined) {
2280
- let data22 = data19.interface;
2281
- const _errs76 = errors;
2282
- if (typeof data22 !== "string") {
2034
+ if (data16.interface !== undefined) {
2035
+ let data19 = data16.interface;
2036
+ const _errs57 = errors;
2037
+ if (typeof data19 !== "string") {
2283
2038
  validate27.errors = [{ instancePath: instancePath + "/descriptor/interface", schemaPath: "#/properties/descriptor/properties/interface/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2284
2039
  return false;
2285
2040
  }
2286
- if (!(data22 === "Records")) {
2041
+ if (!(data19 === "Records")) {
2287
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" }];
2288
2043
  return false;
2289
2044
  }
2290
- var valid26 = _errs76 === errors;
2045
+ var valid18 = _errs57 === errors;
2291
2046
  }
2292
2047
  else {
2293
- var valid26 = true;
2048
+ var valid18 = true;
2294
2049
  }
2295
- if (valid26) {
2296
- if (data19.method !== undefined) {
2297
- let data23 = data19.method;
2298
- const _errs78 = errors;
2299
- 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") {
2300
2055
  validate27.errors = [{ instancePath: instancePath + "/descriptor/method", schemaPath: "#/properties/descriptor/properties/method/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2301
2056
  return false;
2302
2057
  }
2303
- if (!(data23 === "Write")) {
2058
+ if (!(data20 === "Write")) {
2304
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" }];
2305
2060
  return false;
2306
2061
  }
2307
- var valid26 = _errs78 === errors;
2062
+ var valid18 = _errs59 === errors;
2308
2063
  }
2309
2064
  else {
2310
- var valid26 = true;
2065
+ var valid18 = true;
2311
2066
  }
2312
- if (valid26) {
2313
- if (data19.recipient !== undefined) {
2314
- let data24 = data19.recipient;
2315
- const _errs80 = errors;
2316
- const _errs81 = errors;
2317
- if (errors === _errs81) {
2318
- if (typeof data24 === "string") {
2319
- 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)) {
2320
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_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$" + "\"" }];
2321
2076
  return false;
2322
2077
  }
@@ -2326,30 +2081,30 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2326
2081
  return false;
2327
2082
  }
2328
2083
  }
2329
- var valid26 = _errs80 === errors;
2084
+ var valid18 = _errs61 === errors;
2330
2085
  }
2331
2086
  else {
2332
- var valid26 = true;
2087
+ var valid18 = true;
2333
2088
  }
2334
- if (valid26) {
2335
- if (data19.protocol !== undefined) {
2336
- const _errs83 = errors;
2337
- if (typeof data19.protocol !== "string") {
2089
+ if (valid18) {
2090
+ if (data16.protocol !== undefined) {
2091
+ const _errs64 = errors;
2092
+ if (typeof data16.protocol !== "string") {
2338
2093
  validate27.errors = [{ instancePath: instancePath + "/descriptor/protocol", schemaPath: "#/properties/descriptor/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2339
2094
  return false;
2340
2095
  }
2341
- var valid26 = _errs83 === errors;
2096
+ var valid18 = _errs64 === errors;
2342
2097
  }
2343
2098
  else {
2344
- var valid26 = true;
2099
+ var valid18 = true;
2345
2100
  }
2346
- if (valid26) {
2347
- if (data19.protocolPath !== undefined) {
2348
- let data26 = data19.protocolPath;
2349
- const _errs85 = errors;
2350
- if (errors === _errs85) {
2351
- if (typeof data26 === "string") {
2352
- 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)) {
2353
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]+)*$" + "\"" }];
2354
2109
  return false;
2355
2110
  }
@@ -2359,144 +2114,144 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2359
2114
  return false;
2360
2115
  }
2361
2116
  }
2362
- var valid26 = _errs85 === errors;
2117
+ var valid18 = _errs66 === errors;
2363
2118
  }
2364
2119
  else {
2365
- var valid26 = true;
2120
+ var valid18 = true;
2366
2121
  }
2367
- if (valid26) {
2368
- if (data19.schema !== undefined) {
2369
- const _errs87 = errors;
2370
- if (typeof data19.schema !== "string") {
2122
+ if (valid18) {
2123
+ if (data16.schema !== undefined) {
2124
+ const _errs68 = errors;
2125
+ if (typeof data16.schema !== "string") {
2371
2126
  validate27.errors = [{ instancePath: instancePath + "/descriptor/schema", schemaPath: "#/properties/descriptor/properties/schema/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2372
2127
  return false;
2373
2128
  }
2374
- var valid26 = _errs87 === errors;
2129
+ var valid18 = _errs68 === errors;
2375
2130
  }
2376
2131
  else {
2377
- var valid26 = true;
2132
+ var valid18 = true;
2378
2133
  }
2379
- if (valid26) {
2380
- if (data19.tags !== undefined) {
2381
- let data28 = data19.tags;
2382
- const _errs89 = errors;
2383
- if (errors === _errs89) {
2384
- if (data28 && typeof data28 == "object" && !Array.isArray(data28)) {
2385
- 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) {
2386
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" }];
2387
2142
  return false;
2388
2143
  }
2389
2144
  else {
2390
- if (Object.keys(data28).length < 1) {
2145
+ if (Object.keys(data25).length < 1) {
2391
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" }];
2392
2147
  return false;
2393
2148
  }
2394
2149
  else {
2395
- for (const key4 in data28) {
2396
- let data29 = data28[key4];
2397
- const _errs92 = errors;
2398
- const _errs93 = errors;
2399
- 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;
2400
2155
  let passing0 = null;
2401
- const _errs94 = errors;
2402
- if (typeof data29 !== "string") {
2403
- 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" };
2404
2159
  if (vErrors === null) {
2405
- vErrors = [err24];
2160
+ vErrors = [err12];
2406
2161
  }
2407
2162
  else {
2408
- vErrors.push(err24);
2163
+ vErrors.push(err12);
2409
2164
  }
2410
2165
  errors++;
2411
2166
  }
2412
- var _valid2 = _errs94 === errors;
2413
- if (_valid2) {
2414
- valid29 = true;
2167
+ var _valid1 = _errs75 === errors;
2168
+ if (_valid1) {
2169
+ valid21 = true;
2415
2170
  passing0 = 0;
2416
2171
  }
2417
- const _errs96 = errors;
2418
- if (!((typeof data29 == "number") && (isFinite(data29)))) {
2419
- 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" };
2420
2175
  if (vErrors === null) {
2421
- vErrors = [err25];
2176
+ vErrors = [err13];
2422
2177
  }
2423
2178
  else {
2424
- vErrors.push(err25);
2179
+ vErrors.push(err13);
2425
2180
  }
2426
2181
  errors++;
2427
2182
  }
2428
- var _valid2 = _errs96 === errors;
2429
- if (_valid2 && valid29) {
2430
- valid29 = false;
2183
+ var _valid1 = _errs77 === errors;
2184
+ if (_valid1 && valid21) {
2185
+ valid21 = false;
2431
2186
  passing0 = [passing0, 1];
2432
2187
  }
2433
2188
  else {
2434
- if (_valid2) {
2435
- valid29 = true;
2189
+ if (_valid1) {
2190
+ valid21 = true;
2436
2191
  passing0 = 1;
2437
2192
  }
2438
- const _errs98 = errors;
2439
- if (typeof data29 !== "boolean") {
2440
- 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" };
2441
2196
  if (vErrors === null) {
2442
- vErrors = [err26];
2197
+ vErrors = [err14];
2443
2198
  }
2444
2199
  else {
2445
- vErrors.push(err26);
2200
+ vErrors.push(err14);
2446
2201
  }
2447
2202
  errors++;
2448
2203
  }
2449
- var _valid2 = _errs98 === errors;
2450
- if (_valid2 && valid29) {
2451
- valid29 = false;
2204
+ var _valid1 = _errs79 === errors;
2205
+ if (_valid1 && valid21) {
2206
+ valid21 = false;
2452
2207
  passing0 = [passing0, 2];
2453
2208
  }
2454
2209
  else {
2455
- if (_valid2) {
2456
- valid29 = true;
2210
+ if (_valid1) {
2211
+ valid21 = true;
2457
2212
  passing0 = 2;
2458
2213
  }
2459
- const _errs100 = errors;
2460
- if (errors === _errs100) {
2461
- if (Array.isArray(data29)) {
2462
- if (data29.length > 10) {
2463
- 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" };
2464
2219
  if (vErrors === null) {
2465
- vErrors = [err27];
2220
+ vErrors = [err15];
2466
2221
  }
2467
2222
  else {
2468
- vErrors.push(err27);
2223
+ vErrors.push(err15);
2469
2224
  }
2470
2225
  errors++;
2471
2226
  }
2472
2227
  else {
2473
- if (data29.length < 1) {
2474
- 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" };
2475
2230
  if (vErrors === null) {
2476
- vErrors = [err28];
2231
+ vErrors = [err16];
2477
2232
  }
2478
2233
  else {
2479
- vErrors.push(err28);
2234
+ vErrors.push(err16);
2480
2235
  }
2481
2236
  errors++;
2482
2237
  }
2483
2238
  else {
2484
- var valid30 = true;
2485
- const len1 = data29.length;
2239
+ var valid22 = true;
2240
+ const len1 = data26.length;
2486
2241
  for (let i1 = 0; i1 < len1; i1++) {
2487
- const _errs102 = errors;
2488
- if (typeof data29[i1] !== "string") {
2489
- 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" };
2490
2245
  if (vErrors === null) {
2491
- vErrors = [err29];
2246
+ vErrors = [err17];
2492
2247
  }
2493
2248
  else {
2494
- vErrors.push(err29);
2249
+ vErrors.push(err17);
2495
2250
  }
2496
2251
  errors++;
2497
2252
  }
2498
- var valid30 = _errs102 === errors;
2499
- if (!valid30) {
2253
+ var valid22 = _errs83 === errors;
2254
+ if (!valid22) {
2500
2255
  break;
2501
2256
  }
2502
2257
  }
@@ -2504,69 +2259,69 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2504
2259
  }
2505
2260
  }
2506
2261
  else {
2507
- 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" };
2508
2263
  if (vErrors === null) {
2509
- vErrors = [err30];
2264
+ vErrors = [err18];
2510
2265
  }
2511
2266
  else {
2512
- vErrors.push(err30);
2267
+ vErrors.push(err18);
2513
2268
  }
2514
2269
  errors++;
2515
2270
  }
2516
2271
  }
2517
- var _valid2 = _errs100 === errors;
2518
- if (_valid2 && valid29) {
2519
- valid29 = false;
2272
+ var _valid1 = _errs81 === errors;
2273
+ if (_valid1 && valid21) {
2274
+ valid21 = false;
2520
2275
  passing0 = [passing0, 3];
2521
2276
  }
2522
2277
  else {
2523
- if (_valid2) {
2524
- valid29 = true;
2278
+ if (_valid1) {
2279
+ valid21 = true;
2525
2280
  passing0 = 3;
2526
2281
  var items0 = true;
2527
2282
  }
2528
- const _errs104 = errors;
2529
- if (errors === _errs104) {
2530
- if (Array.isArray(data29)) {
2531
- if (data29.length > 10) {
2532
- 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" };
2533
2288
  if (vErrors === null) {
2534
- vErrors = [err31];
2289
+ vErrors = [err19];
2535
2290
  }
2536
2291
  else {
2537
- vErrors.push(err31);
2292
+ vErrors.push(err19);
2538
2293
  }
2539
2294
  errors++;
2540
2295
  }
2541
2296
  else {
2542
- if (data29.length < 1) {
2543
- 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" };
2544
2299
  if (vErrors === null) {
2545
- vErrors = [err32];
2300
+ vErrors = [err20];
2546
2301
  }
2547
2302
  else {
2548
- vErrors.push(err32);
2303
+ vErrors.push(err20);
2549
2304
  }
2550
2305
  errors++;
2551
2306
  }
2552
2307
  else {
2553
- var valid31 = true;
2554
- const len2 = data29.length;
2308
+ var valid23 = true;
2309
+ const len2 = data26.length;
2555
2310
  for (let i2 = 0; i2 < len2; i2++) {
2556
- let data31 = data29[i2];
2557
- const _errs106 = errors;
2558
- if (!((typeof data31 == "number") && (isFinite(data31)))) {
2559
- 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" };
2560
2315
  if (vErrors === null) {
2561
- vErrors = [err33];
2316
+ vErrors = [err21];
2562
2317
  }
2563
2318
  else {
2564
- vErrors.push(err33);
2319
+ vErrors.push(err21);
2565
2320
  }
2566
2321
  errors++;
2567
2322
  }
2568
- var valid31 = _errs106 === errors;
2569
- if (!valid31) {
2323
+ var valid23 = _errs87 === errors;
2324
+ if (!valid23) {
2570
2325
  break;
2571
2326
  }
2572
2327
  }
@@ -2574,24 +2329,24 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2574
2329
  }
2575
2330
  }
2576
2331
  else {
2577
- 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" };
2578
2333
  if (vErrors === null) {
2579
- vErrors = [err34];
2334
+ vErrors = [err22];
2580
2335
  }
2581
2336
  else {
2582
- vErrors.push(err34);
2337
+ vErrors.push(err22);
2583
2338
  }
2584
2339
  errors++;
2585
2340
  }
2586
2341
  }
2587
- var _valid2 = _errs104 === errors;
2588
- if (_valid2 && valid29) {
2589
- valid29 = false;
2342
+ var _valid1 = _errs85 === errors;
2343
+ if (_valid1 && valid21) {
2344
+ valid21 = false;
2590
2345
  passing0 = [passing0, 4];
2591
2346
  }
2592
2347
  else {
2593
- if (_valid2) {
2594
- valid29 = true;
2348
+ if (_valid1) {
2349
+ valid21 = true;
2595
2350
  passing0 = 4;
2596
2351
  if (items0 !== true) {
2597
2352
  items0 = true;
@@ -2601,31 +2356,31 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2601
2356
  }
2602
2357
  }
2603
2358
  }
2604
- if (!valid29) {
2605
- 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" };
2606
2361
  if (vErrors === null) {
2607
- vErrors = [err35];
2362
+ vErrors = [err23];
2608
2363
  }
2609
2364
  else {
2610
- vErrors.push(err35);
2365
+ vErrors.push(err23);
2611
2366
  }
2612
2367
  errors++;
2613
2368
  validate27.errors = vErrors;
2614
2369
  return false;
2615
2370
  }
2616
2371
  else {
2617
- errors = _errs93;
2372
+ errors = _errs74;
2618
2373
  if (vErrors !== null) {
2619
- if (_errs93) {
2620
- vErrors.length = _errs93;
2374
+ if (_errs74) {
2375
+ vErrors.length = _errs74;
2621
2376
  }
2622
2377
  else {
2623
2378
  vErrors = null;
2624
2379
  }
2625
2380
  }
2626
2381
  }
2627
- var valid28 = _errs92 === errors;
2628
- if (!valid28) {
2382
+ var valid20 = _errs73 === errors;
2383
+ if (!valid20) {
2629
2384
  break;
2630
2385
  }
2631
2386
  }
@@ -2637,56 +2392,56 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2637
2392
  return false;
2638
2393
  }
2639
2394
  }
2640
- var valid26 = _errs89 === errors;
2395
+ var valid18 = _errs70 === errors;
2641
2396
  }
2642
2397
  else {
2643
- var valid26 = true;
2398
+ var valid18 = true;
2644
2399
  }
2645
- if (valid26) {
2646
- if (data19.parentId !== undefined) {
2647
- const _errs108 = errors;
2648
- if (typeof data19.parentId !== "string") {
2400
+ if (valid18) {
2401
+ if (data16.parentId !== undefined) {
2402
+ const _errs89 = errors;
2403
+ if (typeof data16.parentId !== "string") {
2649
2404
  validate27.errors = [{ instancePath: instancePath + "/descriptor/parentId", schemaPath: "#/properties/descriptor/properties/parentId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2650
2405
  return false;
2651
2406
  }
2652
- var valid26 = _errs108 === errors;
2407
+ var valid18 = _errs89 === errors;
2653
2408
  }
2654
2409
  else {
2655
- var valid26 = true;
2410
+ var valid18 = true;
2656
2411
  }
2657
- if (valid26) {
2658
- if (data19.dataCid !== undefined) {
2659
- const _errs110 = errors;
2660
- if (typeof data19.dataCid !== "string") {
2412
+ if (valid18) {
2413
+ if (data16.dataCid !== undefined) {
2414
+ const _errs91 = errors;
2415
+ if (typeof data16.dataCid !== "string") {
2661
2416
  validate27.errors = [{ instancePath: instancePath + "/descriptor/dataCid", schemaPath: "#/properties/descriptor/properties/dataCid/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2662
2417
  return false;
2663
2418
  }
2664
- var valid26 = _errs110 === errors;
2419
+ var valid18 = _errs91 === errors;
2665
2420
  }
2666
2421
  else {
2667
- var valid26 = true;
2422
+ var valid18 = true;
2668
2423
  }
2669
- if (valid26) {
2670
- if (data19.dataSize !== undefined) {
2671
- let data34 = data19.dataSize;
2672
- const _errs112 = errors;
2673
- 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)))) {
2674
2429
  validate27.errors = [{ instancePath: instancePath + "/descriptor/dataSize", schemaPath: "#/properties/descriptor/properties/dataSize/type", keyword: "type", params: { type: "number" }, message: "must be number" }];
2675
2430
  return false;
2676
2431
  }
2677
- var valid26 = _errs112 === errors;
2432
+ var valid18 = _errs93 === errors;
2678
2433
  }
2679
2434
  else {
2680
- var valid26 = true;
2435
+ var valid18 = true;
2681
2436
  }
2682
- if (valid26) {
2683
- if (data19.dateCreated !== undefined) {
2684
- let data35 = data19.dateCreated;
2685
- const _errs114 = errors;
2686
- const _errs115 = errors;
2687
- if (errors === _errs115) {
2688
- if (typeof data35 === "string") {
2689
- 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)) {
2690
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$" + "\"" }];
2691
2446
  return false;
2692
2447
  }
@@ -2696,19 +2451,19 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2696
2451
  return false;
2697
2452
  }
2698
2453
  }
2699
- var valid26 = _errs114 === errors;
2454
+ var valid18 = _errs95 === errors;
2700
2455
  }
2701
2456
  else {
2702
- var valid26 = true;
2457
+ var valid18 = true;
2703
2458
  }
2704
- if (valid26) {
2705
- if (data19.messageTimestamp !== undefined) {
2706
- let data36 = data19.messageTimestamp;
2707
- const _errs117 = errors;
2708
- const _errs118 = errors;
2709
- if (errors === _errs118) {
2710
- if (typeof data36 === "string") {
2711
- 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)) {
2712
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$" + "\"" }];
2713
2468
  return false;
2714
2469
  }
@@ -2718,31 +2473,31 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2718
2473
  return false;
2719
2474
  }
2720
2475
  }
2721
- var valid26 = _errs117 === errors;
2476
+ var valid18 = _errs98 === errors;
2722
2477
  }
2723
2478
  else {
2724
- var valid26 = true;
2479
+ var valid18 = true;
2725
2480
  }
2726
- if (valid26) {
2727
- if (data19.published !== undefined) {
2728
- const _errs120 = errors;
2729
- if (typeof data19.published !== "boolean") {
2481
+ if (valid18) {
2482
+ if (data16.published !== undefined) {
2483
+ const _errs101 = errors;
2484
+ if (typeof data16.published !== "boolean") {
2730
2485
  validate27.errors = [{ instancePath: instancePath + "/descriptor/published", schemaPath: "#/properties/descriptor/properties/published/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
2731
2486
  return false;
2732
2487
  }
2733
- var valid26 = _errs120 === errors;
2488
+ var valid18 = _errs101 === errors;
2734
2489
  }
2735
2490
  else {
2736
- var valid26 = true;
2491
+ var valid18 = true;
2737
2492
  }
2738
- if (valid26) {
2739
- if (data19.datePublished !== undefined) {
2740
- let data38 = data19.datePublished;
2741
- const _errs122 = errors;
2742
- const _errs123 = errors;
2743
- if (errors === _errs123) {
2744
- if (typeof data38 === "string") {
2745
- 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)) {
2746
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$" + "\"" }];
2747
2502
  return false;
2748
2503
  }
@@ -2752,34 +2507,34 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2752
2507
  return false;
2753
2508
  }
2754
2509
  }
2755
- var valid26 = _errs122 === errors;
2510
+ var valid18 = _errs103 === errors;
2756
2511
  }
2757
2512
  else {
2758
- var valid26 = true;
2513
+ var valid18 = true;
2759
2514
  }
2760
- if (valid26) {
2761
- if (data19.dataFormat !== undefined) {
2762
- const _errs125 = errors;
2763
- if (typeof data19.dataFormat !== "string") {
2515
+ if (valid18) {
2516
+ if (data16.dataFormat !== undefined) {
2517
+ const _errs106 = errors;
2518
+ if (typeof data16.dataFormat !== "string") {
2764
2519
  validate27.errors = [{ instancePath: instancePath + "/descriptor/dataFormat", schemaPath: "#/properties/descriptor/properties/dataFormat/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2765
2520
  return false;
2766
2521
  }
2767
- var valid26 = _errs125 === errors;
2522
+ var valid18 = _errs106 === errors;
2768
2523
  }
2769
2524
  else {
2770
- var valid26 = true;
2525
+ var valid18 = true;
2771
2526
  }
2772
- if (valid26) {
2773
- if (data19.permissionGrantId !== undefined) {
2774
- const _errs127 = errors;
2775
- if (typeof data19.permissionGrantId !== "string") {
2527
+ if (valid18) {
2528
+ if (data16.permissionGrantId !== undefined) {
2529
+ const _errs108 = errors;
2530
+ if (typeof data16.permissionGrantId !== "string") {
2776
2531
  validate27.errors = [{ instancePath: instancePath + "/descriptor/permissionGrantId", schemaPath: "#/properties/descriptor/properties/permissionGrantId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
2777
2532
  return false;
2778
2533
  }
2779
- var valid26 = _errs127 === errors;
2534
+ var valid18 = _errs108 === errors;
2780
2535
  }
2781
2536
  else {
2782
- var valid26 = true;
2537
+ var valid18 = true;
2783
2538
  }
2784
2539
  }
2785
2540
  }
@@ -2805,10 +2560,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2805
2560
  return false;
2806
2561
  }
2807
2562
  }
2808
- var valid8 = _errs55 === errors;
2563
+ var valid0 = _errs36 === errors;
2809
2564
  }
2810
2565
  else {
2811
- var valid8 = true;
2566
+ var valid0 = true;
2812
2567
  }
2813
2568
  }
2814
2569
  }
@@ -2823,10 +2578,9 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
2823
2578
  }
2824
2579
  }
2825
2580
  validate27.errors = vErrors;
2826
- evaluated0.props = props0;
2827
2581
  return errors === 0;
2828
2582
  }
2829
- 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 };
2830
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) {
2831
2585
  evaluated0.props = undefined;
2832
2586
  } if (evaluated0.dynamicItems) {
@@ -2834,9 +2588,6 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
2834
2588
  } if (!(validate27(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
2835
2589
  vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
2836
2590
  errors = vErrors.length;
2837
- }
2838
- else {
2839
- var props0 = validate27.evaluated.props;
2840
2591
  } if (errors === 0) {
2841
2592
  if (data && typeof data == "object" && !Array.isArray(data)) {
2842
2593
  let missing0;
@@ -2845,10 +2596,6 @@ else {
2845
2596
  return false;
2846
2597
  }
2847
2598
  else {
2848
- if (props0 !== true) {
2849
- props0 = props0 || {};
2850
- props0.encodedData = true;
2851
- }
2852
2599
  if (data.encodedData !== undefined) {
2853
2600
  const _errs1 = errors;
2854
2601
  if (typeof data.encodedData !== "string") {
@@ -2861,13 +2608,11 @@ else {
2861
2608
  var valid0 = true;
2862
2609
  }
2863
2610
  if (valid0) {
2864
- if (props0 !== true) {
2865
- for (const key0 in data) {
2866
- if (!props0 || !props0[key0]) {
2867
- validate26.errors = [{ instancePath, schemaPath: "#/unevaluatedProperties", keyword: "unevaluatedProperties", params: { unevaluatedProperty: key0 }, message: "must NOT have unevaluated properties" }];
2868
- return false;
2869
- break;
2870
- }
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;
2871
2616
  }
2872
2617
  }
2873
2618
  }
@@ -5377,7 +5122,7 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
5377
5122
  } validate45.errors = vErrors; return errors === 0; }
5378
5123
  validate45.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
5379
5124
  export const RecordsSubscribe = validate48;
5380
- 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" } } } } };
5381
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) {
5382
5127
  evaluated0.props = undefined;
5383
5128
  } if (evaluated0.dynamicItems) {
@@ -5424,7 +5169,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
5424
5169
  else {
5425
5170
  const _errs5 = errors;
5426
5171
  for (const key1 in data1) {
5427
- 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"))) {
5428
5173
  validate48.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
5429
5174
  return false;
5430
5175
  break;
@@ -5629,6 +5374,19 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
5629
5374
  else {
5630
5375
  var valid1 = true;
5631
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
+ }
5632
5390
  }
5633
5391
  }
5634
5392
  }
@@ -5666,9 +5424,6 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
5666
5424
  } if (!(validate27(data, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }))) {
5667
5425
  vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
5668
5426
  errors = vErrors.length;
5669
- }
5670
- else {
5671
- var props0 = validate27.evaluated.props;
5672
5427
  } if (errors === 0) {
5673
5428
  if (data && typeof data == "object" && !Array.isArray(data)) {
5674
5429
  let missing0;
@@ -5677,13 +5432,11 @@ else {
5677
5432
  return false;
5678
5433
  }
5679
5434
  else {
5680
- if (props0 !== true) {
5681
- for (const key0 in data) {
5682
- if (!props0 || !props0[key0]) {
5683
- validate51.errors = [{ instancePath, schemaPath: "#/unevaluatedProperties", keyword: "unevaluatedProperties", params: { unevaluatedProperty: key0 }, message: "must NOT have unevaluated properties" }];
5684
- return false;
5685
- break;
5686
- }
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;
5687
5440
  }
5688
5441
  }
5689
5442
  }
@@ -6821,7 +6574,7 @@ function validate57(data, { instancePath = "", parentData, parentDataProperty, r
6821
6574
  } validate57.errors = vErrors; return errors === 0; }
6822
6575
  validate57.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
6823
6576
  export const MessagesSubscribe = validate59;
6824
- 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" } } } } };
6825
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) {
6826
6579
  evaluated0.props = undefined;
6827
6580
  } if (evaluated0.dynamicItems) {
@@ -6868,7 +6621,7 @@ function validate59(data, { instancePath = "", parentData, parentDataProperty, r
6868
6621
  else {
6869
6622
  const _errs5 = errors;
6870
6623
  for (const key1 in data1) {
6871
- 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"))) {
6872
6625
  validate59.errors = [{ instancePath: instancePath + "/descriptor", schemaPath: "#/properties/descriptor/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
6873
6626
  return false;
6874
6627
  break;
@@ -6962,6 +6715,19 @@ function validate59(data, { instancePath = "", parentData, parentDataProperty, r
6962
6715
  else {
6963
6716
  var valid1 = true;
6964
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
+ }
6965
6731
  }
6966
6732
  }
6967
6733
  }
@@ -11093,7 +10859,7 @@ export const ProtocolDefinition = validate75;
11093
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" } } } } };
11094
10860
  const pattern39 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*$", "u");
11095
10861
  const pattern41 = new RegExp(".*", "u");
11096
- 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" } } };
11097
10863
  const pattern43 = new RegExp("^[^$].*$", "u");
11098
10864
  const pattern44 = new RegExp("^[a-zA-Z][a-zA-Z0-9_-]*:.+$", "u");
11099
10865
  const pattern45 = new RegExp("^(?!\\$requiredTags$|\\$allowUndefinedTags$).*$", "u");
@@ -11108,7 +10874,7 @@ function validate76(data, { instancePath = "", parentData, parentDataProperty, r
11108
10874
  if (data && typeof data == "object" && !Array.isArray(data)) {
11109
10875
  const _errs1 = errors;
11110
10876
  for (const key0 in data) {
11111
- 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)))) {
11112
10878
  validate76.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
11113
10879
  return false;
11114
10880
  break;
@@ -11618,202 +11384,288 @@ function validate76(data, { instancePath = "", parentData, parentDataProperty, r
11618
11384
  var valid0 = true;
11619
11385
  }
11620
11386
  if (valid0) {
11621
- if (data.$tags !== undefined) {
11622
- let data17 = data.$tags;
11387
+ if (data.$recordLimit !== undefined) {
11388
+ let data17 = data.$recordLimit;
11623
11389
  const _errs45 = errors;
11624
11390
  if (errors === _errs45) {
11625
11391
  if (data17 && typeof data17 == "object" && !Array.isArray(data17)) {
11626
- if (Object.keys(data17).length < 1) {
11627
- 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 + "'" }];
11628
11395
  return false;
11629
11396
  }
11630
11397
  else {
11631
- if (data17.$requiredTags !== undefined) {
11632
- let data18 = data17.$requiredTags;
11633
- const _errs47 = errors;
11634
- if (errors === _errs47) {
11635
- if (Array.isArray(data18)) {
11636
- var valid10 = true;
11637
- const len3 = data18.length;
11638
- for (let i3 = 0; i3 < len3; i3++) {
11639
- const _errs49 = errors;
11640
- if (typeof data18[i3] !== "string") {
11641
- 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" }];
11642
11418
  return false;
11643
11419
  }
11644
- var valid10 = _errs49 === errors;
11645
- if (!valid10) {
11646
- break;
11647
- }
11648
11420
  }
11649
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
+ }
11650
11441
  else {
11651
- validate76.errors = [{ instancePath: instancePath + "/$tags/$requiredTags", schemaPath: "#/properties/%24tags/properties/%24requiredTags/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
11652
- return false;
11442
+ var valid9 = true;
11653
11443
  }
11654
11444
  }
11655
- var valid9 = _errs47 === errors;
11656
- }
11657
- else {
11658
- var valid9 = true;
11659
11445
  }
11660
- if (valid9) {
11661
- if (data17.$allowUndefinedTags !== undefined) {
11662
- const _errs51 = errors;
11663
- if (typeof data17.$allowUndefinedTags !== "boolean") {
11664
- validate76.errors = [{ instancePath: instancePath + "/$tags/$allowUndefinedTags", schemaPath: "#/properties/%24tags/properties/%24allowUndefinedTags/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
11665
- return false;
11666
- }
11667
- 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;
11668
11479
  }
11669
11480
  else {
11670
- var valid9 = true;
11671
- }
11672
- if (valid9) {
11673
- var props2 = {};
11674
- props2.$requiredTags = true;
11675
- props2.$allowUndefinedTags = true;
11676
- for (const key5 in data17) {
11677
- if (pattern45.test(key5)) {
11678
- let data21 = data17[key5];
11679
- const _errs53 = errors;
11680
- if (errors === _errs53) {
11681
- if (data21 && typeof data21 == "object" && !Array.isArray(data21)) {
11682
- const _errs55 = errors;
11683
- for (const key6 in data21) {
11684
- if (!((((key6 === "type") || (key6 === "items")) || (key6 === "contains")) || (pattern46.test(key6)))) {
11685
- 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" }];
11686
- return false;
11687
- break;
11688
- }
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;
11689
11493
  }
11690
- if (_errs55 === errors) {
11691
- if (data21.type !== undefined) {
11692
- let data22 = data21.type;
11693
- const _errs56 = errors;
11694
- if (!(((((data22 === "string") || (data22 === "number")) || (data22 === "integer")) || (data22 === "boolean")) || (data22 === "array"))) {
11695
- 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" }];
11696
- 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
+ }
11697
11539
  }
11698
- var valid12 = _errs56 === errors;
11699
- }
11700
- else {
11701
- var valid12 = true;
11702
- }
11703
- if (valid12) {
11704
- if (data21.items !== undefined) {
11705
- let data23 = data21.items;
11706
- const _errs57 = errors;
11707
- if (errors === _errs57) {
11708
- if (data23 && typeof data23 == "object" && !Array.isArray(data23)) {
11709
- if (data23.type !== undefined) {
11710
- let data24 = data23.type;
11711
- const _errs59 = errors;
11712
- if (!(((data24 === "string") || (data24 === "number")) || (data24 === "integer"))) {
11713
- 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" }];
11714
- return false;
11715
- }
11716
- var valid13 = _errs59 === errors;
11717
- }
11718
- else {
11719
- var valid13 = true;
11720
- }
11721
- if (valid13) {
11722
- var props3 = {};
11723
- props3.type = true;
11724
- for (const key7 in data23) {
11725
- if (pattern47.test(key7)) {
11726
- props3[key7] = true;
11727
- }
11728
- }
11729
- }
11730
- }
11731
- else {
11732
- 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" }];
11733
11546
  return false;
11734
11547
  }
11548
+ var valid13 = _errs66 === errors;
11735
11549
  }
11736
- var valid12 = _errs57 === errors;
11737
- }
11738
- else {
11739
- var valid12 = true;
11740
- }
11741
- if (valid12) {
11742
- if (data21.contains !== undefined) {
11743
- let data25 = data21.contains;
11744
- const _errs60 = errors;
11745
- if (errors === _errs60) {
11746
- if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
11747
- if (data25.type !== undefined) {
11748
- let data26 = data25.type;
11749
- const _errs62 = errors;
11750
- if (!(((data26 === "string") || (data26 === "number")) || (data26 === "integer"))) {
11751
- 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" }];
11752
- 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
+ }
11753
11579
  }
11754
- var valid15 = _errs62 === errors;
11755
11580
  }
11756
11581
  else {
11757
- 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;
11758
11584
  }
11759
- if (valid15) {
11760
- var props4 = {};
11761
- props4.type = true;
11762
- for (const key8 in data25) {
11763
- if (pattern47.test(key8)) {
11764
- 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
+ }
11765
11617
  }
11766
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
+ }
11767
11623
  }
11624
+ var valid13 = _errs70 === errors;
11768
11625
  }
11769
11626
  else {
11770
- 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" }];
11771
- return false;
11627
+ var valid13 = true;
11772
11628
  }
11773
11629
  }
11774
- var valid12 = _errs60 === errors;
11775
- }
11776
- else {
11777
- var valid12 = true;
11778
11630
  }
11779
11631
  }
11780
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
+ }
11781
11637
  }
11782
- }
11783
- else {
11784
- 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" }];
11785
- return false;
11638
+ props2[key6] = true;
11786
11639
  }
11787
11640
  }
11788
- props2[key5] = true;
11789
11641
  }
11790
11642
  }
11791
11643
  }
11792
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
+ }
11793
11649
  }
11650
+ var valid0 = _errs55 === errors;
11794
11651
  }
11795
11652
  else {
11796
- validate76.errors = [{ instancePath: instancePath + "/$tags", schemaPath: "#/properties/%24tags/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
11797
- return false;
11653
+ var valid0 = true;
11798
11654
  }
11799
- }
11800
- var valid0 = _errs45 === errors;
11801
- }
11802
- else {
11803
- var valid0 = true;
11804
- }
11805
- if (valid0) {
11806
- var valid17 = true;
11807
- for (const key9 in data) {
11808
- if (pattern43.test(key9)) {
11809
- const _errs63 = errors;
11810
- if (!(wrapper2.validate(data[key9], { instancePath: instancePath + "/" + key9.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data, parentDataProperty: key9, rootData, dynamicAnchors }))) {
11811
- vErrors = vErrors === null ? wrapper2.validate.errors : vErrors.concat(wrapper2.validate.errors);
11812
- errors = vErrors.length;
11813
- }
11814
- var valid17 = _errs63 === errors;
11815
- if (!valid17) {
11816
- 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
+ }
11817
11669
  }
11818
11670
  }
11819
11671
  }