@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.
- package/CHANGELOG.md +43 -0
- package/README.md +28 -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/_shims/{ReadableStream.js → auto/types.js} +0 -2
- package/{src/_shims/ReadableStream.js → _shims/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 +170 -223
- package/core.d.ts.map +1 -1
- package/core.js +682 -729
- package/core.js.map +1 -1
- package/core.mjs +676 -680
- package/core.mjs.map +1 -1
- package/error.d.ts +32 -32
- package/error.d.ts.map +1 -1
- package/error.js +95 -106
- package/error.js.map +1 -1
- package/error.mjs +91 -91
- package/error.mjs.map +1 -1
- package/index.d.mts +145 -178
- package/index.d.ts +145 -178
- package/index.d.ts.map +1 -1
- package/index.js +145 -201
- package/index.js.map +1 -1
- package/index.mjs +123 -149
- package/index.mjs.map +1 -1
- package/package.json +31 -23
- 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 +5 -7
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -51
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -6
- 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 +18 -18
- package/resources/webhooks.js +103 -107
- package/resources/webhooks.mjs +98 -102
- 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 +75 -44
- package/src/error.ts +6 -4
- package/src/index.ts +8 -25
- package/src/pagination.ts +2 -261
- package/src/resource.ts +1 -1
- package/src/resources/account.ts +3 -3
- package/src/resources/hris/benefits/benefits.ts +6 -6
- package/src/resources/hris/benefits/index.ts +2 -2
- package/src/resources/hris/benefits/individuals.ts +6 -6
- package/src/resources/hris/company.ts +4 -4
- package/src/resources/hris/directory.ts +5 -5
- package/src/resources/hris/employments.ts +5 -5
- package/src/resources/hris/hris.ts +9 -9
- package/src/resources/hris/index.ts +8 -8
- package/src/resources/hris/individuals.ts +6 -6
- package/src/resources/hris/pay-statements.ts +6 -6
- package/src/resources/hris/payments.ts +5 -5
- package/src/resources/index.ts +4 -6
- package/src/resources/providers.ts +4 -4
- package/src/resources/webhooks.ts +2 -2
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/uploads.ts +12 -16
- 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-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/ReadableStream.d.ts +0 -38
- package/_shims/ReadableStream.mjs +0 -7
- 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/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/fetch-node.d.ts +0 -64
- package/_shims/fetch-node.js +0 -12
- package/_shims/fetch-node.mjs +0 -14
- package/_shims/fetch.d.ts +0 -60
- package/_shims/fetch.js +0 -13
- package/_shims/fetch.mjs +0 -15
- 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/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/form-data-node.d.ts +0 -45
- package/_shims/form-data-node.js +0 -11
- package/_shims/form-data-node.mjs +0 -9
- package/_shims/form-data.d.ts +0 -43
- package/_shims/form-data.js +0 -17
- package/_shims/form-data.mjs +0 -20
- 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/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/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/_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/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-node.d.ts +0 -64
- package/src/_shims/fetch-node.js +0 -12
- package/src/_shims/fetch-node.mjs +0 -14
- package/src/_shims/fetch.d.ts +0 -60
- package/src/_shims/fetch.js +0 -13
- package/src/_shims/fetch.mjs +0 -15
- package/src/_shims/fileFromPath-node.ts +0 -29
- package/src/_shims/fileFromPath.ts +0 -29
- package/src/_shims/form-data-node.d.ts +0 -45
- package/src/_shims/form-data-node.js +0 -11
- package/src/_shims/form-data-node.mjs +0 -9
- package/src/_shims/form-data.d.ts +0 -43
- package/src/_shims/form-data.js +0 -17
- package/src/_shims/form-data.mjs +0 -20
- 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/resources/index.js
CHANGED
|
@@ -1,52 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
exports.Webhooks =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return ats_1.ATS;
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
var account_1 = require('./account.js');
|
|
19
|
-
Object.defineProperty(exports, 'Account', {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return account_1.Account;
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
var hris_1 = require('./hris/hris.js');
|
|
26
|
-
Object.defineProperty(exports, 'HRIS', {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function () {
|
|
29
|
-
return hris_1.HRIS;
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
var providers_1 = require('./providers.js');
|
|
33
|
-
Object.defineProperty(exports, 'ProvidersSinglePage', {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function () {
|
|
36
|
-
return providers_1.ProvidersSinglePage;
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(exports, 'Providers', {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function () {
|
|
42
|
-
return providers_1.Providers;
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
var webhooks_1 = require('./webhooks.js');
|
|
46
|
-
Object.defineProperty(exports, 'Webhooks', {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: function () {
|
|
49
|
-
return webhooks_1.Webhooks;
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Webhooks = exports.Providers = exports.ProvidersSinglePage = exports.HRIS = exports.Account = void 0;
|
|
5
|
+
var account_1 = require("./account.js");
|
|
6
|
+
Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return account_1.Account; } });
|
|
7
|
+
var hris_1 = require("./hris/hris.js");
|
|
8
|
+
Object.defineProperty(exports, "HRIS", { enumerable: true, get: function () { return hris_1.HRIS; } });
|
|
9
|
+
var providers_1 = require("./providers.js");
|
|
10
|
+
Object.defineProperty(exports, "ProvidersSinglePage", { enumerable: true, get: function () { return providers_1.ProvidersSinglePage; } });
|
|
11
|
+
Object.defineProperty(exports, "Providers", { enumerable: true, get: function () { return providers_1.Providers; } });
|
|
12
|
+
var webhooks_1 = require("./webhooks.js");
|
|
13
|
+
Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return webhooks_1.Webhooks; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAErD,wCAAuE;AAA3B,kGAAA,OAAO,OAAA;AACnD,uCAAoE;AAA1B,4FAAA,IAAI,OAAA;AAC9C,4CAAuE;AAApD,gHAAA,mBAAmB,OAAA;AAAE,sGAAA,SAAS,OAAA;AACjD,0CAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=index.mjs.map
|
|
2
|
+
export { Account } from "./account.mjs";
|
|
3
|
+
export { HRIS } from "./hris/hris.mjs";
|
|
4
|
+
export { ProvidersSinglePage, Providers } from "./providers.mjs";
|
|
5
|
+
export { Webhooks } from "./webhooks.mjs";
|
|
6
|
+
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAE9C,EAAqC,OAAO,EAAE;OAC9C,EAAmC,IAAI,EAAE;OACzC,EAAY,mBAAmB,EAAE,SAAS,EAAE;OAC5C,EAAE,QAAQ,EAAE"}
|
package/resources/providers.d.ts
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
import * as Core from '@tryfinch/finch-api/core';
|
|
2
2
|
import { APIResource } from '@tryfinch/finch-api/resource';
|
|
3
|
-
import * as API from
|
|
3
|
+
import * as API from "./index.js";
|
|
4
4
|
import { SinglePage } from '@tryfinch/finch-api/pagination';
|
|
5
5
|
export declare class Providers extends APIResource {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Return details on all available payroll and HR systems.
|
|
8
|
+
*/
|
|
9
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ProvidersSinglePage, Provider>;
|
|
10
|
+
}
|
|
11
|
+
export declare class ProvidersSinglePage extends SinglePage<Provider> {
|
|
10
12
|
}
|
|
11
|
-
export declare class ProvidersSinglePage extends SinglePage<Provider> {}
|
|
12
13
|
type _ProvidersSinglePage = ProvidersSinglePage;
|
|
13
14
|
export interface Provider {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The id of the payroll provider used in Connect.
|
|
17
|
+
*/
|
|
18
|
+
id?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The display name of the payroll provider.
|
|
21
|
+
*/
|
|
22
|
+
display_name?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The url to the official icon of the payroll provider.
|
|
25
|
+
*/
|
|
26
|
+
icon?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The url to the official logo of the payroll provider.
|
|
29
|
+
*/
|
|
30
|
+
logo?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the Finch integration with this provider uses the Assisted Connect Flow
|
|
33
|
+
* by default.
|
|
34
|
+
*/
|
|
35
|
+
manual?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* whether MFA is required for the provider.
|
|
38
|
+
*/
|
|
39
|
+
mfa_required?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The hex code for the primary color of the payroll provider.
|
|
42
|
+
*/
|
|
43
|
+
primary_color?: string;
|
|
44
|
+
/**
|
|
45
|
+
* The list of Finch products supported on this payroll provider.
|
|
46
|
+
*/
|
|
47
|
+
products?: Array<string>;
|
|
47
48
|
}
|
|
48
49
|
export declare namespace Providers {
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
export import Provider = API.Provider;
|
|
51
|
+
type ProvidersSinglePage = _ProvidersSinglePage;
|
|
51
52
|
}
|
|
52
53
|
export {};
|
|
53
|
-
//# sourceMappingURL=providers.d.ts.map
|
|
54
|
+
//# sourceMappingURL=providers.d.ts.map
|
package/resources/providers.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.ProvidersSinglePage = exports.Providers = void 0;
|
|
5
|
-
const resource_1 = require(
|
|
6
|
-
const pagination_1 = require(
|
|
5
|
+
const resource_1 = require("@tryfinch/finch-api/resource");
|
|
6
|
+
const pagination_1 = require("@tryfinch/finch-api/pagination");
|
|
7
7
|
class Providers extends resource_1.APIResource {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Return details on all available payroll and HR systems.
|
|
10
|
+
*/
|
|
11
|
+
list(options) {
|
|
12
|
+
return this.getAPIList('/providers', ProvidersSinglePage, options);
|
|
13
|
+
}
|
|
14
14
|
}
|
|
15
15
|
exports.Providers = Providers;
|
|
16
|
-
class ProvidersSinglePage extends pagination_1.SinglePage {
|
|
16
|
+
class ProvidersSinglePage extends pagination_1.SinglePage {
|
|
17
|
+
}
|
|
17
18
|
exports.ProvidersSinglePage = ProvidersSinglePage;
|
|
18
|
-
(function (Providers) {
|
|
19
|
-
|
|
19
|
+
(function (Providers) {
|
|
20
|
+
})(Providers = exports.Providers || (exports.Providers = {}));
|
|
21
|
+
//# sourceMappingURL=providers.js.map
|
package/resources/providers.mjs
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
import { APIResource } from '@tryfinch/finch-api/resource';
|
|
3
3
|
import { SinglePage } from '@tryfinch/finch-api/pagination';
|
|
4
4
|
export class Providers extends APIResource {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Return details on all available payroll and HR systems.
|
|
7
|
+
*/
|
|
8
|
+
list(options) {
|
|
9
|
+
return this.getAPIList('/providers', ProvidersSinglePage, options);
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
|
-
export class ProvidersSinglePage extends SinglePage {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
export class ProvidersSinglePage extends SinglePage {
|
|
13
|
+
}
|
|
14
|
+
(function (Providers) {
|
|
15
|
+
})(Providers || (Providers = {}));
|
|
16
|
+
//# sourceMappingURL=providers.mjs.map
|
package/resources/top-level.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=top-level.d.ts.map
|
|
2
|
+
//# sourceMappingURL=top-level.d.ts.map
|
package/resources/top-level.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
//# sourceMappingURL=top-level.js.map
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
//# sourceMappingURL=top-level.js.map
|
package/resources/top-level.mjs
CHANGED
package/resources/webhooks.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { APIResource } from '@tryfinch/finch-api/resource';
|
|
2
2
|
import { HeadersLike } from '@tryfinch/finch-api/core';
|
|
3
3
|
export declare class Webhooks extends APIResource {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Validates that the given payload was sent by Finch and parses the payload.
|
|
6
|
+
*/
|
|
7
|
+
unwrap(payload: string, headers: HeadersLike, secret?: string | undefined | null): Object;
|
|
8
|
+
private parseSecret;
|
|
9
|
+
private signPayload;
|
|
10
|
+
/** Make an assertion, if not `true`, then throw. */
|
|
11
|
+
private assert;
|
|
12
|
+
/** Compare to array buffers or data views in a way that timing based attacks
|
|
13
|
+
* cannot gain information about the platform. */
|
|
14
|
+
private timingSafeEqual;
|
|
15
|
+
/**
|
|
16
|
+
* Validates whether or not the webhook payload was sent by Finch.
|
|
17
|
+
*
|
|
18
|
+
* An error will be raised if the webhook payload was not sent by Finch.
|
|
19
|
+
*/
|
|
20
|
+
verifySignature(body: string, headers: HeadersLike, secret?: string | undefined | null): void;
|
|
21
21
|
}
|
|
22
|
-
//# sourceMappingURL=webhooks.d.ts.map
|
|
22
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
package/resources/webhooks.js
CHANGED
|
@@ -1,118 +1,114 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Webhooks = void 0;
|
|
5
|
-
const resource_1 = require(
|
|
6
|
-
const crypto_1 = require(
|
|
7
|
-
const core_1 = require(
|
|
5
|
+
const resource_1 = require("@tryfinch/finch-api/resource");
|
|
6
|
+
const crypto_1 = require("crypto");
|
|
7
|
+
const core_1 = require("@tryfinch/finch-api/core");
|
|
8
8
|
class Webhooks extends resource_1.APIResource {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
parseSecret(secret) {
|
|
17
|
-
if (!secret) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
"The webhook secret must either be set using the env var, FINCH_WEBHOOK_SECRET, on the client class, Finch({ webhook_secret: '123' }), or passed to this function",
|
|
20
|
-
);
|
|
9
|
+
/**
|
|
10
|
+
* Validates that the given payload was sent by Finch and parses the payload.
|
|
11
|
+
*/
|
|
12
|
+
unwrap(payload, headers, secret = this.client.webhookSecret) {
|
|
13
|
+
this.verifySignature(payload, headers, secret);
|
|
14
|
+
return JSON.parse(payload);
|
|
21
15
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
parseSecret(secret) {
|
|
17
|
+
if (!secret) {
|
|
18
|
+
throw new Error("The webhook secret must either be set using the env var, FINCH_WEBHOOK_SECRET, on the client class, Finch({ webhook_secret: '123' }), or passed to this function");
|
|
19
|
+
}
|
|
20
|
+
const buf = Buffer.from(secret, 'base64');
|
|
21
|
+
if (buf.toString('base64') !== secret) {
|
|
22
|
+
throw new Error(`Given secret is not valid`);
|
|
23
|
+
}
|
|
24
|
+
return new Uint8Array(buf);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
hmac.update(toSign);
|
|
33
|
-
return `v1,${hmac.digest('base64')}`;
|
|
34
|
-
}
|
|
35
|
-
/** Make an assertion, if not `true`, then throw. */
|
|
36
|
-
assert(expr, msg = '') {
|
|
37
|
-
if (!expr) {
|
|
38
|
-
throw new Error(msg);
|
|
26
|
+
signPayload(payload, { eventId, timestamp, secret }) {
|
|
27
|
+
const encoder = new TextEncoder();
|
|
28
|
+
const toSign = encoder.encode(`${eventId}.${timestamp.getTime() / 1000}.${payload}`);
|
|
29
|
+
const hmac = (0, crypto_1.createHmac)('sha256', secret);
|
|
30
|
+
hmac.update(toSign);
|
|
31
|
+
return `v1,${hmac.digest('base64')}`;
|
|
39
32
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return false;
|
|
33
|
+
/** Make an assertion, if not `true`, then throw. */
|
|
34
|
+
assert(expr, msg = '') {
|
|
35
|
+
if (!expr) {
|
|
36
|
+
throw new Error(msg);
|
|
37
|
+
}
|
|
46
38
|
}
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
/** Compare to array buffers or data views in a way that timing based attacks
|
|
40
|
+
* cannot gain information about the platform. */
|
|
41
|
+
timingSafeEqual(a, b) {
|
|
42
|
+
if (a.byteLength !== b.byteLength) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
if (!(a instanceof DataView)) {
|
|
46
|
+
a = new DataView(ArrayBuffer.isView(a) ? a.buffer : a);
|
|
47
|
+
}
|
|
48
|
+
if (!(b instanceof DataView)) {
|
|
49
|
+
b = new DataView(ArrayBuffer.isView(b) ? b.buffer : b);
|
|
50
|
+
}
|
|
51
|
+
this.assert(a instanceof DataView);
|
|
52
|
+
this.assert(b instanceof DataView);
|
|
53
|
+
const length = a.byteLength;
|
|
54
|
+
let out = 0;
|
|
55
|
+
let i = -1;
|
|
56
|
+
while (++i < length) {
|
|
57
|
+
out |= a.getUint8(i) ^ b.getUint8(i);
|
|
58
|
+
}
|
|
59
|
+
return out === 0;
|
|
49
60
|
}
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Validates whether or not the webhook payload was sent by Finch.
|
|
63
|
+
*
|
|
64
|
+
* An error will be raised if the webhook payload was not sent by Finch.
|
|
65
|
+
*/
|
|
66
|
+
verifySignature(body, headers, secret = this.client.webhookSecret) {
|
|
67
|
+
const parsedSecret = this.parseSecret(secret);
|
|
68
|
+
const eventId = (0, core_1.getHeader)(headers, 'finch-event-id');
|
|
69
|
+
if (!eventId) {
|
|
70
|
+
throw new Error('Could not find finch-event-id header');
|
|
71
|
+
}
|
|
72
|
+
const msgTimestamp = (0, core_1.getHeader)(headers, 'finch-timestamp');
|
|
73
|
+
if (!msgTimestamp) {
|
|
74
|
+
throw new Error('Could not find finch-timestamp header');
|
|
75
|
+
}
|
|
76
|
+
const msgSignature = (0, core_1.getHeader)(headers, 'finch-signature');
|
|
77
|
+
if (!msgSignature) {
|
|
78
|
+
throw new Error('Could not find finch-signature header');
|
|
79
|
+
}
|
|
80
|
+
const now = Math.floor(Date.now() / 1000);
|
|
81
|
+
const timestampSeconds = parseInt(msgTimestamp, 10);
|
|
82
|
+
if (isNaN(timestampSeconds)) {
|
|
83
|
+
throw new Error(`Invalid timestamp header: ${msgTimestamp}`);
|
|
84
|
+
}
|
|
85
|
+
if (typeof body !== 'string') {
|
|
86
|
+
throw new Error('Webhook body must be passed as the raw JSON string sent from the server (do not parse it first).');
|
|
87
|
+
}
|
|
88
|
+
const webhook_tolerance_in_seconds = 5 * 60; // 5 minutes
|
|
89
|
+
if (now - timestampSeconds > webhook_tolerance_in_seconds) {
|
|
90
|
+
throw new Error('Webhook timestamp is too old');
|
|
91
|
+
}
|
|
92
|
+
if (timestampSeconds > now + webhook_tolerance_in_seconds) {
|
|
93
|
+
throw new Error('Webhook timestamp is too new');
|
|
94
|
+
}
|
|
95
|
+
const timestamp = new Date(timestampSeconds * 1000);
|
|
96
|
+
const computedSignature = this.signPayload(body, { eventId, timestamp, secret: parsedSecret });
|
|
97
|
+
const expectedSignature = computedSignature.split(',')[1];
|
|
98
|
+
const passedSignatures = msgSignature.split(' ');
|
|
99
|
+
const encoder = new globalThis.TextEncoder();
|
|
100
|
+
for (const versionedSignature of passedSignatures) {
|
|
101
|
+
const [version, signature] = versionedSignature.split(',');
|
|
102
|
+
if (version !== 'v1') {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (this.timingSafeEqual(encoder.encode(signature), encoder.encode(expectedSignature))) {
|
|
106
|
+
// valid!
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
throw new Error('None of the given webhook signatures match the expected signature');
|
|
52
111
|
}
|
|
53
|
-
this.assert(a instanceof DataView);
|
|
54
|
-
this.assert(b instanceof DataView);
|
|
55
|
-
const length = a.byteLength;
|
|
56
|
-
let out = 0;
|
|
57
|
-
let i = -1;
|
|
58
|
-
while (++i < length) {
|
|
59
|
-
out |= a.getUint8(i) ^ b.getUint8(i);
|
|
60
|
-
}
|
|
61
|
-
return out === 0;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Validates whether or not the webhook payload was sent by Finch.
|
|
65
|
-
*
|
|
66
|
-
* An error will be raised if the webhook payload was not sent by Finch.
|
|
67
|
-
*/
|
|
68
|
-
verifySignature(body, headers, secret = this.client.webhookSecret) {
|
|
69
|
-
const parsedSecret = this.parseSecret(secret);
|
|
70
|
-
const eventId = (0, core_1.getHeader)(headers, 'finch-event-id');
|
|
71
|
-
if (!eventId) {
|
|
72
|
-
throw new Error('Could not find finch-event-id header');
|
|
73
|
-
}
|
|
74
|
-
const msgTimestamp = (0, core_1.getHeader)(headers, 'finch-timestamp');
|
|
75
|
-
if (!msgTimestamp) {
|
|
76
|
-
throw new Error('Could not find finch-timestamp header');
|
|
77
|
-
}
|
|
78
|
-
const msgSignature = (0, core_1.getHeader)(headers, 'finch-signature');
|
|
79
|
-
if (!msgSignature) {
|
|
80
|
-
throw new Error('Could not find finch-signature header');
|
|
81
|
-
}
|
|
82
|
-
const now = Math.floor(Date.now() / 1000);
|
|
83
|
-
const timestampSeconds = parseInt(msgTimestamp, 10);
|
|
84
|
-
if (isNaN(timestampSeconds)) {
|
|
85
|
-
throw new Error(`Invalid timestamp header: ${msgTimestamp}`);
|
|
86
|
-
}
|
|
87
|
-
if (typeof body !== 'string') {
|
|
88
|
-
throw new Error(
|
|
89
|
-
'Webhook body must be passed as the raw JSON string sent from the server (do not parse it first).',
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
const webhook_tolerance_in_seconds = 5 * 60; // 5 minutes
|
|
93
|
-
if (now - timestampSeconds > webhook_tolerance_in_seconds) {
|
|
94
|
-
throw new Error('Webhook timestamp is too old');
|
|
95
|
-
}
|
|
96
|
-
if (timestampSeconds > now + webhook_tolerance_in_seconds) {
|
|
97
|
-
throw new Error('Webhook timestamp is too new');
|
|
98
|
-
}
|
|
99
|
-
const timestamp = new Date(timestampSeconds * 1000);
|
|
100
|
-
const computedSignature = this.signPayload(body, { eventId, timestamp, secret: parsedSecret });
|
|
101
|
-
const expectedSignature = computedSignature.split(',')[1];
|
|
102
|
-
const passedSignatures = msgSignature.split(' ');
|
|
103
|
-
const encoder = new globalThis.TextEncoder();
|
|
104
|
-
for (const versionedSignature of passedSignatures) {
|
|
105
|
-
const [version, signature] = versionedSignature.split(',');
|
|
106
|
-
if (version !== 'v1') {
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
if (this.timingSafeEqual(encoder.encode(signature), encoder.encode(expectedSignature))) {
|
|
110
|
-
// valid!
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
throw new Error('None of the given webhook signatures match the expected signature');
|
|
115
|
-
}
|
|
116
112
|
}
|
|
117
113
|
exports.Webhooks = Webhooks;
|
|
118
|
-
//# sourceMappingURL=webhooks.js.map
|
|
114
|
+
//# sourceMappingURL=webhooks.js.map
|