@tryfinch/finch-api 6.31.0 → 8.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 (902) hide show
  1. package/CHANGELOG.md +330 -0
  2. package/README.md +129 -68
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +2 -0
  6. package/api-promise.d.ts.map +1 -0
  7. package/api-promise.js +6 -0
  8. package/api-promise.js.map +1 -0
  9. package/api-promise.mjs +2 -0
  10. package/api-promise.mjs.map +1 -0
  11. package/bin/cli +53 -0
  12. package/bin/migration-config.json +6 -0
  13. package/client.d.mts +258 -0
  14. package/client.d.mts.map +1 -0
  15. package/client.d.ts +258 -0
  16. package/client.d.ts.map +1 -0
  17. package/client.js +553 -0
  18. package/client.js.map +1 -0
  19. package/client.mjs +549 -0
  20. package/client.mjs.map +1 -0
  21. package/core/api-promise.d.mts +46 -0
  22. package/core/api-promise.d.mts.map +1 -0
  23. package/core/api-promise.d.ts +46 -0
  24. package/core/api-promise.d.ts.map +1 -0
  25. package/core/api-promise.js +74 -0
  26. package/core/api-promise.js.map +1 -0
  27. package/core/api-promise.mjs +70 -0
  28. package/core/api-promise.mjs.map +1 -0
  29. package/core/error.d.mts +46 -0
  30. package/core/error.d.mts.map +1 -0
  31. package/core/error.d.ts +46 -0
  32. package/core/error.d.ts.map +1 -0
  33. package/core/error.js +113 -0
  34. package/core/error.js.map +1 -0
  35. package/core/error.mjs +97 -0
  36. package/core/error.mjs.map +1 -0
  37. package/core/pagination.d.mts +105 -0
  38. package/core/pagination.d.mts.map +1 -0
  39. package/core/pagination.d.ts +105 -0
  40. package/core/pagination.d.ts.map +1 -0
  41. package/core/pagination.js +163 -0
  42. package/core/pagination.js.map +1 -0
  43. package/core/pagination.mjs +154 -0
  44. package/core/pagination.mjs.map +1 -0
  45. package/core/resource.d.mts +6 -0
  46. package/core/resource.d.mts.map +1 -0
  47. package/core/resource.d.ts +6 -0
  48. package/core/resource.d.ts.map +1 -0
  49. package/core/resource.js +11 -0
  50. package/core/resource.js.map +1 -0
  51. package/core/resource.mjs +7 -0
  52. package/core/resource.mjs.map +1 -0
  53. package/core/uploads.d.mts +3 -0
  54. package/core/uploads.d.mts.map +1 -0
  55. package/core/uploads.d.ts +3 -0
  56. package/core/uploads.d.ts.map +1 -0
  57. package/core/uploads.js +6 -0
  58. package/core/uploads.js.map +1 -0
  59. package/core/uploads.mjs +2 -0
  60. package/core/uploads.mjs.map +1 -0
  61. package/error.d.mts +2 -0
  62. package/error.d.mts.map +1 -0
  63. package/error.d.ts +1 -46
  64. package/error.d.ts.map +1 -1
  65. package/error.js +3 -110
  66. package/error.js.map +1 -1
  67. package/error.mjs +1 -96
  68. package/error.mjs.map +1 -1
  69. package/index.d.mts +7 -197
  70. package/index.d.mts.map +1 -0
  71. package/index.d.ts +6 -196
  72. package/index.d.ts.map +1 -1
  73. package/index.js +14 -235
  74. package/index.js.map +1 -1
  75. package/index.mjs +6 -208
  76. package/index.mjs.map +1 -1
  77. package/internal/builtin-types.d.mts +73 -0
  78. package/internal/builtin-types.d.mts.map +1 -0
  79. package/internal/builtin-types.d.ts +73 -0
  80. package/internal/builtin-types.d.ts.map +1 -0
  81. package/internal/builtin-types.js +4 -0
  82. package/internal/builtin-types.js.map +1 -0
  83. package/internal/builtin-types.mjs +3 -0
  84. package/internal/builtin-types.mjs.map +1 -0
  85. package/internal/detect-platform.d.mts +15 -0
  86. package/internal/detect-platform.d.mts.map +1 -0
  87. package/internal/detect-platform.d.ts +15 -0
  88. package/internal/detect-platform.d.ts.map +1 -0
  89. package/internal/detect-platform.js +162 -0
  90. package/internal/detect-platform.js.map +1 -0
  91. package/internal/detect-platform.mjs +157 -0
  92. package/internal/detect-platform.mjs.map +1 -0
  93. package/internal/errors.d.mts +3 -0
  94. package/internal/errors.d.mts.map +1 -0
  95. package/internal/errors.d.ts +3 -0
  96. package/internal/errors.d.ts.map +1 -0
  97. package/internal/errors.js +41 -0
  98. package/internal/errors.js.map +1 -0
  99. package/internal/errors.mjs +36 -0
  100. package/internal/errors.mjs.map +1 -0
  101. package/internal/headers.d.mts +26 -0
  102. package/internal/headers.d.mts.map +1 -0
  103. package/internal/headers.d.ts +26 -0
  104. package/internal/headers.d.ts.map +1 -0
  105. package/internal/headers.js +120 -0
  106. package/internal/headers.js.map +1 -0
  107. package/internal/headers.mjs +112 -0
  108. package/internal/headers.mjs.map +1 -0
  109. package/internal/parse.d.mts +12 -0
  110. package/internal/parse.d.mts.map +1 -0
  111. package/internal/parse.d.ts +12 -0
  112. package/internal/parse.d.ts.map +1 -0
  113. package/internal/parse.js +35 -0
  114. package/internal/parse.js.map +1 -0
  115. package/internal/parse.mjs +32 -0
  116. package/internal/parse.mjs.map +1 -0
  117. package/internal/qs/formats.d.mts +7 -0
  118. package/internal/qs/formats.d.mts.map +1 -0
  119. package/internal/qs/formats.d.ts +1 -0
  120. package/internal/qs/formats.d.ts.map +1 -1
  121. package/internal/qs/formats.js +4 -2
  122. package/internal/qs/formats.js.map +1 -1
  123. package/internal/qs/formats.mjs +2 -1
  124. package/internal/qs/formats.mjs.map +1 -1
  125. package/internal/qs/index.d.mts +10 -0
  126. package/internal/qs/index.d.mts.map +1 -0
  127. package/internal/qs/index.d.ts.map +1 -1
  128. package/internal/qs/stringify.d.mts +3 -0
  129. package/internal/qs/stringify.d.mts.map +1 -0
  130. package/internal/qs/stringify.d.ts.map +1 -1
  131. package/internal/qs/stringify.js +16 -19
  132. package/internal/qs/stringify.js.map +1 -1
  133. package/internal/qs/stringify.mjs +17 -19
  134. package/internal/qs/stringify.mjs.map +1 -1
  135. package/internal/qs/types.d.mts +57 -0
  136. package/internal/qs/types.d.mts.map +1 -0
  137. package/internal/qs/utils.d.mts +15 -0
  138. package/internal/qs/utils.d.mts.map +1 -0
  139. package/internal/qs/utils.d.ts +1 -0
  140. package/internal/qs/utils.d.ts.map +1 -1
  141. package/internal/qs/utils.js +22 -21
  142. package/internal/qs/utils.js.map +1 -1
  143. package/internal/qs/utils.mjs +12 -12
  144. package/internal/qs/utils.mjs.map +1 -1
  145. package/internal/request-options.d.mts +75 -0
  146. package/internal/request-options.d.mts.map +1 -0
  147. package/internal/request-options.d.ts +75 -0
  148. package/internal/request-options.d.ts.map +1 -0
  149. package/internal/request-options.js +14 -0
  150. package/internal/request-options.js.map +1 -0
  151. package/internal/request-options.mjs +10 -0
  152. package/internal/request-options.mjs.map +1 -0
  153. package/internal/shim-types.d.mts +17 -0
  154. package/internal/shim-types.d.mts.map +1 -0
  155. package/internal/shim-types.d.ts +17 -0
  156. package/internal/shim-types.d.ts.map +1 -0
  157. package/internal/shim-types.js +4 -0
  158. package/internal/shim-types.js.map +1 -0
  159. package/internal/shim-types.mjs +3 -0
  160. package/internal/shim-types.mjs.map +1 -0
  161. package/internal/shims.d.mts +20 -0
  162. package/internal/shims.d.mts.map +1 -0
  163. package/internal/shims.d.ts +20 -0
  164. package/internal/shims.d.ts.map +1 -0
  165. package/internal/shims.js +92 -0
  166. package/internal/shims.js.map +1 -0
  167. package/internal/shims.mjs +85 -0
  168. package/internal/shims.mjs.map +1 -0
  169. package/internal/to-file.d.mts +45 -0
  170. package/internal/to-file.d.mts.map +1 -0
  171. package/internal/to-file.d.ts +45 -0
  172. package/internal/to-file.d.ts.map +1 -0
  173. package/internal/to-file.js +91 -0
  174. package/internal/to-file.js.map +1 -0
  175. package/internal/to-file.mjs +88 -0
  176. package/internal/to-file.mjs.map +1 -0
  177. package/internal/tslib.js +81 -0
  178. package/internal/tslib.mjs +17 -0
  179. package/internal/types.d.mts +69 -0
  180. package/internal/types.d.mts.map +1 -0
  181. package/internal/types.d.ts +69 -0
  182. package/internal/types.d.ts.map +1 -0
  183. package/internal/types.js +4 -0
  184. package/internal/types.js.map +1 -0
  185. package/internal/types.mjs +3 -0
  186. package/internal/types.mjs.map +1 -0
  187. package/internal/uploads.d.mts +42 -0
  188. package/internal/uploads.d.mts.map +1 -0
  189. package/internal/uploads.d.ts +42 -0
  190. package/internal/uploads.d.ts.map +1 -0
  191. package/internal/uploads.js +141 -0
  192. package/internal/uploads.js.map +1 -0
  193. package/internal/uploads.mjs +131 -0
  194. package/internal/uploads.mjs.map +1 -0
  195. package/internal/utils/base64.d.mts +3 -0
  196. package/internal/utils/base64.d.mts.map +1 -0
  197. package/internal/utils/base64.d.ts +3 -0
  198. package/internal/utils/base64.d.ts.map +1 -0
  199. package/internal/utils/base64.js +38 -0
  200. package/internal/utils/base64.js.map +1 -0
  201. package/internal/utils/base64.mjs +33 -0
  202. package/internal/utils/base64.mjs.map +1 -0
  203. package/internal/utils/bytes.d.mts +4 -0
  204. package/internal/utils/bytes.d.mts.map +1 -0
  205. package/internal/utils/bytes.d.ts +4 -0
  206. package/internal/utils/bytes.d.ts.map +1 -0
  207. package/internal/utils/bytes.js +31 -0
  208. package/internal/utils/bytes.js.map +1 -0
  209. package/internal/utils/bytes.mjs +26 -0
  210. package/internal/utils/bytes.mjs.map +1 -0
  211. package/internal/utils/env.d.mts +9 -0
  212. package/internal/utils/env.d.mts.map +1 -0
  213. package/internal/utils/env.d.ts +9 -0
  214. package/internal/utils/env.d.ts.map +1 -0
  215. package/internal/utils/env.js +22 -0
  216. package/internal/utils/env.js.map +1 -0
  217. package/internal/utils/env.mjs +18 -0
  218. package/internal/utils/env.mjs.map +1 -0
  219. package/internal/utils/log.d.mts +37 -0
  220. package/internal/utils/log.d.mts.map +1 -0
  221. package/internal/utils/log.d.ts +37 -0
  222. package/internal/utils/log.d.ts.map +1 -0
  223. package/internal/utils/log.js +85 -0
  224. package/internal/utils/log.js.map +1 -0
  225. package/internal/utils/log.mjs +79 -0
  226. package/internal/utils/log.mjs.map +1 -0
  227. package/internal/utils/path.d.mts +15 -0
  228. package/internal/utils/path.d.mts.map +1 -0
  229. package/internal/utils/path.d.ts +15 -0
  230. package/internal/utils/path.d.ts.map +1 -0
  231. package/internal/utils/path.js +79 -0
  232. package/internal/utils/path.js.map +1 -0
  233. package/internal/utils/path.mjs +74 -0
  234. package/internal/utils/path.mjs.map +1 -0
  235. package/internal/utils/sleep.d.mts +2 -0
  236. package/internal/utils/sleep.d.mts.map +1 -0
  237. package/internal/utils/sleep.d.ts +2 -0
  238. package/internal/utils/sleep.d.ts.map +1 -0
  239. package/internal/utils/sleep.js +7 -0
  240. package/internal/utils/sleep.js.map +1 -0
  241. package/internal/utils/sleep.mjs +3 -0
  242. package/internal/utils/sleep.mjs.map +1 -0
  243. package/internal/utils/uuid.d.mts +5 -0
  244. package/internal/utils/uuid.d.mts.map +1 -0
  245. package/internal/utils/uuid.d.ts +5 -0
  246. package/internal/utils/uuid.d.ts.map +1 -0
  247. package/internal/utils/uuid.js +19 -0
  248. package/internal/utils/uuid.js.map +1 -0
  249. package/internal/utils/uuid.mjs +15 -0
  250. package/internal/utils/uuid.mjs.map +1 -0
  251. package/internal/utils/values.d.mts +18 -0
  252. package/internal/utils/values.d.mts.map +1 -0
  253. package/internal/utils/values.d.ts +18 -0
  254. package/internal/utils/values.d.ts.map +1 -0
  255. package/internal/utils/values.js +112 -0
  256. package/internal/utils/values.js.map +1 -0
  257. package/internal/utils/values.mjs +94 -0
  258. package/internal/utils/values.mjs.map +1 -0
  259. package/internal/utils.d.mts +7 -0
  260. package/internal/utils.d.mts.map +1 -0
  261. package/internal/utils.d.ts +7 -0
  262. package/internal/utils.d.ts.map +1 -0
  263. package/internal/utils.js +11 -0
  264. package/internal/utils.js.map +1 -0
  265. package/internal/utils.mjs +8 -0
  266. package/internal/utils.mjs.map +1 -0
  267. package/package.json +116 -67
  268. package/pagination.d.mts +2 -0
  269. package/pagination.d.mts.map +1 -0
  270. package/pagination.d.ts +1 -79
  271. package/pagination.d.ts.map +1 -1
  272. package/pagination.js +3 -123
  273. package/pagination.js.map +1 -1
  274. package/pagination.mjs +1 -118
  275. package/pagination.mjs.map +1 -1
  276. package/resource.d.mts +2 -0
  277. package/resource.d.mts.map +1 -0
  278. package/resource.d.ts +1 -5
  279. package/resource.d.ts.map +1 -1
  280. package/resource.js +3 -8
  281. package/resource.js.map +1 -1
  282. package/resource.mjs +1 -6
  283. package/resource.mjs.map +1 -1
  284. package/resources/access-tokens.d.mts +83 -0
  285. package/resources/access-tokens.d.mts.map +1 -0
  286. package/resources/access-tokens.d.ts +42 -33
  287. package/resources/access-tokens.d.ts.map +1 -1
  288. package/resources/access-tokens.js +2 -10
  289. package/resources/access-tokens.js.map +1 -1
  290. package/resources/access-tokens.mjs +2 -10
  291. package/resources/access-tokens.mjs.map +1 -1
  292. package/resources/account.d.mts +149 -0
  293. package/resources/account.d.mts.map +1 -0
  294. package/resources/account.d.ts +73 -49
  295. package/resources/account.d.ts.map +1 -1
  296. package/resources/account.js +1 -1
  297. package/resources/account.js.map +1 -1
  298. package/resources/account.mjs +1 -1
  299. package/resources/account.mjs.map +1 -1
  300. package/resources/connect/connect.d.mts +10 -0
  301. package/resources/connect/connect.d.mts.map +1 -0
  302. package/resources/connect/connect.d.ts +1 -1
  303. package/resources/connect/connect.d.ts.map +1 -1
  304. package/resources/connect/connect.js +3 -25
  305. package/resources/connect/connect.js.map +1 -1
  306. package/resources/connect/connect.mjs +1 -1
  307. package/resources/connect/index.d.mts +3 -0
  308. package/resources/connect/index.d.mts.map +1 -0
  309. package/resources/connect/index.d.ts.map +1 -1
  310. package/resources/connect/sessions.d.mts +110 -0
  311. package/resources/connect/sessions.d.mts.map +1 -0
  312. package/resources/connect/sessions.d.ts +44 -10
  313. package/resources/connect/sessions.d.ts.map +1 -1
  314. package/resources/connect/sessions.js +1 -1
  315. package/resources/connect/sessions.js.map +1 -1
  316. package/resources/connect/sessions.mjs +1 -1
  317. package/resources/connect/sessions.mjs.map +1 -1
  318. package/resources/connect.d.mts +2 -0
  319. package/resources/connect.d.mts.map +1 -0
  320. package/resources/connect.d.ts.map +1 -1
  321. package/resources/connect.js +2 -15
  322. package/resources/connect.js.map +1 -1
  323. package/resources/hris/benefits/benefits.d.mts +298 -0
  324. package/resources/hris/benefits/benefits.d.mts.map +1 -0
  325. package/resources/hris/benefits/benefits.d.ts +103 -115
  326. package/resources/hris/benefits/benefits.d.ts.map +1 -1
  327. package/resources/hris/benefits/benefits.js +45 -54
  328. package/resources/hris/benefits/benefits.js.map +1 -1
  329. package/resources/hris/benefits/benefits.mjs +43 -28
  330. package/resources/hris/benefits/benefits.mjs.map +1 -1
  331. package/resources/hris/benefits/index.d.mts +3 -0
  332. package/resources/hris/benefits/index.d.mts.map +1 -0
  333. package/resources/hris/benefits/index.d.ts +2 -2
  334. package/resources/hris/benefits/index.d.ts.map +1 -1
  335. package/resources/hris/benefits/index.js +1 -4
  336. package/resources/hris/benefits/index.js.map +1 -1
  337. package/resources/hris/benefits/index.mjs +2 -2
  338. package/resources/hris/benefits/index.mjs.map +1 -1
  339. package/resources/hris/benefits/individuals.d.mts +288 -0
  340. package/resources/hris/benefits/individuals.d.mts.map +1 -0
  341. package/resources/hris/benefits/individuals.d.ts +145 -27
  342. package/resources/hris/benefits/individuals.d.ts.map +1 -1
  343. package/resources/hris/benefits/individuals.js +61 -26
  344. package/resources/hris/benefits/individuals.js.map +1 -1
  345. package/resources/hris/benefits/individuals.mjs +60 -24
  346. package/resources/hris/benefits/individuals.mjs.map +1 -1
  347. package/resources/hris/benefits.d.mts +2 -0
  348. package/resources/hris/benefits.d.mts.map +1 -0
  349. package/resources/hris/benefits.d.ts.map +1 -1
  350. package/resources/hris/benefits.js +2 -15
  351. package/resources/hris/benefits.js.map +1 -1
  352. package/resources/hris/company/company.d.mts +124 -0
  353. package/resources/hris/company/company.d.mts.map +1 -0
  354. package/resources/hris/company/company.d.ts +12 -5
  355. package/resources/hris/company/company.d.ts.map +1 -1
  356. package/resources/hris/company/company.js +5 -28
  357. package/resources/hris/company/company.js.map +1 -1
  358. package/resources/hris/company/company.mjs +4 -5
  359. package/resources/hris/company/company.mjs.map +1 -1
  360. package/resources/hris/company/index.d.mts +3 -0
  361. package/resources/hris/company/index.d.mts.map +1 -0
  362. package/resources/hris/company/index.d.ts +2 -2
  363. package/resources/hris/company/index.d.ts.map +1 -1
  364. package/resources/hris/company/index.js +1 -2
  365. package/resources/hris/company/index.js.map +1 -1
  366. package/resources/hris/company/index.mjs +1 -1
  367. package/resources/hris/company/index.mjs.map +1 -1
  368. package/resources/hris/company/pay-statement-item/index.d.mts +3 -0
  369. package/resources/hris/company/pay-statement-item/index.d.mts.map +1 -0
  370. package/resources/hris/company/pay-statement-item/index.d.ts +2 -2
  371. package/resources/hris/company/pay-statement-item/index.d.ts.map +1 -1
  372. package/resources/hris/company/pay-statement-item/index.js +1 -3
  373. package/resources/hris/company/pay-statement-item/index.js.map +1 -1
  374. package/resources/hris/company/pay-statement-item/index.mjs +2 -2
  375. package/resources/hris/company/pay-statement-item/index.mjs.map +1 -1
  376. package/resources/hris/company/pay-statement-item/pay-statement-item.d.mts +99 -0
  377. package/resources/hris/company/pay-statement-item/pay-statement-item.d.mts.map +1 -0
  378. package/resources/hris/company/pay-statement-item/pay-statement-item.d.ts +22 -18
  379. package/resources/hris/company/pay-statement-item/pay-statement-item.d.ts.map +1 -1
  380. package/resources/hris/company/pay-statement-item/pay-statement-item.js +19 -40
  381. package/resources/hris/company/pay-statement-item/pay-statement-item.js.map +1 -1
  382. package/resources/hris/company/pay-statement-item/pay-statement-item.mjs +17 -15
  383. package/resources/hris/company/pay-statement-item/pay-statement-item.mjs.map +1 -1
  384. package/resources/hris/company/pay-statement-item/rules.d.mts +398 -0
  385. package/resources/hris/company/pay-statement-item/rules.d.mts.map +1 -0
  386. package/resources/hris/company/pay-statement-item/rules.d.ts +56 -21
  387. package/resources/hris/company/pay-statement-item/rules.d.ts.map +1 -1
  388. package/resources/hris/company/pay-statement-item/rules.js +55 -22
  389. package/resources/hris/company/pay-statement-item/rules.js.map +1 -1
  390. package/resources/hris/company/pay-statement-item/rules.mjs +54 -20
  391. package/resources/hris/company/pay-statement-item/rules.mjs.map +1 -1
  392. package/resources/hris/company/pay-statement-item.d.mts +2 -0
  393. package/resources/hris/company/pay-statement-item.d.mts.map +1 -0
  394. package/resources/hris/company/pay-statement-item.d.ts.map +1 -1
  395. package/resources/hris/company/pay-statement-item.js +2 -15
  396. package/resources/hris/company/pay-statement-item.js.map +1 -1
  397. package/resources/hris/company.d.mts +2 -0
  398. package/resources/hris/company.d.mts.map +1 -0
  399. package/resources/hris/company.d.ts.map +1 -1
  400. package/resources/hris/company.js +2 -15
  401. package/resources/hris/company.js.map +1 -1
  402. package/resources/hris/directory.d.mts +87 -0
  403. package/resources/hris/directory.d.mts.map +1 -0
  404. package/resources/hris/directory.d.ts +13 -9
  405. package/resources/hris/directory.d.ts.map +1 -1
  406. package/resources/hris/directory.js +17 -7
  407. package/resources/hris/directory.js.map +1 -1
  408. package/resources/hris/directory.mjs +17 -7
  409. package/resources/hris/directory.mjs.map +1 -1
  410. package/resources/hris/documents.d.mts +198 -0
  411. package/resources/hris/documents.d.mts.map +1 -0
  412. package/resources/hris/documents.d.ts +40 -30
  413. package/resources/hris/documents.d.ts.map +1 -1
  414. package/resources/hris/documents.js +13 -7
  415. package/resources/hris/documents.js.map +1 -1
  416. package/resources/hris/documents.mjs +13 -7
  417. package/resources/hris/documents.mjs.map +1 -1
  418. package/resources/hris/employments.d.mts +175 -0
  419. package/resources/hris/employments.d.mts.map +1 -0
  420. package/resources/hris/employments.d.ts +23 -20
  421. package/resources/hris/employments.d.ts.map +1 -1
  422. package/resources/hris/employments.js +7 -9
  423. package/resources/hris/employments.js.map +1 -1
  424. package/resources/hris/employments.mjs +6 -7
  425. package/resources/hris/employments.mjs.map +1 -1
  426. package/resources/hris/hris.d.mts +98 -0
  427. package/resources/hris/hris.d.mts.map +1 -0
  428. package/resources/hris/hris.d.ts +14 -14
  429. package/resources/hris/hris.d.ts.map +1 -1
  430. package/resources/hris/hris.js +10 -38
  431. package/resources/hris/hris.js.map +1 -1
  432. package/resources/hris/hris.mjs +6 -12
  433. package/resources/hris/hris.mjs.map +1 -1
  434. package/resources/hris/index.d.mts +10 -0
  435. package/resources/hris/index.d.mts.map +1 -0
  436. package/resources/hris/index.d.ts +7 -7
  437. package/resources/hris/index.d.ts.map +1 -1
  438. package/resources/hris/index.js +1 -7
  439. package/resources/hris/index.js.map +1 -1
  440. package/resources/hris/index.mjs +5 -5
  441. package/resources/hris/index.mjs.map +1 -1
  442. package/resources/hris/individuals.d.mts +116 -0
  443. package/resources/hris/individuals.d.mts.map +1 -0
  444. package/resources/hris/individuals.d.ts +16 -8
  445. package/resources/hris/individuals.d.ts.map +1 -1
  446. package/resources/hris/individuals.js +18 -13
  447. package/resources/hris/individuals.js.map +1 -1
  448. package/resources/hris/individuals.mjs +17 -11
  449. package/resources/hris/individuals.mjs.map +1 -1
  450. package/resources/hris/pay-statements.d.mts +268 -0
  451. package/resources/hris/pay-statements.d.mts.map +1 -0
  452. package/resources/hris/pay-statements.d.ts +113 -100
  453. package/resources/hris/pay-statements.d.ts.map +1 -1
  454. package/resources/hris/pay-statements.js +7 -9
  455. package/resources/hris/pay-statements.js.map +1 -1
  456. package/resources/hris/pay-statements.mjs +6 -7
  457. package/resources/hris/pay-statements.mjs.map +1 -1
  458. package/resources/hris/payments.d.mts +80 -0
  459. package/resources/hris/payments.d.mts.map +1 -0
  460. package/resources/hris/payments.d.ts +24 -21
  461. package/resources/hris/payments.d.ts.map +1 -1
  462. package/resources/hris/payments.js +4 -8
  463. package/resources/hris/payments.js.map +1 -1
  464. package/resources/hris/payments.mjs +3 -6
  465. package/resources/hris/payments.mjs.map +1 -1
  466. package/resources/hris.d.mts +2 -0
  467. package/resources/hris.d.mts.map +1 -0
  468. package/resources/hris.d.ts.map +1 -1
  469. package/resources/hris.js +2 -15
  470. package/resources/hris.js.map +1 -1
  471. package/resources/index.d.mts +12 -0
  472. package/resources/index.d.mts.map +1 -0
  473. package/resources/index.d.ts +1 -1
  474. package/resources/index.d.ts.map +1 -1
  475. package/resources/index.js +3 -17
  476. package/resources/index.js.map +1 -1
  477. package/resources/index.mjs +1 -1
  478. package/resources/index.mjs.map +1 -1
  479. package/resources/jobs/automated.d.mts +174 -0
  480. package/resources/jobs/automated.d.mts.map +1 -0
  481. package/resources/jobs/automated.d.ts +15 -11
  482. package/resources/jobs/automated.d.ts.map +1 -1
  483. package/resources/jobs/automated.js +9 -7
  484. package/resources/jobs/automated.js.map +1 -1
  485. package/resources/jobs/automated.mjs +9 -7
  486. package/resources/jobs/automated.mjs.map +1 -1
  487. package/resources/jobs/index.d.mts +4 -0
  488. package/resources/jobs/index.d.mts.map +1 -0
  489. package/resources/jobs/index.d.ts.map +1 -1
  490. package/resources/jobs/jobs.d.mts +14 -0
  491. package/resources/jobs/jobs.d.mts.map +1 -0
  492. package/resources/jobs/jobs.d.ts +1 -1
  493. package/resources/jobs/jobs.d.ts.map +1 -1
  494. package/resources/jobs/jobs.js +4 -26
  495. package/resources/jobs/jobs.js.map +1 -1
  496. package/resources/jobs/jobs.mjs +1 -1
  497. package/resources/jobs/manual.d.mts +22 -0
  498. package/resources/jobs/manual.d.mts.map +1 -0
  499. package/resources/jobs/manual.d.ts +4 -3
  500. package/resources/jobs/manual.d.ts.map +1 -1
  501. package/resources/jobs/manual.js +4 -3
  502. package/resources/jobs/manual.js.map +1 -1
  503. package/resources/jobs/manual.mjs +4 -3
  504. package/resources/jobs/manual.mjs.map +1 -1
  505. package/resources/jobs.d.mts +2 -0
  506. package/resources/jobs.d.mts.map +1 -0
  507. package/resources/jobs.d.ts.map +1 -1
  508. package/resources/jobs.js +2 -15
  509. package/resources/jobs.js.map +1 -1
  510. package/resources/payroll/index.d.mts +3 -0
  511. package/resources/payroll/index.d.mts.map +1 -0
  512. package/resources/payroll/index.d.ts +1 -1
  513. package/resources/payroll/index.d.ts.map +1 -1
  514. package/resources/payroll/index.js +1 -2
  515. package/resources/payroll/index.js.map +1 -1
  516. package/resources/payroll/index.mjs +1 -1
  517. package/resources/payroll/index.mjs.map +1 -1
  518. package/resources/payroll/pay-groups.d.mts +62 -0
  519. package/resources/payroll/pay-groups.d.mts.map +1 -0
  520. package/resources/payroll/pay-groups.d.ts +22 -13
  521. package/resources/payroll/pay-groups.d.ts.map +1 -1
  522. package/resources/payroll/pay-groups.js +10 -14
  523. package/resources/payroll/pay-groups.js.map +1 -1
  524. package/resources/payroll/pay-groups.mjs +9 -12
  525. package/resources/payroll/pay-groups.mjs.map +1 -1
  526. package/resources/payroll/payroll.d.mts +10 -0
  527. package/resources/payroll/payroll.d.mts.map +1 -0
  528. package/resources/payroll/payroll.d.ts +3 -3
  529. package/resources/payroll/payroll.d.ts.map +1 -1
  530. package/resources/payroll/payroll.js +3 -26
  531. package/resources/payroll/payroll.js.map +1 -1
  532. package/resources/payroll/payroll.mjs +2 -3
  533. package/resources/payroll/payroll.mjs.map +1 -1
  534. package/resources/payroll.d.mts +2 -0
  535. package/resources/payroll.d.mts.map +1 -0
  536. package/resources/payroll.d.ts.map +1 -1
  537. package/resources/payroll.js +2 -15
  538. package/resources/payroll.js.map +1 -1
  539. package/resources/providers.d.mts +142 -0
  540. package/resources/providers.d.mts.map +1 -0
  541. package/resources/providers.d.ts +90 -258
  542. package/resources/providers.d.ts.map +1 -1
  543. package/resources/providers.js +4 -8
  544. package/resources/providers.js.map +1 -1
  545. package/resources/providers.mjs +3 -6
  546. package/resources/providers.mjs.map +1 -1
  547. package/resources/request-forwarding.d.mts +109 -0
  548. package/resources/request-forwarding.d.mts.map +1 -0
  549. package/resources/request-forwarding.d.ts +48 -49
  550. package/resources/request-forwarding.d.ts.map +1 -1
  551. package/resources/request-forwarding.js +3 -13
  552. package/resources/request-forwarding.js.map +1 -1
  553. package/resources/request-forwarding.mjs +3 -13
  554. package/resources/request-forwarding.mjs.map +1 -1
  555. package/resources/sandbox/company.d.mts +219 -0
  556. package/resources/sandbox/company.d.mts.map +1 -0
  557. package/resources/sandbox/company.d.ts +4 -3
  558. package/resources/sandbox/company.d.ts.map +1 -1
  559. package/resources/sandbox/company.js +1 -1
  560. package/resources/sandbox/company.js.map +1 -1
  561. package/resources/sandbox/company.mjs +1 -1
  562. package/resources/sandbox/company.mjs.map +1 -1
  563. package/resources/sandbox/connections/accounts.d.mts +97 -0
  564. package/resources/sandbox/connections/accounts.d.mts.map +1 -0
  565. package/resources/sandbox/connections/accounts.d.ts +5 -5
  566. package/resources/sandbox/connections/accounts.d.ts.map +1 -1
  567. package/resources/sandbox/connections/accounts.js +13 -5
  568. package/resources/sandbox/connections/accounts.js.map +1 -1
  569. package/resources/sandbox/connections/accounts.mjs +13 -5
  570. package/resources/sandbox/connections/accounts.mjs.map +1 -1
  571. package/resources/sandbox/connections/connections.d.mts +62 -0
  572. package/resources/sandbox/connections/connections.d.mts.map +1 -0
  573. package/resources/sandbox/connections/connections.d.ts +4 -3
  574. package/resources/sandbox/connections/connections.d.ts.map +1 -1
  575. package/resources/sandbox/connections/connections.js +3 -25
  576. package/resources/sandbox/connections/connections.js.map +1 -1
  577. package/resources/sandbox/connections/connections.mjs +1 -1
  578. package/resources/sandbox/connections/connections.mjs.map +1 -1
  579. package/resources/sandbox/connections/index.d.mts +3 -0
  580. package/resources/sandbox/connections/index.d.mts.map +1 -0
  581. package/resources/sandbox/connections/index.d.ts.map +1 -1
  582. package/resources/sandbox/connections.d.mts +2 -0
  583. package/resources/sandbox/connections.d.mts.map +1 -0
  584. package/resources/sandbox/connections.d.ts.map +1 -1
  585. package/resources/sandbox/connections.js +2 -15
  586. package/resources/sandbox/connections.js.map +1 -1
  587. package/resources/sandbox/directory.d.mts +174 -0
  588. package/resources/sandbox/directory.d.mts.map +1 -0
  589. package/resources/sandbox/directory.d.ts +12 -8
  590. package/resources/sandbox/directory.d.ts.map +1 -1
  591. package/resources/sandbox/directory.js +12 -7
  592. package/resources/sandbox/directory.js.map +1 -1
  593. package/resources/sandbox/directory.mjs +12 -7
  594. package/resources/sandbox/directory.mjs.map +1 -1
  595. package/resources/sandbox/employment.d.mts +235 -0
  596. package/resources/sandbox/employment.d.mts.map +1 -0
  597. package/resources/sandbox/employment.d.ts +4 -4
  598. package/resources/sandbox/employment.d.ts.map +1 -1
  599. package/resources/sandbox/employment.js +14 -7
  600. package/resources/sandbox/employment.js.map +1 -1
  601. package/resources/sandbox/employment.mjs +14 -7
  602. package/resources/sandbox/employment.mjs.map +1 -1
  603. package/resources/sandbox/index.d.mts +9 -0
  604. package/resources/sandbox/index.d.mts.map +1 -0
  605. package/resources/sandbox/index.d.ts.map +1 -1
  606. package/resources/sandbox/individual.d.mts +131 -0
  607. package/resources/sandbox/individual.d.mts.map +1 -0
  608. package/resources/sandbox/individual.d.ts +4 -4
  609. package/resources/sandbox/individual.d.ts.map +1 -1
  610. package/resources/sandbox/individual.js +14 -7
  611. package/resources/sandbox/individual.js.map +1 -1
  612. package/resources/sandbox/individual.mjs +14 -7
  613. package/resources/sandbox/individual.mjs.map +1 -1
  614. package/resources/sandbox/jobs/configuration.d.mts +41 -0
  615. package/resources/sandbox/jobs/configuration.d.mts.map +1 -0
  616. package/resources/sandbox/jobs/configuration.d.ts +5 -4
  617. package/resources/sandbox/jobs/configuration.d.ts.map +1 -1
  618. package/resources/sandbox/jobs/configuration.js +1 -1
  619. package/resources/sandbox/jobs/configuration.js.map +1 -1
  620. package/resources/sandbox/jobs/configuration.mjs +1 -1
  621. package/resources/sandbox/jobs/configuration.mjs.map +1 -1
  622. package/resources/sandbox/jobs/index.d.mts +3 -0
  623. package/resources/sandbox/jobs/index.d.mts.map +1 -0
  624. package/resources/sandbox/jobs/index.d.ts.map +1 -1
  625. package/resources/sandbox/jobs/jobs.d.mts +48 -0
  626. package/resources/sandbox/jobs/jobs.d.mts.map +1 -0
  627. package/resources/sandbox/jobs/jobs.d.ts +4 -3
  628. package/resources/sandbox/jobs/jobs.d.ts.map +1 -1
  629. package/resources/sandbox/jobs/jobs.js +3 -25
  630. package/resources/sandbox/jobs/jobs.js.map +1 -1
  631. package/resources/sandbox/jobs/jobs.mjs +1 -1
  632. package/resources/sandbox/jobs/jobs.mjs.map +1 -1
  633. package/resources/sandbox/jobs.d.mts +2 -0
  634. package/resources/sandbox/jobs.d.mts.map +1 -0
  635. package/resources/sandbox/jobs.d.ts.map +1 -1
  636. package/resources/sandbox/jobs.js +2 -15
  637. package/resources/sandbox/jobs.js.map +1 -1
  638. package/resources/sandbox/payment.d.mts +81 -0
  639. package/resources/sandbox/payment.d.mts.map +1 -0
  640. package/resources/sandbox/payment.d.ts +34 -188
  641. package/resources/sandbox/payment.d.ts.map +1 -1
  642. package/resources/sandbox/payment.js +9 -5
  643. package/resources/sandbox/payment.js.map +1 -1
  644. package/resources/sandbox/payment.mjs +9 -5
  645. package/resources/sandbox/payment.mjs.map +1 -1
  646. package/resources/sandbox/sandbox.d.mts +34 -0
  647. package/resources/sandbox/sandbox.d.mts.map +1 -0
  648. package/resources/sandbox/sandbox.d.ts +1 -1
  649. package/resources/sandbox/sandbox.d.ts.map +1 -1
  650. package/resources/sandbox/sandbox.js +9 -31
  651. package/resources/sandbox/sandbox.js.map +1 -1
  652. package/resources/sandbox/sandbox.mjs +1 -1
  653. package/resources/sandbox.d.mts +2 -0
  654. package/resources/sandbox.d.mts.map +1 -0
  655. package/resources/sandbox.d.ts.map +1 -1
  656. package/resources/sandbox.js +2 -15
  657. package/resources/sandbox.js.map +1 -1
  658. package/resources/shared.d.mts +64 -0
  659. package/resources/shared.d.mts.map +1 -0
  660. package/resources/top-level.d.mts +2 -0
  661. package/resources/top-level.d.mts.map +1 -0
  662. package/resources/webhooks.d.mts +396 -0
  663. package/resources/webhooks.d.mts.map +1 -0
  664. package/resources/webhooks.d.ts +5 -3
  665. package/resources/webhooks.d.ts.map +1 -1
  666. package/resources/webhooks.js +9 -8
  667. package/resources/webhooks.js.map +1 -1
  668. package/resources/webhooks.mjs +3 -2
  669. package/resources/webhooks.mjs.map +1 -1
  670. package/resources.d.mts +2 -0
  671. package/resources.d.mts.map +1 -0
  672. package/resources.d.ts.map +1 -1
  673. package/resources.js +2 -15
  674. package/resources.js.map +1 -1
  675. package/src/api-promise.ts +2 -0
  676. package/src/client.ts +967 -0
  677. package/src/core/README.md +3 -0
  678. package/src/core/api-promise.ts +92 -0
  679. package/src/core/error.ts +130 -0
  680. package/src/core/pagination.ts +292 -0
  681. package/src/core/resource.ts +11 -0
  682. package/src/core/uploads.ts +2 -0
  683. package/src/error.ts +2 -130
  684. package/src/index.ts +6 -432
  685. package/src/internal/README.md +3 -0
  686. package/src/internal/builtin-types.ts +93 -0
  687. package/src/internal/detect-platform.ts +196 -0
  688. package/src/internal/errors.ts +33 -0
  689. package/src/internal/headers.ts +144 -0
  690. package/src/internal/parse.ts +50 -0
  691. package/src/internal/qs/formats.ts +3 -2
  692. package/src/internal/qs/index.ts +3 -3
  693. package/src/internal/qs/stringify.ts +18 -21
  694. package/src/internal/qs/utils.ts +16 -16
  695. package/src/internal/request-options.ts +91 -0
  696. package/src/internal/shim-types.ts +26 -0
  697. package/src/internal/shims.ts +107 -0
  698. package/src/internal/to-file.ts +154 -0
  699. package/src/internal/types.ts +95 -0
  700. package/src/internal/uploads.ts +187 -0
  701. package/src/internal/utils/base64.ts +40 -0
  702. package/src/internal/utils/bytes.ts +32 -0
  703. package/src/internal/utils/env.ts +18 -0
  704. package/src/internal/utils/log.ts +126 -0
  705. package/src/internal/utils/path.ts +88 -0
  706. package/src/internal/utils/sleep.ts +3 -0
  707. package/src/internal/utils/uuid.ts +17 -0
  708. package/src/internal/utils/values.ts +105 -0
  709. package/src/internal/utils.ts +8 -0
  710. package/src/pagination.ts +2 -221
  711. package/src/resource.ts +2 -11
  712. package/src/resources/access-tokens.ts +46 -39
  713. package/src/resources/account.ts +86 -57
  714. package/src/resources/connect/connect.ts +3 -3
  715. package/src/resources/connect/index.ts +2 -2
  716. package/src/resources/connect/sessions.ts +52 -18
  717. package/src/resources/connect.ts +1 -1
  718. package/src/resources/hris/benefits/benefits.ts +163 -173
  719. package/src/resources/hris/benefits/index.ts +9 -6
  720. package/src/resources/hris/benefits/individuals.ts +202 -79
  721. package/src/resources/hris/benefits.ts +1 -1
  722. package/src/resources/hris/company/company.ts +20 -10
  723. package/src/resources/hris/company/index.ts +3 -3
  724. package/src/resources/hris/company/pay-statement-item/index.ts +6 -4
  725. package/src/resources/hris/company/pay-statement-item/pay-statement-item.ts +34 -37
  726. package/src/resources/hris/company/pay-statement-item/rules.ts +85 -43
  727. package/src/resources/hris/company/pay-statement-item.ts +1 -1
  728. package/src/resources/hris/company.ts +1 -1
  729. package/src/resources/hris/directory.ts +22 -18
  730. package/src/resources/hris/documents.ts +51 -38
  731. package/src/resources/hris/employments.ts +33 -28
  732. package/src/resources/hris/hris.ts +41 -35
  733. package/src/resources/hris/index.ts +19 -15
  734. package/src/resources/hris/individuals.ts +23 -21
  735. package/src/resources/hris/pay-statements.ts +130 -116
  736. package/src/resources/hris/payments.ts +32 -32
  737. package/src/resources/hris.ts +1 -1
  738. package/src/resources/index.ts +16 -11
  739. package/src/resources/jobs/automated.ts +20 -22
  740. package/src/resources/jobs/index.ts +3 -3
  741. package/src/resources/jobs/jobs.ts +5 -5
  742. package/src/resources/jobs/manual.ts +6 -4
  743. package/src/resources/jobs.ts +1 -1
  744. package/src/resources/payroll/index.ts +4 -3
  745. package/src/resources/payroll/pay-groups.ts +43 -37
  746. package/src/resources/payroll/payroll.ts +6 -5
  747. package/src/resources/payroll.ts +1 -1
  748. package/src/resources/providers.ts +91 -397
  749. package/src/resources/request-forwarding.ts +38 -51
  750. package/src/resources/sandbox/company.ts +5 -4
  751. package/src/resources/sandbox/connections/accounts.ts +8 -13
  752. package/src/resources/sandbox/connections/connections.ts +6 -8
  753. package/src/resources/sandbox/connections/index.ts +2 -2
  754. package/src/resources/sandbox/connections.ts +1 -1
  755. package/src/resources/sandbox/directory.ts +17 -20
  756. package/src/resources/sandbox/employment.ts +10 -18
  757. package/src/resources/sandbox/index.ts +8 -8
  758. package/src/resources/sandbox/individual.ts +10 -18
  759. package/src/resources/sandbox/jobs/configuration.ts +5 -7
  760. package/src/resources/sandbox/jobs/index.ts +2 -2
  761. package/src/resources/sandbox/jobs/jobs.ts +6 -5
  762. package/src/resources/sandbox/jobs.ts +1 -1
  763. package/src/resources/sandbox/payment.ts +82 -220
  764. package/src/resources/sandbox/sandbox.ts +15 -15
  765. package/src/resources/sandbox.ts +1 -1
  766. package/src/resources/webhooks.ts +7 -5
  767. package/src/resources.ts +1 -1
  768. package/src/tsconfig.json +2 -2
  769. package/src/uploads.ts +2 -255
  770. package/src/version.ts +1 -1
  771. package/uploads.d.mts +2 -0
  772. package/uploads.d.mts.map +1 -0
  773. package/uploads.d.ts +1 -74
  774. package/uploads.d.ts.map +1 -1
  775. package/uploads.js +3 -168
  776. package/uploads.js.map +1 -1
  777. package/uploads.mjs +1 -157
  778. package/uploads.mjs.map +1 -1
  779. package/version.d.mts +2 -0
  780. package/version.d.mts.map +1 -0
  781. package/version.d.ts +1 -1
  782. package/version.d.ts.map +1 -1
  783. package/version.js +1 -1
  784. package/version.js.map +1 -1
  785. package/version.mjs +1 -1
  786. package/version.mjs.map +1 -1
  787. package/_shims/MultipartBody.d.ts +0 -9
  788. package/_shims/MultipartBody.d.ts.map +0 -1
  789. package/_shims/MultipartBody.js +0 -16
  790. package/_shims/MultipartBody.js.map +0 -1
  791. package/_shims/MultipartBody.mjs +0 -12
  792. package/_shims/MultipartBody.mjs.map +0 -1
  793. package/_shims/README.md +0 -46
  794. package/_shims/auto/runtime-bun.d.ts +0 -5
  795. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  796. package/_shims/auto/runtime-bun.js +0 -21
  797. package/_shims/auto/runtime-bun.js.map +0 -1
  798. package/_shims/auto/runtime-bun.mjs +0 -2
  799. package/_shims/auto/runtime-bun.mjs.map +0 -1
  800. package/_shims/auto/runtime-node.d.ts +0 -5
  801. package/_shims/auto/runtime-node.d.ts.map +0 -1
  802. package/_shims/auto/runtime-node.js +0 -21
  803. package/_shims/auto/runtime-node.js.map +0 -1
  804. package/_shims/auto/runtime-node.mjs +0 -2
  805. package/_shims/auto/runtime-node.mjs.map +0 -1
  806. package/_shims/auto/runtime.d.ts +0 -5
  807. package/_shims/auto/runtime.d.ts.map +0 -1
  808. package/_shims/auto/runtime.js +0 -21
  809. package/_shims/auto/runtime.js.map +0 -1
  810. package/_shims/auto/runtime.mjs +0 -2
  811. package/_shims/auto/runtime.mjs.map +0 -1
  812. package/_shims/auto/types-node.d.ts +0 -5
  813. package/_shims/auto/types-node.d.ts.map +0 -1
  814. package/_shims/auto/types-node.js +0 -21
  815. package/_shims/auto/types-node.js.map +0 -1
  816. package/_shims/auto/types-node.mjs +0 -2
  817. package/_shims/auto/types-node.mjs.map +0 -1
  818. package/_shims/auto/types.d.ts +0 -101
  819. package/_shims/auto/types.js +0 -3
  820. package/_shims/auto/types.mjs +0 -3
  821. package/_shims/bun-runtime.d.ts +0 -6
  822. package/_shims/bun-runtime.d.ts.map +0 -1
  823. package/_shims/bun-runtime.js +0 -14
  824. package/_shims/bun-runtime.js.map +0 -1
  825. package/_shims/bun-runtime.mjs +0 -10
  826. package/_shims/bun-runtime.mjs.map +0 -1
  827. package/_shims/index.d.ts +0 -83
  828. package/_shims/index.js +0 -17
  829. package/_shims/index.mjs +0 -11
  830. package/_shims/manual-types.d.ts +0 -12
  831. package/_shims/manual-types.js +0 -3
  832. package/_shims/manual-types.mjs +0 -3
  833. package/_shims/node-runtime.d.ts +0 -3
  834. package/_shims/node-runtime.d.ts.map +0 -1
  835. package/_shims/node-runtime.js +0 -89
  836. package/_shims/node-runtime.js.map +0 -1
  837. package/_shims/node-runtime.mjs +0 -56
  838. package/_shims/node-runtime.mjs.map +0 -1
  839. package/_shims/node-types.d.ts +0 -42
  840. package/_shims/node-types.js +0 -3
  841. package/_shims/node-types.mjs +0 -3
  842. package/_shims/registry.d.ts +0 -37
  843. package/_shims/registry.d.ts.map +0 -1
  844. package/_shims/registry.js +0 -41
  845. package/_shims/registry.js.map +0 -1
  846. package/_shims/registry.mjs +0 -37
  847. package/_shims/registry.mjs.map +0 -1
  848. package/_shims/web-runtime.d.ts +0 -5
  849. package/_shims/web-runtime.d.ts.map +0 -1
  850. package/_shims/web-runtime.js +0 -78
  851. package/_shims/web-runtime.js.map +0 -1
  852. package/_shims/web-runtime.mjs +0 -71
  853. package/_shims/web-runtime.mjs.map +0 -1
  854. package/_shims/web-types.d.ts +0 -83
  855. package/_shims/web-types.js +0 -3
  856. package/_shims/web-types.mjs +0 -3
  857. package/core.d.ts +0 -253
  858. package/core.d.ts.map +0 -1
  859. package/core.js +0 -932
  860. package/core.js.map +0 -1
  861. package/core.mjs +0 -899
  862. package/core.mjs.map +0 -1
  863. package/shims/node.d.ts +0 -30
  864. package/shims/node.d.ts.map +0 -1
  865. package/shims/node.js +0 -31
  866. package/shims/node.js.map +0 -1
  867. package/shims/node.mjs +0 -5
  868. package/shims/node.mjs.map +0 -1
  869. package/shims/web.d.ts +0 -26
  870. package/shims/web.d.ts.map +0 -1
  871. package/shims/web.js +0 -31
  872. package/shims/web.js.map +0 -1
  873. package/shims/web.mjs +0 -5
  874. package/shims/web.mjs.map +0 -1
  875. package/src/_shims/MultipartBody.ts +0 -9
  876. package/src/_shims/README.md +0 -46
  877. package/src/_shims/auto/runtime-bun.ts +0 -4
  878. package/src/_shims/auto/runtime-node.ts +0 -4
  879. package/src/_shims/auto/runtime.ts +0 -4
  880. package/src/_shims/auto/types-node.ts +0 -4
  881. package/src/_shims/auto/types.d.ts +0 -101
  882. package/src/_shims/auto/types.js +0 -3
  883. package/src/_shims/auto/types.mjs +0 -3
  884. package/src/_shims/bun-runtime.ts +0 -14
  885. package/src/_shims/index.d.ts +0 -83
  886. package/src/_shims/index.js +0 -17
  887. package/src/_shims/index.mjs +0 -11
  888. package/src/_shims/manual-types.d.ts +0 -12
  889. package/src/_shims/manual-types.js +0 -3
  890. package/src/_shims/manual-types.mjs +0 -3
  891. package/src/_shims/node-runtime.ts +0 -81
  892. package/src/_shims/node-types.d.ts +0 -42
  893. package/src/_shims/node-types.js +0 -3
  894. package/src/_shims/node-types.mjs +0 -3
  895. package/src/_shims/registry.ts +0 -67
  896. package/src/_shims/web-runtime.ts +0 -103
  897. package/src/_shims/web-types.d.ts +0 -83
  898. package/src/_shims/web-types.js +0 -3
  899. package/src/_shims/web-types.mjs +0 -3
  900. package/src/core.ts +0 -1248
  901. package/src/shims/node.ts +0 -50
  902. package/src/shims/web.ts +0 -50
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../src/internal/headers.ts"],"names":[],"mappings":"AAIA,KAAK,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC7C,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,SAAS,WAAW,EAAE,EAAE,GACxB,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,WAAW,EAAE,CAAC,GACpD,SAAS,GACT,IAAI,GACJ,eAAe,CAAC;AAEpB,QAAA,MAAM,4BAA4B,eAAyD,CAAC;AAE5F;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,kEAAkE;IAClE,CAAC,4BAA4B,CAAC,EAAE,IAAI,CAAC;IACrC,sBAAsB;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,4DAA4D;IAC5D,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpB,CAAC;AA2CF,eAAO,MAAM,YAAY,GAAI,YAAY,WAAW,EAAE,KAAG,eAqBxD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,YAGlD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,WAAW,GAAG,OAAO,EAAE,QAAQ,MAAM,KAAG,MAMlF,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,GAAG,KAAG,OAAO,IAAI,eAE3D,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACpD;AAED,eAAO,MAAM,SAAS,GAAI,SAAS,WAAW,GAAG,OAAO,EAAE,QAAQ,MAAM,KAAG,MAAM,GAAG,SA6BnF,CAAC"}
@@ -0,0 +1,120 @@
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.getHeader = exports.isHeadersProtocol = exports.getRequiredHeader = exports.isEmptyHeaders = exports.buildHeaders = void 0;
5
+ const values_1 = require("./utils/values.js");
6
+ const brand_privateNullableHeaders = /* @__PURE__ */ Symbol('brand.privateNullableHeaders');
7
+ function* iterateHeaders(headers) {
8
+ if (!headers)
9
+ return;
10
+ if (brand_privateNullableHeaders in headers) {
11
+ const { values, nulls } = headers;
12
+ yield* values.entries();
13
+ for (const name of nulls) {
14
+ yield [name, null];
15
+ }
16
+ return;
17
+ }
18
+ let shouldClear = false;
19
+ let iter;
20
+ if (headers instanceof Headers) {
21
+ iter = headers.entries();
22
+ }
23
+ else if ((0, values_1.isReadonlyArray)(headers)) {
24
+ iter = headers;
25
+ }
26
+ else {
27
+ shouldClear = true;
28
+ iter = Object.entries(headers ?? {});
29
+ }
30
+ for (let row of iter) {
31
+ const name = row[0];
32
+ if (typeof name !== 'string')
33
+ throw new TypeError('expected header name to be a string');
34
+ const values = (0, values_1.isReadonlyArray)(row[1]) ? row[1] : [row[1]];
35
+ let didClear = false;
36
+ for (const value of values) {
37
+ if (value === undefined)
38
+ continue;
39
+ // Objects keys always overwrite older headers, they never append.
40
+ // Yield a null to clear the header before adding the new values.
41
+ if (shouldClear && !didClear) {
42
+ didClear = true;
43
+ yield [name, null];
44
+ }
45
+ yield [name, value];
46
+ }
47
+ }
48
+ }
49
+ const buildHeaders = (newHeaders) => {
50
+ const targetHeaders = new Headers();
51
+ const nullHeaders = new Set();
52
+ for (const headers of newHeaders) {
53
+ const seenHeaders = new Set();
54
+ for (const [name, value] of iterateHeaders(headers)) {
55
+ const lowerName = name.toLowerCase();
56
+ if (!seenHeaders.has(lowerName)) {
57
+ targetHeaders.delete(name);
58
+ seenHeaders.add(lowerName);
59
+ }
60
+ if (value === null) {
61
+ targetHeaders.delete(name);
62
+ nullHeaders.add(lowerName);
63
+ }
64
+ else {
65
+ targetHeaders.append(name, value);
66
+ nullHeaders.delete(lowerName);
67
+ }
68
+ }
69
+ }
70
+ return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };
71
+ };
72
+ exports.buildHeaders = buildHeaders;
73
+ const isEmptyHeaders = (headers) => {
74
+ for (const _ of iterateHeaders(headers))
75
+ return false;
76
+ return true;
77
+ };
78
+ exports.isEmptyHeaders = isEmptyHeaders;
79
+ const getRequiredHeader = (headers, header) => {
80
+ const foundHeader = (0, exports.getHeader)(headers, header);
81
+ if (foundHeader === undefined) {
82
+ throw new Error(`Could not find ${header} header`);
83
+ }
84
+ return foundHeader;
85
+ };
86
+ exports.getRequiredHeader = getRequiredHeader;
87
+ const isHeadersProtocol = (headers) => {
88
+ return typeof headers?.get === 'function';
89
+ };
90
+ exports.isHeadersProtocol = isHeadersProtocol;
91
+ const getHeader = (headers, header) => {
92
+ if (!headers)
93
+ return undefined;
94
+ const lowerCasedHeader = header.toLowerCase();
95
+ if ((0, exports.isHeadersProtocol)(headers)) {
96
+ // to deal with the case where the header looks like Stainless-Event-Id
97
+ const intercapsHeader = header[0]?.toUpperCase() +
98
+ header.substring(1).replace(/([^\w])(\w)/g, (_m, g1, g2) => g1 + g2.toUpperCase());
99
+ for (const key of [header, lowerCasedHeader, header.toUpperCase(), intercapsHeader]) {
100
+ const value = headers.get(key);
101
+ if (value) {
102
+ return value;
103
+ }
104
+ }
105
+ }
106
+ for (const [key, value] of Object.entries(headers)) {
107
+ if (key.toLowerCase() === lowerCasedHeader) {
108
+ if (Array.isArray(value)) {
109
+ if (value.length <= 1)
110
+ return value[0];
111
+ console.warn(`Received ${value.length} entries for the ${header} header, using the first entry.`);
112
+ return value[0];
113
+ }
114
+ return value;
115
+ }
116
+ }
117
+ return undefined;
118
+ };
119
+ exports.getHeader = getHeader;
120
+ //# sourceMappingURL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C,CAAC,CAAC,EAAE,WAAW,EAAE;YACxB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QACrF,KAAK,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,EAAE,eAAe,CAAC,EAAE,CAAC;YACpF,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;IACH,CAAC;IAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnD,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE,CAAC;YAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;oBAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvC,OAAO,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,MAAM,oBAAoB,MAAM,iCAAiC,CAAC,CAAC;gBAClG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AA7BW,QAAA,SAAS,aA6BpB"}
@@ -0,0 +1,112 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { isReadonlyArray } from "./utils/values.mjs";
3
+ const brand_privateNullableHeaders = /* @__PURE__ */ Symbol('brand.privateNullableHeaders');
4
+ function* iterateHeaders(headers) {
5
+ if (!headers)
6
+ return;
7
+ if (brand_privateNullableHeaders in headers) {
8
+ const { values, nulls } = headers;
9
+ yield* values.entries();
10
+ for (const name of nulls) {
11
+ yield [name, null];
12
+ }
13
+ return;
14
+ }
15
+ let shouldClear = false;
16
+ let iter;
17
+ if (headers instanceof Headers) {
18
+ iter = headers.entries();
19
+ }
20
+ else if (isReadonlyArray(headers)) {
21
+ iter = headers;
22
+ }
23
+ else {
24
+ shouldClear = true;
25
+ iter = Object.entries(headers ?? {});
26
+ }
27
+ for (let row of iter) {
28
+ const name = row[0];
29
+ if (typeof name !== 'string')
30
+ throw new TypeError('expected header name to be a string');
31
+ const values = isReadonlyArray(row[1]) ? row[1] : [row[1]];
32
+ let didClear = false;
33
+ for (const value of values) {
34
+ if (value === undefined)
35
+ continue;
36
+ // Objects keys always overwrite older headers, they never append.
37
+ // Yield a null to clear the header before adding the new values.
38
+ if (shouldClear && !didClear) {
39
+ didClear = true;
40
+ yield [name, null];
41
+ }
42
+ yield [name, value];
43
+ }
44
+ }
45
+ }
46
+ export const buildHeaders = (newHeaders) => {
47
+ const targetHeaders = new Headers();
48
+ const nullHeaders = new Set();
49
+ for (const headers of newHeaders) {
50
+ const seenHeaders = new Set();
51
+ for (const [name, value] of iterateHeaders(headers)) {
52
+ const lowerName = name.toLowerCase();
53
+ if (!seenHeaders.has(lowerName)) {
54
+ targetHeaders.delete(name);
55
+ seenHeaders.add(lowerName);
56
+ }
57
+ if (value === null) {
58
+ targetHeaders.delete(name);
59
+ nullHeaders.add(lowerName);
60
+ }
61
+ else {
62
+ targetHeaders.append(name, value);
63
+ nullHeaders.delete(lowerName);
64
+ }
65
+ }
66
+ }
67
+ return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };
68
+ };
69
+ export const isEmptyHeaders = (headers) => {
70
+ for (const _ of iterateHeaders(headers))
71
+ return false;
72
+ return true;
73
+ };
74
+ export const getRequiredHeader = (headers, header) => {
75
+ const foundHeader = getHeader(headers, header);
76
+ if (foundHeader === undefined) {
77
+ throw new Error(`Could not find ${header} header`);
78
+ }
79
+ return foundHeader;
80
+ };
81
+ export const isHeadersProtocol = (headers) => {
82
+ return typeof headers?.get === 'function';
83
+ };
84
+ export const getHeader = (headers, header) => {
85
+ if (!headers)
86
+ return undefined;
87
+ const lowerCasedHeader = header.toLowerCase();
88
+ if (isHeadersProtocol(headers)) {
89
+ // to deal with the case where the header looks like Stainless-Event-Id
90
+ const intercapsHeader = header[0]?.toUpperCase() +
91
+ header.substring(1).replace(/([^\w])(\w)/g, (_m, g1, g2) => g1 + g2.toUpperCase());
92
+ for (const key of [header, lowerCasedHeader, header.toUpperCase(), intercapsHeader]) {
93
+ const value = headers.get(key);
94
+ if (value) {
95
+ return value;
96
+ }
97
+ }
98
+ }
99
+ for (const [key, value] of Object.entries(headers)) {
100
+ if (key.toLowerCase() === lowerCasedHeader) {
101
+ if (Array.isArray(value)) {
102
+ if (value.length <= 1)
103
+ return value[0];
104
+ console.warn(`Received ${value.length} entries for the ${header} header, using the first entry.`);
105
+ return value[0];
106
+ }
107
+ return value;
108
+ }
109
+ }
110
+ return undefined;
111
+ };
112
+ //# sourceMappingURL=headers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"headers.mjs","sourceRoot":"","sources":["../src/internal/headers.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,eAAe,EAAE;AAW1B,MAAM,4BAA4B,GAAG,eAAe,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC;AAgB5F,QAAQ,CAAC,CAAC,cAAc,CAAC,OAAoB;IAC3C,IAAI,CAAC,OAAO;QAAE,OAAO;IAErB,IAAI,4BAA4B,IAAI,OAAO,EAAE,CAAC;QAC5C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAClC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACxB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,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C;QACnD,IAAI,GAAG,CAAC,WAAW,EAAE,KAAK,gBAAgB,EAAE,CAAC;YAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC;oBAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvC,OAAO,CAAC,IAAI,CAAC,YAAY,KAAK,CAAC,MAAM,oBAAoB,MAAM,iCAAiC,CAAC,CAAC;gBAClG,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { FinalRequestOptions } from "./request-options.mjs";
2
+ import { type Finch } from "../client.mjs";
3
+ export type APIResponseProps = {
4
+ response: Response;
5
+ options: FinalRequestOptions;
6
+ controller: AbortController;
7
+ requestLogID: string;
8
+ retryOfRequestLogID: string | undefined;
9
+ startTime: number;
10
+ };
11
+ export declare function defaultParseResponse<T>(client: Finch, props: APIResponseProps): Promise<T>;
12
+ //# sourceMappingURL=parse.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.mts","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,mBAAmB,EAAE;OAC5B,EAAE,KAAK,KAAK,EAAE;AAGrB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAkChG"}
@@ -0,0 +1,12 @@
1
+ import type { FinalRequestOptions } from "./request-options.js";
2
+ import { type Finch } from "../client.js";
3
+ export type APIResponseProps = {
4
+ response: Response;
5
+ options: FinalRequestOptions;
6
+ controller: AbortController;
7
+ requestLogID: string;
8
+ retryOfRequestLogID: string | undefined;
9
+ startTime: number;
10
+ };
11
+ export declare function defaultParseResponse<T>(client: Finch, props: APIResponseProps): Promise<T>;
12
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,mBAAmB,EAAE;OAC5B,EAAE,KAAK,KAAK,EAAE;AAGrB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,CAAC,CAkChG"}
@@ -0,0 +1,35 @@
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.defaultParseResponse = defaultParseResponse;
5
+ const log_1 = require("./utils/log.js");
6
+ async function defaultParseResponse(client, props) {
7
+ const { response, requestLogID, retryOfRequestLogID, startTime } = props;
8
+ const body = await (async () => {
9
+ // fetch refuses to read the body when the status code is 204.
10
+ if (response.status === 204) {
11
+ return null;
12
+ }
13
+ if (props.options.__binaryResponse) {
14
+ return response;
15
+ }
16
+ const contentType = response.headers.get('content-type');
17
+ const mediaType = contentType?.split(';')[0]?.trim();
18
+ const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
19
+ if (isJSON) {
20
+ const json = await response.json();
21
+ return json;
22
+ }
23
+ const text = await response.text();
24
+ return text;
25
+ })();
26
+ (0, log_1.loggerFor)(client).debug(`[${requestLogID}] response parsed`, (0, log_1.formatRequestDetails)({
27
+ retryOfRequestLogID,
28
+ url: response.url,
29
+ status: response.status,
30
+ body,
31
+ durationMs: Date.now() - startTime,
32
+ }));
33
+ return body;
34
+ }
35
+ //# sourceMappingURL=parse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AAetF,oDAkCC;AA7CD,wCAA8D;AAWvD,KAAK,UAAU,oBAAoB,CAAI,MAAa,EAAE,KAAuB;IAClF,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE;QAC7B,8DAA8D;QAC9D,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,OAAO,IAAS,CAAC;QACnB,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YACnC,OAAO,QAAwB,CAAC;QAClC,CAAC;QAED,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzD,MAAM,SAAS,GAAG,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QACrD,MAAM,MAAM,GAAG,SAAS,EAAE,QAAQ,CAAC,kBAAkB,CAAC,IAAI,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvF,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAS,CAAC;QACnB,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,IAAoB,CAAC;IAC9B,CAAC,CAAC,EAAE,CAAC;IACL,IAAA,eAAS,EAAC,MAAM,CAAC,CAAC,KAAK,CACrB,IAAI,YAAY,mBAAmB,EACnC,IAAA,0BAAoB,EAAC;QACnB,mBAAmB;QACnB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;KACnC,CAAC,CACH,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,32 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { formatRequestDetails, loggerFor } from "./utils/log.mjs";
3
+ export async function defaultParseResponse(client, props) {
4
+ const { response, requestLogID, retryOfRequestLogID, startTime } = props;
5
+ const body = await (async () => {
6
+ // fetch refuses to read the body when the status code is 204.
7
+ if (response.status === 204) {
8
+ return null;
9
+ }
10
+ if (props.options.__binaryResponse) {
11
+ return response;
12
+ }
13
+ const contentType = response.headers.get('content-type');
14
+ const mediaType = contentType?.split(';')[0]?.trim();
15
+ const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
16
+ if (isJSON) {
17
+ const json = await response.json();
18
+ return json;
19
+ }
20
+ const text = await response.text();
21
+ return text;
22
+ })();
23
+ loggerFor(client).debug(`[${requestLogID}] response parsed`, formatRequestDetails({
24
+ retryOfRequestLogID,
25
+ url: response.url,
26
+ status: response.status,
27
+ body,
28
+ durationMs: Date.now() - startTime,
29
+ }));
30
+ return body;
31
+ }
32
+ //# sourceMappingURL=parse.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.mjs","sourceRoot":"","sources":["../src/internal/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I,CAAC,GAAG,EAAE,GAAG,SAAS;KACnC,CAAC,CACH,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { Format } from "./types.mjs";
2
+ export declare const default_format: Format;
3
+ export declare const default_formatter: (v: PropertyKey) => string;
4
+ export declare const formatters: Record<Format, (str: PropertyKey) => string>;
5
+ export declare const RFC1738 = "RFC1738";
6
+ export declare const RFC3986 = "RFC3986";
7
+ //# sourceMappingURL=formats.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formats.d.mts","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,MAAM,EAAE;AAEtB,eAAO,MAAM,cAAc,EAAE,MAAkB,CAAC;AAChD,eAAO,MAAM,iBAAiB,GAAI,GAAG,WAAW,WAAc,CAAC;AAC/D,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,CAGnE,CAAC;AACF,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,OAAO,YAAY,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { Format } from "./types.js";
2
2
  export declare const default_format: Format;
3
+ export declare const default_formatter: (v: PropertyKey) => string;
3
4
  export declare const formatters: Record<Format, (str: PropertyKey) => string>;
4
5
  export declare const RFC1738 = "RFC1738";
5
6
  export declare const RFC3986 = "RFC3986";
@@ -1 +1 @@
1
- {"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,eAAO,MAAM,cAAc,EAAE,MAAkB,CAAC;AAChD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,CAGnE,CAAC;AACF,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,OAAO,YAAY,CAAC"}
1
+ {"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":"OAAO,KAAK,EAAE,MAAM,EAAE;AAEtB,eAAO,MAAM,cAAc,EAAE,MAAkB,CAAC;AAChD,eAAO,MAAM,iBAAiB,GAAI,GAAG,WAAW,WAAc,CAAC;AAC/D,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,CAGnE,CAAC;AACF,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,OAAO,YAAY,CAAC"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RFC3986 = exports.RFC1738 = exports.formatters = exports.default_format = void 0;
3
+ exports.RFC3986 = exports.RFC1738 = exports.formatters = exports.default_formatter = exports.default_format = void 0;
4
4
  exports.default_format = 'RFC3986';
5
+ const default_formatter = (v) => String(v);
6
+ exports.default_formatter = default_formatter;
5
7
  exports.formatters = {
6
8
  RFC1738: (v) => String(v).replace(/%20/g, '+'),
7
- RFC3986: (v) => String(v),
9
+ RFC3986: exports.default_formatter,
8
10
  };
9
11
  exports.RFC1738 = 'RFC1738';
10
12
  exports.RFC3986 = 'RFC3986';
@@ -1 +1 @@
1
- {"version":3,"file":"formats.js","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAW,SAAS,CAAC;AACnC,QAAA,UAAU,GAAiD;IACtE,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3D,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CACvC,CAAC;AACW,QAAA,OAAO,GAAG,SAAS,CAAC;AACpB,QAAA,OAAO,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"formats.js","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAW,SAAS,CAAC;AACzC,MAAM,iBAAiB,GAAG,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAAlD,QAAA,iBAAiB,qBAAiC;AAClD,QAAA,UAAU,GAAiD;IACtE,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3D,OAAO,EAAE,yBAAiB;CAC3B,CAAC;AACW,QAAA,OAAO,GAAG,SAAS,CAAC;AACpB,QAAA,OAAO,GAAG,SAAS,CAAC"}
@@ -1,7 +1,8 @@
1
1
  export const default_format = 'RFC3986';
2
+ export const default_formatter = (v) => String(v);
2
3
  export const formatters = {
3
4
  RFC1738: (v) => String(v).replace(/%20/g, '+'),
4
- RFC3986: (v) => String(v),
5
+ RFC3986: default_formatter,
5
6
  };
6
7
  export const RFC1738 = 'RFC1738';
7
8
  export const RFC3986 = 'RFC3986';
@@ -1 +1 @@
1
- {"version":3,"file":"formats.mjs","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAW,SAAS,CAAC;AAChD,MAAM,CAAC,MAAM,UAAU,GAAiD;IACtE,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3D,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;CACvC,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"formats.mjs","sourceRoot":"","sources":["../../src/internal/qs/formats.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAW,SAAS,CAAC;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,UAAU,GAAiD;IACtE,OAAO,EAAE,CAAC,CAAc,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;IAC3D,OAAO,EAAE,iBAAiB;CAC3B,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare const formats: {
2
+ formatters: Record<import("./types").Format, (str: PropertyKey) => string>;
3
+ RFC1738: string;
4
+ RFC3986: string;
5
+ default: import("./types").Format;
6
+ };
7
+ export { stringify } from "./stringify.mjs";
8
+ export { formats };
9
+ export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from "./types.mjs";
10
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/internal/qs/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO;;;;;CAKZ,CAAC;OAEK,EAAE,SAAS,EAAE;AACpB,OAAO,EAAE,OAAO,EAAE,CAAC;YAEP,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal/qs/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO;;;;;CAKZ,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/internal/qs/index.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO;;;;;CAKZ,CAAC;OAEK,EAAE,SAAS,EAAE;AACpB,OAAO,EAAE,OAAO,EAAE,CAAC;YAEP,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE"}
@@ -0,0 +1,3 @@
1
+ import type { StringifyOptions } from "./types.mjs";
2
+ export declare function stringify(object: any, opts?: StringifyOptions): string;
3
+ //# sourceMappingURL=stringify.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stringify.d.mts","sourceRoot":"","sources":["../../src/internal/qs/stringify.ts"],"names":[],"mappings":"OAEO,KAAK,EAAyB,gBAAgB,EAAE;AA+SvD,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,gBAAqB,UA+EjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"stringify.d.ts","sourceRoot":"","sources":["../../src/internal/qs/stringify.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAkTvE,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,gBAAqB,UA+EjE"}
1
+ {"version":3,"file":"stringify.d.ts","sourceRoot":"","sources":["../../src/internal/qs/stringify.ts"],"names":[],"mappings":"OAEO,KAAK,EAAyB,gBAAgB,EAAE;AA+SvD,wBAAgB,SAAS,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,gBAAqB,UA+EjE"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringify = void 0;
3
+ exports.stringify = stringify;
4
4
  const utils_1 = require("./utils.js");
5
5
  const formats_1 = require("./formats.js");
6
- const has = Object.prototype.hasOwnProperty;
6
+ const values_1 = require("../utils/values.js");
7
7
  const array_prefix_generators = {
8
8
  brackets(prefix) {
9
9
  return String(prefix) + '[]';
@@ -16,12 +16,10 @@ const array_prefix_generators = {
16
16
  return String(prefix);
17
17
  },
18
18
  };
19
- const is_array = Array.isArray;
20
- const push = Array.prototype.push;
21
19
  const push_to_array = function (arr, value_or_array) {
22
- push.apply(arr, is_array(value_or_array) ? value_or_array : [value_or_array]);
20
+ Array.prototype.push.apply(arr, (0, values_1.isArray)(value_or_array) ? value_or_array : [value_or_array]);
23
21
  };
24
- const to_ISO = Date.prototype.toISOString;
22
+ let toISOString;
25
23
  const defaults = {
26
24
  addQueryPrefix: false,
27
25
  allowDots: false,
@@ -35,11 +33,11 @@ const defaults = {
35
33
  encoder: utils_1.encode,
36
34
  encodeValuesOnly: false,
37
35
  format: formats_1.default_format,
38
- formatter: formats_1.formatters[formats_1.default_format],
36
+ formatter: formats_1.default_formatter,
39
37
  /** @deprecated */
40
38
  indices: false,
41
39
  serializeDate(date) {
42
- return to_ISO.call(date);
40
+ return (toISOString ?? (toISOString = Function.prototype.call.bind(Date.prototype.toISOString)))(date);
43
41
  },
44
42
  skipNulls: false,
45
43
  strictNullHandling: false,
@@ -79,7 +77,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al
79
77
  else if (obj instanceof Date) {
80
78
  obj = serializeDate?.(obj);
81
79
  }
82
- else if (generateArrayPrefix === 'comma' && is_array(obj)) {
80
+ else if (generateArrayPrefix === 'comma' && (0, values_1.isArray)(obj)) {
83
81
  obj = (0, utils_1.maybe_map)(obj, function (value) {
84
82
  if (value instanceof Date) {
85
83
  return serializeDate?.(value);
@@ -115,7 +113,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al
115
113
  return values;
116
114
  }
117
115
  let obj_keys;
118
- if (generateArrayPrefix === 'comma' && is_array(obj)) {
116
+ if (generateArrayPrefix === 'comma' && (0, values_1.isArray)(obj)) {
119
117
  // we need to join elements in
120
118
  if (encodeValuesOnly && encoder) {
121
119
  // @ts-expect-error values only
@@ -123,7 +121,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al
123
121
  }
124
122
  obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
125
123
  }
126
- else if (is_array(filter)) {
124
+ else if ((0, values_1.isArray)(filter)) {
127
125
  obj_keys = filter;
128
126
  }
129
127
  else {
@@ -131,8 +129,8 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al
131
129
  obj_keys = sort ? keys.sort(sort) : keys;
132
130
  }
133
131
  const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
134
- const adjusted_prefix = commaRoundTrip && is_array(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix;
135
- if (allowEmptyArrays && is_array(obj) && obj.length === 0) {
132
+ const adjusted_prefix = commaRoundTrip && (0, values_1.isArray)(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix;
133
+ if (allowEmptyArrays && (0, values_1.isArray)(obj) && obj.length === 0) {
136
134
  return adjusted_prefix + '[]';
137
135
  }
138
136
  for (let j = 0; j < obj_keys.length; ++j) {
@@ -145,7 +143,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al
145
143
  }
146
144
  // @ts-ignore
147
145
  const encoded_key = allowDots && encodeDotInKeys ? key.replace(/\./g, '%2E') : key;
148
- const key_prefix = is_array(obj) ?
146
+ const key_prefix = (0, values_1.isArray)(obj) ?
149
147
  typeof generateArrayPrefix === 'function' ?
150
148
  generateArrayPrefix(adjusted_prefix, encoded_key)
151
149
  : adjusted_prefix
@@ -155,7 +153,7 @@ function inner_stringify(object, prefix, generateArrayPrefix, commaRoundTrip, al
155
153
  valueSideChannel.set(sentinel, sideChannel);
156
154
  push_to_array(values, inner_stringify(value, key_prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys,
157
155
  // @ts-ignore
158
- generateArrayPrefix === 'comma' && encodeValuesOnly && is_array(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
156
+ generateArrayPrefix === 'comma' && encodeValuesOnly && (0, values_1.isArray)(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
159
157
  }
160
158
  return values;
161
159
  }
@@ -175,14 +173,14 @@ function normalize_stringify_options(opts = defaults) {
175
173
  }
176
174
  let format = formats_1.default_format;
177
175
  if (typeof opts.format !== 'undefined') {
178
- if (!has.call(formats_1.formatters, opts.format)) {
176
+ if (!(0, utils_1.has)(formats_1.formatters, opts.format)) {
179
177
  throw new TypeError('Unknown format option provided.');
180
178
  }
181
179
  format = opts.format;
182
180
  }
183
181
  const formatter = formats_1.formatters[format];
184
182
  let filter = defaults.filter;
185
- if (typeof opts.filter === 'function' || is_array(opts.filter)) {
183
+ if (typeof opts.filter === 'function' || (0, values_1.isArray)(opts.filter)) {
186
184
  filter = opts.filter;
187
185
  }
188
186
  let arrayFormat;
@@ -236,7 +234,7 @@ function stringify(object, opts = {}) {
236
234
  filter = options.filter;
237
235
  obj = filter('', obj);
238
236
  }
239
- else if (is_array(options.filter)) {
237
+ else if ((0, values_1.isArray)(options.filter)) {
240
238
  filter = options.filter;
241
239
  obj_keys = filter;
242
240
  }
@@ -276,5 +274,4 @@ function stringify(object, opts = {}) {
276
274
  }
277
275
  return joined.length > 0 ? prefix + joined : '';
278
276
  }
279
- exports.stringify = stringify;
280
277
  //# sourceMappingURL=stringify.js.map