@snagsolutions/sdk 0.1.0-alpha.230 → 0.1.0-alpha.232

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 (786) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +42 -112
  3. package/_shims/MultipartBody.d.ts +9 -0
  4. package/_shims/MultipartBody.d.ts.map +1 -0
  5. package/_shims/MultipartBody.js +16 -0
  6. package/_shims/MultipartBody.js.map +1 -0
  7. package/_shims/MultipartBody.mjs +12 -0
  8. package/_shims/MultipartBody.mjs.map +1 -0
  9. package/_shims/README.md +46 -0
  10. package/_shims/auto/runtime-bun.d.ts +5 -0
  11. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  12. package/_shims/auto/runtime-bun.js +21 -0
  13. package/_shims/auto/runtime-bun.js.map +1 -0
  14. package/_shims/auto/runtime-bun.mjs +2 -0
  15. package/_shims/auto/runtime-bun.mjs.map +1 -0
  16. package/_shims/auto/runtime-node.d.ts +5 -0
  17. package/_shims/auto/runtime-node.d.ts.map +1 -0
  18. package/_shims/auto/runtime-node.js +21 -0
  19. package/_shims/auto/runtime-node.js.map +1 -0
  20. package/_shims/auto/runtime-node.mjs +2 -0
  21. package/_shims/auto/runtime-node.mjs.map +1 -0
  22. package/_shims/auto/runtime.d.ts +5 -0
  23. package/_shims/auto/runtime.d.ts.map +1 -0
  24. package/_shims/auto/runtime.js +21 -0
  25. package/_shims/auto/runtime.js.map +1 -0
  26. package/_shims/auto/runtime.mjs +2 -0
  27. package/_shims/auto/runtime.mjs.map +1 -0
  28. package/_shims/auto/types-node.d.ts +5 -0
  29. package/_shims/auto/types-node.d.ts.map +1 -0
  30. package/_shims/auto/types-node.js +21 -0
  31. package/_shims/auto/types-node.js.map +1 -0
  32. package/_shims/auto/types-node.mjs +2 -0
  33. package/_shims/auto/types-node.mjs.map +1 -0
  34. package/_shims/auto/types.d.ts +101 -0
  35. package/_shims/auto/types.js +3 -0
  36. package/_shims/auto/types.mjs +3 -0
  37. package/_shims/bun-runtime.d.ts +6 -0
  38. package/_shims/bun-runtime.d.ts.map +1 -0
  39. package/_shims/bun-runtime.js +14 -0
  40. package/_shims/bun-runtime.js.map +1 -0
  41. package/_shims/bun-runtime.mjs +10 -0
  42. package/_shims/bun-runtime.mjs.map +1 -0
  43. package/_shims/index.d.ts +83 -0
  44. package/_shims/index.js +17 -0
  45. package/_shims/index.mjs +11 -0
  46. package/_shims/manual-types.d.ts +12 -0
  47. package/_shims/manual-types.js +3 -0
  48. package/_shims/manual-types.mjs +3 -0
  49. package/_shims/node-runtime.d.ts +3 -0
  50. package/_shims/node-runtime.d.ts.map +1 -0
  51. package/_shims/node-runtime.js +89 -0
  52. package/_shims/node-runtime.js.map +1 -0
  53. package/_shims/node-runtime.mjs +56 -0
  54. package/_shims/node-runtime.mjs.map +1 -0
  55. package/_shims/node-types.d.ts +42 -0
  56. package/_shims/node-types.js +3 -0
  57. package/_shims/node-types.mjs +3 -0
  58. package/_shims/registry.d.ts +37 -0
  59. package/_shims/registry.d.ts.map +1 -0
  60. package/_shims/registry.js +41 -0
  61. package/_shims/registry.js.map +1 -0
  62. package/_shims/registry.mjs +37 -0
  63. package/_shims/registry.mjs.map +1 -0
  64. package/_shims/web-runtime.d.ts +5 -0
  65. package/_shims/web-runtime.d.ts.map +1 -0
  66. package/_shims/web-runtime.js +78 -0
  67. package/_shims/web-runtime.js.map +1 -0
  68. package/_shims/web-runtime.mjs +71 -0
  69. package/_shims/web-runtime.mjs.map +1 -0
  70. package/_shims/web-types.d.ts +83 -0
  71. package/_shims/web-types.js +3 -0
  72. package/_shims/web-types.mjs +3 -0
  73. package/core.d.ts +255 -0
  74. package/core.d.ts.map +1 -0
  75. package/core.js +929 -0
  76. package/core.js.map +1 -0
  77. package/core.mjs +897 -0
  78. package/core.mjs.map +1 -0
  79. package/error.d.ts +46 -1
  80. package/error.d.ts.map +1 -1
  81. package/error.js +110 -3
  82. package/error.js.map +1 -1
  83. package/error.mjs +96 -1
  84. package/error.mjs.map +1 -1
  85. package/index.d.mts +138 -6
  86. package/index.d.ts +137 -5
  87. package/index.d.ts.map +1 -1
  88. package/index.js +136 -12
  89. package/index.js.map +1 -1
  90. package/index.mjs +109 -5
  91. package/index.mjs.map +1 -1
  92. package/internal/qs/formats.d.ts +0 -1
  93. package/internal/qs/formats.d.ts.map +1 -1
  94. package/internal/qs/formats.js +2 -4
  95. package/internal/qs/formats.js.map +1 -1
  96. package/internal/qs/formats.mjs +1 -2
  97. package/internal/qs/formats.mjs.map +1 -1
  98. package/internal/qs/index.d.ts.map +1 -1
  99. package/internal/qs/stringify.d.ts.map +1 -1
  100. package/internal/qs/stringify.js +19 -16
  101. package/internal/qs/stringify.js.map +1 -1
  102. package/internal/qs/stringify.mjs +19 -17
  103. package/internal/qs/stringify.mjs.map +1 -1
  104. package/internal/qs/utils.d.ts +0 -1
  105. package/internal/qs/utils.d.ts.map +1 -1
  106. package/internal/qs/utils.js +21 -22
  107. package/internal/qs/utils.js.map +1 -1
  108. package/internal/qs/utils.mjs +12 -12
  109. package/internal/qs/utils.mjs.map +1 -1
  110. package/package.json +65 -101
  111. package/resource.d.ts +5 -1
  112. package/resource.d.ts.map +1 -1
  113. package/resource.js +8 -3
  114. package/resource.js.map +1 -1
  115. package/resource.mjs +6 -1
  116. package/resource.mjs.map +1 -1
  117. package/resources/assets.d.ts +3 -4
  118. package/resources/assets.d.ts.map +1 -1
  119. package/resources/assets.js +1 -1
  120. package/resources/assets.js.map +1 -1
  121. package/resources/assets.mjs +1 -1
  122. package/resources/assets.mjs.map +1 -1
  123. package/resources/auctions/auctions.d.ts +6 -6
  124. package/resources/auctions/auctions.d.ts.map +1 -1
  125. package/resources/auctions/auctions.js +29 -11
  126. package/resources/auctions/auctions.js.map +1 -1
  127. package/resources/auctions/auctions.mjs +5 -9
  128. package/resources/auctions/auctions.mjs.map +1 -1
  129. package/resources/auctions/index.d.ts.map +1 -1
  130. package/resources/auctions/website-user-attributes/index.d.ts.map +1 -1
  131. package/resources/auctions/website-user-attributes/values.d.ts +4 -5
  132. package/resources/auctions/website-user-attributes/values.d.ts.map +1 -1
  133. package/resources/auctions/website-user-attributes/values.js +1 -1
  134. package/resources/auctions/website-user-attributes/values.js.map +1 -1
  135. package/resources/auctions/website-user-attributes/values.mjs +1 -1
  136. package/resources/auctions/website-user-attributes/values.mjs.map +1 -1
  137. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts +6 -6
  138. package/resources/auctions/website-user-attributes/website-user-attributes.d.ts.map +1 -1
  139. package/resources/auctions/website-user-attributes/website-user-attributes.js +31 -15
  140. package/resources/auctions/website-user-attributes/website-user-attributes.js.map +1 -1
  141. package/resources/auctions/website-user-attributes/website-user-attributes.mjs +7 -13
  142. package/resources/auctions/website-user-attributes/website-user-attributes.mjs.map +1 -1
  143. package/resources/auctions/website-user-attributes.d.ts.map +1 -1
  144. package/resources/auctions/website-user-attributes.js +15 -2
  145. package/resources/auctions/website-user-attributes.js.map +1 -1
  146. package/resources/auctions.d.ts.map +1 -1
  147. package/resources/auctions.js +15 -2
  148. package/resources/auctions.js.map +1 -1
  149. package/resources/auth.d.ts +52 -5
  150. package/resources/auth.d.ts.map +1 -1
  151. package/resources/auth.js +11 -5
  152. package/resources/auth.js.map +1 -1
  153. package/resources/auth.mjs +11 -5
  154. package/resources/auth.mjs.map +1 -1
  155. package/resources/index.d.ts +1 -1
  156. package/resources/index.d.ts.map +1 -1
  157. package/resources/index.js.map +1 -1
  158. package/resources/index.mjs +1 -1
  159. package/resources/index.mjs.map +1 -1
  160. package/resources/loyalty/account-streaks.d.ts +3 -4
  161. package/resources/loyalty/account-streaks.d.ts.map +1 -1
  162. package/resources/loyalty/account-streaks.js +1 -1
  163. package/resources/loyalty/account-streaks.js.map +1 -1
  164. package/resources/loyalty/account-streaks.mjs +1 -1
  165. package/resources/loyalty/account-streaks.mjs.map +1 -1
  166. package/resources/loyalty/accounts.d.ts +5 -5
  167. package/resources/loyalty/accounts.d.ts.map +1 -1
  168. package/resources/loyalty/accounts.js +6 -11
  169. package/resources/loyalty/accounts.js.map +1 -1
  170. package/resources/loyalty/accounts.mjs +6 -11
  171. package/resources/loyalty/accounts.mjs.map +1 -1
  172. package/resources/loyalty/badges.d.ts +12 -9
  173. package/resources/loyalty/badges.d.ts.map +1 -1
  174. package/resources/loyalty/badges.js +18 -44
  175. package/resources/loyalty/badges.js.map +1 -1
  176. package/resources/loyalty/badges.mjs +18 -44
  177. package/resources/loyalty/badges.mjs.map +1 -1
  178. package/resources/loyalty/currencies.d.ts +4 -5
  179. package/resources/loyalty/currencies.d.ts.map +1 -1
  180. package/resources/loyalty/currencies.js +1 -1
  181. package/resources/loyalty/currencies.js.map +1 -1
  182. package/resources/loyalty/currencies.mjs +1 -1
  183. package/resources/loyalty/currencies.mjs.map +1 -1
  184. package/resources/loyalty/index.d.ts.map +1 -1
  185. package/resources/loyalty/loyalty.d.ts +1 -1
  186. package/resources/loyalty/loyalty.d.ts.map +1 -1
  187. package/resources/loyalty/loyalty.js +35 -13
  188. package/resources/loyalty/loyalty.js.map +1 -1
  189. package/resources/loyalty/loyalty.mjs +1 -1
  190. package/resources/loyalty/multipliers.d.ts +10 -9
  191. package/resources/loyalty/multipliers.d.ts.map +1 -1
  192. package/resources/loyalty/multipliers.js +14 -26
  193. package/resources/loyalty/multipliers.js.map +1 -1
  194. package/resources/loyalty/multipliers.mjs +14 -26
  195. package/resources/loyalty/multipliers.mjs.map +1 -1
  196. package/resources/loyalty/questions-responses.d.ts +5 -5
  197. package/resources/loyalty/questions-responses.d.ts.map +1 -1
  198. package/resources/loyalty/questions-responses.js +5 -11
  199. package/resources/loyalty/questions-responses.js.map +1 -1
  200. package/resources/loyalty/questions-responses.mjs +5 -11
  201. package/resources/loyalty/questions-responses.mjs.map +1 -1
  202. package/resources/loyalty/questions.d.ts +5 -6
  203. package/resources/loyalty/questions.d.ts.map +1 -1
  204. package/resources/loyalty/questions.js +2 -3
  205. package/resources/loyalty/questions.js.map +1 -1
  206. package/resources/loyalty/questions.mjs +2 -3
  207. package/resources/loyalty/questions.mjs.map +1 -1
  208. package/resources/loyalty/rule-edits.d.ts +4 -5
  209. package/resources/loyalty/rule-edits.d.ts.map +1 -1
  210. package/resources/loyalty/rule-edits.js +2 -3
  211. package/resources/loyalty/rule-edits.js.map +1 -1
  212. package/resources/loyalty/rule-edits.mjs +2 -3
  213. package/resources/loyalty/rule-edits.mjs.map +1 -1
  214. package/resources/loyalty/rule-groups.d.ts +8 -7
  215. package/resources/loyalty/rule-groups.d.ts.map +1 -1
  216. package/resources/loyalty/rule-groups.js +10 -24
  217. package/resources/loyalty/rule-groups.js.map +1 -1
  218. package/resources/loyalty/rule-groups.mjs +10 -24
  219. package/resources/loyalty/rule-groups.mjs.map +1 -1
  220. package/resources/loyalty/rules.d.ts +12 -9
  221. package/resources/loyalty/rules.d.ts.map +1 -1
  222. package/resources/loyalty/rules.js +18 -48
  223. package/resources/loyalty/rules.js.map +1 -1
  224. package/resources/loyalty/rules.mjs +18 -48
  225. package/resources/loyalty/rules.mjs.map +1 -1
  226. package/resources/loyalty/transactions/index.d.ts.map +1 -1
  227. package/resources/loyalty/transactions/posts.d.ts +5 -5
  228. package/resources/loyalty/transactions/posts.d.ts.map +1 -1
  229. package/resources/loyalty/transactions/posts.js +6 -14
  230. package/resources/loyalty/transactions/posts.js.map +1 -1
  231. package/resources/loyalty/transactions/posts.mjs +6 -14
  232. package/resources/loyalty/transactions/posts.mjs.map +1 -1
  233. package/resources/loyalty/transactions/rule-statuses.d.ts +5 -5
  234. package/resources/loyalty/transactions/rule-statuses.d.ts.map +1 -1
  235. package/resources/loyalty/transactions/rule-statuses.js +5 -10
  236. package/resources/loyalty/transactions/rule-statuses.js.map +1 -1
  237. package/resources/loyalty/transactions/rule-statuses.mjs +5 -10
  238. package/resources/loyalty/transactions/rule-statuses.mjs.map +1 -1
  239. package/resources/loyalty/transactions/transactions.d.ts +8 -8
  240. package/resources/loyalty/transactions/transactions.d.ts.map +1 -1
  241. package/resources/loyalty/transactions/transactions.js +30 -14
  242. package/resources/loyalty/transactions/transactions.js.map +1 -1
  243. package/resources/loyalty/transactions/transactions.mjs +5 -11
  244. package/resources/loyalty/transactions/transactions.mjs.map +1 -1
  245. package/resources/loyalty/transactions.d.ts.map +1 -1
  246. package/resources/loyalty/transactions.js +15 -2
  247. package/resources/loyalty/transactions.js.map +1 -1
  248. package/resources/loyalty.d.ts.map +1 -1
  249. package/resources/loyalty.js +15 -2
  250. package/resources/loyalty.js.map +1 -1
  251. package/resources/minting/allowlist.d.ts +4 -5
  252. package/resources/minting/allowlist.d.ts.map +1 -1
  253. package/resources/minting/allowlist.js +1 -1
  254. package/resources/minting/allowlist.js.map +1 -1
  255. package/resources/minting/allowlist.mjs +1 -1
  256. package/resources/minting/allowlist.mjs.map +1 -1
  257. package/resources/minting/contracts.d.ts +5 -5
  258. package/resources/minting/contracts.d.ts.map +1 -1
  259. package/resources/minting/contracts.js +5 -9
  260. package/resources/minting/contracts.js.map +1 -1
  261. package/resources/minting/contracts.mjs +5 -9
  262. package/resources/minting/contracts.mjs.map +1 -1
  263. package/resources/minting/index.d.ts.map +1 -1
  264. package/resources/minting/minting.d.ts +4 -5
  265. package/resources/minting/minting.d.ts.map +1 -1
  266. package/resources/minting/minting.js +27 -5
  267. package/resources/minting/minting.js.map +1 -1
  268. package/resources/minting/minting.mjs +1 -1
  269. package/resources/minting/minting.mjs.map +1 -1
  270. package/resources/minting/status.d.ts +4 -5
  271. package/resources/minting/status.d.ts.map +1 -1
  272. package/resources/minting/status.js +3 -4
  273. package/resources/minting/status.js.map +1 -1
  274. package/resources/minting/status.mjs +3 -4
  275. package/resources/minting/status.mjs.map +1 -1
  276. package/resources/minting.d.ts.map +1 -1
  277. package/resources/minting.js +15 -2
  278. package/resources/minting.js.map +1 -1
  279. package/resources/referral/index.d.ts.map +1 -1
  280. package/resources/referral/referral.d.ts +3 -4
  281. package/resources/referral/referral.d.ts.map +1 -1
  282. package/resources/referral/referral.js +25 -3
  283. package/resources/referral/referral.js.map +1 -1
  284. package/resources/referral/referral.mjs +1 -1
  285. package/resources/referral/referral.mjs.map +1 -1
  286. package/resources/referral/users.d.ts +5 -5
  287. package/resources/referral/users.d.ts.map +1 -1
  288. package/resources/referral/users.js +5 -9
  289. package/resources/referral/users.js.map +1 -1
  290. package/resources/referral/users.mjs +5 -9
  291. package/resources/referral/users.mjs.map +1 -1
  292. package/resources/referral.d.ts.map +1 -1
  293. package/resources/referral.js +15 -2
  294. package/resources/referral.js.map +1 -1
  295. package/resources/token-claims.d.ts +10 -9
  296. package/resources/token-claims.d.ts.map +1 -1
  297. package/resources/token-claims.js +16 -16
  298. package/resources/token-claims.js.map +1 -1
  299. package/resources/token-claims.mjs +16 -16
  300. package/resources/token-claims.mjs.map +1 -1
  301. package/resources/users/index.d.ts.map +1 -1
  302. package/resources/users/metadatas.d.ts +6 -5
  303. package/resources/users/metadatas.d.ts.map +1 -1
  304. package/resources/users/metadatas.js +8 -17
  305. package/resources/users/metadatas.js.map +1 -1
  306. package/resources/users/metadatas.mjs +8 -17
  307. package/resources/users/metadatas.mjs.map +1 -1
  308. package/resources/users/users.d.ts +13 -9
  309. package/resources/users/users.d.ts.map +1 -1
  310. package/resources/users/users.js +29 -11
  311. package/resources/users/users.js.map +1 -1
  312. package/resources/users/users.mjs +5 -9
  313. package/resources/users/users.mjs.map +1 -1
  314. package/resources/users.d.ts.map +1 -1
  315. package/resources/users.js +15 -2
  316. package/resources/users.js.map +1 -1
  317. package/resources/websites/index.d.ts.map +1 -1
  318. package/resources/websites/website-collections.d.ts +4 -5
  319. package/resources/websites/website-collections.d.ts.map +1 -1
  320. package/resources/websites/website-collections.js +2 -3
  321. package/resources/websites/website-collections.js.map +1 -1
  322. package/resources/websites/website-collections.mjs +2 -3
  323. package/resources/websites/website-collections.mjs.map +1 -1
  324. package/resources/websites/website-user-roles.d.ts +4 -5
  325. package/resources/websites/website-user-roles.d.ts.map +1 -1
  326. package/resources/websites/website-user-roles.js +1 -1
  327. package/resources/websites/website-user-roles.js.map +1 -1
  328. package/resources/websites/website-user-roles.mjs +1 -1
  329. package/resources/websites/website-user-roles.mjs.map +1 -1
  330. package/resources/websites/websites.d.ts +5 -5
  331. package/resources/websites/websites.d.ts.map +1 -1
  332. package/resources/websites/websites.js +30 -13
  333. package/resources/websites/websites.js.map +1 -1
  334. package/resources/websites/websites.mjs +5 -10
  335. package/resources/websites/websites.mjs.map +1 -1
  336. package/resources/websites.d.ts.map +1 -1
  337. package/resources/websites.js +15 -2
  338. package/resources/websites.js.map +1 -1
  339. package/resources.d.ts.map +1 -1
  340. package/resources.js +15 -2
  341. package/resources.js.map +1 -1
  342. package/shims/node.d.ts +30 -0
  343. package/shims/node.d.ts.map +1 -0
  344. package/shims/node.js +31 -0
  345. package/shims/node.js.map +1 -0
  346. package/shims/node.mjs +5 -0
  347. package/shims/node.mjs.map +1 -0
  348. package/shims/web.d.ts +26 -0
  349. package/shims/web.d.ts.map +1 -0
  350. package/shims/web.js +31 -0
  351. package/shims/web.js.map +1 -0
  352. package/shims/web.mjs +5 -0
  353. package/shims/web.mjs.map +1 -0
  354. package/src/_shims/MultipartBody.ts +9 -0
  355. package/src/_shims/README.md +46 -0
  356. package/src/_shims/auto/runtime-bun.ts +4 -0
  357. package/src/_shims/auto/runtime-node.ts +4 -0
  358. package/src/_shims/auto/runtime.ts +4 -0
  359. package/src/_shims/auto/types-node.ts +4 -0
  360. package/src/_shims/auto/types.d.ts +101 -0
  361. package/src/_shims/auto/types.js +3 -0
  362. package/src/_shims/auto/types.mjs +3 -0
  363. package/src/_shims/bun-runtime.ts +14 -0
  364. package/src/_shims/index.d.ts +83 -0
  365. package/src/_shims/index.js +17 -0
  366. package/src/_shims/index.mjs +11 -0
  367. package/src/_shims/manual-types.d.ts +12 -0
  368. package/src/_shims/manual-types.js +3 -0
  369. package/src/_shims/manual-types.mjs +3 -0
  370. package/src/_shims/node-runtime.ts +81 -0
  371. package/src/_shims/node-types.d.ts +42 -0
  372. package/src/_shims/node-types.js +3 -0
  373. package/src/_shims/node-types.mjs +3 -0
  374. package/src/_shims/registry.ts +67 -0
  375. package/src/_shims/web-runtime.ts +103 -0
  376. package/src/_shims/web-types.d.ts +83 -0
  377. package/src/_shims/web-types.js +3 -0
  378. package/src/_shims/web-types.mjs +3 -0
  379. package/src/core.ts +1243 -0
  380. package/src/error.ts +130 -2
  381. package/src/index.ts +342 -5
  382. package/src/internal/qs/formats.ts +1 -2
  383. package/src/internal/qs/stringify.ts +20 -17
  384. package/src/internal/qs/utils.ts +14 -14
  385. package/src/resource.ts +11 -2
  386. package/src/resources/assets.ts +6 -4
  387. package/src/resources/auctions/auctions.ts +17 -9
  388. package/src/resources/auctions/website-user-attributes/values.ts +4 -5
  389. package/src/resources/auctions/website-user-attributes/website-user-attributes.ts +20 -13
  390. package/src/resources/auth.ts +107 -8
  391. package/src/resources/index.ts +7 -1
  392. package/src/resources/loyalty/account-streaks.ts +4 -5
  393. package/src/resources/loyalty/accounts.ts +14 -10
  394. package/src/resources/loyalty/badges.ts +53 -22
  395. package/src/resources/loyalty/currencies.ts +4 -5
  396. package/src/resources/loyalty/loyalty.ts +1 -1
  397. package/src/resources/loyalty/multipliers.ts +35 -19
  398. package/src/resources/loyalty/questions-responses.ts +16 -8
  399. package/src/resources/loyalty/questions.ts +7 -9
  400. package/src/resources/loyalty/rule-edits.ts +6 -8
  401. package/src/resources/loyalty/rule-groups.ts +34 -15
  402. package/src/resources/loyalty/rules.ts +56 -22
  403. package/src/resources/loyalty/transactions/posts.ts +17 -9
  404. package/src/resources/loyalty/transactions/rule-statuses.ts +15 -7
  405. package/src/resources/loyalty/transactions/transactions.ts +24 -14
  406. package/src/resources/minting/allowlist.ts +7 -5
  407. package/src/resources/minting/contracts.ts +12 -7
  408. package/src/resources/minting/minting.ts +8 -6
  409. package/src/resources/minting/status.ts +10 -8
  410. package/src/resources/referral/referral.ts +4 -5
  411. package/src/resources/referral/users.ts +12 -7
  412. package/src/resources/token-claims.ts +39 -26
  413. package/src/resources/users/metadatas.ts +19 -9
  414. package/src/resources/users/users.ts +30 -11
  415. package/src/resources/websites/website-collections.ts +6 -8
  416. package/src/resources/websites/website-user-roles.ts +8 -6
  417. package/src/resources/websites/websites.ts +12 -7
  418. package/src/shims/node.ts +50 -0
  419. package/src/shims/web.ts +50 -0
  420. package/src/tsconfig.json +2 -2
  421. package/src/uploads.ts +255 -2
  422. package/src/version.ts +1 -1
  423. package/uploads.d.ts +74 -1
  424. package/uploads.d.ts.map +1 -1
  425. package/uploads.js +168 -3
  426. package/uploads.js.map +1 -1
  427. package/uploads.mjs +157 -1
  428. package/uploads.mjs.map +1 -1
  429. package/version.d.ts +1 -1
  430. package/version.js +1 -1
  431. package/version.mjs +1 -1
  432. package/api-promise.d.mts +0 -2
  433. package/api-promise.d.mts.map +0 -1
  434. package/api-promise.d.ts +0 -2
  435. package/api-promise.d.ts.map +0 -1
  436. package/api-promise.js +0 -6
  437. package/api-promise.js.map +0 -1
  438. package/api-promise.mjs +0 -2
  439. package/api-promise.mjs.map +0 -1
  440. package/client.d.mts +0 -202
  441. package/client.d.mts.map +0 -1
  442. package/client.d.ts +0 -202
  443. package/client.d.ts.map +0 -1
  444. package/client.js +0 -478
  445. package/client.js.map +0 -1
  446. package/client.mjs +0 -474
  447. package/client.mjs.map +0 -1
  448. package/core/api-promise.d.mts +0 -46
  449. package/core/api-promise.d.mts.map +0 -1
  450. package/core/api-promise.d.ts +0 -46
  451. package/core/api-promise.d.ts.map +0 -1
  452. package/core/api-promise.js +0 -74
  453. package/core/api-promise.js.map +0 -1
  454. package/core/api-promise.mjs +0 -70
  455. package/core/api-promise.mjs.map +0 -1
  456. package/core/error.d.mts +0 -46
  457. package/core/error.d.mts.map +0 -1
  458. package/core/error.d.ts +0 -46
  459. package/core/error.d.ts.map +0 -1
  460. package/core/error.js +0 -113
  461. package/core/error.js.map +0 -1
  462. package/core/error.mjs +0 -97
  463. package/core/error.mjs.map +0 -1
  464. package/core/resource.d.mts +0 -6
  465. package/core/resource.d.mts.map +0 -1
  466. package/core/resource.d.ts +0 -6
  467. package/core/resource.d.ts.map +0 -1
  468. package/core/resource.js +0 -11
  469. package/core/resource.js.map +0 -1
  470. package/core/resource.mjs +0 -7
  471. package/core/resource.mjs.map +0 -1
  472. package/core/uploads.d.mts +0 -3
  473. package/core/uploads.d.mts.map +0 -1
  474. package/core/uploads.d.ts +0 -3
  475. package/core/uploads.d.ts.map +0 -1
  476. package/core/uploads.js +0 -6
  477. package/core/uploads.js.map +0 -1
  478. package/core/uploads.mjs +0 -2
  479. package/core/uploads.mjs.map +0 -1
  480. package/error.d.mts +0 -2
  481. package/error.d.mts.map +0 -1
  482. package/index.d.mts.map +0 -1
  483. package/internal/builtin-types.d.mts +0 -73
  484. package/internal/builtin-types.d.mts.map +0 -1
  485. package/internal/builtin-types.d.ts +0 -73
  486. package/internal/builtin-types.d.ts.map +0 -1
  487. package/internal/builtin-types.js +0 -4
  488. package/internal/builtin-types.js.map +0 -1
  489. package/internal/builtin-types.mjs +0 -3
  490. package/internal/builtin-types.mjs.map +0 -1
  491. package/internal/detect-platform.d.mts +0 -15
  492. package/internal/detect-platform.d.mts.map +0 -1
  493. package/internal/detect-platform.d.ts +0 -15
  494. package/internal/detect-platform.d.ts.map +0 -1
  495. package/internal/detect-platform.js +0 -162
  496. package/internal/detect-platform.js.map +0 -1
  497. package/internal/detect-platform.mjs +0 -157
  498. package/internal/detect-platform.mjs.map +0 -1
  499. package/internal/errors.d.mts +0 -3
  500. package/internal/errors.d.mts.map +0 -1
  501. package/internal/errors.d.ts +0 -3
  502. package/internal/errors.d.ts.map +0 -1
  503. package/internal/errors.js +0 -41
  504. package/internal/errors.js.map +0 -1
  505. package/internal/errors.mjs +0 -36
  506. package/internal/errors.mjs.map +0 -1
  507. package/internal/headers.d.mts +0 -20
  508. package/internal/headers.d.mts.map +0 -1
  509. package/internal/headers.d.ts +0 -20
  510. package/internal/headers.d.ts.map +0 -1
  511. package/internal/headers.js +0 -79
  512. package/internal/headers.js.map +0 -1
  513. package/internal/headers.mjs +0 -74
  514. package/internal/headers.mjs.map +0 -1
  515. package/internal/parse.d.mts +0 -12
  516. package/internal/parse.d.mts.map +0 -1
  517. package/internal/parse.d.ts +0 -12
  518. package/internal/parse.d.ts.map +0 -1
  519. package/internal/parse.js +0 -40
  520. package/internal/parse.js.map +0 -1
  521. package/internal/parse.mjs +0 -37
  522. package/internal/parse.mjs.map +0 -1
  523. package/internal/qs/formats.d.mts +0 -7
  524. package/internal/qs/formats.d.mts.map +0 -1
  525. package/internal/qs/index.d.mts +0 -10
  526. package/internal/qs/index.d.mts.map +0 -1
  527. package/internal/qs/stringify.d.mts +0 -3
  528. package/internal/qs/stringify.d.mts.map +0 -1
  529. package/internal/qs/types.d.mts +0 -57
  530. package/internal/qs/types.d.mts.map +0 -1
  531. package/internal/qs/utils.d.mts +0 -15
  532. package/internal/qs/utils.d.mts.map +0 -1
  533. package/internal/request-options.d.mts +0 -75
  534. package/internal/request-options.d.mts.map +0 -1
  535. package/internal/request-options.d.ts +0 -75
  536. package/internal/request-options.d.ts.map +0 -1
  537. package/internal/request-options.js +0 -14
  538. package/internal/request-options.js.map +0 -1
  539. package/internal/request-options.mjs +0 -10
  540. package/internal/request-options.mjs.map +0 -1
  541. package/internal/shim-types.d.mts +0 -17
  542. package/internal/shim-types.d.mts.map +0 -1
  543. package/internal/shim-types.d.ts +0 -17
  544. package/internal/shim-types.d.ts.map +0 -1
  545. package/internal/shim-types.js +0 -4
  546. package/internal/shim-types.js.map +0 -1
  547. package/internal/shim-types.mjs +0 -3
  548. package/internal/shim-types.mjs.map +0 -1
  549. package/internal/shims.d.mts +0 -20
  550. package/internal/shims.d.mts.map +0 -1
  551. package/internal/shims.d.ts +0 -20
  552. package/internal/shims.d.ts.map +0 -1
  553. package/internal/shims.js +0 -92
  554. package/internal/shims.js.map +0 -1
  555. package/internal/shims.mjs +0 -85
  556. package/internal/shims.mjs.map +0 -1
  557. package/internal/to-file.d.mts +0 -45
  558. package/internal/to-file.d.mts.map +0 -1
  559. package/internal/to-file.d.ts +0 -45
  560. package/internal/to-file.d.ts.map +0 -1
  561. package/internal/to-file.js +0 -91
  562. package/internal/to-file.js.map +0 -1
  563. package/internal/to-file.mjs +0 -88
  564. package/internal/to-file.mjs.map +0 -1
  565. package/internal/tslib.js +0 -81
  566. package/internal/tslib.mjs +0 -17
  567. package/internal/types.d.mts +0 -69
  568. package/internal/types.d.mts.map +0 -1
  569. package/internal/types.d.ts +0 -69
  570. package/internal/types.d.ts.map +0 -1
  571. package/internal/types.js +0 -4
  572. package/internal/types.js.map +0 -1
  573. package/internal/types.mjs +0 -3
  574. package/internal/types.mjs.map +0 -1
  575. package/internal/uploads.d.mts +0 -42
  576. package/internal/uploads.d.mts.map +0 -1
  577. package/internal/uploads.d.ts +0 -42
  578. package/internal/uploads.d.ts.map +0 -1
  579. package/internal/uploads.js +0 -141
  580. package/internal/uploads.js.map +0 -1
  581. package/internal/uploads.mjs +0 -131
  582. package/internal/uploads.mjs.map +0 -1
  583. package/internal/utils/base64.d.mts +0 -3
  584. package/internal/utils/base64.d.mts.map +0 -1
  585. package/internal/utils/base64.d.ts +0 -3
  586. package/internal/utils/base64.d.ts.map +0 -1
  587. package/internal/utils/base64.js +0 -38
  588. package/internal/utils/base64.js.map +0 -1
  589. package/internal/utils/base64.mjs +0 -33
  590. package/internal/utils/base64.mjs.map +0 -1
  591. package/internal/utils/bytes.d.mts +0 -4
  592. package/internal/utils/bytes.d.mts.map +0 -1
  593. package/internal/utils/bytes.d.ts +0 -4
  594. package/internal/utils/bytes.d.ts.map +0 -1
  595. package/internal/utils/bytes.js +0 -31
  596. package/internal/utils/bytes.js.map +0 -1
  597. package/internal/utils/bytes.mjs +0 -26
  598. package/internal/utils/bytes.mjs.map +0 -1
  599. package/internal/utils/env.d.mts +0 -9
  600. package/internal/utils/env.d.mts.map +0 -1
  601. package/internal/utils/env.d.ts +0 -9
  602. package/internal/utils/env.d.ts.map +0 -1
  603. package/internal/utils/env.js +0 -22
  604. package/internal/utils/env.js.map +0 -1
  605. package/internal/utils/env.mjs +0 -18
  606. package/internal/utils/env.mjs.map +0 -1
  607. package/internal/utils/log.d.mts +0 -37
  608. package/internal/utils/log.d.mts.map +0 -1
  609. package/internal/utils/log.d.ts +0 -37
  610. package/internal/utils/log.d.ts.map +0 -1
  611. package/internal/utils/log.js +0 -86
  612. package/internal/utils/log.js.map +0 -1
  613. package/internal/utils/log.mjs +0 -80
  614. package/internal/utils/log.mjs.map +0 -1
  615. package/internal/utils/path.d.mts +0 -15
  616. package/internal/utils/path.d.mts.map +0 -1
  617. package/internal/utils/path.d.ts +0 -15
  618. package/internal/utils/path.d.ts.map +0 -1
  619. package/internal/utils/path.js +0 -79
  620. package/internal/utils/path.js.map +0 -1
  621. package/internal/utils/path.mjs +0 -74
  622. package/internal/utils/path.mjs.map +0 -1
  623. package/internal/utils/sleep.d.mts +0 -2
  624. package/internal/utils/sleep.d.mts.map +0 -1
  625. package/internal/utils/sleep.d.ts +0 -2
  626. package/internal/utils/sleep.d.ts.map +0 -1
  627. package/internal/utils/sleep.js +0 -7
  628. package/internal/utils/sleep.js.map +0 -1
  629. package/internal/utils/sleep.mjs +0 -3
  630. package/internal/utils/sleep.mjs.map +0 -1
  631. package/internal/utils/uuid.d.mts +0 -5
  632. package/internal/utils/uuid.d.mts.map +0 -1
  633. package/internal/utils/uuid.d.ts +0 -5
  634. package/internal/utils/uuid.d.ts.map +0 -1
  635. package/internal/utils/uuid.js +0 -19
  636. package/internal/utils/uuid.js.map +0 -1
  637. package/internal/utils/uuid.mjs +0 -15
  638. package/internal/utils/uuid.mjs.map +0 -1
  639. package/internal/utils/values.d.mts +0 -18
  640. package/internal/utils/values.d.mts.map +0 -1
  641. package/internal/utils/values.d.ts +0 -18
  642. package/internal/utils/values.d.ts.map +0 -1
  643. package/internal/utils/values.js +0 -112
  644. package/internal/utils/values.js.map +0 -1
  645. package/internal/utils/values.mjs +0 -94
  646. package/internal/utils/values.mjs.map +0 -1
  647. package/internal/utils.d.mts +0 -7
  648. package/internal/utils.d.mts.map +0 -1
  649. package/internal/utils.d.ts +0 -7
  650. package/internal/utils.d.ts.map +0 -1
  651. package/internal/utils.js +0 -11
  652. package/internal/utils.js.map +0 -1
  653. package/internal/utils.mjs +0 -8
  654. package/internal/utils.mjs.map +0 -1
  655. package/resource.d.mts +0 -2
  656. package/resource.d.mts.map +0 -1
  657. package/resources/assets.d.mts +0 -65
  658. package/resources/assets.d.mts.map +0 -1
  659. package/resources/auctions/auctions.d.mts +0 -368
  660. package/resources/auctions/auctions.d.mts.map +0 -1
  661. package/resources/auctions/index.d.mts +0 -3
  662. package/resources/auctions/index.d.mts.map +0 -1
  663. package/resources/auctions/website-user-attributes/index.d.mts +0 -3
  664. package/resources/auctions/website-user-attributes/index.d.mts.map +0 -1
  665. package/resources/auctions/website-user-attributes/values.d.mts +0 -127
  666. package/resources/auctions/website-user-attributes/values.d.mts.map +0 -1
  667. package/resources/auctions/website-user-attributes/website-user-attributes.d.mts +0 -136
  668. package/resources/auctions/website-user-attributes/website-user-attributes.d.mts.map +0 -1
  669. package/resources/auctions/website-user-attributes.d.mts +0 -2
  670. package/resources/auctions/website-user-attributes.d.mts.map +0 -1
  671. package/resources/auctions.d.mts +0 -2
  672. package/resources/auctions.d.mts.map +0 -1
  673. package/resources/auth.d.mts +0 -53
  674. package/resources/auth.d.mts.map +0 -1
  675. package/resources/index.d.mts +0 -10
  676. package/resources/index.d.mts.map +0 -1
  677. package/resources/loyalty/account-streaks.d.mts +0 -97
  678. package/resources/loyalty/account-streaks.d.mts.map +0 -1
  679. package/resources/loyalty/accounts.d.mts +0 -238
  680. package/resources/loyalty/accounts.d.mts.map +0 -1
  681. package/resources/loyalty/badges.d.mts +0 -1398
  682. package/resources/loyalty/badges.d.mts.map +0 -1
  683. package/resources/loyalty/currencies.d.mts +0 -272
  684. package/resources/loyalty/currencies.d.mts.map +0 -1
  685. package/resources/loyalty/index.d.mts +0 -13
  686. package/resources/loyalty/index.d.mts.map +0 -1
  687. package/resources/loyalty/loyalty.d.mts +0 -50
  688. package/resources/loyalty/loyalty.d.mts.map +0 -1
  689. package/resources/loyalty/multipliers.d.mts +0 -221
  690. package/resources/loyalty/multipliers.d.mts.map +0 -1
  691. package/resources/loyalty/questions-responses.d.mts +0 -148
  692. package/resources/loyalty/questions-responses.d.mts.map +0 -1
  693. package/resources/loyalty/questions.d.mts +0 -205
  694. package/resources/loyalty/questions.d.mts.map +0 -1
  695. package/resources/loyalty/rule-edits.d.mts +0 -3165
  696. package/resources/loyalty/rule-edits.d.mts.map +0 -1
  697. package/resources/loyalty/rule-groups.d.mts +0 -826
  698. package/resources/loyalty/rule-groups.d.mts.map +0 -1
  699. package/resources/loyalty/rules.d.mts +0 -4543
  700. package/resources/loyalty/rules.d.mts.map +0 -1
  701. package/resources/loyalty/transactions/index.d.mts +0 -4
  702. package/resources/loyalty/transactions/index.d.mts.map +0 -1
  703. package/resources/loyalty/transactions/posts.d.mts +0 -145
  704. package/resources/loyalty/transactions/posts.d.mts.map +0 -1
  705. package/resources/loyalty/transactions/rule-statuses.d.mts +0 -121
  706. package/resources/loyalty/transactions/rule-statuses.d.mts.map +0 -1
  707. package/resources/loyalty/transactions/transactions.d.mts +0 -564
  708. package/resources/loyalty/transactions/transactions.d.mts.map +0 -1
  709. package/resources/loyalty/transactions.d.mts +0 -2
  710. package/resources/loyalty/transactions.d.mts.map +0 -1
  711. package/resources/loyalty.d.mts +0 -2
  712. package/resources/loyalty.d.mts.map +0 -1
  713. package/resources/minting/allowlist.d.mts +0 -85
  714. package/resources/minting/allowlist.d.mts.map +0 -1
  715. package/resources/minting/contracts.d.mts +0 -165
  716. package/resources/minting/contracts.d.mts.map +0 -1
  717. package/resources/minting/index.d.mts +0 -5
  718. package/resources/minting/index.d.mts.map +0 -1
  719. package/resources/minting/minting.d.mts +0 -143
  720. package/resources/minting/minting.d.mts.map +0 -1
  721. package/resources/minting/status.d.mts +0 -45
  722. package/resources/minting/status.d.mts.map +0 -1
  723. package/resources/minting.d.mts +0 -2
  724. package/resources/minting.d.mts.map +0 -1
  725. package/resources/referral/index.d.mts +0 -3
  726. package/resources/referral/index.d.mts.map +0 -1
  727. package/resources/referral/referral.d.mts +0 -41
  728. package/resources/referral/referral.d.mts.map +0 -1
  729. package/resources/referral/users.d.mts +0 -84
  730. package/resources/referral/users.d.mts.map +0 -1
  731. package/resources/referral.d.mts +0 -2
  732. package/resources/referral.d.mts.map +0 -1
  733. package/resources/token-claims.d.mts +0 -159
  734. package/resources/token-claims.d.mts.map +0 -1
  735. package/resources/users/index.d.mts +0 -3
  736. package/resources/users/index.d.mts.map +0 -1
  737. package/resources/users/metadatas.d.mts +0 -174
  738. package/resources/users/metadatas.d.mts.map +0 -1
  739. package/resources/users/users.d.mts +0 -465
  740. package/resources/users/users.d.mts.map +0 -1
  741. package/resources/users.d.mts +0 -2
  742. package/resources/users.d.mts.map +0 -1
  743. package/resources/websites/index.d.mts +0 -4
  744. package/resources/websites/index.d.mts.map +0 -1
  745. package/resources/websites/website-collections.d.mts +0 -95
  746. package/resources/websites/website-collections.d.mts.map +0 -1
  747. package/resources/websites/website-user-roles.d.mts +0 -97
  748. package/resources/websites/website-user-roles.d.mts.map +0 -1
  749. package/resources/websites/websites.d.mts +0 -329
  750. package/resources/websites/websites.d.mts.map +0 -1
  751. package/resources/websites.d.mts +0 -2
  752. package/resources/websites.d.mts.map +0 -1
  753. package/resources.d.mts +0 -2
  754. package/resources.d.mts.map +0 -1
  755. package/src/api-promise.ts +0 -2
  756. package/src/client.ts +0 -868
  757. package/src/core/README.md +0 -3
  758. package/src/core/api-promise.ts +0 -92
  759. package/src/core/error.ts +0 -130
  760. package/src/core/resource.ts +0 -11
  761. package/src/core/uploads.ts +0 -2
  762. package/src/internal/README.md +0 -3
  763. package/src/internal/builtin-types.ts +0 -93
  764. package/src/internal/detect-platform.ts +0 -196
  765. package/src/internal/errors.ts +0 -33
  766. package/src/internal/headers.ts +0 -97
  767. package/src/internal/parse.ts +0 -56
  768. package/src/internal/request-options.ts +0 -91
  769. package/src/internal/shim-types.ts +0 -26
  770. package/src/internal/shims.ts +0 -107
  771. package/src/internal/to-file.ts +0 -154
  772. package/src/internal/types.ts +0 -95
  773. package/src/internal/uploads.ts +0 -187
  774. package/src/internal/utils/base64.ts +0 -40
  775. package/src/internal/utils/bytes.ts +0 -32
  776. package/src/internal/utils/env.ts +0 -18
  777. package/src/internal/utils/log.ts +0 -127
  778. package/src/internal/utils/path.ts +0 -88
  779. package/src/internal/utils/sleep.ts +0 -3
  780. package/src/internal/utils/uuid.ts +0 -17
  781. package/src/internal/utils/values.ts +0 -105
  782. package/src/internal/utils.ts +0 -8
  783. package/uploads.d.mts +0 -2
  784. package/uploads.d.mts.map +0 -1
  785. package/version.d.mts +0 -2
  786. package/version.d.mts.map +0 -1
@@ -1,131 +0,0 @@
1
- import { ReadableStreamFrom } from "./shims.mjs";
2
- export const checkFileSupport = () => {
3
- if (typeof File === 'undefined') {
4
- const { process } = globalThis;
5
- const isOldNode = typeof process?.versions?.node === 'string' && parseInt(process.versions.node.split('.')) < 20;
6
- throw new Error('`File` is not defined as a global, which is required for file uploads.' +
7
- (isOldNode ?
8
- " Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`."
9
- : ''));
10
- }
11
- };
12
- /**
13
- * Construct a `File` instance. This is used to ensure a helpful error is thrown
14
- * for environments that don't define a global `File` yet.
15
- */
16
- export function makeFile(fileBits, fileName, options) {
17
- checkFileSupport();
18
- return new File(fileBits, fileName ?? 'unknown_file', options);
19
- }
20
- export function getName(value) {
21
- return (((typeof value === 'object' &&
22
- value !== null &&
23
- (('name' in value && value.name && String(value.name)) ||
24
- ('url' in value && value.url && String(value.url)) ||
25
- ('filename' in value && value.filename && String(value.filename)) ||
26
- ('path' in value && value.path && String(value.path)))) ||
27
- '')
28
- .split(/[\\/]/)
29
- .pop() || undefined);
30
- }
31
- export const isAsyncIterable = (value) => value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';
32
- /**
33
- * Returns a multipart/form-data request if any part of the given request body contains a File / Blob value.
34
- * Otherwise returns the request as is.
35
- */
36
- export const maybeMultipartFormRequestOptions = async (opts, fetch) => {
37
- if (!hasUploadableValue(opts.body))
38
- return opts;
39
- return { ...opts, body: await createForm(opts.body, fetch) };
40
- };
41
- export const multipartFormRequestOptions = async (opts, fetch) => {
42
- return { ...opts, body: await createForm(opts.body, fetch) };
43
- };
44
- const supportsFormDataMap = /* @__PURE__ */ new WeakMap();
45
- /**
46
- * node-fetch doesn't support the global FormData object in recent node versions. Instead of sending
47
- * properly-encoded form data, it just stringifies the object, resulting in a request body of "[object FormData]".
48
- * This function detects if the fetch function provided supports the global FormData object to avoid
49
- * confusing error messages later on.
50
- */
51
- function supportsFormData(fetchObject) {
52
- const fetch = typeof fetchObject === 'function' ? fetchObject : fetchObject.fetch;
53
- const cached = supportsFormDataMap.get(fetch);
54
- if (cached)
55
- return cached;
56
- const promise = (async () => {
57
- try {
58
- const FetchResponse = ('Response' in fetch ?
59
- fetch.Response
60
- : (await fetch('data:,')).constructor);
61
- const data = new FormData();
62
- if (data.toString() === (await new FetchResponse(data).text())) {
63
- return false;
64
- }
65
- return true;
66
- }
67
- catch {
68
- // avoid false negatives
69
- return true;
70
- }
71
- })();
72
- supportsFormDataMap.set(fetch, promise);
73
- return promise;
74
- }
75
- export const createForm = async (body, fetch) => {
76
- if (!(await supportsFormData(fetch))) {
77
- throw new TypeError('The provided fetch function does not support file uploads with the current global FormData class.');
78
- }
79
- const form = new FormData();
80
- await Promise.all(Object.entries(body || {}).map(([key, value]) => addFormValue(form, key, value)));
81
- return form;
82
- };
83
- // We check for Blob not File because Bun.File doesn't inherit from File,
84
- // but they both inherit from Blob and have a `name` property at runtime.
85
- const isNamedBlob = (value) => value instanceof Blob && 'name' in value;
86
- const isUploadable = (value) => typeof value === 'object' &&
87
- value !== null &&
88
- (value instanceof Response || isAsyncIterable(value) || isNamedBlob(value));
89
- const hasUploadableValue = (value) => {
90
- if (isUploadable(value))
91
- return true;
92
- if (Array.isArray(value))
93
- return value.some(hasUploadableValue);
94
- if (value && typeof value === 'object') {
95
- for (const k in value) {
96
- if (hasUploadableValue(value[k]))
97
- return true;
98
- }
99
- }
100
- return false;
101
- };
102
- const addFormValue = async (form, key, value) => {
103
- if (value === undefined)
104
- return;
105
- if (value == null) {
106
- throw new TypeError(`Received null for "${key}"; to pass null in FormData, you must use the string 'null'`);
107
- }
108
- // TODO: make nested formats configurable
109
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
110
- form.append(key, String(value));
111
- }
112
- else if (value instanceof Response) {
113
- form.append(key, makeFile([await value.blob()], getName(value)));
114
- }
115
- else if (isAsyncIterable(value)) {
116
- form.append(key, makeFile([await new Response(ReadableStreamFrom(value)).blob()], getName(value)));
117
- }
118
- else if (isNamedBlob(value)) {
119
- form.append(key, value, getName(value));
120
- }
121
- else if (Array.isArray(value)) {
122
- await Promise.all(value.map((entry) => addFormValue(form, key + '[]', entry)));
123
- }
124
- else if (typeof value === 'object') {
125
- await Promise.all(Object.entries(value).map(([name, prop]) => addFormValue(form, `${key}[${name}]`, prop)));
126
- }
127
- else {
128
- throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`);
129
- }
130
- };
131
- //# sourceMappingURL=uploads.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"uploads.mjs","sourceRoot":"","sources":["../src/internal/uploads.ts"],"names":[],"mappings":"OAGO,EAAE,kBAAkB,EAAE;AAU7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAiB,CAAC;QACtC,MAAM,SAAS,GACb,OAAO,OAAO,EAAE,QAAQ,EAAE,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,OA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,QAAQ,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACrG,CAAC;SAAM,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjF,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,MAAM,OAAO,CAAC,GAAG,CACf,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,CAAC,CACzF,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,SAAS,CACjB,wGAAwG,KAAK,UAAU,CACxH,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const toBase64: (data: string | Uint8Array | null | undefined) => string;
2
- export declare const fromBase64: (str: string) => Uint8Array;
3
- //# sourceMappingURL=base64.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base64.d.mts","sourceRoot":"","sources":["../../src/internal/utils/base64.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,KAAG,MAgBvE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,UAgBxC,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const toBase64: (data: string | Uint8Array | null | undefined) => string;
2
- export declare const fromBase64: (str: string) => Uint8Array;
3
- //# sourceMappingURL=base64.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/internal/utils/base64.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,GAAI,MAAM,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,SAAS,KAAG,MAgBvE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,UAgBxC,CAAC"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.fromBase64 = exports.toBase64 = void 0;
5
- const error_1 = require("../../core/error.js");
6
- const bytes_1 = require("./bytes.js");
7
- const toBase64 = (data) => {
8
- if (!data)
9
- return '';
10
- if (typeof globalThis.Buffer !== 'undefined') {
11
- return globalThis.Buffer.from(data).toString('base64');
12
- }
13
- if (typeof data === 'string') {
14
- data = (0, bytes_1.encodeUTF8)(data);
15
- }
16
- if (typeof btoa !== 'undefined') {
17
- return btoa(String.fromCharCode.apply(null, data));
18
- }
19
- throw new error_1.SnagSolutionsError('Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined');
20
- };
21
- exports.toBase64 = toBase64;
22
- const fromBase64 = (str) => {
23
- if (typeof globalThis.Buffer !== 'undefined') {
24
- const buf = globalThis.Buffer.from(str, 'base64');
25
- return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
26
- }
27
- if (typeof atob !== 'undefined') {
28
- const bstr = atob(str);
29
- const buf = new Uint8Array(bstr.length);
30
- for (let i = 0; i < bstr.length; i++) {
31
- buf[i] = bstr.charCodeAt(i);
32
- }
33
- return buf;
34
- }
35
- throw new error_1.SnagSolutionsError('Cannot decode base64 string; Expected `Buffer` or `atob` to be defined');
36
- };
37
- exports.fromBase64 = fromBase64;
38
- //# sourceMappingURL=base64.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src/internal/utils/base64.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,+CAAsD;AACtD,sCAAqC;AAE9B,MAAM,QAAQ,GAAG,CAAC,IAA4C,EAAU,EAAE;IAC/E,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,IAAI,OAAQ,UAAkB,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACtD,OAAQ,UAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,GAAG,IAAA,kBAAU,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,IAAW,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,IAAI,0BAAkB,CAAC,0EAA0E,CAAC,CAAC;AAC3G,CAAC,CAAC;AAhBW,QAAA,QAAQ,YAgBnB;AAEK,MAAM,UAAU,GAAG,CAAC,GAAW,EAAc,EAAE;IACpD,IAAI,OAAQ,UAAkB,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACtD,MAAM,GAAG,GAAI,UAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC3D,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,IAAI,0BAAkB,CAAC,wEAAwE,CAAC,CAAC;AACzG,CAAC,CAAC;AAhBW,QAAA,UAAU,cAgBrB"}
@@ -1,33 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { SnagSolutionsError } from "../../core/error.mjs";
3
- import { encodeUTF8 } from "./bytes.mjs";
4
- export const toBase64 = (data) => {
5
- if (!data)
6
- return '';
7
- if (typeof globalThis.Buffer !== 'undefined') {
8
- return globalThis.Buffer.from(data).toString('base64');
9
- }
10
- if (typeof data === 'string') {
11
- data = encodeUTF8(data);
12
- }
13
- if (typeof btoa !== 'undefined') {
14
- return btoa(String.fromCharCode.apply(null, data));
15
- }
16
- throw new SnagSolutionsError('Cannot generate base64 string; Expected `Buffer` or `btoa` to be defined');
17
- };
18
- export const fromBase64 = (str) => {
19
- if (typeof globalThis.Buffer !== 'undefined') {
20
- const buf = globalThis.Buffer.from(str, 'base64');
21
- return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
22
- }
23
- if (typeof atob !== 'undefined') {
24
- const bstr = atob(str);
25
- const buf = new Uint8Array(bstr.length);
26
- for (let i = 0; i < bstr.length; i++) {
27
- buf[i] = bstr.charCodeAt(i);
28
- }
29
- return buf;
30
- }
31
- throw new SnagSolutionsError('Cannot decode base64 string; Expected `Buffer` or `atob` to be defined');
32
- };
33
- //# sourceMappingURL=base64.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base64.mjs","sourceRoot":"","sources":["../../src/internal/utils/base64.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,kBAAkB,EAAE;OACtB,EAAE,UAAU,EAAE;AAErB,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAA4C,EAAU,EAAE;IAC/E,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,IAAI,OAAQ,UAAkB,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACtD,OAAQ,UAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,IAAW,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,IAAI,kBAAkB,CAAC,0EAA0E,CAAC,CAAC;AAC3G,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAW,EAAc,EAAE;IACpD,IAAI,OAAQ,UAAkB,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACtD,MAAM,GAAG,GAAI,UAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC3D,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,IAAI,kBAAkB,CAAC,wEAAwE,CAAC,CAAC;AACzG,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare function concatBytes(buffers: Uint8Array[]): Uint8Array;
2
- export declare function encodeUTF8(str: string): Uint8Array<ArrayBufferLike>;
3
- export declare function decodeUTF8(bytes: Uint8Array): string;
4
- //# sourceMappingURL=bytes.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bytes.d.mts","sourceRoot":"","sources":["../../src/internal/utils/bytes.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAa7D;AAGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,+BAMrC;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,UAM3C"}
@@ -1,4 +0,0 @@
1
- export declare function concatBytes(buffers: Uint8Array[]): Uint8Array;
2
- export declare function encodeUTF8(str: string): Uint8Array<ArrayBufferLike>;
3
- export declare function decodeUTF8(bytes: Uint8Array): string;
4
- //# sourceMappingURL=bytes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../src/internal/utils/bytes.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAa7D;AAGD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,+BAMrC;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,UAM3C"}
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.concatBytes = concatBytes;
4
- exports.encodeUTF8 = encodeUTF8;
5
- exports.decodeUTF8 = decodeUTF8;
6
- function concatBytes(buffers) {
7
- let length = 0;
8
- for (const buffer of buffers) {
9
- length += buffer.length;
10
- }
11
- const output = new Uint8Array(length);
12
- let index = 0;
13
- for (const buffer of buffers) {
14
- output.set(buffer, index);
15
- index += buffer.length;
16
- }
17
- return output;
18
- }
19
- let encodeUTF8_;
20
- function encodeUTF8(str) {
21
- let encoder;
22
- return (encodeUTF8_ ??
23
- ((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);
24
- }
25
- let decodeUTF8_;
26
- function decodeUTF8(bytes) {
27
- let decoder;
28
- return (decodeUTF8_ ??
29
- ((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);
30
- }
31
- //# sourceMappingURL=bytes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../src/internal/utils/bytes.ts"],"names":[],"mappings":";;AAAA,kCAaC;AAGD,gCAMC;AAGD,gCAMC;AA/BD,SAAgB,WAAW,CAAC,OAAqB;IAC/C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC;IAC1B,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC1B,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,IAAI,WAAwC,CAAC;AAC7C,SAAgB,UAAU,CAAC,GAAW;IACpC,IAAI,OAAO,CAAC;IACZ,OAAO,CACL,WAAW;QACX,CAAC,CAAC,OAAO,GAAG,IAAK,UAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClG,CAAC,GAAG,CAAC,CAAC;AACT,CAAC;AAED,IAAI,WAA0C,CAAC;AAC/C,SAAgB,UAAU,CAAC,KAAiB;IAC1C,IAAI,OAAO,CAAC;IACZ,OAAO,CACL,WAAW;QACX,CAAC,CAAC,OAAO,GAAG,IAAK,UAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClG,CAAC,KAAK,CAAC,CAAC;AACX,CAAC"}
@@ -1,26 +0,0 @@
1
- export function concatBytes(buffers) {
2
- let length = 0;
3
- for (const buffer of buffers) {
4
- length += buffer.length;
5
- }
6
- const output = new Uint8Array(length);
7
- let index = 0;
8
- for (const buffer of buffers) {
9
- output.set(buffer, index);
10
- index += buffer.length;
11
- }
12
- return output;
13
- }
14
- let encodeUTF8_;
15
- export function encodeUTF8(str) {
16
- let encoder;
17
- return (encodeUTF8_ ??
18
- ((encoder = new globalThis.TextEncoder()), (encodeUTF8_ = encoder.encode.bind(encoder))))(str);
19
- }
20
- let decodeUTF8_;
21
- export function decodeUTF8(bytes) {
22
- let decoder;
23
- return (decodeUTF8_ ??
24
- ((decoder = new globalThis.TextDecoder()), (decodeUTF8_ = decoder.decode.bind(decoder))))(bytes);
25
- }
26
- //# sourceMappingURL=bytes.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bytes.mjs","sourceRoot":"","sources":["../../src/internal/utils/bytes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,OAAqB;IAC/C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC;IAC1B,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC1B,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,IAAI,WAAwC,CAAC;AAC7C,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,OAAO,CAAC;IACZ,OAAO,CACL,WAAW;QACX,CAAC,CAAC,OAAO,GAAG,IAAK,UAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClG,CAAC,GAAG,CAAC,CAAC;AACT,CAAC;AAED,IAAI,WAA0C,CAAC;AAC/C,MAAM,UAAU,UAAU,CAAC,KAAiB;IAC1C,IAAI,OAAO,CAAC;IACZ,OAAO,CACL,WAAW;QACX,CAAC,CAAC,OAAO,GAAG,IAAK,UAAkB,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClG,CAAC,KAAK,CAAC,CAAC;AACX,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Read an environment variable.
3
- *
4
- * Trims beginning and trailing whitespace.
5
- *
6
- * Will return undefined if the environment variable doesn't exist or cannot be accessed.
7
- */
8
- export declare const readEnv: (env: string) => string | undefined;
9
- //# sourceMappingURL=env.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.mts","sourceRoot":"","sources":["../../src/internal/utils/env.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAQ9C,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Read an environment variable.
3
- *
4
- * Trims beginning and trailing whitespace.
5
- *
6
- * Will return undefined if the environment variable doesn't exist or cannot be accessed.
7
- */
8
- export declare const readEnv: (env: string) => string | undefined;
9
- //# sourceMappingURL=env.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/internal/utils/env.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAQ9C,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.readEnv = void 0;
5
- /**
6
- * Read an environment variable.
7
- *
8
- * Trims beginning and trailing whitespace.
9
- *
10
- * Will return undefined if the environment variable doesn't exist or cannot be accessed.
11
- */
12
- const readEnv = (env) => {
13
- if (typeof globalThis.process !== 'undefined') {
14
- return globalThis.process.env?.[env]?.trim() ?? undefined;
15
- }
16
- if (typeof globalThis.Deno !== 'undefined') {
17
- return globalThis.Deno.env?.get?.(env)?.trim();
18
- }
19
- return undefined;
20
- };
21
- exports.readEnv = readEnv;
22
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/internal/utils/env.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF;;;;;;GAMG;AACI,MAAM,OAAO,GAAG,CAAC,GAAW,EAAsB,EAAE;IACzD,IAAI,OAAQ,UAAkB,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACvD,OAAQ,UAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;IACrE,CAAC;IACD,IAAI,OAAQ,UAAkB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QACpD,OAAQ,UAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AARW,QAAA,OAAO,WAQlB"}
@@ -1,18 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- /**
3
- * Read an environment variable.
4
- *
5
- * Trims beginning and trailing whitespace.
6
- *
7
- * Will return undefined if the environment variable doesn't exist or cannot be accessed.
8
- */
9
- export const readEnv = (env) => {
10
- if (typeof globalThis.process !== 'undefined') {
11
- return globalThis.process.env?.[env]?.trim() ?? undefined;
12
- }
13
- if (typeof globalThis.Deno !== 'undefined') {
14
- return globalThis.Deno.env?.get?.(env)?.trim();
15
- }
16
- return undefined;
17
- };
18
- //# sourceMappingURL=env.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.mjs","sourceRoot":"","sources":["../../src/internal/utils/env.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAW,EAAsB,EAAE;IACzD,IAAI,OAAQ,UAAkB,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACvD,OAAQ,UAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;IACrE,CAAC;IACD,IAAI,OAAQ,UAAkB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QACpD,OAAQ,UAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
@@ -1,37 +0,0 @@
1
- import { type SnagSolutions } from "../../client.mjs";
2
- import { RequestOptions } from "../request-options.mjs";
3
- type LogFn = (message: string, ...rest: unknown[]) => void;
4
- export type Logger = {
5
- error: LogFn;
6
- warn: LogFn;
7
- info: LogFn;
8
- debug: LogFn;
9
- };
10
- export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
11
- export declare const parseLogLevel: (maybeLevel: string | undefined, sourceName: string, client: SnagSolutions) => LogLevel | undefined;
12
- export declare function loggerFor(client: SnagSolutions): Logger;
13
- export declare const formatRequestDetails: (details: {
14
- options?: RequestOptions | undefined;
15
- headers?: Headers | Record<string, string> | undefined;
16
- retryOfRequestLogID?: string | undefined;
17
- retryOf?: string | undefined;
18
- url?: string | undefined;
19
- status?: number | undefined;
20
- method?: string | undefined;
21
- durationMs?: number | undefined;
22
- message?: unknown;
23
- body?: unknown;
24
- }) => {
25
- options?: RequestOptions | undefined;
26
- headers?: Headers | Record<string, string> | undefined;
27
- retryOfRequestLogID?: string | undefined;
28
- retryOf?: string | undefined;
29
- url?: string | undefined;
30
- status?: number | undefined;
31
- method?: string | undefined;
32
- durationMs?: number | undefined;
33
- message?: unknown;
34
- body?: unknown;
35
- };
36
- export {};
37
- //# sourceMappingURL=log.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.d.mts","sourceRoot":"","sources":["../../src/internal/utils/log.ts"],"names":[],"mappings":"OAGO,EAAE,KAAK,aAAa,EAAE;OACtB,EAAE,cAAc,EAAE;AAEzB,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAC3D,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,IAA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ions } from "../../client.js";
2
- import { RequestOptions } from "../request-options.js";
3
- type LogFn = (message: string, ...rest: unknown[]) => void;
4
- export type Logger = {
5
- error: LogFn;
6
- warn: LogFn;
7
- info: LogFn;
8
- debug: LogFn;
9
- };
10
- export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
11
- export declare const parseLogLevel: (maybeLevel: string | undefined, sourceName: string, client: SnagSolutions) => LogLevel | undefined;
12
- export declare function loggerFor(client: SnagSolutions): Logger;
13
- export declare const formatRequestDetails: (details: {
14
- options?: RequestOptions | undefined;
15
- headers?: Headers | Record<string, string> | undefined;
16
- retryOfRequestLogID?: string | undefined;
17
- retryOf?: string | undefined;
18
- url?: string | undefined;
19
- status?: number | undefined;
20
- method?: string | undefined;
21
- durationMs?: number | undefined;
22
- message?: unknown;
23
- body?: unknown;
24
- }) => {
25
- options?: RequestOptions | undefined;
26
- headers?: Headers | Record<string, string> | undefined;
27
- retryOfRequestLogID?: string | undefined;
28
- retryOf?: string | undefined;
29
- url?: string | undefined;
30
- status?: number | undefined;
31
- method?: string | undefined;
32
- durationMs?: number | undefined;
33
- message?: unknown;
34
- body?: unknown;
35
- };
36
- export {};
37
- //# sourceMappingURL=log.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/internal/utils/log.ts"],"names":[],"mappings":"OAGO,EAAE,KAAK,aAAa,EAAE;OACtB,EAAE,cAAc,EAAE;AAEzB,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAC3D,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAUnE,eAAO,MAAM,aAAa,GACxB,YAAY,MAAM,GAAG,SAAS,EAC9B,YAAY,MAAM,EAClB,QAAQ,aAAa,KACpB,QAAQ,GAAG,SAab,CAAC;AAsBF,wBAAgB,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAsBvD;AAED,eAAO,MAAM,oBAAoB,GAAI,SAAS;IAC5C,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACvD,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;cAVW,cAAc,GAAG,SAAS;cAC1B,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS;0BAChC,MAAM,GAAG,SAAS;cAC9B,MAAM,GAAG,SAAS;UACtB,MAAM,GAAG,SAAS;aACf,MAAM,GAAG,SAAS;aAClB,MAAM,GAAG,SAAS;iBACd,MAAM,GAAG,SAAS;cACrB,OAAO;WACV,OAAO;CA8Bf,CAAC"}
@@ -1,86 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.formatRequestDetails = exports.parseLogLevel = void 0;
5
- exports.loggerFor = loggerFor;
6
- const values_1 = require("./values.js");
7
- const levelNumbers = {
8
- off: 0,
9
- error: 200,
10
- warn: 300,
11
- info: 400,
12
- debug: 500,
13
- };
14
- const parseLogLevel = (maybeLevel, sourceName, client) => {
15
- if (!maybeLevel) {
16
- return undefined;
17
- }
18
- if ((0, values_1.hasOwn)(levelNumbers, maybeLevel)) {
19
- return maybeLevel;
20
- }
21
- loggerFor(client).warn(`${sourceName} was set to ${JSON.stringify(maybeLevel)}, expected one of ${JSON.stringify(Object.keys(levelNumbers))}`);
22
- return undefined;
23
- };
24
- exports.parseLogLevel = parseLogLevel;
25
- function noop() { }
26
- function makeLogFn(fnLevel, logger, logLevel) {
27
- if (!logger || levelNumbers[fnLevel] > levelNumbers[logLevel]) {
28
- return noop;
29
- }
30
- else {
31
- // Don't wrap logger functions, we want the stacktrace intact!
32
- return logger[fnLevel].bind(logger);
33
- }
34
- }
35
- const noopLogger = {
36
- error: noop,
37
- warn: noop,
38
- info: noop,
39
- debug: noop,
40
- };
41
- let cachedLoggers = /* @__PURE__ */ new WeakMap();
42
- function loggerFor(client) {
43
- const logger = client.logger;
44
- const logLevel = client.logLevel ?? 'off';
45
- if (!logger) {
46
- return noopLogger;
47
- }
48
- const cachedLogger = cachedLoggers.get(logger);
49
- if (cachedLogger && cachedLogger[0] === logLevel) {
50
- return cachedLogger[1];
51
- }
52
- const levelLogger = {
53
- error: makeLogFn('error', logger, logLevel),
54
- warn: makeLogFn('warn', logger, logLevel),
55
- info: makeLogFn('info', logger, logLevel),
56
- debug: makeLogFn('debug', logger, logLevel),
57
- };
58
- cachedLoggers.set(logger, [logLevel, levelLogger]);
59
- return levelLogger;
60
- }
61
- const formatRequestDetails = (details) => {
62
- if (details.options) {
63
- details.options = { ...details.options };
64
- delete details.options['headers']; // redundant + leaks internals
65
- }
66
- if (details.headers) {
67
- details.headers = Object.fromEntries((details.headers instanceof Headers ? [...details.headers] : Object.entries(details.headers)).map(([name, value]) => [
68
- name,
69
- (name.toLowerCase() === 'x-api-key' ||
70
- name.toLowerCase() === 'authorization' ||
71
- name.toLowerCase() === 'cookie' ||
72
- name.toLowerCase() === 'set-cookie') ?
73
- '***'
74
- : value,
75
- ]));
76
- }
77
- if ('retryOfRequestLogID' in details) {
78
- if (details.retryOfRequestLogID) {
79
- details.retryOf = details.retryOfRequestLogID;
80
- }
81
- delete details.retryOfRequestLogID;
82
- }
83
- return details;
84
- };
85
- exports.formatRequestDetails = formatRequestDetails;
86
- //# sourceMappingURL=log.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/internal/utils/log.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AA8DtF,8BAsBC;AAlFD,wCAAkC;AAalC,MAAM,YAAY,GAAG;IACnB,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,GAAG;CACX,CAAC;AAEK,MAAM,aAAa,GAAG,CAC3B,UAA8B,EAC9B,UAAkB,EAClB,MAAqB,EACC,EAAE;IACxB,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,IAAA,eAAM,EAAC,YAAY,EAAE,UAAU,CAAC,EAAE,CAAC;QACrC,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CACpB,GAAG,UAAU,eAAe,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,qBAAqB,IAAI,CAAC,SAAS,CACvF,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAC1B,EAAE,CACJ,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAjBW,QAAA,aAAa,iBAiBxB;AAEF,SAAS,IAAI,KAAI,CAAC;AAElB,SAAS,SAAS,CAAC,OAAqB,EAAE,MAA0B,EAAE,QAAkB;IACtF,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,OAAO,CAAC,GAAG,YAAY,CA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