@tryfinch/finch-api 5.1.0 → 5.3.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 (361) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +28 -21
  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/{src/_shims/ReadableStream-node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
  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 +99 -0
  35. package/_shims/{ReadableStream.js → auto/types.js} +0 -2
  36. package/{src/_shims/ReadableStream.js → _shims/auto/types.mjs} +0 -2
  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 +79 -0
  44. package/_shims/index.js +13 -0
  45. package/_shims/index.mjs +7 -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 +87 -0
  52. package/_shims/node-runtime.js.map +1 -0
  53. package/_shims/node-runtime.mjs +54 -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 +35 -0
  59. package/_shims/registry.d.ts.map +1 -0
  60. package/_shims/registry.js +39 -0
  61. package/_shims/registry.js.map +1 -0
  62. package/_shims/registry.mjs +35 -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 +70 -0
  67. package/_shims/web-runtime.js.map +1 -0
  68. package/_shims/web-runtime.mjs +63 -0
  69. package/_shims/web-runtime.mjs.map +1 -0
  70. package/_shims/web-types.d.ts +82 -0
  71. package/_shims/web-types.js +3 -0
  72. package/_shims/web-types.mjs +3 -0
  73. package/core.d.ts +170 -223
  74. package/core.d.ts.map +1 -1
  75. package/core.js +682 -729
  76. package/core.js.map +1 -1
  77. package/core.mjs +676 -680
  78. package/core.mjs.map +1 -1
  79. package/error.d.ts +32 -32
  80. package/error.d.ts.map +1 -1
  81. package/error.js +95 -106
  82. package/error.js.map +1 -1
  83. package/error.mjs +91 -91
  84. package/error.mjs.map +1 -1
  85. package/index.d.mts +145 -178
  86. package/index.d.ts +145 -178
  87. package/index.d.ts.map +1 -1
  88. package/index.js +145 -201
  89. package/index.js.map +1 -1
  90. package/index.mjs +123 -149
  91. package/index.mjs.map +1 -1
  92. package/package.json +31 -23
  93. package/pagination.d.ts +47 -167
  94. package/pagination.d.ts.map +1 -1
  95. package/pagination.js +72 -202
  96. package/pagination.js.map +1 -1
  97. package/pagination.mjs +68 -187
  98. package/pagination.mjs.map +1 -1
  99. package/resource.d.ts +10 -10
  100. package/resource.js +12 -12
  101. package/resource.mjs +10 -10
  102. package/resources/account.d.ts +44 -44
  103. package/resources/account.js +20 -19
  104. package/resources/account.mjs +17 -16
  105. package/resources/hris/benefits/benefits.d.ts +127 -154
  106. package/resources/hris/benefits/benefits.js +74 -89
  107. package/resources/hris/benefits/benefits.mjs +50 -48
  108. package/resources/hris/benefits/index.d.ts +3 -28
  109. package/resources/hris/benefits/index.js +13 -55
  110. package/resources/hris/benefits/index.mjs +3 -8
  111. package/resources/hris/benefits/individuals.d.ts +129 -147
  112. package/resources/hris/benefits/individuals.js +59 -59
  113. package/resources/hris/benefits/individuals.mjs +53 -49
  114. package/resources/hris/company.d.ts +80 -80
  115. package/resources/hris/company.js +12 -13
  116. package/resources/hris/company.mjs +9 -8
  117. package/resources/hris/directory.d.ts +53 -55
  118. package/resources/hris/directory.js +13 -12
  119. package/resources/hris/directory.mjs +8 -7
  120. package/resources/hris/employments.d.ts +124 -126
  121. package/resources/hris/employments.js +23 -21
  122. package/resources/hris/employments.mjs +19 -17
  123. package/resources/hris/hris.d.ts +113 -123
  124. package/resources/hris/hris.js +54 -71
  125. package/resources/hris/hris.mjs +32 -32
  126. package/resources/hris/index.d.ts +9 -41
  127. package/resources/hris/index.js +26 -110
  128. package/resources/hris/index.mjs +9 -9
  129. package/resources/hris/individuals.d.ts +65 -67
  130. package/resources/hris/individuals.js +19 -17
  131. package/resources/hris/individuals.mjs +14 -12
  132. package/resources/hris/pay-statements.d.ts +146 -162
  133. package/resources/hris/pay-statements.js +22 -20
  134. package/resources/hris/pay-statements.mjs +18 -16
  135. package/resources/hris/payments.d.ts +47 -49
  136. package/resources/hris/payments.js +15 -13
  137. package/resources/hris/payments.mjs +11 -9
  138. package/resources/index.d.ts +5 -7
  139. package/resources/index.d.ts.map +1 -1
  140. package/resources/index.js +13 -51
  141. package/resources/index.js.map +1 -1
  142. package/resources/index.mjs +5 -6
  143. package/resources/index.mjs.map +1 -1
  144. package/resources/providers.d.ts +43 -42
  145. package/resources/providers.js +15 -13
  146. package/resources/providers.mjs +11 -9
  147. package/resources/top-level.d.ts +1 -1
  148. package/resources/top-level.js +3 -3
  149. package/resources/top-level.mjs +1 -1
  150. package/resources/webhooks.d.ts +18 -18
  151. package/resources/webhooks.js +103 -107
  152. package/resources/webhooks.mjs +98 -102
  153. package/shims/node.d.ts +29 -0
  154. package/shims/node.d.ts.map +1 -0
  155. package/shims/node.js +31 -0
  156. package/shims/node.js.map +1 -0
  157. package/shims/node.mjs +5 -0
  158. package/shims/node.mjs.map +1 -0
  159. package/shims/web.d.ts +26 -0
  160. package/shims/web.d.ts.map +1 -0
  161. package/shims/web.js +31 -0
  162. package/shims/web.js.map +1 -0
  163. package/shims/web.mjs +5 -0
  164. package/shims/web.mjs.map +1 -0
  165. package/src/_shims/MultipartBody.ts +9 -0
  166. package/src/_shims/README.md +46 -0
  167. package/src/_shims/auto/runtime-bun.ts +4 -0
  168. package/src/_shims/auto/runtime-node.ts +4 -0
  169. package/src/_shims/auto/runtime.ts +4 -0
  170. package/src/_shims/auto/types-node.ts +4 -0
  171. package/src/_shims/auto/types.d.ts +99 -0
  172. package/src/_shims/auto/types.js +3 -0
  173. package/src/_shims/auto/types.mjs +3 -0
  174. package/src/_shims/bun-runtime.ts +14 -0
  175. package/src/_shims/index.d.ts +79 -0
  176. package/src/_shims/index.js +13 -0
  177. package/src/_shims/index.mjs +7 -0
  178. package/src/_shims/manual-types.d.ts +12 -0
  179. package/src/_shims/manual-types.js +3 -0
  180. package/src/_shims/manual-types.mjs +3 -0
  181. package/src/_shims/node-runtime.ts +79 -0
  182. package/src/_shims/node-types.d.ts +42 -0
  183. package/src/_shims/node-types.js +3 -0
  184. package/src/_shims/node-types.mjs +3 -0
  185. package/src/_shims/registry.ts +64 -0
  186. package/src/_shims/web-runtime.ts +91 -0
  187. package/src/_shims/web-types.d.ts +82 -0
  188. package/src/_shims/web-types.js +3 -0
  189. package/src/_shims/web-types.mjs +3 -0
  190. package/src/core.ts +75 -44
  191. package/src/error.ts +6 -4
  192. package/src/index.ts +8 -25
  193. package/src/pagination.ts +2 -261
  194. package/src/resource.ts +1 -1
  195. package/src/resources/account.ts +3 -3
  196. package/src/resources/hris/benefits/benefits.ts +6 -6
  197. package/src/resources/hris/benefits/index.ts +2 -2
  198. package/src/resources/hris/benefits/individuals.ts +6 -6
  199. package/src/resources/hris/company.ts +4 -4
  200. package/src/resources/hris/directory.ts +5 -5
  201. package/src/resources/hris/employments.ts +5 -5
  202. package/src/resources/hris/hris.ts +9 -9
  203. package/src/resources/hris/index.ts +8 -8
  204. package/src/resources/hris/individuals.ts +6 -6
  205. package/src/resources/hris/pay-statements.ts +6 -6
  206. package/src/resources/hris/payments.ts +5 -5
  207. package/src/resources/index.ts +4 -6
  208. package/src/resources/providers.ts +4 -4
  209. package/src/resources/webhooks.ts +2 -2
  210. package/src/shims/node.ts +50 -0
  211. package/src/shims/web.ts +50 -0
  212. package/src/uploads.ts +12 -16
  213. package/src/version.ts +1 -1
  214. package/uploads.d.ts +23 -39
  215. package/uploads.d.ts.map +1 -1
  216. package/uploads.js +115 -157
  217. package/uploads.js.map +1 -1
  218. package/uploads.mjs +111 -133
  219. package/uploads.mjs.map +1 -1
  220. package/version.d.ts +2 -2
  221. package/version.js +4 -4
  222. package/version.mjs +2 -2
  223. package/_shims/ReadableStream-node.d.ts +0 -6
  224. package/_shims/ReadableStream-node.d.ts.map +0 -1
  225. package/_shims/ReadableStream-node.js +0 -14
  226. package/_shims/ReadableStream-node.js.map +0 -1
  227. package/_shims/ReadableStream-node.mjs +0 -3
  228. package/_shims/ReadableStream-node.mjs.map +0 -1
  229. package/_shims/ReadableStream.d.ts +0 -38
  230. package/_shims/ReadableStream.mjs +0 -7
  231. package/_shims/agent-node.d.ts +0 -7
  232. package/_shims/agent-node.d.ts.map +0 -1
  233. package/_shims/agent-node.js +0 -28
  234. package/_shims/agent-node.js.map +0 -1
  235. package/_shims/agent-node.mjs +0 -16
  236. package/_shims/agent-node.mjs.map +0 -1
  237. package/_shims/agent.d.ts +0 -9
  238. package/_shims/agent.d.ts.map +0 -1
  239. package/_shims/agent.js +0 -14
  240. package/_shims/agent.js.map +0 -1
  241. package/_shims/agent.mjs +0 -10
  242. package/_shims/agent.mjs.map +0 -1
  243. package/_shims/fetch-node.d.ts +0 -64
  244. package/_shims/fetch-node.js +0 -12
  245. package/_shims/fetch-node.mjs +0 -14
  246. package/_shims/fetch.d.ts +0 -60
  247. package/_shims/fetch.js +0 -13
  248. package/_shims/fetch.mjs +0 -15
  249. package/_shims/fileFromPath-node.d.ts +0 -17
  250. package/_shims/fileFromPath-node.d.ts.map +0 -1
  251. package/_shims/fileFromPath-node.js +0 -17
  252. package/_shims/fileFromPath-node.js.map +0 -1
  253. package/_shims/fileFromPath-node.mjs +0 -13
  254. package/_shims/fileFromPath-node.mjs.map +0 -1
  255. package/_shims/fileFromPath.d.ts +0 -22
  256. package/_shims/fileFromPath.d.ts.map +0 -1
  257. package/_shims/fileFromPath.js +0 -16
  258. package/_shims/fileFromPath.js.map +0 -1
  259. package/_shims/fileFromPath.mjs +0 -12
  260. package/_shims/fileFromPath.mjs.map +0 -1
  261. package/_shims/form-data-node.d.ts +0 -45
  262. package/_shims/form-data-node.js +0 -11
  263. package/_shims/form-data-node.mjs +0 -9
  264. package/_shims/form-data.d.ts +0 -43
  265. package/_shims/form-data.js +0 -17
  266. package/_shims/form-data.mjs +0 -20
  267. package/_shims/getMultipartRequestOptions-node.d.ts +0 -10
  268. package/_shims/getMultipartRequestOptions-node.d.ts.map +0 -1
  269. package/_shims/getMultipartRequestOptions-node.js +0 -22
  270. package/_shims/getMultipartRequestOptions-node.js.map +0 -1
  271. package/_shims/getMultipartRequestOptions-node.mjs +0 -18
  272. package/_shims/getMultipartRequestOptions-node.mjs.map +0 -1
  273. package/_shims/getMultipartRequestOptions.d.ts +0 -10
  274. package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
  275. package/_shims/getMultipartRequestOptions.js +0 -12
  276. package/_shims/getMultipartRequestOptions.js.map +0 -1
  277. package/_shims/getMultipartRequestOptions.mjs +0 -8
  278. package/_shims/getMultipartRequestOptions.mjs.map +0 -1
  279. package/_shims/node-readable-node.d.ts +0 -8
  280. package/_shims/node-readable-node.d.ts.map +0 -1
  281. package/_shims/node-readable-node.js +0 -9
  282. package/_shims/node-readable-node.js.map +0 -1
  283. package/_shims/node-readable-node.mjs +0 -5
  284. package/_shims/node-readable-node.mjs.map +0 -1
  285. package/_shims/node-readable.d.ts +0 -23
  286. package/_shims/node-readable.d.ts.map +0 -1
  287. package/_shims/node-readable.js +0 -11
  288. package/_shims/node-readable.js.map +0 -1
  289. package/_shims/node-readable.mjs +0 -7
  290. package/_shims/node-readable.mjs.map +0 -1
  291. package/resources/ats/applications.d.ts +0 -39
  292. package/resources/ats/applications.d.ts.map +0 -1
  293. package/resources/ats/applications.js +0 -24
  294. package/resources/ats/applications.js.map +0 -1
  295. package/resources/ats/applications.mjs +0 -20
  296. package/resources/ats/applications.mjs.map +0 -1
  297. package/resources/ats/ats.d.ts +0 -32
  298. package/resources/ats/ats.d.ts.map +0 -1
  299. package/resources/ats/ats.js +0 -71
  300. package/resources/ats/ats.js.map +0 -1
  301. package/resources/ats/ats.mjs +0 -27
  302. package/resources/ats/ats.mjs.map +0 -1
  303. package/resources/ats/candidates.d.ts +0 -53
  304. package/resources/ats/candidates.d.ts.map +0 -1
  305. package/resources/ats/candidates.js +0 -25
  306. package/resources/ats/candidates.js.map +0 -1
  307. package/resources/ats/candidates.mjs +0 -21
  308. package/resources/ats/candidates.mjs.map +0 -1
  309. package/resources/ats/index.d.ts +0 -7
  310. package/resources/ats/index.d.ts.map +0 -1
  311. package/resources/ats/index.js +0 -60
  312. package/resources/ats/index.js.map +0 -1
  313. package/resources/ats/index.mjs +0 -8
  314. package/resources/ats/index.mjs.map +0 -1
  315. package/resources/ats/jobs.d.ts +0 -47
  316. package/resources/ats/jobs.d.ts.map +0 -1
  317. package/resources/ats/jobs.js +0 -24
  318. package/resources/ats/jobs.js.map +0 -1
  319. package/resources/ats/jobs.mjs +0 -20
  320. package/resources/ats/jobs.mjs.map +0 -1
  321. package/resources/ats/offers.d.ts +0 -39
  322. package/resources/ats/offers.d.ts.map +0 -1
  323. package/resources/ats/offers.js +0 -24
  324. package/resources/ats/offers.js.map +0 -1
  325. package/resources/ats/offers.mjs +0 -20
  326. package/resources/ats/offers.mjs.map +0 -1
  327. package/resources/ats/stages.d.ts +0 -30
  328. package/resources/ats/stages.d.ts.map +0 -1
  329. package/resources/ats/stages.js +0 -22
  330. package/resources/ats/stages.js.map +0 -1
  331. package/resources/ats/stages.mjs +0 -17
  332. package/resources/ats/stages.mjs.map +0 -1
  333. package/src/_shims/ReadableStream.d.ts +0 -38
  334. package/src/_shims/ReadableStream.mjs +0 -7
  335. package/src/_shims/agent-node.ts +0 -22
  336. package/src/_shims/agent.ts +0 -12
  337. package/src/_shims/fetch-node.d.ts +0 -64
  338. package/src/_shims/fetch-node.js +0 -12
  339. package/src/_shims/fetch-node.mjs +0 -14
  340. package/src/_shims/fetch.d.ts +0 -60
  341. package/src/_shims/fetch.js +0 -13
  342. package/src/_shims/fetch.mjs +0 -15
  343. package/src/_shims/fileFromPath-node.ts +0 -29
  344. package/src/_shims/fileFromPath.ts +0 -29
  345. package/src/_shims/form-data-node.d.ts +0 -45
  346. package/src/_shims/form-data-node.js +0 -11
  347. package/src/_shims/form-data-node.mjs +0 -9
  348. package/src/_shims/form-data.d.ts +0 -43
  349. package/src/_shims/form-data.js +0 -17
  350. package/src/_shims/form-data.mjs +0 -20
  351. package/src/_shims/getMultipartRequestOptions-node.ts +0 -25
  352. package/src/_shims/getMultipartRequestOptions.ts +0 -14
  353. package/src/_shims/node-readable-node.ts +0 -10
  354. package/src/_shims/node-readable.ts +0 -30
  355. package/src/resources/ats/applications.ts +0 -64
  356. package/src/resources/ats/ats.ts +0 -39
  357. package/src/resources/ats/candidates.ts +0 -83
  358. package/src/resources/ats/index.ts +0 -8
  359. package/src/resources/ats/jobs.ts +0 -76
  360. package/src/resources/ats/offers.ts +0 -63
  361. package/src/resources/ats/stages.ts +0 -39
package/CHANGELOG.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.3.0 (2023-09-26)
4
+
5
+ Full Changelog: [v5.2.0...v5.3.0](https://github.com/Finch-API/finch-api-node/compare/v5.2.0...v5.3.0)
6
+
7
+ ### Features
8
+
9
+ * **ci:** add reviewers ([#170](https://github.com/Finch-API/finch-api-node/issues/170)) ([a29194d](https://github.com/Finch-API/finch-api-node/commit/a29194d11ceb8afbe8c9a98ddeadbf8c569bf068))
10
+ * **client:** handle retry-after with a date ([#174](https://github.com/Finch-API/finch-api-node/issues/174)) ([747a82b](https://github.com/Finch-API/finch-api-node/commit/747a82b615fb85674922c630e6047c8e1b5f1306))
11
+ * **package:** export a root error type ([#171](https://github.com/Finch-API/finch-api-node/issues/171)) ([1be7dc7](https://github.com/Finch-API/finch-api-node/commit/1be7dc713869cb5b27be34cd7b0876c0e2001827))
12
+
13
+
14
+ ### Chores
15
+
16
+ * **internal:** update lock file ([#173](https://github.com/Finch-API/finch-api-node/issues/173)) ([0e92b0c](https://github.com/Finch-API/finch-api-node/commit/0e92b0cf0c7b21eea82965445ce0a8590d2b3205))
17
+ * **internal:** update lock file ([#175](https://github.com/Finch-API/finch-api-node/issues/175)) ([bf8578e](https://github.com/Finch-API/finch-api-node/commit/bf8578e847c12ae95f5b019ee216daa02de14513))
18
+
19
+
20
+ ### Documentation
21
+
22
+ * **api.md:** add shared models ([#168](https://github.com/Finch-API/finch-api-node/issues/168)) ([bd33a59](https://github.com/Finch-API/finch-api-node/commit/bd33a59358f131618262dd57fcfc38c18014d1a1))
23
+
24
+ ## 5.2.0 (2023-09-21)
25
+
26
+ Full Changelog: [v5.1.0...v5.2.0](https://github.com/Finch-API/finch-api-node/compare/v5.1.0...v5.2.0)
27
+
28
+ ### Features
29
+
30
+ * **client:** retry on 408 Request Timeout ([#159](https://github.com/Finch-API/finch-api-node/issues/159)) ([b28c579](https://github.com/Finch-API/finch-api-node/commit/b28c57911bac472b249d23aa373c175a02877b20))
31
+ * **client:** support importing node or web shims manually ([#166](https://github.com/Finch-API/finch-api-node/issues/166)) ([8812dcc](https://github.com/Finch-API/finch-api-node/commit/8812dccf79d3f9d9e3b6c026b4049f4eb0c7df35))
32
+ * **errors:** add status code to error message ([#163](https://github.com/Finch-API/finch-api-node/issues/163)) ([edea234](https://github.com/Finch-API/finch-api-node/commit/edea234ee18e89e9313dcc3b49c172bdc3b750b8))
33
+
34
+
35
+ ### Chores
36
+
37
+ * **api:** remove deprecated & unused ATS API ([#164](https://github.com/Finch-API/finch-api-node/issues/164)) ([e9377e8](https://github.com/Finch-API/finch-api-node/commit/e9377e81b26c08d023c64d1ec6fb7b160a1b92bf))
38
+
39
+
40
+ ### Documentation
41
+
42
+ * declare Bun 1.0 officially supported ([#162](https://github.com/Finch-API/finch-api-node/issues/162)) ([b082f06](https://github.com/Finch-API/finch-api-node/commit/b082f06fb881e69331beed46ded0a7b2bbdb6235))
43
+ * **README:** fix variable names in some examples ([#167](https://github.com/Finch-API/finch-api-node/issues/167)) ([7e83bae](https://github.com/Finch-API/finch-api-node/commit/7e83bae3434dc75b0cc10e647d56a11857a7fdab))
44
+ * **readme:** remove incorrect wording in opening ([#165](https://github.com/Finch-API/finch-api-node/issues/165)) ([ec99ddb](https://github.com/Finch-API/finch-api-node/commit/ec99ddb8e80c94f47f591789981884813b54a837))
45
+
3
46
  ## 5.1.0 (2023-09-08)
4
47
 
5
48
  Full Changelog: [v5.0.0...v5.1.0](https://github.com/Finch-API/finch-api-node/compare/v5.0.0...v5.1.0)
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/@tryfinch/finch-api.svg)](https://npmjs.org/package/@tryfinch/finch-api)
4
4
 
5
- This library provides convenient access to the Finch Node REST API from server-side TypeScript or JavaScript.
5
+ This library provides convenient access to the Finch REST API from server-side TypeScript or JavaScript.
6
6
 
7
7
  The API documentation can be found [here](https://developer.tryfinch.com/).
8
8
 
@@ -26,9 +26,10 @@ const finch = new Finch({
26
26
  });
27
27
 
28
28
  async function main() {
29
- const candidate = await finch.ats.candidates.retrieve('<candidate id>');
29
+ const page = await finch.hris.directory.listIndividuals();
30
+ const individualInDirectory = page.individuals[0];
30
31
 
31
- console.log(candidate.first_name);
32
+ console.log(individualInDirectory.first_name);
32
33
  }
33
34
 
34
35
  main();
@@ -46,7 +47,8 @@ const finch = new Finch({
46
47
  });
47
48
 
48
49
  async function main() {
49
- const candidate: Finch.ATS.Candidate = await finch.ats.candidates.retrieve('<candidate id>');
50
+ const [individualInDirectory]: [Finch.HRIS.IndividualInDirectory] =
51
+ await finch.hris.directory.listIndividuals();
50
52
  }
51
53
 
52
54
  main();
@@ -93,8 +95,8 @@ Error codes are as followed:
93
95
  ### Retries
94
96
 
95
97
  Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
96
- Connection errors (for example, due to a network connectivity problem), 409 Conflict, 429 Rate Limit,
97
- and >=500 Internal errors will all be retried by default.
98
+ Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
99
+ 429 Rate Limit, and >=500 Internal errors will all be retried by default.
98
100
 
99
101
  You can use the `maxRetries` option to configure or disable this:
100
102
 
@@ -138,22 +140,22 @@ List methods in the Finch API are paginated.
138
140
  You can use `for await … of` syntax to iterate through items across all pages:
139
141
 
140
142
  ```ts
141
- async function fetchAllATSJobs(params) {
142
- const allATSJobs = [];
143
+ async function fetchAllHRISDirectories(params) {
144
+ const allHRISDirectories = [];
143
145
  // Automatically fetches more pages as needed.
144
- for await (const job of finch.ats.jobs.list()) {
145
- allATSJobs.push(job);
146
+ for await (const individualInDirectory of finch.hris.directory.listIndividuals()) {
147
+ allHRISDirectories.push(individualInDirectory);
146
148
  }
147
- return allATSJobs;
149
+ return allHRISDirectories;
148
150
  }
149
151
  ```
150
152
 
151
153
  Alternatively, you can make request a single page at a time:
152
154
 
153
155
  ```ts
154
- let page = await finch.ats.jobs.list();
155
- for (const job of page.jobs) {
156
- console.log(job);
156
+ let page = await finch.hris.directory.listIndividuals();
157
+ for (const individualInDirectory of page.individuals) {
158
+ console.log(individualInDirectory);
157
159
  }
158
160
 
159
161
  // Convenience methods are provided for manually paginating:
@@ -176,9 +178,10 @@ import Finch from '@tryfinch/finch-api';
176
178
 
177
179
  const finch = new Finch();
178
180
 
179
- const candidate = await finch.ats.candidates.retrieve('<candidate id>', {
181
+ const page = await finch.hris.directory.listIndividuals({
180
182
  headers: { 'Finch-API-Version': 'My-Custom-Value' },
181
183
  });
184
+ const individualInDirectory = page.individuals[0];
182
185
  ```
183
186
 
184
187
  ## Webhook Verification
@@ -221,15 +224,15 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
221
224
  ```ts
222
225
  const finch = new Finch();
223
226
 
224
- const response = await finch.ats.candidates.retrieve('<candidate id>').asResponse();
227
+ const response = await finch.hris.directory.listIndividuals().asResponse();
225
228
  console.log(response.headers.get('X-My-Header'));
226
229
  console.log(response.statusText); // access the underlying Response object
227
230
 
228
- const { data: candidates, response: raw } = await finch.ats.candidates
229
- .retrieve('<candidate id>')
230
- .withResponse();
231
+ const { data: page, response: raw } = await finch.hris.directory.listIndividuals().withResponse();
231
232
  console.log(raw.headers.get('X-My-Header'));
232
- console.log(candidates.first_name);
233
+ for await (const individualInDirectory of page) {
234
+ console.log(individualInDirectory.first_name);
235
+ }
233
236
  ```
234
237
 
235
238
  ## Configuring an HTTP(S) Agent (e.g., for proxies)
@@ -275,8 +278,12 @@ The following runtimes are supported:
275
278
 
276
279
  - Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
277
280
  - Deno v1.28.0 or higher, using `import Finch from "npm:@tryfinch/finch-api"`.
278
- Deno Deploy is not yet supported.
281
+ - Bun 1.0 or later.
279
282
  - Cloudflare Workers.
280
283
  - Vercel Edge Runtime.
284
+ - Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
285
+ - Nitro v2.6 or greater.
286
+
287
+ Note that React Native is not supported at this time.
281
288
 
282
289
  If you are interested in other runtime environments, please open or upvote an issue on GitHub.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export declare class MultipartBody {
5
+ body: any;
6
+ constructor(body: any);
7
+ get [Symbol.toStringTag](): string;
8
+ }
9
+ //# sourceMappingURL=MultipartBody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.d.ts","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,aAAa;IACL,IAAI,EAAE,GAAG;gBAAT,IAAI,EAAE,GAAG;IAC5B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACF"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultipartBody = void 0;
4
+ /**
5
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
6
+ */
7
+ class MultipartBody {
8
+ constructor(body) {
9
+ this.body = body;
10
+ }
11
+ get [Symbol.toStringTag]() {
12
+ return 'MultipartBody';
13
+ }
14
+ }
15
+ exports.MultipartBody = MultipartBody;
16
+ //# sourceMappingURL=MultipartBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.js","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AALD,sCAKC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export class MultipartBody {
5
+ constructor(body) {
6
+ this.body = body;
7
+ }
8
+ get [Symbol.toStringTag]() {
9
+ return 'MultipartBody';
10
+ }
11
+ }
12
+ //# sourceMappingURL=MultipartBody.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipartBody.mjs","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,46 @@
1
+ # 👋 Wondering what everything in here does?
2
+
3
+ `@tryfinch/finch-api` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
4
+ edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
5
+
6
+ To do this, `@tryfinch/finch-api` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
7
+
8
+ It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
9
+ automatically select the correct shims for each environment. However, conditional exports are a fairly new
10
+ feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
11
+
12
+ setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
13
+ Unfortunately that's still the default setting, and it can result in errors like
14
+ getting the wrong raw `Response` type from `.asResponse()`, for example.
15
+
16
+ The user can work around these issues by manually importing one of:
17
+
18
+ - `import '@tryfinch/finch-api/shims/node'`
19
+ - `import '@tryfinch/finch-api/shims/web'`
20
+
21
+ All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
22
+
23
+ ### How it works - Runtime
24
+
25
+ Runtime shims get installed by calling `setShims` exported by `@tryfinch/finch-api/_shims/registry`.
26
+
27
+ Manually importing `@tryfinch/finch-api/shims/node` or `@tryfinch/finch-api/shims/web`, calls `setShims` with the respective runtime shims.
28
+
29
+ All client code imports shims from `@tryfinch/finch-api/_shims/index`, which:
30
+
31
+ - checks if shims have been set manually
32
+ - if not, calls `setShims` with the shims from `@tryfinch/finch-api/_shims/auto/runtime`
33
+ - re-exports the installed shims from `@tryfinch/finch-api/_shims/registry`.
34
+
35
+ `@tryfinch/finch-api/_shims/auto/runtime` exports web runtime shims.
36
+ If the `node` export condition is set, the export map replaces it with `@tryfinch/finch-api/_shims/auto/runtime-node`.
37
+
38
+ ### How it works - Type time
39
+
40
+ All client code imports shim types from `@tryfinch/finch-api/_shims/index`, which selects the manual types from `@tryfinch/finch-api/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `@tryfinch/finch-api/_shims/auto/types`.
41
+
42
+ `@tryfinch/finch-api/_shims/manual-types` exports an empty namespace.
43
+ Manually importing `@tryfinch/finch-api/shims/node` or `@tryfinch/finch-api/shims/web` merges declarations into this empty namespace, so they get picked up by `@tryfinch/finch-api/_shims/index`.
44
+
45
+ `@tryfinch/finch-api/_shims/auto/types` exports web type definitions.
46
+ If the `node` export condition is set, the export map replaces it with `@tryfinch/finch-api/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
3
  */
4
- import { ReadableStream } from 'web-streams-polyfill';
5
-
6
- export { ReadableStream };
4
+ export * from "../bun-runtime.js";
5
+ //# sourceMappingURL=runtime-bun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../bun-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime-bun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
@@ -0,0 +1,2 @@
1
+ export * from "../bun-runtime.mjs";
2
+ //# sourceMappingURL=runtime-bun.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bun.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../node-runtime.js";
5
+ //# sourceMappingURL=runtime-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../node-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qDAAgC"}
@@ -0,0 +1,2 @@
1
+ export * from "../node-runtime.mjs";
2
+ //# sourceMappingURL=runtime-node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../web-runtime.js";
5
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../web-runtime.js"), exports);
21
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
@@ -0,0 +1,2 @@
1
+ export * from "../web-runtime.mjs";
2
+ //# sourceMappingURL=runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export * from "../node-types.js";
5
+ //# sourceMappingURL=types-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,eAAe,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
+ */
20
+ __exportStar(require("../node-types.js"), exports);
21
+ //# sourceMappingURL=types-node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-node.js","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,mDAA8B"}
@@ -0,0 +1,2 @@
1
+ export * from "../node-types.mjs";
2
+ //# sourceMappingURL=types-node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":""}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ export type Agent = any;
5
+
6
+ // @ts-ignore
7
+ declare const _fetch: unknown extends typeof fetch ? never : typeof fetch;
8
+ export { _fetch as fetch };
9
+
10
+ // @ts-ignore
11
+ type _Request = unknown extends Request ? never : Request;
12
+ export { _Request as Request };
13
+
14
+ // @ts-ignore
15
+ type _RequestInfo = unknown extends RequestInfo ? never : RequestInfo;
16
+ export { type _RequestInfo as RequestInfo };
17
+
18
+ // @ts-ignore
19
+ type _RequestInit = unknown extends RequestInit ? never : RequestInit;
20
+ export { type _RequestInit as RequestInit };
21
+
22
+ // @ts-ignore
23
+ type _Response = unknown extends Response ? never : Response;
24
+ export { _Response as Response };
25
+
26
+ // @ts-ignore
27
+ type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
28
+ export { type _ResponseInit as ResponseInit };
29
+
30
+ // @ts-ignore
31
+ type _ResponseType = unknown extends ResponseType ? never : ResponseType;
32
+ export { type _ResponseType as ResponseType };
33
+
34
+ // @ts-ignore
35
+ type _BodyInit = unknown extends BodyInit ? never : BodyInit;
36
+ export { type _BodyInit as BodyInit };
37
+
38
+ // @ts-ignore
39
+ type _Headers = unknown extends Headers ? never : Headers;
40
+ export { _Headers as Headers };
41
+
42
+ // @ts-ignore
43
+ type _HeadersInit = unknown extends HeadersInit ? never : HeadersInit;
44
+ export { type _HeadersInit as HeadersInit };
45
+
46
+ type EndingType = 'native' | 'transparent';
47
+
48
+ export interface BlobPropertyBag {
49
+ endings?: EndingType;
50
+ type?: string;
51
+ }
52
+
53
+ export interface FilePropertyBag extends BlobPropertyBag {
54
+ lastModified?: number;
55
+ }
56
+
57
+ export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
58
+
59
+ // @ts-ignore
60
+ type _FormData = unknown extends FormData ? never : FormData;
61
+ // @ts-ignore
62
+ declare const _FormData: unknown extends typeof FormData ? never : typeof FormData;
63
+ export { _FormData as FormData };
64
+
65
+ // @ts-ignore
66
+ type _File = unknown extends File ? never : File;
67
+ // @ts-ignore
68
+ declare const _File: unknown extends typeof File ? never : typeof File;
69
+ export { _File as File };
70
+
71
+ // @ts-ignore
72
+ type _Blob = unknown extends Blob ? never : Blob;
73
+ // @ts-ignore
74
+ declare const _Blob: unknown extends typeof Blob ? never : typeof Blob;
75
+ export { _Blob as Blob };
76
+
77
+ export declare class Readable {
78
+ readable: boolean;
79
+ readonly readableEnded: boolean;
80
+ readonly readableFlowing: boolean | null;
81
+ readonly readableHighWaterMark: number;
82
+ readonly readableLength: number;
83
+ readonly readableObjectMode: boolean;
84
+ destroyed: boolean;
85
+ read(size?: number): any;
86
+ pause(): this;
87
+ resume(): this;
88
+ isPaused(): boolean;
89
+ destroy(error?: Error): this;
90
+ [Symbol.asyncIterator](): AsyncIterableIterator<any>;
91
+ }
92
+
93
+ export declare class FsReadStream extends Readable {
94
+ path: {}; // node type is string | Buffer
95
+ }
96
+
97
+ // @ts-ignore
98
+ type _ReadableStream<R = any> = unknown extends ReadableStream<R> ? never : ReadableStream<R>;
99
+ export { type _ReadableStream as ReadableStream };
@@ -1,5 +1,3 @@
1
1
  /**
2
2
  * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
3
  */
4
-
5
- exports.ReadableStream = ReadableStream;
@@ -1,5 +1,3 @@
1
1
  /**
2
2
  * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
3
  */
4
-
5
- exports.ReadableStream = ReadableStream;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ import { type Shims } from "./registry.js";
5
+ export declare function getRuntime(): Shims;
6
+ //# sourceMappingURL=bun-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun-runtime.d.ts","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAIxC,wBAAgB,UAAU,IAAI,KAAK,CAMlC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRuntime = void 0;
4
+ const web_runtime_1 = require("./web-runtime.js");
5
+ const node_fs_1 = require("node:fs");
6
+ function getRuntime() {
7
+ const runtime = (0, web_runtime_1.getRuntime)();
8
+ function isFsReadStream(value) {
9
+ return value instanceof node_fs_1.ReadStream;
10
+ }
11
+ return { ...runtime, isFsReadStream };
12
+ }
13
+ exports.getRuntime = getRuntime;
14
+ //# sourceMappingURL=bun-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun-runtime.js","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":";;;AAIA,kDAA4D;AAC5D,qCAAqD;AAErD,SAAgB,UAAU;IACxB,MAAM,OAAO,GAAG,IAAA,wBAAa,GAAE,CAAC;IAChC,SAAS,cAAc,CAAC,KAAU;QAChC,OAAO,KAAK,YAAY,oBAAY,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC;AAND,gCAMC"}
@@ -0,0 +1,10 @@
1
+ import { getRuntime as getWebRuntime } from "./web-runtime.mjs";
2
+ import { ReadStream as FsReadStream } from 'node:fs';
3
+ export function getRuntime() {
4
+ const runtime = getWebRuntime();
5
+ function isFsReadStream(value) {
6
+ return value instanceof FsReadStream;
7
+ }
8
+ return { ...runtime, isFsReadStream };
9
+ }
10
+ //# sourceMappingURL=bun-runtime.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bun-runtime.mjs","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":"OAIO,EAAE,UAAU,IAAI,aAAa,EAAE;OAC/B,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,SAAS;AAEpD,MAAM,UAAU,UAAU;IACxB,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,SAAS,cAAc,CAAC,KAAU;QAChC,OAAO,KAAK,YAAY,YAAY,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC"}