wapi-client 0.12.5-beta.6 → 0.13.0

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 (587) hide show
  1. package/dist/api/http-client.browser.cjs +520 -500
  2. package/dist/api/http-client.browser.js +520 -500
  3. package/dist/api/http-client.cjs +3 -4
  4. package/dist/api/http-client.js +1 -2
  5. package/dist/client-options.schema.zod.browser.cjs +14 -4008
  6. package/dist/client-options.schema.zod.browser.js +1 -3996
  7. package/dist/client-options.schema.zod.cjs +1 -1
  8. package/dist/client-options.schema.zod.d.ts +1 -1
  9. package/dist/client-options.schema.zod.js +1 -1
  10. package/dist/db/consts.browser.cjs +79 -4056
  11. package/dist/db/consts.browser.js +1 -3978
  12. package/dist/db/consts.cjs +79 -89
  13. package/dist/db/consts.d.ts +1 -1
  14. package/dist/db/consts.enums.d.ts +1 -1
  15. package/dist/db/consts.js +1 -1
  16. package/dist/db/token/token.enums.d.ts +1 -1
  17. package/dist/db/token/token.schema.zod.browser.cjs +10 -4004
  18. package/dist/db/token/token.schema.zod.browser.js +1 -3998
  19. package/dist/db/token/token.schema.zod.cjs +10 -20
  20. package/dist/db/token/token.schema.zod.d.ts +1 -1
  21. package/dist/db/token/token.schema.zod.js +1 -1
  22. package/dist/db/transfer/transfer.enums.d.ts +1 -1
  23. package/dist/db/transfer/transfer.schema.zod.browser.cjs +16 -4010
  24. package/dist/db/transfer/transfer.schema.zod.browser.js +1 -3998
  25. package/dist/db/transfer/transfer.schema.zod.cjs +16 -26
  26. package/dist/db/transfer/transfer.schema.zod.d.ts +1 -1
  27. package/dist/db/transfer/transfer.schema.zod.js +1 -1
  28. package/dist/db/transfer-group/transfer-group.enums.d.ts +1 -1
  29. package/dist/db/transfer-group/transfer-group.schema.zod.browser.cjs +10 -4004
  30. package/dist/db/transfer-group/transfer-group.schema.zod.browser.js +1 -3998
  31. package/dist/db/transfer-group/transfer-group.schema.zod.cjs +10 -20
  32. package/dist/db/transfer-group/transfer-group.schema.zod.d.ts +1 -1
  33. package/dist/db/transfer-group/transfer-group.schema.zod.js +1 -1
  34. package/dist/db/transfer-log/transfer-log.enums.d.ts +1 -1
  35. package/dist/db/transfer-log/transfer-log.schema.zod.browser.cjs +20 -4014
  36. package/dist/db/transfer-log/transfer-log.schema.zod.browser.js +1 -3998
  37. package/dist/db/transfer-log/transfer-log.schema.zod.cjs +20 -30
  38. package/dist/db/transfer-log/transfer-log.schema.zod.d.ts +1 -1
  39. package/dist/db/transfer-log/transfer-log.schema.zod.js +1 -1
  40. package/dist/db/wallet/wallet.enums.d.ts +1 -1
  41. package/dist/db/wallet/wallet.schema.zod.browser.cjs +11 -4005
  42. package/dist/db/wallet/wallet.schema.zod.browser.js +1 -3998
  43. package/dist/db/wallet/wallet.schema.zod.cjs +11 -21
  44. package/dist/db/wallet/wallet.schema.zod.d.ts +1 -1
  45. package/dist/db/wallet/wallet.schema.zod.js +1 -1
  46. package/dist/db/wallet-token-setting/wallet-token-setting.enums.d.ts +1 -1
  47. package/dist/db/wallet-token-setting/wallet-token-setting.schema.zod.browser.cjs +9 -4003
  48. package/dist/db/wallet-token-setting/wallet-token-setting.schema.zod.browser.js +1 -3998
  49. package/dist/db/wallet-token-setting/wallet-token-setting.schema.zod.cjs +9 -19
  50. package/dist/db/wallet-token-setting/wallet-token-setting.schema.zod.d.ts +1 -1
  51. package/dist/db/wallet-token-setting/wallet-token-setting.schema.zod.js +1 -1
  52. package/dist/db/wapi-setting/wapi-setting.enums.d.ts +1 -1
  53. package/dist/db/wapi-setting/wapi-setting.schema.zod.browser.cjs +7 -4001
  54. package/dist/db/wapi-setting/wapi-setting.schema.zod.browser.js +1 -3998
  55. package/dist/db/wapi-setting/wapi-setting.schema.zod.cjs +7 -17
  56. package/dist/db/wapi-setting/wapi-setting.schema.zod.d.ts +1 -1
  57. package/dist/db/wapi-setting/wapi-setting.schema.zod.js +1 -1
  58. package/dist/db/wapi-statistic/wapi-statistic.enums.d.ts +1 -1
  59. package/dist/db/wapi-statistic/wapi-statistic.schema.zod.browser.cjs +6 -4000
  60. package/dist/db/wapi-statistic/wapi-statistic.schema.zod.browser.js +1 -3998
  61. package/dist/db/wapi-statistic/wapi-statistic.schema.zod.cjs +6 -16
  62. package/dist/db/wapi-statistic/wapi-statistic.schema.zod.d.ts +1 -1
  63. package/dist/db/wapi-statistic/wapi-statistic.schema.zod.js +1 -1
  64. package/dist/fns/aggregate-transfers/aggregate-transfers.enums.d.ts +1 -1
  65. package/dist/fns/aggregate-transfers/aggregate-transfers.schema.zod.browser.cjs +2 -3996
  66. package/dist/fns/aggregate-transfers/aggregate-transfers.schema.zod.browser.js +1 -3996
  67. package/dist/fns/aggregate-transfers/aggregate-transfers.schema.zod.cjs +1 -1
  68. package/dist/fns/aggregate-transfers/aggregate-transfers.schema.zod.d.ts +1 -1
  69. package/dist/fns/aggregate-transfers/aggregate-transfers.schema.zod.js +1 -1
  70. package/dist/fns/consts.browser.cjs +8 -4002
  71. package/dist/fns/consts.browser.js +1 -3998
  72. package/dist/fns/consts.cjs +8 -18
  73. package/dist/fns/consts.d.ts +1 -1
  74. package/dist/fns/consts.enums.d.ts +1 -1
  75. package/dist/fns/consts.js +1 -1
  76. package/dist/fns/create-access-token/create-access-token.enums.d.ts +1 -1
  77. package/dist/fns/create-access-token/create-access-token.schema.zod.browser.cjs +4 -3998
  78. package/dist/fns/create-access-token/create-access-token.schema.zod.browser.js +1 -3996
  79. package/dist/fns/create-access-token/create-access-token.schema.zod.cjs +1 -1
  80. package/dist/fns/create-access-token/create-access-token.schema.zod.d.ts +1 -1
  81. package/dist/fns/create-access-token/create-access-token.schema.zod.js +1 -1
  82. package/dist/fns/create-contract/create-contract.enums.d.ts +1 -1
  83. package/dist/fns/create-contract/create-contract.schema.zod.browser.cjs +5 -3999
  84. package/dist/fns/create-contract/create-contract.schema.zod.browser.js +1 -3998
  85. package/dist/fns/create-contract/create-contract.schema.zod.cjs +1 -1
  86. package/dist/fns/create-contract/create-contract.schema.zod.d.ts +1 -1
  87. package/dist/fns/create-contract/create-contract.schema.zod.js +1 -1
  88. package/dist/fns/create-deposit/create-deposit.enums.d.ts +1 -1
  89. package/dist/fns/create-deposit/create-deposit.schema.zod.browser.cjs +4 -3998
  90. package/dist/fns/create-deposit/create-deposit.schema.zod.browser.js +1 -3996
  91. package/dist/fns/create-deposit/create-deposit.schema.zod.cjs +1 -1
  92. package/dist/fns/create-deposit/create-deposit.schema.zod.d.ts +1 -1
  93. package/dist/fns/create-deposit/create-deposit.schema.zod.js +1 -1
  94. package/dist/fns/create-exchange/create-exchange.enums.d.ts +1 -1
  95. package/dist/fns/create-exchange/create-exchange.schema.zod.browser.cjs +2 -3996
  96. package/dist/fns/create-exchange/create-exchange.schema.zod.browser.js +1 -3996
  97. package/dist/fns/create-exchange/create-exchange.schema.zod.cjs +1 -1
  98. package/dist/fns/create-exchange/create-exchange.schema.zod.d.ts +1 -1
  99. package/dist/fns/create-exchange/create-exchange.schema.zod.js +1 -1
  100. package/dist/fns/create-token/create-token.enums.d.ts +1 -1
  101. package/dist/fns/create-transfer/create-transfer.enums.d.ts +1 -1
  102. package/dist/fns/create-transfer/create-transfer.schema.zod.browser.cjs +8 -4002
  103. package/dist/fns/create-transfer/create-transfer.schema.zod.browser.js +1 -3996
  104. package/dist/fns/create-transfer/create-transfer.schema.zod.cjs +1 -1
  105. package/dist/fns/create-transfer/create-transfer.schema.zod.d.ts +1 -1
  106. package/dist/fns/create-transfer/create-transfer.schema.zod.js +1 -1
  107. package/dist/fns/create-transfer-group/create-transfer-group.enums.d.ts +1 -1
  108. package/dist/fns/create-transfer-group/create-transfer-group.schema.zod.browser.cjs +2 -3996
  109. package/dist/fns/create-transfer-group/create-transfer-group.schema.zod.browser.js +1 -3996
  110. package/dist/fns/create-transfer-group/create-transfer-group.schema.zod.cjs +1 -1
  111. package/dist/fns/create-transfer-group/create-transfer-group.schema.zod.d.ts +1 -1
  112. package/dist/fns/create-transfer-group/create-transfer-group.schema.zod.js +1 -1
  113. package/dist/fns/create-transfers/create-transfers.enums.d.ts +1 -1
  114. package/dist/fns/create-transfers/create-transfers.schema.zod.browser.cjs +2 -3996
  115. package/dist/fns/create-transfers/create-transfers.schema.zod.browser.js +1 -3996
  116. package/dist/fns/create-transfers/create-transfers.schema.zod.cjs +1 -1
  117. package/dist/fns/create-transfers/create-transfers.schema.zod.d.ts +1 -1
  118. package/dist/fns/create-transfers/create-transfers.schema.zod.js +1 -1
  119. package/dist/fns/create-wallet/create-wallet.enums.d.ts +1 -1
  120. package/dist/fns/create-withdrawal/create-withdrawal.enums.d.ts +1 -1
  121. package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.browser.cjs +3 -3997
  122. package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.browser.js +1 -3996
  123. package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.cjs +1 -1
  124. package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.d.ts +1 -1
  125. package/dist/fns/create-withdrawal/create-withdrawal.schema.zod.js +1 -1
  126. package/dist/fns/export-balance-history/export-balance-history.enums.d.ts +1 -1
  127. package/dist/fns/export-balance-history/export-balance-history.schema.zod.browser.cjs +2 -3996
  128. package/dist/fns/export-balance-history/export-balance-history.schema.zod.browser.js +1 -3996
  129. package/dist/fns/export-balance-history/export-balance-history.schema.zod.cjs +1 -1
  130. package/dist/fns/export-balance-history/export-balance-history.schema.zod.d.ts +1 -1
  131. package/dist/fns/export-balance-history/export-balance-history.schema.zod.js +1 -1
  132. package/dist/fns/export-tokens/export-tokens.enums.d.ts +1 -1
  133. package/dist/fns/export-transfer-groups/export-transfer-groups.enums.d.ts +1 -1
  134. package/dist/fns/export-transfers/export-transfers.enums.d.ts +1 -1
  135. package/dist/fns/export-wallets/export-wallets.enums.d.ts +1 -1
  136. package/dist/fns/find-balances/find-balances.enums.d.ts +1 -1
  137. package/dist/fns/find-balances/find-balances.schema.zod.browser.cjs +2 -3996
  138. package/dist/fns/find-balances/find-balances.schema.zod.browser.js +1 -3996
  139. package/dist/fns/find-balances/find-balances.schema.zod.cjs +1 -1
  140. package/dist/fns/find-balances/find-balances.schema.zod.d.ts +1 -1
  141. package/dist/fns/find-balances/find-balances.schema.zod.js +1 -1
  142. package/dist/fns/find-tokens/find-tokens.enums.d.ts +1 -1
  143. package/dist/fns/find-tokens/find-tokens.schema.zod.browser.cjs +2 -3996
  144. package/dist/fns/find-tokens/find-tokens.schema.zod.browser.js +1 -3996
  145. package/dist/fns/find-tokens/find-tokens.schema.zod.cjs +1 -1
  146. package/dist/fns/find-tokens/find-tokens.schema.zod.d.ts +1 -1
  147. package/dist/fns/find-tokens/find-tokens.schema.zod.js +1 -1
  148. package/dist/fns/find-transfer-groups/find-transfer-groups.enums.d.ts +1 -1
  149. package/dist/fns/find-transfer-groups/find-transfer-groups.schema.zod.browser.cjs +2 -3996
  150. package/dist/fns/find-transfer-groups/find-transfer-groups.schema.zod.browser.js +1 -3996
  151. package/dist/fns/find-transfer-groups/find-transfer-groups.schema.zod.cjs +1 -1
  152. package/dist/fns/find-transfer-groups/find-transfer-groups.schema.zod.d.ts +1 -1
  153. package/dist/fns/find-transfer-groups/find-transfer-groups.schema.zod.js +1 -1
  154. package/dist/fns/find-transfers/find-transfers.enums.d.ts +1 -1
  155. package/dist/fns/find-transfers/find-transfers.schema.zod.browser.cjs +5 -3982
  156. package/dist/fns/find-transfers/find-transfers.schema.zod.browser.js +1 -3976
  157. package/dist/fns/find-transfers/find-transfers.schema.zod.cjs +1 -1
  158. package/dist/fns/find-transfers/find-transfers.schema.zod.d.ts +1 -1
  159. package/dist/fns/find-transfers/find-transfers.schema.zod.js +1 -1
  160. package/dist/fns/find-wallets/find-wallets.enums.d.ts +1 -1
  161. package/dist/fns/find-wallets/find-wallets.schema.zod.browser.cjs +3 -3997
  162. package/dist/fns/find-wallets/find-wallets.schema.zod.browser.js +1 -3996
  163. package/dist/fns/find-wallets/find-wallets.schema.zod.cjs +1 -1
  164. package/dist/fns/find-wallets/find-wallets.schema.zod.d.ts +1 -1
  165. package/dist/fns/find-wallets/find-wallets.schema.zod.js +1 -1
  166. package/dist/fns/get-balance/get-balance.enums.d.ts +1 -1
  167. package/dist/fns/get-balance/get-balance.schema.zod.browser.cjs +2 -3996
  168. package/dist/fns/get-balance/get-balance.schema.zod.browser.js +1 -3996
  169. package/dist/fns/get-balance/get-balance.schema.zod.cjs +1 -1
  170. package/dist/fns/get-balance/get-balance.schema.zod.d.ts +1 -1
  171. package/dist/fns/get-balance/get-balance.schema.zod.js +1 -1
  172. package/dist/fns/get-balance-history/get-balance-history.enums.d.ts +1 -1
  173. package/dist/fns/get-balance-history/get-balance-history.schema.zod.browser.cjs +2 -3996
  174. package/dist/fns/get-balance-history/get-balance-history.schema.zod.browser.js +1 -3996
  175. package/dist/fns/get-balance-history/get-balance-history.schema.zod.cjs +1 -1
  176. package/dist/fns/get-balance-history/get-balance-history.schema.zod.d.ts +1 -1
  177. package/dist/fns/get-balance-history/get-balance-history.schema.zod.js +1 -1
  178. package/dist/fns/get-export/get-export.enums.d.ts +1 -1
  179. package/dist/fns/get-export/get-export.schema.zod.browser.cjs +3 -3997
  180. package/dist/fns/get-export/get-export.schema.zod.browser.js +1 -3996
  181. package/dist/fns/get-export/get-export.schema.zod.cjs +1 -1
  182. package/dist/fns/get-export/get-export.schema.zod.d.ts +1 -1
  183. package/dist/fns/get-export/get-export.schema.zod.js +1 -1
  184. package/dist/fns/get-flags/get-flags.enums.d.ts +1 -1
  185. package/dist/fns/get-flags/get-flags.schema.zod.browser.cjs +2 -3996
  186. package/dist/fns/get-flags/get-flags.schema.zod.browser.js +1 -3996
  187. package/dist/fns/get-flags/get-flags.schema.zod.cjs +1 -1
  188. package/dist/fns/get-flags/get-flags.schema.zod.d.ts +1 -1
  189. package/dist/fns/get-flags/get-flags.schema.zod.js +1 -1
  190. package/dist/fns/get-statistics/get-statistics.enums.d.ts +1 -1
  191. package/dist/fns/get-statistics/get-statistics.schema.zod.browser.cjs +7 -4001
  192. package/dist/fns/get-statistics/get-statistics.schema.zod.browser.js +1 -3996
  193. package/dist/fns/get-statistics/get-statistics.schema.zod.cjs +1 -1
  194. package/dist/fns/get-statistics/get-statistics.schema.zod.d.ts +1 -1
  195. package/dist/fns/get-statistics/get-statistics.schema.zod.js +1 -1
  196. package/dist/fns/get-token/get-token.enums.d.ts +1 -1
  197. package/dist/fns/get-token/get-token.schema.zod.browser.cjs +2 -3996
  198. package/dist/fns/get-token/get-token.schema.zod.browser.js +1 -3996
  199. package/dist/fns/get-token/get-token.schema.zod.cjs +1 -1
  200. package/dist/fns/get-token/get-token.schema.zod.d.ts +1 -1
  201. package/dist/fns/get-token/get-token.schema.zod.js +1 -1
  202. package/dist/fns/get-transfer/get-transfer.enums.d.ts +1 -1
  203. package/dist/fns/get-transfer/get-transfer.schema.zod.browser.cjs +2 -3996
  204. package/dist/fns/get-transfer/get-transfer.schema.zod.browser.js +1 -3996
  205. package/dist/fns/get-transfer/get-transfer.schema.zod.cjs +1 -1
  206. package/dist/fns/get-transfer/get-transfer.schema.zod.d.ts +1 -1
  207. package/dist/fns/get-transfer/get-transfer.schema.zod.js +1 -1
  208. package/dist/fns/get-transfer-group/get-transfer-group.enums.d.ts +1 -1
  209. package/dist/fns/get-transfer-group/get-transfer-group.schema.zod.browser.cjs +2 -3996
  210. package/dist/fns/get-transfer-group/get-transfer-group.schema.zod.browser.js +1 -3996
  211. package/dist/fns/get-transfer-group/get-transfer-group.schema.zod.cjs +1 -1
  212. package/dist/fns/get-transfer-group/get-transfer-group.schema.zod.d.ts +1 -1
  213. package/dist/fns/get-transfer-group/get-transfer-group.schema.zod.js +1 -1
  214. package/dist/fns/get-wallet/get-wallet.enums.d.ts +1 -1
  215. package/dist/fns/get-wallet/get-wallet.schema.zod.browser.cjs +2 -3996
  216. package/dist/fns/get-wallet/get-wallet.schema.zod.browser.js +1 -3996
  217. package/dist/fns/get-wallet/get-wallet.schema.zod.cjs +1 -1
  218. package/dist/fns/get-wallet/get-wallet.schema.zod.d.ts +1 -1
  219. package/dist/fns/get-wallet/get-wallet.schema.zod.js +1 -1
  220. package/dist/fns/healthcheck/healthcheck.enums.d.ts +1 -1
  221. package/dist/fns/healthcheck/healthcheck.schema.zod.browser.cjs +2 -3996
  222. package/dist/fns/healthcheck/healthcheck.schema.zod.browser.js +1 -3996
  223. package/dist/fns/healthcheck/healthcheck.schema.zod.cjs +1 -1
  224. package/dist/fns/healthcheck/healthcheck.schema.zod.d.ts +1 -1
  225. package/dist/fns/healthcheck/healthcheck.schema.zod.js +1 -1
  226. package/dist/fns/list-exports/list-exports.enums.d.ts +1 -1
  227. package/dist/fns/list-exports/list-exports.schema.zod.browser.cjs +3 -3997
  228. package/dist/fns/list-exports/list-exports.schema.zod.browser.js +1 -3996
  229. package/dist/fns/list-exports/list-exports.schema.zod.cjs +1 -1
  230. package/dist/fns/list-exports/list-exports.schema.zod.d.ts +1 -1
  231. package/dist/fns/list-exports/list-exports.schema.zod.js +1 -1
  232. package/dist/fns/reverse-transfer/reverse-transfer.enums.d.ts +1 -1
  233. package/dist/fns/reverse-transfer/reverse-transfer.schema.zod.browser.cjs +2 -3996
  234. package/dist/fns/reverse-transfer/reverse-transfer.schema.zod.browser.js +1 -3996
  235. package/dist/fns/reverse-transfer/reverse-transfer.schema.zod.cjs +1 -1
  236. package/dist/fns/reverse-transfer/reverse-transfer.schema.zod.d.ts +1 -1
  237. package/dist/fns/reverse-transfer/reverse-transfer.schema.zod.js +1 -1
  238. package/dist/fns/reverse-transfer-group/reverse-transfer-group.enums.d.ts +1 -1
  239. package/dist/fns/reverse-transfer-group/reverse-transfer-group.schema.zod.browser.cjs +2 -3996
  240. package/dist/fns/reverse-transfer-group/reverse-transfer-group.schema.zod.browser.js +1 -3996
  241. package/dist/fns/reverse-transfer-group/reverse-transfer-group.schema.zod.cjs +1 -1
  242. package/dist/fns/reverse-transfer-group/reverse-transfer-group.schema.zod.d.ts +1 -1
  243. package/dist/fns/reverse-transfer-group/reverse-transfer-group.schema.zod.js +1 -1
  244. package/dist/fns/reverse-transfers/reverse-transfers.enums.d.ts +1 -1
  245. package/dist/fns/set-flags/set-flags.enums.d.ts +1 -1
  246. package/dist/fns/update-token/update-token.enums.d.ts +1 -1
  247. package/dist/fns/update-token/update-token.schema.zod.browser.cjs +2 -3996
  248. package/dist/fns/update-token/update-token.schema.zod.browser.js +1 -3996
  249. package/dist/fns/update-token/update-token.schema.zod.cjs +1 -1
  250. package/dist/fns/update-token/update-token.schema.zod.d.ts +1 -1
  251. package/dist/fns/update-token/update-token.schema.zod.js +1 -1
  252. package/dist/fns/update-transfer/update-transfer.enums.d.ts +1 -1
  253. package/dist/fns/update-transfer/update-transfer.schema.zod.browser.cjs +3 -3997
  254. package/dist/fns/update-transfer/update-transfer.schema.zod.browser.js +1 -3996
  255. package/dist/fns/update-transfer/update-transfer.schema.zod.cjs +1 -1
  256. package/dist/fns/update-transfer/update-transfer.schema.zod.d.ts +1 -1
  257. package/dist/fns/update-transfer/update-transfer.schema.zod.js +1 -1
  258. package/dist/fns/update-transfer-group/update-transfer-group.enums.d.ts +1 -1
  259. package/dist/fns/update-transfer-group/update-transfer-group.schema.zod.browser.cjs +3 -3997
  260. package/dist/fns/update-transfer-group/update-transfer-group.schema.zod.browser.js +1 -3996
  261. package/dist/fns/update-transfer-group/update-transfer-group.schema.zod.cjs +1 -1
  262. package/dist/fns/update-transfer-group/update-transfer-group.schema.zod.d.ts +1 -1
  263. package/dist/fns/update-transfer-group/update-transfer-group.schema.zod.js +1 -1
  264. package/dist/fns/update-transfer-groups/update-transfer-groups.enums.d.ts +1 -1
  265. package/dist/fns/update-transfer-groups/update-transfer-groups.schema.zod.browser.cjs +2 -3996
  266. package/dist/fns/update-transfer-groups/update-transfer-groups.schema.zod.browser.js +1 -3996
  267. package/dist/fns/update-transfer-groups/update-transfer-groups.schema.zod.cjs +1 -1
  268. package/dist/fns/update-transfer-groups/update-transfer-groups.schema.zod.d.ts +1 -1
  269. package/dist/fns/update-transfer-groups/update-transfer-groups.schema.zod.js +1 -1
  270. package/dist/fns/update-transfers/update-transfers.enums.d.ts +1 -1
  271. package/dist/fns/update-transfers/update-transfers.schema.zod.browser.cjs +3 -3997
  272. package/dist/fns/update-transfers/update-transfers.schema.zod.browser.js +1 -3996
  273. package/dist/fns/update-transfers/update-transfers.schema.zod.cjs +1 -1
  274. package/dist/fns/update-transfers/update-transfers.schema.zod.d.ts +1 -1
  275. package/dist/fns/update-transfers/update-transfers.schema.zod.js +1 -1
  276. package/dist/fns/update-wallet/update-wallet.enums.d.ts +1 -1
  277. package/dist/fns/update-wallet/update-wallet.schema.zod.browser.cjs +2 -3996
  278. package/dist/fns/update-wallet/update-wallet.schema.zod.browser.js +1 -3996
  279. package/dist/fns/update-wallet/update-wallet.schema.zod.cjs +1 -1
  280. package/dist/fns/update-wallet/update-wallet.schema.zod.d.ts +1 -1
  281. package/dist/fns/update-wallet/update-wallet.schema.zod.js +1 -1
  282. package/dist/lib/env.browser.cjs +1 -1
  283. package/dist/lib/env.browser.js +1 -1
  284. package/dist/lib/env.cjs +1 -1
  285. package/dist/lib/env.js +1 -1
  286. package/dist/lib/validation.d.ts +16 -16
  287. package/dist/lib/zod.browser.cjs +4018 -0
  288. package/dist/lib/zod.browser.js +3998 -0
  289. package/dist/lib/zod.cjs +30 -0
  290. package/dist/lib/zod.d.ts +2 -0
  291. package/dist/lib/zod.js +5 -0
  292. package/dist/txs/aggregate-transfer-many/aggregate-transfer-many.enums.d.ts +1 -1
  293. package/dist/txs/aggregate-transfer-many/aggregate-transfer-many.schema.zod.browser.cjs +8 -4002
  294. package/dist/txs/aggregate-transfer-many/aggregate-transfer-many.schema.zod.browser.js +1 -3996
  295. package/dist/txs/aggregate-transfer-many/aggregate-transfer-many.schema.zod.cjs +8 -18
  296. package/dist/txs/aggregate-transfer-many/aggregate-transfer-many.schema.zod.d.ts +1 -1
  297. package/dist/txs/aggregate-transfer-many/aggregate-transfer-many.schema.zod.js +1 -1
  298. package/dist/txs/authentication-check/authentication-check.enums.d.ts +1 -1
  299. package/dist/txs/authentication-check/authentication-check.schema.zod.browser.cjs +3 -3997
  300. package/dist/txs/authentication-check/authentication-check.schema.zod.browser.js +1 -3996
  301. package/dist/txs/authentication-check/authentication-check.schema.zod.cjs +3 -13
  302. package/dist/txs/authentication-check/authentication-check.schema.zod.d.ts +1 -1
  303. package/dist/txs/authentication-check/authentication-check.schema.zod.js +1 -1
  304. package/dist/txs/consts.browser.cjs +64 -4058
  305. package/dist/txs/consts.browser.js +1 -3998
  306. package/dist/txs/consts.cjs +64 -74
  307. package/dist/txs/consts.d.ts +1 -1
  308. package/dist/txs/consts.enums.d.ts +1 -1
  309. package/dist/txs/consts.js +1 -1
  310. package/dist/txs/create-access-token/create-access-token.enums.d.ts +1 -1
  311. package/dist/txs/create-access-token/create-access-token.schema.zod.browser.cjs +13 -4007
  312. package/dist/txs/create-access-token/create-access-token.schema.zod.browser.js +1 -3996
  313. package/dist/txs/create-access-token/create-access-token.schema.zod.cjs +13 -23
  314. package/dist/txs/create-access-token/create-access-token.schema.zod.d.ts +1 -1
  315. package/dist/txs/create-access-token/create-access-token.schema.zod.js +1 -1
  316. package/dist/txs/create-contract/create-contract.enums.d.ts +1 -1
  317. package/dist/txs/create-contract/create-contract.schema.zod.browser.cjs +7 -4001
  318. package/dist/txs/create-contract/create-contract.schema.zod.browser.js +1 -3996
  319. package/dist/txs/create-contract/create-contract.schema.zod.cjs +7 -17
  320. package/dist/txs/create-contract/create-contract.schema.zod.d.ts +1 -1
  321. package/dist/txs/create-contract/create-contract.schema.zod.js +1 -1
  322. package/dist/txs/create-deposit/create-deposit.enums.d.ts +1 -1
  323. package/dist/txs/create-deposit/create-deposit.schema.zod.browser.cjs +3 -3997
  324. package/dist/txs/create-deposit/create-deposit.schema.zod.browser.js +1 -3996
  325. package/dist/txs/create-deposit/create-deposit.schema.zod.cjs +3 -13
  326. package/dist/txs/create-deposit/create-deposit.schema.zod.d.ts +1 -1
  327. package/dist/txs/create-deposit/create-deposit.schema.zod.js +1 -1
  328. package/dist/txs/create-distribution/create-distribution.enums.d.ts +1 -1
  329. package/dist/txs/create-distribution/create-distribution.schema.zod.browser.cjs +13 -4007
  330. package/dist/txs/create-distribution/create-distribution.schema.zod.browser.js +1 -3996
  331. package/dist/txs/create-distribution/create-distribution.schema.zod.cjs +13 -23
  332. package/dist/txs/create-distribution/create-distribution.schema.zod.d.ts +1 -1
  333. package/dist/txs/create-distribution/create-distribution.schema.zod.js +1 -1
  334. package/dist/txs/create-token/create-token.enums.d.ts +1 -1
  335. package/dist/txs/create-token/create-token.schema.zod.browser.cjs +4 -3998
  336. package/dist/txs/create-token/create-token.schema.zod.browser.js +1 -3996
  337. package/dist/txs/create-token/create-token.schema.zod.cjs +4 -14
  338. package/dist/txs/create-token/create-token.schema.zod.d.ts +1 -1
  339. package/dist/txs/create-token/create-token.schema.zod.js +1 -1
  340. package/dist/txs/create-transfer/create-transfer.enums.d.ts +1 -1
  341. package/dist/txs/create-transfer/create-transfer.schema.zod.browser.cjs +12 -4006
  342. package/dist/txs/create-transfer/create-transfer.schema.zod.browser.js +1 -3996
  343. package/dist/txs/create-transfer/create-transfer.schema.zod.cjs +12 -22
  344. package/dist/txs/create-transfer/create-transfer.schema.zod.d.ts +1 -1
  345. package/dist/txs/create-transfer/create-transfer.schema.zod.js +1 -1
  346. package/dist/txs/create-transfer-group/create-transfer-group.enums.d.ts +1 -1
  347. package/dist/txs/create-transfer-group/create-transfer-group.schema.zod.browser.cjs +7 -4001
  348. package/dist/txs/create-transfer-group/create-transfer-group.schema.zod.browser.js +1 -3996
  349. package/dist/txs/create-transfer-group/create-transfer-group.schema.zod.cjs +7 -17
  350. package/dist/txs/create-transfer-group/create-transfer-group.schema.zod.d.ts +1 -1
  351. package/dist/txs/create-transfer-group/create-transfer-group.schema.zod.js +1 -1
  352. package/dist/txs/create-transfer-many/create-transfer-many.enums.d.ts +1 -1
  353. package/dist/txs/create-transfer-many/create-transfer-many.schema.zod.browser.cjs +3 -3997
  354. package/dist/txs/create-transfer-many/create-transfer-many.schema.zod.browser.js +1 -3996
  355. package/dist/txs/create-transfer-many/create-transfer-many.schema.zod.cjs +3 -13
  356. package/dist/txs/create-transfer-many/create-transfer-many.schema.zod.d.ts +1 -1
  357. package/dist/txs/create-transfer-many/create-transfer-many.schema.zod.js +1 -1
  358. package/dist/txs/create-wallet/create-wallet.enums.d.ts +1 -1
  359. package/dist/txs/create-wallet/create-wallet.schema.zod.browser.cjs +4 -3998
  360. package/dist/txs/create-wallet/create-wallet.schema.zod.browser.js +1 -3996
  361. package/dist/txs/create-wallet/create-wallet.schema.zod.cjs +4 -14
  362. package/dist/txs/create-wallet/create-wallet.schema.zod.d.ts +1 -1
  363. package/dist/txs/create-wallet/create-wallet.schema.zod.js +1 -1
  364. package/dist/txs/create-withdrawal/create-withdrawal.enums.d.ts +1 -1
  365. package/dist/txs/create-withdrawal/create-withdrawal.schema.zod.browser.cjs +3 -3997
  366. package/dist/txs/create-withdrawal/create-withdrawal.schema.zod.browser.js +1 -3996
  367. package/dist/txs/create-withdrawal/create-withdrawal.schema.zod.cjs +3 -13
  368. package/dist/txs/create-withdrawal/create-withdrawal.schema.zod.d.ts +1 -1
  369. package/dist/txs/create-withdrawal/create-withdrawal.schema.zod.js +1 -1
  370. package/dist/txs/export-balance-history/export-balance-history.enums.d.ts +1 -1
  371. package/dist/txs/export-balance-history/export-balance-history.schema.zod.browser.cjs +3 -3997
  372. package/dist/txs/export-balance-history/export-balance-history.schema.zod.browser.js +1 -3996
  373. package/dist/txs/export-balance-history/export-balance-history.schema.zod.cjs +3 -13
  374. package/dist/txs/export-balance-history/export-balance-history.schema.zod.d.ts +1 -1
  375. package/dist/txs/export-balance-history/export-balance-history.schema.zod.js +1 -1
  376. package/dist/txs/export-token-many/export-token-many.enums.d.ts +1 -1
  377. package/dist/txs/export-transfer-group-many/export-transfer-group-many.enums.d.ts +1 -1
  378. package/dist/txs/export-transfer-many/export-transfer-many.enums.d.ts +1 -1
  379. package/dist/txs/export-wallet-many/export-wallet-many.enums.d.ts +1 -1
  380. package/dist/txs/find-balance-many/find-balance-many.enums.d.ts +1 -1
  381. package/dist/txs/find-balance-many/find-balance-many.schema.zod.browser.cjs +5 -3999
  382. package/dist/txs/find-balance-many/find-balance-many.schema.zod.browser.js +1 -3996
  383. package/dist/txs/find-balance-many/find-balance-many.schema.zod.cjs +5 -15
  384. package/dist/txs/find-balance-many/find-balance-many.schema.zod.d.ts +1 -1
  385. package/dist/txs/find-balance-many/find-balance-many.schema.zod.js +1 -1
  386. package/dist/txs/find-token-many/find-token-many.enums.d.ts +1 -1
  387. package/dist/txs/find-token-many/find-token-many.schema.zod.browser.cjs +6 -4000
  388. package/dist/txs/find-token-many/find-token-many.schema.zod.browser.js +1 -3996
  389. package/dist/txs/find-token-many/find-token-many.schema.zod.cjs +6 -16
  390. package/dist/txs/find-token-many/find-token-many.schema.zod.d.ts +1 -1
  391. package/dist/txs/find-token-many/find-token-many.schema.zod.js +1 -1
  392. package/dist/txs/find-transfer-group-many/find-transfer-group-many.enums.d.ts +1 -1
  393. package/dist/txs/find-transfer-group-many/find-transfer-group-many.schema.zod.browser.cjs +7 -4001
  394. package/dist/txs/find-transfer-group-many/find-transfer-group-many.schema.zod.browser.js +1 -3996
  395. package/dist/txs/find-transfer-group-many/find-transfer-group-many.schema.zod.cjs +7 -17
  396. package/dist/txs/find-transfer-group-many/find-transfer-group-many.schema.zod.d.ts +1 -1
  397. package/dist/txs/find-transfer-group-many/find-transfer-group-many.schema.zod.js +1 -1
  398. package/dist/txs/find-transfer-many/find-transfer-many.enums.d.ts +1 -1
  399. package/dist/txs/find-transfer-many/find-transfer-many.schema.zod.browser.cjs +6 -4000
  400. package/dist/txs/find-transfer-many/find-transfer-many.schema.zod.browser.js +1 -3996
  401. package/dist/txs/find-transfer-many/find-transfer-many.schema.zod.cjs +6 -16
  402. package/dist/txs/find-transfer-many/find-transfer-many.schema.zod.d.ts +1 -1
  403. package/dist/txs/find-transfer-many/find-transfer-many.schema.zod.js +1 -1
  404. package/dist/txs/find-wallet-many/find-wallet-many.enums.d.ts +1 -1
  405. package/dist/txs/find-wallet-many/find-wallet-many.schema.zod.browser.cjs +9 -4003
  406. package/dist/txs/find-wallet-many/find-wallet-many.schema.zod.browser.js +1 -3996
  407. package/dist/txs/find-wallet-many/find-wallet-many.schema.zod.cjs +9 -19
  408. package/dist/txs/find-wallet-many/find-wallet-many.schema.zod.d.ts +1 -1
  409. package/dist/txs/find-wallet-many/find-wallet-many.schema.zod.js +1 -1
  410. package/dist/txs/finish-transaction/finish-transaction.enums.d.ts +1 -1
  411. package/dist/txs/finish-transaction/finish-transaction.schema.zod.browser.cjs +6 -4000
  412. package/dist/txs/finish-transaction/finish-transaction.schema.zod.browser.js +1 -3996
  413. package/dist/txs/finish-transaction/finish-transaction.schema.zod.cjs +6 -16
  414. package/dist/txs/finish-transaction/finish-transaction.schema.zod.d.ts +1 -1
  415. package/dist/txs/finish-transaction/finish-transaction.schema.zod.js +1 -1
  416. package/dist/txs/get-balance/get-balance.enums.d.ts +1 -1
  417. package/dist/txs/get-balance/get-balance.schema.zod.browser.cjs +9 -4003
  418. package/dist/txs/get-balance/get-balance.schema.zod.browser.js +1 -3996
  419. package/dist/txs/get-balance/get-balance.schema.zod.cjs +9 -19
  420. package/dist/txs/get-balance/get-balance.schema.zod.d.ts +1 -1
  421. package/dist/txs/get-balance/get-balance.schema.zod.js +1 -1
  422. package/dist/txs/get-balance-history/get-balance-history.enums.d.ts +1 -1
  423. package/dist/txs/get-balance-history/get-balance-history.schema.zod.browser.cjs +12 -4006
  424. package/dist/txs/get-balance-history/get-balance-history.schema.zod.browser.js +1 -3996
  425. package/dist/txs/get-balance-history/get-balance-history.schema.zod.cjs +12 -22
  426. package/dist/txs/get-balance-history/get-balance-history.schema.zod.d.ts +1 -1
  427. package/dist/txs/get-balance-history/get-balance-history.schema.zod.js +1 -1
  428. package/dist/txs/get-export/get-export.enums.d.ts +1 -1
  429. package/dist/txs/get-export/get-export.schema.zod.browser.cjs +14 -4008
  430. package/dist/txs/get-export/get-export.schema.zod.browser.js +1 -3996
  431. package/dist/txs/get-export/get-export.schema.zod.cjs +14 -24
  432. package/dist/txs/get-export/get-export.schema.zod.d.ts +1 -1
  433. package/dist/txs/get-export/get-export.schema.zod.js +1 -1
  434. package/dist/txs/get-flags/get-flags.enums.d.ts +1 -1
  435. package/dist/txs/get-flags/get-flags.schema.zod.browser.cjs +3 -3997
  436. package/dist/txs/get-flags/get-flags.schema.zod.browser.js +1 -3996
  437. package/dist/txs/get-flags/get-flags.schema.zod.cjs +3 -13
  438. package/dist/txs/get-flags/get-flags.schema.zod.d.ts +1 -1
  439. package/dist/txs/get-flags/get-flags.schema.zod.js +1 -1
  440. package/dist/txs/get-statistics/get-statistics.enums.d.ts +1 -1
  441. package/dist/txs/get-statistics/get-statistics.schema.zod.browser.cjs +6 -4000
  442. package/dist/txs/get-statistics/get-statistics.schema.zod.browser.js +1 -3996
  443. package/dist/txs/get-statistics/get-statistics.schema.zod.cjs +6 -16
  444. package/dist/txs/get-statistics/get-statistics.schema.zod.d.ts +1 -1
  445. package/dist/txs/get-statistics/get-statistics.schema.zod.js +1 -1
  446. package/dist/txs/get-token/get-token.enums.d.ts +1 -1
  447. package/dist/txs/get-token/get-token.schema.zod.browser.cjs +8 -4002
  448. package/dist/txs/get-token/get-token.schema.zod.browser.js +1 -3996
  449. package/dist/txs/get-token/get-token.schema.zod.cjs +8 -18
  450. package/dist/txs/get-token/get-token.schema.zod.d.ts +1 -1
  451. package/dist/txs/get-token/get-token.schema.zod.js +1 -1
  452. package/dist/txs/get-token-many/get-token-many.enums.d.ts +1 -1
  453. package/dist/txs/get-token-many/get-token-many.schema.zod.browser.cjs +3 -3997
  454. package/dist/txs/get-token-many/get-token-many.schema.zod.browser.js +1 -3996
  455. package/dist/txs/get-token-many/get-token-many.schema.zod.cjs +3 -13
  456. package/dist/txs/get-token-many/get-token-many.schema.zod.d.ts +1 -1
  457. package/dist/txs/get-token-many/get-token-many.schema.zod.js +1 -1
  458. package/dist/txs/get-transfer/get-transfer.enums.d.ts +1 -1
  459. package/dist/txs/get-transfer/get-transfer.schema.zod.browser.cjs +3 -3997
  460. package/dist/txs/get-transfer/get-transfer.schema.zod.browser.js +1 -3996
  461. package/dist/txs/get-transfer/get-transfer.schema.zod.cjs +3 -13
  462. package/dist/txs/get-transfer/get-transfer.schema.zod.d.ts +1 -1
  463. package/dist/txs/get-transfer/get-transfer.schema.zod.js +1 -1
  464. package/dist/txs/get-transfer-group/get-transfer-group.enums.d.ts +1 -1
  465. package/dist/txs/get-transfer-group/get-transfer-group.schema.zod.browser.cjs +5 -3999
  466. package/dist/txs/get-transfer-group/get-transfer-group.schema.zod.browser.js +1 -3996
  467. package/dist/txs/get-transfer-group/get-transfer-group.schema.zod.cjs +5 -15
  468. package/dist/txs/get-transfer-group/get-transfer-group.schema.zod.d.ts +1 -1
  469. package/dist/txs/get-transfer-group/get-transfer-group.schema.zod.js +1 -1
  470. package/dist/txs/get-wallet/get-wallet.enums.d.ts +1 -1
  471. package/dist/txs/get-wallet/get-wallet.schema.zod.browser.cjs +7 -4001
  472. package/dist/txs/get-wallet/get-wallet.schema.zod.browser.js +1 -3996
  473. package/dist/txs/get-wallet/get-wallet.schema.zod.cjs +7 -17
  474. package/dist/txs/get-wallet/get-wallet.schema.zod.d.ts +1 -1
  475. package/dist/txs/get-wallet/get-wallet.schema.zod.js +1 -1
  476. package/dist/txs/get-wallet-many/get-wallet-many.enums.d.ts +1 -1
  477. package/dist/txs/get-wallet-many/get-wallet-many.schema.zod.browser.cjs +3 -3997
  478. package/dist/txs/get-wallet-many/get-wallet-many.schema.zod.browser.js +1 -3996
  479. package/dist/txs/get-wallet-many/get-wallet-many.schema.zod.cjs +3 -13
  480. package/dist/txs/get-wallet-many/get-wallet-many.schema.zod.d.ts +1 -1
  481. package/dist/txs/get-wallet-many/get-wallet-many.schema.zod.js +1 -1
  482. package/dist/txs/healthcheck/healthcheck.enums.d.ts +1 -1
  483. package/dist/txs/healthcheck/healthcheck.schema.zod.browser.cjs +9 -4003
  484. package/dist/txs/healthcheck/healthcheck.schema.zod.browser.js +1 -3996
  485. package/dist/txs/healthcheck/healthcheck.schema.zod.cjs +9 -19
  486. package/dist/txs/healthcheck/healthcheck.schema.zod.d.ts +1 -1
  487. package/dist/txs/healthcheck/healthcheck.schema.zod.js +1 -1
  488. package/dist/txs/import-actions/import-actions.enums.d.ts +1 -1
  489. package/dist/txs/import-actions/import-actions.schema.zod.browser.cjs +19 -4013
  490. package/dist/txs/import-actions/import-actions.schema.zod.browser.js +1 -3998
  491. package/dist/txs/import-actions/import-actions.schema.zod.cjs +19 -29
  492. package/dist/txs/import-actions/import-actions.schema.zod.d.ts +1 -1
  493. package/dist/txs/import-actions/import-actions.schema.zod.js +1 -1
  494. package/dist/txs/list-export-many/list-export-many.enums.d.ts +1 -1
  495. package/dist/txs/list-export-many/list-export-many.schema.zod.browser.cjs +6 -4000
  496. package/dist/txs/list-export-many/list-export-many.schema.zod.browser.js +1 -3996
  497. package/dist/txs/list-export-many/list-export-many.schema.zod.cjs +6 -16
  498. package/dist/txs/list-export-many/list-export-many.schema.zod.d.ts +1 -1
  499. package/dist/txs/list-export-many/list-export-many.schema.zod.js +1 -1
  500. package/dist/txs/query-logs/query-logs.enums.d.ts +1 -1
  501. package/dist/txs/query-logs/query-logs.schema.zod.browser.cjs +10 -4004
  502. package/dist/txs/query-logs/query-logs.schema.zod.browser.js +1 -3996
  503. package/dist/txs/query-logs/query-logs.schema.zod.cjs +10 -20
  504. package/dist/txs/query-logs/query-logs.schema.zod.d.ts +1 -1
  505. package/dist/txs/query-logs/query-logs.schema.zod.js +1 -1
  506. package/dist/txs/reset-database/reset-database.enums.d.ts +1 -1
  507. package/dist/txs/reset-database/reset-database.schema.zod.browser.cjs +7 -4001
  508. package/dist/txs/reset-database/reset-database.schema.zod.browser.js +1 -3996
  509. package/dist/txs/reset-database/reset-database.schema.zod.cjs +7 -17
  510. package/dist/txs/reset-database/reset-database.schema.zod.d.ts +1 -1
  511. package/dist/txs/reset-database/reset-database.schema.zod.js +1 -1
  512. package/dist/txs/reverse-transfer/reverse-transfer.enums.d.ts +1 -1
  513. package/dist/txs/reverse-transfer/reverse-transfer.schema.zod.browser.cjs +8 -4002
  514. package/dist/txs/reverse-transfer/reverse-transfer.schema.zod.browser.js +1 -3996
  515. package/dist/txs/reverse-transfer/reverse-transfer.schema.zod.cjs +8 -18
  516. package/dist/txs/reverse-transfer/reverse-transfer.schema.zod.d.ts +1 -1
  517. package/dist/txs/reverse-transfer/reverse-transfer.schema.zod.js +1 -1
  518. package/dist/txs/reverse-transfer-group/reverse-transfer-group.enums.d.ts +1 -1
  519. package/dist/txs/reverse-transfer-group/reverse-transfer-group.schema.zod.browser.cjs +9 -4003
  520. package/dist/txs/reverse-transfer-group/reverse-transfer-group.schema.zod.browser.js +1 -3996
  521. package/dist/txs/reverse-transfer-group/reverse-transfer-group.schema.zod.cjs +9 -19
  522. package/dist/txs/reverse-transfer-group/reverse-transfer-group.schema.zod.d.ts +1 -1
  523. package/dist/txs/reverse-transfer-group/reverse-transfer-group.schema.zod.js +1 -1
  524. package/dist/txs/reverse-transfer-group-many/reverse-transfer-group-many.enums.d.ts +1 -1
  525. package/dist/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.zod.browser.cjs +3 -3997
  526. package/dist/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.zod.browser.js +1 -3996
  527. package/dist/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.zod.cjs +3 -13
  528. package/dist/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.zod.d.ts +1 -1
  529. package/dist/txs/reverse-transfer-group-many/reverse-transfer-group-many.schema.zod.js +1 -1
  530. package/dist/txs/reverse-transfer-many/reverse-transfer-many.enums.d.ts +1 -1
  531. package/dist/txs/reverse-transfer-many/reverse-transfer-many.schema.zod.browser.cjs +6 -4000
  532. package/dist/txs/reverse-transfer-many/reverse-transfer-many.schema.zod.browser.js +1 -3996
  533. package/dist/txs/reverse-transfer-many/reverse-transfer-many.schema.zod.cjs +6 -16
  534. package/dist/txs/reverse-transfer-many/reverse-transfer-many.schema.zod.d.ts +1 -1
  535. package/dist/txs/reverse-transfer-many/reverse-transfer-many.schema.zod.js +1 -1
  536. package/dist/txs/set-flags/set-flags.enums.d.ts +1 -1
  537. package/dist/txs/set-flags/set-flags.schema.zod.browser.cjs +4 -3998
  538. package/dist/txs/set-flags/set-flags.schema.zod.browser.js +1 -3996
  539. package/dist/txs/set-flags/set-flags.schema.zod.cjs +4 -14
  540. package/dist/txs/set-flags/set-flags.schema.zod.d.ts +1 -1
  541. package/dist/txs/set-flags/set-flags.schema.zod.js +1 -1
  542. package/dist/txs/start-transaction/start-transaction.enums.d.ts +1 -1
  543. package/dist/txs/start-transaction/start-transaction.schema.zod.browser.cjs +4 -3998
  544. package/dist/txs/start-transaction/start-transaction.schema.zod.browser.js +1 -3996
  545. package/dist/txs/start-transaction/start-transaction.schema.zod.cjs +4 -14
  546. package/dist/txs/start-transaction/start-transaction.schema.zod.d.ts +1 -1
  547. package/dist/txs/start-transaction/start-transaction.schema.zod.js +1 -1
  548. package/dist/txs/update-token/update-token.enums.d.ts +1 -1
  549. package/dist/txs/update-token/update-token.schema.zod.browser.cjs +5 -3999
  550. package/dist/txs/update-token/update-token.schema.zod.browser.js +1 -3996
  551. package/dist/txs/update-token/update-token.schema.zod.cjs +5 -15
  552. package/dist/txs/update-token/update-token.schema.zod.d.ts +1 -1
  553. package/dist/txs/update-token/update-token.schema.zod.js +1 -1
  554. package/dist/txs/update-transfer/update-transfer.enums.d.ts +1 -1
  555. package/dist/txs/update-transfer/update-transfer.schema.zod.browser.cjs +7 -4001
  556. package/dist/txs/update-transfer/update-transfer.schema.zod.browser.js +1 -3996
  557. package/dist/txs/update-transfer/update-transfer.schema.zod.cjs +7 -17
  558. package/dist/txs/update-transfer/update-transfer.schema.zod.d.ts +1 -1
  559. package/dist/txs/update-transfer/update-transfer.schema.zod.js +1 -1
  560. package/dist/txs/update-transfer-group/update-transfer-group.enums.d.ts +1 -1
  561. package/dist/txs/update-transfer-group/update-transfer-group.schema.zod.browser.cjs +7 -4001
  562. package/dist/txs/update-transfer-group/update-transfer-group.schema.zod.browser.js +1 -3996
  563. package/dist/txs/update-transfer-group/update-transfer-group.schema.zod.cjs +7 -17
  564. package/dist/txs/update-transfer-group/update-transfer-group.schema.zod.d.ts +1 -1
  565. package/dist/txs/update-transfer-group/update-transfer-group.schema.zod.js +1 -1
  566. package/dist/txs/update-transfer-group-many/update-transfer-group-many.enums.d.ts +1 -1
  567. package/dist/txs/update-transfer-group-many/update-transfer-group-many.schema.zod.browser.cjs +4 -3998
  568. package/dist/txs/update-transfer-group-many/update-transfer-group-many.schema.zod.browser.js +1 -3996
  569. package/dist/txs/update-transfer-group-many/update-transfer-group-many.schema.zod.cjs +4 -14
  570. package/dist/txs/update-transfer-group-many/update-transfer-group-many.schema.zod.d.ts +1 -1
  571. package/dist/txs/update-transfer-group-many/update-transfer-group-many.schema.zod.js +1 -1
  572. package/dist/txs/update-transfer-many/update-transfer-many.enums.d.ts +1 -1
  573. package/dist/txs/update-transfer-many/update-transfer-many.schema.zod.browser.cjs +4 -3998
  574. package/dist/txs/update-transfer-many/update-transfer-many.schema.zod.browser.js +1 -3996
  575. package/dist/txs/update-transfer-many/update-transfer-many.schema.zod.cjs +4 -14
  576. package/dist/txs/update-transfer-many/update-transfer-many.schema.zod.d.ts +1 -1
  577. package/dist/txs/update-transfer-many/update-transfer-many.schema.zod.js +1 -1
  578. package/dist/txs/update-wallet/update-wallet.enums.d.ts +1 -1
  579. package/dist/txs/update-wallet/update-wallet.schema.zod.browser.cjs +5 -3999
  580. package/dist/txs/update-wallet/update-wallet.schema.zod.browser.js +1 -3996
  581. package/dist/txs/update-wallet/update-wallet.schema.zod.cjs +5 -15
  582. package/dist/txs/update-wallet/update-wallet.schema.zod.d.ts +1 -1
  583. package/dist/txs/update-wallet/update-wallet.schema.zod.js +1 -1
  584. package/dist/types/wapi-client.d.ts +217 -213
  585. package/dist/wapi-client-web.iife.js +2 -2
  586. package/dist/wapi-client.iife.js +2 -2
  587. package/package.json +5 -5
@@ -1,25 +1,8 @@
1
1
  "use strict";
2
2
  var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
- var __spreadValues = (a, b) => {
12
- for (var prop in b || (b = {}))
13
- if (__hasOwnProp.call(b, prop))
14
- __defNormalProp(a, prop, b[prop]);
15
- if (__getOwnPropSymbols)
16
- for (var prop of __getOwnPropSymbols(b)) {
17
- if (__propIsEnum.call(b, prop))
18
- __defNormalProp(a, prop, b[prop]);
19
- }
20
- return a;
21
- };
22
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
6
  var __export = (target, all) => {
24
7
  for (var name in all)
25
8
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -33,26 +16,6 @@ var __copyProps = (to, from, except, desc) => {
33
16
  return to;
34
17
  };
35
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
- var __async = (__this, __arguments, generator) => {
37
- return new Promise((resolve, reject) => {
38
- var fulfilled = (value) => {
39
- try {
40
- step(generator.next(value));
41
- } catch (e) {
42
- reject(e);
43
- }
44
- };
45
- var rejected = (value) => {
46
- try {
47
- step(generator.throw(value));
48
- } catch (e) {
49
- reject(e);
50
- }
51
- };
52
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
53
- step((generator = generator.apply(__this, __arguments)).next());
54
- });
55
- };
56
19
 
57
20
  // src/txs/reverse-transfer-many/reverse-transfer-many.schema.zod.ts
58
21
  var reverse_transfer_many_schema_zod_exports = {};
@@ -63,3989 +26,32 @@ __export(reverse_transfer_many_schema_zod_exports, {
63
26
  reverseTransferManyTxOutputSchema: () => reverseTransferManyTxOutputSchema
64
27
  });
65
28
  module.exports = __toCommonJS(reverse_transfer_many_schema_zod_exports);
66
-
67
- // node_modules/zod/lib/index.mjs
68
- var util;
69
- (function(util2) {
70
- util2.assertEqual = (val) => val;
71
- function assertIs(_arg) {
72
- }
73
- util2.assertIs = assertIs;
74
- function assertNever(_x) {
75
- throw new Error();
76
- }
77
- util2.assertNever = assertNever;
78
- util2.arrayToEnum = (items) => {
79
- const obj = {};
80
- for (const item of items) {
81
- obj[item] = item;
82
- }
83
- return obj;
84
- };
85
- util2.getValidEnumValues = (obj) => {
86
- const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
87
- const filtered = {};
88
- for (const k of validKeys) {
89
- filtered[k] = obj[k];
90
- }
91
- return util2.objectValues(filtered);
92
- };
93
- util2.objectValues = (obj) => {
94
- return util2.objectKeys(obj).map(function(e) {
95
- return obj[e];
96
- });
97
- };
98
- util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
99
- const keys = [];
100
- for (const key in object) {
101
- if (Object.prototype.hasOwnProperty.call(object, key)) {
102
- keys.push(key);
103
- }
104
- }
105
- return keys;
106
- };
107
- util2.find = (arr, checker) => {
108
- for (const item of arr) {
109
- if (checker(item))
110
- return item;
111
- }
112
- return void 0;
113
- };
114
- util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
115
- function joinValues(array, separator = " | ") {
116
- return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
117
- }
118
- util2.joinValues = joinValues;
119
- util2.jsonStringifyReplacer = (_, value) => {
120
- if (typeof value === "bigint") {
121
- return value.toString();
122
- }
123
- return value;
124
- };
125
- })(util || (util = {}));
126
- var objectUtil;
127
- (function(objectUtil2) {
128
- objectUtil2.mergeShapes = (first, second) => {
129
- return __spreadValues(__spreadValues({}, first), second);
130
- };
131
- })(objectUtil || (objectUtil = {}));
132
- var ZodParsedType = util.arrayToEnum([
133
- "string",
134
- "nan",
135
- "number",
136
- "integer",
137
- "float",
138
- "boolean",
139
- "date",
140
- "bigint",
141
- "symbol",
142
- "function",
143
- "undefined",
144
- "null",
145
- "array",
146
- "object",
147
- "unknown",
148
- "promise",
149
- "void",
150
- "never",
151
- "map",
152
- "set"
153
- ]);
154
- var getParsedType = (data) => {
155
- const t = typeof data;
156
- switch (t) {
157
- case "undefined":
158
- return ZodParsedType.undefined;
159
- case "string":
160
- return ZodParsedType.string;
161
- case "number":
162
- return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
163
- case "boolean":
164
- return ZodParsedType.boolean;
165
- case "function":
166
- return ZodParsedType.function;
167
- case "bigint":
168
- return ZodParsedType.bigint;
169
- case "symbol":
170
- return ZodParsedType.symbol;
171
- case "object":
172
- if (Array.isArray(data)) {
173
- return ZodParsedType.array;
174
- }
175
- if (data === null) {
176
- return ZodParsedType.null;
177
- }
178
- if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
179
- return ZodParsedType.promise;
180
- }
181
- if (typeof Map !== "undefined" && data instanceof Map) {
182
- return ZodParsedType.map;
183
- }
184
- if (typeof Set !== "undefined" && data instanceof Set) {
185
- return ZodParsedType.set;
186
- }
187
- if (typeof Date !== "undefined" && data instanceof Date) {
188
- return ZodParsedType.date;
189
- }
190
- return ZodParsedType.object;
191
- default:
192
- return ZodParsedType.unknown;
193
- }
194
- };
195
- var ZodIssueCode = util.arrayToEnum([
196
- "invalid_type",
197
- "invalid_literal",
198
- "custom",
199
- "invalid_union",
200
- "invalid_union_discriminator",
201
- "invalid_enum_value",
202
- "unrecognized_keys",
203
- "invalid_arguments",
204
- "invalid_return_type",
205
- "invalid_date",
206
- "invalid_string",
207
- "too_small",
208
- "too_big",
209
- "invalid_intersection_types",
210
- "not_multiple_of",
211
- "not_finite"
212
- ]);
213
- var quotelessJson = (obj) => {
214
- const json = JSON.stringify(obj, null, 2);
215
- return json.replace(/"([^"]+)":/g, "$1:");
216
- };
217
- var ZodError = class _ZodError extends Error {
218
- get errors() {
219
- return this.issues;
220
- }
221
- constructor(issues) {
222
- super();
223
- this.issues = [];
224
- this.addIssue = (sub) => {
225
- this.issues = [...this.issues, sub];
226
- };
227
- this.addIssues = (subs = []) => {
228
- this.issues = [...this.issues, ...subs];
229
- };
230
- const actualProto = new.target.prototype;
231
- if (Object.setPrototypeOf) {
232
- Object.setPrototypeOf(this, actualProto);
233
- } else {
234
- this.__proto__ = actualProto;
235
- }
236
- this.name = "ZodError";
237
- this.issues = issues;
238
- }
239
- format(_mapper) {
240
- const mapper = _mapper || function(issue) {
241
- return issue.message;
242
- };
243
- const fieldErrors = { _errors: [] };
244
- const processError = (error) => {
245
- for (const issue of error.issues) {
246
- if (issue.code === "invalid_union") {
247
- issue.unionErrors.map(processError);
248
- } else if (issue.code === "invalid_return_type") {
249
- processError(issue.returnTypeError);
250
- } else if (issue.code === "invalid_arguments") {
251
- processError(issue.argumentsError);
252
- } else if (issue.path.length === 0) {
253
- fieldErrors._errors.push(mapper(issue));
254
- } else {
255
- let curr = fieldErrors;
256
- let i = 0;
257
- while (i < issue.path.length) {
258
- const el = issue.path[i];
259
- const terminal = i === issue.path.length - 1;
260
- if (!terminal) {
261
- curr[el] = curr[el] || { _errors: [] };
262
- } else {
263
- curr[el] = curr[el] || { _errors: [] };
264
- curr[el]._errors.push(mapper(issue));
265
- }
266
- curr = curr[el];
267
- i++;
268
- }
269
- }
270
- }
271
- };
272
- processError(this);
273
- return fieldErrors;
274
- }
275
- static assert(value) {
276
- if (!(value instanceof _ZodError)) {
277
- throw new Error(`Not a ZodError: ${value}`);
278
- }
279
- }
280
- toString() {
281
- return this.message;
282
- }
283
- get message() {
284
- return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);
285
- }
286
- get isEmpty() {
287
- return this.issues.length === 0;
288
- }
289
- flatten(mapper = (issue) => issue.message) {
290
- const fieldErrors = {};
291
- const formErrors = [];
292
- for (const sub of this.issues) {
293
- if (sub.path.length > 0) {
294
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
295
- fieldErrors[sub.path[0]].push(mapper(sub));
296
- } else {
297
- formErrors.push(mapper(sub));
298
- }
299
- }
300
- return { formErrors, fieldErrors };
301
- }
302
- get formErrors() {
303
- return this.flatten();
304
- }
305
- };
306
- ZodError.create = (issues) => {
307
- const error = new ZodError(issues);
308
- return error;
309
- };
310
- var errorMap = (issue, _ctx) => {
311
- let message;
312
- switch (issue.code) {
313
- case ZodIssueCode.invalid_type:
314
- if (issue.received === ZodParsedType.undefined) {
315
- message = "Required";
316
- } else {
317
- message = `Expected ${issue.expected}, received ${issue.received}`;
318
- }
319
- break;
320
- case ZodIssueCode.invalid_literal:
321
- message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
322
- break;
323
- case ZodIssueCode.unrecognized_keys:
324
- message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
325
- break;
326
- case ZodIssueCode.invalid_union:
327
- message = `Invalid input`;
328
- break;
329
- case ZodIssueCode.invalid_union_discriminator:
330
- message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
331
- break;
332
- case ZodIssueCode.invalid_enum_value:
333
- message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
334
- break;
335
- case ZodIssueCode.invalid_arguments:
336
- message = `Invalid function arguments`;
337
- break;
338
- case ZodIssueCode.invalid_return_type:
339
- message = `Invalid function return type`;
340
- break;
341
- case ZodIssueCode.invalid_date:
342
- message = `Invalid date`;
343
- break;
344
- case ZodIssueCode.invalid_string:
345
- if (typeof issue.validation === "object") {
346
- if ("includes" in issue.validation) {
347
- message = `Invalid input: must include "${issue.validation.includes}"`;
348
- if (typeof issue.validation.position === "number") {
349
- message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
350
- }
351
- } else if ("startsWith" in issue.validation) {
352
- message = `Invalid input: must start with "${issue.validation.startsWith}"`;
353
- } else if ("endsWith" in issue.validation) {
354
- message = `Invalid input: must end with "${issue.validation.endsWith}"`;
355
- } else {
356
- util.assertNever(issue.validation);
357
- }
358
- } else if (issue.validation !== "regex") {
359
- message = `Invalid ${issue.validation}`;
360
- } else {
361
- message = "Invalid";
362
- }
363
- break;
364
- case ZodIssueCode.too_small:
365
- if (issue.type === "array")
366
- message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
367
- else if (issue.type === "string")
368
- message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
369
- else if (issue.type === "number")
370
- message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
371
- else if (issue.type === "date")
372
- message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
373
- else
374
- message = "Invalid input";
375
- break;
376
- case ZodIssueCode.too_big:
377
- if (issue.type === "array")
378
- message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
379
- else if (issue.type === "string")
380
- message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
381
- else if (issue.type === "number")
382
- message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
383
- else if (issue.type === "bigint")
384
- message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
385
- else if (issue.type === "date")
386
- message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
387
- else
388
- message = "Invalid input";
389
- break;
390
- case ZodIssueCode.custom:
391
- message = `Invalid input`;
392
- break;
393
- case ZodIssueCode.invalid_intersection_types:
394
- message = `Intersection results could not be merged`;
395
- break;
396
- case ZodIssueCode.not_multiple_of:
397
- message = `Number must be a multiple of ${issue.multipleOf}`;
398
- break;
399
- case ZodIssueCode.not_finite:
400
- message = "Number must be finite";
401
- break;
402
- default:
403
- message = _ctx.defaultError;
404
- util.assertNever(issue);
405
- }
406
- return { message };
407
- };
408
- var overrideErrorMap = errorMap;
409
- function setErrorMap(map) {
410
- overrideErrorMap = map;
411
- }
412
- function getErrorMap() {
413
- return overrideErrorMap;
414
- }
415
- var makeIssue = (params) => {
416
- const { data, path, errorMaps, issueData } = params;
417
- const fullPath = [...path, ...issueData.path || []];
418
- const fullIssue = __spreadProps(__spreadValues({}, issueData), {
419
- path: fullPath
420
- });
421
- if (issueData.message !== void 0) {
422
- return __spreadProps(__spreadValues({}, issueData), {
423
- path: fullPath,
424
- message: issueData.message
425
- });
426
- }
427
- let errorMessage = "";
428
- const maps = errorMaps.filter((m) => !!m).slice().reverse();
429
- for (const map of maps) {
430
- errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
431
- }
432
- return __spreadProps(__spreadValues({}, issueData), {
433
- path: fullPath,
434
- message: errorMessage
435
- });
436
- };
437
- var EMPTY_PATH = [];
438
- function addIssueToContext(ctx, issueData) {
439
- const overrideMap = getErrorMap();
440
- const issue = makeIssue({
441
- issueData,
442
- data: ctx.data,
443
- path: ctx.path,
444
- errorMaps: [
445
- ctx.common.contextualErrorMap,
446
- // contextual error map is first priority
447
- ctx.schemaErrorMap,
448
- // then schema-bound map if available
449
- overrideMap,
450
- // then global override map
451
- overrideMap === errorMap ? void 0 : errorMap
452
- // then global default map
453
- ].filter((x) => !!x)
454
- });
455
- ctx.common.issues.push(issue);
456
- }
457
- var ParseStatus = class _ParseStatus {
458
- constructor() {
459
- this.value = "valid";
460
- }
461
- dirty() {
462
- if (this.value === "valid")
463
- this.value = "dirty";
464
- }
465
- abort() {
466
- if (this.value !== "aborted")
467
- this.value = "aborted";
468
- }
469
- static mergeArray(status, results) {
470
- const arrayValue = [];
471
- for (const s of results) {
472
- if (s.status === "aborted")
473
- return INVALID;
474
- if (s.status === "dirty")
475
- status.dirty();
476
- arrayValue.push(s.value);
477
- }
478
- return { status: status.value, value: arrayValue };
479
- }
480
- static mergeObjectAsync(status, pairs) {
481
- return __async(this, null, function* () {
482
- const syncPairs = [];
483
- for (const pair of pairs) {
484
- const key = yield pair.key;
485
- const value = yield pair.value;
486
- syncPairs.push({
487
- key,
488
- value
489
- });
490
- }
491
- return _ParseStatus.mergeObjectSync(status, syncPairs);
492
- });
493
- }
494
- static mergeObjectSync(status, pairs) {
495
- const finalObject = {};
496
- for (const pair of pairs) {
497
- const { key, value } = pair;
498
- if (key.status === "aborted")
499
- return INVALID;
500
- if (value.status === "aborted")
501
- return INVALID;
502
- if (key.status === "dirty")
503
- status.dirty();
504
- if (value.status === "dirty")
505
- status.dirty();
506
- if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
507
- finalObject[key.value] = value.value;
508
- }
509
- }
510
- return { status: status.value, value: finalObject };
511
- }
512
- };
513
- var INVALID = Object.freeze({
514
- status: "aborted"
515
- });
516
- var DIRTY = (value) => ({ status: "dirty", value });
517
- var OK = (value) => ({ status: "valid", value });
518
- var isAborted = (x) => x.status === "aborted";
519
- var isDirty = (x) => x.status === "dirty";
520
- var isValid = (x) => x.status === "valid";
521
- var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
522
- function __classPrivateFieldGet(receiver, state, kind, f) {
523
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
524
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
525
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
526
- }
527
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
528
- if (kind === "m") throw new TypeError("Private method is not writable");
529
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
530
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
531
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
532
- }
533
- var errorUtil;
534
- (function(errorUtil2) {
535
- errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
536
- errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
537
- })(errorUtil || (errorUtil = {}));
538
- var _ZodEnum_cache;
539
- var _ZodNativeEnum_cache;
540
- var ParseInputLazyPath = class {
541
- constructor(parent, value, path, key) {
542
- this._cachedPath = [];
543
- this.parent = parent;
544
- this.data = value;
545
- this._path = path;
546
- this._key = key;
547
- }
548
- get path() {
549
- if (!this._cachedPath.length) {
550
- if (this._key instanceof Array) {
551
- this._cachedPath.push(...this._path, ...this._key);
552
- } else {
553
- this._cachedPath.push(...this._path, this._key);
554
- }
555
- }
556
- return this._cachedPath;
557
- }
558
- };
559
- var handleResult = (ctx, result) => {
560
- if (isValid(result)) {
561
- return { success: true, data: result.value };
562
- } else {
563
- if (!ctx.common.issues.length) {
564
- throw new Error("Validation failed but no issues detected.");
565
- }
566
- return {
567
- success: false,
568
- get error() {
569
- if (this._error)
570
- return this._error;
571
- const error = new ZodError(ctx.common.issues);
572
- this._error = error;
573
- return this._error;
574
- }
575
- };
576
- }
577
- };
578
- function processCreateParams(params) {
579
- if (!params)
580
- return {};
581
- const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;
582
- if (errorMap2 && (invalid_type_error || required_error)) {
583
- throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
584
- }
585
- if (errorMap2)
586
- return { errorMap: errorMap2, description };
587
- const customMap = (iss, ctx) => {
588
- var _a, _b;
589
- const { message } = params;
590
- if (iss.code === "invalid_enum_value") {
591
- return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
592
- }
593
- if (typeof ctx.data === "undefined") {
594
- return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
595
- }
596
- if (iss.code !== "invalid_type")
597
- return { message: ctx.defaultError };
598
- return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
599
- };
600
- return { errorMap: customMap, description };
601
- }
602
- var ZodType = class {
603
- get description() {
604
- return this._def.description;
605
- }
606
- _getType(input) {
607
- return getParsedType(input.data);
608
- }
609
- _getOrReturnCtx(input, ctx) {
610
- return ctx || {
611
- common: input.parent.common,
612
- data: input.data,
613
- parsedType: getParsedType(input.data),
614
- schemaErrorMap: this._def.errorMap,
615
- path: input.path,
616
- parent: input.parent
617
- };
618
- }
619
- _processInputParams(input) {
620
- return {
621
- status: new ParseStatus(),
622
- ctx: {
623
- common: input.parent.common,
624
- data: input.data,
625
- parsedType: getParsedType(input.data),
626
- schemaErrorMap: this._def.errorMap,
627
- path: input.path,
628
- parent: input.parent
629
- }
630
- };
631
- }
632
- _parseSync(input) {
633
- const result = this._parse(input);
634
- if (isAsync(result)) {
635
- throw new Error("Synchronous parse encountered promise.");
636
- }
637
- return result;
638
- }
639
- _parseAsync(input) {
640
- const result = this._parse(input);
641
- return Promise.resolve(result);
642
- }
643
- parse(data, params) {
644
- const result = this.safeParse(data, params);
645
- if (result.success)
646
- return result.data;
647
- throw result.error;
648
- }
649
- safeParse(data, params) {
650
- var _a;
651
- const ctx = {
652
- common: {
653
- issues: [],
654
- async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,
655
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
656
- },
657
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
658
- schemaErrorMap: this._def.errorMap,
659
- parent: null,
660
- data,
661
- parsedType: getParsedType(data)
662
- };
663
- const result = this._parseSync({ data, path: ctx.path, parent: ctx });
664
- return handleResult(ctx, result);
665
- }
666
- "~validate"(data) {
667
- var _a, _b;
668
- const ctx = {
669
- common: {
670
- issues: [],
671
- async: !!this["~standard"].async
672
- },
673
- path: [],
674
- schemaErrorMap: this._def.errorMap,
675
- parent: null,
676
- data,
677
- parsedType: getParsedType(data)
678
- };
679
- if (!this["~standard"].async) {
680
- try {
681
- const result = this._parseSync({ data, path: [], parent: ctx });
682
- return isValid(result) ? {
683
- value: result.value
684
- } : {
685
- issues: ctx.common.issues
686
- };
687
- } catch (err) {
688
- if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes("encountered")) {
689
- this["~standard"].async = true;
690
- }
691
- ctx.common = {
692
- issues: [],
693
- async: true
694
- };
695
- }
696
- }
697
- return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
698
- value: result.value
699
- } : {
700
- issues: ctx.common.issues
701
- });
702
- }
703
- parseAsync(data, params) {
704
- return __async(this, null, function* () {
705
- const result = yield this.safeParseAsync(data, params);
706
- if (result.success)
707
- return result.data;
708
- throw result.error;
709
- });
710
- }
711
- safeParseAsync(data, params) {
712
- return __async(this, null, function* () {
713
- const ctx = {
714
- common: {
715
- issues: [],
716
- contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,
717
- async: true
718
- },
719
- path: (params === null || params === void 0 ? void 0 : params.path) || [],
720
- schemaErrorMap: this._def.errorMap,
721
- parent: null,
722
- data,
723
- parsedType: getParsedType(data)
724
- };
725
- const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
726
- const result = yield isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult);
727
- return handleResult(ctx, result);
728
- });
729
- }
730
- refine(check, message) {
731
- const getIssueProperties = (val) => {
732
- if (typeof message === "string" || typeof message === "undefined") {
733
- return { message };
734
- } else if (typeof message === "function") {
735
- return message(val);
736
- } else {
737
- return message;
738
- }
739
- };
740
- return this._refinement((val, ctx) => {
741
- const result = check(val);
742
- const setError = () => ctx.addIssue(__spreadValues({
743
- code: ZodIssueCode.custom
744
- }, getIssueProperties(val)));
745
- if (typeof Promise !== "undefined" && result instanceof Promise) {
746
- return result.then((data) => {
747
- if (!data) {
748
- setError();
749
- return false;
750
- } else {
751
- return true;
752
- }
753
- });
754
- }
755
- if (!result) {
756
- setError();
757
- return false;
758
- } else {
759
- return true;
760
- }
761
- });
762
- }
763
- refinement(check, refinementData) {
764
- return this._refinement((val, ctx) => {
765
- if (!check(val)) {
766
- ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
767
- return false;
768
- } else {
769
- return true;
770
- }
771
- });
772
- }
773
- _refinement(refinement) {
774
- return new ZodEffects({
775
- schema: this,
776
- typeName: ZodFirstPartyTypeKind.ZodEffects,
777
- effect: { type: "refinement", refinement }
778
- });
779
- }
780
- superRefine(refinement) {
781
- return this._refinement(refinement);
782
- }
783
- constructor(def) {
784
- this.spa = this.safeParseAsync;
785
- this._def = def;
786
- this.parse = this.parse.bind(this);
787
- this.safeParse = this.safeParse.bind(this);
788
- this.parseAsync = this.parseAsync.bind(this);
789
- this.safeParseAsync = this.safeParseAsync.bind(this);
790
- this.spa = this.spa.bind(this);
791
- this.refine = this.refine.bind(this);
792
- this.refinement = this.refinement.bind(this);
793
- this.superRefine = this.superRefine.bind(this);
794
- this.optional = this.optional.bind(this);
795
- this.nullable = this.nullable.bind(this);
796
- this.nullish = this.nullish.bind(this);
797
- this.array = this.array.bind(this);
798
- this.promise = this.promise.bind(this);
799
- this.or = this.or.bind(this);
800
- this.and = this.and.bind(this);
801
- this.transform = this.transform.bind(this);
802
- this.brand = this.brand.bind(this);
803
- this.default = this.default.bind(this);
804
- this.catch = this.catch.bind(this);
805
- this.describe = this.describe.bind(this);
806
- this.pipe = this.pipe.bind(this);
807
- this.readonly = this.readonly.bind(this);
808
- this.isNullable = this.isNullable.bind(this);
809
- this.isOptional = this.isOptional.bind(this);
810
- this["~standard"] = {
811
- version: 1,
812
- vendor: "zod",
813
- validate: (data) => this["~validate"](data)
814
- };
815
- }
816
- optional() {
817
- return ZodOptional.create(this, this._def);
818
- }
819
- nullable() {
820
- return ZodNullable.create(this, this._def);
821
- }
822
- nullish() {
823
- return this.nullable().optional();
824
- }
825
- array() {
826
- return ZodArray.create(this);
827
- }
828
- promise() {
829
- return ZodPromise.create(this, this._def);
830
- }
831
- or(option) {
832
- return ZodUnion.create([this, option], this._def);
833
- }
834
- and(incoming) {
835
- return ZodIntersection.create(this, incoming, this._def);
836
- }
837
- transform(transform) {
838
- return new ZodEffects(__spreadProps(__spreadValues({}, processCreateParams(this._def)), {
839
- schema: this,
840
- typeName: ZodFirstPartyTypeKind.ZodEffects,
841
- effect: { type: "transform", transform }
842
- }));
843
- }
844
- default(def) {
845
- const defaultValueFunc = typeof def === "function" ? def : () => def;
846
- return new ZodDefault(__spreadProps(__spreadValues({}, processCreateParams(this._def)), {
847
- innerType: this,
848
- defaultValue: defaultValueFunc,
849
- typeName: ZodFirstPartyTypeKind.ZodDefault
850
- }));
851
- }
852
- brand() {
853
- return new ZodBranded(__spreadValues({
854
- typeName: ZodFirstPartyTypeKind.ZodBranded,
855
- type: this
856
- }, processCreateParams(this._def)));
857
- }
858
- catch(def) {
859
- const catchValueFunc = typeof def === "function" ? def : () => def;
860
- return new ZodCatch(__spreadProps(__spreadValues({}, processCreateParams(this._def)), {
861
- innerType: this,
862
- catchValue: catchValueFunc,
863
- typeName: ZodFirstPartyTypeKind.ZodCatch
864
- }));
865
- }
866
- describe(description) {
867
- const This = this.constructor;
868
- return new This(__spreadProps(__spreadValues({}, this._def), {
869
- description
870
- }));
871
- }
872
- pipe(target) {
873
- return ZodPipeline.create(this, target);
874
- }
875
- readonly() {
876
- return ZodReadonly.create(this);
877
- }
878
- isOptional() {
879
- return this.safeParse(void 0).success;
880
- }
881
- isNullable() {
882
- return this.safeParse(null).success;
883
- }
884
- };
885
- var cuidRegex = /^c[^\s-]{8,}$/i;
886
- var cuid2Regex = /^[0-9a-z]+$/;
887
- var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
888
- var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
889
- var nanoidRegex = /^[a-z0-9_-]{21}$/i;
890
- var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
891
- var durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
892
- var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
893
- var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
894
- var emojiRegex;
895
- var ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
896
- var ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
897
- var ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
898
- var ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
899
- var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
900
- var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
901
- var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
902
- var dateRegex = new RegExp(`^${dateRegexSource}$`);
903
- function timeRegexSource(args) {
904
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
905
- if (args.precision) {
906
- regex = `${regex}\\.\\d{${args.precision}}`;
907
- } else if (args.precision == null) {
908
- regex = `${regex}(\\.\\d+)?`;
909
- }
910
- return regex;
911
- }
912
- function timeRegex(args) {
913
- return new RegExp(`^${timeRegexSource(args)}$`);
914
- }
915
- function datetimeRegex(args) {
916
- let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
917
- const opts = [];
918
- opts.push(args.local ? `Z?` : `Z`);
919
- if (args.offset)
920
- opts.push(`([+-]\\d{2}:?\\d{2})`);
921
- regex = `${regex}(${opts.join("|")})`;
922
- return new RegExp(`^${regex}$`);
923
- }
924
- function isValidIP(ip, version) {
925
- if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
926
- return true;
927
- }
928
- if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
929
- return true;
930
- }
931
- return false;
932
- }
933
- function isValidJWT(jwt, alg) {
934
- if (!jwtRegex.test(jwt))
935
- return false;
936
- try {
937
- const [header] = jwt.split(".");
938
- const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
939
- const decoded = JSON.parse(atob(base64));
940
- if (typeof decoded !== "object" || decoded === null)
941
- return false;
942
- if (!decoded.typ || !decoded.alg)
943
- return false;
944
- if (alg && decoded.alg !== alg)
945
- return false;
946
- return true;
947
- } catch (_a) {
948
- return false;
949
- }
950
- }
951
- function isValidCidr(ip, version) {
952
- if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
953
- return true;
954
- }
955
- if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
956
- return true;
957
- }
958
- return false;
959
- }
960
- var ZodString = class _ZodString extends ZodType {
961
- _parse(input) {
962
- if (this._def.coerce) {
963
- input.data = String(input.data);
964
- }
965
- const parsedType = this._getType(input);
966
- if (parsedType !== ZodParsedType.string) {
967
- const ctx2 = this._getOrReturnCtx(input);
968
- addIssueToContext(ctx2, {
969
- code: ZodIssueCode.invalid_type,
970
- expected: ZodParsedType.string,
971
- received: ctx2.parsedType
972
- });
973
- return INVALID;
974
- }
975
- const status = new ParseStatus();
976
- let ctx = void 0;
977
- for (const check of this._def.checks) {
978
- if (check.kind === "min") {
979
- if (input.data.length < check.value) {
980
- ctx = this._getOrReturnCtx(input, ctx);
981
- addIssueToContext(ctx, {
982
- code: ZodIssueCode.too_small,
983
- minimum: check.value,
984
- type: "string",
985
- inclusive: true,
986
- exact: false,
987
- message: check.message
988
- });
989
- status.dirty();
990
- }
991
- } else if (check.kind === "max") {
992
- if (input.data.length > check.value) {
993
- ctx = this._getOrReturnCtx(input, ctx);
994
- addIssueToContext(ctx, {
995
- code: ZodIssueCode.too_big,
996
- maximum: check.value,
997
- type: "string",
998
- inclusive: true,
999
- exact: false,
1000
- message: check.message
1001
- });
1002
- status.dirty();
1003
- }
1004
- } else if (check.kind === "length") {
1005
- const tooBig = input.data.length > check.value;
1006
- const tooSmall = input.data.length < check.value;
1007
- if (tooBig || tooSmall) {
1008
- ctx = this._getOrReturnCtx(input, ctx);
1009
- if (tooBig) {
1010
- addIssueToContext(ctx, {
1011
- code: ZodIssueCode.too_big,
1012
- maximum: check.value,
1013
- type: "string",
1014
- inclusive: true,
1015
- exact: true,
1016
- message: check.message
1017
- });
1018
- } else if (tooSmall) {
1019
- addIssueToContext(ctx, {
1020
- code: ZodIssueCode.too_small,
1021
- minimum: check.value,
1022
- type: "string",
1023
- inclusive: true,
1024
- exact: true,
1025
- message: check.message
1026
- });
1027
- }
1028
- status.dirty();
1029
- }
1030
- } else if (check.kind === "email") {
1031
- if (!emailRegex.test(input.data)) {
1032
- ctx = this._getOrReturnCtx(input, ctx);
1033
- addIssueToContext(ctx, {
1034
- validation: "email",
1035
- code: ZodIssueCode.invalid_string,
1036
- message: check.message
1037
- });
1038
- status.dirty();
1039
- }
1040
- } else if (check.kind === "emoji") {
1041
- if (!emojiRegex) {
1042
- emojiRegex = new RegExp(_emojiRegex, "u");
1043
- }
1044
- if (!emojiRegex.test(input.data)) {
1045
- ctx = this._getOrReturnCtx(input, ctx);
1046
- addIssueToContext(ctx, {
1047
- validation: "emoji",
1048
- code: ZodIssueCode.invalid_string,
1049
- message: check.message
1050
- });
1051
- status.dirty();
1052
- }
1053
- } else if (check.kind === "uuid") {
1054
- if (!uuidRegex.test(input.data)) {
1055
- ctx = this._getOrReturnCtx(input, ctx);
1056
- addIssueToContext(ctx, {
1057
- validation: "uuid",
1058
- code: ZodIssueCode.invalid_string,
1059
- message: check.message
1060
- });
1061
- status.dirty();
1062
- }
1063
- } else if (check.kind === "nanoid") {
1064
- if (!nanoidRegex.test(input.data)) {
1065
- ctx = this._getOrReturnCtx(input, ctx);
1066
- addIssueToContext(ctx, {
1067
- validation: "nanoid",
1068
- code: ZodIssueCode.invalid_string,
1069
- message: check.message
1070
- });
1071
- status.dirty();
1072
- }
1073
- } else if (check.kind === "cuid") {
1074
- if (!cuidRegex.test(input.data)) {
1075
- ctx = this._getOrReturnCtx(input, ctx);
1076
- addIssueToContext(ctx, {
1077
- validation: "cuid",
1078
- code: ZodIssueCode.invalid_string,
1079
- message: check.message
1080
- });
1081
- status.dirty();
1082
- }
1083
- } else if (check.kind === "cuid2") {
1084
- if (!cuid2Regex.test(input.data)) {
1085
- ctx = this._getOrReturnCtx(input, ctx);
1086
- addIssueToContext(ctx, {
1087
- validation: "cuid2",
1088
- code: ZodIssueCode.invalid_string,
1089
- message: check.message
1090
- });
1091
- status.dirty();
1092
- }
1093
- } else if (check.kind === "ulid") {
1094
- if (!ulidRegex.test(input.data)) {
1095
- ctx = this._getOrReturnCtx(input, ctx);
1096
- addIssueToContext(ctx, {
1097
- validation: "ulid",
1098
- code: ZodIssueCode.invalid_string,
1099
- message: check.message
1100
- });
1101
- status.dirty();
1102
- }
1103
- } else if (check.kind === "url") {
1104
- try {
1105
- new URL(input.data);
1106
- } catch (_a) {
1107
- ctx = this._getOrReturnCtx(input, ctx);
1108
- addIssueToContext(ctx, {
1109
- validation: "url",
1110
- code: ZodIssueCode.invalid_string,
1111
- message: check.message
1112
- });
1113
- status.dirty();
1114
- }
1115
- } else if (check.kind === "regex") {
1116
- check.regex.lastIndex = 0;
1117
- const testResult = check.regex.test(input.data);
1118
- if (!testResult) {
1119
- ctx = this._getOrReturnCtx(input, ctx);
1120
- addIssueToContext(ctx, {
1121
- validation: "regex",
1122
- code: ZodIssueCode.invalid_string,
1123
- message: check.message
1124
- });
1125
- status.dirty();
1126
- }
1127
- } else if (check.kind === "trim") {
1128
- input.data = input.data.trim();
1129
- } else if (check.kind === "includes") {
1130
- if (!input.data.includes(check.value, check.position)) {
1131
- ctx = this._getOrReturnCtx(input, ctx);
1132
- addIssueToContext(ctx, {
1133
- code: ZodIssueCode.invalid_string,
1134
- validation: { includes: check.value, position: check.position },
1135
- message: check.message
1136
- });
1137
- status.dirty();
1138
- }
1139
- } else if (check.kind === "toLowerCase") {
1140
- input.data = input.data.toLowerCase();
1141
- } else if (check.kind === "toUpperCase") {
1142
- input.data = input.data.toUpperCase();
1143
- } else if (check.kind === "startsWith") {
1144
- if (!input.data.startsWith(check.value)) {
1145
- ctx = this._getOrReturnCtx(input, ctx);
1146
- addIssueToContext(ctx, {
1147
- code: ZodIssueCode.invalid_string,
1148
- validation: { startsWith: check.value },
1149
- message: check.message
1150
- });
1151
- status.dirty();
1152
- }
1153
- } else if (check.kind === "endsWith") {
1154
- if (!input.data.endsWith(check.value)) {
1155
- ctx = this._getOrReturnCtx(input, ctx);
1156
- addIssueToContext(ctx, {
1157
- code: ZodIssueCode.invalid_string,
1158
- validation: { endsWith: check.value },
1159
- message: check.message
1160
- });
1161
- status.dirty();
1162
- }
1163
- } else if (check.kind === "datetime") {
1164
- const regex = datetimeRegex(check);
1165
- if (!regex.test(input.data)) {
1166
- ctx = this._getOrReturnCtx(input, ctx);
1167
- addIssueToContext(ctx, {
1168
- code: ZodIssueCode.invalid_string,
1169
- validation: "datetime",
1170
- message: check.message
1171
- });
1172
- status.dirty();
1173
- }
1174
- } else if (check.kind === "date") {
1175
- const regex = dateRegex;
1176
- if (!regex.test(input.data)) {
1177
- ctx = this._getOrReturnCtx(input, ctx);
1178
- addIssueToContext(ctx, {
1179
- code: ZodIssueCode.invalid_string,
1180
- validation: "date",
1181
- message: check.message
1182
- });
1183
- status.dirty();
1184
- }
1185
- } else if (check.kind === "time") {
1186
- const regex = timeRegex(check);
1187
- if (!regex.test(input.data)) {
1188
- ctx = this._getOrReturnCtx(input, ctx);
1189
- addIssueToContext(ctx, {
1190
- code: ZodIssueCode.invalid_string,
1191
- validation: "time",
1192
- message: check.message
1193
- });
1194
- status.dirty();
1195
- }
1196
- } else if (check.kind === "duration") {
1197
- if (!durationRegex.test(input.data)) {
1198
- ctx = this._getOrReturnCtx(input, ctx);
1199
- addIssueToContext(ctx, {
1200
- validation: "duration",
1201
- code: ZodIssueCode.invalid_string,
1202
- message: check.message
1203
- });
1204
- status.dirty();
1205
- }
1206
- } else if (check.kind === "ip") {
1207
- if (!isValidIP(input.data, check.version)) {
1208
- ctx = this._getOrReturnCtx(input, ctx);
1209
- addIssueToContext(ctx, {
1210
- validation: "ip",
1211
- code: ZodIssueCode.invalid_string,
1212
- message: check.message
1213
- });
1214
- status.dirty();
1215
- }
1216
- } else if (check.kind === "jwt") {
1217
- if (!isValidJWT(input.data, check.alg)) {
1218
- ctx = this._getOrReturnCtx(input, ctx);
1219
- addIssueToContext(ctx, {
1220
- validation: "jwt",
1221
- code: ZodIssueCode.invalid_string,
1222
- message: check.message
1223
- });
1224
- status.dirty();
1225
- }
1226
- } else if (check.kind === "cidr") {
1227
- if (!isValidCidr(input.data, check.version)) {
1228
- ctx = this._getOrReturnCtx(input, ctx);
1229
- addIssueToContext(ctx, {
1230
- validation: "cidr",
1231
- code: ZodIssueCode.invalid_string,
1232
- message: check.message
1233
- });
1234
- status.dirty();
1235
- }
1236
- } else if (check.kind === "base64") {
1237
- if (!base64Regex.test(input.data)) {
1238
- ctx = this._getOrReturnCtx(input, ctx);
1239
- addIssueToContext(ctx, {
1240
- validation: "base64",
1241
- code: ZodIssueCode.invalid_string,
1242
- message: check.message
1243
- });
1244
- status.dirty();
1245
- }
1246
- } else if (check.kind === "base64url") {
1247
- if (!base64urlRegex.test(input.data)) {
1248
- ctx = this._getOrReturnCtx(input, ctx);
1249
- addIssueToContext(ctx, {
1250
- validation: "base64url",
1251
- code: ZodIssueCode.invalid_string,
1252
- message: check.message
1253
- });
1254
- status.dirty();
1255
- }
1256
- } else {
1257
- util.assertNever(check);
1258
- }
1259
- }
1260
- return { status: status.value, value: input.data };
1261
- }
1262
- _regex(regex, validation, message) {
1263
- return this.refinement((data) => regex.test(data), __spreadValues({
1264
- validation,
1265
- code: ZodIssueCode.invalid_string
1266
- }, errorUtil.errToObj(message)));
1267
- }
1268
- _addCheck(check) {
1269
- return new _ZodString(__spreadProps(__spreadValues({}, this._def), {
1270
- checks: [...this._def.checks, check]
1271
- }));
1272
- }
1273
- email(message) {
1274
- return this._addCheck(__spreadValues({ kind: "email" }, errorUtil.errToObj(message)));
1275
- }
1276
- url(message) {
1277
- return this._addCheck(__spreadValues({ kind: "url" }, errorUtil.errToObj(message)));
1278
- }
1279
- emoji(message) {
1280
- return this._addCheck(__spreadValues({ kind: "emoji" }, errorUtil.errToObj(message)));
1281
- }
1282
- uuid(message) {
1283
- return this._addCheck(__spreadValues({ kind: "uuid" }, errorUtil.errToObj(message)));
1284
- }
1285
- nanoid(message) {
1286
- return this._addCheck(__spreadValues({ kind: "nanoid" }, errorUtil.errToObj(message)));
1287
- }
1288
- cuid(message) {
1289
- return this._addCheck(__spreadValues({ kind: "cuid" }, errorUtil.errToObj(message)));
1290
- }
1291
- cuid2(message) {
1292
- return this._addCheck(__spreadValues({ kind: "cuid2" }, errorUtil.errToObj(message)));
1293
- }
1294
- ulid(message) {
1295
- return this._addCheck(__spreadValues({ kind: "ulid" }, errorUtil.errToObj(message)));
1296
- }
1297
- base64(message) {
1298
- return this._addCheck(__spreadValues({ kind: "base64" }, errorUtil.errToObj(message)));
1299
- }
1300
- base64url(message) {
1301
- return this._addCheck(__spreadValues({
1302
- kind: "base64url"
1303
- }, errorUtil.errToObj(message)));
1304
- }
1305
- jwt(options) {
1306
- return this._addCheck(__spreadValues({ kind: "jwt" }, errorUtil.errToObj(options)));
1307
- }
1308
- ip(options) {
1309
- return this._addCheck(__spreadValues({ kind: "ip" }, errorUtil.errToObj(options)));
1310
- }
1311
- cidr(options) {
1312
- return this._addCheck(__spreadValues({ kind: "cidr" }, errorUtil.errToObj(options)));
1313
- }
1314
- datetime(options) {
1315
- var _a, _b;
1316
- if (typeof options === "string") {
1317
- return this._addCheck({
1318
- kind: "datetime",
1319
- precision: null,
1320
- offset: false,
1321
- local: false,
1322
- message: options
1323
- });
1324
- }
1325
- return this._addCheck(__spreadValues({
1326
- kind: "datetime",
1327
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
1328
- offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
1329
- local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false
1330
- }, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
1331
- }
1332
- date(message) {
1333
- return this._addCheck({ kind: "date", message });
1334
- }
1335
- time(options) {
1336
- if (typeof options === "string") {
1337
- return this._addCheck({
1338
- kind: "time",
1339
- precision: null,
1340
- message: options
1341
- });
1342
- }
1343
- return this._addCheck(__spreadValues({
1344
- kind: "time",
1345
- precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision
1346
- }, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
1347
- }
1348
- duration(message) {
1349
- return this._addCheck(__spreadValues({ kind: "duration" }, errorUtil.errToObj(message)));
1350
- }
1351
- regex(regex, message) {
1352
- return this._addCheck(__spreadValues({
1353
- kind: "regex",
1354
- regex
1355
- }, errorUtil.errToObj(message)));
1356
- }
1357
- includes(value, options) {
1358
- return this._addCheck(__spreadValues({
1359
- kind: "includes",
1360
- value,
1361
- position: options === null || options === void 0 ? void 0 : options.position
1362
- }, errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)));
1363
- }
1364
- startsWith(value, message) {
1365
- return this._addCheck(__spreadValues({
1366
- kind: "startsWith",
1367
- value
1368
- }, errorUtil.errToObj(message)));
1369
- }
1370
- endsWith(value, message) {
1371
- return this._addCheck(__spreadValues({
1372
- kind: "endsWith",
1373
- value
1374
- }, errorUtil.errToObj(message)));
1375
- }
1376
- min(minLength, message) {
1377
- return this._addCheck(__spreadValues({
1378
- kind: "min",
1379
- value: minLength
1380
- }, errorUtil.errToObj(message)));
1381
- }
1382
- max(maxLength, message) {
1383
- return this._addCheck(__spreadValues({
1384
- kind: "max",
1385
- value: maxLength
1386
- }, errorUtil.errToObj(message)));
1387
- }
1388
- length(len, message) {
1389
- return this._addCheck(__spreadValues({
1390
- kind: "length",
1391
- value: len
1392
- }, errorUtil.errToObj(message)));
1393
- }
1394
- /**
1395
- * Equivalent to `.min(1)`
1396
- */
1397
- nonempty(message) {
1398
- return this.min(1, errorUtil.errToObj(message));
1399
- }
1400
- trim() {
1401
- return new _ZodString(__spreadProps(__spreadValues({}, this._def), {
1402
- checks: [...this._def.checks, { kind: "trim" }]
1403
- }));
1404
- }
1405
- toLowerCase() {
1406
- return new _ZodString(__spreadProps(__spreadValues({}, this._def), {
1407
- checks: [...this._def.checks, { kind: "toLowerCase" }]
1408
- }));
1409
- }
1410
- toUpperCase() {
1411
- return new _ZodString(__spreadProps(__spreadValues({}, this._def), {
1412
- checks: [...this._def.checks, { kind: "toUpperCase" }]
1413
- }));
1414
- }
1415
- get isDatetime() {
1416
- return !!this._def.checks.find((ch) => ch.kind === "datetime");
1417
- }
1418
- get isDate() {
1419
- return !!this._def.checks.find((ch) => ch.kind === "date");
1420
- }
1421
- get isTime() {
1422
- return !!this._def.checks.find((ch) => ch.kind === "time");
1423
- }
1424
- get isDuration() {
1425
- return !!this._def.checks.find((ch) => ch.kind === "duration");
1426
- }
1427
- get isEmail() {
1428
- return !!this._def.checks.find((ch) => ch.kind === "email");
1429
- }
1430
- get isURL() {
1431
- return !!this._def.checks.find((ch) => ch.kind === "url");
1432
- }
1433
- get isEmoji() {
1434
- return !!this._def.checks.find((ch) => ch.kind === "emoji");
1435
- }
1436
- get isUUID() {
1437
- return !!this._def.checks.find((ch) => ch.kind === "uuid");
1438
- }
1439
- get isNANOID() {
1440
- return !!this._def.checks.find((ch) => ch.kind === "nanoid");
1441
- }
1442
- get isCUID() {
1443
- return !!this._def.checks.find((ch) => ch.kind === "cuid");
1444
- }
1445
- get isCUID2() {
1446
- return !!this._def.checks.find((ch) => ch.kind === "cuid2");
1447
- }
1448
- get isULID() {
1449
- return !!this._def.checks.find((ch) => ch.kind === "ulid");
1450
- }
1451
- get isIP() {
1452
- return !!this._def.checks.find((ch) => ch.kind === "ip");
1453
- }
1454
- get isCIDR() {
1455
- return !!this._def.checks.find((ch) => ch.kind === "cidr");
1456
- }
1457
- get isBase64() {
1458
- return !!this._def.checks.find((ch) => ch.kind === "base64");
1459
- }
1460
- get isBase64url() {
1461
- return !!this._def.checks.find((ch) => ch.kind === "base64url");
1462
- }
1463
- get minLength() {
1464
- let min = null;
1465
- for (const ch of this._def.checks) {
1466
- if (ch.kind === "min") {
1467
- if (min === null || ch.value > min)
1468
- min = ch.value;
1469
- }
1470
- }
1471
- return min;
1472
- }
1473
- get maxLength() {
1474
- let max = null;
1475
- for (const ch of this._def.checks) {
1476
- if (ch.kind === "max") {
1477
- if (max === null || ch.value < max)
1478
- max = ch.value;
1479
- }
1480
- }
1481
- return max;
1482
- }
1483
- };
1484
- ZodString.create = (params) => {
1485
- var _a;
1486
- return new ZodString(__spreadValues({
1487
- checks: [],
1488
- typeName: ZodFirstPartyTypeKind.ZodString,
1489
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false
1490
- }, processCreateParams(params)));
1491
- };
1492
- function floatSafeRemainder(val, step) {
1493
- const valDecCount = (val.toString().split(".")[1] || "").length;
1494
- const stepDecCount = (step.toString().split(".")[1] || "").length;
1495
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
1496
- const valInt = parseInt(val.toFixed(decCount).replace(".", ""));
1497
- const stepInt = parseInt(step.toFixed(decCount).replace(".", ""));
1498
- return valInt % stepInt / Math.pow(10, decCount);
1499
- }
1500
- var ZodNumber = class _ZodNumber extends ZodType {
1501
- constructor() {
1502
- super(...arguments);
1503
- this.min = this.gte;
1504
- this.max = this.lte;
1505
- this.step = this.multipleOf;
1506
- }
1507
- _parse(input) {
1508
- if (this._def.coerce) {
1509
- input.data = Number(input.data);
1510
- }
1511
- const parsedType = this._getType(input);
1512
- if (parsedType !== ZodParsedType.number) {
1513
- const ctx2 = this._getOrReturnCtx(input);
1514
- addIssueToContext(ctx2, {
1515
- code: ZodIssueCode.invalid_type,
1516
- expected: ZodParsedType.number,
1517
- received: ctx2.parsedType
1518
- });
1519
- return INVALID;
1520
- }
1521
- let ctx = void 0;
1522
- const status = new ParseStatus();
1523
- for (const check of this._def.checks) {
1524
- if (check.kind === "int") {
1525
- if (!util.isInteger(input.data)) {
1526
- ctx = this._getOrReturnCtx(input, ctx);
1527
- addIssueToContext(ctx, {
1528
- code: ZodIssueCode.invalid_type,
1529
- expected: "integer",
1530
- received: "float",
1531
- message: check.message
1532
- });
1533
- status.dirty();
1534
- }
1535
- } else if (check.kind === "min") {
1536
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1537
- if (tooSmall) {
1538
- ctx = this._getOrReturnCtx(input, ctx);
1539
- addIssueToContext(ctx, {
1540
- code: ZodIssueCode.too_small,
1541
- minimum: check.value,
1542
- type: "number",
1543
- inclusive: check.inclusive,
1544
- exact: false,
1545
- message: check.message
1546
- });
1547
- status.dirty();
1548
- }
1549
- } else if (check.kind === "max") {
1550
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1551
- if (tooBig) {
1552
- ctx = this._getOrReturnCtx(input, ctx);
1553
- addIssueToContext(ctx, {
1554
- code: ZodIssueCode.too_big,
1555
- maximum: check.value,
1556
- type: "number",
1557
- inclusive: check.inclusive,
1558
- exact: false,
1559
- message: check.message
1560
- });
1561
- status.dirty();
1562
- }
1563
- } else if (check.kind === "multipleOf") {
1564
- if (floatSafeRemainder(input.data, check.value) !== 0) {
1565
- ctx = this._getOrReturnCtx(input, ctx);
1566
- addIssueToContext(ctx, {
1567
- code: ZodIssueCode.not_multiple_of,
1568
- multipleOf: check.value,
1569
- message: check.message
1570
- });
1571
- status.dirty();
1572
- }
1573
- } else if (check.kind === "finite") {
1574
- if (!Number.isFinite(input.data)) {
1575
- ctx = this._getOrReturnCtx(input, ctx);
1576
- addIssueToContext(ctx, {
1577
- code: ZodIssueCode.not_finite,
1578
- message: check.message
1579
- });
1580
- status.dirty();
1581
- }
1582
- } else {
1583
- util.assertNever(check);
1584
- }
1585
- }
1586
- return { status: status.value, value: input.data };
1587
- }
1588
- gte(value, message) {
1589
- return this.setLimit("min", value, true, errorUtil.toString(message));
1590
- }
1591
- gt(value, message) {
1592
- return this.setLimit("min", value, false, errorUtil.toString(message));
1593
- }
1594
- lte(value, message) {
1595
- return this.setLimit("max", value, true, errorUtil.toString(message));
1596
- }
1597
- lt(value, message) {
1598
- return this.setLimit("max", value, false, errorUtil.toString(message));
1599
- }
1600
- setLimit(kind, value, inclusive, message) {
1601
- return new _ZodNumber(__spreadProps(__spreadValues({}, this._def), {
1602
- checks: [
1603
- ...this._def.checks,
1604
- {
1605
- kind,
1606
- value,
1607
- inclusive,
1608
- message: errorUtil.toString(message)
1609
- }
1610
- ]
1611
- }));
1612
- }
1613
- _addCheck(check) {
1614
- return new _ZodNumber(__spreadProps(__spreadValues({}, this._def), {
1615
- checks: [...this._def.checks, check]
1616
- }));
1617
- }
1618
- int(message) {
1619
- return this._addCheck({
1620
- kind: "int",
1621
- message: errorUtil.toString(message)
1622
- });
1623
- }
1624
- positive(message) {
1625
- return this._addCheck({
1626
- kind: "min",
1627
- value: 0,
1628
- inclusive: false,
1629
- message: errorUtil.toString(message)
1630
- });
1631
- }
1632
- negative(message) {
1633
- return this._addCheck({
1634
- kind: "max",
1635
- value: 0,
1636
- inclusive: false,
1637
- message: errorUtil.toString(message)
1638
- });
1639
- }
1640
- nonpositive(message) {
1641
- return this._addCheck({
1642
- kind: "max",
1643
- value: 0,
1644
- inclusive: true,
1645
- message: errorUtil.toString(message)
1646
- });
1647
- }
1648
- nonnegative(message) {
1649
- return this._addCheck({
1650
- kind: "min",
1651
- value: 0,
1652
- inclusive: true,
1653
- message: errorUtil.toString(message)
1654
- });
1655
- }
1656
- multipleOf(value, message) {
1657
- return this._addCheck({
1658
- kind: "multipleOf",
1659
- value,
1660
- message: errorUtil.toString(message)
1661
- });
1662
- }
1663
- finite(message) {
1664
- return this._addCheck({
1665
- kind: "finite",
1666
- message: errorUtil.toString(message)
1667
- });
1668
- }
1669
- safe(message) {
1670
- return this._addCheck({
1671
- kind: "min",
1672
- inclusive: true,
1673
- value: Number.MIN_SAFE_INTEGER,
1674
- message: errorUtil.toString(message)
1675
- })._addCheck({
1676
- kind: "max",
1677
- inclusive: true,
1678
- value: Number.MAX_SAFE_INTEGER,
1679
- message: errorUtil.toString(message)
1680
- });
1681
- }
1682
- get minValue() {
1683
- let min = null;
1684
- for (const ch of this._def.checks) {
1685
- if (ch.kind === "min") {
1686
- if (min === null || ch.value > min)
1687
- min = ch.value;
1688
- }
1689
- }
1690
- return min;
1691
- }
1692
- get maxValue() {
1693
- let max = null;
1694
- for (const ch of this._def.checks) {
1695
- if (ch.kind === "max") {
1696
- if (max === null || ch.value < max)
1697
- max = ch.value;
1698
- }
1699
- }
1700
- return max;
1701
- }
1702
- get isInt() {
1703
- return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
1704
- }
1705
- get isFinite() {
1706
- let max = null, min = null;
1707
- for (const ch of this._def.checks) {
1708
- if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
1709
- return true;
1710
- } else if (ch.kind === "min") {
1711
- if (min === null || ch.value > min)
1712
- min = ch.value;
1713
- } else if (ch.kind === "max") {
1714
- if (max === null || ch.value < max)
1715
- max = ch.value;
1716
- }
1717
- }
1718
- return Number.isFinite(min) && Number.isFinite(max);
1719
- }
1720
- };
1721
- ZodNumber.create = (params) => {
1722
- return new ZodNumber(__spreadValues({
1723
- checks: [],
1724
- typeName: ZodFirstPartyTypeKind.ZodNumber,
1725
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false
1726
- }, processCreateParams(params)));
1727
- };
1728
- var ZodBigInt = class _ZodBigInt extends ZodType {
1729
- constructor() {
1730
- super(...arguments);
1731
- this.min = this.gte;
1732
- this.max = this.lte;
1733
- }
1734
- _parse(input) {
1735
- if (this._def.coerce) {
1736
- try {
1737
- input.data = BigInt(input.data);
1738
- } catch (_a) {
1739
- return this._getInvalidInput(input);
1740
- }
1741
- }
1742
- const parsedType = this._getType(input);
1743
- if (parsedType !== ZodParsedType.bigint) {
1744
- return this._getInvalidInput(input);
1745
- }
1746
- let ctx = void 0;
1747
- const status = new ParseStatus();
1748
- for (const check of this._def.checks) {
1749
- if (check.kind === "min") {
1750
- const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
1751
- if (tooSmall) {
1752
- ctx = this._getOrReturnCtx(input, ctx);
1753
- addIssueToContext(ctx, {
1754
- code: ZodIssueCode.too_small,
1755
- type: "bigint",
1756
- minimum: check.value,
1757
- inclusive: check.inclusive,
1758
- message: check.message
1759
- });
1760
- status.dirty();
1761
- }
1762
- } else if (check.kind === "max") {
1763
- const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
1764
- if (tooBig) {
1765
- ctx = this._getOrReturnCtx(input, ctx);
1766
- addIssueToContext(ctx, {
1767
- code: ZodIssueCode.too_big,
1768
- type: "bigint",
1769
- maximum: check.value,
1770
- inclusive: check.inclusive,
1771
- message: check.message
1772
- });
1773
- status.dirty();
1774
- }
1775
- } else if (check.kind === "multipleOf") {
1776
- if (input.data % check.value !== BigInt(0)) {
1777
- ctx = this._getOrReturnCtx(input, ctx);
1778
- addIssueToContext(ctx, {
1779
- code: ZodIssueCode.not_multiple_of,
1780
- multipleOf: check.value,
1781
- message: check.message
1782
- });
1783
- status.dirty();
1784
- }
1785
- } else {
1786
- util.assertNever(check);
1787
- }
1788
- }
1789
- return { status: status.value, value: input.data };
1790
- }
1791
- _getInvalidInput(input) {
1792
- const ctx = this._getOrReturnCtx(input);
1793
- addIssueToContext(ctx, {
1794
- code: ZodIssueCode.invalid_type,
1795
- expected: ZodParsedType.bigint,
1796
- received: ctx.parsedType
1797
- });
1798
- return INVALID;
1799
- }
1800
- gte(value, message) {
1801
- return this.setLimit("min", value, true, errorUtil.toString(message));
1802
- }
1803
- gt(value, message) {
1804
- return this.setLimit("min", value, false, errorUtil.toString(message));
1805
- }
1806
- lte(value, message) {
1807
- return this.setLimit("max", value, true, errorUtil.toString(message));
1808
- }
1809
- lt(value, message) {
1810
- return this.setLimit("max", value, false, errorUtil.toString(message));
1811
- }
1812
- setLimit(kind, value, inclusive, message) {
1813
- return new _ZodBigInt(__spreadProps(__spreadValues({}, this._def), {
1814
- checks: [
1815
- ...this._def.checks,
1816
- {
1817
- kind,
1818
- value,
1819
- inclusive,
1820
- message: errorUtil.toString(message)
1821
- }
1822
- ]
1823
- }));
1824
- }
1825
- _addCheck(check) {
1826
- return new _ZodBigInt(__spreadProps(__spreadValues({}, this._def), {
1827
- checks: [...this._def.checks, check]
1828
- }));
1829
- }
1830
- positive(message) {
1831
- return this._addCheck({
1832
- kind: "min",
1833
- value: BigInt(0),
1834
- inclusive: false,
1835
- message: errorUtil.toString(message)
1836
- });
1837
- }
1838
- negative(message) {
1839
- return this._addCheck({
1840
- kind: "max",
1841
- value: BigInt(0),
1842
- inclusive: false,
1843
- message: errorUtil.toString(message)
1844
- });
1845
- }
1846
- nonpositive(message) {
1847
- return this._addCheck({
1848
- kind: "max",
1849
- value: BigInt(0),
1850
- inclusive: true,
1851
- message: errorUtil.toString(message)
1852
- });
1853
- }
1854
- nonnegative(message) {
1855
- return this._addCheck({
1856
- kind: "min",
1857
- value: BigInt(0),
1858
- inclusive: true,
1859
- message: errorUtil.toString(message)
1860
- });
1861
- }
1862
- multipleOf(value, message) {
1863
- return this._addCheck({
1864
- kind: "multipleOf",
1865
- value,
1866
- message: errorUtil.toString(message)
1867
- });
1868
- }
1869
- get minValue() {
1870
- let min = null;
1871
- for (const ch of this._def.checks) {
1872
- if (ch.kind === "min") {
1873
- if (min === null || ch.value > min)
1874
- min = ch.value;
1875
- }
1876
- }
1877
- return min;
1878
- }
1879
- get maxValue() {
1880
- let max = null;
1881
- for (const ch of this._def.checks) {
1882
- if (ch.kind === "max") {
1883
- if (max === null || ch.value < max)
1884
- max = ch.value;
1885
- }
1886
- }
1887
- return max;
1888
- }
1889
- };
1890
- ZodBigInt.create = (params) => {
1891
- var _a;
1892
- return new ZodBigInt(__spreadValues({
1893
- checks: [],
1894
- typeName: ZodFirstPartyTypeKind.ZodBigInt,
1895
- coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false
1896
- }, processCreateParams(params)));
1897
- };
1898
- var ZodBoolean = class extends ZodType {
1899
- _parse(input) {
1900
- if (this._def.coerce) {
1901
- input.data = Boolean(input.data);
1902
- }
1903
- const parsedType = this._getType(input);
1904
- if (parsedType !== ZodParsedType.boolean) {
1905
- const ctx = this._getOrReturnCtx(input);
1906
- addIssueToContext(ctx, {
1907
- code: ZodIssueCode.invalid_type,
1908
- expected: ZodParsedType.boolean,
1909
- received: ctx.parsedType
1910
- });
1911
- return INVALID;
1912
- }
1913
- return OK(input.data);
1914
- }
1915
- };
1916
- ZodBoolean.create = (params) => {
1917
- return new ZodBoolean(__spreadValues({
1918
- typeName: ZodFirstPartyTypeKind.ZodBoolean,
1919
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false
1920
- }, processCreateParams(params)));
1921
- };
1922
- var ZodDate = class _ZodDate extends ZodType {
1923
- _parse(input) {
1924
- if (this._def.coerce) {
1925
- input.data = new Date(input.data);
1926
- }
1927
- const parsedType = this._getType(input);
1928
- if (parsedType !== ZodParsedType.date) {
1929
- const ctx2 = this._getOrReturnCtx(input);
1930
- addIssueToContext(ctx2, {
1931
- code: ZodIssueCode.invalid_type,
1932
- expected: ZodParsedType.date,
1933
- received: ctx2.parsedType
1934
- });
1935
- return INVALID;
1936
- }
1937
- if (isNaN(input.data.getTime())) {
1938
- const ctx2 = this._getOrReturnCtx(input);
1939
- addIssueToContext(ctx2, {
1940
- code: ZodIssueCode.invalid_date
1941
- });
1942
- return INVALID;
1943
- }
1944
- const status = new ParseStatus();
1945
- let ctx = void 0;
1946
- for (const check of this._def.checks) {
1947
- if (check.kind === "min") {
1948
- if (input.data.getTime() < check.value) {
1949
- ctx = this._getOrReturnCtx(input, ctx);
1950
- addIssueToContext(ctx, {
1951
- code: ZodIssueCode.too_small,
1952
- message: check.message,
1953
- inclusive: true,
1954
- exact: false,
1955
- minimum: check.value,
1956
- type: "date"
1957
- });
1958
- status.dirty();
1959
- }
1960
- } else if (check.kind === "max") {
1961
- if (input.data.getTime() > check.value) {
1962
- ctx = this._getOrReturnCtx(input, ctx);
1963
- addIssueToContext(ctx, {
1964
- code: ZodIssueCode.too_big,
1965
- message: check.message,
1966
- inclusive: true,
1967
- exact: false,
1968
- maximum: check.value,
1969
- type: "date"
1970
- });
1971
- status.dirty();
1972
- }
1973
- } else {
1974
- util.assertNever(check);
1975
- }
1976
- }
1977
- return {
1978
- status: status.value,
1979
- value: new Date(input.data.getTime())
1980
- };
1981
- }
1982
- _addCheck(check) {
1983
- return new _ZodDate(__spreadProps(__spreadValues({}, this._def), {
1984
- checks: [...this._def.checks, check]
1985
- }));
1986
- }
1987
- min(minDate, message) {
1988
- return this._addCheck({
1989
- kind: "min",
1990
- value: minDate.getTime(),
1991
- message: errorUtil.toString(message)
1992
- });
1993
- }
1994
- max(maxDate, message) {
1995
- return this._addCheck({
1996
- kind: "max",
1997
- value: maxDate.getTime(),
1998
- message: errorUtil.toString(message)
1999
- });
2000
- }
2001
- get minDate() {
2002
- let min = null;
2003
- for (const ch of this._def.checks) {
2004
- if (ch.kind === "min") {
2005
- if (min === null || ch.value > min)
2006
- min = ch.value;
2007
- }
2008
- }
2009
- return min != null ? new Date(min) : null;
2010
- }
2011
- get maxDate() {
2012
- let max = null;
2013
- for (const ch of this._def.checks) {
2014
- if (ch.kind === "max") {
2015
- if (max === null || ch.value < max)
2016
- max = ch.value;
2017
- }
2018
- }
2019
- return max != null ? new Date(max) : null;
2020
- }
2021
- };
2022
- ZodDate.create = (params) => {
2023
- return new ZodDate(__spreadValues({
2024
- checks: [],
2025
- coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
2026
- typeName: ZodFirstPartyTypeKind.ZodDate
2027
- }, processCreateParams(params)));
2028
- };
2029
- var ZodSymbol = class extends ZodType {
2030
- _parse(input) {
2031
- const parsedType = this._getType(input);
2032
- if (parsedType !== ZodParsedType.symbol) {
2033
- const ctx = this._getOrReturnCtx(input);
2034
- addIssueToContext(ctx, {
2035
- code: ZodIssueCode.invalid_type,
2036
- expected: ZodParsedType.symbol,
2037
- received: ctx.parsedType
2038
- });
2039
- return INVALID;
2040
- }
2041
- return OK(input.data);
2042
- }
2043
- };
2044
- ZodSymbol.create = (params) => {
2045
- return new ZodSymbol(__spreadValues({
2046
- typeName: ZodFirstPartyTypeKind.ZodSymbol
2047
- }, processCreateParams(params)));
2048
- };
2049
- var ZodUndefined = class extends ZodType {
2050
- _parse(input) {
2051
- const parsedType = this._getType(input);
2052
- if (parsedType !== ZodParsedType.undefined) {
2053
- const ctx = this._getOrReturnCtx(input);
2054
- addIssueToContext(ctx, {
2055
- code: ZodIssueCode.invalid_type,
2056
- expected: ZodParsedType.undefined,
2057
- received: ctx.parsedType
2058
- });
2059
- return INVALID;
2060
- }
2061
- return OK(input.data);
2062
- }
2063
- };
2064
- ZodUndefined.create = (params) => {
2065
- return new ZodUndefined(__spreadValues({
2066
- typeName: ZodFirstPartyTypeKind.ZodUndefined
2067
- }, processCreateParams(params)));
2068
- };
2069
- var ZodNull = class extends ZodType {
2070
- _parse(input) {
2071
- const parsedType = this._getType(input);
2072
- if (parsedType !== ZodParsedType.null) {
2073
- const ctx = this._getOrReturnCtx(input);
2074
- addIssueToContext(ctx, {
2075
- code: ZodIssueCode.invalid_type,
2076
- expected: ZodParsedType.null,
2077
- received: ctx.parsedType
2078
- });
2079
- return INVALID;
2080
- }
2081
- return OK(input.data);
2082
- }
2083
- };
2084
- ZodNull.create = (params) => {
2085
- return new ZodNull(__spreadValues({
2086
- typeName: ZodFirstPartyTypeKind.ZodNull
2087
- }, processCreateParams(params)));
2088
- };
2089
- var ZodAny = class extends ZodType {
2090
- constructor() {
2091
- super(...arguments);
2092
- this._any = true;
2093
- }
2094
- _parse(input) {
2095
- return OK(input.data);
2096
- }
2097
- };
2098
- ZodAny.create = (params) => {
2099
- return new ZodAny(__spreadValues({
2100
- typeName: ZodFirstPartyTypeKind.ZodAny
2101
- }, processCreateParams(params)));
2102
- };
2103
- var ZodUnknown = class extends ZodType {
2104
- constructor() {
2105
- super(...arguments);
2106
- this._unknown = true;
2107
- }
2108
- _parse(input) {
2109
- return OK(input.data);
2110
- }
2111
- };
2112
- ZodUnknown.create = (params) => {
2113
- return new ZodUnknown(__spreadValues({
2114
- typeName: ZodFirstPartyTypeKind.ZodUnknown
2115
- }, processCreateParams(params)));
2116
- };
2117
- var ZodNever = class extends ZodType {
2118
- _parse(input) {
2119
- const ctx = this._getOrReturnCtx(input);
2120
- addIssueToContext(ctx, {
2121
- code: ZodIssueCode.invalid_type,
2122
- expected: ZodParsedType.never,
2123
- received: ctx.parsedType
2124
- });
2125
- return INVALID;
2126
- }
2127
- };
2128
- ZodNever.create = (params) => {
2129
- return new ZodNever(__spreadValues({
2130
- typeName: ZodFirstPartyTypeKind.ZodNever
2131
- }, processCreateParams(params)));
2132
- };
2133
- var ZodVoid = class extends ZodType {
2134
- _parse(input) {
2135
- const parsedType = this._getType(input);
2136
- if (parsedType !== ZodParsedType.undefined) {
2137
- const ctx = this._getOrReturnCtx(input);
2138
- addIssueToContext(ctx, {
2139
- code: ZodIssueCode.invalid_type,
2140
- expected: ZodParsedType.void,
2141
- received: ctx.parsedType
2142
- });
2143
- return INVALID;
2144
- }
2145
- return OK(input.data);
2146
- }
2147
- };
2148
- ZodVoid.create = (params) => {
2149
- return new ZodVoid(__spreadValues({
2150
- typeName: ZodFirstPartyTypeKind.ZodVoid
2151
- }, processCreateParams(params)));
2152
- };
2153
- var ZodArray = class _ZodArray extends ZodType {
2154
- _parse(input) {
2155
- const { ctx, status } = this._processInputParams(input);
2156
- const def = this._def;
2157
- if (ctx.parsedType !== ZodParsedType.array) {
2158
- addIssueToContext(ctx, {
2159
- code: ZodIssueCode.invalid_type,
2160
- expected: ZodParsedType.array,
2161
- received: ctx.parsedType
2162
- });
2163
- return INVALID;
2164
- }
2165
- if (def.exactLength !== null) {
2166
- const tooBig = ctx.data.length > def.exactLength.value;
2167
- const tooSmall = ctx.data.length < def.exactLength.value;
2168
- if (tooBig || tooSmall) {
2169
- addIssueToContext(ctx, {
2170
- code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
2171
- minimum: tooSmall ? def.exactLength.value : void 0,
2172
- maximum: tooBig ? def.exactLength.value : void 0,
2173
- type: "array",
2174
- inclusive: true,
2175
- exact: true,
2176
- message: def.exactLength.message
2177
- });
2178
- status.dirty();
2179
- }
2180
- }
2181
- if (def.minLength !== null) {
2182
- if (ctx.data.length < def.minLength.value) {
2183
- addIssueToContext(ctx, {
2184
- code: ZodIssueCode.too_small,
2185
- minimum: def.minLength.value,
2186
- type: "array",
2187
- inclusive: true,
2188
- exact: false,
2189
- message: def.minLength.message
2190
- });
2191
- status.dirty();
2192
- }
2193
- }
2194
- if (def.maxLength !== null) {
2195
- if (ctx.data.length > def.maxLength.value) {
2196
- addIssueToContext(ctx, {
2197
- code: ZodIssueCode.too_big,
2198
- maximum: def.maxLength.value,
2199
- type: "array",
2200
- inclusive: true,
2201
- exact: false,
2202
- message: def.maxLength.message
2203
- });
2204
- status.dirty();
2205
- }
2206
- }
2207
- if (ctx.common.async) {
2208
- return Promise.all([...ctx.data].map((item, i) => {
2209
- return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2210
- })).then((result2) => {
2211
- return ParseStatus.mergeArray(status, result2);
2212
- });
2213
- }
2214
- const result = [...ctx.data].map((item, i) => {
2215
- return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2216
- });
2217
- return ParseStatus.mergeArray(status, result);
2218
- }
2219
- get element() {
2220
- return this._def.type;
2221
- }
2222
- min(minLength, message) {
2223
- return new _ZodArray(__spreadProps(__spreadValues({}, this._def), {
2224
- minLength: { value: minLength, message: errorUtil.toString(message) }
2225
- }));
2226
- }
2227
- max(maxLength, message) {
2228
- return new _ZodArray(__spreadProps(__spreadValues({}, this._def), {
2229
- maxLength: { value: maxLength, message: errorUtil.toString(message) }
2230
- }));
2231
- }
2232
- length(len, message) {
2233
- return new _ZodArray(__spreadProps(__spreadValues({}, this._def), {
2234
- exactLength: { value: len, message: errorUtil.toString(message) }
2235
- }));
2236
- }
2237
- nonempty(message) {
2238
- return this.min(1, message);
2239
- }
2240
- };
2241
- ZodArray.create = (schema, params) => {
2242
- return new ZodArray(__spreadValues({
2243
- type: schema,
2244
- minLength: null,
2245
- maxLength: null,
2246
- exactLength: null,
2247
- typeName: ZodFirstPartyTypeKind.ZodArray
2248
- }, processCreateParams(params)));
2249
- };
2250
- function deepPartialify(schema) {
2251
- if (schema instanceof ZodObject) {
2252
- const newShape = {};
2253
- for (const key in schema.shape) {
2254
- const fieldSchema = schema.shape[key];
2255
- newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
2256
- }
2257
- return new ZodObject(__spreadProps(__spreadValues({}, schema._def), {
2258
- shape: () => newShape
2259
- }));
2260
- } else if (schema instanceof ZodArray) {
2261
- return new ZodArray(__spreadProps(__spreadValues({}, schema._def), {
2262
- type: deepPartialify(schema.element)
2263
- }));
2264
- } else if (schema instanceof ZodOptional) {
2265
- return ZodOptional.create(deepPartialify(schema.unwrap()));
2266
- } else if (schema instanceof ZodNullable) {
2267
- return ZodNullable.create(deepPartialify(schema.unwrap()));
2268
- } else if (schema instanceof ZodTuple) {
2269
- return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
2270
- } else {
2271
- return schema;
2272
- }
2273
- }
2274
- var ZodObject = class _ZodObject extends ZodType {
2275
- constructor() {
2276
- super(...arguments);
2277
- this._cached = null;
2278
- this.nonstrict = this.passthrough;
2279
- this.augment = this.extend;
2280
- }
2281
- _getCached() {
2282
- if (this._cached !== null)
2283
- return this._cached;
2284
- const shape = this._def.shape();
2285
- const keys = util.objectKeys(shape);
2286
- return this._cached = { shape, keys };
2287
- }
2288
- _parse(input) {
2289
- const parsedType = this._getType(input);
2290
- if (parsedType !== ZodParsedType.object) {
2291
- const ctx2 = this._getOrReturnCtx(input);
2292
- addIssueToContext(ctx2, {
2293
- code: ZodIssueCode.invalid_type,
2294
- expected: ZodParsedType.object,
2295
- received: ctx2.parsedType
2296
- });
2297
- return INVALID;
2298
- }
2299
- const { status, ctx } = this._processInputParams(input);
2300
- const { shape, keys: shapeKeys } = this._getCached();
2301
- const extraKeys = [];
2302
- if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
2303
- for (const key in ctx.data) {
2304
- if (!shapeKeys.includes(key)) {
2305
- extraKeys.push(key);
2306
- }
2307
- }
2308
- }
2309
- const pairs = [];
2310
- for (const key of shapeKeys) {
2311
- const keyValidator = shape[key];
2312
- const value = ctx.data[key];
2313
- pairs.push({
2314
- key: { status: "valid", value: key },
2315
- value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
2316
- alwaysSet: key in ctx.data
2317
- });
2318
- }
2319
- if (this._def.catchall instanceof ZodNever) {
2320
- const unknownKeys = this._def.unknownKeys;
2321
- if (unknownKeys === "passthrough") {
2322
- for (const key of extraKeys) {
2323
- pairs.push({
2324
- key: { status: "valid", value: key },
2325
- value: { status: "valid", value: ctx.data[key] }
2326
- });
2327
- }
2328
- } else if (unknownKeys === "strict") {
2329
- if (extraKeys.length > 0) {
2330
- addIssueToContext(ctx, {
2331
- code: ZodIssueCode.unrecognized_keys,
2332
- keys: extraKeys
2333
- });
2334
- status.dirty();
2335
- }
2336
- } else if (unknownKeys === "strip") ;
2337
- else {
2338
- throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
2339
- }
2340
- } else {
2341
- const catchall = this._def.catchall;
2342
- for (const key of extraKeys) {
2343
- const value = ctx.data[key];
2344
- pairs.push({
2345
- key: { status: "valid", value: key },
2346
- value: catchall._parse(
2347
- new ParseInputLazyPath(ctx, value, ctx.path, key)
2348
- //, ctx.child(key), value, getParsedType(value)
2349
- ),
2350
- alwaysSet: key in ctx.data
2351
- });
2352
- }
2353
- }
2354
- if (ctx.common.async) {
2355
- return Promise.resolve().then(() => __async(this, null, function* () {
2356
- const syncPairs = [];
2357
- for (const pair of pairs) {
2358
- const key = yield pair.key;
2359
- const value = yield pair.value;
2360
- syncPairs.push({
2361
- key,
2362
- value,
2363
- alwaysSet: pair.alwaysSet
2364
- });
2365
- }
2366
- return syncPairs;
2367
- })).then((syncPairs) => {
2368
- return ParseStatus.mergeObjectSync(status, syncPairs);
2369
- });
2370
- } else {
2371
- return ParseStatus.mergeObjectSync(status, pairs);
2372
- }
2373
- }
2374
- get shape() {
2375
- return this._def.shape();
2376
- }
2377
- strict(message) {
2378
- errorUtil.errToObj;
2379
- return new _ZodObject(__spreadValues(__spreadProps(__spreadValues({}, this._def), {
2380
- unknownKeys: "strict"
2381
- }), message !== void 0 ? {
2382
- errorMap: (issue, ctx) => {
2383
- var _a, _b, _c, _d;
2384
- const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;
2385
- if (issue.code === "unrecognized_keys")
2386
- return {
2387
- message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError
2388
- };
2389
- return {
2390
- message: defaultError
2391
- };
2392
- }
2393
- } : {}));
2394
- }
2395
- strip() {
2396
- return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
2397
- unknownKeys: "strip"
2398
- }));
2399
- }
2400
- passthrough() {
2401
- return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
2402
- unknownKeys: "passthrough"
2403
- }));
2404
- }
2405
- // const AugmentFactory =
2406
- // <Def extends ZodObjectDef>(def: Def) =>
2407
- // <Augmentation extends ZodRawShape>(
2408
- // augmentation: Augmentation
2409
- // ): ZodObject<
2410
- // extendShape<ReturnType<Def["shape"]>, Augmentation>,
2411
- // Def["unknownKeys"],
2412
- // Def["catchall"]
2413
- // > => {
2414
- // return new ZodObject({
2415
- // ...def,
2416
- // shape: () => ({
2417
- // ...def.shape(),
2418
- // ...augmentation,
2419
- // }),
2420
- // }) as any;
2421
- // };
2422
- extend(augmentation) {
2423
- return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
2424
- shape: () => __spreadValues(__spreadValues({}, this._def.shape()), augmentation)
2425
- }));
2426
- }
2427
- /**
2428
- * Prior to zod@1.0.12 there was a bug in the
2429
- * inferred type of merged objects. Please
2430
- * upgrade if you are experiencing issues.
2431
- */
2432
- merge(merging) {
2433
- const merged = new _ZodObject({
2434
- unknownKeys: merging._def.unknownKeys,
2435
- catchall: merging._def.catchall,
2436
- shape: () => __spreadValues(__spreadValues({}, this._def.shape()), merging._def.shape()),
2437
- typeName: ZodFirstPartyTypeKind.ZodObject
2438
- });
2439
- return merged;
2440
- }
2441
- // merge<
2442
- // Incoming extends AnyZodObject,
2443
- // Augmentation extends Incoming["shape"],
2444
- // NewOutput extends {
2445
- // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
2446
- // ? Augmentation[k]["_output"]
2447
- // : k extends keyof Output
2448
- // ? Output[k]
2449
- // : never;
2450
- // },
2451
- // NewInput extends {
2452
- // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
2453
- // ? Augmentation[k]["_input"]
2454
- // : k extends keyof Input
2455
- // ? Input[k]
2456
- // : never;
2457
- // }
2458
- // >(
2459
- // merging: Incoming
2460
- // ): ZodObject<
2461
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2462
- // Incoming["_def"]["unknownKeys"],
2463
- // Incoming["_def"]["catchall"],
2464
- // NewOutput,
2465
- // NewInput
2466
- // > {
2467
- // const merged: any = new ZodObject({
2468
- // unknownKeys: merging._def.unknownKeys,
2469
- // catchall: merging._def.catchall,
2470
- // shape: () =>
2471
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2472
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2473
- // }) as any;
2474
- // return merged;
2475
- // }
2476
- setKey(key, schema) {
2477
- return this.augment({ [key]: schema });
2478
- }
2479
- // merge<Incoming extends AnyZodObject>(
2480
- // merging: Incoming
2481
- // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
2482
- // ZodObject<
2483
- // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
2484
- // Incoming["_def"]["unknownKeys"],
2485
- // Incoming["_def"]["catchall"]
2486
- // > {
2487
- // // const mergedShape = objectUtil.mergeShapes(
2488
- // // this._def.shape(),
2489
- // // merging._def.shape()
2490
- // // );
2491
- // const merged: any = new ZodObject({
2492
- // unknownKeys: merging._def.unknownKeys,
2493
- // catchall: merging._def.catchall,
2494
- // shape: () =>
2495
- // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
2496
- // typeName: ZodFirstPartyTypeKind.ZodObject,
2497
- // }) as any;
2498
- // return merged;
2499
- // }
2500
- catchall(index) {
2501
- return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
2502
- catchall: index
2503
- }));
2504
- }
2505
- pick(mask) {
2506
- const shape = {};
2507
- util.objectKeys(mask).forEach((key) => {
2508
- if (mask[key] && this.shape[key]) {
2509
- shape[key] = this.shape[key];
2510
- }
2511
- });
2512
- return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
2513
- shape: () => shape
2514
- }));
2515
- }
2516
- omit(mask) {
2517
- const shape = {};
2518
- util.objectKeys(this.shape).forEach((key) => {
2519
- if (!mask[key]) {
2520
- shape[key] = this.shape[key];
2521
- }
2522
- });
2523
- return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
2524
- shape: () => shape
2525
- }));
2526
- }
2527
- /**
2528
- * @deprecated
2529
- */
2530
- deepPartial() {
2531
- return deepPartialify(this);
2532
- }
2533
- partial(mask) {
2534
- const newShape = {};
2535
- util.objectKeys(this.shape).forEach((key) => {
2536
- const fieldSchema = this.shape[key];
2537
- if (mask && !mask[key]) {
2538
- newShape[key] = fieldSchema;
2539
- } else {
2540
- newShape[key] = fieldSchema.optional();
2541
- }
2542
- });
2543
- return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
2544
- shape: () => newShape
2545
- }));
2546
- }
2547
- required(mask) {
2548
- const newShape = {};
2549
- util.objectKeys(this.shape).forEach((key) => {
2550
- if (mask && !mask[key]) {
2551
- newShape[key] = this.shape[key];
2552
- } else {
2553
- const fieldSchema = this.shape[key];
2554
- let newField = fieldSchema;
2555
- while (newField instanceof ZodOptional) {
2556
- newField = newField._def.innerType;
2557
- }
2558
- newShape[key] = newField;
2559
- }
2560
- });
2561
- return new _ZodObject(__spreadProps(__spreadValues({}, this._def), {
2562
- shape: () => newShape
2563
- }));
2564
- }
2565
- keyof() {
2566
- return createZodEnum(util.objectKeys(this.shape));
2567
- }
2568
- };
2569
- ZodObject.create = (shape, params) => {
2570
- return new ZodObject(__spreadValues({
2571
- shape: () => shape,
2572
- unknownKeys: "strip",
2573
- catchall: ZodNever.create(),
2574
- typeName: ZodFirstPartyTypeKind.ZodObject
2575
- }, processCreateParams(params)));
2576
- };
2577
- ZodObject.strictCreate = (shape, params) => {
2578
- return new ZodObject(__spreadValues({
2579
- shape: () => shape,
2580
- unknownKeys: "strict",
2581
- catchall: ZodNever.create(),
2582
- typeName: ZodFirstPartyTypeKind.ZodObject
2583
- }, processCreateParams(params)));
2584
- };
2585
- ZodObject.lazycreate = (shape, params) => {
2586
- return new ZodObject(__spreadValues({
2587
- shape,
2588
- unknownKeys: "strip",
2589
- catchall: ZodNever.create(),
2590
- typeName: ZodFirstPartyTypeKind.ZodObject
2591
- }, processCreateParams(params)));
2592
- };
2593
- var ZodUnion = class extends ZodType {
2594
- _parse(input) {
2595
- const { ctx } = this._processInputParams(input);
2596
- const options = this._def.options;
2597
- function handleResults(results) {
2598
- for (const result of results) {
2599
- if (result.result.status === "valid") {
2600
- return result.result;
2601
- }
2602
- }
2603
- for (const result of results) {
2604
- if (result.result.status === "dirty") {
2605
- ctx.common.issues.push(...result.ctx.common.issues);
2606
- return result.result;
2607
- }
2608
- }
2609
- const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
2610
- addIssueToContext(ctx, {
2611
- code: ZodIssueCode.invalid_union,
2612
- unionErrors
2613
- });
2614
- return INVALID;
2615
- }
2616
- if (ctx.common.async) {
2617
- return Promise.all(options.map((option) => __async(this, null, function* () {
2618
- const childCtx = __spreadProps(__spreadValues({}, ctx), {
2619
- common: __spreadProps(__spreadValues({}, ctx.common), {
2620
- issues: []
2621
- }),
2622
- parent: null
2623
- });
2624
- return {
2625
- result: yield option._parseAsync({
2626
- data: ctx.data,
2627
- path: ctx.path,
2628
- parent: childCtx
2629
- }),
2630
- ctx: childCtx
2631
- };
2632
- }))).then(handleResults);
2633
- } else {
2634
- let dirty = void 0;
2635
- const issues = [];
2636
- for (const option of options) {
2637
- const childCtx = __spreadProps(__spreadValues({}, ctx), {
2638
- common: __spreadProps(__spreadValues({}, ctx.common), {
2639
- issues: []
2640
- }),
2641
- parent: null
2642
- });
2643
- const result = option._parseSync({
2644
- data: ctx.data,
2645
- path: ctx.path,
2646
- parent: childCtx
2647
- });
2648
- if (result.status === "valid") {
2649
- return result;
2650
- } else if (result.status === "dirty" && !dirty) {
2651
- dirty = { result, ctx: childCtx };
2652
- }
2653
- if (childCtx.common.issues.length) {
2654
- issues.push(childCtx.common.issues);
2655
- }
2656
- }
2657
- if (dirty) {
2658
- ctx.common.issues.push(...dirty.ctx.common.issues);
2659
- return dirty.result;
2660
- }
2661
- const unionErrors = issues.map((issues2) => new ZodError(issues2));
2662
- addIssueToContext(ctx, {
2663
- code: ZodIssueCode.invalid_union,
2664
- unionErrors
2665
- });
2666
- return INVALID;
2667
- }
2668
- }
2669
- get options() {
2670
- return this._def.options;
2671
- }
2672
- };
2673
- ZodUnion.create = (types, params) => {
2674
- return new ZodUnion(__spreadValues({
2675
- options: types,
2676
- typeName: ZodFirstPartyTypeKind.ZodUnion
2677
- }, processCreateParams(params)));
2678
- };
2679
- var getDiscriminator = (type) => {
2680
- if (type instanceof ZodLazy) {
2681
- return getDiscriminator(type.schema);
2682
- } else if (type instanceof ZodEffects) {
2683
- return getDiscriminator(type.innerType());
2684
- } else if (type instanceof ZodLiteral) {
2685
- return [type.value];
2686
- } else if (type instanceof ZodEnum) {
2687
- return type.options;
2688
- } else if (type instanceof ZodNativeEnum) {
2689
- return util.objectValues(type.enum);
2690
- } else if (type instanceof ZodDefault) {
2691
- return getDiscriminator(type._def.innerType);
2692
- } else if (type instanceof ZodUndefined) {
2693
- return [void 0];
2694
- } else if (type instanceof ZodNull) {
2695
- return [null];
2696
- } else if (type instanceof ZodOptional) {
2697
- return [void 0, ...getDiscriminator(type.unwrap())];
2698
- } else if (type instanceof ZodNullable) {
2699
- return [null, ...getDiscriminator(type.unwrap())];
2700
- } else if (type instanceof ZodBranded) {
2701
- return getDiscriminator(type.unwrap());
2702
- } else if (type instanceof ZodReadonly) {
2703
- return getDiscriminator(type.unwrap());
2704
- } else if (type instanceof ZodCatch) {
2705
- return getDiscriminator(type._def.innerType);
2706
- } else {
2707
- return [];
2708
- }
2709
- };
2710
- var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
2711
- _parse(input) {
2712
- const { ctx } = this._processInputParams(input);
2713
- if (ctx.parsedType !== ZodParsedType.object) {
2714
- addIssueToContext(ctx, {
2715
- code: ZodIssueCode.invalid_type,
2716
- expected: ZodParsedType.object,
2717
- received: ctx.parsedType
2718
- });
2719
- return INVALID;
2720
- }
2721
- const discriminator = this.discriminator;
2722
- const discriminatorValue = ctx.data[discriminator];
2723
- const option = this.optionsMap.get(discriminatorValue);
2724
- if (!option) {
2725
- addIssueToContext(ctx, {
2726
- code: ZodIssueCode.invalid_union_discriminator,
2727
- options: Array.from(this.optionsMap.keys()),
2728
- path: [discriminator]
2729
- });
2730
- return INVALID;
2731
- }
2732
- if (ctx.common.async) {
2733
- return option._parseAsync({
2734
- data: ctx.data,
2735
- path: ctx.path,
2736
- parent: ctx
2737
- });
2738
- } else {
2739
- return option._parseSync({
2740
- data: ctx.data,
2741
- path: ctx.path,
2742
- parent: ctx
2743
- });
2744
- }
2745
- }
2746
- get discriminator() {
2747
- return this._def.discriminator;
2748
- }
2749
- get options() {
2750
- return this._def.options;
2751
- }
2752
- get optionsMap() {
2753
- return this._def.optionsMap;
2754
- }
2755
- /**
2756
- * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
2757
- * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
2758
- * have a different value for each object in the union.
2759
- * @param discriminator the name of the discriminator property
2760
- * @param types an array of object schemas
2761
- * @param params
2762
- */
2763
- static create(discriminator, options, params) {
2764
- const optionsMap = /* @__PURE__ */ new Map();
2765
- for (const type of options) {
2766
- const discriminatorValues = getDiscriminator(type.shape[discriminator]);
2767
- if (!discriminatorValues.length) {
2768
- throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
2769
- }
2770
- for (const value of discriminatorValues) {
2771
- if (optionsMap.has(value)) {
2772
- throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
2773
- }
2774
- optionsMap.set(value, type);
2775
- }
2776
- }
2777
- return new _ZodDiscriminatedUnion(__spreadValues({
2778
- typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
2779
- discriminator,
2780
- options,
2781
- optionsMap
2782
- }, processCreateParams(params)));
2783
- }
2784
- };
2785
- function mergeValues(a, b) {
2786
- const aType = getParsedType(a);
2787
- const bType = getParsedType(b);
2788
- if (a === b) {
2789
- return { valid: true, data: a };
2790
- } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
2791
- const bKeys = util.objectKeys(b);
2792
- const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2793
- const newObj = __spreadValues(__spreadValues({}, a), b);
2794
- for (const key of sharedKeys) {
2795
- const sharedValue = mergeValues(a[key], b[key]);
2796
- if (!sharedValue.valid) {
2797
- return { valid: false };
2798
- }
2799
- newObj[key] = sharedValue.data;
2800
- }
2801
- return { valid: true, data: newObj };
2802
- } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
2803
- if (a.length !== b.length) {
2804
- return { valid: false };
2805
- }
2806
- const newArray = [];
2807
- for (let index = 0; index < a.length; index++) {
2808
- const itemA = a[index];
2809
- const itemB = b[index];
2810
- const sharedValue = mergeValues(itemA, itemB);
2811
- if (!sharedValue.valid) {
2812
- return { valid: false };
2813
- }
2814
- newArray.push(sharedValue.data);
2815
- }
2816
- return { valid: true, data: newArray };
2817
- } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
2818
- return { valid: true, data: a };
2819
- } else {
2820
- return { valid: false };
2821
- }
2822
- }
2823
- var ZodIntersection = class extends ZodType {
2824
- _parse(input) {
2825
- const { status, ctx } = this._processInputParams(input);
2826
- const handleParsed = (parsedLeft, parsedRight) => {
2827
- if (isAborted(parsedLeft) || isAborted(parsedRight)) {
2828
- return INVALID;
2829
- }
2830
- const merged = mergeValues(parsedLeft.value, parsedRight.value);
2831
- if (!merged.valid) {
2832
- addIssueToContext(ctx, {
2833
- code: ZodIssueCode.invalid_intersection_types
2834
- });
2835
- return INVALID;
2836
- }
2837
- if (isDirty(parsedLeft) || isDirty(parsedRight)) {
2838
- status.dirty();
2839
- }
2840
- return { status: status.value, value: merged.data };
2841
- };
2842
- if (ctx.common.async) {
2843
- return Promise.all([
2844
- this._def.left._parseAsync({
2845
- data: ctx.data,
2846
- path: ctx.path,
2847
- parent: ctx
2848
- }),
2849
- this._def.right._parseAsync({
2850
- data: ctx.data,
2851
- path: ctx.path,
2852
- parent: ctx
2853
- })
2854
- ]).then(([left, right]) => handleParsed(left, right));
2855
- } else {
2856
- return handleParsed(this._def.left._parseSync({
2857
- data: ctx.data,
2858
- path: ctx.path,
2859
- parent: ctx
2860
- }), this._def.right._parseSync({
2861
- data: ctx.data,
2862
- path: ctx.path,
2863
- parent: ctx
2864
- }));
2865
- }
2866
- }
2867
- };
2868
- ZodIntersection.create = (left, right, params) => {
2869
- return new ZodIntersection(__spreadValues({
2870
- left,
2871
- right,
2872
- typeName: ZodFirstPartyTypeKind.ZodIntersection
2873
- }, processCreateParams(params)));
2874
- };
2875
- var ZodTuple = class _ZodTuple extends ZodType {
2876
- _parse(input) {
2877
- const { status, ctx } = this._processInputParams(input);
2878
- if (ctx.parsedType !== ZodParsedType.array) {
2879
- addIssueToContext(ctx, {
2880
- code: ZodIssueCode.invalid_type,
2881
- expected: ZodParsedType.array,
2882
- received: ctx.parsedType
2883
- });
2884
- return INVALID;
2885
- }
2886
- if (ctx.data.length < this._def.items.length) {
2887
- addIssueToContext(ctx, {
2888
- code: ZodIssueCode.too_small,
2889
- minimum: this._def.items.length,
2890
- inclusive: true,
2891
- exact: false,
2892
- type: "array"
2893
- });
2894
- return INVALID;
2895
- }
2896
- const rest = this._def.rest;
2897
- if (!rest && ctx.data.length > this._def.items.length) {
2898
- addIssueToContext(ctx, {
2899
- code: ZodIssueCode.too_big,
2900
- maximum: this._def.items.length,
2901
- inclusive: true,
2902
- exact: false,
2903
- type: "array"
2904
- });
2905
- status.dirty();
2906
- }
2907
- const items = [...ctx.data].map((item, itemIndex) => {
2908
- const schema = this._def.items[itemIndex] || this._def.rest;
2909
- if (!schema)
2910
- return null;
2911
- return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
2912
- }).filter((x) => !!x);
2913
- if (ctx.common.async) {
2914
- return Promise.all(items).then((results) => {
2915
- return ParseStatus.mergeArray(status, results);
2916
- });
2917
- } else {
2918
- return ParseStatus.mergeArray(status, items);
2919
- }
2920
- }
2921
- get items() {
2922
- return this._def.items;
2923
- }
2924
- rest(rest) {
2925
- return new _ZodTuple(__spreadProps(__spreadValues({}, this._def), {
2926
- rest
2927
- }));
2928
- }
2929
- };
2930
- ZodTuple.create = (schemas, params) => {
2931
- if (!Array.isArray(schemas)) {
2932
- throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
2933
- }
2934
- return new ZodTuple(__spreadValues({
2935
- items: schemas,
2936
- typeName: ZodFirstPartyTypeKind.ZodTuple,
2937
- rest: null
2938
- }, processCreateParams(params)));
2939
- };
2940
- var ZodRecord = class _ZodRecord extends ZodType {
2941
- get keySchema() {
2942
- return this._def.keyType;
2943
- }
2944
- get valueSchema() {
2945
- return this._def.valueType;
2946
- }
2947
- _parse(input) {
2948
- const { status, ctx } = this._processInputParams(input);
2949
- if (ctx.parsedType !== ZodParsedType.object) {
2950
- addIssueToContext(ctx, {
2951
- code: ZodIssueCode.invalid_type,
2952
- expected: ZodParsedType.object,
2953
- received: ctx.parsedType
2954
- });
2955
- return INVALID;
2956
- }
2957
- const pairs = [];
2958
- const keyType = this._def.keyType;
2959
- const valueType = this._def.valueType;
2960
- for (const key in ctx.data) {
2961
- pairs.push({
2962
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
2963
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
2964
- alwaysSet: key in ctx.data
2965
- });
2966
- }
2967
- if (ctx.common.async) {
2968
- return ParseStatus.mergeObjectAsync(status, pairs);
2969
- } else {
2970
- return ParseStatus.mergeObjectSync(status, pairs);
2971
- }
2972
- }
2973
- get element() {
2974
- return this._def.valueType;
2975
- }
2976
- static create(first, second, third) {
2977
- if (second instanceof ZodType) {
2978
- return new _ZodRecord(__spreadValues({
2979
- keyType: first,
2980
- valueType: second,
2981
- typeName: ZodFirstPartyTypeKind.ZodRecord
2982
- }, processCreateParams(third)));
2983
- }
2984
- return new _ZodRecord(__spreadValues({
2985
- keyType: ZodString.create(),
2986
- valueType: first,
2987
- typeName: ZodFirstPartyTypeKind.ZodRecord
2988
- }, processCreateParams(second)));
2989
- }
2990
- };
2991
- var ZodMap = class extends ZodType {
2992
- get keySchema() {
2993
- return this._def.keyType;
2994
- }
2995
- get valueSchema() {
2996
- return this._def.valueType;
2997
- }
2998
- _parse(input) {
2999
- const { status, ctx } = this._processInputParams(input);
3000
- if (ctx.parsedType !== ZodParsedType.map) {
3001
- addIssueToContext(ctx, {
3002
- code: ZodIssueCode.invalid_type,
3003
- expected: ZodParsedType.map,
3004
- received: ctx.parsedType
3005
- });
3006
- return INVALID;
3007
- }
3008
- const keyType = this._def.keyType;
3009
- const valueType = this._def.valueType;
3010
- const pairs = [...ctx.data.entries()].map(([key, value], index) => {
3011
- return {
3012
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
3013
- value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
3014
- };
3015
- });
3016
- if (ctx.common.async) {
3017
- const finalMap = /* @__PURE__ */ new Map();
3018
- return Promise.resolve().then(() => __async(this, null, function* () {
3019
- for (const pair of pairs) {
3020
- const key = yield pair.key;
3021
- const value = yield pair.value;
3022
- if (key.status === "aborted" || value.status === "aborted") {
3023
- return INVALID;
3024
- }
3025
- if (key.status === "dirty" || value.status === "dirty") {
3026
- status.dirty();
3027
- }
3028
- finalMap.set(key.value, value.value);
3029
- }
3030
- return { status: status.value, value: finalMap };
3031
- }));
3032
- } else {
3033
- const finalMap = /* @__PURE__ */ new Map();
3034
- for (const pair of pairs) {
3035
- const key = pair.key;
3036
- const value = pair.value;
3037
- if (key.status === "aborted" || value.status === "aborted") {
3038
- return INVALID;
3039
- }
3040
- if (key.status === "dirty" || value.status === "dirty") {
3041
- status.dirty();
3042
- }
3043
- finalMap.set(key.value, value.value);
3044
- }
3045
- return { status: status.value, value: finalMap };
3046
- }
3047
- }
3048
- };
3049
- ZodMap.create = (keyType, valueType, params) => {
3050
- return new ZodMap(__spreadValues({
3051
- valueType,
3052
- keyType,
3053
- typeName: ZodFirstPartyTypeKind.ZodMap
3054
- }, processCreateParams(params)));
3055
- };
3056
- var ZodSet = class _ZodSet extends ZodType {
3057
- _parse(input) {
3058
- const { status, ctx } = this._processInputParams(input);
3059
- if (ctx.parsedType !== ZodParsedType.set) {
3060
- addIssueToContext(ctx, {
3061
- code: ZodIssueCode.invalid_type,
3062
- expected: ZodParsedType.set,
3063
- received: ctx.parsedType
3064
- });
3065
- return INVALID;
3066
- }
3067
- const def = this._def;
3068
- if (def.minSize !== null) {
3069
- if (ctx.data.size < def.minSize.value) {
3070
- addIssueToContext(ctx, {
3071
- code: ZodIssueCode.too_small,
3072
- minimum: def.minSize.value,
3073
- type: "set",
3074
- inclusive: true,
3075
- exact: false,
3076
- message: def.minSize.message
3077
- });
3078
- status.dirty();
3079
- }
3080
- }
3081
- if (def.maxSize !== null) {
3082
- if (ctx.data.size > def.maxSize.value) {
3083
- addIssueToContext(ctx, {
3084
- code: ZodIssueCode.too_big,
3085
- maximum: def.maxSize.value,
3086
- type: "set",
3087
- inclusive: true,
3088
- exact: false,
3089
- message: def.maxSize.message
3090
- });
3091
- status.dirty();
3092
- }
3093
- }
3094
- const valueType = this._def.valueType;
3095
- function finalizeSet(elements2) {
3096
- const parsedSet = /* @__PURE__ */ new Set();
3097
- for (const element of elements2) {
3098
- if (element.status === "aborted")
3099
- return INVALID;
3100
- if (element.status === "dirty")
3101
- status.dirty();
3102
- parsedSet.add(element.value);
3103
- }
3104
- return { status: status.value, value: parsedSet };
3105
- }
3106
- const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
3107
- if (ctx.common.async) {
3108
- return Promise.all(elements).then((elements2) => finalizeSet(elements2));
3109
- } else {
3110
- return finalizeSet(elements);
3111
- }
3112
- }
3113
- min(minSize, message) {
3114
- return new _ZodSet(__spreadProps(__spreadValues({}, this._def), {
3115
- minSize: { value: minSize, message: errorUtil.toString(message) }
3116
- }));
3117
- }
3118
- max(maxSize, message) {
3119
- return new _ZodSet(__spreadProps(__spreadValues({}, this._def), {
3120
- maxSize: { value: maxSize, message: errorUtil.toString(message) }
3121
- }));
3122
- }
3123
- size(size, message) {
3124
- return this.min(size, message).max(size, message);
3125
- }
3126
- nonempty(message) {
3127
- return this.min(1, message);
3128
- }
3129
- };
3130
- ZodSet.create = (valueType, params) => {
3131
- return new ZodSet(__spreadValues({
3132
- valueType,
3133
- minSize: null,
3134
- maxSize: null,
3135
- typeName: ZodFirstPartyTypeKind.ZodSet
3136
- }, processCreateParams(params)));
3137
- };
3138
- var ZodFunction = class _ZodFunction extends ZodType {
3139
- constructor() {
3140
- super(...arguments);
3141
- this.validate = this.implement;
3142
- }
3143
- _parse(input) {
3144
- const { ctx } = this._processInputParams(input);
3145
- if (ctx.parsedType !== ZodParsedType.function) {
3146
- addIssueToContext(ctx, {
3147
- code: ZodIssueCode.invalid_type,
3148
- expected: ZodParsedType.function,
3149
- received: ctx.parsedType
3150
- });
3151
- return INVALID;
3152
- }
3153
- function makeArgsIssue(args, error) {
3154
- return makeIssue({
3155
- data: args,
3156
- path: ctx.path,
3157
- errorMaps: [
3158
- ctx.common.contextualErrorMap,
3159
- ctx.schemaErrorMap,
3160
- getErrorMap(),
3161
- errorMap
3162
- ].filter((x) => !!x),
3163
- issueData: {
3164
- code: ZodIssueCode.invalid_arguments,
3165
- argumentsError: error
3166
- }
3167
- });
3168
- }
3169
- function makeReturnsIssue(returns, error) {
3170
- return makeIssue({
3171
- data: returns,
3172
- path: ctx.path,
3173
- errorMaps: [
3174
- ctx.common.contextualErrorMap,
3175
- ctx.schemaErrorMap,
3176
- getErrorMap(),
3177
- errorMap
3178
- ].filter((x) => !!x),
3179
- issueData: {
3180
- code: ZodIssueCode.invalid_return_type,
3181
- returnTypeError: error
3182
- }
3183
- });
3184
- }
3185
- const params = { errorMap: ctx.common.contextualErrorMap };
3186
- const fn = ctx.data;
3187
- if (this._def.returns instanceof ZodPromise) {
3188
- const me = this;
3189
- return OK(function(...args) {
3190
- return __async(this, null, function* () {
3191
- const error = new ZodError([]);
3192
- const parsedArgs = yield me._def.args.parseAsync(args, params).catch((e) => {
3193
- error.addIssue(makeArgsIssue(args, e));
3194
- throw error;
3195
- });
3196
- const result = yield Reflect.apply(fn, this, parsedArgs);
3197
- const parsedReturns = yield me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3198
- error.addIssue(makeReturnsIssue(result, e));
3199
- throw error;
3200
- });
3201
- return parsedReturns;
3202
- });
3203
- });
3204
- } else {
3205
- const me = this;
3206
- return OK(function(...args) {
3207
- const parsedArgs = me._def.args.safeParse(args, params);
3208
- if (!parsedArgs.success) {
3209
- throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3210
- }
3211
- const result = Reflect.apply(fn, this, parsedArgs.data);
3212
- const parsedReturns = me._def.returns.safeParse(result, params);
3213
- if (!parsedReturns.success) {
3214
- throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3215
- }
3216
- return parsedReturns.data;
3217
- });
3218
- }
3219
- }
3220
- parameters() {
3221
- return this._def.args;
3222
- }
3223
- returnType() {
3224
- return this._def.returns;
3225
- }
3226
- args(...items) {
3227
- return new _ZodFunction(__spreadProps(__spreadValues({}, this._def), {
3228
- args: ZodTuple.create(items).rest(ZodUnknown.create())
3229
- }));
3230
- }
3231
- returns(returnType) {
3232
- return new _ZodFunction(__spreadProps(__spreadValues({}, this._def), {
3233
- returns: returnType
3234
- }));
3235
- }
3236
- implement(func) {
3237
- const validatedFunc = this.parse(func);
3238
- return validatedFunc;
3239
- }
3240
- strictImplement(func) {
3241
- const validatedFunc = this.parse(func);
3242
- return validatedFunc;
3243
- }
3244
- static create(args, returns, params) {
3245
- return new _ZodFunction(__spreadValues({
3246
- args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
3247
- returns: returns || ZodUnknown.create(),
3248
- typeName: ZodFirstPartyTypeKind.ZodFunction
3249
- }, processCreateParams(params)));
3250
- }
3251
- };
3252
- var ZodLazy = class extends ZodType {
3253
- get schema() {
3254
- return this._def.getter();
3255
- }
3256
- _parse(input) {
3257
- const { ctx } = this._processInputParams(input);
3258
- const lazySchema = this._def.getter();
3259
- return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
3260
- }
3261
- };
3262
- ZodLazy.create = (getter, params) => {
3263
- return new ZodLazy(__spreadValues({
3264
- getter,
3265
- typeName: ZodFirstPartyTypeKind.ZodLazy
3266
- }, processCreateParams(params)));
3267
- };
3268
- var ZodLiteral = class extends ZodType {
3269
- _parse(input) {
3270
- if (input.data !== this._def.value) {
3271
- const ctx = this._getOrReturnCtx(input);
3272
- addIssueToContext(ctx, {
3273
- received: ctx.data,
3274
- code: ZodIssueCode.invalid_literal,
3275
- expected: this._def.value
3276
- });
3277
- return INVALID;
3278
- }
3279
- return { status: "valid", value: input.data };
3280
- }
3281
- get value() {
3282
- return this._def.value;
3283
- }
3284
- };
3285
- ZodLiteral.create = (value, params) => {
3286
- return new ZodLiteral(__spreadValues({
3287
- value,
3288
- typeName: ZodFirstPartyTypeKind.ZodLiteral
3289
- }, processCreateParams(params)));
3290
- };
3291
- function createZodEnum(values, params) {
3292
- return new ZodEnum(__spreadValues({
3293
- values,
3294
- typeName: ZodFirstPartyTypeKind.ZodEnum
3295
- }, processCreateParams(params)));
3296
- }
3297
- var ZodEnum = class _ZodEnum extends ZodType {
3298
- constructor() {
3299
- super(...arguments);
3300
- _ZodEnum_cache.set(this, void 0);
3301
- }
3302
- _parse(input) {
3303
- if (typeof input.data !== "string") {
3304
- const ctx = this._getOrReturnCtx(input);
3305
- const expectedValues = this._def.values;
3306
- addIssueToContext(ctx, {
3307
- expected: util.joinValues(expectedValues),
3308
- received: ctx.parsedType,
3309
- code: ZodIssueCode.invalid_type
3310
- });
3311
- return INVALID;
3312
- }
3313
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
3314
- __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
3315
- }
3316
- if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
3317
- const ctx = this._getOrReturnCtx(input);
3318
- const expectedValues = this._def.values;
3319
- addIssueToContext(ctx, {
3320
- received: ctx.data,
3321
- code: ZodIssueCode.invalid_enum_value,
3322
- options: expectedValues
3323
- });
3324
- return INVALID;
3325
- }
3326
- return OK(input.data);
3327
- }
3328
- get options() {
3329
- return this._def.values;
3330
- }
3331
- get enum() {
3332
- const enumValues = {};
3333
- for (const val of this._def.values) {
3334
- enumValues[val] = val;
3335
- }
3336
- return enumValues;
3337
- }
3338
- get Values() {
3339
- const enumValues = {};
3340
- for (const val of this._def.values) {
3341
- enumValues[val] = val;
3342
- }
3343
- return enumValues;
3344
- }
3345
- get Enum() {
3346
- const enumValues = {};
3347
- for (const val of this._def.values) {
3348
- enumValues[val] = val;
3349
- }
3350
- return enumValues;
3351
- }
3352
- extract(values, newDef = this._def) {
3353
- return _ZodEnum.create(values, __spreadValues(__spreadValues({}, this._def), newDef));
3354
- }
3355
- exclude(values, newDef = this._def) {
3356
- return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), __spreadValues(__spreadValues({}, this._def), newDef));
3357
- }
3358
- };
3359
- _ZodEnum_cache = /* @__PURE__ */ new WeakMap();
3360
- ZodEnum.create = createZodEnum;
3361
- var ZodNativeEnum = class extends ZodType {
3362
- constructor() {
3363
- super(...arguments);
3364
- _ZodNativeEnum_cache.set(this, void 0);
3365
- }
3366
- _parse(input) {
3367
- const nativeEnumValues = util.getValidEnumValues(this._def.values);
3368
- const ctx = this._getOrReturnCtx(input);
3369
- if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
3370
- const expectedValues = util.objectValues(nativeEnumValues);
3371
- addIssueToContext(ctx, {
3372
- expected: util.joinValues(expectedValues),
3373
- received: ctx.parsedType,
3374
- code: ZodIssueCode.invalid_type
3375
- });
3376
- return INVALID;
3377
- }
3378
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
3379
- __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
3380
- }
3381
- if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
3382
- const expectedValues = util.objectValues(nativeEnumValues);
3383
- addIssueToContext(ctx, {
3384
- received: ctx.data,
3385
- code: ZodIssueCode.invalid_enum_value,
3386
- options: expectedValues
3387
- });
3388
- return INVALID;
3389
- }
3390
- return OK(input.data);
3391
- }
3392
- get enum() {
3393
- return this._def.values;
3394
- }
3395
- };
3396
- _ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
3397
- ZodNativeEnum.create = (values, params) => {
3398
- return new ZodNativeEnum(__spreadValues({
3399
- values,
3400
- typeName: ZodFirstPartyTypeKind.ZodNativeEnum
3401
- }, processCreateParams(params)));
3402
- };
3403
- var ZodPromise = class extends ZodType {
3404
- unwrap() {
3405
- return this._def.type;
3406
- }
3407
- _parse(input) {
3408
- const { ctx } = this._processInputParams(input);
3409
- if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
3410
- addIssueToContext(ctx, {
3411
- code: ZodIssueCode.invalid_type,
3412
- expected: ZodParsedType.promise,
3413
- received: ctx.parsedType
3414
- });
3415
- return INVALID;
3416
- }
3417
- const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
3418
- return OK(promisified.then((data) => {
3419
- return this._def.type.parseAsync(data, {
3420
- path: ctx.path,
3421
- errorMap: ctx.common.contextualErrorMap
3422
- });
3423
- }));
3424
- }
3425
- };
3426
- ZodPromise.create = (schema, params) => {
3427
- return new ZodPromise(__spreadValues({
3428
- type: schema,
3429
- typeName: ZodFirstPartyTypeKind.ZodPromise
3430
- }, processCreateParams(params)));
3431
- };
3432
- var ZodEffects = class extends ZodType {
3433
- innerType() {
3434
- return this._def.schema;
3435
- }
3436
- sourceType() {
3437
- return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
3438
- }
3439
- _parse(input) {
3440
- const { status, ctx } = this._processInputParams(input);
3441
- const effect = this._def.effect || null;
3442
- const checkCtx = {
3443
- addIssue: (arg) => {
3444
- addIssueToContext(ctx, arg);
3445
- if (arg.fatal) {
3446
- status.abort();
3447
- } else {
3448
- status.dirty();
3449
- }
3450
- },
3451
- get path() {
3452
- return ctx.path;
3453
- }
3454
- };
3455
- checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
3456
- if (effect.type === "preprocess") {
3457
- const processed = effect.transform(ctx.data, checkCtx);
3458
- if (ctx.common.async) {
3459
- return Promise.resolve(processed).then((processed2) => __async(this, null, function* () {
3460
- if (status.value === "aborted")
3461
- return INVALID;
3462
- const result = yield this._def.schema._parseAsync({
3463
- data: processed2,
3464
- path: ctx.path,
3465
- parent: ctx
3466
- });
3467
- if (result.status === "aborted")
3468
- return INVALID;
3469
- if (result.status === "dirty")
3470
- return DIRTY(result.value);
3471
- if (status.value === "dirty")
3472
- return DIRTY(result.value);
3473
- return result;
3474
- }));
3475
- } else {
3476
- if (status.value === "aborted")
3477
- return INVALID;
3478
- const result = this._def.schema._parseSync({
3479
- data: processed,
3480
- path: ctx.path,
3481
- parent: ctx
3482
- });
3483
- if (result.status === "aborted")
3484
- return INVALID;
3485
- if (result.status === "dirty")
3486
- return DIRTY(result.value);
3487
- if (status.value === "dirty")
3488
- return DIRTY(result.value);
3489
- return result;
3490
- }
3491
- }
3492
- if (effect.type === "refinement") {
3493
- const executeRefinement = (acc) => {
3494
- const result = effect.refinement(acc, checkCtx);
3495
- if (ctx.common.async) {
3496
- return Promise.resolve(result);
3497
- }
3498
- if (result instanceof Promise) {
3499
- throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
3500
- }
3501
- return acc;
3502
- };
3503
- if (ctx.common.async === false) {
3504
- const inner = this._def.schema._parseSync({
3505
- data: ctx.data,
3506
- path: ctx.path,
3507
- parent: ctx
3508
- });
3509
- if (inner.status === "aborted")
3510
- return INVALID;
3511
- if (inner.status === "dirty")
3512
- status.dirty();
3513
- executeRefinement(inner.value);
3514
- return { status: status.value, value: inner.value };
3515
- } else {
3516
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
3517
- if (inner.status === "aborted")
3518
- return INVALID;
3519
- if (inner.status === "dirty")
3520
- status.dirty();
3521
- return executeRefinement(inner.value).then(() => {
3522
- return { status: status.value, value: inner.value };
3523
- });
3524
- });
3525
- }
3526
- }
3527
- if (effect.type === "transform") {
3528
- if (ctx.common.async === false) {
3529
- const base = this._def.schema._parseSync({
3530
- data: ctx.data,
3531
- path: ctx.path,
3532
- parent: ctx
3533
- });
3534
- if (!isValid(base))
3535
- return base;
3536
- const result = effect.transform(base.value, checkCtx);
3537
- if (result instanceof Promise) {
3538
- throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
3539
- }
3540
- return { status: status.value, value: result };
3541
- } else {
3542
- return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
3543
- if (!isValid(base))
3544
- return base;
3545
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));
3546
- });
3547
- }
3548
- }
3549
- util.assertNever(effect);
3550
- }
3551
- };
3552
- ZodEffects.create = (schema, effect, params) => {
3553
- return new ZodEffects(__spreadValues({
3554
- schema,
3555
- typeName: ZodFirstPartyTypeKind.ZodEffects,
3556
- effect
3557
- }, processCreateParams(params)));
3558
- };
3559
- ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
3560
- return new ZodEffects(__spreadValues({
3561
- schema,
3562
- effect: { type: "preprocess", transform: preprocess },
3563
- typeName: ZodFirstPartyTypeKind.ZodEffects
3564
- }, processCreateParams(params)));
3565
- };
3566
- var ZodOptional = class extends ZodType {
3567
- _parse(input) {
3568
- const parsedType = this._getType(input);
3569
- if (parsedType === ZodParsedType.undefined) {
3570
- return OK(void 0);
3571
- }
3572
- return this._def.innerType._parse(input);
3573
- }
3574
- unwrap() {
3575
- return this._def.innerType;
3576
- }
3577
- };
3578
- ZodOptional.create = (type, params) => {
3579
- return new ZodOptional(__spreadValues({
3580
- innerType: type,
3581
- typeName: ZodFirstPartyTypeKind.ZodOptional
3582
- }, processCreateParams(params)));
3583
- };
3584
- var ZodNullable = class extends ZodType {
3585
- _parse(input) {
3586
- const parsedType = this._getType(input);
3587
- if (parsedType === ZodParsedType.null) {
3588
- return OK(null);
3589
- }
3590
- return this._def.innerType._parse(input);
3591
- }
3592
- unwrap() {
3593
- return this._def.innerType;
3594
- }
3595
- };
3596
- ZodNullable.create = (type, params) => {
3597
- return new ZodNullable(__spreadValues({
3598
- innerType: type,
3599
- typeName: ZodFirstPartyTypeKind.ZodNullable
3600
- }, processCreateParams(params)));
3601
- };
3602
- var ZodDefault = class extends ZodType {
3603
- _parse(input) {
3604
- const { ctx } = this._processInputParams(input);
3605
- let data = ctx.data;
3606
- if (ctx.parsedType === ZodParsedType.undefined) {
3607
- data = this._def.defaultValue();
3608
- }
3609
- return this._def.innerType._parse({
3610
- data,
3611
- path: ctx.path,
3612
- parent: ctx
3613
- });
3614
- }
3615
- removeDefault() {
3616
- return this._def.innerType;
3617
- }
3618
- };
3619
- ZodDefault.create = (type, params) => {
3620
- return new ZodDefault(__spreadValues({
3621
- innerType: type,
3622
- typeName: ZodFirstPartyTypeKind.ZodDefault,
3623
- defaultValue: typeof params.default === "function" ? params.default : () => params.default
3624
- }, processCreateParams(params)));
3625
- };
3626
- var ZodCatch = class extends ZodType {
3627
- _parse(input) {
3628
- const { ctx } = this._processInputParams(input);
3629
- const newCtx = __spreadProps(__spreadValues({}, ctx), {
3630
- common: __spreadProps(__spreadValues({}, ctx.common), {
3631
- issues: []
3632
- })
3633
- });
3634
- const result = this._def.innerType._parse({
3635
- data: newCtx.data,
3636
- path: newCtx.path,
3637
- parent: __spreadValues({}, newCtx)
3638
- });
3639
- if (isAsync(result)) {
3640
- return result.then((result2) => {
3641
- return {
3642
- status: "valid",
3643
- value: result2.status === "valid" ? result2.value : this._def.catchValue({
3644
- get error() {
3645
- return new ZodError(newCtx.common.issues);
3646
- },
3647
- input: newCtx.data
3648
- })
3649
- };
3650
- });
3651
- } else {
3652
- return {
3653
- status: "valid",
3654
- value: result.status === "valid" ? result.value : this._def.catchValue({
3655
- get error() {
3656
- return new ZodError(newCtx.common.issues);
3657
- },
3658
- input: newCtx.data
3659
- })
3660
- };
3661
- }
3662
- }
3663
- removeCatch() {
3664
- return this._def.innerType;
3665
- }
3666
- };
3667
- ZodCatch.create = (type, params) => {
3668
- return new ZodCatch(__spreadValues({
3669
- innerType: type,
3670
- typeName: ZodFirstPartyTypeKind.ZodCatch,
3671
- catchValue: typeof params.catch === "function" ? params.catch : () => params.catch
3672
- }, processCreateParams(params)));
3673
- };
3674
- var ZodNaN = class extends ZodType {
3675
- _parse(input) {
3676
- const parsedType = this._getType(input);
3677
- if (parsedType !== ZodParsedType.nan) {
3678
- const ctx = this._getOrReturnCtx(input);
3679
- addIssueToContext(ctx, {
3680
- code: ZodIssueCode.invalid_type,
3681
- expected: ZodParsedType.nan,
3682
- received: ctx.parsedType
3683
- });
3684
- return INVALID;
3685
- }
3686
- return { status: "valid", value: input.data };
3687
- }
3688
- };
3689
- ZodNaN.create = (params) => {
3690
- return new ZodNaN(__spreadValues({
3691
- typeName: ZodFirstPartyTypeKind.ZodNaN
3692
- }, processCreateParams(params)));
3693
- };
3694
- var BRAND = Symbol("zod_brand");
3695
- var ZodBranded = class extends ZodType {
3696
- _parse(input) {
3697
- const { ctx } = this._processInputParams(input);
3698
- const data = ctx.data;
3699
- return this._def.type._parse({
3700
- data,
3701
- path: ctx.path,
3702
- parent: ctx
3703
- });
3704
- }
3705
- unwrap() {
3706
- return this._def.type;
3707
- }
3708
- };
3709
- var ZodPipeline = class _ZodPipeline extends ZodType {
3710
- _parse(input) {
3711
- const { status, ctx } = this._processInputParams(input);
3712
- if (ctx.common.async) {
3713
- const handleAsync = () => __async(this, null, function* () {
3714
- const inResult = yield this._def.in._parseAsync({
3715
- data: ctx.data,
3716
- path: ctx.path,
3717
- parent: ctx
3718
- });
3719
- if (inResult.status === "aborted")
3720
- return INVALID;
3721
- if (inResult.status === "dirty") {
3722
- status.dirty();
3723
- return DIRTY(inResult.value);
3724
- } else {
3725
- return this._def.out._parseAsync({
3726
- data: inResult.value,
3727
- path: ctx.path,
3728
- parent: ctx
3729
- });
3730
- }
3731
- });
3732
- return handleAsync();
3733
- } else {
3734
- const inResult = this._def.in._parseSync({
3735
- data: ctx.data,
3736
- path: ctx.path,
3737
- parent: ctx
3738
- });
3739
- if (inResult.status === "aborted")
3740
- return INVALID;
3741
- if (inResult.status === "dirty") {
3742
- status.dirty();
3743
- return {
3744
- status: "dirty",
3745
- value: inResult.value
3746
- };
3747
- } else {
3748
- return this._def.out._parseSync({
3749
- data: inResult.value,
3750
- path: ctx.path,
3751
- parent: ctx
3752
- });
3753
- }
3754
- }
3755
- }
3756
- static create(a, b) {
3757
- return new _ZodPipeline({
3758
- in: a,
3759
- out: b,
3760
- typeName: ZodFirstPartyTypeKind.ZodPipeline
3761
- });
3762
- }
3763
- };
3764
- var ZodReadonly = class extends ZodType {
3765
- _parse(input) {
3766
- const result = this._def.innerType._parse(input);
3767
- const freeze = (data) => {
3768
- if (isValid(data)) {
3769
- data.value = Object.freeze(data.value);
3770
- }
3771
- return data;
3772
- };
3773
- return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
3774
- }
3775
- unwrap() {
3776
- return this._def.innerType;
3777
- }
3778
- };
3779
- ZodReadonly.create = (type, params) => {
3780
- return new ZodReadonly(__spreadValues({
3781
- innerType: type,
3782
- typeName: ZodFirstPartyTypeKind.ZodReadonly
3783
- }, processCreateParams(params)));
3784
- };
3785
- function cleanParams(params, data) {
3786
- const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
3787
- const p2 = typeof p === "string" ? { message: p } : p;
3788
- return p2;
3789
- }
3790
- function custom(check, _params = {}, fatal) {
3791
- if (check)
3792
- return ZodAny.create().superRefine((data, ctx) => {
3793
- var _a, _b;
3794
- const r = check(data);
3795
- if (r instanceof Promise) {
3796
- return r.then((r2) => {
3797
- var _a2, _b2;
3798
- if (!r2) {
3799
- const params = cleanParams(_params, data);
3800
- const _fatal = (_b2 = (_a2 = params.fatal) !== null && _a2 !== void 0 ? _a2 : fatal) !== null && _b2 !== void 0 ? _b2 : true;
3801
- ctx.addIssue(__spreadProps(__spreadValues({ code: "custom" }, params), { fatal: _fatal }));
3802
- }
3803
- });
3804
- }
3805
- if (!r) {
3806
- const params = cleanParams(_params, data);
3807
- const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
3808
- ctx.addIssue(__spreadProps(__spreadValues({ code: "custom" }, params), { fatal: _fatal }));
3809
- }
3810
- return;
3811
- });
3812
- return ZodAny.create();
3813
- }
3814
- var late = {
3815
- object: ZodObject.lazycreate
3816
- };
3817
- var ZodFirstPartyTypeKind;
3818
- (function(ZodFirstPartyTypeKind2) {
3819
- ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
3820
- ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber";
3821
- ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN";
3822
- ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt";
3823
- ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean";
3824
- ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate";
3825
- ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol";
3826
- ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined";
3827
- ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull";
3828
- ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny";
3829
- ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown";
3830
- ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever";
3831
- ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid";
3832
- ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray";
3833
- ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject";
3834
- ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion";
3835
- ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
3836
- ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection";
3837
- ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple";
3838
- ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord";
3839
- ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap";
3840
- ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet";
3841
- ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction";
3842
- ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy";
3843
- ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral";
3844
- ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum";
3845
- ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects";
3846
- ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum";
3847
- ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional";
3848
- ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable";
3849
- ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault";
3850
- ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch";
3851
- ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
3852
- ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
3853
- ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
3854
- ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
3855
- })(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
3856
- var instanceOfType = (cls, params = {
3857
- message: `Input not instance of ${cls.name}`
3858
- }) => custom((data) => data instanceof cls, params);
3859
- var stringType = ZodString.create;
3860
- var numberType = ZodNumber.create;
3861
- var nanType = ZodNaN.create;
3862
- var bigIntType = ZodBigInt.create;
3863
- var booleanType = ZodBoolean.create;
3864
- var dateType = ZodDate.create;
3865
- var symbolType = ZodSymbol.create;
3866
- var undefinedType = ZodUndefined.create;
3867
- var nullType = ZodNull.create;
3868
- var anyType = ZodAny.create;
3869
- var unknownType = ZodUnknown.create;
3870
- var neverType = ZodNever.create;
3871
- var voidType = ZodVoid.create;
3872
- var arrayType = ZodArray.create;
3873
- var objectType = ZodObject.create;
3874
- var strictObjectType = ZodObject.strictCreate;
3875
- var unionType = ZodUnion.create;
3876
- var discriminatedUnionType = ZodDiscriminatedUnion.create;
3877
- var intersectionType = ZodIntersection.create;
3878
- var tupleType = ZodTuple.create;
3879
- var recordType = ZodRecord.create;
3880
- var mapType = ZodMap.create;
3881
- var setType = ZodSet.create;
3882
- var functionType = ZodFunction.create;
3883
- var lazyType = ZodLazy.create;
3884
- var literalType = ZodLiteral.create;
3885
- var enumType = ZodEnum.create;
3886
- var nativeEnumType = ZodNativeEnum.create;
3887
- var promiseType = ZodPromise.create;
3888
- var effectsType = ZodEffects.create;
3889
- var optionalType = ZodOptional.create;
3890
- var nullableType = ZodNullable.create;
3891
- var preprocessType = ZodEffects.createWithPreprocess;
3892
- var pipelineType = ZodPipeline.create;
3893
- var ostring = () => stringType().optional();
3894
- var onumber = () => numberType().optional();
3895
- var oboolean = () => booleanType().optional();
3896
- var coerce = {
3897
- string: (arg) => ZodString.create(__spreadProps(__spreadValues({}, arg), { coerce: true })),
3898
- number: (arg) => ZodNumber.create(__spreadProps(__spreadValues({}, arg), { coerce: true })),
3899
- boolean: (arg) => ZodBoolean.create(__spreadProps(__spreadValues({}, arg), {
3900
- coerce: true
3901
- })),
3902
- bigint: (arg) => ZodBigInt.create(__spreadProps(__spreadValues({}, arg), { coerce: true })),
3903
- date: (arg) => ZodDate.create(__spreadProps(__spreadValues({}, arg), { coerce: true }))
3904
- };
3905
- var NEVER = INVALID;
3906
- var z = /* @__PURE__ */ Object.freeze({
3907
- __proto__: null,
3908
- defaultErrorMap: errorMap,
3909
- setErrorMap,
3910
- getErrorMap,
3911
- makeIssue,
3912
- EMPTY_PATH,
3913
- addIssueToContext,
3914
- ParseStatus,
3915
- INVALID,
3916
- DIRTY,
3917
- OK,
3918
- isAborted,
3919
- isDirty,
3920
- isValid,
3921
- isAsync,
3922
- get util() {
3923
- return util;
3924
- },
3925
- get objectUtil() {
3926
- return objectUtil;
3927
- },
3928
- ZodParsedType,
3929
- getParsedType,
3930
- ZodType,
3931
- datetimeRegex,
3932
- ZodString,
3933
- ZodNumber,
3934
- ZodBigInt,
3935
- ZodBoolean,
3936
- ZodDate,
3937
- ZodSymbol,
3938
- ZodUndefined,
3939
- ZodNull,
3940
- ZodAny,
3941
- ZodUnknown,
3942
- ZodNever,
3943
- ZodVoid,
3944
- ZodArray,
3945
- ZodObject,
3946
- ZodUnion,
3947
- ZodDiscriminatedUnion,
3948
- ZodIntersection,
3949
- ZodTuple,
3950
- ZodRecord,
3951
- ZodMap,
3952
- ZodSet,
3953
- ZodFunction,
3954
- ZodLazy,
3955
- ZodLiteral,
3956
- ZodEnum,
3957
- ZodNativeEnum,
3958
- ZodPromise,
3959
- ZodEffects,
3960
- ZodTransformer: ZodEffects,
3961
- ZodOptional,
3962
- ZodNullable,
3963
- ZodDefault,
3964
- ZodCatch,
3965
- ZodNaN,
3966
- BRAND,
3967
- ZodBranded,
3968
- ZodPipeline,
3969
- ZodReadonly,
3970
- custom,
3971
- Schema: ZodType,
3972
- ZodSchema: ZodType,
3973
- late,
3974
- get ZodFirstPartyTypeKind() {
3975
- return ZodFirstPartyTypeKind;
3976
- },
3977
- coerce,
3978
- any: anyType,
3979
- array: arrayType,
3980
- bigint: bigIntType,
3981
- boolean: booleanType,
3982
- date: dateType,
3983
- discriminatedUnion: discriminatedUnionType,
3984
- effect: effectsType,
3985
- "enum": enumType,
3986
- "function": functionType,
3987
- "instanceof": instanceOfType,
3988
- intersection: intersectionType,
3989
- lazy: lazyType,
3990
- literal: literalType,
3991
- map: mapType,
3992
- nan: nanType,
3993
- nativeEnum: nativeEnumType,
3994
- never: neverType,
3995
- "null": nullType,
3996
- nullable: nullableType,
3997
- number: numberType,
3998
- object: objectType,
3999
- oboolean,
4000
- onumber,
4001
- optional: optionalType,
4002
- ostring,
4003
- pipeline: pipelineType,
4004
- preprocess: preprocessType,
4005
- promise: promiseType,
4006
- record: recordType,
4007
- set: setType,
4008
- strictObject: strictObjectType,
4009
- string: stringType,
4010
- symbol: symbolType,
4011
- transformer: effectsType,
4012
- tuple: tupleType,
4013
- "undefined": undefinedType,
4014
- union: unionType,
4015
- unknown: unknownType,
4016
- "void": voidType,
4017
- NEVER,
4018
- ZodIssueCode,
4019
- quotelessJson,
4020
- ZodError
4021
- });
4022
-
4023
- // src/txs/reverse-transfer-many/reverse-transfer-many.schema.zod.ts
29
+ var import_zod = require('../../lib/zod.cjs');
4024
30
  var import_get_transfer_schema = require('../get-transfer/get-transfer.schema.zod.cjs');
4025
31
  var import_find_transfer_many_schema = require('../find-transfer-many/find-transfer-many.schema.zod.cjs');
4026
32
  var import_consts = require('../consts.cjs');
4027
33
  var import_transfer_schema = require('../../db/transfer/transfer.schema.zod.cjs');
4028
- var reverseTransferManyModificationsSchema = z.object({
34
+ var reverseTransferManyModificationsSchema = import_zod.z.object({
4029
35
  status: import_transfer_schema.transferTableStatusInputSchema,
4030
36
  force: import_transfer_schema.transferTableSchema.shape.force,
4031
37
  metadata: import_transfer_schema.transferTableSchema.shape.metadata
4032
38
  }).partial();
4033
39
  var reverseTransferManyTxInputOptionsSchema = import_consts.iTxGeneralOptions.extend({
4034
- reverse_deposit: z.boolean().describe(
40
+ reverse_deposit: import_zod.z.boolean().describe(
4035
41
  "Whether to create withdrawal transaction for deposit (will default to pending)"
4036
42
  ),
4037
- reverse_withdrawal: z.boolean().describe(
43
+ reverse_withdrawal: import_zod.z.boolean().describe(
4038
44
  "Whether to create deposit transaction for withdrawal (will default to pending)"
4039
45
  ),
4040
46
  metadata_action: import_consts.iTxMetadataActionForReverse
4041
47
  }).partial();
4042
- var reverseTransferManyTxInputSchema = z.object({
48
+ var reverseTransferManyTxInputSchema = import_zod.z.object({
4043
49
  transfer: import_find_transfer_many_schema.transferFilterSchema,
4044
50
  reverse: reverseTransferManyModificationsSchema,
4045
51
  options: reverseTransferManyTxInputOptionsSchema
4046
52
  }).strict().partial().required({
4047
53
  transfer: true
4048
54
  }).describe("Input for reverseTranferMany");
4049
- var reverseTransferManyTxOutputSchema = z.object({
55
+ var reverseTransferManyTxOutputSchema = import_zod.z.object({
4050
56
  transfers: import_get_transfer_schema.transferOutputSchema.array().describe("Created transfer array")
4051
57
  }).describe("Output of reverseTranferMany");