@quickshops/sdk 1.0.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 (568) hide show
  1. package/FUNCTIONS.md +88 -0
  2. package/README.md +486 -0
  3. package/RUNTIMES.md +48 -0
  4. package/esm/core.d.ts +10 -0
  5. package/esm/core.d.ts.map +1 -0
  6. package/esm/core.js +13 -0
  7. package/esm/core.js.map +1 -0
  8. package/esm/funcs/cart-cart-add-line.d.ts +15 -0
  9. package/esm/funcs/cart-cart-add-line.d.ts.map +1 -0
  10. package/esm/funcs/cart-cart-add-line.js +87 -0
  11. package/esm/funcs/cart-cart-add-line.js.map +1 -0
  12. package/esm/funcs/cart-cart-clear.d.ts +15 -0
  13. package/esm/funcs/cart-cart-clear.d.ts.map +1 -0
  14. package/esm/funcs/cart-cart-clear.js +86 -0
  15. package/esm/funcs/cart-cart-clear.js.map +1 -0
  16. package/esm/funcs/cart-cart-create.d.ts +15 -0
  17. package/esm/funcs/cart-cart-create.d.ts.map +1 -0
  18. package/esm/funcs/cart-cart-create.js +70 -0
  19. package/esm/funcs/cart-cart-create.js.map +1 -0
  20. package/esm/funcs/cart-cart-get.d.ts +15 -0
  21. package/esm/funcs/cart-cart-get.d.ts.map +1 -0
  22. package/esm/funcs/cart-cart-get.js +86 -0
  23. package/esm/funcs/cart-cart-get.js.map +1 -0
  24. package/esm/funcs/cart-cart-remove-line.d.ts +15 -0
  25. package/esm/funcs/cart-cart-remove-line.d.ts.map +1 -0
  26. package/esm/funcs/cart-cart-remove-line.js +90 -0
  27. package/esm/funcs/cart-cart-remove-line.js.map +1 -0
  28. package/esm/funcs/cart-cart-update-line.d.ts +15 -0
  29. package/esm/funcs/cart-cart-update-line.d.ts.map +1 -0
  30. package/esm/funcs/cart-cart-update-line.js +91 -0
  31. package/esm/funcs/cart-cart-update-line.js.map +1 -0
  32. package/esm/funcs/checkout-checkout-create-session.d.ts +15 -0
  33. package/esm/funcs/checkout-checkout-create-session.d.ts.map +1 -0
  34. package/esm/funcs/checkout-checkout-create-session.js +81 -0
  35. package/esm/funcs/checkout-checkout-create-session.js.map +1 -0
  36. package/esm/funcs/health-health-check.d.ts +15 -0
  37. package/esm/funcs/health-health-check.d.ts.map +1 -0
  38. package/esm/funcs/health-health-check.js +70 -0
  39. package/esm/funcs/health-health-check.js.map +1 -0
  40. package/esm/funcs/products-products-get-all.d.ts +15 -0
  41. package/esm/funcs/products-products-get-all.d.ts.map +1 -0
  42. package/esm/funcs/products-products-get-all.js +70 -0
  43. package/esm/funcs/products-products-get-all.js.map +1 -0
  44. package/esm/funcs/products-products-get-by-id.d.ts +15 -0
  45. package/esm/funcs/products-products-get-by-id.d.ts.map +1 -0
  46. package/esm/funcs/products-products-get-by-id.js +86 -0
  47. package/esm/funcs/products-products-get-by-id.js.map +1 -0
  48. package/esm/funcs/store-store-get.d.ts +15 -0
  49. package/esm/funcs/store-store-get.d.ts.map +1 -0
  50. package/esm/funcs/store-store-get.js +70 -0
  51. package/esm/funcs/store-store-get.js.map +1 -0
  52. package/esm/funcs/subscription-subscription-create-portal-session.d.ts +15 -0
  53. package/esm/funcs/subscription-subscription-create-portal-session.d.ts.map +1 -0
  54. package/esm/funcs/subscription-subscription-create-portal-session.js +81 -0
  55. package/esm/funcs/subscription-subscription-create-portal-session.js.map +1 -0
  56. package/esm/hooks/hooks.d.ts +25 -0
  57. package/esm/hooks/hooks.d.ts.map +1 -0
  58. package/esm/hooks/hooks.js +80 -0
  59. package/esm/hooks/hooks.js.map +1 -0
  60. package/esm/hooks/index.d.ts +3 -0
  61. package/esm/hooks/index.d.ts.map +1 -0
  62. package/esm/hooks/index.js +6 -0
  63. package/esm/hooks/index.js.map +1 -0
  64. package/esm/hooks/types.d.ts +77 -0
  65. package/esm/hooks/types.d.ts.map +1 -0
  66. package/esm/hooks/types.js +5 -0
  67. package/esm/hooks/types.js.map +1 -0
  68. package/esm/index.d.ts +6 -0
  69. package/esm/index.d.ts.map +1 -0
  70. package/esm/index.js +8 -0
  71. package/esm/index.js.map +1 -0
  72. package/esm/lib/base64.d.ts +10 -0
  73. package/esm/lib/base64.d.ts.map +1 -0
  74. package/esm/lib/base64.js +31 -0
  75. package/esm/lib/base64.js.map +1 -0
  76. package/esm/lib/config.d.ts +30 -0
  77. package/esm/lib/config.d.ts.map +1 -0
  78. package/esm/lib/config.js +21 -0
  79. package/esm/lib/config.js.map +1 -0
  80. package/esm/lib/encodings.d.ts +54 -0
  81. package/esm/lib/encodings.d.ts.map +1 -0
  82. package/esm/lib/encodings.js +391 -0
  83. package/esm/lib/encodings.js.map +1 -0
  84. package/esm/lib/env.d.ts +15 -0
  85. package/esm/lib/env.d.ts.map +1 -0
  86. package/esm/lib/env.js +44 -0
  87. package/esm/lib/env.js.map +1 -0
  88. package/esm/lib/files.d.ts +26 -0
  89. package/esm/lib/files.d.ts.map +1 -0
  90. package/esm/lib/files.js +91 -0
  91. package/esm/lib/files.js.map +1 -0
  92. package/esm/lib/http.d.ts +67 -0
  93. package/esm/lib/http.d.ts.map +1 -0
  94. package/esm/lib/http.js +209 -0
  95. package/esm/lib/http.js.map +1 -0
  96. package/esm/lib/logger.d.ts +6 -0
  97. package/esm/lib/logger.d.ts.map +1 -0
  98. package/esm/lib/logger.js +5 -0
  99. package/esm/lib/logger.js.map +1 -0
  100. package/esm/lib/matchers.d.ts +59 -0
  101. package/esm/lib/matchers.d.ts.map +1 -0
  102. package/esm/lib/matchers.js +202 -0
  103. package/esm/lib/matchers.js.map +1 -0
  104. package/esm/lib/primitives.d.ts +27 -0
  105. package/esm/lib/primitives.d.ts.map +1 -0
  106. package/esm/lib/primitives.js +120 -0
  107. package/esm/lib/primitives.js.map +1 -0
  108. package/esm/lib/retries.d.ts +38 -0
  109. package/esm/lib/retries.d.ts.map +1 -0
  110. package/esm/lib/retries.js +150 -0
  111. package/esm/lib/retries.js.map +1 -0
  112. package/esm/lib/schemas.d.ts +21 -0
  113. package/esm/lib/schemas.d.ts.map +1 -0
  114. package/esm/lib/schemas.js +57 -0
  115. package/esm/lib/schemas.js.map +1 -0
  116. package/esm/lib/sdks.d.ts +63 -0
  117. package/esm/lib/sdks.d.ts.map +1 -0
  118. package/esm/lib/sdks.js +294 -0
  119. package/esm/lib/sdks.js.map +1 -0
  120. package/esm/lib/security.d.ts +83 -0
  121. package/esm/lib/security.d.ts.map +1 -0
  122. package/esm/lib/security.js +149 -0
  123. package/esm/lib/security.js.map +1 -0
  124. package/esm/lib/url.d.ts +5 -0
  125. package/esm/lib/url.d.ts.map +1 -0
  126. package/esm/lib/url.js +24 -0
  127. package/esm/lib/url.js.map +1 -0
  128. package/esm/models/errors/cart-add-line.d.ts +141 -0
  129. package/esm/models/errors/cart-add-line.d.ts.map +1 -0
  130. package/esm/models/errors/cart-add-line.js +205 -0
  131. package/esm/models/errors/cart-add-line.js.map +1 -0
  132. package/esm/models/errors/cart-clear.d.ts +118 -0
  133. package/esm/models/errors/cart-clear.d.ts.map +1 -0
  134. package/esm/models/errors/cart-clear.js +172 -0
  135. package/esm/models/errors/cart-clear.js.map +1 -0
  136. package/esm/models/errors/cart-create.d.ts +118 -0
  137. package/esm/models/errors/cart-create.d.ts.map +1 -0
  138. package/esm/models/errors/cart-create.js +172 -0
  139. package/esm/models/errors/cart-create.js.map +1 -0
  140. package/esm/models/errors/cart-get.d.ts +95 -0
  141. package/esm/models/errors/cart-get.d.ts.map +1 -0
  142. package/esm/models/errors/cart-get.js +139 -0
  143. package/esm/models/errors/cart-get.js.map +1 -0
  144. package/esm/models/errors/cart-remove-line.d.ts +141 -0
  145. package/esm/models/errors/cart-remove-line.d.ts.map +1 -0
  146. package/esm/models/errors/cart-remove-line.js +205 -0
  147. package/esm/models/errors/cart-remove-line.js.map +1 -0
  148. package/esm/models/errors/cart-update-line.d.ts +141 -0
  149. package/esm/models/errors/cart-update-line.d.ts.map +1 -0
  150. package/esm/models/errors/cart-update-line.js +205 -0
  151. package/esm/models/errors/cart-update-line.js.map +1 -0
  152. package/esm/models/errors/checkout-create-session.d.ts +118 -0
  153. package/esm/models/errors/checkout-create-session.d.ts.map +1 -0
  154. package/esm/models/errors/checkout-create-session.js +172 -0
  155. package/esm/models/errors/checkout-create-session.js.map +1 -0
  156. package/esm/models/errors/health-check.d.ts +72 -0
  157. package/esm/models/errors/health-check.d.ts.map +1 -0
  158. package/esm/models/errors/health-check.js +106 -0
  159. package/esm/models/errors/health-check.js.map +1 -0
  160. package/esm/models/errors/http-client-errors.d.ts +44 -0
  161. package/esm/models/errors/http-client-errors.d.ts.map +1 -0
  162. package/esm/models/errors/http-client-errors.js +56 -0
  163. package/esm/models/errors/http-client-errors.js.map +1 -0
  164. package/esm/models/errors/index.d.ts +18 -0
  165. package/esm/models/errors/index.d.ts.map +1 -0
  166. package/esm/models/errors/index.js +21 -0
  167. package/esm/models/errors/index.js.map +1 -0
  168. package/esm/models/errors/products-get-all.d.ts +72 -0
  169. package/esm/models/errors/products-get-all.d.ts.map +1 -0
  170. package/esm/models/errors/products-get-all.js +106 -0
  171. package/esm/models/errors/products-get-all.js.map +1 -0
  172. package/esm/models/errors/products-get-by-id.d.ts +95 -0
  173. package/esm/models/errors/products-get-by-id.d.ts.map +1 -0
  174. package/esm/models/errors/products-get-by-id.js +139 -0
  175. package/esm/models/errors/products-get-by-id.js.map +1 -0
  176. package/esm/models/errors/quickshops-default-error.d.ts +10 -0
  177. package/esm/models/errors/quickshops-default-error.d.ts.map +1 -0
  178. package/esm/models/errors/quickshops-default-error.js +30 -0
  179. package/esm/models/errors/quickshops-default-error.js.map +1 -0
  180. package/esm/models/errors/quickshops-error.d.ts +19 -0
  181. package/esm/models/errors/quickshops-error.d.ts.map +1 -0
  182. package/esm/models/errors/quickshops-error.js +26 -0
  183. package/esm/models/errors/quickshops-error.js.map +1 -0
  184. package/esm/models/errors/response-validation-error.d.ts +26 -0
  185. package/esm/models/errors/response-validation-error.d.ts.map +1 -0
  186. package/esm/models/errors/response-validation-error.js +37 -0
  187. package/esm/models/errors/response-validation-error.js.map +1 -0
  188. package/esm/models/errors/sdk-validation-error.d.ts +21 -0
  189. package/esm/models/errors/sdk-validation-error.d.ts.map +1 -0
  190. package/esm/models/errors/sdk-validation-error.js +52 -0
  191. package/esm/models/errors/sdk-validation-error.js.map +1 -0
  192. package/esm/models/errors/store-get.d.ts +95 -0
  193. package/esm/models/errors/store-get.d.ts.map +1 -0
  194. package/esm/models/errors/store-get.js +139 -0
  195. package/esm/models/errors/store-get.js.map +1 -0
  196. package/esm/models/errors/subscription-create-portal-session.d.ts +118 -0
  197. package/esm/models/errors/subscription-create-portal-session.d.ts.map +1 -0
  198. package/esm/models/errors/subscription-create-portal-session.js +175 -0
  199. package/esm/models/errors/subscription-create-portal-session.js.map +1 -0
  200. package/esm/models/index.d.ts +2 -0
  201. package/esm/models/index.d.ts.map +1 -0
  202. package/esm/models/index.js +5 -0
  203. package/esm/models/index.js.map +1 -0
  204. package/esm/models/operations/cart-add-line.d.ts +61 -0
  205. package/esm/models/operations/cart-add-line.d.ts.map +1 -0
  206. package/esm/models/operations/cart-add-line.js +57 -0
  207. package/esm/models/operations/cart-add-line.js.map +1 -0
  208. package/esm/models/operations/cart-clear.d.ts +47 -0
  209. package/esm/models/operations/cart-clear.d.ts.map +1 -0
  210. package/esm/models/operations/cart-clear.js +48 -0
  211. package/esm/models/operations/cart-clear.js.map +1 -0
  212. package/esm/models/operations/cart-create.d.ts +37 -0
  213. package/esm/models/operations/cart-create.d.ts.map +1 -0
  214. package/esm/models/operations/cart-create.js +41 -0
  215. package/esm/models/operations/cart-create.js.map +1 -0
  216. package/esm/models/operations/cart-get.d.ts +47 -0
  217. package/esm/models/operations/cart-get.d.ts.map +1 -0
  218. package/esm/models/operations/cart-get.js +50 -0
  219. package/esm/models/operations/cart-get.js.map +1 -0
  220. package/esm/models/operations/cart-remove-line.d.ts +49 -0
  221. package/esm/models/operations/cart-remove-line.d.ts.map +1 -0
  222. package/esm/models/operations/cart-remove-line.js +49 -0
  223. package/esm/models/operations/cart-remove-line.js.map +1 -0
  224. package/esm/models/operations/cart-update-line.d.ts +61 -0
  225. package/esm/models/operations/cart-update-line.d.ts.map +1 -0
  226. package/esm/models/operations/cart-update-line.js +57 -0
  227. package/esm/models/operations/cart-update-line.js.map +1 -0
  228. package/esm/models/operations/checkout-create-session.d.ts +29 -0
  229. package/esm/models/operations/checkout-create-session.d.ts.map +1 -0
  230. package/esm/models/operations/checkout-create-session.js +28 -0
  231. package/esm/models/operations/checkout-create-session.js.map +1 -0
  232. package/esm/models/operations/health-check.d.ts +13 -0
  233. package/esm/models/operations/health-check.d.ts.map +1 -0
  234. package/esm/models/operations/health-check.js +14 -0
  235. package/esm/models/operations/health-check.js.map +1 -0
  236. package/esm/models/operations/index.d.ts +13 -0
  237. package/esm/models/operations/index.d.ts.map +1 -0
  238. package/esm/models/operations/index.js +16 -0
  239. package/esm/models/operations/index.js.map +1 -0
  240. package/esm/models/operations/products-get-all.d.ts +45 -0
  241. package/esm/models/operations/products-get-all.d.ts.map +1 -0
  242. package/esm/models/operations/products-get-all.js +50 -0
  243. package/esm/models/operations/products-get-all.js.map +1 -0
  244. package/esm/models/operations/products-get-by-id.d.ts +55 -0
  245. package/esm/models/operations/products-get-by-id.d.ts.map +1 -0
  246. package/esm/models/operations/products-get-by-id.js +57 -0
  247. package/esm/models/operations/products-get-by-id.js.map +1 -0
  248. package/esm/models/operations/store-get.d.ts +31 -0
  249. package/esm/models/operations/store-get.d.ts.map +1 -0
  250. package/esm/models/operations/store-get.js +39 -0
  251. package/esm/models/operations/store-get.js.map +1 -0
  252. package/esm/models/operations/subscription-create-portal-session.d.ts +29 -0
  253. package/esm/models/operations/subscription-create-portal-session.d.ts.map +1 -0
  254. package/esm/models/operations/subscription-create-portal-session.js +28 -0
  255. package/esm/models/operations/subscription-create-portal-session.js.map +1 -0
  256. package/esm/models/security.d.ts +12 -0
  257. package/esm/models/security.d.ts.map +1 -0
  258. package/esm/models/security.js +17 -0
  259. package/esm/models/security.js.map +1 -0
  260. package/esm/sdk/cart.d.ts +29 -0
  261. package/esm/sdk/cart.d.ts.map +1 -0
  262. package/esm/sdk/cart.js +50 -0
  263. package/esm/sdk/cart.js.map +1 -0
  264. package/esm/sdk/checkout.d.ts +9 -0
  265. package/esm/sdk/checkout.d.ts.map +1 -0
  266. package/esm/sdk/checkout.js +15 -0
  267. package/esm/sdk/checkout.js.map +1 -0
  268. package/esm/sdk/health.d.ts +9 -0
  269. package/esm/sdk/health.d.ts.map +1 -0
  270. package/esm/sdk/health.js +15 -0
  271. package/esm/sdk/health.js.map +1 -0
  272. package/esm/sdk/index.d.ts +2 -0
  273. package/esm/sdk/index.d.ts.map +1 -0
  274. package/esm/sdk/index.js +5 -0
  275. package/esm/sdk/index.js.map +1 -0
  276. package/esm/sdk/products.d.ts +13 -0
  277. package/esm/sdk/products.d.ts.map +1 -0
  278. package/esm/sdk/products.js +22 -0
  279. package/esm/sdk/products.js.map +1 -0
  280. package/esm/sdk/sdk.d.ts +22 -0
  281. package/esm/sdk/sdk.d.ts.map +1 -0
  282. package/esm/sdk/sdk.js +37 -0
  283. package/esm/sdk/sdk.js.map +1 -0
  284. package/esm/sdk/store.d.ts +9 -0
  285. package/esm/sdk/store.d.ts.map +1 -0
  286. package/esm/sdk/store.js +15 -0
  287. package/esm/sdk/store.js.map +1 -0
  288. package/esm/sdk/subscription.d.ts +9 -0
  289. package/esm/sdk/subscription.d.ts.map +1 -0
  290. package/esm/sdk/subscription.js +15 -0
  291. package/esm/sdk/subscription.js.map +1 -0
  292. package/esm/types/async.d.ts +23 -0
  293. package/esm/types/async.d.ts.map +1 -0
  294. package/esm/types/async.js +28 -0
  295. package/esm/types/async.js.map +1 -0
  296. package/esm/types/blobs.d.ts +4 -0
  297. package/esm/types/blobs.d.ts.map +1 -0
  298. package/esm/types/blobs.js +25 -0
  299. package/esm/types/blobs.js.map +1 -0
  300. package/esm/types/const-date-time.d.ts +3 -0
  301. package/esm/types/const-date-time.d.ts.map +1 -0
  302. package/esm/types/const-date-time.js +10 -0
  303. package/esm/types/const-date-time.js.map +1 -0
  304. package/esm/types/default-to-zero-value.d.ts +12 -0
  305. package/esm/types/default-to-zero-value.d.ts.map +1 -0
  306. package/esm/types/default-to-zero-value.js +31 -0
  307. package/esm/types/default-to-zero-value.js.map +1 -0
  308. package/esm/types/enums.d.ts +9 -0
  309. package/esm/types/enums.d.ts.map +1 -0
  310. package/esm/types/enums.js +27 -0
  311. package/esm/types/enums.js.map +1 -0
  312. package/esm/types/fp.d.ts +31 -0
  313. package/esm/types/fp.d.ts.map +1 -0
  314. package/esm/types/fp.js +31 -0
  315. package/esm/types/fp.js.map +1 -0
  316. package/esm/types/index.d.ts +10 -0
  317. package/esm/types/index.d.ts.map +1 -0
  318. package/esm/types/index.js +10 -0
  319. package/esm/types/index.js.map +1 -0
  320. package/esm/types/operations.d.ts +27 -0
  321. package/esm/types/operations.d.ts.map +1 -0
  322. package/esm/types/operations.js +77 -0
  323. package/esm/types/operations.js.map +1 -0
  324. package/esm/types/primitives.d.ts +9 -0
  325. package/esm/types/primitives.d.ts.map +1 -0
  326. package/esm/types/primitives.js +109 -0
  327. package/esm/types/primitives.js.map +1 -0
  328. package/esm/types/rfcdate.d.ts +21 -0
  329. package/esm/types/rfcdate.d.ts.map +1 -0
  330. package/esm/types/rfcdate.js +43 -0
  331. package/esm/types/rfcdate.js.map +1 -0
  332. package/esm/types/smart-union.d.ts +7 -0
  333. package/esm/types/smart-union.d.ts.map +1 -0
  334. package/esm/types/smart-union.js +117 -0
  335. package/esm/types/smart-union.js.map +1 -0
  336. package/esm/types/streams.d.ts +2 -0
  337. package/esm/types/streams.d.ts.map +1 -0
  338. package/esm/types/streams.js +15 -0
  339. package/esm/types/streams.js.map +1 -0
  340. package/esm/types/unrecognized.d.ts +16 -0
  341. package/esm/types/unrecognized.d.ts.map +1 -0
  342. package/esm/types/unrecognized.js +31 -0
  343. package/esm/types/unrecognized.js.map +1 -0
  344. package/examples/healthHealthCheck.example.ts +27 -0
  345. package/examples/node_modules/@types/node/assert/strict.d.ts +8 -0
  346. package/examples/node_modules/@types/node/assert.d.ts +1062 -0
  347. package/examples/node_modules/@types/node/async_hooks.d.ts +605 -0
  348. package/examples/node_modules/@types/node/buffer.buffer.d.ts +471 -0
  349. package/examples/node_modules/@types/node/buffer.d.ts +1936 -0
  350. package/examples/node_modules/@types/node/child_process.d.ts +1475 -0
  351. package/examples/node_modules/@types/node/cluster.d.ts +577 -0
  352. package/examples/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  353. package/examples/node_modules/@types/node/compatibility/index.d.ts +9 -0
  354. package/examples/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  355. package/examples/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  356. package/examples/node_modules/@types/node/console.d.ts +452 -0
  357. package/examples/node_modules/@types/node/constants.d.ts +21 -0
  358. package/examples/node_modules/@types/node/crypto.d.ts +4590 -0
  359. package/examples/node_modules/@types/node/dgram.d.ts +597 -0
  360. package/examples/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  361. package/examples/node_modules/@types/node/dns/promises.d.ts +479 -0
  362. package/examples/node_modules/@types/node/dns.d.ts +871 -0
  363. package/examples/node_modules/@types/node/domain.d.ts +170 -0
  364. package/examples/node_modules/@types/node/events.d.ts +977 -0
  365. package/examples/node_modules/@types/node/fs/promises.d.ts +1270 -0
  366. package/examples/node_modules/@types/node/fs.d.ts +4375 -0
  367. package/examples/node_modules/@types/node/globals.d.ts +172 -0
  368. package/examples/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  369. package/examples/node_modules/@types/node/http.d.ts +2049 -0
  370. package/examples/node_modules/@types/node/http2.d.ts +2712 -0
  371. package/examples/node_modules/@types/node/https.d.ts +578 -0
  372. package/examples/node_modules/@types/node/index.d.ts +93 -0
  373. package/examples/node_modules/@types/node/inspector.generated.d.ts +3966 -0
  374. package/examples/node_modules/@types/node/module.d.ts +539 -0
  375. package/examples/node_modules/@types/node/net.d.ts +1031 -0
  376. package/examples/node_modules/@types/node/os.d.ts +506 -0
  377. package/examples/node_modules/@types/node/path.d.ts +200 -0
  378. package/examples/node_modules/@types/node/perf_hooks.d.ts +961 -0
  379. package/examples/node_modules/@types/node/process.d.ts +1961 -0
  380. package/examples/node_modules/@types/node/punycode.d.ts +117 -0
  381. package/examples/node_modules/@types/node/querystring.d.ts +152 -0
  382. package/examples/node_modules/@types/node/readline/promises.d.ts +162 -0
  383. package/examples/node_modules/@types/node/readline.d.ts +589 -0
  384. package/examples/node_modules/@types/node/repl.d.ts +430 -0
  385. package/examples/node_modules/@types/node/sea.d.ts +153 -0
  386. package/examples/node_modules/@types/node/stream/consumers.d.ts +38 -0
  387. package/examples/node_modules/@types/node/stream/promises.d.ts +90 -0
  388. package/examples/node_modules/@types/node/stream/web.d.ts +533 -0
  389. package/examples/node_modules/@types/node/stream.d.ts +1698 -0
  390. package/examples/node_modules/@types/node/string_decoder.d.ts +67 -0
  391. package/examples/node_modules/@types/node/test.d.ts +1787 -0
  392. package/examples/node_modules/@types/node/timers/promises.d.ts +108 -0
  393. package/examples/node_modules/@types/node/timers.d.ts +286 -0
  394. package/examples/node_modules/@types/node/tls.d.ts +1259 -0
  395. package/examples/node_modules/@types/node/trace_events.d.ts +197 -0
  396. package/examples/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  397. package/examples/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  398. package/examples/node_modules/@types/node/ts5.6/index.d.ts +93 -0
  399. package/examples/node_modules/@types/node/tty.d.ts +208 -0
  400. package/examples/node_modules/@types/node/url.d.ts +964 -0
  401. package/examples/node_modules/@types/node/util.d.ts +2331 -0
  402. package/examples/node_modules/@types/node/v8.d.ts +809 -0
  403. package/examples/node_modules/@types/node/vm.d.ts +1001 -0
  404. package/examples/node_modules/@types/node/wasi.d.ts +181 -0
  405. package/examples/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  406. package/examples/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  407. package/examples/node_modules/@types/node/web-globals/events.d.ts +97 -0
  408. package/examples/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
  409. package/examples/node_modules/@types/node/worker_threads.d.ts +715 -0
  410. package/examples/node_modules/@types/node/zlib.d.ts +598 -0
  411. package/examples/node_modules/dotenv/config.d.ts +1 -0
  412. package/examples/node_modules/dotenv/config.js +9 -0
  413. package/examples/node_modules/dotenv/lib/cli-options.js +17 -0
  414. package/examples/node_modules/dotenv/lib/env-options.js +28 -0
  415. package/examples/node_modules/dotenv/lib/main.d.ts +162 -0
  416. package/examples/node_modules/dotenv/lib/main.js +386 -0
  417. package/examples/node_modules/esbuild/install.js +300 -0
  418. package/examples/node_modules/esbuild/lib/main.d.ts +716 -0
  419. package/examples/node_modules/esbuild/lib/main.js +2532 -0
  420. package/examples/node_modules/fsevents/fsevents.d.ts +46 -0
  421. package/examples/node_modules/fsevents/fsevents.js +83 -0
  422. package/examples/node_modules/tsx/dist/cjs/api/index.mjs +1 -0
  423. package/examples/node_modules/tsx/dist/cjs/index.mjs +1 -0
  424. package/examples/node_modules/tsx/dist/cli.mjs +55 -0
  425. package/examples/node_modules/tsx/dist/client-D_mPDF5S.mjs +1 -0
  426. package/examples/node_modules/tsx/dist/esm/api/index.mjs +1 -0
  427. package/examples/node_modules/tsx/dist/esm/index.mjs +1 -0
  428. package/examples/node_modules/tsx/dist/get-pipe-path-_tAJyU_v.mjs +1 -0
  429. package/examples/node_modules/tsx/dist/index-XurvG3JN.mjs +14 -0
  430. package/examples/node_modules/tsx/dist/index-gbaejti9.mjs +1 -0
  431. package/examples/node_modules/tsx/dist/lexer-DQCqS3nf.mjs +3 -0
  432. package/examples/node_modules/tsx/dist/loader.mjs +1 -0
  433. package/examples/node_modules/tsx/dist/node-features-B9BBLzwu.mjs +1 -0
  434. package/examples/node_modules/tsx/dist/package-Bj47PlGH.mjs +1 -0
  435. package/examples/node_modules/tsx/dist/patch-repl.mjs +1 -0
  436. package/examples/node_modules/tsx/dist/preflight.mjs +1 -0
  437. package/examples/node_modules/tsx/dist/register-BnTWPeIB.mjs +10 -0
  438. package/examples/node_modules/tsx/dist/register-CqMfTiWi.mjs +2 -0
  439. package/examples/node_modules/tsx/dist/repl.mjs +3 -0
  440. package/examples/node_modules/tsx/dist/require-DzmC1hVr.mjs +1 -0
  441. package/examples/node_modules/tsx/dist/suppress-warnings.mjs +1 -0
  442. package/examples/node_modules/tsx/dist/temporary-directory-BDDVQOvU.mjs +1 -0
  443. package/examples/node_modules/tsx/dist/types-Cxp8y2TL.d.ts +5 -0
  444. package/examples/node_modules/undici-types/agent.d.ts +31 -0
  445. package/examples/node_modules/undici-types/api.d.ts +43 -0
  446. package/examples/node_modules/undici-types/balanced-pool.d.ts +29 -0
  447. package/examples/node_modules/undici-types/cache.d.ts +36 -0
  448. package/examples/node_modules/undici-types/client.d.ts +108 -0
  449. package/examples/node_modules/undici-types/connector.d.ts +34 -0
  450. package/examples/node_modules/undici-types/content-type.d.ts +21 -0
  451. package/examples/node_modules/undici-types/cookies.d.ts +28 -0
  452. package/examples/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  453. package/examples/node_modules/undici-types/dispatcher.d.ts +256 -0
  454. package/examples/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  455. package/examples/node_modules/undici-types/errors.d.ts +149 -0
  456. package/examples/node_modules/undici-types/eventsource.d.ts +61 -0
  457. package/examples/node_modules/undici-types/fetch.d.ts +209 -0
  458. package/examples/node_modules/undici-types/file.d.ts +39 -0
  459. package/examples/node_modules/undici-types/filereader.d.ts +54 -0
  460. package/examples/node_modules/undici-types/formdata.d.ts +108 -0
  461. package/examples/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  462. package/examples/node_modules/undici-types/global-origin.d.ts +7 -0
  463. package/examples/node_modules/undici-types/handlers.d.ts +15 -0
  464. package/examples/node_modules/undici-types/header.d.ts +4 -0
  465. package/examples/node_modules/undici-types/index.d.ts +71 -0
  466. package/examples/node_modules/undici-types/interceptors.d.ts +17 -0
  467. package/examples/node_modules/undici-types/mock-agent.d.ts +50 -0
  468. package/examples/node_modules/undici-types/mock-client.d.ts +25 -0
  469. package/examples/node_modules/undici-types/mock-errors.d.ts +12 -0
  470. package/examples/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  471. package/examples/node_modules/undici-types/mock-pool.d.ts +25 -0
  472. package/examples/node_modules/undici-types/patch.d.ts +33 -0
  473. package/examples/node_modules/undici-types/pool-stats.d.ts +19 -0
  474. package/examples/node_modules/undici-types/pool.d.ts +39 -0
  475. package/examples/node_modules/undici-types/proxy-agent.d.ts +28 -0
  476. package/examples/node_modules/undici-types/readable.d.ts +65 -0
  477. package/examples/node_modules/undici-types/retry-agent.d.ts +8 -0
  478. package/examples/node_modules/undici-types/retry-handler.d.ts +116 -0
  479. package/examples/node_modules/undici-types/util.d.ts +18 -0
  480. package/examples/node_modules/undici-types/webidl.d.ts +228 -0
  481. package/examples/node_modules/undici-types/websocket.d.ts +150 -0
  482. package/jsr.json +27 -0
  483. package/package.json +63 -0
  484. package/src/core.ts +13 -0
  485. package/src/funcs/cart-cart-add-line.ts +195 -0
  486. package/src/funcs/cart-cart-clear.ts +190 -0
  487. package/src/funcs/cart-cart-create.ts +166 -0
  488. package/src/funcs/cart-cart-get.ts +186 -0
  489. package/src/funcs/cart-cart-remove-line.ts +198 -0
  490. package/src/funcs/cart-cart-update-line.ts +199 -0
  491. package/src/funcs/checkout-checkout-create-session.ts +189 -0
  492. package/src/funcs/health-health-check.ts +158 -0
  493. package/src/funcs/products-products-get-all.ts +158 -0
  494. package/src/funcs/products-products-get-by-id.ts +186 -0
  495. package/src/funcs/store-store-get.ts +162 -0
  496. package/src/funcs/subscription-subscription-create-portal-session.ts +207 -0
  497. package/src/hooks/hooks.ts +129 -0
  498. package/src/hooks/index.ts +6 -0
  499. package/src/hooks/types.ts +108 -0
  500. package/src/index.ts +9 -0
  501. package/src/lib/base64.ts +39 -0
  502. package/src/lib/config.ts +49 -0
  503. package/src/lib/encodings.ts +529 -0
  504. package/src/lib/env.ts +61 -0
  505. package/src/lib/files.ts +104 -0
  506. package/src/lib/http.ts +323 -0
  507. package/src/lib/logger.ts +9 -0
  508. package/src/lib/matchers.ts +353 -0
  509. package/src/lib/primitives.ts +166 -0
  510. package/src/lib/retries.ts +218 -0
  511. package/src/lib/schemas.ts +94 -0
  512. package/src/lib/sdks.ts +442 -0
  513. package/src/lib/security.ts +275 -0
  514. package/src/lib/url.ts +35 -0
  515. package/src/models/errors/cart-add-line.ts +337 -0
  516. package/src/models/errors/cart-clear.ts +282 -0
  517. package/src/models/errors/cart-create.ts +282 -0
  518. package/src/models/errors/cart-get.ts +227 -0
  519. package/src/models/errors/cart-remove-line.ts +337 -0
  520. package/src/models/errors/cart-update-line.ts +337 -0
  521. package/src/models/errors/checkout-create-session.ts +278 -0
  522. package/src/models/errors/health-check.ts +172 -0
  523. package/src/models/errors/http-client-errors.ts +62 -0
  524. package/src/models/errors/index.ts +21 -0
  525. package/src/models/errors/products-get-all.ts +172 -0
  526. package/src/models/errors/products-get-by-id.ts +227 -0
  527. package/src/models/errors/quickshops-default-error.ts +40 -0
  528. package/src/models/errors/quickshops-error.ts +35 -0
  529. package/src/models/errors/response-validation-error.ts +50 -0
  530. package/src/models/errors/sdk-validation-error.ts +54 -0
  531. package/src/models/errors/store-get.ts +227 -0
  532. package/src/models/errors/subscription-create-portal-session.ts +286 -0
  533. package/src/models/index.ts +5 -0
  534. package/src/models/operations/cart-add-line.ts +168 -0
  535. package/src/models/operations/cart-clear.ts +137 -0
  536. package/src/models/operations/cart-create.ts +112 -0
  537. package/src/models/operations/cart-get.ts +129 -0
  538. package/src/models/operations/cart-remove-line.ts +140 -0
  539. package/src/models/operations/cart-update-line.ts +168 -0
  540. package/src/models/operations/checkout-create-session.ts +83 -0
  541. package/src/models/operations/health-check.ts +34 -0
  542. package/src/models/operations/index.ts +16 -0
  543. package/src/models/operations/products-get-all.ts +116 -0
  544. package/src/models/operations/products-get-by-id.ts +141 -0
  545. package/src/models/operations/store-get.ts +96 -0
  546. package/src/models/operations/subscription-create-portal-session.ts +90 -0
  547. package/src/models/security.ts +34 -0
  548. package/src/sdk/cart.ts +97 -0
  549. package/src/sdk/checkout.ts +24 -0
  550. package/src/sdk/health.ts +22 -0
  551. package/src/sdk/index.ts +5 -0
  552. package/src/sdk/products.ts +37 -0
  553. package/src/sdk/sdk.ts +43 -0
  554. package/src/sdk/store.ts +22 -0
  555. package/src/sdk/subscription.ts +24 -0
  556. package/src/types/async.ts +69 -0
  557. package/src/types/blobs.ts +33 -0
  558. package/src/types/const-date-time.ts +15 -0
  559. package/src/types/default-to-zero-value.ts +33 -0
  560. package/src/types/enums.ts +45 -0
  561. package/src/types/fp.ts +50 -0
  562. package/src/types/index.ts +13 -0
  563. package/src/types/operations.ts +105 -0
  564. package/src/types/primitives.ts +140 -0
  565. package/src/types/rfcdate.ts +54 -0
  566. package/src/types/smart-union.ts +153 -0
  567. package/src/types/streams.ts +21 -0
  568. package/src/types/unrecognized.ts +35 -0
@@ -0,0 +1,120 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ class InvariantError extends Error {
5
+ constructor(message) {
6
+ super(message);
7
+ this.name = "InvariantError";
8
+ }
9
+ }
10
+ export function invariant(condition, message) {
11
+ if (!condition) {
12
+ throw new InvariantError(message);
13
+ }
14
+ }
15
+ /**
16
+ * Converts or omits an object's keys according to a mapping.
17
+ *
18
+ * @param inp An object whose keys will be remapped
19
+ * @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object.
20
+ * @returns A new object with keys remapped or omitted according to the mappings
21
+ */
22
+ export function remap(inp, mappings) {
23
+ let out = {};
24
+ if (!Object.keys(mappings).length) {
25
+ out = inp;
26
+ return out;
27
+ }
28
+ for (const [k, v] of Object.entries(inp)) {
29
+ const j = mappings[k];
30
+ if (j === null) {
31
+ continue;
32
+ }
33
+ out[j ?? k] = v;
34
+ }
35
+ return out;
36
+ }
37
+ export function combineSignals(...signals) {
38
+ const filtered = [];
39
+ for (const signal of signals) {
40
+ if (signal) {
41
+ filtered.push(signal);
42
+ }
43
+ }
44
+ switch (filtered.length) {
45
+ case 0:
46
+ case 1:
47
+ return filtered[0] || null;
48
+ default:
49
+ if ("any" in AbortSignal && typeof AbortSignal.any === "function") {
50
+ return AbortSignal.any(filtered);
51
+ }
52
+ return abortSignalAny(filtered);
53
+ }
54
+ }
55
+ export function abortSignalAny(signals) {
56
+ const controller = new AbortController();
57
+ const result = controller.signal;
58
+ if (!signals.length) {
59
+ return controller.signal;
60
+ }
61
+ if (signals.length === 1) {
62
+ return signals[0] || controller.signal;
63
+ }
64
+ for (const signal of signals) {
65
+ if (signal.aborted) {
66
+ return signal;
67
+ }
68
+ }
69
+ function abort() {
70
+ controller.abort(this.reason);
71
+ clean();
72
+ }
73
+ const signalRefs = [];
74
+ function clean() {
75
+ for (const signalRef of signalRefs) {
76
+ const signal = signalRef.deref();
77
+ if (signal) {
78
+ signal.removeEventListener("abort", abort);
79
+ }
80
+ }
81
+ }
82
+ for (const signal of signals) {
83
+ signalRefs.push(new WeakRef(signal));
84
+ signal.addEventListener("abort", abort);
85
+ }
86
+ return result;
87
+ }
88
+ export function compactMap(values) {
89
+ const out = {};
90
+ for (const [k, v] of Object.entries(values)) {
91
+ if (typeof v !== "undefined") {
92
+ out[k] = v;
93
+ }
94
+ }
95
+ return out;
96
+ }
97
+ export function allRequired(v) {
98
+ if (Object.values(v).every((x) => x == null)) {
99
+ return void 0;
100
+ }
101
+ return v;
102
+ }
103
+ export function isPlainObject(value) {
104
+ if (value === null || typeof value !== "object")
105
+ return false;
106
+ if (Object.prototype.toString.call(value) !== "[object Object]")
107
+ return false;
108
+ const proto = Object.getPrototypeOf(value);
109
+ if (proto === null || proto === Object.prototype)
110
+ return true;
111
+ // cross-realm plain objects (vm contexts, iframes) inherit from a
112
+ // different realm's Object.prototype, which itself has a null prototype
113
+ try {
114
+ return Object.getPrototypeOf(proto) === null;
115
+ }
116
+ catch {
117
+ return false;
118
+ }
119
+ }
120
+ //# sourceMappingURL=primitives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/lib/primitives.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,cAAe,SAAQ,KAAK;IAChC,YAAY,OAAe,EAAE;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAAA,CAC9B;CACF;AAED,MAAM,UAAU,SAAS,CACvB,SAAkB,EAClB,OAAe,EACI;IACnB,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;AAAA,CACF;AAcD;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAGnB,GAAQ,EAAE,QAAiB,EAAuB;IAClD,IAAI,GAAG,GAAQ,EAAE,CAAC;IAElB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;QAClC,GAAG,GAAG,GAAG,CAAC;QACV,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YACf,SAAS;QACX,CAAC;QACD,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,GAAG,CAAC;AAAA,CACZ;AAED,MAAM,UAAU,cAAc,CAC5B,GAAG,OAA8C,EAC7B;IACpB,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC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AAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC9D,kEAAkE;IAClE,wEAAwE;IACxE,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AAAA,CACF"}
@@ -0,0 +1,38 @@
1
+ export type BackoffStrategy = {
2
+ initialInterval: number;
3
+ maxInterval: number;
4
+ exponent: number;
5
+ maxElapsedTime: number;
6
+ };
7
+ export type RetryConfig = {
8
+ strategy: "none";
9
+ } | {
10
+ strategy: "backoff";
11
+ backoff?: BackoffStrategy;
12
+ retryConnectionErrors?: boolean;
13
+ };
14
+ /**
15
+ * PermanentError is an error that is not recoverable. Throwing this error will
16
+ * cause a retry loop to terminate.
17
+ */
18
+ export declare class PermanentError extends Error {
19
+ /** The underlying cause of the error. */
20
+ readonly cause: unknown;
21
+ constructor(message: string, options?: {
22
+ cause?: unknown;
23
+ });
24
+ }
25
+ /**
26
+ * TemporaryError is an error is used to signal that an HTTP request can be
27
+ * retried as part of a retry loop. If retry attempts are exhausted and this
28
+ * error is thrown, the response will be returned to the caller.
29
+ */
30
+ export declare class TemporaryError extends Error {
31
+ response: Response;
32
+ constructor(message: string, response: Response);
33
+ }
34
+ export declare function retry(fetchFn: () => Promise<Response>, options: {
35
+ config: RetryConfig;
36
+ statusCodes: string[];
37
+ }): Promise<Response>;
38
+ //# sourceMappingURL=retries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retries.d.ts","sourceRoot":"","sources":["../../src/lib/retries.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AASF,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpB;IACE,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEN;;;GAGG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,yCAAyC;IACzC,SAAkB,KAAK,EAAE,OAAO,CAAC;IAEjC,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAezD;CACF;AAED;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,EAAE,QAAQ,CAAC;IAEnB,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAM9C;CACF;AAED,wBAAsB,KAAK,CACzB,OAAO,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,EAChC,OAAO,EAAE;IACP,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,GACA,OAAO,CAAC,QAAQ,CAAC,CAanB"}
@@ -0,0 +1,150 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import { isConnectionError, isTimeoutError } from "./http.js";
5
+ const defaultBackoff = {
6
+ initialInterval: 500,
7
+ maxInterval: 60000,
8
+ exponent: 1.5,
9
+ maxElapsedTime: 3600000,
10
+ };
11
+ /**
12
+ * PermanentError is an error that is not recoverable. Throwing this error will
13
+ * cause a retry loop to terminate.
14
+ */
15
+ export class PermanentError extends Error {
16
+ /** The underlying cause of the error. */
17
+ cause;
18
+ constructor(message, options) {
19
+ let msg = message;
20
+ if (options?.cause) {
21
+ msg += `: ${options.cause}`;
22
+ }
23
+ super(msg, options);
24
+ this.name = "PermanentError";
25
+ // In older runtimes, the cause field would not have been assigned through
26
+ // the super() call.
27
+ if (typeof this.cause === "undefined") {
28
+ this.cause = options?.cause;
29
+ }
30
+ Object.setPrototypeOf(this, PermanentError.prototype);
31
+ }
32
+ }
33
+ /**
34
+ * TemporaryError is an error is used to signal that an HTTP request can be
35
+ * retried as part of a retry loop. If retry attempts are exhausted and this
36
+ * error is thrown, the response will be returned to the caller.
37
+ */
38
+ export class TemporaryError extends Error {
39
+ response;
40
+ constructor(message, response) {
41
+ super(message);
42
+ this.response = response;
43
+ this.name = "TemporaryError";
44
+ Object.setPrototypeOf(this, TemporaryError.prototype);
45
+ }
46
+ }
47
+ export async function retry(fetchFn, options) {
48
+ switch (options.config.strategy) {
49
+ case "backoff":
50
+ return retryBackoff(wrapFetcher(fetchFn, {
51
+ statusCodes: options.statusCodes,
52
+ retryConnectionErrors: !!options.config.retryConnectionErrors,
53
+ }), options.config.backoff ?? defaultBackoff);
54
+ default:
55
+ return await fetchFn();
56
+ }
57
+ }
58
+ function wrapFetcher(fn, options) {
59
+ return async () => {
60
+ try {
61
+ const res = await fn();
62
+ if (isRetryableResponse(res, options.statusCodes)) {
63
+ throw new TemporaryError("Response failed with retryable status code", res);
64
+ }
65
+ return res;
66
+ }
67
+ catch (err) {
68
+ if (err instanceof TemporaryError) {
69
+ throw err;
70
+ }
71
+ if (options.retryConnectionErrors &&
72
+ (isTimeoutError(err) || isConnectionError(err))) {
73
+ throw err;
74
+ }
75
+ throw new PermanentError("Permanent error", { cause: err });
76
+ }
77
+ };
78
+ }
79
+ const codeRangeRE = new RegExp("^[0-9]xx$", "i");
80
+ function isRetryableResponse(res, statusCodes) {
81
+ const actual = `${res.status}`;
82
+ return statusCodes.some((code) => {
83
+ if (!codeRangeRE.test(code)) {
84
+ return code === actual;
85
+ }
86
+ const expectFamily = code.charAt(0);
87
+ if (!expectFamily) {
88
+ throw new Error("Invalid status code range");
89
+ }
90
+ const actualFamily = actual.charAt(0);
91
+ if (!actualFamily) {
92
+ throw new Error(`Invalid response status code: ${actual}`);
93
+ }
94
+ return actualFamily === expectFamily;
95
+ });
96
+ }
97
+ async function retryBackoff(fn, strategy) {
98
+ const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy;
99
+ const start = Date.now();
100
+ let x = 0;
101
+ while (true) {
102
+ try {
103
+ const res = await fn();
104
+ return res;
105
+ }
106
+ catch (err) {
107
+ if (err instanceof PermanentError) {
108
+ throw err.cause;
109
+ }
110
+ const elapsed = Date.now() - start;
111
+ if (elapsed > maxElapsedTime) {
112
+ if (err instanceof TemporaryError) {
113
+ return err.response;
114
+ }
115
+ throw err;
116
+ }
117
+ let retryInterval = 0;
118
+ if (err instanceof TemporaryError) {
119
+ retryInterval = retryIntervalFromResponse(err.response);
120
+ }
121
+ if (retryInterval <= 0) {
122
+ retryInterval =
123
+ initialInterval * Math.pow(x, exponent) + Math.random() * 1000;
124
+ }
125
+ const d = Math.min(retryInterval, maxInterval);
126
+ await delay(d);
127
+ x++;
128
+ }
129
+ }
130
+ }
131
+ function retryIntervalFromResponse(res) {
132
+ const retryVal = res.headers.get("retry-after") || "";
133
+ if (!retryVal) {
134
+ return 0;
135
+ }
136
+ const parsedNumber = Number(retryVal);
137
+ if (Number.isInteger(parsedNumber)) {
138
+ return parsedNumber * 1000;
139
+ }
140
+ const parsedDate = Date.parse(retryVal);
141
+ if (Number.isInteger(parsedDate)) {
142
+ const deltaMS = parsedDate - Date.now();
143
+ return deltaMS > 0 ? Math.ceil(deltaMS) : 0;
144
+ }
145
+ return 0;
146
+ }
147
+ async function delay(delay) {
148
+ return new Promise((resolve) => setTimeout(resolve, delay));
149
+ }
150
+ //# sourceMappingURL=retries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retries.js","sourceRoot":"","sources":["../../src/lib/retries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAS9D,MAAM,c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AC;AAAA,CACV;AAED,KAAK,UAAU,KAAK,CAAC,KAAa,EAAiB;IACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAAA,CAC7D"}
@@ -0,0 +1,21 @@
1
+ import * as z from "zod/v4-mini";
2
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
3
+ import { Result } from "../types/fp.js";
4
+ /**
5
+ * Utility function that executes some code which may throw a ZodError. It
6
+ * intercepts this error and converts it to an SDKValidationError so as to not
7
+ * leak Zod implementation details to user code.
8
+ */
9
+ export declare function parse<Inp, Out>(rawValue: Inp, fn: (value: Inp) => Out, errorMessage: string): Out;
10
+ /**
11
+ * Utility function that executes some code which may result in a ZodError. It
12
+ * intercepts this error and converts it to an SDKValidationError so as to not
13
+ * leak Zod implementation details to user code.
14
+ */
15
+ export declare function safeParse<Inp, Out>(rawValue: Inp, fn: (value: Inp) => Out, errorMessage: string): Result<Out, SDKValidationError>;
16
+ export declare function collectExtraKeys<Shape extends z.core.$ZodShape, Catchall extends z.ZodMiniType, K extends string, Optional extends boolean>(obj: z.ZodMiniObject<Shape, z.core.$catchall<Catchall>>, extrasKey: K, optional: Optional): z.ZodMiniPipe<z.ZodMiniObject<Shape, z.core.$catchall<Catchall>>, z.ZodMiniTransform<z.output<z.ZodMiniObject<Shape, z.core.$strip>> & (Optional extends false ? {
17
+ [k in K]: Record<string, z.output<Catchall>>;
18
+ } : {
19
+ [k in K]?: Record<string, z.output<Catchall>> | undefined;
20
+ }), z.output<z.ZodMiniObject<Shape, z.core.$catchall<Catchall>>>>>;
21
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/lib/schemas.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM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C,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS;CAC1D,CAAC,EACJ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC7D,CACF,CA2BA"}
@@ -0,0 +1,57 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+ import * as z from "zod/v4-mini";
5
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
6
+ import { ERR, OK } from "../types/fp.js";
7
+ /**
8
+ * Utility function that executes some code which may throw a ZodError. It
9
+ * intercepts this error and converts it to an SDKValidationError so as to not
10
+ * leak Zod implementation details to user code.
11
+ */
12
+ export function parse(rawValue, fn, errorMessage) {
13
+ try {
14
+ return fn(rawValue);
15
+ }
16
+ catch (err) {
17
+ if (err instanceof z.core.$ZodError) {
18
+ throw new SDKValidationError(errorMessage, err, rawValue);
19
+ }
20
+ throw err;
21
+ }
22
+ }
23
+ /**
24
+ * Utility function that executes some code which may result in a ZodError. It
25
+ * intercepts this error and converts it to an SDKValidationError so as to not
26
+ * leak Zod implementation details to user code.
27
+ */
28
+ export function safeParse(rawValue, fn, errorMessage) {
29
+ try {
30
+ return OK(fn(rawValue));
31
+ }
32
+ catch (err) {
33
+ return ERR(new SDKValidationError(errorMessage, err, rawValue));
34
+ }
35
+ }
36
+ export function collectExtraKeys(obj, extrasKey, optional) {
37
+ return z.pipe(obj, z.transform((val) => {
38
+ const extras = {};
39
+ const { shape } = obj;
40
+ for (const [key] of Object.entries(val)) {
41
+ if (key in shape) {
42
+ continue;
43
+ }
44
+ const v = val[key];
45
+ if (typeof v === "undefined") {
46
+ continue;
47
+ }
48
+ extras[key] = v;
49
+ delete val[key];
50
+ }
51
+ if (optional && Object.keys(extras).length === 0) {
52
+ return val;
53
+ }
54
+ return { ...val, [extrasKey]: extras };
55
+ }));
56
+ }
57
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/lib/schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,GAAG,EAAE,EAAE,EAAU,MAAM,gBAAgB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,KAAK,CACnB,QAAa,EACb,EAAuB,EACvB,YAAoB,EACf;IACL,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,MAAM,IAAI,kBAAkB,CAAC,YAAY,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC5D,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AAAA,CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CACvB,QAAa,EACb,EAAuB,EACvB,YAAoB,EACa;IACjC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,GAAG,CAAC,IAAI,kBAAkB,CAAC,YAAY,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;IAClE,CAAC;AAAA,CACF;AAED,MAAM,UAAU,gBAAgB,CAM9B,GAAuD,EACvD,SAAY,EACZ,QAAkB,EAalB;IACA,OAAO,CAAC,CAAC,IAAI,CACX,GAAG,EACH,CAAC,CAAC,SAAS,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC;QACxB,MAAM,MAAM,GAAuC,EAAE,CAAC;QACtD,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC;QACtB,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,IAAI,GAAG,IAAI,KAAK,EAAE,CAAC;gBACjB,SAAS;YACX,CAAC;YAED,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YACnB,IAAI,OAAO,CAAC,KAAK,WAAW,EAAE,CAAC;gBAC7B,SAAS;YACX,CAAC;YAED,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAChB,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QAED,IAAI,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjD,OAAO,GAAG,CAAC;QACb,CAAC;QAED,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAAA,CACxC,CAAC,CACH,CAAC;AAAA,CACH"}
@@ -0,0 +1,63 @@
1
+ import { SDKHooks } from "../hooks/hooks.js";
2
+ import { HookContext } from "../hooks/types.js";
3
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/http-client-errors.js";
4
+ import { Result } from "../types/fp.js";
5
+ import { SDKOptions } from "./config.js";
6
+ import { RetryConfig } from "./retries.js";
7
+ import { SecurityState } from "./security.js";
8
+ export type RequestOptions = {
9
+ /**
10
+ * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If
11
+ * `fetchOptions.signal` is set then it will take precedence over this option.
12
+ */
13
+ timeoutMs?: number;
14
+ /**
15
+ * Set or override a retry policy on HTTP calls.
16
+ */
17
+ retries?: RetryConfig;
18
+ /**
19
+ * Specifies the status codes which should be retried using the given retry policy.
20
+ */
21
+ retryCodes?: string[];
22
+ /**
23
+ * Overrides the base server URL that will be used by an operation.
24
+ */
25
+ serverURL?: string | URL;
26
+ /**
27
+ * @deprecated `fetchOptions` has been flattened into `RequestOptions`.
28
+ *
29
+ * Sets various request options on the `fetch` call made by an SDK method.
30
+ *
31
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request}
32
+ */
33
+ fetchOptions?: Omit<RequestInit, "method" | "body">;
34
+ } & Omit<RequestInit, "method" | "body">;
35
+ type RequestConfig = {
36
+ method: string;
37
+ path: string;
38
+ baseURL?: string | URL | undefined;
39
+ query?: string;
40
+ body?: RequestInit["body"];
41
+ headers?: HeadersInit;
42
+ security?: SecurityState | null;
43
+ uaHeader?: string;
44
+ userAgent?: string | undefined;
45
+ timeoutMs?: number;
46
+ };
47
+ export declare class ClientSDK {
48
+ #private;
49
+ readonly _baseURL: URL | null;
50
+ readonly _options: SDKOptions & {
51
+ hooks?: SDKHooks;
52
+ };
53
+ constructor(options: SDKOptions);
54
+ _createRequest(context: HookContext, conf: RequestConfig, options?: RequestOptions): Result<Request, InvalidRequestError | UnexpectedClientError>;
55
+ _do(request: Request, options: {
56
+ context: HookContext;
57
+ isErrorStatusCode: (statusCode: number) => boolean;
58
+ retryConfig: RetryConfig;
59
+ retryCodes: string[];
60
+ }): Promise<Result<Response, RequestAbortedError | RequestTimeoutError | ConnectionError | UnexpectedClientError>>;
61
+ }
62
+ export {};
63
+ //# sourceMappingURL=sdks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdks.d.ts","sourceRoot":"","sources":["../../src/lib/sdks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAW,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EA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