@tryfinch/finch-api 5.9.1 → 5.10.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 +13 -0
- package/core.d.ts +0 -10
- package/core.d.ts.map +1 -1
- package/core.js +1 -13
- package/core.js.map +1 -1
- package/core.mjs +0 -11
- package/core.mjs.map +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.ts +1 -7
- package/resource.d.ts.map +1 -1
- package/resource.js +1 -7
- package/resource.js.map +1 -1
- package/resource.mjs +1 -7
- package/resource.mjs.map +1 -1
- package/resources/account.d.ts +4 -0
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +2 -2
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +2 -2
- package/resources/account.mjs.map +1 -1
- package/resources/hris/benefits/benefits.d.ts +65 -1
- package/resources/hris/benefits/benefits.d.ts.map +1 -1
- package/resources/hris/benefits/benefits.js +6 -6
- package/resources/hris/benefits/benefits.js.map +1 -1
- package/resources/hris/benefits/benefits.mjs +6 -6
- package/resources/hris/benefits/benefits.mjs.map +1 -1
- package/resources/hris/benefits/index.d.ts +1 -1
- package/resources/hris/benefits/index.d.ts.map +1 -1
- package/resources/hris/benefits/index.js.map +1 -1
- package/resources/hris/benefits/index.mjs.map +1 -1
- package/resources/hris/benefits/individuals.d.ts.map +1 -1
- package/resources/hris/benefits/individuals.js +4 -15
- package/resources/hris/benefits/individuals.js.map +1 -1
- package/resources/hris/benefits/individuals.mjs +4 -15
- package/resources/hris/benefits/individuals.mjs.map +1 -1
- package/resources/hris/company.js +1 -1
- package/resources/hris/company.js.map +1 -1
- package/resources/hris/company.mjs +1 -1
- package/resources/hris/company.mjs.map +1 -1
- package/resources/hris/directory.js +1 -1
- package/resources/hris/directory.js.map +1 -1
- package/resources/hris/directory.mjs +1 -1
- package/resources/hris/directory.mjs.map +1 -1
- package/resources/hris/employments.d.ts +9 -0
- package/resources/hris/employments.d.ts.map +1 -1
- package/resources/hris/employments.js +1 -1
- package/resources/hris/employments.js.map +1 -1
- package/resources/hris/employments.mjs +1 -1
- package/resources/hris/employments.mjs.map +1 -1
- package/resources/hris/hris.d.ts +3 -0
- package/resources/hris/hris.d.ts.map +1 -1
- package/resources/hris/hris.js +7 -7
- package/resources/hris/hris.js.map +1 -1
- package/resources/hris/hris.mjs +7 -7
- package/resources/hris/hris.mjs.map +1 -1
- package/resources/hris/index.d.ts +1 -1
- package/resources/hris/index.d.ts.map +1 -1
- package/resources/hris/index.js.map +1 -1
- package/resources/hris/index.mjs.map +1 -1
- package/resources/hris/individuals.d.ts +4 -0
- package/resources/hris/individuals.d.ts.map +1 -1
- package/resources/hris/individuals.js +1 -1
- package/resources/hris/individuals.js.map +1 -1
- package/resources/hris/individuals.mjs +1 -1
- package/resources/hris/individuals.mjs.map +1 -1
- package/resources/hris/pay-statements.js +1 -1
- package/resources/hris/pay-statements.js.map +1 -1
- package/resources/hris/pay-statements.mjs +1 -1
- package/resources/hris/pay-statements.mjs.map +1 -1
- package/resources/hris/payments.js +1 -1
- package/resources/hris/payments.js.map +1 -1
- package/resources/hris/payments.mjs +1 -1
- package/resources/hris/payments.mjs.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +15 -0
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/providers.d.ts +244 -2
- package/resources/providers.d.ts.map +1 -1
- package/resources/providers.js +1 -1
- package/resources/providers.js.map +1 -1
- package/resources/providers.mjs +1 -1
- package/resources/providers.mjs.map +1 -1
- package/resources/request-forwarding.d.ts +7 -4
- package/resources/request-forwarding.d.ts.map +1 -1
- package/resources/request-forwarding.js +5 -2
- package/resources/request-forwarding.js.map +1 -1
- package/resources/request-forwarding.mjs +5 -2
- package/resources/request-forwarding.mjs.map +1 -1
- package/resources/shared.d.ts +53 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +2 -2
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +2 -2
- package/resources/webhooks.mjs.map +1 -1
- package/src/core.ts +0 -21
- package/src/index.ts +3 -0
- package/src/resource.ts +3 -16
- package/src/resources/account.ts +7 -2
- package/src/resources/hris/benefits/benefits.ts +94 -7
- package/src/resources/hris/benefits/index.ts +3 -0
- package/src/resources/hris/benefits/individuals.ts +16 -15
- package/src/resources/hris/company.ts +1 -1
- package/src/resources/hris/directory.ts +1 -1
- package/src/resources/hris/employments.ts +13 -1
- package/src/resources/hris/hris.ts +10 -7
- package/src/resources/hris/index.ts +3 -0
- package/src/resources/hris/individuals.ts +15 -1
- package/src/resources/hris/pay-statements.ts +1 -1
- package/src/resources/hris/payments.ts +1 -1
- package/src/resources/index.ts +1 -0
- package/src/resources/providers.ts +385 -3
- package/src/resources/request-forwarding.ts +8 -5
- package/src/resources/shared.ts +62 -0
- package/src/resources/webhooks.ts +2 -2
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -5,10 +5,13 @@ exports.RequestForwarding = void 0;
|
|
|
5
5
|
const resource_1 = require("@tryfinch/finch-api/resource");
|
|
6
6
|
class RequestForwarding extends resource_1.APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* The Forward API allows you to make direct requests to an employment system.
|
|
8
|
+
* The Forward API allows you to make direct requests to an employment system. If
|
|
9
|
+
* Finch’s unified API doesn’t have a data model that cleanly fits your needs, then
|
|
10
|
+
* Forward allows you to push or pull data models directly against an integration’s
|
|
11
|
+
* API.
|
|
9
12
|
*/
|
|
10
13
|
forward(body, options) {
|
|
11
|
-
return this.post('/forward', { body, ...options });
|
|
14
|
+
return this._client.post('/forward', { body, ...options });
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
exports.RequestForwarding = RequestForwarding;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-forwarding.js","sourceRoot":"","sources":["../src/resources/request-forwarding.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,2DAA2D;AAG3D,MAAa,iBAAkB,SAAQ,sBAAW;IAChD
|
|
1
|
+
{"version":3,"file":"request-forwarding.js","sourceRoot":"","sources":["../src/resources/request-forwarding.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,2DAA2D;AAG3D,MAAa,iBAAkB,SAAQ,sBAAW;IAChD;;;;;OAKG;IACH,OAAO,CACL,IAAoC,EACpC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF;AAbD,8CAaC;AAqGD,WAAiB,iBAAiB;AAGlC,CAAC,EAHgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAGjC"}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
import { APIResource } from '@tryfinch/finch-api/resource';
|
|
3
3
|
export class RequestForwarding extends APIResource {
|
|
4
4
|
/**
|
|
5
|
-
* The Forward API allows you to make direct requests to an employment system.
|
|
5
|
+
* The Forward API allows you to make direct requests to an employment system. If
|
|
6
|
+
* Finch’s unified API doesn’t have a data model that cleanly fits your needs, then
|
|
7
|
+
* Forward allows you to push or pull data models directly against an integration’s
|
|
8
|
+
* API.
|
|
6
9
|
*/
|
|
7
10
|
forward(body, options) {
|
|
8
|
-
return this.post('/forward', { body, ...options });
|
|
11
|
+
return this._client.post('/forward', { body, ...options });
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
14
|
(function (RequestForwarding) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-forwarding.mjs","sourceRoot":"","sources":["../src/resources/request-forwarding.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,8BAA8B;AAG1D,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD
|
|
1
|
+
{"version":3,"file":"request-forwarding.mjs","sourceRoot":"","sources":["../src/resources/request-forwarding.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,8BAA8B;AAG1D,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD;;;;;OAKG;IACH,OAAO,CACL,IAAoC,EACpC,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF;AAqGD,WAAiB,iBAAiB;AAGlC,CAAC,EAHgB,iBAAiB,KAAjB,iBAAiB,QAGjC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* - `supported`: This operation is supported by both the provider and Finch <br>
|
|
3
|
+
* - `not_supported_by_finch`: This operation is not supported by Finch but
|
|
4
|
+
* supported by the provider <br>
|
|
5
|
+
* - `not_supported_by_provider`: This operation is not supported by the provider,
|
|
6
|
+
* so Finch cannot support <br>
|
|
7
|
+
* - `client_access_only`: This behavior is supported by the provider, but only
|
|
8
|
+
* available to the client and not to Finch
|
|
9
|
+
*/
|
|
10
|
+
export type OperationSupport = 'supported' | 'not_supported_by_finch' | 'not_supported_by_provider' | 'client_access_only';
|
|
11
|
+
export interface OperationSupportMatrix {
|
|
12
|
+
/**
|
|
13
|
+
* - `supported`: This operation is supported by both the provider and Finch <br>
|
|
14
|
+
* - `not_supported_by_finch`: This operation is not supported by Finch but
|
|
15
|
+
* supported by the provider <br>
|
|
16
|
+
* - `not_supported_by_provider`: This operation is not supported by the provider,
|
|
17
|
+
* so Finch cannot support <br>
|
|
18
|
+
* - `client_access_only`: This behavior is supported by the provider, but only
|
|
19
|
+
* available to the client and not to Finch
|
|
20
|
+
*/
|
|
21
|
+
create?: OperationSupport;
|
|
22
|
+
/**
|
|
23
|
+
* - `supported`: This operation is supported by both the provider and Finch <br>
|
|
24
|
+
* - `not_supported_by_finch`: This operation is not supported by Finch but
|
|
25
|
+
* supported by the provider <br>
|
|
26
|
+
* - `not_supported_by_provider`: This operation is not supported by the provider,
|
|
27
|
+
* so Finch cannot support <br>
|
|
28
|
+
* - `client_access_only`: This behavior is supported by the provider, but only
|
|
29
|
+
* available to the client and not to Finch
|
|
30
|
+
*/
|
|
31
|
+
delete?: OperationSupport;
|
|
32
|
+
/**
|
|
33
|
+
* - `supported`: This operation is supported by both the provider and Finch <br>
|
|
34
|
+
* - `not_supported_by_finch`: This operation is not supported by Finch but
|
|
35
|
+
* supported by the provider <br>
|
|
36
|
+
* - `not_supported_by_provider`: This operation is not supported by the provider,
|
|
37
|
+
* so Finch cannot support <br>
|
|
38
|
+
* - `client_access_only`: This behavior is supported by the provider, but only
|
|
39
|
+
* available to the client and not to Finch
|
|
40
|
+
*/
|
|
41
|
+
read?: OperationSupport;
|
|
42
|
+
/**
|
|
43
|
+
* - `supported`: This operation is supported by both the provider and Finch <br>
|
|
44
|
+
* - `not_supported_by_finch`: This operation is not supported by Finch but
|
|
45
|
+
* supported by the provider <br>
|
|
46
|
+
* - `not_supported_by_provider`: This operation is not supported by the provider,
|
|
47
|
+
* so Finch cannot support <br>
|
|
48
|
+
* - `client_access_only`: This behavior is supported by the provider, but only
|
|
49
|
+
* available to the client and not to Finch
|
|
50
|
+
*/
|
|
51
|
+
update?: OperationSupport;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,wBAAwB,GACxB,2BAA2B,GAC3B,oBAAoB,CAAC;AAEzB,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IAExB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":";AAAA,qDAAqD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.mjs","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAAA,qDAAqD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAqB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE1E,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,EACpB,MAAM,GAAE,MAAM,GAAG,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAqB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE1E,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,EACpB,MAAM,GAAE,MAAM,GAAG,SAAS,GAAG,IAAiC,GAC7D,MAAM;IAKT,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,WAAW;IAanB,oDAAoD;IACpD,OAAO,CAAC,MAAM;IAMd;qDACiD;IACjD,OAAO,CAAC,eAAe;IAwBvB;;;;OAIG;IACH,eAAe,CACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,WAAW,EACpB,MAAM,GAAE,MAAM,GAAG,SAAS,GAAG,IAAiC,GAC7D,IAAI;CAkDR"}
|
package/resources/webhooks.js
CHANGED
|
@@ -9,7 +9,7 @@ class Webhooks extends resource_1.APIResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* Validates that the given payload was sent by Finch and parses the payload.
|
|
11
11
|
*/
|
|
12
|
-
unwrap(payload, headers, secret = this.
|
|
12
|
+
unwrap(payload, headers, secret = this._client.webhookSecret) {
|
|
13
13
|
this.verifySignature(payload, headers, secret);
|
|
14
14
|
return JSON.parse(payload);
|
|
15
15
|
}
|
|
@@ -63,7 +63,7 @@ class Webhooks extends resource_1.APIResource {
|
|
|
63
63
|
*
|
|
64
64
|
* An error will be raised if the webhook payload was not sent by Finch.
|
|
65
65
|
*/
|
|
66
|
-
verifySignature(body, headers, secret = this.
|
|
66
|
+
verifySignature(body, headers, secret = this._client.webhookSecret) {
|
|
67
67
|
const parsedSecret = this.parseSecret(secret);
|
|
68
68
|
const eventId = (0, core_1.getRequiredHeader)(headers, 'finch-event-id');
|
|
69
69
|
const msgTimestamp = (0, core_1.getRequiredHeader)(headers, 'finch-timestamp');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAErD,2DAA2D;AAC3D,mCAAoC;AACpC,mDAA0E;AAE1E,MAAa,QAAS,SAAQ,sBAAW;IACvC;;OAEG;IAC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,EAAE,CAAC,CAAC;QAC/F,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE1D,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjD,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;QAC7C,KAAK,MAAM,kBAAkB,IAAI,gBAAgB,EAAE;YACjD,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,IAAI,OAAO,KAAK,IAAI,EAAE;gBACpB,SAAS;aACV;YAED,IAAI,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE;gBACtF,SAAS;gBACT,OAAO;aACR;SACF;QAED,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;CACF;AArID,4BAqIC"}
|
package/resources/webhooks.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export class Webhooks extends APIResource {
|
|
|
6
6
|
/**
|
|
7
7
|
* Validates that the given payload was sent by Finch and parses the payload.
|
|
8
8
|
*/
|
|
9
|
-
unwrap(payload, headers, secret = this.
|
|
9
|
+
unwrap(payload, headers, secret = this._client.webhookSecret) {
|
|
10
10
|
this.verifySignature(payload, headers, secret);
|
|
11
11
|
return JSON.parse(payload);
|
|
12
12
|
}
|
|
@@ -60,7 +60,7 @@ export class Webhooks extends APIResource {
|
|
|
60
60
|
*
|
|
61
61
|
* An error will be raised if the webhook payload was not sent by Finch.
|
|
62
62
|
*/
|
|
63
|
-
verifySignature(body, headers, secret = this.
|
|
63
|
+
verifySignature(body, headers, secret = this._client.webhookSecret) {
|
|
64
64
|
const parsedSecret = this.parseSecret(secret);
|
|
65
65
|
const eventId = getRequiredHeader(headers, 'finch-event-id');
|
|
66
66
|
const msgTimestamp = getRequiredHeader(headers, 'finch-timestamp');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAE9C,EAAE,WAAW,EAAE,MAAM,8BAA8B;OACnD,EAAE,UAAU,EAAE,MAAM,QAAQ;OAC5B,EAAE,iBAAiB,EAAe,MAAM,0BAA0B;AAEzE,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CACJ,OAAe,EACf,OAAoB,EACpB,SAAoC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"webhooks.mjs","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAE9C,EAAE,WAAW,EAAE,MAAM,8BAA8B;OACnD,EAAE,UAAU,EAAE,MAAM,QAAQ;OAC5B,EAAE,iBAAiB,EAAe,MAAM,0BAA0B;AAEzE,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CACJ,OAAe,EACf,OAAoB,EACpB,SAAoC,IAAI,CAAC,OAAO,CAAC,aAAa;QAE9D,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAEO,WAAW,CAAC,MAAiC;QACnD,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CACb,kKAAkK,CACnK,CAAC;SACH;QAED,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC1C,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,MAAM,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;QAED,OAAO,IAAI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C,YAAY;QACzD,IAAI,GAAG,GAAG,gBAAgB,GAAG,4BAA4B,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QAED,IAAI,gBAAgB,GAAG,GAAG,GAAG,4BAA4B,EAAE;YACzD,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;SACjD;QAED,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;QAEpD,MAAM,iBAAiB,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;QAC/F,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE1D,MAAM,gBAAgB,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjD,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,WAAW,EAAE,CAAC;QAC7C,KAAK,MAAM,kBAAkB,IAAI,gBAAgB,EAAE;YACjD,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,kBAAkB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,IAAI,OAAO,KAAK,IAAI,EAAE;gBACpB,SAAS;aACV;YAED,IAAI,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE;gBACtF,SAAS;gBACT,OAAO;aACR;SACF;QAED,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;CACF"}
|
package/src/core.ts
CHANGED
|
@@ -555,27 +555,6 @@ export abstract class APIClient {
|
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
|
|
558
|
-
export class APIResource {
|
|
559
|
-
protected client: APIClient;
|
|
560
|
-
constructor(client: APIClient) {
|
|
561
|
-
this.client = client;
|
|
562
|
-
|
|
563
|
-
this.get = client.get.bind(client);
|
|
564
|
-
this.post = client.post.bind(client);
|
|
565
|
-
this.patch = client.patch.bind(client);
|
|
566
|
-
this.put = client.put.bind(client);
|
|
567
|
-
this.delete = client.delete.bind(client);
|
|
568
|
-
this.getAPIList = client.getAPIList.bind(client);
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
protected get: APIClient['get'];
|
|
572
|
-
protected post: APIClient['post'];
|
|
573
|
-
protected patch: APIClient['patch'];
|
|
574
|
-
protected put: APIClient['put'];
|
|
575
|
-
protected delete: APIClient['delete'];
|
|
576
|
-
protected getAPIList: APIClient['getAPIList'];
|
|
577
|
-
}
|
|
578
|
-
|
|
579
558
|
export type PageInfo = { url: URL } | { params: Record<string, unknown> | null };
|
|
580
559
|
|
|
581
560
|
export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
package/src/index.ts
CHANGED
|
@@ -297,6 +297,9 @@ export namespace Finch {
|
|
|
297
297
|
export import RequestForwarding = API.RequestForwarding;
|
|
298
298
|
export import RequestForwardingForwardResponse = API.RequestForwardingForwardResponse;
|
|
299
299
|
export import RequestForwardingForwardParams = API.RequestForwardingForwardParams;
|
|
300
|
+
|
|
301
|
+
export import OperationSupport = API.OperationSupport;
|
|
302
|
+
export import OperationSupportMatrix = API.OperationSupportMatrix;
|
|
300
303
|
}
|
|
301
304
|
|
|
302
305
|
export default Finch;
|
package/src/resource.ts
CHANGED
|
@@ -3,22 +3,9 @@
|
|
|
3
3
|
import type { Finch } from './index';
|
|
4
4
|
|
|
5
5
|
export class APIResource {
|
|
6
|
-
protected
|
|
7
|
-
constructor(client: Finch) {
|
|
8
|
-
this.client = client;
|
|
6
|
+
protected _client: Finch;
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
this.
|
|
12
|
-
this.patch = client.patch.bind(client);
|
|
13
|
-
this.put = client.put.bind(client);
|
|
14
|
-
this.delete = client.delete.bind(client);
|
|
15
|
-
this.getAPIList = client.getAPIList.bind(client);
|
|
8
|
+
constructor(client: Finch) {
|
|
9
|
+
this._client = client;
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
protected get: Finch['get'];
|
|
19
|
-
protected post: Finch['post'];
|
|
20
|
-
protected patch: Finch['patch'];
|
|
21
|
-
protected put: Finch['put'];
|
|
22
|
-
protected delete: Finch['delete'];
|
|
23
|
-
protected getAPIList: Finch['getAPIList'];
|
|
24
11
|
}
|
package/src/resources/account.ts
CHANGED
|
@@ -11,14 +11,14 @@ export class Account extends APIResource {
|
|
|
11
11
|
* Disconnect endpoint for billing and security purposes.
|
|
12
12
|
*/
|
|
13
13
|
disconnect(options?: Core.RequestOptions): Core.APIPromise<DisconnectResponse> {
|
|
14
|
-
return this.post('/disconnect', options);
|
|
14
|
+
return this._client.post('/disconnect', options);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Read account information associated with an `access_token`
|
|
19
19
|
*/
|
|
20
20
|
introspect(options?: Core.RequestOptions): Core.APIPromise<Introspection> {
|
|
21
|
-
return this.get('/introspect', options);
|
|
21
|
+
return this._client.get('/introspect', options);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -30,6 +30,11 @@ export interface DisconnectResponse {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export interface Introspection {
|
|
33
|
+
/**
|
|
34
|
+
* The Finch uuid of the account used to connect this company.
|
|
35
|
+
*/
|
|
36
|
+
account_id: string;
|
|
37
|
+
|
|
33
38
|
/**
|
|
34
39
|
* The client id of the application associated with the `access_token`.
|
|
35
40
|
*/
|
|
@@ -4,11 +4,12 @@ import * as Core from "../../../core";
|
|
|
4
4
|
import { APIResource } from "../../../resource";
|
|
5
5
|
import { isRequestOptions } from "../../../core";
|
|
6
6
|
import * as BenefitsAPI from "./benefits";
|
|
7
|
+
import * as Shared from "../../shared";
|
|
7
8
|
import * as IndividualsAPI from "./individuals";
|
|
8
9
|
import { SinglePage } from "../../../pagination";
|
|
9
10
|
|
|
10
11
|
export class Benefits extends APIResource {
|
|
11
|
-
individuals: IndividualsAPI.Individuals = new IndividualsAPI.Individuals(this.
|
|
12
|
+
individuals: IndividualsAPI.Individuals = new IndividualsAPI.Individuals(this._client);
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* **Availability: Automated and Assisted Benefits providers**
|
|
@@ -28,7 +29,7 @@ export class Benefits extends APIResource {
|
|
|
28
29
|
if (isRequestOptions(body)) {
|
|
29
30
|
return this.create({}, body);
|
|
30
31
|
}
|
|
31
|
-
return this.post('/employer/benefits', { body, ...options });
|
|
32
|
+
return this._client.post('/employer/benefits', { body, ...options });
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -37,7 +38,7 @@ export class Benefits extends APIResource {
|
|
|
37
38
|
* Lists benefit information for a given benefit
|
|
38
39
|
*/
|
|
39
40
|
retrieve(benefitId: string, options?: Core.RequestOptions): Core.APIPromise<CompanyBenefit> {
|
|
40
|
-
return this.get(`/employer/benefits/${benefitId}`, options);
|
|
41
|
+
return this._client.get(`/employer/benefits/${benefitId}`, options);
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/**
|
|
@@ -59,7 +60,7 @@ export class Benefits extends APIResource {
|
|
|
59
60
|
if (isRequestOptions(body)) {
|
|
60
61
|
return this.update(benefitId, {}, body);
|
|
61
62
|
}
|
|
62
|
-
return this.post(`/employer/benefits/${benefitId}`, { body, ...options });
|
|
63
|
+
return this._client.post(`/employer/benefits/${benefitId}`, { body, ...options });
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
/**
|
|
@@ -68,7 +69,7 @@ export class Benefits extends APIResource {
|
|
|
68
69
|
* List all company-wide benefits.
|
|
69
70
|
*/
|
|
70
71
|
list(options?: Core.RequestOptions): Core.PagePromise<CompanyBenefitsSinglePage, CompanyBenefit> {
|
|
71
|
-
return this.getAPIList('/employer/benefits', CompanyBenefitsSinglePage, options);
|
|
72
|
+
return this._client.getAPIList('/employer/benefits', CompanyBenefitsSinglePage, options);
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
/**
|
|
@@ -80,7 +81,7 @@ export class Benefits extends APIResource {
|
|
|
80
81
|
listSupportedBenefits(
|
|
81
82
|
options?: Core.RequestOptions,
|
|
82
83
|
): Core.PagePromise<SupportedBenefitsSinglePage, SupportedBenefit> {
|
|
83
|
-
return this.getAPIList('/employer/benefits/meta', SupportedBenefitsSinglePage, options);
|
|
84
|
+
return this._client.getAPIList('/employer/benefits/meta', SupportedBenefitsSinglePage, options);
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -100,7 +101,53 @@ export interface BenefitContribution {
|
|
|
100
101
|
type?: 'fixed' | 'percent' | null;
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
export
|
|
104
|
+
export interface BenefitFeaturesAndOperations {
|
|
105
|
+
supported_features?: BenefitFeaturesAndOperations.SupportedFeatures;
|
|
106
|
+
|
|
107
|
+
supported_operations?: SupportPerBenefitType;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export namespace BenefitFeaturesAndOperations {
|
|
111
|
+
export interface SupportedFeatures {
|
|
112
|
+
/**
|
|
113
|
+
* Whether the provider supports an annual maximum for this benefit.
|
|
114
|
+
*/
|
|
115
|
+
annual_maximum?: boolean | null;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Whether the provider supports catch up for this benefit. This field will only be
|
|
119
|
+
* true for retirement benefits.
|
|
120
|
+
*/
|
|
121
|
+
catch_up?: boolean | null;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Supported contribution types. An empty array indicates contributions are not
|
|
125
|
+
* supported.
|
|
126
|
+
*/
|
|
127
|
+
company_contribution?: Array<'fixed' | 'percent'> | null;
|
|
128
|
+
|
|
129
|
+
description?: string | null;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Supported deduction types. An empty array indicates deductions are not
|
|
133
|
+
* supported.
|
|
134
|
+
*/
|
|
135
|
+
employee_deduction?: Array<'fixed' | 'percent'> | null;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The list of frequencies supported by the provider for this benefit
|
|
139
|
+
*/
|
|
140
|
+
frequencies?: Array<BenefitsAPI.BenefitFrequency | null>;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Whether the provider supports HSA contribution limits. Empty if this feature is
|
|
144
|
+
* not supported for the benefit. This array only has values for HSA benefits.
|
|
145
|
+
*/
|
|
146
|
+
hsa_contribution_limit?: Array<'individual' | 'family'> | null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type BenefitFrequency = 'one_time' | 'every_paycheck' | 'monthly' | null;
|
|
104
151
|
|
|
105
152
|
/**
|
|
106
153
|
* Type of benefit.
|
|
@@ -127,6 +174,37 @@ export type BenefitType =
|
|
|
127
174
|
| 'custom_pre_tax'
|
|
128
175
|
| null;
|
|
129
176
|
|
|
177
|
+
/**
|
|
178
|
+
* Each benefit type and their supported features. If the benefit type is not
|
|
179
|
+
* supported, the property will be null
|
|
180
|
+
*/
|
|
181
|
+
export interface BenefitsSupport {
|
|
182
|
+
commuter?: BenefitFeaturesAndOperations | null;
|
|
183
|
+
|
|
184
|
+
custom_post_tax?: BenefitFeaturesAndOperations | null;
|
|
185
|
+
|
|
186
|
+
custom_pre_tax?: BenefitFeaturesAndOperations | null;
|
|
187
|
+
|
|
188
|
+
fsa_dependent_care?: BenefitFeaturesAndOperations | null;
|
|
189
|
+
|
|
190
|
+
fsa_medical?: BenefitFeaturesAndOperations | null;
|
|
191
|
+
|
|
192
|
+
hsa_post?: BenefitFeaturesAndOperations | null;
|
|
193
|
+
|
|
194
|
+
hsa_pre?: BenefitFeaturesAndOperations | null;
|
|
195
|
+
|
|
196
|
+
s125_dental?: BenefitFeaturesAndOperations | null;
|
|
197
|
+
|
|
198
|
+
s125_medical?: BenefitFeaturesAndOperations | null;
|
|
199
|
+
|
|
200
|
+
s125_vision?: BenefitFeaturesAndOperations | null;
|
|
201
|
+
|
|
202
|
+
simple?: BenefitFeaturesAndOperations | null;
|
|
203
|
+
|
|
204
|
+
simple_ira?: BenefitFeaturesAndOperations | null;
|
|
205
|
+
[k: string]: BenefitFeaturesAndOperations | null;
|
|
206
|
+
}
|
|
207
|
+
|
|
130
208
|
/**
|
|
131
209
|
* @deprecated use `BenefitContribution` instead
|
|
132
210
|
*/
|
|
@@ -153,6 +231,12 @@ export interface CreateCompanyBenefitsResponse {
|
|
|
153
231
|
benefit_id: string;
|
|
154
232
|
}
|
|
155
233
|
|
|
234
|
+
export interface SupportPerBenefitType {
|
|
235
|
+
company_benefits?: Shared.OperationSupportMatrix;
|
|
236
|
+
|
|
237
|
+
individual_benefits?: Shared.OperationSupportMatrix;
|
|
238
|
+
}
|
|
239
|
+
|
|
156
240
|
export interface SupportedBenefit {
|
|
157
241
|
/**
|
|
158
242
|
* Whether the provider supports an annual maximum for this benefit.
|
|
@@ -220,14 +304,17 @@ export interface BenefitUpdateParams {
|
|
|
220
304
|
|
|
221
305
|
export namespace Benefits {
|
|
222
306
|
export import BenefitContribution = BenefitsAPI.BenefitContribution;
|
|
307
|
+
export import BenefitFeaturesAndOperations = BenefitsAPI.BenefitFeaturesAndOperations;
|
|
223
308
|
export import BenefitFrequency = BenefitsAPI.BenefitFrequency;
|
|
224
309
|
export import BenefitType = BenefitsAPI.BenefitType;
|
|
310
|
+
export import BenefitsSupport = BenefitsAPI.BenefitsSupport;
|
|
225
311
|
/**
|
|
226
312
|
* @deprecated use `BenefitContribution` instead
|
|
227
313
|
*/
|
|
228
314
|
export import BenfitContribution = BenefitsAPI.BenfitContribution;
|
|
229
315
|
export import CompanyBenefit = BenefitsAPI.CompanyBenefit;
|
|
230
316
|
export import CreateCompanyBenefitsResponse = BenefitsAPI.CreateCompanyBenefitsResponse;
|
|
317
|
+
export import SupportPerBenefitType = BenefitsAPI.SupportPerBenefitType;
|
|
231
318
|
export import SupportedBenefit = BenefitsAPI.SupportedBenefit;
|
|
232
319
|
export import UpdateCompanyBenefitResponse = BenefitsAPI.UpdateCompanyBenefitResponse;
|
|
233
320
|
export import CompanyBenefitsSinglePage = BenefitsAPI.CompanyBenefitsSinglePage;
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
4
|
BenefitContribution,
|
|
5
|
+
BenefitFeaturesAndOperations,
|
|
5
6
|
BenefitFrequency,
|
|
6
7
|
BenefitType,
|
|
8
|
+
BenefitsSupport,
|
|
7
9
|
BenfitContribution,
|
|
8
10
|
CompanyBenefit,
|
|
9
11
|
CreateCompanyBenefitsResponse,
|
|
12
|
+
SupportPerBenefitType,
|
|
10
13
|
SupportedBenefit,
|
|
11
14
|
UpdateCompanyBenefitResponse,
|
|
12
15
|
BenefitCreateParams,
|
|
@@ -25,11 +25,11 @@ export class Individuals extends APIResource {
|
|
|
25
25
|
body: IndividualEnrollManyParams,
|
|
26
26
|
options?: Core.RequestOptions,
|
|
27
27
|
): Core.PagePromise<EnrolledIndividualsSinglePage, EnrolledIndividual> {
|
|
28
|
-
return this.getAPIList(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
...options,
|
|
32
|
-
|
|
28
|
+
return this._client.getAPIList(
|
|
29
|
+
`/employer/benefits/${benefitId}/individuals`,
|
|
30
|
+
EnrolledIndividualsSinglePage,
|
|
31
|
+
{ body, method: 'post', ...options },
|
|
32
|
+
);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -41,7 +41,7 @@ export class Individuals extends APIResource {
|
|
|
41
41
|
benefitId: string,
|
|
42
42
|
options?: Core.RequestOptions,
|
|
43
43
|
): Core.APIPromise<IndividualEnrolledIDsResponse> {
|
|
44
|
-
return this.get(`/employer/benefits/${benefitId}/enrolled`, options);
|
|
44
|
+
return this._client.get(`/employer/benefits/${benefitId}/enrolled`, options);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -66,10 +66,11 @@ export class Individuals extends APIResource {
|
|
|
66
66
|
if (isRequestOptions(query)) {
|
|
67
67
|
return this.retrieveManyBenefits(benefitId, {}, query);
|
|
68
68
|
}
|
|
69
|
-
return this.getAPIList(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
return this._client.getAPIList(
|
|
70
|
+
`/employer/benefits/${benefitId}/individuals`,
|
|
71
|
+
IndividualBenefitsSinglePage,
|
|
72
|
+
{ query, ...options },
|
|
73
|
+
);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
/**
|
|
@@ -94,11 +95,11 @@ export class Individuals extends APIResource {
|
|
|
94
95
|
if (isRequestOptions(body)) {
|
|
95
96
|
return this.unenrollMany(benefitId, {}, body);
|
|
96
97
|
}
|
|
97
|
-
return this.getAPIList(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
...options,
|
|
101
|
-
|
|
98
|
+
return this._client.getAPIList(
|
|
99
|
+
`/employer/benefits/${benefitId}/individuals`,
|
|
100
|
+
UnenrolledIndividualsSinglePage,
|
|
101
|
+
{ body, method: 'delete', ...options },
|
|
102
|
+
);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
|
|
@@ -10,7 +10,7 @@ export class CompanyResource extends APIResource {
|
|
|
10
10
|
* Read basic company data
|
|
11
11
|
*/
|
|
12
12
|
retrieve(options?: Core.RequestOptions): Core.APIPromise<Company> {
|
|
13
|
-
return this.get('/employer/company', options);
|
|
13
|
+
return this._client.get('/employer/company', options);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@ export class Directory extends APIResource {
|
|
|
22
22
|
if (isRequestOptions(query)) {
|
|
23
23
|
return this.list({}, query);
|
|
24
24
|
}
|
|
25
|
-
return this.getAPIList('/employer/directory', IndividualsPage, { query, ...options });
|
|
25
|
+
return this._client.getAPIList('/employer/directory', IndividualsPage, { query, ...options });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -18,7 +18,7 @@ export class Employments extends APIResource {
|
|
|
18
18
|
body: EmploymentRetrieveManyParams,
|
|
19
19
|
options?: Core.RequestOptions,
|
|
20
20
|
): Core.PagePromise<EmploymentDataResponsesPage, EmploymentDataResponse> {
|
|
21
|
-
return this.getAPIList('/employer/employment', EmploymentDataResponsesPage, {
|
|
21
|
+
return this._client.getAPIList('/employer/employment', EmploymentDataResponsesPage, {
|
|
22
22
|
body,
|
|
23
23
|
method: 'post',
|
|
24
24
|
...options,
|
|
@@ -39,6 +39,12 @@ export interface EmploymentData {
|
|
|
39
39
|
*/
|
|
40
40
|
class_code?: string | null;
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Custom fields for the individual. These are fields which are defined by the
|
|
44
|
+
* employer in the system.
|
|
45
|
+
*/
|
|
46
|
+
custom_fields?: Array<EmploymentData.CustomField> | null;
|
|
47
|
+
|
|
42
48
|
/**
|
|
43
49
|
* The department object.
|
|
44
50
|
*/
|
|
@@ -122,6 +128,12 @@ export interface EmploymentData {
|
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
export namespace EmploymentData {
|
|
131
|
+
export interface CustomField {
|
|
132
|
+
name?: string;
|
|
133
|
+
|
|
134
|
+
value?: unknown;
|
|
135
|
+
}
|
|
136
|
+
|
|
125
137
|
/**
|
|
126
138
|
* The department object.
|
|
127
139
|
*/
|
|
@@ -11,13 +11,13 @@ import * as PaymentsAPI from "./payments";
|
|
|
11
11
|
import * as BenefitsAPI from "./benefits/benefits";
|
|
12
12
|
|
|
13
13
|
export class HRIS extends APIResource {
|
|
14
|
-
company: CompanyAPI.CompanyResource = new CompanyAPI.CompanyResource(this.
|
|
15
|
-
directory: DirectoryAPI.Directory = new DirectoryAPI.Directory(this.
|
|
16
|
-
individuals: IndividualsAPI.Individuals = new IndividualsAPI.Individuals(this.
|
|
17
|
-
employments: EmploymentsAPI.Employments = new EmploymentsAPI.Employments(this.
|
|
18
|
-
payments: PaymentsAPI.Payments = new PaymentsAPI.Payments(this.
|
|
19
|
-
payStatements: PayStatementsAPI.PayStatements = new PayStatementsAPI.PayStatements(this.
|
|
20
|
-
benefits: BenefitsAPI.Benefits = new BenefitsAPI.Benefits(this.
|
|
14
|
+
company: CompanyAPI.CompanyResource = new CompanyAPI.CompanyResource(this._client);
|
|
15
|
+
directory: DirectoryAPI.Directory = new DirectoryAPI.Directory(this._client);
|
|
16
|
+
individuals: IndividualsAPI.Individuals = new IndividualsAPI.Individuals(this._client);
|
|
17
|
+
employments: EmploymentsAPI.Employments = new EmploymentsAPI.Employments(this._client);
|
|
18
|
+
payments: PaymentsAPI.Payments = new PaymentsAPI.Payments(this._client);
|
|
19
|
+
payStatements: PayStatementsAPI.PayStatements = new PayStatementsAPI.PayStatements(this._client);
|
|
20
|
+
benefits: BenefitsAPI.Benefits = new BenefitsAPI.Benefits(this._client);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -148,14 +148,17 @@ export namespace HRIS {
|
|
|
148
148
|
export import PayStatementRetrieveManyParams = PayStatementsAPI.PayStatementRetrieveManyParams;
|
|
149
149
|
export import Benefits = BenefitsAPI.Benefits;
|
|
150
150
|
export import BenefitContribution = BenefitsAPI.BenefitContribution;
|
|
151
|
+
export import BenefitFeaturesAndOperations = BenefitsAPI.BenefitFeaturesAndOperations;
|
|
151
152
|
export import BenefitFrequency = BenefitsAPI.BenefitFrequency;
|
|
152
153
|
export import BenefitType = BenefitsAPI.BenefitType;
|
|
154
|
+
export import BenefitsSupport = BenefitsAPI.BenefitsSupport;
|
|
153
155
|
/**
|
|
154
156
|
* @deprecated use `BenefitContribution` instead
|
|
155
157
|
*/
|
|
156
158
|
export import BenfitContribution = BenefitsAPI.BenfitContribution;
|
|
157
159
|
export import CompanyBenefit = BenefitsAPI.CompanyBenefit;
|
|
158
160
|
export import CreateCompanyBenefitsResponse = BenefitsAPI.CreateCompanyBenefitsResponse;
|
|
161
|
+
export import SupportPerBenefitType = BenefitsAPI.SupportPerBenefitType;
|
|
159
162
|
export import SupportedBenefit = BenefitsAPI.SupportedBenefit;
|
|
160
163
|
export import UpdateCompanyBenefitResponse = BenefitsAPI.UpdateCompanyBenefitResponse;
|
|
161
164
|
export import CompanyBenefitsSinglePage = BenefitsAPI.CompanyBenefitsSinglePage;
|