@xyo-network/sdk-protocol 7.0.4

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 (391) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +85 -0
  3. package/dist/_pkg/account/neutral/Account.d.ts +38 -0
  4. package/dist/_pkg/account/neutral/Jwt/base64url.d.ts +5 -0
  5. package/dist/_pkg/account/neutral/Jwt/createJwt.d.ts +3 -0
  6. package/dist/_pkg/account/neutral/Jwt/decodeJwt.d.ts +3 -0
  7. package/dist/_pkg/account/neutral/Jwt/digest.d.ts +4 -0
  8. package/dist/_pkg/account/neutral/Jwt/index.d.ts +6 -0
  9. package/dist/_pkg/account/neutral/Jwt/verifyJwt.d.ts +3 -0
  10. package/dist/_pkg/account/neutral/Key/AddressValue.d.ts +11 -0
  11. package/dist/_pkg/account/neutral/Key/EllipticKey.d.ts +4 -0
  12. package/dist/_pkg/account/neutral/Key/PrivateKey.d.ts +14 -0
  13. package/dist/_pkg/account/neutral/Key/PublicKey.d.ts +14 -0
  14. package/dist/_pkg/account/neutral/Key/index.d.ts +5 -0
  15. package/dist/_pkg/account/neutral/index.d.ts +6 -0
  16. package/dist/_pkg/account/neutral/index.mjs +547 -0
  17. package/dist/_pkg/account/neutral/lib/index.d.ts +2 -0
  18. package/dist/_pkg/account/neutral/lib/walletPath/combineWalletPaths.d.ts +2 -0
  19. package/dist/_pkg/account/neutral/lib/walletPath/formatWalletPath.d.ts +2 -0
  20. package/dist/_pkg/account/neutral/lib/walletPath/index.d.ts +4 -0
  21. package/dist/_pkg/account/neutral/lib/walletPath/isValidWalletPath.d.ts +3 -0
  22. package/dist/_pkg/account/neutral/register.d.ts +2 -0
  23. package/dist/_pkg/account-model/neutral/Account.d.ts +46 -0
  24. package/dist/_pkg/account-model/neutral/Algorithm.d.ts +5 -0
  25. package/dist/_pkg/account-model/neutral/Jwt/constants.d.ts +14 -0
  26. package/dist/_pkg/account-model/neutral/Jwt/index.d.ts +3 -0
  27. package/dist/_pkg/account-model/neutral/Jwt/types.d.ts +56 -0
  28. package/dist/_pkg/account-model/neutral/VerifierRegistry.d.ts +6 -0
  29. package/dist/_pkg/account-model/neutral/addressTo20Bytes.d.ts +2 -0
  30. package/dist/_pkg/account-model/neutral/index.d.ts +6 -0
  31. package/dist/_pkg/account-model/neutral/index.mjs +100 -0
  32. package/dist/_pkg/address/neutral/XyoAddress.d.ts +38 -0
  33. package/dist/_pkg/address/neutral/XyoLegacyAddress.d.ts +37 -0
  34. package/dist/_pkg/address/neutral/XyoQuantAddress.d.ts +33 -0
  35. package/dist/_pkg/address/neutral/index.d.ts +4 -0
  36. package/dist/_pkg/address/neutral/index.mjs +75 -0
  37. package/dist/_pkg/api/neutral/Api/Api.d.ts +8 -0
  38. package/dist/_pkg/api/neutral/Api/index.d.ts +2 -0
  39. package/dist/_pkg/api/neutral/Base.d.ts +32 -0
  40. package/dist/_pkg/api/neutral/Simple.d.ts +22 -0
  41. package/dist/_pkg/api/neutral/WithArchive.d.ts +4 -0
  42. package/dist/_pkg/api/neutral/index.d.ts +6 -0
  43. package/dist/_pkg/api/neutral/index.mjs +187 -0
  44. package/dist/_pkg/api/neutral/models/ArchivePath.d.ts +4 -0
  45. package/dist/_pkg/api/neutral/models/index.d.ts +2 -0
  46. package/dist/_pkg/api/neutral/objToQuery.d.ts +2 -0
  47. package/dist/_pkg/api-models/neutral/Config.d.ts +25 -0
  48. package/dist/_pkg/api-models/neutral/Envelope.d.ts +15 -0
  49. package/dist/_pkg/api-models/neutral/Error.d.ts +5 -0
  50. package/dist/_pkg/api-models/neutral/Reportable.d.ts +8 -0
  51. package/dist/_pkg/api-models/neutral/Response.d.ts +8 -0
  52. package/dist/_pkg/api-models/neutral/Warning.d.ts +2 -0
  53. package/dist/_pkg/api-models/neutral/index.d.ts +7 -0
  54. package/dist/_pkg/api-models/neutral/index.mjs +1 -0
  55. package/dist/_pkg/boundwitness/neutral/builder.d.ts +2 -0
  56. package/dist/_pkg/boundwitness/neutral/builder.mjs +3 -0
  57. package/dist/_pkg/boundwitness/neutral/index.d.ts +5 -0
  58. package/dist/_pkg/boundwitness/neutral/index.mjs +6 -0
  59. package/dist/_pkg/boundwitness/neutral/model.d.ts +2 -0
  60. package/dist/_pkg/boundwitness/neutral/model.mjs +3 -0
  61. package/dist/_pkg/boundwitness/neutral/validator.d.ts +2 -0
  62. package/dist/_pkg/boundwitness/neutral/validator.mjs +3 -0
  63. package/dist/_pkg/boundwitness/neutral/wrapper.d.ts +2 -0
  64. package/dist/_pkg/boundwitness/neutral/wrapper.mjs +3 -0
  65. package/dist/_pkg/boundwitness-builder/neutral/BoundWitnessBuilder.d.ts +48 -0
  66. package/dist/_pkg/boundwitness-builder/neutral/GeneratedBoundWitnessFields.d.ts +3 -0
  67. package/dist/_pkg/boundwitness-builder/neutral/Query/QueryBoundWitnessBuilder.d.ts +9 -0
  68. package/dist/_pkg/boundwitness-builder/neutral/Query/index.d.ts +2 -0
  69. package/dist/_pkg/boundwitness-builder/neutral/combinationsByBoundwitness.d.ts +10 -0
  70. package/dist/_pkg/boundwitness-builder/neutral/index.d.ts +5 -0
  71. package/dist/_pkg/boundwitness-builder/neutral/index.mjs +311 -0
  72. package/dist/_pkg/boundwitness-builder/neutral/intraBoundwitnessSchemaCombinations.d.ts +11 -0
  73. package/dist/_pkg/boundwitness-builder/neutral/uniqueAccounts.d.ts +3 -0
  74. package/dist/_pkg/boundwitness-builder/neutral/uniqueAddresses.d.ts +3 -0
  75. package/dist/_pkg/boundwitness-model/neutral/BoundWitness/BoundWitness.d.ts +173 -0
  76. package/dist/_pkg/boundwitness-model/neutral/BoundWitness/BoundWitnessJsonSchema.d.ts +37 -0
  77. package/dist/_pkg/boundwitness-model/neutral/BoundWitness/BoundWitnessSchema.d.ts +5 -0
  78. package/dist/_pkg/boundwitness-model/neutral/BoundWitness/HydratedBoundWitness.d.ts +72 -0
  79. package/dist/_pkg/boundwitness-model/neutral/BoundWitness/Signatures.d.ts +14 -0
  80. package/dist/_pkg/boundwitness-model/neutral/BoundWitness/SignedBoundWitness.d.ts +44 -0
  81. package/dist/_pkg/boundwitness-model/neutral/BoundWitness/UnsignedBoundWitness.d.ts +44 -0
  82. package/dist/_pkg/boundwitness-model/neutral/BoundWitness/index.d.ts +8 -0
  83. package/dist/_pkg/boundwitness-model/neutral/QueryBoundWitness.d.ts +150 -0
  84. package/dist/_pkg/boundwitness-model/neutral/index.d.ts +3 -0
  85. package/dist/_pkg/boundwitness-model/neutral/index.mjs +131 -0
  86. package/dist/_pkg/boundwitness-validator/neutral/Validator.d.ts +17 -0
  87. package/dist/_pkg/boundwitness-validator/neutral/index.d.ts +3 -0
  88. package/dist/_pkg/boundwitness-validator/neutral/index.mjs +177 -0
  89. package/dist/_pkg/boundwitness-validator/neutral/lib/addresses/addressesContains.d.ts +10 -0
  90. package/dist/_pkg/boundwitness-validator/neutral/lib/addresses/addressesContainsAll.d.ts +10 -0
  91. package/dist/_pkg/boundwitness-validator/neutral/lib/addresses/addressesContainsAny.d.ts +12 -0
  92. package/dist/_pkg/boundwitness-validator/neutral/lib/addresses/index.d.ts +4 -0
  93. package/dist/_pkg/boundwitness-validator/neutral/lib/index.d.ts +4 -0
  94. package/dist/_pkg/boundwitness-validator/neutral/lib/payloadHashes/index.d.ts +4 -0
  95. package/dist/_pkg/boundwitness-validator/neutral/lib/payloadHashes/payloadHashesContains.d.ts +10 -0
  96. package/dist/_pkg/boundwitness-validator/neutral/lib/payloadHashes/payloadHashesContainsAll.d.ts +10 -0
  97. package/dist/_pkg/boundwitness-validator/neutral/lib/payloadHashes/payloadHashesContainsAny.d.ts +12 -0
  98. package/dist/_pkg/boundwitness-validator/neutral/lib/payloadSchemas/index.d.ts +4 -0
  99. package/dist/_pkg/boundwitness-validator/neutral/lib/payloadSchemas/payloadSchemasContains.d.ts +10 -0
  100. package/dist/_pkg/boundwitness-validator/neutral/lib/payloadSchemas/payloadSchemasContainsAll.d.ts +10 -0
  101. package/dist/_pkg/boundwitness-validator/neutral/lib/payloadSchemas/payloadSchemasContainsAny.d.ts +12 -0
  102. package/dist/_pkg/boundwitness-validator/neutral/lib/util/BoundWitnessArrayProperty.d.ts +10 -0
  103. package/dist/_pkg/boundwitness-validator/neutral/lib/util/boundWitnessArrayPropertyContains.d.ts +11 -0
  104. package/dist/_pkg/boundwitness-validator/neutral/lib/util/boundWitnessArrayPropertyContainsAll.d.ts +11 -0
  105. package/dist/_pkg/boundwitness-validator/neutral/lib/util/boundWitnessArrayPropertyContainsAny.d.ts +13 -0
  106. package/dist/_pkg/boundwitness-validator/neutral/lib/util/index.d.ts +4 -0
  107. package/dist/_pkg/boundwitness-wrapper/neutral/BoundWitnessWrapper.d.ts +60 -0
  108. package/dist/_pkg/boundwitness-wrapper/neutral/QueryBoundWitnessWrapper.d.ts +14 -0
  109. package/dist/_pkg/boundwitness-wrapper/neutral/SchemaType.d.ts +6 -0
  110. package/dist/_pkg/boundwitness-wrapper/neutral/index.d.ts +4 -0
  111. package/dist/_pkg/boundwitness-wrapper/neutral/index.mjs +281 -0
  112. package/dist/_pkg/config-payload-plugin/neutral/Payload.d.ts +44 -0
  113. package/dist/_pkg/config-payload-plugin/neutral/Plugin.d.ts +7 -0
  114. package/dist/_pkg/config-payload-plugin/neutral/Schema.d.ts +5 -0
  115. package/dist/_pkg/config-payload-plugin/neutral/Template.d.ts +3 -0
  116. package/dist/_pkg/config-payload-plugin/neutral/index.d.ts +5 -0
  117. package/dist/_pkg/config-payload-plugin/neutral/index.mjs +44 -0
  118. package/dist/_pkg/core/neutral/index.d.ts +6 -0
  119. package/dist/_pkg/core/neutral/index.mjs +7 -0
  120. package/dist/_pkg/core-payload-plugins/neutral/index.d.ts +11 -0
  121. package/dist/_pkg/core-payload-plugins/neutral/index.mjs +26 -0
  122. package/dist/_pkg/crypto/neutral/account-model.d.ts +2 -0
  123. package/dist/_pkg/crypto/neutral/account-model.mjs +3 -0
  124. package/dist/_pkg/crypto/neutral/account.d.ts +2 -0
  125. package/dist/_pkg/crypto/neutral/account.mjs +3 -0
  126. package/dist/_pkg/crypto/neutral/index.d.ts +10 -0
  127. package/dist/_pkg/crypto/neutral/index.mjs +11 -0
  128. package/dist/_pkg/crypto/neutral/key-model.d.ts +2 -0
  129. package/dist/_pkg/crypto/neutral/key-model.mjs +3 -0
  130. package/dist/_pkg/crypto/neutral/wallet-model.d.ts +2 -0
  131. package/dist/_pkg/crypto/neutral/wallet-model.mjs +3 -0
  132. package/dist/_pkg/crypto/neutral/wallet.d.ts +2 -0
  133. package/dist/_pkg/crypto/neutral/wallet.mjs +3 -0
  134. package/dist/_pkg/data/neutral/AbstractData.d.ts +16 -0
  135. package/dist/_pkg/data/neutral/Data.d.ts +13 -0
  136. package/dist/_pkg/data/neutral/index.d.ts +3 -0
  137. package/dist/_pkg/data/neutral/index.mjs +53 -0
  138. package/dist/_pkg/dns/neutral/DnsRecordType.d.ts +16 -0
  139. package/dist/_pkg/dns/neutral/DnsReturnCode.d.ts +14 -0
  140. package/dist/_pkg/dns/neutral/GoogleDnsResult.d.ts +17 -0
  141. package/dist/_pkg/dns/neutral/GoogleDnsResultAnswer.d.ts +8 -0
  142. package/dist/_pkg/dns/neutral/GoogleDnsResultQuestion.d.ts +11 -0
  143. package/dist/_pkg/dns/neutral/domainExists.d.ts +8 -0
  144. package/dist/_pkg/dns/neutral/domainResolve.d.ts +9 -0
  145. package/dist/_pkg/dns/neutral/googleDnsOverHttps.d.ts +5 -0
  146. package/dist/_pkg/dns/neutral/index.d.ts +9 -0
  147. package/dist/_pkg/dns/neutral/index.mjs +61 -0
  148. package/dist/_pkg/domain-payload-plugin/neutral/DomainConfigPayload.d.ts +219 -0
  149. package/dist/_pkg/domain-payload-plugin/neutral/DomainConfigPlugin.d.ts +33 -0
  150. package/dist/_pkg/domain-payload-plugin/neutral/DomainConfigSchema.d.ts +5 -0
  151. package/dist/_pkg/domain-payload-plugin/neutral/DomainConfigTemplate.d.ts +3 -0
  152. package/dist/_pkg/domain-payload-plugin/neutral/Payload.d.ts +282 -0
  153. package/dist/_pkg/domain-payload-plugin/neutral/Plugin.d.ts +33 -0
  154. package/dist/_pkg/domain-payload-plugin/neutral/Resolution/DomainSchemaResolver.d.ts +45 -0
  155. package/dist/_pkg/domain-payload-plugin/neutral/Resolution/SchemaResolution.d.ts +27 -0
  156. package/dist/_pkg/domain-payload-plugin/neutral/Resolution/XyoDnsRecords.d.ts +27 -0
  157. package/dist/_pkg/domain-payload-plugin/neutral/Resolution/index.d.ts +4 -0
  158. package/dist/_pkg/domain-payload-plugin/neutral/Schema.d.ts +5 -0
  159. package/dist/_pkg/domain-payload-plugin/neutral/Template.d.ts +3 -0
  160. package/dist/_pkg/domain-payload-plugin/neutral/Wrapper.d.ts +278 -0
  161. package/dist/_pkg/domain-payload-plugin/neutral/index.d.ts +11 -0
  162. package/dist/_pkg/domain-payload-plugin/neutral/index.mjs +485 -0
  163. package/dist/_pkg/elliptic/neutral/Elliptic.d.ts +15 -0
  164. package/dist/_pkg/elliptic/neutral/index.d.ts +2 -0
  165. package/dist/_pkg/elliptic/neutral/index.mjs +89 -0
  166. package/dist/_pkg/hash/browser/BrowserObjectHasher.d.ts +9 -0
  167. package/dist/_pkg/hash/browser/NodeObjectHasher.d.ts +6 -0
  168. package/dist/_pkg/hash/browser/ObjectHasher.d.ts +69 -0
  169. package/dist/_pkg/hash/browser/createBrowserWorker.d.ts +3 -0
  170. package/dist/_pkg/hash/browser/createNodeWorker.d.ts +3 -0
  171. package/dist/_pkg/hash/browser/hasEmptyFields.d.ts +3 -0
  172. package/dist/_pkg/hash/browser/index-browser.d.ts +4 -0
  173. package/dist/_pkg/hash/browser/index-browser.mjs +289 -0
  174. package/dist/_pkg/hash/browser/index.d.ts +5 -0
  175. package/dist/_pkg/hash/browser/removeEmptyFields.d.ts +3 -0
  176. package/dist/_pkg/hash/browser/sortFields.d.ts +3 -0
  177. package/dist/_pkg/hash/browser/worker/index.d.ts +3 -0
  178. package/dist/_pkg/hash/browser/worker/subtleHash-bundle.mjs +257 -0
  179. package/dist/_pkg/hash/browser/worker/subtleHash.d.ts +2 -0
  180. package/dist/_pkg/hash/browser/worker/subtleHashNode.d.ts +2 -0
  181. package/dist/_pkg/hash/browser/worker/wasmHash-bundle.mjs +1678 -0
  182. package/dist/_pkg/hash/browser/worker/wasmHash.d.ts +2 -0
  183. package/dist/_pkg/hash/browser/worker/wasmHashNode.d.ts +2 -0
  184. package/dist/_pkg/hash/neutral/BrowserObjectHasher.d.ts +9 -0
  185. package/dist/_pkg/hash/neutral/NodeObjectHasher.d.ts +6 -0
  186. package/dist/_pkg/hash/neutral/ObjectHasher.d.ts +69 -0
  187. package/dist/_pkg/hash/neutral/createBrowserWorker.d.ts +3 -0
  188. package/dist/_pkg/hash/neutral/createNodeWorker.d.ts +3 -0
  189. package/dist/_pkg/hash/neutral/hasEmptyFields.d.ts +3 -0
  190. package/dist/_pkg/hash/neutral/index-browser.d.ts +4 -0
  191. package/dist/_pkg/hash/neutral/index-browser.mjs +289 -0
  192. package/dist/_pkg/hash/neutral/index.d.ts +5 -0
  193. package/dist/_pkg/hash/neutral/removeEmptyFields.d.ts +3 -0
  194. package/dist/_pkg/hash/neutral/sortFields.d.ts +3 -0
  195. package/dist/_pkg/hash/neutral/worker/index.d.ts +3 -0
  196. package/dist/_pkg/hash/neutral/worker/subtleHash.d.ts +2 -0
  197. package/dist/_pkg/hash/neutral/worker/subtleHashNode.d.ts +2 -0
  198. package/dist/_pkg/hash/neutral/worker/wasmHash.d.ts +2 -0
  199. package/dist/_pkg/hash/neutral/worker/wasmHashNode.d.ts +2 -0
  200. package/dist/_pkg/hash/node/BrowserObjectHasher.d.ts +9 -0
  201. package/dist/_pkg/hash/node/NodeObjectHasher.d.ts +6 -0
  202. package/dist/_pkg/hash/node/ObjectHasher.d.ts +69 -0
  203. package/dist/_pkg/hash/node/createBrowserWorker.d.ts +3 -0
  204. package/dist/_pkg/hash/node/createNodeWorker.d.ts +3 -0
  205. package/dist/_pkg/hash/node/hasEmptyFields.d.ts +3 -0
  206. package/dist/_pkg/hash/node/index-browser.d.ts +4 -0
  207. package/dist/_pkg/hash/node/index.d.ts +5 -0
  208. package/dist/_pkg/hash/node/index.mjs +279 -0
  209. package/dist/_pkg/hash/node/removeEmptyFields.d.ts +3 -0
  210. package/dist/_pkg/hash/node/sortFields.d.ts +3 -0
  211. package/dist/_pkg/hash/node/worker/index.d.ts +3 -0
  212. package/dist/_pkg/hash/node/worker/subtleHash.d.ts +2 -0
  213. package/dist/_pkg/hash/node/worker/subtleHashNode.d.ts +2 -0
  214. package/dist/_pkg/hash/node/worker/wasmHash.d.ts +2 -0
  215. package/dist/_pkg/hash/node/worker/wasmHashNode.d.ts +2 -0
  216. package/dist/_pkg/huri/neutral/Huri.d.ts +33 -0
  217. package/dist/_pkg/huri/neutral/index.d.ts +2 -0
  218. package/dist/_pkg/huri/neutral/index.mjs +118 -0
  219. package/dist/_pkg/id-payload-plugin/neutral/Payload.d.ts +86 -0
  220. package/dist/_pkg/id-payload-plugin/neutral/Plugin.d.ts +7 -0
  221. package/dist/_pkg/id-payload-plugin/neutral/Schema.d.ts +5 -0
  222. package/dist/_pkg/id-payload-plugin/neutral/Template.d.ts +3 -0
  223. package/dist/_pkg/id-payload-plugin/neutral/index.d.ts +5 -0
  224. package/dist/_pkg/id-payload-plugin/neutral/index.mjs +48 -0
  225. package/dist/_pkg/key-model/neutral/Key/AddressValue.d.ts +10 -0
  226. package/dist/_pkg/key-model/neutral/Key/EllipticKey.d.ts +4 -0
  227. package/dist/_pkg/key-model/neutral/Key/PrivateKey.d.ts +15 -0
  228. package/dist/_pkg/key-model/neutral/Key/PublicKey.d.ts +11 -0
  229. package/dist/_pkg/key-model/neutral/Key/index.d.ts +4 -0
  230. package/dist/_pkg/key-model/neutral/index.d.ts +2 -0
  231. package/dist/_pkg/key-model/neutral/index.mjs +1 -0
  232. package/dist/_pkg/manifest/neutral/index.d.ts +2 -0
  233. package/dist/_pkg/manifest/neutral/index.mjs +3 -0
  234. package/dist/_pkg/manifest-model/neutral/Manifest.d.ts +4 -0
  235. package/dist/_pkg/manifest-model/neutral/Manifest.zod.d.ts +2619 -0
  236. package/dist/_pkg/manifest-model/neutral/Payload.d.ts +2 -0
  237. package/dist/_pkg/manifest-model/neutral/Payload.zod.d.ts +1591 -0
  238. package/dist/_pkg/manifest-model/neutral/index.d.ts +3 -0
  239. package/dist/_pkg/manifest-model/neutral/index.mjs +193 -0
  240. package/dist/_pkg/metamask-connector/browser/MetaMaskConnector.d.ts +38 -0
  241. package/dist/_pkg/metamask-connector/browser/index.d.ts +2 -0
  242. package/dist/_pkg/metamask-connector/browser/index.mjs +114 -0
  243. package/dist/_pkg/network/neutral/NetworkNodePayload.d.ts +79 -0
  244. package/dist/_pkg/network/neutral/NetworkNodePayloadWrapper.d.ts +17 -0
  245. package/dist/_pkg/network/neutral/NetworkPayload.d.ts +119 -0
  246. package/dist/_pkg/network/neutral/NetworkPayloadWrapper.d.ts +63 -0
  247. package/dist/_pkg/network/neutral/index.d.ts +8 -0
  248. package/dist/_pkg/network/neutral/index.mjs +211 -0
  249. package/dist/_pkg/network/neutral/knownArchivists.d.ts +3 -0
  250. package/dist/_pkg/network/neutral/knownDiviners.d.ts +3 -0
  251. package/dist/_pkg/network/neutral/knownNetworks.d.ts +3 -0
  252. package/dist/_pkg/payload/neutral/builder.d.ts +2 -0
  253. package/dist/_pkg/payload/neutral/builder.mjs +3 -0
  254. package/dist/_pkg/payload/neutral/index.d.ts +6 -0
  255. package/dist/_pkg/payload/neutral/index.mjs +7 -0
  256. package/dist/_pkg/payload/neutral/model.d.ts +2 -0
  257. package/dist/_pkg/payload/neutral/model.mjs +3 -0
  258. package/dist/_pkg/payload/neutral/validator.d.ts +2 -0
  259. package/dist/_pkg/payload/neutral/validator.mjs +3 -0
  260. package/dist/_pkg/payload/neutral/wrapper.d.ts +2 -0
  261. package/dist/_pkg/payload/neutral/wrapper.mjs +3 -0
  262. package/dist/_pkg/payload-builder/neutral/Builder.d.ts +70 -0
  263. package/dist/_pkg/payload-builder/neutral/Options.d.ts +7 -0
  264. package/dist/_pkg/payload-builder/neutral/index.d.ts +3 -0
  265. package/dist/_pkg/payload-builder/neutral/index.mjs +218 -0
  266. package/dist/_pkg/payload-model/neutral/Error.d.ts +65 -0
  267. package/dist/_pkg/payload-model/neutral/Payload.d.ts +35 -0
  268. package/dist/_pkg/payload-model/neutral/PayloadBundle.d.ts +72 -0
  269. package/dist/_pkg/payload-model/neutral/PayloadFindFilter.d.ts +6 -0
  270. package/dist/_pkg/payload-model/neutral/PayloadHashMap.d.ts +7 -0
  271. package/dist/_pkg/payload-model/neutral/PayloadSet/PayloadSetPayload.d.ts +54 -0
  272. package/dist/_pkg/payload-model/neutral/PayloadSet/PayloadSetSchema.d.ts +5 -0
  273. package/dist/_pkg/payload-model/neutral/PayloadSet/index.d.ts +3 -0
  274. package/dist/_pkg/payload-model/neutral/PayloadValidationFunction.d.ts +14 -0
  275. package/dist/_pkg/payload-model/neutral/PayloadValueExpression.d.ts +38 -0
  276. package/dist/_pkg/payload-model/neutral/PayloadZod.d.ts +173 -0
  277. package/dist/_pkg/payload-model/neutral/Query.d.ts +21 -0
  278. package/dist/_pkg/payload-model/neutral/Schema.d.ts +38 -0
  279. package/dist/_pkg/payload-model/neutral/StorageMeta/DataHash.d.ts +24 -0
  280. package/dist/_pkg/payload-model/neutral/StorageMeta/Hash.d.ts +25 -0
  281. package/dist/_pkg/payload-model/neutral/StorageMeta/Sequence.d.ts +11 -0
  282. package/dist/_pkg/payload-model/neutral/StorageMeta/index.d.ts +3 -0
  283. package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/Comparer.d.ts +7 -0
  284. package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/Parser.d.ts +31 -0
  285. package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/Sequence.d.ts +80 -0
  286. package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/SequenceZod.d.ts +9 -0
  287. package/dist/_pkg/payload-model/neutral/StorageMeta/sequence/index.d.ts +5 -0
  288. package/dist/_pkg/payload-model/neutral/Timestamp.d.ts +8 -0
  289. package/dist/_pkg/payload-model/neutral/index.d.ts +16 -0
  290. package/dist/_pkg/payload-model/neutral/index.mjs +452 -0
  291. package/dist/_pkg/payload-model/neutral/isPayloadOfSchemaType.d.ts +5 -0
  292. package/dist/_pkg/payload-model/neutral/isPayloadOfZodType.d.ts +12 -0
  293. package/dist/_pkg/payload-plugin/neutral/Plugin.d.ts +19 -0
  294. package/dist/_pkg/payload-plugin/neutral/Resolver.d.ts +26 -0
  295. package/dist/_pkg/payload-plugin/neutral/createPlugin.d.ts +5 -0
  296. package/dist/_pkg/payload-plugin/neutral/index.d.ts +4 -0
  297. package/dist/_pkg/payload-plugin/neutral/index.mjs +67 -0
  298. package/dist/_pkg/payload-validator/neutral/Validator.d.ts +18 -0
  299. package/dist/_pkg/payload-validator/neutral/index.d.ts +2 -0
  300. package/dist/_pkg/payload-validator/neutral/index.mjs +40 -0
  301. package/dist/_pkg/payload-wrapper/neutral/PayloadDataWrapper.d.ts +18 -0
  302. package/dist/_pkg/payload-wrapper/neutral/PayloadWrapper.d.ts +6 -0
  303. package/dist/_pkg/payload-wrapper/neutral/PayloadWrapperBase.d.ts +23 -0
  304. package/dist/_pkg/payload-wrapper/neutral/SchemaType.d.ts +6 -0
  305. package/dist/_pkg/payload-wrapper/neutral/index.d.ts +4 -0
  306. package/dist/_pkg/payload-wrapper/neutral/index.mjs +157 -0
  307. package/dist/_pkg/pqc/neutral/MlDsa.d.ts +20 -0
  308. package/dist/_pkg/pqc/neutral/index.d.ts +2 -0
  309. package/dist/_pkg/pqc/neutral/index.mjs +47 -0
  310. package/dist/_pkg/previous-hash-store/neutral/index.d.ts +4 -0
  311. package/dist/_pkg/previous-hash-store/neutral/index.mjs +5 -0
  312. package/dist/_pkg/previous-hash-store-indexeddb/neutral/IndexedDbPreviousHashStore.d.ts +27 -0
  313. package/dist/_pkg/previous-hash-store-indexeddb/neutral/index.d.ts +2 -0
  314. package/dist/_pkg/previous-hash-store-indexeddb/neutral/index.mjs +42 -0
  315. package/dist/_pkg/previous-hash-store-model/neutral/PreviousHashStore.d.ts +8 -0
  316. package/dist/_pkg/previous-hash-store-model/neutral/index.d.ts +2 -0
  317. package/dist/_pkg/previous-hash-store-model/neutral/index.mjs +1 -0
  318. package/dist/_pkg/previous-hash-store-storage/neutral/NamespacedStorage.d.ts +10 -0
  319. package/dist/_pkg/previous-hash-store-storage/neutral/StoragePreviousHashStore.d.ts +24 -0
  320. package/dist/_pkg/previous-hash-store-storage/neutral/index.d.ts +3 -0
  321. package/dist/_pkg/previous-hash-store-storage/neutral/index.mjs +104 -0
  322. package/dist/_pkg/protocol/neutral/index.d.ts +5 -0
  323. package/dist/_pkg/protocol/neutral/index.mjs +6 -0
  324. package/dist/_pkg/quadkey/neutral/Quadkey.d.ts +65 -0
  325. package/dist/_pkg/quadkey/neutral/RelativeDirectionConstantLookup.d.ts +2 -0
  326. package/dist/_pkg/quadkey/neutral/index.d.ts +2 -0
  327. package/dist/_pkg/quadkey/neutral/index.mjs +281 -0
  328. package/dist/_pkg/quant-account/neutral/QuantAccount.d.ts +34 -0
  329. package/dist/_pkg/quant-account/neutral/index.d.ts +3 -0
  330. package/dist/_pkg/quant-account/neutral/index.mjs +173 -0
  331. package/dist/_pkg/quant-account/neutral/register.d.ts +2 -0
  332. package/dist/_pkg/query-payload-plugin/neutral/Payload.d.ts +43 -0
  333. package/dist/_pkg/query-payload-plugin/neutral/Plugin.d.ts +7 -0
  334. package/dist/_pkg/query-payload-plugin/neutral/Schema.d.ts +5 -0
  335. package/dist/_pkg/query-payload-plugin/neutral/Template.d.ts +3 -0
  336. package/dist/_pkg/query-payload-plugin/neutral/index.d.ts +5 -0
  337. package/dist/_pkg/query-payload-plugin/neutral/index.mjs +44 -0
  338. package/dist/_pkg/schema-cache/neutral/Debounce.d.ts +5 -0
  339. package/dist/_pkg/schema-cache/neutral/SchemaCache.d.ts +43 -0
  340. package/dist/_pkg/schema-cache/neutral/SchemaNameToValidatorMap.d.ts +12 -0
  341. package/dist/_pkg/schema-cache/neutral/TtlLruCache.d.ts +13 -0
  342. package/dist/_pkg/schema-cache/neutral/index.d.ts +5 -0
  343. package/dist/_pkg/schema-cache/neutral/index.mjs +178 -0
  344. package/dist/_pkg/schema-name-validator/neutral/SchemaNameValidator.d.ts +43 -0
  345. package/dist/_pkg/schema-name-validator/neutral/index.d.ts +2 -0
  346. package/dist/_pkg/schema-name-validator/neutral/index.mjs +69 -0
  347. package/dist/_pkg/schema-payload-plugin/neutral/Payload.d.ts +96 -0
  348. package/dist/_pkg/schema-payload-plugin/neutral/Plugin.d.ts +13 -0
  349. package/dist/_pkg/schema-payload-plugin/neutral/Schema.d.ts +5 -0
  350. package/dist/_pkg/schema-payload-plugin/neutral/Template.d.ts +3 -0
  351. package/dist/_pkg/schema-payload-plugin/neutral/index.d.ts +5 -0
  352. package/dist/_pkg/schema-payload-plugin/neutral/index.mjs +60 -0
  353. package/dist/_pkg/sdk-utils/neutral/api.d.ts +5 -0
  354. package/dist/_pkg/sdk-utils/neutral/api.mjs +6 -0
  355. package/dist/_pkg/sdk-utils/neutral/index.d.ts +9 -0
  356. package/dist/_pkg/sdk-utils/neutral/index.mjs +10 -0
  357. package/dist/_pkg/sdk-utils/neutral/integrations.d.ts +3 -0
  358. package/dist/_pkg/sdk-utils/neutral/integrations.mjs +4 -0
  359. package/dist/_pkg/sdk-utils/neutral/plugins.d.ts +2 -0
  360. package/dist/_pkg/sdk-utils/neutral/plugins.mjs +3 -0
  361. package/dist/_pkg/sdk-utils/neutral/validation.d.ts +2 -0
  362. package/dist/_pkg/sdk-utils/neutral/validation.mjs +3 -0
  363. package/dist/_pkg/value-payload-plugin/neutral/Payload.d.ts +46 -0
  364. package/dist/_pkg/value-payload-plugin/neutral/Plugin.d.ts +3 -0
  365. package/dist/_pkg/value-payload-plugin/neutral/Schema.d.ts +5 -0
  366. package/dist/_pkg/value-payload-plugin/neutral/Template.d.ts +3 -0
  367. package/dist/_pkg/value-payload-plugin/neutral/index.d.ts +5 -0
  368. package/dist/_pkg/value-payload-plugin/neutral/index.mjs +44 -0
  369. package/dist/_pkg/wallet/neutral/HDWallet.d.ts +38 -0
  370. package/dist/_pkg/wallet/neutral/index.d.ts +2 -0
  371. package/dist/_pkg/wallet/neutral/index.mjs +157 -0
  372. package/dist/_pkg/wallet-model/neutral/Mnemonic.d.ts +27 -0
  373. package/dist/_pkg/wallet-model/neutral/Wallet.d.ts +26 -0
  374. package/dist/_pkg/wallet-model/neutral/Wordlist.d.ts +24 -0
  375. package/dist/_pkg/wallet-model/neutral/index.d.ts +2 -0
  376. package/dist/_pkg/wallet-model/neutral/index.mjs +1 -0
  377. package/dist/_pkg/wasm/neutral/WasmSupport.d.ts +110 -0
  378. package/dist/_pkg/wasm/neutral/index.d.ts +2 -0
  379. package/dist/_pkg/wasm/neutral/index.mjs +178 -0
  380. package/dist/_pkg/wasm/neutral/wasmFeatureDetect.d.ts +16 -0
  381. package/dist/neutral/core-payload-plugins.d.ts +1 -0
  382. package/dist/neutral/core-payload-plugins.mjs +1 -0
  383. package/dist/neutral/index.d.ts +4 -0
  384. package/dist/neutral/index.mjs +4 -0
  385. package/dist/neutral/manifest.d.ts +1 -0
  386. package/dist/neutral/manifest.mjs +1 -0
  387. package/dist/neutral/protocol.d.ts +1 -0
  388. package/dist/neutral/protocol.mjs +1 -0
  389. package/dist/neutral/sdk-utils.d.ts +1 -0
  390. package/dist/neutral/sdk-utils.mjs +1 -0
  391. package/package.json +113 -0
@@ -0,0 +1,43 @@
1
+ import * as z from 'zod/mini';
2
+ export declare const QueryPayloadZod: z.ZodMiniObject<{
3
+ schema: z.ZodMiniLiteral<"network.xyo.query" & {
4
+ readonly __schema: true;
5
+ }>;
6
+ query: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniTransform<import("../../payload-model/neutral/index.ts").BrandedSchema<string>, string>>;
7
+ }, z.core.$strip>;
8
+ export type QueryPayload = z.infer<typeof QueryPayloadZod>;
9
+ export declare const isQueryPayload: <T>(value: T) => value is T & {
10
+ schema: "network.xyo.query" & {
11
+ readonly __schema: true;
12
+ };
13
+ query: import("../../payload-model/neutral/index.ts").BrandedSchema<string>;
14
+ };
15
+ export declare const asQueryPayload: {
16
+ <T>(value: T): (T & {
17
+ schema: "network.xyo.query" & {
18
+ readonly __schema: true;
19
+ };
20
+ query: import("../../payload-model/neutral/index.ts").BrandedSchema<string>;
21
+ }) | undefined;
22
+ <T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
23
+ schema: "network.xyo.query" & {
24
+ readonly __schema: true;
25
+ };
26
+ query: import("../../payload-model/neutral/index.ts").BrandedSchema<string>;
27
+ };
28
+ };
29
+ export declare const toQueryPayload: {
30
+ <T>(value: T): (T & {
31
+ schema: "network.xyo.query" & {
32
+ readonly __schema: true;
33
+ };
34
+ query: import("../../payload-model/neutral/index.ts").BrandedSchema<string>;
35
+ }) | undefined;
36
+ <T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
37
+ schema: "network.xyo.query" & {
38
+ readonly __schema: true;
39
+ };
40
+ query: import("../../payload-model/neutral/index.ts").BrandedSchema<string>;
41
+ };
42
+ };
43
+ //# sourceMappingURL=Payload.d.ts.map
@@ -0,0 +1,7 @@
1
+ export declare const QueryPayloadPlugin: () => import("../../payload-plugin/neutral/index.ts").PayloadPlugin<{
2
+ schema: "network.xyo.query" & {
3
+ readonly __schema: true;
4
+ };
5
+ query: import("../../payload-model/neutral/index.ts").BrandedSchema<string>;
6
+ }>;
7
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const QuerySchema: "network.xyo.query" & {
2
+ readonly __schema: true;
3
+ };
4
+ export type QuerySchema = typeof QuerySchema;
5
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { QueryPayload } from './Payload.ts';
2
+ export declare const queryPayloadTemplate: () => QueryPayload;
3
+ //# sourceMappingURL=Template.d.ts.map
@@ -0,0 +1,5 @@
1
+ export * from './Payload.ts';
2
+ export { QueryPayloadPlugin as default, QueryPayloadPlugin } from './Plugin.ts';
3
+ export * from './Schema.ts';
4
+ export * from './Template.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,44 @@
1
+ // src/Payload.ts
2
+ import {
3
+ zodAsFactory,
4
+ zodIsFactory,
5
+ zodToFactory
6
+ } from "@xylabs/sdk";
7
+ import { PayloadZodOfSchema, SchemaZod } from "../../payload-model/neutral/index.mjs";
8
+ import * as z from "zod/mini";
9
+
10
+ // src/Schema.ts
11
+ import { asSchema } from "../../payload-model/neutral/index.mjs";
12
+ var QuerySchema = asSchema("network.xyo.query", true);
13
+
14
+ // src/Payload.ts
15
+ var QueryPayloadZod = z.extend(PayloadZodOfSchema(QuerySchema), { query: SchemaZod });
16
+ var isQueryPayload = zodIsFactory(QueryPayloadZod);
17
+ var asQueryPayload = zodAsFactory(QueryPayloadZod, "asQueryPayload");
18
+ var toQueryPayload = zodToFactory(QueryPayloadZod, "toQueryPayload");
19
+
20
+ // src/Plugin.ts
21
+ import { createPayloadPlugin } from "../../payload-plugin/neutral/index.mjs";
22
+
23
+ // src/Template.ts
24
+ var queryPayloadTemplate = () => ({
25
+ query: "",
26
+ schema: QuerySchema
27
+ });
28
+
29
+ // src/Plugin.ts
30
+ var QueryPayloadPlugin = () => createPayloadPlugin({
31
+ schema: QuerySchema,
32
+ template: queryPayloadTemplate
33
+ });
34
+ export {
35
+ QueryPayloadPlugin,
36
+ QueryPayloadZod,
37
+ QuerySchema,
38
+ asQueryPayload,
39
+ QueryPayloadPlugin as default,
40
+ isQueryPayload,
41
+ queryPayloadTemplate,
42
+ toQueryPayload
43
+ };
44
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,5 @@
1
+ export declare class Debounce<TKey = string> {
2
+ private map;
3
+ one<T>(key: TKey, closure: () => Promise<T>, timeout?: number): Promise<T>;
4
+ }
5
+ //# sourceMappingURL=Debounce.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { SchemaResolution, SchemaResolutionSource } from '../../domain-payload-plugin/neutral/index.ts';
2
+ import type { FetchedPayload } from '../../huri/neutral/index.ts';
3
+ import type { SchemaPayload } from '../../schema-payload-plugin/neutral/index.ts';
4
+ import type { SchemaNameToValidatorMap } from './SchemaNameToValidatorMap.ts';
5
+ export interface SchemaCacheEntry extends FetchedPayload<SchemaPayload> {
6
+ /** Provenance of the schema definition when resolved via the domain schema authority */
7
+ source?: SchemaResolutionSource;
8
+ }
9
+ export declare class SchemaCache<T extends SchemaNameToValidatorMap = SchemaNameToValidatorMap> {
10
+ /**
11
+ * Object representing `null` since LRU Cache types
12
+ * only allow for types that derive from object
13
+ */
14
+ protected static readonly NULL: SchemaCacheEntry;
15
+ private static _instance?;
16
+ private _cache;
17
+ private _resolutions;
18
+ private _validators;
19
+ private getDebounce;
20
+ onSchemaCached?: (name: string, entry: SchemaCacheEntry) => void;
21
+ proxy?: string;
22
+ private constructor();
23
+ static get instance(): SchemaCache<SchemaNameToValidatorMap>;
24
+ private cacheSchemaIfValid;
25
+ private cacheSchemas;
26
+ private fetchSchema;
27
+ /**
28
+ * A map of cached schema (by name) to payload validators for the schema. A schema
29
+ * must be cached via `get('schema.name')` before it's validator can be used as
30
+ * they are compiled dynamically at runtime upon retrieval.
31
+ */
32
+ get validators(): T;
33
+ get(schema?: string): Promise<SchemaCacheEntry | undefined | null>;
34
+ /**
35
+ * Resolve a schema name to its domain-published authoritative definition (SPEC.md in
36
+ * @xyo-network/domain-payload-plugin), with provenance and a richer status than get():
37
+ * 'resolved' | 'not-published' | 'unreachable'. Resolved definitions are cached and
38
+ * their validators compiled, exactly as with get(). 'unreachable' results are
39
+ * retryable: they are not cached as permanent negatives.
40
+ */
41
+ resolve(schema?: string): Promise<SchemaResolution | undefined>;
42
+ }
43
+ //# sourceMappingURL=SchemaCache.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { Payload } from '../../payload-model/neutral/index.ts';
2
+ /**
3
+ * Used in conjunction with schema validation to support compile time type assertion
4
+ * for known schema types.
5
+ */
6
+ export type NarrowPayload<T extends Payload = Payload> = ((x: Payload) => x is T) | undefined;
7
+ /**
8
+ * Used to map known schemas (byt their string name) to the validators which assert their types
9
+ */
10
+ export interface SchemaNameToValidatorMap {
11
+ }
12
+ //# sourceMappingURL=SchemaNameToValidatorMap.d.ts.map
@@ -0,0 +1,13 @@
1
+ export interface TtlLruCacheOpts {
2
+ max: number;
3
+ ttl: number;
4
+ }
5
+ export declare class TtlLruCache<K, V> {
6
+ private readonly map;
7
+ private readonly max;
8
+ private readonly ttl;
9
+ constructor(opts: TtlLruCacheOpts);
10
+ get(key: K): V | undefined;
11
+ set(key: K, value: V): void;
12
+ }
13
+ //# sourceMappingURL=TtlLruCache.d.ts.map
@@ -0,0 +1,5 @@
1
+ export * from './Debounce.ts';
2
+ export * from './SchemaCache.ts';
3
+ export * from './SchemaNameToValidatorMap.ts';
4
+ export * from './TtlLruCache.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,178 @@
1
+ // src/Debounce.ts
2
+ import { delay, isDefined } from "@xylabs/sdk";
3
+ var Debounce = class {
4
+ map = /* @__PURE__ */ new Map();
5
+ async one(key, closure, timeout = 1e4) {
6
+ const startTime = Date.now();
7
+ while (isDefined(this.map.get(key))) {
8
+ await delay(100);
9
+ if (Date.now() - startTime > timeout) {
10
+ throw new Error(`Debounce timed out [${String(key)}]`);
11
+ }
12
+ }
13
+ try {
14
+ this.map.set(key, 1);
15
+ return await closure();
16
+ } finally {
17
+ this.map.delete(key);
18
+ }
19
+ }
20
+ };
21
+
22
+ // src/SchemaCache.ts
23
+ import {
24
+ FetchClientError,
25
+ handleError,
26
+ isDefined as isDefined2,
27
+ isString
28
+ } from "@xylabs/sdk";
29
+ import { DomainPayloadWrapper, DomainSchemaResolver } from "../../domain-payload-plugin/neutral/index.mjs";
30
+ import { SchemaSchema } from "../../schema-payload-plugin/neutral/index.mjs";
31
+ import { Ajv } from "ajv";
32
+
33
+ // src/TtlLruCache.ts
34
+ var TtlLruCache = class {
35
+ map = /* @__PURE__ */ new Map();
36
+ max;
37
+ ttl;
38
+ constructor(opts) {
39
+ this.max = opts.max;
40
+ this.ttl = opts.ttl;
41
+ }
42
+ get(key) {
43
+ const entry = this.map.get(key);
44
+ if (entry === void 0) return void 0;
45
+ if (entry.expires <= Date.now()) {
46
+ this.map.delete(key);
47
+ return void 0;
48
+ }
49
+ this.map.delete(key);
50
+ this.map.set(key, entry);
51
+ return entry.value;
52
+ }
53
+ set(key, value) {
54
+ if (this.map.has(key)) this.map.delete(key);
55
+ this.map.set(key, { value, expires: Date.now() + this.ttl });
56
+ if (this.map.size > this.max) {
57
+ const oldest = this.map.keys().next().value;
58
+ if (oldest !== void 0) this.map.delete(oldest);
59
+ }
60
+ }
61
+ };
62
+
63
+ // src/SchemaCache.ts
64
+ var getSchemaNameFromSchema = (schema) => {
65
+ if (isString(schema.$id)) {
66
+ return schema.$id;
67
+ }
68
+ };
69
+ var SchemaCache = class _SchemaCache {
70
+ /**
71
+ * Object representing `null` since LRU Cache types
72
+ * only allow for types that derive from object
73
+ */
74
+ static NULL = { payload: { definition: {}, schema: SchemaSchema } };
75
+ static _instance;
76
+ _cache = new TtlLruCache({ max: 500, ttl: 1e3 * 60 * 5 });
77
+ _resolutions = new TtlLruCache({ max: 500, ttl: 1e3 * 60 * 5 });
78
+ _validators = {};
79
+ // prevents double discovery
80
+ getDebounce = new Debounce();
81
+ onSchemaCached;
82
+ proxy;
83
+ constructor(proxy) {
84
+ this.proxy = proxy;
85
+ }
86
+ static get instance() {
87
+ this._instance ??= new _SchemaCache();
88
+ return this._instance;
89
+ }
90
+ cacheSchemaIfValid(entry) {
91
+ if (!isDefined2(entry?.payload?.definition)) {
92
+ return;
93
+ }
94
+ const ajv = new Ajv({ strict: false });
95
+ const validator = ajv.compile(entry.payload.definition);
96
+ const schemaName = getSchemaNameFromSchema(entry.payload.definition);
97
+ if (isString(schemaName)) {
98
+ this._cache.set(schemaName, entry);
99
+ const key = schemaName;
100
+ this._validators[key] = validator;
101
+ this.onSchemaCached?.(schemaName, entry);
102
+ }
103
+ }
104
+ cacheSchemas(aliasEntries) {
105
+ for (const entry of aliasEntries?.filter((entry2) => entry2.payload.schema === SchemaSchema) ?? []) {
106
+ this.cacheSchemaIfValid(entry);
107
+ }
108
+ }
109
+ async fetchSchema(schema) {
110
+ try {
111
+ const resolution = await this.resolve(schema);
112
+ if (resolution?.status === "resolved") {
113
+ return;
114
+ }
115
+ const domain = await DomainPayloadWrapper.discover(schema, this.proxy);
116
+ await domain?.fetch();
117
+ this.cacheSchemas(domain?.aliases);
118
+ if (this._cache.get(schema) === void 0 && resolution?.status !== "unreachable") {
119
+ this._cache.set(schema, _SchemaCache.NULL);
120
+ }
121
+ } catch (error) {
122
+ if (error instanceof FetchClientError) {
123
+ console.log(`Fetch Url: ${error.config.url}`);
124
+ }
125
+ handleError(error, (error2) => {
126
+ console.error(`fetchSchema threw: ${error2.message}`);
127
+ });
128
+ }
129
+ }
130
+ /**
131
+ * A map of cached schema (by name) to payload validators for the schema. A schema
132
+ * must be cached via `get('schema.name')` before it's validator can be used as
133
+ * they are compiled dynamically at runtime upon retrieval.
134
+ */
135
+ get validators() {
136
+ return this._validators;
137
+ }
138
+ async get(schema) {
139
+ if (isString(schema)) {
140
+ await this.getDebounce.one(schema, async () => {
141
+ if (this._cache.get(schema) === void 0) {
142
+ await this.fetchSchema(schema);
143
+ }
144
+ });
145
+ const value = this._cache.get(schema);
146
+ return value === _SchemaCache.NULL ? null : value;
147
+ }
148
+ return void 0;
149
+ }
150
+ /**
151
+ * Resolve a schema name to its domain-published authoritative definition (SPEC.md in
152
+ * @xyo-network/domain-payload-plugin), with provenance and a richer status than get():
153
+ * 'resolved' | 'not-published' | 'unreachable'. Resolved definitions are cached and
154
+ * their validators compiled, exactly as with get(). 'unreachable' results are
155
+ * retryable: they are not cached as permanent negatives.
156
+ */
157
+ async resolve(schema) {
158
+ if (!isString(schema)) return void 0;
159
+ await this.getDebounce.one(`resolve:${schema}`, async () => {
160
+ const existing = this._resolutions.get(schema);
161
+ if (existing === void 0 || existing.status === "unreachable") {
162
+ const resolver = new DomainSchemaResolver();
163
+ const resolution = await resolver.resolve(schema, { proxy: this.proxy });
164
+ this._resolutions.set(schema, resolution);
165
+ if (resolution.status === "resolved" && isDefined2(resolution.payload)) {
166
+ this.cacheSchemaIfValid({ payload: resolution.payload, source: resolution.source });
167
+ }
168
+ }
169
+ });
170
+ return this._resolutions.get(schema);
171
+ }
172
+ };
173
+ export {
174
+ Debounce,
175
+ SchemaCache,
176
+ TtlLruCache
177
+ };
178
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Validates a XYO schema name's structure
3
+ */
4
+ export declare class SchemaNameValidator {
5
+ private _parts?;
6
+ private _rootDomain?;
7
+ private _schema?;
8
+ constructor(schema?: string);
9
+ /**
10
+ * Checks whether the schema is all lowercase
11
+ *
12
+ * @returns boolean
13
+ */
14
+ get isLowercase(): boolean;
15
+ /**
16
+ * Levels in the schema
17
+ *
18
+ * @returns number
19
+ */
20
+ get levels(): number | undefined;
21
+ /**
22
+ * The schema converted into a string array split on '.'
23
+ *
24
+ * @returns string[]
25
+ */
26
+ get parts(): string[] | undefined;
27
+ /**
28
+ * The rootDomain is the first two levels of the schema, in reverse order
29
+ * This can be used to determine who 'owns' that schema, based on domain
30
+ * registration
31
+ *
32
+ * @returns string
33
+ */
34
+ get rootDomain(): string | undefined;
35
+ get schema(): string | undefined;
36
+ set schema(schema: string | undefined);
37
+ /**
38
+ * Run all static validations
39
+ * @returns Error[]
40
+ */
41
+ all(): Error[];
42
+ }
43
+ //# sourceMappingURL=SchemaNameValidator.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './SchemaNameValidator.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,69 @@
1
+ // src/SchemaNameValidator.ts
2
+ var SchemaNameValidator = class {
3
+ _parts;
4
+ _rootDomain;
5
+ _schema;
6
+ constructor(schema) {
7
+ this._schema = schema;
8
+ }
9
+ /**
10
+ * Checks whether the schema is all lowercase
11
+ *
12
+ * @returns boolean
13
+ */
14
+ get isLowercase() {
15
+ return this.schema === this.schema?.toLowerCase();
16
+ }
17
+ /**
18
+ * Levels in the schema
19
+ *
20
+ * @returns number
21
+ */
22
+ get levels() {
23
+ return this.parts?.length;
24
+ }
25
+ /**
26
+ * The schema converted into a string array split on '.'
27
+ *
28
+ * @returns string[]
29
+ */
30
+ get parts() {
31
+ this._parts = this._parts ?? this.schema?.split(".");
32
+ return this._parts;
33
+ }
34
+ /**
35
+ * The rootDomain is the first two levels of the schema, in reverse order
36
+ * This can be used to determine who 'owns' that schema, based on domain
37
+ * registration
38
+ *
39
+ * @returns string
40
+ */
41
+ get rootDomain() {
42
+ this._rootDomain = this._rootDomain ?? domainLevel(this, 1);
43
+ return this._rootDomain;
44
+ }
45
+ get schema() {
46
+ return this._schema;
47
+ }
48
+ set schema(schema) {
49
+ this._schema = schema;
50
+ }
51
+ /**
52
+ * Run all static validations
53
+ * @returns Error[]
54
+ */
55
+ all() {
56
+ const errors = [];
57
+ if ((this.schema?.length ?? 0) === 0) errors.push(new Error("schema missing"));
58
+ else if ((this.levels ?? 0) < 3) errors.push(new Error(`schema levels < 3 [${this.levels}, ${this.schema}]`));
59
+ else if (!this.isLowercase) errors.push(new Error(`schema not lowercase [${this.schema}]`));
60
+ return errors;
61
+ }
62
+ };
63
+ function domainLevel(validator, level) {
64
+ return validator.parts?.slice(0, level + 1).toReversed().join(".");
65
+ }
66
+ export {
67
+ SchemaNameValidator
68
+ };
69
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,96 @@
1
+ import * as z from 'zod/mini';
2
+ export declare const SchemaPayloadZod: z.ZodMiniObject<{
3
+ schema: z.ZodMiniLiteral<"network.xyo.schema" & {
4
+ readonly __schema: true;
5
+ }>;
6
+ definition: z.ZodMiniObject<{
7
+ $id: z.ZodMiniOptional<z.ZodMiniString<string>>;
8
+ }, z.core.$loose>;
9
+ extends: z.ZodMiniOptional<z.ZodMiniString<string>>;
10
+ name: z.ZodMiniOptional<z.ZodMiniString<string>>;
11
+ version: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
12
+ }, z.core.$strip>;
13
+ export type SchemaPayload = z.infer<typeof SchemaPayloadZod>;
14
+ /**
15
+ * Identity function for determining if an object is a Schema
16
+ */
17
+ export declare const isSchemaPayload: <T>(value: T) => value is T & {
18
+ schema: "network.xyo.schema" & {
19
+ readonly __schema: true;
20
+ };
21
+ definition: {
22
+ [x: string]: unknown;
23
+ $id?: string | undefined;
24
+ };
25
+ extends?: string | undefined;
26
+ name?: string | undefined;
27
+ version?: number | undefined;
28
+ };
29
+ export declare const asSchemaPayload: {
30
+ <T>(value: T): (T & {
31
+ schema: "network.xyo.schema" & {
32
+ readonly __schema: true;
33
+ };
34
+ definition: {
35
+ [x: string]: unknown;
36
+ $id?: string | undefined;
37
+ };
38
+ extends?: string | undefined;
39
+ name?: string | undefined;
40
+ version?: number | undefined;
41
+ }) | undefined;
42
+ <T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
43
+ schema: "network.xyo.schema" & {
44
+ readonly __schema: true;
45
+ };
46
+ definition: {
47
+ [x: string]: unknown;
48
+ $id?: string | undefined;
49
+ };
50
+ extends?: string | undefined;
51
+ name?: string | undefined;
52
+ version?: number | undefined;
53
+ };
54
+ };
55
+ export declare const toSchemaPayload: {
56
+ <T>(value: T): (T & {
57
+ schema: "network.xyo.schema" & {
58
+ readonly __schema: true;
59
+ };
60
+ definition: {
61
+ [x: string]: unknown;
62
+ $id?: string | undefined;
63
+ };
64
+ extends?: string | undefined;
65
+ name?: string | undefined;
66
+ version?: number | undefined;
67
+ }) | undefined;
68
+ <T>(value: T, assert: import("@xylabs/sdk").ZodFactoryConfig): T & {
69
+ schema: "network.xyo.schema" & {
70
+ readonly __schema: true;
71
+ };
72
+ definition: {
73
+ [x: string]: unknown;
74
+ $id?: string | undefined;
75
+ };
76
+ extends?: string | undefined;
77
+ name?: string | undefined;
78
+ version?: number | undefined;
79
+ };
80
+ };
81
+ /**
82
+ * Identity function for determining if an object is a Schema with sources
83
+ */
84
+ export declare const isSchemaPayloadWithSources: (x?: unknown) => x is import("../../payload-model/neutral/index.ts").WithSources<{
85
+ schema: "network.xyo.schema" & {
86
+ readonly __schema: true;
87
+ };
88
+ definition: {
89
+ [x: string]: unknown;
90
+ $id?: string | undefined;
91
+ };
92
+ extends?: string | undefined;
93
+ name?: string | undefined;
94
+ version?: number | undefined;
95
+ }>;
96
+ //# sourceMappingURL=Payload.d.ts.map
@@ -0,0 +1,13 @@
1
+ export declare const SchemaPayloadPlugin: () => import("../../payload-plugin/neutral/index.ts").PayloadPlugin<{
2
+ schema: "network.xyo.schema" & {
3
+ readonly __schema: true;
4
+ };
5
+ definition: {
6
+ [x: string]: unknown;
7
+ $id?: string | undefined;
8
+ };
9
+ extends?: string | undefined;
10
+ name?: string | undefined;
11
+ version?: number | undefined;
12
+ }>;
13
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1,5 @@
1
+ export declare const SchemaSchema: "network.xyo.schema" & {
2
+ readonly __schema: true;
3
+ };
4
+ export type SchemaSchema = typeof SchemaSchema;
5
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { SchemaPayload } from './Payload.ts';
2
+ export declare const schemaPayloadTemplate: () => SchemaPayload;
3
+ //# sourceMappingURL=Template.d.ts.map
@@ -0,0 +1,5 @@
1
+ export * from './Payload.ts';
2
+ export { SchemaPayloadPlugin as default, SchemaPayloadPlugin } from './Plugin.ts';
3
+ export * from './Schema.ts';
4
+ export * from './Template.ts';
5
+ //# sourceMappingURL=index.d.ts.map