@tryfinch/finch-api 5.0.0 → 5.2.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 (364) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +61 -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/{src/_shims/ReadableStream.js → _shims/auto/types.js} +0 -2
  36. package/_shims/{ReadableStream.js → 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 +171 -223
  74. package/core.d.ts.map +1 -1
  75. package/core.js +674 -728
  76. package/core.js.map +1 -1
  77. package/core.mjs +668 -681
  78. package/core.mjs.map +1 -1
  79. package/error.d.ts +29 -31
  80. package/error.d.ts.map +1 -1
  81. package/error.js +91 -105
  82. package/error.js.map +1 -1
  83. package/error.mjs +88 -90
  84. package/error.mjs.map +1 -1
  85. package/index.d.mts +144 -173
  86. package/index.d.ts +144 -173
  87. package/index.d.ts.map +1 -1
  88. package/index.js +144 -195
  89. package/index.js.map +1 -1
  90. package/index.mjs +122 -143
  91. package/index.mjs.map +1 -1
  92. package/package.json +33 -20
  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 +6 -6
  139. package/resources/index.d.ts.map +1 -1
  140. package/resources/index.js +13 -38
  141. package/resources/index.js.map +1 -1
  142. package/resources/index.mjs +5 -5
  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 +22 -0
  151. package/resources/webhooks.d.ts.map +1 -0
  152. package/resources/webhooks.js +114 -0
  153. package/resources/webhooks.js.map +1 -0
  154. package/resources/webhooks.mjs +110 -0
  155. package/resources/webhooks.mjs.map +1 -0
  156. package/shims/node.d.ts +29 -0
  157. package/shims/node.d.ts.map +1 -0
  158. package/shims/node.js +31 -0
  159. package/shims/node.js.map +1 -0
  160. package/shims/node.mjs +5 -0
  161. package/shims/node.mjs.map +1 -0
  162. package/shims/web.d.ts +26 -0
  163. package/shims/web.d.ts.map +1 -0
  164. package/shims/web.js +31 -0
  165. package/shims/web.js.map +1 -0
  166. package/shims/web.mjs +5 -0
  167. package/shims/web.mjs.map +1 -0
  168. package/src/_shims/MultipartBody.ts +9 -0
  169. package/src/_shims/README.md +46 -0
  170. package/src/_shims/auto/runtime-bun.ts +4 -0
  171. package/src/_shims/auto/runtime-node.ts +4 -0
  172. package/src/_shims/auto/runtime.ts +4 -0
  173. package/src/_shims/auto/types-node.ts +4 -0
  174. package/src/_shims/auto/types.d.ts +99 -0
  175. package/src/_shims/auto/types.js +3 -0
  176. package/src/_shims/auto/types.mjs +3 -0
  177. package/src/_shims/bun-runtime.ts +14 -0
  178. package/src/_shims/index.d.ts +79 -0
  179. package/src/_shims/index.js +13 -0
  180. package/src/_shims/index.mjs +7 -0
  181. package/src/_shims/manual-types.d.ts +12 -0
  182. package/src/_shims/manual-types.js +3 -0
  183. package/src/_shims/manual-types.mjs +3 -0
  184. package/src/_shims/node-runtime.ts +79 -0
  185. package/src/_shims/node-types.d.ts +42 -0
  186. package/src/_shims/node-types.js +3 -0
  187. package/src/_shims/node-types.mjs +3 -0
  188. package/src/_shims/registry.ts +64 -0
  189. package/src/_shims/web-runtime.ts +91 -0
  190. package/src/_shims/web-types.d.ts +82 -0
  191. package/src/_shims/web-types.js +3 -0
  192. package/src/_shims/web-types.mjs +3 -0
  193. package/src/core.ts +38 -17
  194. package/src/error.ts +4 -4
  195. package/src/index.ts +12 -21
  196. package/src/pagination.ts +0 -259
  197. package/src/resources/account.ts +2 -2
  198. package/src/resources/hris/benefits/benefits.ts +4 -4
  199. package/src/resources/hris/benefits/individuals.ts +5 -5
  200. package/src/resources/hris/company.ts +3 -3
  201. package/src/resources/hris/directory.ts +4 -4
  202. package/src/resources/hris/employments.ts +4 -4
  203. package/src/resources/hris/hris.ts +1 -1
  204. package/src/resources/hris/individuals.ts +5 -5
  205. package/src/resources/hris/pay-statements.ts +5 -5
  206. package/src/resources/hris/payments.ts +4 -4
  207. package/src/resources/index.ts +1 -1
  208. package/src/resources/providers.ts +3 -3
  209. package/src/resources/webhooks.ts +151 -0
  210. package/src/shims/node.ts +50 -0
  211. package/src/shims/web.ts +50 -0
  212. package/src/tsconfig.json +11 -0
  213. package/src/uploads.ts +11 -15
  214. package/src/version.ts +1 -1
  215. package/uploads.d.ts +23 -39
  216. package/uploads.d.ts.map +1 -1
  217. package/uploads.js +115 -157
  218. package/uploads.js.map +1 -1
  219. package/uploads.mjs +111 -133
  220. package/uploads.mjs.map +1 -1
  221. package/version.d.ts +2 -2
  222. package/version.js +4 -4
  223. package/version.mjs +2 -2
  224. package/_shims/ReadableStream.d.ts +0 -38
  225. package/_shims/ReadableStream.mjs +0 -7
  226. package/_shims/ReadableStream.node.d.ts +0 -6
  227. package/_shims/ReadableStream.node.d.ts.map +0 -1
  228. package/_shims/ReadableStream.node.js +0 -14
  229. package/_shims/ReadableStream.node.js.map +0 -1
  230. package/_shims/ReadableStream.node.mjs +0 -3
  231. package/_shims/ReadableStream.node.mjs.map +0 -1
  232. package/_shims/agent.d.ts +0 -9
  233. package/_shims/agent.d.ts.map +0 -1
  234. package/_shims/agent.js +0 -14
  235. package/_shims/agent.js.map +0 -1
  236. package/_shims/agent.mjs +0 -10
  237. package/_shims/agent.mjs.map +0 -1
  238. package/_shims/agent.node.d.ts +0 -7
  239. package/_shims/agent.node.d.ts.map +0 -1
  240. package/_shims/agent.node.js +0 -28
  241. package/_shims/agent.node.js.map +0 -1
  242. package/_shims/agent.node.mjs +0 -16
  243. package/_shims/agent.node.mjs.map +0 -1
  244. package/_shims/fetch.d.ts +0 -60
  245. package/_shims/fetch.js +0 -13
  246. package/_shims/fetch.mjs +0 -15
  247. package/_shims/fetch.node.d.ts +0 -64
  248. package/_shims/fetch.node.js +0 -12
  249. package/_shims/fetch.node.mjs +0 -14
  250. package/_shims/fileFromPath.d.ts +0 -22
  251. package/_shims/fileFromPath.d.ts.map +0 -1
  252. package/_shims/fileFromPath.js +0 -16
  253. package/_shims/fileFromPath.js.map +0 -1
  254. package/_shims/fileFromPath.mjs +0 -12
  255. package/_shims/fileFromPath.mjs.map +0 -1
  256. package/_shims/fileFromPath.node.d.ts +0 -17
  257. package/_shims/fileFromPath.node.d.ts.map +0 -1
  258. package/_shims/fileFromPath.node.js +0 -17
  259. package/_shims/fileFromPath.node.js.map +0 -1
  260. package/_shims/fileFromPath.node.mjs +0 -13
  261. package/_shims/fileFromPath.node.mjs.map +0 -1
  262. package/_shims/formdata.d.ts +0 -43
  263. package/_shims/formdata.js +0 -17
  264. package/_shims/formdata.mjs +0 -20
  265. package/_shims/formdata.node.d.ts +0 -45
  266. package/_shims/formdata.node.js +0 -11
  267. package/_shims/formdata.node.mjs +0 -9
  268. package/_shims/getMultipartRequestOptions.d.ts +0 -10
  269. package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
  270. package/_shims/getMultipartRequestOptions.js +0 -12
  271. package/_shims/getMultipartRequestOptions.js.map +0 -1
  272. package/_shims/getMultipartRequestOptions.mjs +0 -8
  273. package/_shims/getMultipartRequestOptions.mjs.map +0 -1
  274. package/_shims/getMultipartRequestOptions.node.d.ts +0 -10
  275. package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
  276. package/_shims/getMultipartRequestOptions.node.js +0 -22
  277. package/_shims/getMultipartRequestOptions.node.js.map +0 -1
  278. package/_shims/getMultipartRequestOptions.node.mjs +0 -18
  279. package/_shims/getMultipartRequestOptions.node.mjs.map +0 -1
  280. package/_shims/node-readable.d.ts +0 -23
  281. package/_shims/node-readable.d.ts.map +0 -1
  282. package/_shims/node-readable.js +0 -11
  283. package/_shims/node-readable.js.map +0 -1
  284. package/_shims/node-readable.mjs +0 -7
  285. package/_shims/node-readable.mjs.map +0 -1
  286. package/_shims/node-readable.node.d.ts +0 -8
  287. package/_shims/node-readable.node.d.ts.map +0 -1
  288. package/_shims/node-readable.node.js +0 -9
  289. package/_shims/node-readable.node.js.map +0 -1
  290. package/_shims/node-readable.node.mjs +0 -5
  291. package/_shims/node-readable.node.mjs.map +0 -1
  292. package/resources/ats/applications.d.ts +0 -39
  293. package/resources/ats/applications.d.ts.map +0 -1
  294. package/resources/ats/applications.js +0 -24
  295. package/resources/ats/applications.js.map +0 -1
  296. package/resources/ats/applications.mjs +0 -20
  297. package/resources/ats/applications.mjs.map +0 -1
  298. package/resources/ats/ats.d.ts +0 -32
  299. package/resources/ats/ats.d.ts.map +0 -1
  300. package/resources/ats/ats.js +0 -71
  301. package/resources/ats/ats.js.map +0 -1
  302. package/resources/ats/ats.mjs +0 -27
  303. package/resources/ats/ats.mjs.map +0 -1
  304. package/resources/ats/candidates.d.ts +0 -53
  305. package/resources/ats/candidates.d.ts.map +0 -1
  306. package/resources/ats/candidates.js +0 -25
  307. package/resources/ats/candidates.js.map +0 -1
  308. package/resources/ats/candidates.mjs +0 -21
  309. package/resources/ats/candidates.mjs.map +0 -1
  310. package/resources/ats/index.d.ts +0 -7
  311. package/resources/ats/index.d.ts.map +0 -1
  312. package/resources/ats/index.js +0 -60
  313. package/resources/ats/index.js.map +0 -1
  314. package/resources/ats/index.mjs +0 -8
  315. package/resources/ats/index.mjs.map +0 -1
  316. package/resources/ats/jobs.d.ts +0 -47
  317. package/resources/ats/jobs.d.ts.map +0 -1
  318. package/resources/ats/jobs.js +0 -24
  319. package/resources/ats/jobs.js.map +0 -1
  320. package/resources/ats/jobs.mjs +0 -20
  321. package/resources/ats/jobs.mjs.map +0 -1
  322. package/resources/ats/offers.d.ts +0 -39
  323. package/resources/ats/offers.d.ts.map +0 -1
  324. package/resources/ats/offers.js +0 -24
  325. package/resources/ats/offers.js.map +0 -1
  326. package/resources/ats/offers.mjs +0 -20
  327. package/resources/ats/offers.mjs.map +0 -1
  328. package/resources/ats/stages.d.ts +0 -30
  329. package/resources/ats/stages.d.ts.map +0 -1
  330. package/resources/ats/stages.js +0 -22
  331. package/resources/ats/stages.js.map +0 -1
  332. package/resources/ats/stages.mjs +0 -17
  333. package/resources/ats/stages.mjs.map +0 -1
  334. package/src/_shims/ReadableStream.d.ts +0 -38
  335. package/src/_shims/ReadableStream.mjs +0 -7
  336. package/src/_shims/agent.node.ts +0 -22
  337. package/src/_shims/agent.ts +0 -12
  338. package/src/_shims/fetch.d.ts +0 -60
  339. package/src/_shims/fetch.deno.ts +0 -23
  340. package/src/_shims/fetch.js +0 -13
  341. package/src/_shims/fetch.mjs +0 -15
  342. package/src/_shims/fetch.node.d.ts +0 -64
  343. package/src/_shims/fetch.node.js +0 -12
  344. package/src/_shims/fetch.node.mjs +0 -14
  345. package/src/_shims/fileFromPath.node.ts +0 -29
  346. package/src/_shims/fileFromPath.ts +0 -29
  347. package/src/_shims/formdata.d.ts +0 -43
  348. package/src/_shims/formdata.deno.ts +0 -16
  349. package/src/_shims/formdata.js +0 -17
  350. package/src/_shims/formdata.mjs +0 -20
  351. package/src/_shims/formdata.node.d.ts +0 -45
  352. package/src/_shims/formdata.node.js +0 -11
  353. package/src/_shims/formdata.node.mjs +0 -9
  354. package/src/_shims/getMultipartRequestOptions.node.ts +0 -25
  355. package/src/_shims/getMultipartRequestOptions.ts +0 -14
  356. package/src/_shims/node-readable.node.ts +0 -10
  357. package/src/_shims/node-readable.ts +0 -30
  358. package/src/resources/ats/applications.ts +0 -64
  359. package/src/resources/ats/ats.ts +0 -39
  360. package/src/resources/ats/candidates.ts +0 -83
  361. package/src/resources/ats/index.ts +0 -8
  362. package/src/resources/ats/jobs.ts +0 -76
  363. package/src/resources/ats/offers.ts +0 -63
  364. package/src/resources/ats/stages.ts +0 -39
package/CHANGELOG.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.2.0 (2023-09-21)
4
+
5
+ Full Changelog: [v5.1.0...v5.2.0](https://github.com/Finch-API/finch-api-node/compare/v5.1.0...v5.2.0)
6
+
7
+ ### Features
8
+
9
+ * **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))
10
+ * **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))
11
+ * **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))
12
+
13
+
14
+ ### Chores
15
+
16
+ * **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))
17
+
18
+
19
+ ### Documentation
20
+
21
+ * 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))
22
+ * **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))
23
+ * **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))
24
+
25
+ ## 5.1.0 (2023-09-08)
26
+
27
+ Full Changelog: [v5.0.0...v5.1.0](https://github.com/Finch-API/finch-api-node/compare/v5.0.0...v5.1.0)
28
+
29
+ ### Features
30
+
31
+ * add webhook verification methods ([#153](https://github.com/Finch-API/finch-api-node/issues/153)) ([bbcd2d3](https://github.com/Finch-API/finch-api-node/commit/bbcd2d397493d9697ae8f91cc4b878cb4767ee78))
32
+ * **package:** add Bun export map ([#145](https://github.com/Finch-API/finch-api-node/issues/145)) ([a30eed3](https://github.com/Finch-API/finch-api-node/commit/a30eed30dbd6988855df99b969c9d38f438aeb9b))
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * **client:** fix TS errors that appear when users Go to Source in VSCode ([#150](https://github.com/Finch-API/finch-api-node/issues/150)) ([81cf41d](https://github.com/Finch-API/finch-api-node/commit/81cf41daa58ae151856655df3c28da642f24b014))
38
+ * **client:** handle case where the client is instantiated with a undefined baseURL ([#151](https://github.com/Finch-API/finch-api-node/issues/151)) ([45c409c](https://github.com/Finch-API/finch-api-node/commit/45c409c1896920f2a01ae219c9fe41f86bf001a6))
39
+ * **client:** use explicit file extensions in _shims imports ([#149](https://github.com/Finch-API/finch-api-node/issues/149)) ([5484933](https://github.com/Finch-API/finch-api-node/commit/54849335187d3639bd92afe67fccda1925073c26))
40
+ * fix module not found errors in Vercel edge ([#156](https://github.com/Finch-API/finch-api-node/issues/156)) ([e39458c](https://github.com/Finch-API/finch-api-node/commit/e39458c3522e406ac246276daa4685549ace8393))
41
+ * **readme:** update link to api.md to use the correct branch ([#154](https://github.com/Finch-API/finch-api-node/issues/154)) ([312a217](https://github.com/Finch-API/finch-api-node/commit/312a2172cfbf0e21af7759315c1247e97fd8ec92))
42
+
43
+
44
+ ### Chores
45
+
46
+ * **internal:** add example for configuration ([#147](https://github.com/Finch-API/finch-api-node/issues/147)) ([ac9de99](https://github.com/Finch-API/finch-api-node/commit/ac9de99f30dc2cb31bf4361f68382f33c9a1ed9d))
47
+ * **internal:** export helper from core ([#155](https://github.com/Finch-API/finch-api-node/issues/155)) ([46233a7](https://github.com/Finch-API/finch-api-node/commit/46233a78c56a25f5300f0766e47d8f90cc603733))
48
+
49
+
50
+ ### Documentation
51
+
52
+ * **readme:** add link to api.md ([#152](https://github.com/Finch-API/finch-api-node/issues/152)) ([601c2ba](https://github.com/Finch-API/finch-api-node/commit/601c2ba9cc95cc9c06f55b652309828f6c5ddc1f))
53
+
3
54
  ## 5.0.0 (2023-08-29)
4
55
 
5
56
  Full Changelog: [v4.2.1...v5.0.0](https://github.com/Finch-API/finch-api-node/compare/v4.2.1...v5.0.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
 
@@ -16,6 +16,8 @@ yarn add @tryfinch/finch-api
16
16
 
17
17
  ## Usage
18
18
 
19
+ The full API of this library can be found in [api.md](https://www.github.com/Finch-API/finch-api-node/blob/main/api.md).
20
+
19
21
  ```js
20
22
  import Finch from '@tryfinch/finch-api';
21
23
 
@@ -24,9 +26,10 @@ const finch = new Finch({
24
26
  });
25
27
 
26
28
  async function main() {
27
- const candidate = await finch.ats.candidates.retrieve('<candidate id>');
29
+ const page = await finch.hris.directory.listIndividuals();
30
+ const individualInDirectory = page.individuals[0];
28
31
 
29
- console.log(candidate.first_name);
32
+ console.log(individualInDirectory.first_name);
30
33
  }
31
34
 
32
35
  main();
@@ -44,7 +47,8 @@ const finch = new Finch({
44
47
  });
45
48
 
46
49
  async function main() {
47
- const candidate: Finch.ATS.Candidate = await finch.ats.candidates.retrieve('<candidate id>');
50
+ const [individualInDirectory]: [Finch.HRIS.IndividualInDirectory] =
51
+ await finch.hris.directory.listIndividuals();
48
52
  }
49
53
 
50
54
  main();
@@ -91,8 +95,8 @@ Error codes are as followed:
91
95
  ### Retries
92
96
 
93
97
  Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
94
- Connection errors (for example, due to a network connectivity problem), 409 Conflict, 429 Rate Limit,
95
- 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.
96
100
 
97
101
  You can use the `maxRetries` option to configure or disable this:
98
102
 
@@ -136,22 +140,22 @@ List methods in the Finch API are paginated.
136
140
  You can use `for await … of` syntax to iterate through items across all pages:
137
141
 
138
142
  ```ts
139
- async function fetchAllATSJobs(params) {
140
- const allATSJobs = [];
143
+ async function fetchAllHRISDirectories(params) {
144
+ const allHRISDirectories = [];
141
145
  // Automatically fetches more pages as needed.
142
- for await (const job of finch.ats.jobs.list()) {
143
- allATSJobs.push(job);
146
+ for await (const individualInDirectory of finch.hris.directory.listIndividuals()) {
147
+ allHRISDirectories.push(individualInDirectory);
144
148
  }
145
- return allATSJobs;
149
+ return allHRISDirectories;
146
150
  }
147
151
  ```
148
152
 
149
153
  Alternatively, you can make request a single page at a time:
150
154
 
151
155
  ```ts
152
- let page = await finch.ats.jobs.list();
153
- for (const job of page.jobs) {
154
- console.log(job);
156
+ let page = await finch.hris.directory.listIndividuals();
157
+ for (const individualInDirectory of page.individuals) {
158
+ console.log(individualInDirectory);
155
159
  }
156
160
 
157
161
  // Convenience methods are provided for manually paginating:
@@ -174,9 +178,39 @@ import Finch from '@tryfinch/finch-api';
174
178
 
175
179
  const finch = new Finch();
176
180
 
177
- const candidate = await finch.ats.candidates.retrieve('<candidate id>', {
181
+ const page = await finch.hris.directory.listIndividuals({
178
182
  headers: { 'Finch-API-Version': 'My-Custom-Value' },
179
183
  });
184
+ const individualInDirectory = page.individuals[0];
185
+ ```
186
+
187
+ ## Webhook Verification
188
+
189
+ We provide helper methods for verifying that a webhook request came from Finch, and not a malicious third party.
190
+
191
+ You can use `finch.webhooks.verifySignature(body: string, headers, secret?) -> void` or `finch.webhooks.unwrap(body: string, headers, secret?) -> Payload`,
192
+ both of which will raise an error if the signature is invalid.
193
+
194
+ Note that the "body" parameter must be the raw JSON string sent from the server (do not parse and re-stringify it).
195
+ The `.unwrap()` method will automatically parse this JSON for you into a typed `Payload`.
196
+
197
+ For example:
198
+
199
+ ```ts
200
+ // with Express:
201
+ app.use('/webhooks/finch', bodyParser.text({ type: '*/*' }), function (req, res) {
202
+ const payload = finch.webhooks.unwrap(req.body, req.headers, process.env['FINCH_WEBHOOK_SECRET']); // env var used by default; explicit here.
203
+ console.log(payload);
204
+ res.json({ ok: true });
205
+ });
206
+
207
+ // with Next.js (app router):
208
+ export default async function POST(req) {
209
+ const body = await req.text(); // if you're using the pages router, you will need this trick: https://vancelucas.com/blog/how-to-access-raw-body-data-with-next-js/
210
+ const payload = finch.webhooks.unwrap(body, req.headers, process.env['FINCH_WEBHOOK_SECRET']); // env var used by default; explicit here.
211
+ console.log(payload);
212
+ return NextResponse.json({ ok: true });
213
+ }
180
214
  ```
181
215
 
182
216
  ## Advanced Usage
@@ -190,15 +224,15 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi
190
224
  ```ts
191
225
  const finch = new Finch();
192
226
 
193
- const response = await finch.ats.candidates.retrieve('<candidate id>').asResponse();
227
+ const response = await finch.hris.directory.listIndividuals().asResponse();
194
228
  console.log(response.headers.get('X-My-Header'));
195
229
  console.log(response.statusText); // access the underlying Response object
196
230
 
197
- const { data: candidates, response: raw } = await finch.ats.candidates
198
- .retrieve('<candidate id>')
199
- .withResponse();
231
+ const { data: page, response: raw } = await finch.hris.directory.listIndividuals().withResponse();
200
232
  console.log(raw.headers.get('X-My-Header'));
201
- console.log(candidates.first_name);
233
+ for await (const individualInDirectory of page) {
234
+ console.log(individualInDirectory.first_name);
235
+ }
202
236
  ```
203
237
 
204
238
  ## Configuring an HTTP(S) Agent (e.g., for proxies)
@@ -238,12 +272,18 @@ We are keen for your feedback; please open an [issue](https://www.github.com/Fin
238
272
 
239
273
  ## Requirements
240
274
 
275
+ TypeScript >= 4.5 is supported.
276
+
241
277
  The following runtimes are supported:
242
278
 
243
279
  - Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
244
280
  - Deno v1.28.0 or higher, using `import Finch from "npm:@tryfinch/finch-api"`.
245
- Deno Deploy is not yet supported.
281
+ - Bun 1.0 or later.
246
282
  - Cloudflare Workers.
247
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.
248
288
 
249
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