@tryfinch/finch-api 9.9.0 → 9.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/account.d.mts +40 -1
  11. package/resources/account.d.mts.map +1 -1
  12. package/resources/account.d.ts +40 -1
  13. package/resources/account.d.ts.map +1 -1
  14. package/resources/account.js +29 -0
  15. package/resources/account.js.map +1 -1
  16. package/resources/account.mjs +29 -0
  17. package/resources/account.mjs.map +1 -1
  18. package/resources/hris/benefits/benefits.d.mts +37 -1
  19. package/resources/hris/benefits/benefits.d.mts.map +1 -1
  20. package/resources/hris/benefits/benefits.d.ts +37 -1
  21. package/resources/hris/benefits/benefits.d.ts.map +1 -1
  22. package/resources/hris/benefits/benefits.js +19 -0
  23. package/resources/hris/benefits/benefits.js.map +1 -1
  24. package/resources/hris/benefits/benefits.mjs +19 -0
  25. package/resources/hris/benefits/benefits.mjs.map +1 -1
  26. package/resources/hris/benefits/index.d.mts +1 -1
  27. package/resources/hris/benefits/index.d.mts.map +1 -1
  28. package/resources/hris/benefits/index.d.ts +1 -1
  29. package/resources/hris/benefits/index.d.ts.map +1 -1
  30. package/resources/hris/benefits/index.js.map +1 -1
  31. package/resources/hris/benefits/index.mjs.map +1 -1
  32. package/resources/hris/directory.d.mts +1 -9
  33. package/resources/hris/directory.d.mts.map +1 -1
  34. package/resources/hris/directory.d.ts +1 -9
  35. package/resources/hris/directory.d.ts.map +1 -1
  36. package/resources/hris/hris.d.mts +2 -2
  37. package/resources/hris/hris.d.mts.map +1 -1
  38. package/resources/hris/hris.d.ts +2 -2
  39. package/resources/hris/hris.d.ts.map +1 -1
  40. package/resources/hris/hris.js.map +1 -1
  41. package/resources/hris/hris.mjs.map +1 -1
  42. package/resources/hris/index.d.mts +1 -1
  43. package/resources/hris/index.d.mts.map +1 -1
  44. package/resources/hris/index.d.ts +1 -1
  45. package/resources/hris/index.d.ts.map +1 -1
  46. package/resources/hris/index.js.map +1 -1
  47. package/resources/hris/index.mjs.map +1 -1
  48. package/resources/index.d.mts +1 -1
  49. package/resources/index.d.mts.map +1 -1
  50. package/resources/index.d.ts +1 -1
  51. package/resources/index.d.ts.map +1 -1
  52. package/resources/index.js.map +1 -1
  53. package/resources/index.mjs +1 -1
  54. package/resources/index.mjs.map +1 -1
  55. package/src/client.ts +9 -1
  56. package/src/resources/account.ts +53 -1
  57. package/src/resources/hris/benefits/benefits.ts +56 -0
  58. package/src/resources/hris/benefits/index.ts +2 -0
  59. package/src/resources/hris/directory.ts +1 -11
  60. package/src/resources/hris/hris.ts +4 -0
  61. package/src/resources/hris/index.ts +2 -0
  62. package/src/resources/index.ts +7 -1
  63. package/src/version.ts +1 -1
  64. package/version.d.mts +1 -1
  65. package/version.d.mts.map +1 -1
  66. package/version.d.ts +1 -1
  67. package/version.d.ts.map +1 -1
  68. package/version.js +1 -1
  69. package/version.js.map +1 -1
  70. package/version.mjs +1 -1
  71. package/version.mjs.map +1 -1
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export * from "./shared.mjs";
3
3
  export { AccessTokens } from "./access-tokens.mjs";
4
- export { Account } from "./account.mjs";
4
+ export { Account, } from "./account.mjs";
5
5
  export { Connect } from "./connect/connect.mjs";
6
6
  export { HRIS } from "./hris/hris.mjs";
7
7
  export { Jobs } from "./jobs/jobs.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EAAE,YAAY,EAAgE;OAC9E,EAAE,OAAO,EAA+C;OACxD,EAAE,OAAO,EAAE;OACX,EAAE,IAAI,EAA0C;OAChD,EAAE,IAAI,EAAE;OACR,EAAE,OAAO,EAAE;OACX,EACL,SAAS,GAIV;OACM,EACL,iBAAiB,GAGlB;OACM,EAAE,OAAO,EAAE;OACX,EACL,QAAQ,GAWT"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,EAAE,YAAY,EAAgE;OAC9E,EACL,OAAO,GAKR;OACM,EAAE,OAAO,EAAE;OACX,EAAE,IAAI,EAA0C;OAChD,EAAE,IAAI,EAAE;OACR,EAAE,OAAO,EAAE;OACX,EACL,SAAS,GAIV;OACM,EACL,iBAAiB,GAGlB;OACM,EAAE,OAAO,EAAE;OACX,EACL,QAAQ,GAWT"}
package/src/client.ts CHANGED
@@ -28,7 +28,13 @@ import * as Uploads from './core/uploads';
28
28
  import * as API from './resources/index';
29
29
  import { APIPromise } from './core/api-promise';
30
30
  import { AccessTokenCreateParams, AccessTokens, CreateAccessTokenResponse } from './resources/access-tokens';
31
- import { Account, DisconnectResponse, Introspection } from './resources/account';
31
+ import {
32
+ Account,
33
+ AccountDisconnectEntityParams,
34
+ DisconnectEntityResponse,
35
+ DisconnectResponse,
36
+ Introspection,
37
+ } from './resources/account';
32
38
  import {
33
39
  Provider,
34
40
  ProviderListResponse,
@@ -967,8 +973,10 @@ export declare namespace Finch {
967
973
 
968
974
  export {
969
975
  Account as Account,
976
+ type DisconnectEntityResponse as DisconnectEntityResponse,
970
977
  type DisconnectResponse as DisconnectResponse,
971
978
  type Introspection as Introspection,
979
+ type AccountDisconnectEntityParams as AccountDisconnectEntityParams,
972
980
  };
973
981
 
974
982
  export {
@@ -8,19 +8,59 @@ import { RequestOptions } from '../internal/request-options';
8
8
  export class Account extends APIResource {
9
9
  /**
10
10
  * Disconnect one or more `access_token`s from your application.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const disconnectResponse =
15
+ * await client.account.disconnect();
16
+ * ```
11
17
  */
12
18
  disconnect(options?: RequestOptions): APIPromise<DisconnectResponse> {
13
19
  return this._client.post('/disconnect', { ...options, __security: { bearerAuth: true } });
14
20
  }
15
21
 
22
+ /**
23
+ * Disconnect entity(s) from a connection without affecting other entities
24
+ * associated with the same connection.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const disconnectEntityResponse =
29
+ * await client.account.disconnectEntity({
30
+ * entity_ids: [
31
+ * '3c90c3cc-0d44-4b50-8888-8dd25736052a',
32
+ * '5e6f7a8b-9c10-4d11-a12b-c13d14e15f16',
33
+ * ],
34
+ * });
35
+ * ```
36
+ */
37
+ disconnectEntity(
38
+ body: AccountDisconnectEntityParams,
39
+ options?: RequestOptions,
40
+ ): APIPromise<DisconnectEntityResponse> {
41
+ return this._client.post('/disconnect-entity', { body, ...options, __security: { bearerAuth: true } });
42
+ }
43
+
16
44
  /**
17
45
  * Read account information associated with an `access_token`
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const introspection = await client.account.introspect();
50
+ * ```
18
51
  */
19
52
  introspect(options?: RequestOptions): APIPromise<Introspection> {
20
53
  return this._client.get('/introspect', { ...options, __security: { bearerAuth: true } });
21
54
  }
22
55
  }
23
56
 
57
+ export interface DisconnectEntityResponse {
58
+ /**
59
+ * If the request is successful, Finch will return "success" (HTTP 200 status).
60
+ */
61
+ status: string;
62
+ }
63
+
24
64
  export interface DisconnectResponse {
25
65
  /**
26
66
  * If the request is successful, Finch will return "success" (HTTP 200 status).
@@ -195,6 +235,18 @@ export namespace Introspection {
195
235
  }
196
236
  }
197
237
 
238
+ export interface AccountDisconnectEntityParams {
239
+ /**
240
+ * Array of entity UUIDs to disconnect. At least one entity ID must be provided.
241
+ */
242
+ entity_ids: Array<string>;
243
+ }
244
+
198
245
  export declare namespace Account {
199
- export { type DisconnectResponse as DisconnectResponse, type Introspection as Introspection };
246
+ export {
247
+ type DisconnectEntityResponse as DisconnectEntityResponse,
248
+ type DisconnectResponse as DisconnectResponse,
249
+ type Introspection as Introspection,
250
+ type AccountDisconnectEntityParams as AccountDisconnectEntityParams,
251
+ };
200
252
  }
@@ -134,6 +134,29 @@ export class Benefits extends APIResource {
134
134
  __security: { bearerAuth: true },
135
135
  });
136
136
  }
137
+
138
+ /**
139
+ * Register existing benefits from the customer on the provider, on Finch's end.
140
+ * Please use the `/provider` endpoint to view available types for each provider.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * const registerCompanyBenefitResponse =
145
+ * await client.hris.benefits.register();
146
+ * ```
147
+ */
148
+ register(
149
+ params: BenefitRegisterParams | null | undefined = {},
150
+ options?: RequestOptions,
151
+ ): APIPromise<RegisterCompanyBenefitResponse> {
152
+ const { entity_ids, ...body } = params ?? {};
153
+ return this._client.post('/employer/benefits/register', {
154
+ query: { entity_ids },
155
+ body,
156
+ ...options,
157
+ __security: { bearerAuth: true },
158
+ });
159
+ }
137
160
  }
138
161
 
139
162
  export type CompanyBenefitsSinglePage = SinglePage<CompanyBenefit>;
@@ -312,6 +335,15 @@ export interface CreateCompanyBenefitsResponse {
312
335
  job_id: string;
313
336
  }
314
337
 
338
+ export interface RegisterCompanyBenefitResponse {
339
+ /**
340
+ * The id of the benefit.
341
+ */
342
+ benefit_id: string;
343
+
344
+ job_id: string;
345
+ }
346
+
315
347
  export interface SupportPerBenefitType {
316
348
  company_benefits?: Shared.OperationSupportMatrix;
317
349
 
@@ -451,6 +483,28 @@ export interface BenefitListSupportedBenefitsParams {
451
483
  entity_ids?: Array<string>;
452
484
  }
453
485
 
486
+ export interface BenefitRegisterParams {
487
+ /**
488
+ * Query param: The entity IDs to specify which entities' data to access.
489
+ */
490
+ entity_ids?: Array<string>;
491
+
492
+ /**
493
+ * Body param
494
+ */
495
+ description?: string;
496
+
497
+ /**
498
+ * Body param: The frequency of the benefit deduction/contribution.
499
+ */
500
+ frequency?: BenefitFrequency | null;
501
+
502
+ /**
503
+ * Body param: Type of benefit.
504
+ */
505
+ type?: BenefitType | null;
506
+ }
507
+
454
508
  Benefits.Individuals = Individuals;
455
509
 
456
510
  export declare namespace Benefits {
@@ -462,6 +516,7 @@ export declare namespace Benefits {
462
516
  type BenefitsSupport as BenefitsSupport,
463
517
  type CompanyBenefit as CompanyBenefit,
464
518
  type CreateCompanyBenefitsResponse as CreateCompanyBenefitsResponse,
519
+ type RegisterCompanyBenefitResponse as RegisterCompanyBenefitResponse,
465
520
  type SupportPerBenefitType as SupportPerBenefitType,
466
521
  type SupportedBenefit as SupportedBenefit,
467
522
  type UpdateCompanyBenefitResponse as UpdateCompanyBenefitResponse,
@@ -473,6 +528,7 @@ export declare namespace Benefits {
473
528
  type BenefitUpdateParams as BenefitUpdateParams,
474
529
  type BenefitListParams as BenefitListParams,
475
530
  type BenefitListSupportedBenefitsParams as BenefitListSupportedBenefitsParams,
531
+ type BenefitRegisterParams as BenefitRegisterParams,
476
532
  };
477
533
 
478
534
  export {
@@ -9,6 +9,7 @@ export {
9
9
  type BenefitsSupport,
10
10
  type CompanyBenefit,
11
11
  type CreateCompanyBenefitsResponse,
12
+ type RegisterCompanyBenefitResponse,
12
13
  type SupportPerBenefitType,
13
14
  type SupportedBenefit,
14
15
  type UpdateCompanyBenefitResponse,
@@ -18,6 +19,7 @@ export {
18
19
  type BenefitUpdateParams,
19
20
  type BenefitListParams,
20
21
  type BenefitListSupportedBenefitsParams,
22
+ type BenefitRegisterParams,
21
23
  type CompanyBenefitsSinglePage,
22
24
  type SupportedBenefitsSinglePage,
23
25
  } from './benefits';
@@ -99,21 +99,11 @@ export interface DirectoryListParams extends IndividualsPageParams {
99
99
  entity_ids?: Array<string>;
100
100
  }
101
101
 
102
- export interface DirectoryListIndividualsParams {
102
+ export interface DirectoryListIndividualsParams extends IndividualsPageParams {
103
103
  /**
104
104
  * The entity IDs to specify which entities' data to access.
105
105
  */
106
106
  entity_ids?: Array<string>;
107
-
108
- /**
109
- * Number of employees to return (defaults to all)
110
- */
111
- limit?: number;
112
-
113
- /**
114
- * Index to start from (defaults to 0)
115
- */
116
- offset?: number;
117
107
  }
118
108
 
119
109
  export declare namespace Directory {
@@ -55,6 +55,7 @@ import {
55
55
  BenefitFrequency,
56
56
  BenefitListParams,
57
57
  BenefitListSupportedBenefitsParams,
58
+ BenefitRegisterParams,
58
59
  BenefitRetrieveParams,
59
60
  BenefitType,
60
61
  BenefitUpdateParams,
@@ -64,6 +65,7 @@ import {
64
65
  CompanyBenefit,
65
66
  CompanyBenefitsSinglePage,
66
67
  CreateCompanyBenefitsResponse,
68
+ RegisterCompanyBenefitResponse,
67
69
  SupportPerBenefitType,
68
70
  SupportedBenefit,
69
71
  SupportedBenefitsSinglePage,
@@ -244,6 +246,7 @@ export declare namespace HRIS {
244
246
  type BenefitsSupport as BenefitsSupport,
245
247
  type CompanyBenefit as CompanyBenefit,
246
248
  type CreateCompanyBenefitsResponse as CreateCompanyBenefitsResponse,
249
+ type RegisterCompanyBenefitResponse as RegisterCompanyBenefitResponse,
247
250
  type SupportPerBenefitType as SupportPerBenefitType,
248
251
  type SupportedBenefit as SupportedBenefit,
249
252
  type UpdateCompanyBenefitResponse as UpdateCompanyBenefitResponse,
@@ -255,5 +258,6 @@ export declare namespace HRIS {
255
258
  type BenefitUpdateParams as BenefitUpdateParams,
256
259
  type BenefitListParams as BenefitListParams,
257
260
  type BenefitListSupportedBenefitsParams as BenefitListSupportedBenefitsParams,
261
+ type BenefitRegisterParams as BenefitRegisterParams,
258
262
  };
259
263
  }
@@ -9,6 +9,7 @@ export {
9
9
  type BenefitsSupport,
10
10
  type CompanyBenefit,
11
11
  type CreateCompanyBenefitsResponse,
12
+ type RegisterCompanyBenefitResponse,
12
13
  type SupportPerBenefitType,
13
14
  type SupportedBenefit,
14
15
  type UpdateCompanyBenefitResponse,
@@ -18,6 +19,7 @@ export {
18
19
  type BenefitUpdateParams,
19
20
  type BenefitListParams,
20
21
  type BenefitListSupportedBenefitsParams,
22
+ type BenefitRegisterParams,
21
23
  type CompanyBenefitsSinglePage,
22
24
  type SupportedBenefitsSinglePage,
23
25
  } from './benefits/index';
@@ -2,7 +2,13 @@
2
2
 
3
3
  export * from './shared';
4
4
  export { AccessTokens, type CreateAccessTokenResponse, type AccessTokenCreateParams } from './access-tokens';
5
- export { Account, type DisconnectResponse, type Introspection } from './account';
5
+ export {
6
+ Account,
7
+ type DisconnectEntityResponse,
8
+ type DisconnectResponse,
9
+ type Introspection,
10
+ type AccountDisconnectEntityParams,
11
+ } from './account';
6
12
  export { Connect } from './connect/connect';
7
13
  export { HRIS, type Income, type Location, type Money } from './hris/hris';
8
14
  export { Jobs } from './jobs/jobs';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '9.9.0'; // x-release-please-version
1
+ export const VERSION = '9.10.1'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "9.9.0";
1
+ export declare const VERSION = "9.10.1";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "9.9.0";
1
+ export declare const VERSION = "9.10.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '9.9.0'; // x-release-please-version
4
+ exports.VERSION = '9.10.1'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '9.9.0'; // x-release-please-version
1
+ export const VERSION = '9.10.1'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map
package/version.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}