@atxp/client 0.10.4 → 0.10.6

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 (315) hide show
  1. package/dist/_virtual/index10.js +2 -2
  2. package/dist/_virtual/index11.js +2 -2
  3. package/dist/_virtual/index18.js +2 -2
  4. package/dist/_virtual/index19.js +2 -2
  5. package/dist/_virtual/index20.js +2 -2
  6. package/dist/_virtual/index4.js +2 -2
  7. package/dist/_virtual/index5.js +2 -2
  8. package/dist/_virtual/index8.js +2 -2
  9. package/dist/_virtual/index9.js +2 -2
  10. package/dist/atxpFetcher.d.ts.map +1 -1
  11. package/dist/atxpFetcher.js +16 -1
  12. package/dist/atxpFetcher.js.map +1 -1
  13. package/dist/index.cjs +23 -2
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +3 -1
  16. package/dist/index.js +23 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js +1 -1
  19. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js +1 -1
  20. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
  21. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
  22. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
  23. package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
  24. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
  25. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
  26. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
  27. package/dist/oAuth.d.ts +3 -1
  28. package/dist/oAuth.d.ts.map +1 -1
  29. package/dist/oAuth.js +7 -1
  30. package/dist/oAuth.js.map +1 -1
  31. package/package.json +2 -2
  32. package/dist/_virtual/cache.js +0 -4
  33. package/dist/_virtual/cache.js.map +0 -1
  34. package/dist/_virtual/uri.all.js +0 -4
  35. package/dist/_virtual/uri.all.js.map +0 -1
  36. package/dist/atxpAccount.d.ts +0 -20
  37. package/dist/atxpAccount.d.ts.map +0 -1
  38. package/dist/atxpAccount.js +0 -161
  39. package/dist/atxpAccount.js.map +0 -1
  40. package/dist/base.cjs +0 -34
  41. package/dist/base.cjs.map +0 -1
  42. package/dist/base.d.ts +0 -4
  43. package/dist/base.d.ts.map +0 -1
  44. package/dist/base.js +0 -5
  45. package/dist/base.js.map +0 -1
  46. package/dist/baseAccount.d.ts +0 -20
  47. package/dist/baseAccount.d.ts.map +0 -1
  48. package/dist/baseAccount.js +0 -47
  49. package/dist/baseAccount.js.map +0 -1
  50. package/dist/baseConstants.d.ts +0 -10
  51. package/dist/baseConstants.d.ts.map +0 -1
  52. package/dist/baseConstants.js +0 -21
  53. package/dist/baseConstants.js.map +0 -1
  54. package/dist/basePaymentMaker.d.ts +0 -23
  55. package/dist/basePaymentMaker.d.ts.map +0 -1
  56. package/dist/basePaymentMaker.js +0 -169
  57. package/dist/basePaymentMaker.js.map +0 -1
  58. package/dist/node_modules/ajv/dist/ajv.js +0 -71
  59. package/dist/node_modules/ajv/dist/ajv.js.map +0 -1
  60. package/dist/node_modules/ajv/dist/compile/codegen/code.js +0 -169
  61. package/dist/node_modules/ajv/dist/compile/codegen/code.js.map +0 -1
  62. package/dist/node_modules/ajv/dist/compile/codegen/index.js +0 -712
  63. package/dist/node_modules/ajv/dist/compile/codegen/index.js.map +0 -1
  64. package/dist/node_modules/ajv/dist/compile/codegen/scope.js +0 -157
  65. package/dist/node_modules/ajv/dist/compile/codegen/scope.js.map +0 -1
  66. package/dist/node_modules/ajv/dist/compile/errors.js +0 -139
  67. package/dist/node_modules/ajv/dist/compile/errors.js.map +0 -1
  68. package/dist/node_modules/ajv/dist/compile/index.js +0 -259
  69. package/dist/node_modules/ajv/dist/compile/index.js.map +0 -1
  70. package/dist/node_modules/ajv/dist/compile/names.js +0 -40
  71. package/dist/node_modules/ajv/dist/compile/names.js.map +0 -1
  72. package/dist/node_modules/ajv/dist/compile/ref_error.js +0 -24
  73. package/dist/node_modules/ajv/dist/compile/ref_error.js.map +0 -1
  74. package/dist/node_modules/ajv/dist/compile/resolve.js +0 -169
  75. package/dist/node_modules/ajv/dist/compile/resolve.js.map +0 -1
  76. package/dist/node_modules/ajv/dist/compile/rules.js +0 -37
  77. package/dist/node_modules/ajv/dist/compile/rules.js.map +0 -1
  78. package/dist/node_modules/ajv/dist/compile/util.js +0 -191
  79. package/dist/node_modules/ajv/dist/compile/util.js.map +0 -1
  80. package/dist/node_modules/ajv/dist/compile/validate/applicability.js +0 -30
  81. package/dist/node_modules/ajv/dist/compile/validate/applicability.js.map +0 -1
  82. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -64
  83. package/dist/node_modules/ajv/dist/compile/validate/boolSchema.js.map +0 -1
  84. package/dist/node_modules/ajv/dist/compile/validate/dataType.js +0 -219
  85. package/dist/node_modules/ajv/dist/compile/validate/dataType.js.map +0 -1
  86. package/dist/node_modules/ajv/dist/compile/validate/defaults.js +0 -48
  87. package/dist/node_modules/ajv/dist/compile/validate/defaults.js.map +0 -1
  88. package/dist/node_modules/ajv/dist/compile/validate/index.js +0 -541
  89. package/dist/node_modules/ajv/dist/compile/validate/index.js.map +0 -1
  90. package/dist/node_modules/ajv/dist/compile/validate/keyword.js +0 -139
  91. package/dist/node_modules/ajv/dist/compile/validate/keyword.js.map +0 -1
  92. package/dist/node_modules/ajv/dist/compile/validate/subschema.js +0 -94
  93. package/dist/node_modules/ajv/dist/compile/validate/subschema.js.map +0 -1
  94. package/dist/node_modules/ajv/dist/core.js +0 -642
  95. package/dist/node_modules/ajv/dist/core.js.map +0 -1
  96. package/dist/node_modules/ajv/dist/refs/data.json.js +0 -31
  97. package/dist/node_modules/ajv/dist/refs/data.json.js.map +0 -1
  98. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js +0 -254
  99. package/dist/node_modules/ajv/dist/refs/json-schema-draft-07.json.js.map +0 -1
  100. package/dist/node_modules/ajv/dist/runtime/equal.js +0 -19
  101. package/dist/node_modules/ajv/dist/runtime/equal.js.map +0 -1
  102. package/dist/node_modules/ajv/dist/runtime/ucs2length.js +0 -35
  103. package/dist/node_modules/ajv/dist/runtime/ucs2length.js.map +0 -1
  104. package/dist/node_modules/ajv/dist/runtime/uri.js +0 -18
  105. package/dist/node_modules/ajv/dist/runtime/uri.js.map +0 -1
  106. package/dist/node_modules/ajv/dist/runtime/validation_error.js +0 -22
  107. package/dist/node_modules/ajv/dist/runtime/validation_error.js.map +0 -1
  108. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -62
  109. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +0 -1
  110. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -121
  111. package/dist/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +0 -1
  112. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -35
  113. package/dist/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +0 -1
  114. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -24
  115. package/dist/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +0 -1
  116. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -108
  117. package/dist/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +0 -1
  118. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -101
  119. package/dist/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +0 -1
  120. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -79
  121. package/dist/node_modules/ajv/dist/vocabularies/applicator/if.js.map +0 -1
  122. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -71
  123. package/dist/node_modules/ajv/dist/vocabularies/applicator/index.js.map +0 -1
  124. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -66
  125. package/dist/node_modules/ajv/dist/vocabularies/applicator/items.js.map +0 -1
  126. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -45
  127. package/dist/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +0 -1
  128. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -38
  129. package/dist/node_modules/ajv/dist/vocabularies/applicator/not.js.map +0 -1
  130. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -73
  131. package/dist/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +0 -1
  132. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -89
  133. package/dist/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +0 -1
  134. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -24
  135. package/dist/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +0 -1
  136. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -69
  137. package/dist/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +0 -1
  138. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -51
  139. package/dist/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +0 -1
  140. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -25
  141. package/dist/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +0 -1
  142. package/dist/node_modules/ajv/dist/vocabularies/code.js +0 -145
  143. package/dist/node_modules/ajv/dist/vocabularies/code.js.map +0 -1
  144. package/dist/node_modules/ajv/dist/vocabularies/core/id.js +0 -21
  145. package/dist/node_modules/ajv/dist/vocabularies/core/id.js.map +0 -1
  146. package/dist/node_modules/ajv/dist/vocabularies/core/index.js +0 -29
  147. package/dist/node_modules/ajv/dist/vocabularies/core/index.js.map +0 -1
  148. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js +0 -139
  149. package/dist/node_modules/ajv/dist/vocabularies/core/ref.js.map +0 -1
  150. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -120
  151. package/dist/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +0 -1
  152. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -20
  153. package/dist/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +0 -1
  154. package/dist/node_modules/ajv/dist/vocabularies/draft7.js +0 -33
  155. package/dist/node_modules/ajv/dist/vocabularies/draft7.js.map +0 -1
  156. package/dist/node_modules/ajv/dist/vocabularies/format/format.js +0 -104
  157. package/dist/node_modules/ajv/dist/vocabularies/format/format.js.map +0 -1
  158. package/dist/node_modules/ajv/dist/vocabularies/format/index.js +0 -18
  159. package/dist/node_modules/ajv/dist/vocabularies/format/index.js.map +0 -1
  160. package/dist/node_modules/ajv/dist/vocabularies/metadata.js +0 -29
  161. package/dist/node_modules/ajv/dist/vocabularies/metadata.js.map +0 -1
  162. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js +0 -39
  163. package/dist/node_modules/ajv/dist/vocabularies/validation/const.js.map +0 -1
  164. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -62
  165. package/dist/node_modules/ajv/dist/vocabularies/validation/enum.js.map +0 -1
  166. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js +0 -54
  167. package/dist/node_modules/ajv/dist/vocabularies/validation/index.js.map +0 -1
  168. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -36
  169. package/dist/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +0 -1
  170. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -41
  171. package/dist/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +0 -1
  172. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -39
  173. package/dist/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +0 -1
  174. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -36
  175. package/dist/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +0 -1
  176. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -38
  177. package/dist/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +0 -1
  178. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -37
  179. package/dist/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +0 -1
  180. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js +0 -93
  181. package/dist/node_modules/ajv/dist/vocabularies/validation/required.js.map +0 -1
  182. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -79
  183. package/dist/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +0 -1
  184. package/dist/node_modules/ajv/lib/ajv.js +0 -531
  185. package/dist/node_modules/ajv/lib/ajv.js.map +0 -1
  186. package/dist/node_modules/ajv/lib/cache.js +0 -37
  187. package/dist/node_modules/ajv/lib/cache.js.map +0 -1
  188. package/dist/node_modules/ajv/lib/compile/async.js +0 -102
  189. package/dist/node_modules/ajv/lib/compile/async.js.map +0 -1
  190. package/dist/node_modules/ajv/lib/compile/error_classes.js +0 -46
  191. package/dist/node_modules/ajv/lib/compile/error_classes.js.map +0 -1
  192. package/dist/node_modules/ajv/lib/compile/formats.js +0 -154
  193. package/dist/node_modules/ajv/lib/compile/formats.js.map +0 -1
  194. package/dist/node_modules/ajv/lib/compile/index.js +0 -404
  195. package/dist/node_modules/ajv/lib/compile/index.js.map +0 -1
  196. package/dist/node_modules/ajv/lib/compile/resolve.js +0 -286
  197. package/dist/node_modules/ajv/lib/compile/resolve.js.map +0 -1
  198. package/dist/node_modules/ajv/lib/compile/rules.js +0 -79
  199. package/dist/node_modules/ajv/lib/compile/rules.js.map +0 -1
  200. package/dist/node_modules/ajv/lib/compile/schema_obj.js +0 -21
  201. package/dist/node_modules/ajv/lib/compile/schema_obj.js.map +0 -1
  202. package/dist/node_modules/ajv/lib/compile/ucs2length.js +0 -30
  203. package/dist/node_modules/ajv/lib/compile/ucs2length.js.map +0 -1
  204. package/dist/node_modules/ajv/lib/compile/util.js +0 -252
  205. package/dist/node_modules/ajv/lib/compile/util.js.map +0 -1
  206. package/dist/node_modules/ajv/lib/data.js +0 -59
  207. package/dist/node_modules/ajv/lib/data.js.map +0 -1
  208. package/dist/node_modules/ajv/lib/definition_schema.js +0 -49
  209. package/dist/node_modules/ajv/lib/definition_schema.js.map +0 -1
  210. package/dist/node_modules/ajv/lib/dotjs/_limit.js +0 -173
  211. package/dist/node_modules/ajv/lib/dotjs/_limit.js.map +0 -1
  212. package/dist/node_modules/ajv/lib/dotjs/_limitItems.js +0 -90
  213. package/dist/node_modules/ajv/lib/dotjs/_limitItems.js.map +0 -1
  214. package/dist/node_modules/ajv/lib/dotjs/_limitLength.js +0 -95
  215. package/dist/node_modules/ajv/lib/dotjs/_limitLength.js.map +0 -1
  216. package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -90
  217. package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js.map +0 -1
  218. package/dist/node_modules/ajv/lib/dotjs/allOf.js +0 -52
  219. package/dist/node_modules/ajv/lib/dotjs/allOf.js.map +0 -1
  220. package/dist/node_modules/ajv/lib/dotjs/anyOf.js +0 -83
  221. package/dist/node_modules/ajv/lib/dotjs/anyOf.js.map +0 -1
  222. package/dist/node_modules/ajv/lib/dotjs/comment.js +0 -24
  223. package/dist/node_modules/ajv/lib/dotjs/comment.js.map +0 -1
  224. package/dist/node_modules/ajv/lib/dotjs/const.js +0 -62
  225. package/dist/node_modules/ajv/lib/dotjs/const.js.map +0 -1
  226. package/dist/node_modules/ajv/lib/dotjs/contains.js +0 -91
  227. package/dist/node_modules/ajv/lib/dotjs/contains.js.map +0 -1
  228. package/dist/node_modules/ajv/lib/dotjs/custom.js +0 -238
  229. package/dist/node_modules/ajv/lib/dotjs/custom.js.map +0 -1
  230. package/dist/node_modules/ajv/lib/dotjs/dependencies.js +0 -178
  231. package/dist/node_modules/ajv/lib/dotjs/dependencies.js.map +0 -1
  232. package/dist/node_modules/ajv/lib/dotjs/enum.js +0 -72
  233. package/dist/node_modules/ajv/lib/dotjs/enum.js.map +0 -1
  234. package/dist/node_modules/ajv/lib/dotjs/format.js +0 -160
  235. package/dist/node_modules/ajv/lib/dotjs/format.js.map +0 -1
  236. package/dist/node_modules/ajv/lib/dotjs/if.js +0 -113
  237. package/dist/node_modules/ajv/lib/dotjs/if.js.map +0 -1
  238. package/dist/node_modules/ajv/lib/dotjs/index.js +0 -68
  239. package/dist/node_modules/ajv/lib/dotjs/index.js.map +0 -1
  240. package/dist/node_modules/ajv/lib/dotjs/items.js +0 -150
  241. package/dist/node_modules/ajv/lib/dotjs/items.js.map +0 -1
  242. package/dist/node_modules/ajv/lib/dotjs/multipleOf.js +0 -90
  243. package/dist/node_modules/ajv/lib/dotjs/multipleOf.js.map +0 -1
  244. package/dist/node_modules/ajv/lib/dotjs/not.js +0 -94
  245. package/dist/node_modules/ajv/lib/dotjs/not.js.map +0 -1
  246. package/dist/node_modules/ajv/lib/dotjs/oneOf.js +0 -83
  247. package/dist/node_modules/ajv/lib/dotjs/oneOf.js.map +0 -1
  248. package/dist/node_modules/ajv/lib/dotjs/pattern.js +0 -85
  249. package/dist/node_modules/ajv/lib/dotjs/pattern.js.map +0 -1
  250. package/dist/node_modules/ajv/lib/dotjs/properties.js +0 -345
  251. package/dist/node_modules/ajv/lib/dotjs/properties.js.map +0 -1
  252. package/dist/node_modules/ajv/lib/dotjs/propertyNames.js +0 -91
  253. package/dist/node_modules/ajv/lib/dotjs/propertyNames.js.map +0 -1
  254. package/dist/node_modules/ajv/lib/dotjs/ref.js +0 -134
  255. package/dist/node_modules/ajv/lib/dotjs/ref.js.map +0 -1
  256. package/dist/node_modules/ajv/lib/dotjs/required.js +0 -276
  257. package/dist/node_modules/ajv/lib/dotjs/required.js.map +0 -1
  258. package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -96
  259. package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js.map +0 -1
  260. package/dist/node_modules/ajv/lib/dotjs/validate.js +0 -492
  261. package/dist/node_modules/ajv/lib/dotjs/validate.js.map +0 -1
  262. package/dist/node_modules/ajv/lib/keyword.js +0 -159
  263. package/dist/node_modules/ajv/lib/keyword.js.map +0 -1
  264. package/dist/node_modules/ajv/lib/refs/data.json.js +0 -33
  265. package/dist/node_modules/ajv/lib/refs/data.json.js.map +0 -1
  266. package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json.js +0 -254
  267. package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json.js.map +0 -1
  268. package/dist/node_modules/fast-json-stable-stringify/index.js +0 -69
  269. package/dist/node_modules/fast-json-stable-stringify/index.js.map +0 -1
  270. package/dist/node_modules/json-schema-traverse/index.js +0 -104
  271. package/dist/node_modules/json-schema-traverse/index.js.map +0 -1
  272. package/dist/node_modules/uri-js/dist/es5/uri.all.js +0 -1418
  273. package/dist/node_modules/uri-js/dist/es5/uri.all.js.map +0 -1
  274. package/dist/node_modules/zod/v3/ZodError.js +0 -133
  275. package/dist/node_modules/zod/v3/ZodError.js.map +0 -1
  276. package/dist/node_modules/zod/v3/errors.js +0 -9
  277. package/dist/node_modules/zod/v3/errors.js.map +0 -1
  278. package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -9
  279. package/dist/node_modules/zod/v3/helpers/errorUtil.js.map +0 -1
  280. package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -112
  281. package/dist/node_modules/zod/v3/helpers/parseUtil.js.map +0 -1
  282. package/dist/node_modules/zod/v3/helpers/util.js +0 -136
  283. package/dist/node_modules/zod/v3/helpers/util.js.map +0 -1
  284. package/dist/node_modules/zod/v3/locales/en.js +0 -112
  285. package/dist/node_modules/zod/v3/locales/en.js.map +0 -1
  286. package/dist/node_modules/zod/v3/types.js +0 -3491
  287. package/dist/node_modules/zod/v3/types.js.map +0 -1
  288. package/dist/polygon.cjs +0 -39
  289. package/dist/polygon.cjs.map +0 -1
  290. package/dist/polygon.d.ts +0 -1
  291. package/dist/polygon.d.ts.map +0 -1
  292. package/dist/polygon.js +0 -2
  293. package/dist/polygon.js.map +0 -1
  294. package/dist/solana.cjs +0 -20
  295. package/dist/solana.cjs.map +0 -1
  296. package/dist/solana.d.ts +0 -2
  297. package/dist/solana.d.ts.map +0 -1
  298. package/dist/solana.js +0 -3
  299. package/dist/solana.js.map +0 -1
  300. package/dist/solanaAccount.d.ts +0 -13
  301. package/dist/solanaAccount.d.ts.map +0 -1
  302. package/dist/solanaAccount.js +0 -34
  303. package/dist/solanaAccount.js.map +0 -1
  304. package/dist/solanaPaymentMaker.d.ts +0 -25
  305. package/dist/solanaPaymentMaker.d.ts.map +0 -1
  306. package/dist/solanaPaymentMaker.js +0 -108
  307. package/dist/solanaPaymentMaker.js.map +0 -1
  308. package/dist/types.js +0 -152
  309. package/dist/types.js.map +0 -1
  310. package/dist/world.cjs +0 -39
  311. package/dist/world.cjs.map +0 -1
  312. package/dist/world.d.ts +0 -1
  313. package/dist/world.d.ts.map +0 -1
  314. package/dist/world.js +0 -2
  315. package/dist/world.js.map +0 -1
@@ -1,642 +0,0 @@
1
- import { __exports as core } from '../../../_virtual/core.js';
2
- import { __require as requireValidate } from './compile/validate/index.js';
3
- import { __require as requireCodegen } from './compile/codegen/index.js';
4
- import { __require as requireValidation_error } from './runtime/validation_error.js';
5
- import { __require as requireRef_error } from './compile/ref_error.js';
6
- import { __require as requireRules } from './compile/rules.js';
7
- import { __require as requireCompile } from './compile/index.js';
8
- import { __require as requireResolve } from './compile/resolve.js';
9
- import { __require as requireDataType } from './compile/validate/dataType.js';
10
- import { __require as requireUtil } from './compile/util.js';
11
- import require$$9 from './refs/data.json.js';
12
- import { __require as requireUri } from './runtime/uri.js';
13
-
14
- var hasRequiredCore;
15
-
16
- function requireCore () {
17
- if (hasRequiredCore) return core;
18
- hasRequiredCore = 1;
19
- (function (exports$1) {
20
- Object.defineProperty(exports$1, "__esModule", { value: true });
21
- exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = void 0;
22
- var validate_1 = requireValidate();
23
- Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
24
- var codegen_1 = requireCodegen();
25
- Object.defineProperty(exports$1, "_", { enumerable: true, get: function () { return codegen_1._; } });
26
- Object.defineProperty(exports$1, "str", { enumerable: true, get: function () { return codegen_1.str; } });
27
- Object.defineProperty(exports$1, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
28
- Object.defineProperty(exports$1, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
29
- Object.defineProperty(exports$1, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
30
- Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
31
- const validation_error_1 = requireValidation_error();
32
- const ref_error_1 = requireRef_error();
33
- const rules_1 = requireRules();
34
- const compile_1 = requireCompile();
35
- const codegen_2 = requireCodegen();
36
- const resolve_1 = requireResolve();
37
- const dataType_1 = requireDataType();
38
- const util_1 = requireUtil();
39
- const $dataRefSchema = require$$9;
40
- const uri_1 = requireUri();
41
- const defaultRegExp = (str, flags) => new RegExp(str, flags);
42
- defaultRegExp.code = "new RegExp";
43
- const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
44
- const EXT_SCOPE_NAMES = new Set([
45
- "validate",
46
- "serialize",
47
- "parse",
48
- "wrapper",
49
- "root",
50
- "schema",
51
- "keyword",
52
- "pattern",
53
- "formats",
54
- "validate$data",
55
- "func",
56
- "obj",
57
- "Error",
58
- ]);
59
- const removedOptions = {
60
- errorDataPath: "",
61
- format: "`validateFormats: false` can be used instead.",
62
- nullable: '"nullable" keyword is supported by default.',
63
- jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
64
- extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
65
- missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
66
- processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
67
- sourceCode: "Use option `code: {source: true}`",
68
- strictDefaults: "It is default now, see option `strict`.",
69
- strictKeywords: "It is default now, see option `strict`.",
70
- uniqueItems: '"uniqueItems" keyword is always validated.',
71
- unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
72
- cache: "Map is used as cache, schema object as key.",
73
- serialize: "Map is used as cache, schema object as key.",
74
- ajvErrors: "It is default now.",
75
- };
76
- const deprecatedOptions = {
77
- ignoreKeywordsWithRef: "",
78
- jsPropertySyntax: "",
79
- unicode: '"minLength"/"maxLength" account for unicode characters by default.',
80
- };
81
- const MAX_EXPRESSION = 200;
82
- // eslint-disable-next-line complexity
83
- function requiredOptions(o) {
84
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
85
- const s = o.strict;
86
- const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
87
- const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0;
88
- const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
89
- const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
90
- return {
91
- strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
92
- strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
93
- strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
94
- strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
95
- strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
96
- code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
97
- loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
98
- loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
99
- meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
100
- messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
101
- inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
102
- schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
103
- addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
104
- validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
105
- validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
106
- unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
107
- int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
108
- uriResolver: uriResolver,
109
- };
110
- }
111
- class Ajv {
112
- constructor(opts = {}) {
113
- this.schemas = {};
114
- this.refs = {};
115
- this.formats = {};
116
- this._compilations = new Set();
117
- this._loading = {};
118
- this._cache = new Map();
119
- opts = this.opts = { ...opts, ...requiredOptions(opts) };
120
- const { es5, lines } = this.opts.code;
121
- this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });
122
- this.logger = getLogger(opts.logger);
123
- const formatOpt = opts.validateFormats;
124
- opts.validateFormats = false;
125
- this.RULES = (0, rules_1.getRules)();
126
- checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED");
127
- checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn");
128
- this._metaOpts = getMetaSchemaOptions.call(this);
129
- if (opts.formats)
130
- addInitialFormats.call(this);
131
- this._addVocabularies();
132
- this._addDefaultMetaSchema();
133
- if (opts.keywords)
134
- addInitialKeywords.call(this, opts.keywords);
135
- if (typeof opts.meta == "object")
136
- this.addMetaSchema(opts.meta);
137
- addInitialSchemas.call(this);
138
- opts.validateFormats = formatOpt;
139
- }
140
- _addVocabularies() {
141
- this.addKeyword("$async");
142
- }
143
- _addDefaultMetaSchema() {
144
- const { $data, meta, schemaId } = this.opts;
145
- let _dataRefSchema = $dataRefSchema;
146
- if (schemaId === "id") {
147
- _dataRefSchema = { ...$dataRefSchema };
148
- _dataRefSchema.id = _dataRefSchema.$id;
149
- delete _dataRefSchema.$id;
150
- }
151
- if (meta && $data)
152
- this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
153
- }
154
- defaultMeta() {
155
- const { meta, schemaId } = this.opts;
156
- return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined);
157
- }
158
- validate(schemaKeyRef, // key, ref or schema object
159
- // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
160
- data // to be validated
161
- ) {
162
- let v;
163
- if (typeof schemaKeyRef == "string") {
164
- v = this.getSchema(schemaKeyRef);
165
- if (!v)
166
- throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
167
- }
168
- else {
169
- v = this.compile(schemaKeyRef);
170
- }
171
- const valid = v(data);
172
- if (!("$async" in v))
173
- this.errors = v.errors;
174
- return valid;
175
- }
176
- compile(schema, _meta) {
177
- const sch = this._addSchema(schema, _meta);
178
- return (sch.validate || this._compileSchemaEnv(sch));
179
- }
180
- compileAsync(schema, meta) {
181
- if (typeof this.opts.loadSchema != "function") {
182
- throw new Error("options.loadSchema should be a function");
183
- }
184
- const { loadSchema } = this.opts;
185
- return runCompileAsync.call(this, schema, meta);
186
- async function runCompileAsync(_schema, _meta) {
187
- await loadMetaSchema.call(this, _schema.$schema);
188
- const sch = this._addSchema(_schema, _meta);
189
- return sch.validate || _compileAsync.call(this, sch);
190
- }
191
- async function loadMetaSchema($ref) {
192
- if ($ref && !this.getSchema($ref)) {
193
- await runCompileAsync.call(this, { $ref }, true);
194
- }
195
- }
196
- async function _compileAsync(sch) {
197
- try {
198
- return this._compileSchemaEnv(sch);
199
- }
200
- catch (e) {
201
- if (!(e instanceof ref_error_1.default))
202
- throw e;
203
- checkLoaded.call(this, e);
204
- await loadMissingSchema.call(this, e.missingSchema);
205
- return _compileAsync.call(this, sch);
206
- }
207
- }
208
- function checkLoaded({ missingSchema: ref, missingRef }) {
209
- if (this.refs[ref]) {
210
- throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
211
- }
212
- }
213
- async function loadMissingSchema(ref) {
214
- const _schema = await _loadSchema.call(this, ref);
215
- if (!this.refs[ref])
216
- await loadMetaSchema.call(this, _schema.$schema);
217
- if (!this.refs[ref])
218
- this.addSchema(_schema, ref, meta);
219
- }
220
- async function _loadSchema(ref) {
221
- const p = this._loading[ref];
222
- if (p)
223
- return p;
224
- try {
225
- return await (this._loading[ref] = loadSchema(ref));
226
- }
227
- finally {
228
- delete this._loading[ref];
229
- }
230
- }
231
- }
232
- // Adds schema to the instance
233
- addSchema(schema, // If array is passed, `key` will be ignored
234
- key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
235
- _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
236
- _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.
237
- ) {
238
- if (Array.isArray(schema)) {
239
- for (const sch of schema)
240
- this.addSchema(sch, undefined, _meta, _validateSchema);
241
- return this;
242
- }
243
- let id;
244
- if (typeof schema === "object") {
245
- const { schemaId } = this.opts;
246
- id = schema[schemaId];
247
- if (id !== undefined && typeof id != "string") {
248
- throw new Error(`schema ${schemaId} must be string`);
249
- }
250
- }
251
- key = (0, resolve_1.normalizeId)(key || id);
252
- this._checkUnique(key);
253
- this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
254
- return this;
255
- }
256
- // Add schema that will be used to validate other schemas
257
- // options in META_IGNORE_OPTIONS are alway set to false
258
- addMetaSchema(schema, key, // schema key
259
- _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema
260
- ) {
261
- this.addSchema(schema, key, true, _validateSchema);
262
- return this;
263
- }
264
- // Validate schema against its meta-schema
265
- validateSchema(schema, throwOrLogError) {
266
- if (typeof schema == "boolean")
267
- return true;
268
- let $schema;
269
- $schema = schema.$schema;
270
- if ($schema !== undefined && typeof $schema != "string") {
271
- throw new Error("$schema must be a string");
272
- }
273
- $schema = $schema || this.opts.defaultMeta || this.defaultMeta();
274
- if (!$schema) {
275
- this.logger.warn("meta-schema not available");
276
- this.errors = null;
277
- return true;
278
- }
279
- const valid = this.validate($schema, schema);
280
- if (!valid && throwOrLogError) {
281
- const message = "schema is invalid: " + this.errorsText();
282
- if (this.opts.validateSchema === "log")
283
- this.logger.error(message);
284
- else
285
- throw new Error(message);
286
- }
287
- return valid;
288
- }
289
- // Get compiled schema by `key` or `ref`.
290
- // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
291
- getSchema(keyRef) {
292
- let sch;
293
- while (typeof (sch = getSchEnv.call(this, keyRef)) == "string")
294
- keyRef = sch;
295
- if (sch === undefined) {
296
- const { schemaId } = this.opts;
297
- const root = new compile_1.SchemaEnv({ schema: {}, schemaId });
298
- sch = compile_1.resolveSchema.call(this, root, keyRef);
299
- if (!sch)
300
- return;
301
- this.refs[keyRef] = sch;
302
- }
303
- return (sch.validate || this._compileSchemaEnv(sch));
304
- }
305
- // Remove cached schema(s).
306
- // If no parameter is passed all schemas but meta-schemas are removed.
307
- // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
308
- // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
309
- removeSchema(schemaKeyRef) {
310
- if (schemaKeyRef instanceof RegExp) {
311
- this._removeAllSchemas(this.schemas, schemaKeyRef);
312
- this._removeAllSchemas(this.refs, schemaKeyRef);
313
- return this;
314
- }
315
- switch (typeof schemaKeyRef) {
316
- case "undefined":
317
- this._removeAllSchemas(this.schemas);
318
- this._removeAllSchemas(this.refs);
319
- this._cache.clear();
320
- return this;
321
- case "string": {
322
- const sch = getSchEnv.call(this, schemaKeyRef);
323
- if (typeof sch == "object")
324
- this._cache.delete(sch.schema);
325
- delete this.schemas[schemaKeyRef];
326
- delete this.refs[schemaKeyRef];
327
- return this;
328
- }
329
- case "object": {
330
- const cacheKey = schemaKeyRef;
331
- this._cache.delete(cacheKey);
332
- let id = schemaKeyRef[this.opts.schemaId];
333
- if (id) {
334
- id = (0, resolve_1.normalizeId)(id);
335
- delete this.schemas[id];
336
- delete this.refs[id];
337
- }
338
- return this;
339
- }
340
- default:
341
- throw new Error("ajv.removeSchema: invalid parameter");
342
- }
343
- }
344
- // add "vocabulary" - a collection of keywords
345
- addVocabulary(definitions) {
346
- for (const def of definitions)
347
- this.addKeyword(def);
348
- return this;
349
- }
350
- addKeyword(kwdOrDef, def // deprecated
351
- ) {
352
- let keyword;
353
- if (typeof kwdOrDef == "string") {
354
- keyword = kwdOrDef;
355
- if (typeof def == "object") {
356
- this.logger.warn("these parameters are deprecated, see docs for addKeyword");
357
- def.keyword = keyword;
358
- }
359
- }
360
- else if (typeof kwdOrDef == "object" && def === undefined) {
361
- def = kwdOrDef;
362
- keyword = def.keyword;
363
- if (Array.isArray(keyword) && !keyword.length) {
364
- throw new Error("addKeywords: keyword must be string or non-empty array");
365
- }
366
- }
367
- else {
368
- throw new Error("invalid addKeywords parameters");
369
- }
370
- checkKeyword.call(this, keyword, def);
371
- if (!def) {
372
- (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));
373
- return this;
374
- }
375
- keywordMetaschema.call(this, def);
376
- const definition = {
377
- ...def,
378
- type: (0, dataType_1.getJSONTypes)(def.type),
379
- schemaType: (0, dataType_1.getJSONTypes)(def.schemaType),
380
- };
381
- (0, util_1.eachItem)(keyword, definition.type.length === 0
382
- ? (k) => addRule.call(this, k, definition)
383
- : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
384
- return this;
385
- }
386
- getKeyword(keyword) {
387
- const rule = this.RULES.all[keyword];
388
- return typeof rule == "object" ? rule.definition : !!rule;
389
- }
390
- // Remove keyword
391
- removeKeyword(keyword) {
392
- // TODO return type should be Ajv
393
- const { RULES } = this;
394
- delete RULES.keywords[keyword];
395
- delete RULES.all[keyword];
396
- for (const group of RULES.rules) {
397
- const i = group.rules.findIndex((rule) => rule.keyword === keyword);
398
- if (i >= 0)
399
- group.rules.splice(i, 1);
400
- }
401
- return this;
402
- }
403
- // Add format
404
- addFormat(name, format) {
405
- if (typeof format == "string")
406
- format = new RegExp(format);
407
- this.formats[name] = format;
408
- return this;
409
- }
410
- errorsText(errors = this.errors, // optional array of validation errors
411
- { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar`
412
- ) {
413
- if (!errors || errors.length === 0)
414
- return "No errors";
415
- return errors
416
- .map((e) => `${dataVar}${e.instancePath} ${e.message}`)
417
- .reduce((text, msg) => text + separator + msg);
418
- }
419
- $dataMetaSchema(metaSchema, keywordsJsonPointers) {
420
- const rules = this.RULES.all;
421
- metaSchema = JSON.parse(JSON.stringify(metaSchema));
422
- for (const jsonPointer of keywordsJsonPointers) {
423
- const segments = jsonPointer.split("/").slice(1); // first segment is an empty string
424
- let keywords = metaSchema;
425
- for (const seg of segments)
426
- keywords = keywords[seg];
427
- for (const key in rules) {
428
- const rule = rules[key];
429
- if (typeof rule != "object")
430
- continue;
431
- const { $data } = rule.definition;
432
- const schema = keywords[key];
433
- if ($data && schema)
434
- keywords[key] = schemaOrData(schema);
435
- }
436
- }
437
- return metaSchema;
438
- }
439
- _removeAllSchemas(schemas, regex) {
440
- for (const keyRef in schemas) {
441
- const sch = schemas[keyRef];
442
- if (!regex || regex.test(keyRef)) {
443
- if (typeof sch == "string") {
444
- delete schemas[keyRef];
445
- }
446
- else if (sch && !sch.meta) {
447
- this._cache.delete(sch.schema);
448
- delete schemas[keyRef];
449
- }
450
- }
451
- }
452
- }
453
- _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
454
- let id;
455
- const { schemaId } = this.opts;
456
- if (typeof schema == "object") {
457
- id = schema[schemaId];
458
- }
459
- else {
460
- if (this.opts.jtd)
461
- throw new Error("schema must be object");
462
- else if (typeof schema != "boolean")
463
- throw new Error("schema must be object or boolean");
464
- }
465
- let sch = this._cache.get(schema);
466
- if (sch !== undefined)
467
- return sch;
468
- baseId = (0, resolve_1.normalizeId)(id || baseId);
469
- const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
470
- sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });
471
- this._cache.set(sch.schema, sch);
472
- if (addSchema && !baseId.startsWith("#")) {
473
- // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)
474
- if (baseId)
475
- this._checkUnique(baseId);
476
- this.refs[baseId] = sch;
477
- }
478
- if (validateSchema)
479
- this.validateSchema(schema, true);
480
- return sch;
481
- }
482
- _checkUnique(id) {
483
- if (this.schemas[id] || this.refs[id]) {
484
- throw new Error(`schema with key or id "${id}" already exists`);
485
- }
486
- }
487
- _compileSchemaEnv(sch) {
488
- if (sch.meta)
489
- this._compileMetaSchema(sch);
490
- else
491
- compile_1.compileSchema.call(this, sch);
492
- /* istanbul ignore if */
493
- if (!sch.validate)
494
- throw new Error("ajv implementation error");
495
- return sch.validate;
496
- }
497
- _compileMetaSchema(sch) {
498
- const currentOpts = this.opts;
499
- this.opts = this._metaOpts;
500
- try {
501
- compile_1.compileSchema.call(this, sch);
502
- }
503
- finally {
504
- this.opts = currentOpts;
505
- }
506
- }
507
- }
508
- Ajv.ValidationError = validation_error_1.default;
509
- Ajv.MissingRefError = ref_error_1.default;
510
- exports$1.default = Ajv;
511
- function checkOptions(checkOpts, options, msg, log = "error") {
512
- for (const key in checkOpts) {
513
- const opt = key;
514
- if (opt in options)
515
- this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
516
- }
517
- }
518
- function getSchEnv(keyRef) {
519
- keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line
520
- return this.schemas[keyRef] || this.refs[keyRef];
521
- }
522
- function addInitialSchemas() {
523
- const optsSchemas = this.opts.schemas;
524
- if (!optsSchemas)
525
- return;
526
- if (Array.isArray(optsSchemas))
527
- this.addSchema(optsSchemas);
528
- else
529
- for (const key in optsSchemas)
530
- this.addSchema(optsSchemas[key], key);
531
- }
532
- function addInitialFormats() {
533
- for (const name in this.opts.formats) {
534
- const format = this.opts.formats[name];
535
- if (format)
536
- this.addFormat(name, format);
537
- }
538
- }
539
- function addInitialKeywords(defs) {
540
- if (Array.isArray(defs)) {
541
- this.addVocabulary(defs);
542
- return;
543
- }
544
- this.logger.warn("keywords option as map is deprecated, pass array");
545
- for (const keyword in defs) {
546
- const def = defs[keyword];
547
- if (!def.keyword)
548
- def.keyword = keyword;
549
- this.addKeyword(def);
550
- }
551
- }
552
- function getMetaSchemaOptions() {
553
- const metaOpts = { ...this.opts };
554
- for (const opt of META_IGNORE_OPTIONS)
555
- delete metaOpts[opt];
556
- return metaOpts;
557
- }
558
- const noLogs = { log() { }, warn() { }, error() { } };
559
- function getLogger(logger) {
560
- if (logger === false)
561
- return noLogs;
562
- if (logger === undefined)
563
- return console;
564
- if (logger.log && logger.warn && logger.error)
565
- return logger;
566
- throw new Error("logger must implement log, warn and error methods");
567
- }
568
- const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
569
- function checkKeyword(keyword, def) {
570
- const { RULES } = this;
571
- (0, util_1.eachItem)(keyword, (kwd) => {
572
- if (RULES.keywords[kwd])
573
- throw new Error(`Keyword ${kwd} is already defined`);
574
- if (!KEYWORD_NAME.test(kwd))
575
- throw new Error(`Keyword ${kwd} has invalid name`);
576
- });
577
- if (!def)
578
- return;
579
- if (def.$data && !("code" in def || "validate" in def)) {
580
- throw new Error('$data keyword must have "code" or "validate" function');
581
- }
582
- }
583
- function addRule(keyword, definition, dataType) {
584
- var _a;
585
- const post = definition === null || definition === void 0 ? void 0 : definition.post;
586
- if (dataType && post)
587
- throw new Error('keyword with "post" flag cannot have "type"');
588
- const { RULES } = this;
589
- let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
590
- if (!ruleGroup) {
591
- ruleGroup = { type: dataType, rules: [] };
592
- RULES.rules.push(ruleGroup);
593
- }
594
- RULES.keywords[keyword] = true;
595
- if (!definition)
596
- return;
597
- const rule = {
598
- keyword,
599
- definition: {
600
- ...definition,
601
- type: (0, dataType_1.getJSONTypes)(definition.type),
602
- schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType),
603
- },
604
- };
605
- if (definition.before)
606
- addBeforeRule.call(this, ruleGroup, rule, definition.before);
607
- else
608
- ruleGroup.rules.push(rule);
609
- RULES.all[keyword] = rule;
610
- (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
611
- }
612
- function addBeforeRule(ruleGroup, rule, before) {
613
- const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
614
- if (i >= 0) {
615
- ruleGroup.rules.splice(i, 0, rule);
616
- }
617
- else {
618
- ruleGroup.rules.push(rule);
619
- this.logger.warn(`rule ${before} is not defined`);
620
- }
621
- }
622
- function keywordMetaschema(def) {
623
- let { metaSchema } = def;
624
- if (metaSchema === undefined)
625
- return;
626
- if (def.$data && this.opts.$data)
627
- metaSchema = schemaOrData(metaSchema);
628
- def.validateSchema = this.compile(metaSchema, true);
629
- }
630
- const $dataRef = {
631
- $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
632
- };
633
- function schemaOrData(schema) {
634
- return { anyOf: [schema, $dataRef] };
635
- }
636
-
637
- } (core));
638
- return core;
639
- }
640
-
641
- export { requireCore as __require };
642
- //# sourceMappingURL=core.js.map