@tryfinch/finch-api 6.18.0 → 6.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +1 -1
  3. package/core.js +2 -1
  4. package/core.js.map +1 -1
  5. package/core.mjs +2 -1
  6. package/core.mjs.map +1 -1
  7. package/package.json +8 -29
  8. package/resources/connect.d.ts +2 -0
  9. package/resources/connect.d.ts.map +1 -0
  10. package/resources/connect.js +19 -0
  11. package/resources/connect.js.map +1 -0
  12. package/resources/connect.mjs +3 -0
  13. package/resources/connect.mjs.map +1 -0
  14. package/resources/hris/benefits/benefits.d.ts +5 -5
  15. package/resources/hris/benefits/benefits.d.ts.map +1 -1
  16. package/resources/hris/benefits/index.d.ts +1 -1
  17. package/resources/hris/benefits/index.d.ts.map +1 -1
  18. package/resources/hris/benefits.d.ts +2 -0
  19. package/resources/hris/benefits.d.ts.map +1 -0
  20. package/resources/hris/benefits.js +19 -0
  21. package/resources/hris/benefits.js.map +1 -0
  22. package/resources/hris/benefits.mjs +3 -0
  23. package/resources/hris/benefits.mjs.map +1 -0
  24. package/resources/hris/documents.d.ts +5 -5
  25. package/resources/hris/documents.d.ts.map +1 -1
  26. package/resources/hris/documents.js +2 -2
  27. package/resources/hris/documents.mjs +2 -2
  28. package/resources/hris/hris.d.ts +1 -1
  29. package/resources/hris/hris.d.ts.map +1 -1
  30. package/resources/hris/index.d.ts +1 -1
  31. package/resources/hris/index.d.ts.map +1 -1
  32. package/resources/hris.d.ts +2 -0
  33. package/resources/hris.d.ts.map +1 -0
  34. package/resources/hris.js +19 -0
  35. package/resources/hris.js.map +1 -0
  36. package/resources/hris.mjs +3 -0
  37. package/resources/hris.mjs.map +1 -0
  38. package/resources/jobs/automated.d.ts +44 -7
  39. package/resources/jobs/automated.d.ts.map +1 -1
  40. package/resources/jobs/automated.js +2 -7
  41. package/resources/jobs/automated.js.map +1 -1
  42. package/resources/jobs/automated.mjs +1 -5
  43. package/resources/jobs/automated.mjs.map +1 -1
  44. package/resources/jobs/index.d.ts +1 -1
  45. package/resources/jobs/index.d.ts.map +1 -1
  46. package/resources/jobs/index.js +1 -2
  47. package/resources/jobs/index.js.map +1 -1
  48. package/resources/jobs/index.mjs +1 -1
  49. package/resources/jobs/index.mjs.map +1 -1
  50. package/resources/jobs/jobs.d.ts +2 -2
  51. package/resources/jobs/jobs.d.ts.map +1 -1
  52. package/resources/jobs/jobs.js +0 -1
  53. package/resources/jobs/jobs.js.map +1 -1
  54. package/resources/jobs/jobs.mjs +1 -2
  55. package/resources/jobs/jobs.mjs.map +1 -1
  56. package/resources/jobs.d.ts +2 -0
  57. package/resources/jobs.d.ts.map +1 -0
  58. package/resources/jobs.js +19 -0
  59. package/resources/jobs.js.map +1 -0
  60. package/resources/jobs.mjs +3 -0
  61. package/resources/jobs.mjs.map +1 -0
  62. package/resources/payroll.d.ts +2 -0
  63. package/resources/payroll.d.ts.map +1 -0
  64. package/resources/payroll.js +19 -0
  65. package/resources/payroll.js.map +1 -0
  66. package/resources/payroll.mjs +3 -0
  67. package/resources/payroll.mjs.map +1 -0
  68. package/resources/sandbox/connections.d.ts +2 -0
  69. package/resources/sandbox/connections.d.ts.map +1 -0
  70. package/resources/sandbox/connections.js +19 -0
  71. package/resources/sandbox/connections.js.map +1 -0
  72. package/resources/sandbox/connections.mjs +3 -0
  73. package/resources/sandbox/connections.mjs.map +1 -0
  74. package/resources/sandbox/jobs.d.ts +2 -0
  75. package/resources/sandbox/jobs.d.ts.map +1 -0
  76. package/resources/sandbox/jobs.js +19 -0
  77. package/resources/sandbox/jobs.js.map +1 -0
  78. package/resources/sandbox/jobs.mjs +3 -0
  79. package/resources/sandbox/jobs.mjs.map +1 -0
  80. package/resources/sandbox.d.ts +2 -0
  81. package/resources/sandbox.d.ts.map +1 -0
  82. package/resources/sandbox.js +19 -0
  83. package/resources/sandbox.js.map +1 -0
  84. package/resources/sandbox.mjs +3 -0
  85. package/resources/sandbox.mjs.map +1 -0
  86. package/resources.d.ts +2 -0
  87. package/resources.d.ts.map +1 -0
  88. package/resources.js +18 -0
  89. package/resources.js.map +1 -0
  90. package/resources.mjs +2 -0
  91. package/resources.mjs.map +1 -0
  92. package/src/core.ts +3 -3
  93. package/src/resources/connect.ts +3 -0
  94. package/src/resources/hris/benefits/benefits.ts +6 -6
  95. package/src/resources/hris/benefits/index.ts +1 -1
  96. package/src/resources/hris/benefits.ts +3 -0
  97. package/src/resources/hris/documents.ts +5 -5
  98. package/src/resources/hris/hris.ts +1 -1
  99. package/src/resources/hris/index.ts +1 -1
  100. package/src/resources/hris.ts +3 -0
  101. package/src/resources/jobs/automated.ts +53 -13
  102. package/src/resources/jobs/index.ts +1 -1
  103. package/src/resources/jobs/jobs.ts +2 -3
  104. package/src/resources/jobs.ts +3 -0
  105. package/src/resources/payroll.ts +3 -0
  106. package/src/resources/sandbox/connections.ts +3 -0
  107. package/src/resources/sandbox/jobs.ts +3 -0
  108. package/src/resources/sandbox.ts +3 -0
  109. package/src/resources.ts +1 -0
  110. package/src/version.ts +1 -1
  111. package/version.d.ts +1 -1
  112. package/version.js +1 -1
  113. package/version.mjs +1 -1
package/resources.js ADDED
@@ -0,0 +1,18 @@
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
+ __exportStar(require("./resources/index.js"), exports);
18
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAkC"}
package/resources.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./resources/index.mjs";
2
+ //# sourceMappingURL=resources.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.mjs","sourceRoot":"","sources":["src/resources.ts"],"names":[],"mappings":""}
package/src/core.ts CHANGED
@@ -48,8 +48,8 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
48
48
  }
49
49
 
50
50
  const contentType = response.headers.get('content-type');
51
- const isJSON =
52
- contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json');
51
+ const mediaType = contentType?.split(';')[0]?.trim();
52
+ const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
53
53
  if (isJSON) {
54
54
  const json = await response.json();
55
55
 
@@ -395,7 +395,7 @@ export abstract class APIClient {
395
395
  !headers ? {}
396
396
  : Symbol.iterator in headers ?
397
397
  Object.fromEntries(Array.from(headers as Iterable<string[]>).map((header) => [...header]))
398
- : { ...headers }
398
+ : { ...(headers as any as Record<string, string>) }
399
399
  );
400
400
  }
401
401
 
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './connect/index';
@@ -207,11 +207,6 @@ export interface BenefitsSupport {
207
207
  [k: string]: BenefitFeaturesAndOperations | null | undefined;
208
208
  }
209
209
 
210
- /**
211
- * @deprecated use `BenefitContribution` instead
212
- */
213
- export type BenfitContribution = BenefitContribution | null;
214
-
215
210
  export interface CompanyBenefit {
216
211
  benefit_id: string;
217
212
 
@@ -282,6 +277,11 @@ export interface UpdateCompanyBenefitResponse {
282
277
  benefit_id: string;
283
278
  }
284
279
 
280
+ /**
281
+ * @deprecated use `BenefitContribution` instead
282
+ */
283
+ export type BenfitContribution = BenefitContribution | null;
284
+
285
285
  export interface BenefitCreateParams {
286
286
  /**
287
287
  * Name of the benefit as it appears in the provider and pay statements. Recommend
@@ -319,12 +319,12 @@ export declare namespace Benefits {
319
319
  type BenefitFrequency as BenefitFrequency,
320
320
  type BenefitType as BenefitType,
321
321
  type BenefitsSupport as BenefitsSupport,
322
- type BenfitContribution as BenfitContribution,
323
322
  type CompanyBenefit as CompanyBenefit,
324
323
  type CreateCompanyBenefitsResponse as CreateCompanyBenefitsResponse,
325
324
  type SupportPerBenefitType as SupportPerBenefitType,
326
325
  type SupportedBenefit as SupportedBenefit,
327
326
  type UpdateCompanyBenefitResponse as UpdateCompanyBenefitResponse,
327
+ type BenfitContribution as BenfitContribution,
328
328
  CompanyBenefitsSinglePage as CompanyBenefitsSinglePage,
329
329
  SupportedBenefitsSinglePage as SupportedBenefitsSinglePage,
330
330
  type BenefitCreateParams as BenefitCreateParams,
@@ -9,12 +9,12 @@ export {
9
9
  type BenefitFrequency,
10
10
  type BenefitType,
11
11
  type BenefitsSupport,
12
- type BenfitContribution,
13
12
  type CompanyBenefit,
14
13
  type CreateCompanyBenefitsResponse,
15
14
  type SupportPerBenefitType,
16
15
  type SupportedBenefit,
17
16
  type UpdateCompanyBenefitResponse,
17
+ type BenfitContribution,
18
18
  type BenefitCreateParams,
19
19
  type BenefitUpdateParams,
20
20
  } from './benefits';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './benefits/index';
@@ -7,8 +7,8 @@ import * as Shared from '../shared';
7
7
 
8
8
  export class Documents extends APIResource {
9
9
  /**
10
- * **Beta:** This endpoint is in beta and may change.
11
- * Retrieve a list of company-wide documents.
10
+ * **Beta:** This endpoint is in beta and may change. Retrieve a list of
11
+ * company-wide documents.
12
12
  */
13
13
  list(query?: DocumentListParams, options?: Core.RequestOptions): Core.APIPromise<DocumentListResponse>;
14
14
  list(options?: Core.RequestOptions): Core.APIPromise<DocumentListResponse>;
@@ -23,8 +23,8 @@ export class Documents extends APIResource {
23
23
  }
24
24
 
25
25
  /**
26
- * **Beta:** This endpoint is in beta and may change.
27
- * Retrieve details of a specific document by its ID.
26
+ * **Beta:** This endpoint is in beta and may change. Retrieve details of a
27
+ * specific document by its ID.
28
28
  */
29
29
  retreive(documentId: string, options?: Core.RequestOptions): Core.APIPromise<DocumentRetreiveResponse> {
30
30
  return this._client.get(`/employer/documents/${documentId}`, options);
@@ -99,7 +99,7 @@ export namespace W42005 {
99
99
  /**
100
100
  * The individual's filing status for tax purposes.
101
101
  */
102
- filing_status?: 'married' | 'married_but_withhold_at_higher_single_rate' | 'single';
102
+ filing_status?: 'married' | 'married_but_withhold_at_higher_single_rate' | 'single' | null;
103
103
 
104
104
  /**
105
105
  * The unique identifier for the individual associated with this 2005 W4 form.
@@ -237,12 +237,12 @@ export declare namespace HRIS {
237
237
  type BenefitFrequency as BenefitFrequency,
238
238
  type BenefitType as BenefitType,
239
239
  type BenefitsSupport as BenefitsSupport,
240
- type BenfitContribution as BenfitContribution,
241
240
  type CompanyBenefit as CompanyBenefit,
242
241
  type CreateCompanyBenefitsResponse as CreateCompanyBenefitsResponse,
243
242
  type SupportPerBenefitType as SupportPerBenefitType,
244
243
  type SupportedBenefit as SupportedBenefit,
245
244
  type UpdateCompanyBenefitResponse as UpdateCompanyBenefitResponse,
245
+ type BenfitContribution as BenfitContribution,
246
246
  CompanyBenefitsSinglePage as CompanyBenefitsSinglePage,
247
247
  SupportedBenefitsSinglePage as SupportedBenefitsSinglePage,
248
248
  type BenefitCreateParams as BenefitCreateParams,
@@ -9,12 +9,12 @@ export {
9
9
  type BenefitFrequency,
10
10
  type BenefitType,
11
11
  type BenefitsSupport,
12
- type BenfitContribution,
13
12
  type CompanyBenefit,
14
13
  type CreateCompanyBenefitsResponse,
15
14
  type SupportPerBenefitType,
16
15
  type SupportedBenefit,
17
16
  type UpdateCompanyBenefitResponse,
17
+ type BenfitContribution,
18
18
  type BenefitCreateParams,
19
19
  type BenefitUpdateParams,
20
20
  } from './benefits/index';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './hris/index';
@@ -3,7 +3,6 @@
3
3
  import { APIResource } from '../../resource';
4
4
  import { isRequestOptions } from '../../core';
5
5
  import * as Core from '../../core';
6
- import { Page, type PageParams } from '../../pagination';
7
6
 
8
7
  export class Automated extends APIResource {
9
8
  /**
@@ -41,24 +40,19 @@ export class Automated extends APIResource {
41
40
  * jobs are sorted in descending order by submission time. For scheduled jobs such
42
41
  * as data syncs, only the next scheduled job is shown.
43
42
  */
44
- list(
45
- query?: AutomatedListParams,
46
- options?: Core.RequestOptions,
47
- ): Core.PagePromise<AutomatedAsyncJobsPage, AutomatedAsyncJob>;
48
- list(options?: Core.RequestOptions): Core.PagePromise<AutomatedAsyncJobsPage, AutomatedAsyncJob>;
43
+ list(query?: AutomatedListParams, options?: Core.RequestOptions): Core.APIPromise<AutomatedListResponse>;
44
+ list(options?: Core.RequestOptions): Core.APIPromise<AutomatedListResponse>;
49
45
  list(
50
46
  query: AutomatedListParams | Core.RequestOptions = {},
51
47
  options?: Core.RequestOptions,
52
- ): Core.PagePromise<AutomatedAsyncJobsPage, AutomatedAsyncJob> {
48
+ ): Core.APIPromise<AutomatedListResponse> {
53
49
  if (isRequestOptions(query)) {
54
50
  return this.list({}, query);
55
51
  }
56
- return this._client.getAPIList('/jobs/automated', AutomatedAsyncJobsPage, { query, ...options });
52
+ return this._client.get('/jobs/automated', { query, ...options });
57
53
  }
58
54
  }
59
55
 
60
- export class AutomatedAsyncJobsPage extends Page<AutomatedAsyncJob> {}
61
-
62
56
  export interface AutomatedAsyncJob {
63
57
  /**
64
58
  * The datetime the job completed.
@@ -141,6 +135,44 @@ export interface AutomatedCreateResponse {
141
135
  remaining_refreshes: number;
142
136
  }
143
137
 
138
+ export interface AutomatedListResponse {
139
+ data: Array<AutomatedAsyncJob>;
140
+
141
+ meta: AutomatedListResponse.Meta;
142
+ }
143
+
144
+ export namespace AutomatedListResponse {
145
+ export interface Meta {
146
+ /**
147
+ * Information about remaining quotas for this connection. Only applicable for
148
+ * customers opted in to use Finch's Data Sync Refresh endpoint
149
+ * (`POST /jobs/automated`). Please contact a Finch representative for more
150
+ * details.
151
+ */
152
+ quotas?: Meta.Quotas;
153
+ }
154
+
155
+ export namespace Meta {
156
+ /**
157
+ * Information about remaining quotas for this connection. Only applicable for
158
+ * customers opted in to use Finch's Data Sync Refresh endpoint
159
+ * (`POST /jobs/automated`). Please contact a Finch representative for more
160
+ * details.
161
+ */
162
+ export interface Quotas {
163
+ data_sync_all?: Quotas.DataSyncAll;
164
+ }
165
+
166
+ export namespace Quotas {
167
+ export interface DataSyncAll {
168
+ allowed_refreshes?: number;
169
+
170
+ remaining_refreshes?: number;
171
+ }
172
+ }
173
+ }
174
+ }
175
+
144
176
  export type AutomatedCreateParams =
145
177
  | AutomatedCreateParams.DataSyncAll
146
178
  | AutomatedCreateParams.W4FormEmployeeSync;
@@ -172,15 +204,23 @@ export declare namespace AutomatedCreateParams {
172
204
  }
173
205
  }
174
206
 
175
- export interface AutomatedListParams extends PageParams {}
207
+ export interface AutomatedListParams {
208
+ /**
209
+ * Number of items to return
210
+ */
211
+ limit?: number;
176
212
 
177
- Automated.AutomatedAsyncJobsPage = AutomatedAsyncJobsPage;
213
+ /**
214
+ * Index to start from (defaults to 0)
215
+ */
216
+ offset?: number;
217
+ }
178
218
 
179
219
  export declare namespace Automated {
180
220
  export {
181
221
  type AutomatedAsyncJob as AutomatedAsyncJob,
182
222
  type AutomatedCreateResponse as AutomatedCreateResponse,
183
- AutomatedAsyncJobsPage as AutomatedAsyncJobsPage,
223
+ type AutomatedListResponse as AutomatedListResponse,
184
224
  type AutomatedCreateParams as AutomatedCreateParams,
185
225
  type AutomatedListParams as AutomatedListParams,
186
226
  };
@@ -1,10 +1,10 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  export {
4
- AutomatedAsyncJobsPage,
5
4
  Automated,
6
5
  type AutomatedAsyncJob,
7
6
  type AutomatedCreateResponse,
7
+ type AutomatedListResponse,
8
8
  type AutomatedCreateParams,
9
9
  type AutomatedListParams,
10
10
  } from './automated';
@@ -5,10 +5,10 @@ import * as AutomatedAPI from './automated';
5
5
  import {
6
6
  Automated,
7
7
  AutomatedAsyncJob,
8
- AutomatedAsyncJobsPage,
9
8
  AutomatedCreateParams,
10
9
  AutomatedCreateResponse,
11
10
  AutomatedListParams,
11
+ AutomatedListResponse,
12
12
  } from './automated';
13
13
  import * as ManualAPI from './manual';
14
14
  import { Manual, ManualAsyncJob } from './manual';
@@ -19,7 +19,6 @@ export class Jobs extends APIResource {
19
19
  }
20
20
 
21
21
  Jobs.Automated = Automated;
22
- Jobs.AutomatedAsyncJobsPage = AutomatedAsyncJobsPage;
23
22
  Jobs.Manual = Manual;
24
23
 
25
24
  export declare namespace Jobs {
@@ -27,7 +26,7 @@ export declare namespace Jobs {
27
26
  Automated as Automated,
28
27
  type AutomatedAsyncJob as AutomatedAsyncJob,
29
28
  type AutomatedCreateResponse as AutomatedCreateResponse,
30
- AutomatedAsyncJobsPage as AutomatedAsyncJobsPage,
29
+ type AutomatedListResponse as AutomatedListResponse,
31
30
  type AutomatedCreateParams as AutomatedCreateParams,
32
31
  type AutomatedListParams as AutomatedListParams,
33
32
  };
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './jobs/index';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './payroll/index';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './connections/index';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './jobs/index';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './sandbox/index';
@@ -0,0 +1 @@
1
+ export * from './resources/index';
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '6.18.0'; // x-release-please-version
1
+ export const VERSION = '6.19.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "6.18.0";
1
+ export declare const VERSION = "6.19.0";
2
2
  //# sourceMappingURL=version.d.ts.map
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 = '6.18.0'; // x-release-please-version
4
+ exports.VERSION = '6.19.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '6.18.0'; // x-release-please-version
1
+ export const VERSION = '6.19.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map