@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.
- package/CHANGELOG.md +51 -0
- package/README.md +61 -21
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/{src/_shims/ReadableStream.node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +99 -0
- package/{src/_shims/ReadableStream.js → _shims/auto/types.js} +0 -2
- package/_shims/{ReadableStream.js → auto/types.mjs} +0 -2
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +79 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +87 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +54 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +35 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +39 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +35 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +70 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +63 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +82 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +171 -223
- package/core.d.ts.map +1 -1
- package/core.js +674 -728
- package/core.js.map +1 -1
- package/core.mjs +668 -681
- package/core.mjs.map +1 -1
- package/error.d.ts +29 -31
- package/error.d.ts.map +1 -1
- package/error.js +91 -105
- package/error.js.map +1 -1
- package/error.mjs +88 -90
- package/error.mjs.map +1 -1
- package/index.d.mts +144 -173
- package/index.d.ts +144 -173
- package/index.d.ts.map +1 -1
- package/index.js +144 -195
- package/index.js.map +1 -1
- package/index.mjs +122 -143
- package/index.mjs.map +1 -1
- package/package.json +33 -20
- package/pagination.d.ts +47 -167
- package/pagination.d.ts.map +1 -1
- package/pagination.js +72 -202
- package/pagination.js.map +1 -1
- package/pagination.mjs +68 -187
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +10 -10
- package/resource.js +12 -12
- package/resource.mjs +10 -10
- package/resources/account.d.ts +44 -44
- package/resources/account.js +20 -19
- package/resources/account.mjs +17 -16
- package/resources/hris/benefits/benefits.d.ts +127 -154
- package/resources/hris/benefits/benefits.js +74 -89
- package/resources/hris/benefits/benefits.mjs +50 -48
- package/resources/hris/benefits/index.d.ts +3 -28
- package/resources/hris/benefits/index.js +13 -55
- package/resources/hris/benefits/index.mjs +3 -8
- package/resources/hris/benefits/individuals.d.ts +129 -147
- package/resources/hris/benefits/individuals.js +59 -59
- package/resources/hris/benefits/individuals.mjs +53 -49
- package/resources/hris/company.d.ts +80 -80
- package/resources/hris/company.js +12 -13
- package/resources/hris/company.mjs +9 -8
- package/resources/hris/directory.d.ts +53 -55
- package/resources/hris/directory.js +13 -12
- package/resources/hris/directory.mjs +8 -7
- package/resources/hris/employments.d.ts +124 -126
- package/resources/hris/employments.js +23 -21
- package/resources/hris/employments.mjs +19 -17
- package/resources/hris/hris.d.ts +113 -123
- package/resources/hris/hris.js +54 -71
- package/resources/hris/hris.mjs +32 -32
- package/resources/hris/index.d.ts +9 -41
- package/resources/hris/index.js +26 -110
- package/resources/hris/index.mjs +9 -9
- package/resources/hris/individuals.d.ts +65 -67
- package/resources/hris/individuals.js +19 -17
- package/resources/hris/individuals.mjs +14 -12
- package/resources/hris/pay-statements.d.ts +146 -162
- package/resources/hris/pay-statements.js +22 -20
- package/resources/hris/pay-statements.mjs +18 -16
- package/resources/hris/payments.d.ts +47 -49
- package/resources/hris/payments.js +15 -13
- package/resources/hris/payments.mjs +11 -9
- package/resources/index.d.ts +6 -6
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -38
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -5
- package/resources/index.mjs.map +1 -1
- package/resources/providers.d.ts +43 -42
- package/resources/providers.js +15 -13
- package/resources/providers.mjs +11 -9
- package/resources/top-level.d.ts +1 -1
- package/resources/top-level.js +3 -3
- package/resources/top-level.mjs +1 -1
- package/resources/webhooks.d.ts +22 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +114 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +110 -0
- package/resources/webhooks.mjs.map +1 -0
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +99 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +79 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +79 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +64 -0
- package/src/_shims/web-runtime.ts +91 -0
- package/src/_shims/web-types.d.ts +82 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +38 -17
- package/src/error.ts +4 -4
- package/src/index.ts +12 -21
- package/src/pagination.ts +0 -259
- package/src/resources/account.ts +2 -2
- package/src/resources/hris/benefits/benefits.ts +4 -4
- package/src/resources/hris/benefits/individuals.ts +5 -5
- package/src/resources/hris/company.ts +3 -3
- package/src/resources/hris/directory.ts +4 -4
- package/src/resources/hris/employments.ts +4 -4
- package/src/resources/hris/hris.ts +1 -1
- package/src/resources/hris/individuals.ts +5 -5
- package/src/resources/hris/pay-statements.ts +5 -5
- package/src/resources/hris/payments.ts +4 -4
- package/src/resources/index.ts +1 -1
- package/src/resources/providers.ts +3 -3
- package/src/resources/webhooks.ts +151 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +11 -15
- package/src/version.ts +1 -1
- package/uploads.d.ts +23 -39
- package/uploads.d.ts.map +1 -1
- package/uploads.js +115 -157
- package/uploads.js.map +1 -1
- package/uploads.mjs +111 -133
- package/uploads.mjs.map +1 -1
- package/version.d.ts +2 -2
- package/version.js +4 -4
- package/version.mjs +2 -2
- package/_shims/ReadableStream.d.ts +0 -38
- package/_shims/ReadableStream.mjs +0 -7
- package/_shims/ReadableStream.node.d.ts +0 -6
- package/_shims/ReadableStream.node.d.ts.map +0 -1
- package/_shims/ReadableStream.node.js +0 -14
- package/_shims/ReadableStream.node.js.map +0 -1
- package/_shims/ReadableStream.node.mjs +0 -3
- package/_shims/ReadableStream.node.mjs.map +0 -1
- package/_shims/agent.d.ts +0 -9
- package/_shims/agent.d.ts.map +0 -1
- package/_shims/agent.js +0 -14
- package/_shims/agent.js.map +0 -1
- package/_shims/agent.mjs +0 -10
- package/_shims/agent.mjs.map +0 -1
- package/_shims/agent.node.d.ts +0 -7
- package/_shims/agent.node.d.ts.map +0 -1
- package/_shims/agent.node.js +0 -28
- package/_shims/agent.node.js.map +0 -1
- package/_shims/agent.node.mjs +0 -16
- package/_shims/agent.node.mjs.map +0 -1
- package/_shims/fetch.d.ts +0 -60
- package/_shims/fetch.js +0 -13
- package/_shims/fetch.mjs +0 -15
- package/_shims/fetch.node.d.ts +0 -64
- package/_shims/fetch.node.js +0 -12
- package/_shims/fetch.node.mjs +0 -14
- package/_shims/fileFromPath.d.ts +0 -22
- package/_shims/fileFromPath.d.ts.map +0 -1
- package/_shims/fileFromPath.js +0 -16
- package/_shims/fileFromPath.js.map +0 -1
- package/_shims/fileFromPath.mjs +0 -12
- package/_shims/fileFromPath.mjs.map +0 -1
- package/_shims/fileFromPath.node.d.ts +0 -17
- package/_shims/fileFromPath.node.d.ts.map +0 -1
- package/_shims/fileFromPath.node.js +0 -17
- package/_shims/fileFromPath.node.js.map +0 -1
- package/_shims/fileFromPath.node.mjs +0 -13
- package/_shims/fileFromPath.node.mjs.map +0 -1
- package/_shims/formdata.d.ts +0 -43
- package/_shims/formdata.js +0 -17
- package/_shims/formdata.mjs +0 -20
- package/_shims/formdata.node.d.ts +0 -45
- package/_shims/formdata.node.js +0 -11
- package/_shims/formdata.node.mjs +0 -9
- package/_shims/getMultipartRequestOptions.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.js +0 -12
- package/_shims/getMultipartRequestOptions.js.map +0 -1
- package/_shims/getMultipartRequestOptions.mjs +0 -8
- package/_shims/getMultipartRequestOptions.mjs.map +0 -1
- package/_shims/getMultipartRequestOptions.node.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.node.js +0 -22
- package/_shims/getMultipartRequestOptions.node.js.map +0 -1
- package/_shims/getMultipartRequestOptions.node.mjs +0 -18
- package/_shims/getMultipartRequestOptions.node.mjs.map +0 -1
- package/_shims/node-readable.d.ts +0 -23
- package/_shims/node-readable.d.ts.map +0 -1
- package/_shims/node-readable.js +0 -11
- package/_shims/node-readable.js.map +0 -1
- package/_shims/node-readable.mjs +0 -7
- package/_shims/node-readable.mjs.map +0 -1
- package/_shims/node-readable.node.d.ts +0 -8
- package/_shims/node-readable.node.d.ts.map +0 -1
- package/_shims/node-readable.node.js +0 -9
- package/_shims/node-readable.node.js.map +0 -1
- package/_shims/node-readable.node.mjs +0 -5
- package/_shims/node-readable.node.mjs.map +0 -1
- package/resources/ats/applications.d.ts +0 -39
- package/resources/ats/applications.d.ts.map +0 -1
- package/resources/ats/applications.js +0 -24
- package/resources/ats/applications.js.map +0 -1
- package/resources/ats/applications.mjs +0 -20
- package/resources/ats/applications.mjs.map +0 -1
- package/resources/ats/ats.d.ts +0 -32
- package/resources/ats/ats.d.ts.map +0 -1
- package/resources/ats/ats.js +0 -71
- package/resources/ats/ats.js.map +0 -1
- package/resources/ats/ats.mjs +0 -27
- package/resources/ats/ats.mjs.map +0 -1
- package/resources/ats/candidates.d.ts +0 -53
- package/resources/ats/candidates.d.ts.map +0 -1
- package/resources/ats/candidates.js +0 -25
- package/resources/ats/candidates.js.map +0 -1
- package/resources/ats/candidates.mjs +0 -21
- package/resources/ats/candidates.mjs.map +0 -1
- package/resources/ats/index.d.ts +0 -7
- package/resources/ats/index.d.ts.map +0 -1
- package/resources/ats/index.js +0 -60
- package/resources/ats/index.js.map +0 -1
- package/resources/ats/index.mjs +0 -8
- package/resources/ats/index.mjs.map +0 -1
- package/resources/ats/jobs.d.ts +0 -47
- package/resources/ats/jobs.d.ts.map +0 -1
- package/resources/ats/jobs.js +0 -24
- package/resources/ats/jobs.js.map +0 -1
- package/resources/ats/jobs.mjs +0 -20
- package/resources/ats/jobs.mjs.map +0 -1
- package/resources/ats/offers.d.ts +0 -39
- package/resources/ats/offers.d.ts.map +0 -1
- package/resources/ats/offers.js +0 -24
- package/resources/ats/offers.js.map +0 -1
- package/resources/ats/offers.mjs +0 -20
- package/resources/ats/offers.mjs.map +0 -1
- package/resources/ats/stages.d.ts +0 -30
- package/resources/ats/stages.d.ts.map +0 -1
- package/resources/ats/stages.js +0 -22
- package/resources/ats/stages.js.map +0 -1
- package/resources/ats/stages.mjs +0 -17
- package/resources/ats/stages.mjs.map +0 -1
- package/src/_shims/ReadableStream.d.ts +0 -38
- package/src/_shims/ReadableStream.mjs +0 -7
- package/src/_shims/agent.node.ts +0 -22
- package/src/_shims/agent.ts +0 -12
- package/src/_shims/fetch.d.ts +0 -60
- package/src/_shims/fetch.deno.ts +0 -23
- package/src/_shims/fetch.js +0 -13
- package/src/_shims/fetch.mjs +0 -15
- package/src/_shims/fetch.node.d.ts +0 -64
- package/src/_shims/fetch.node.js +0 -12
- package/src/_shims/fetch.node.mjs +0 -14
- package/src/_shims/fileFromPath.node.ts +0 -29
- package/src/_shims/fileFromPath.ts +0 -29
- package/src/_shims/formdata.d.ts +0 -43
- package/src/_shims/formdata.deno.ts +0 -16
- package/src/_shims/formdata.js +0 -17
- package/src/_shims/formdata.mjs +0 -20
- package/src/_shims/formdata.node.d.ts +0 -45
- package/src/_shims/formdata.node.js +0 -11
- package/src/_shims/formdata.node.mjs +0 -9
- package/src/_shims/getMultipartRequestOptions.node.ts +0 -25
- package/src/_shims/getMultipartRequestOptions.ts +0 -14
- package/src/_shims/node-readable.node.ts +0 -10
- package/src/_shims/node-readable.ts +0 -30
- package/src/resources/ats/applications.ts +0 -64
- package/src/resources/ats/ats.ts +0 -39
- package/src/resources/ats/candidates.ts +0 -83
- package/src/resources/ats/index.ts +0 -8
- package/src/resources/ats/jobs.ts +0 -76
- package/src/resources/ats/offers.ts +0 -63
- 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
|
[](https://npmjs.org/package/@tryfinch/finch-api)
|
|
4
4
|
|
|
5
|
-
This library provides convenient access to the Finch
|
|
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
|
|
29
|
+
const page = await finch.hris.directory.listIndividuals();
|
|
30
|
+
const individualInDirectory = page.individuals[0];
|
|
28
31
|
|
|
29
|
-
console.log(
|
|
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
|
|
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),
|
|
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
|
|
140
|
-
const
|
|
143
|
+
async function fetchAllHRISDirectories(params) {
|
|
144
|
+
const allHRISDirectories = [];
|
|
141
145
|
// Automatically fetches more pages as needed.
|
|
142
|
-
for await (const
|
|
143
|
-
|
|
146
|
+
for await (const individualInDirectory of finch.hris.directory.listIndividuals()) {
|
|
147
|
+
allHRISDirectories.push(individualInDirectory);
|
|
144
148
|
}
|
|
145
|
-
return
|
|
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.
|
|
153
|
-
for (const
|
|
154
|
-
console.log(
|
|
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
|
|
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.
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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 @@
|
|
|
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"}
|
package/_shims/README.md
ADDED
|
@@ -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"`.
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bun.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":""}
|
|
@@ -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 @@
|
|
|
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 };
|
|
@@ -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
|