@tryfinch/finch-api 5.12.1 → 5.13.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 (79) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/index.d.mts +6 -1
  3. package/index.d.ts +6 -1
  4. package/index.d.ts.map +1 -1
  5. package/index.js +3 -0
  6. package/index.js.map +1 -1
  7. package/index.mjs +3 -0
  8. package/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/pagination.d.ts +25 -3
  11. package/pagination.d.ts.map +1 -1
  12. package/pagination.js +38 -1
  13. package/pagination.js.map +1 -1
  14. package/pagination.mjs +36 -0
  15. package/pagination.mjs.map +1 -1
  16. package/resources/account.d.ts +9 -0
  17. package/resources/account.d.ts.map +1 -1
  18. package/resources/account.js.map +1 -1
  19. package/resources/account.mjs.map +1 -1
  20. package/resources/hris/hris.d.ts +0 -11
  21. package/resources/hris/hris.d.ts.map +1 -1
  22. package/resources/hris/hris.js.map +1 -1
  23. package/resources/hris/hris.mjs.map +1 -1
  24. package/resources/hris/index.d.ts +1 -1
  25. package/resources/hris/index.d.ts.map +1 -1
  26. package/resources/hris/index.js.map +1 -1
  27. package/resources/hris/index.mjs.map +1 -1
  28. package/resources/hris/pay-statements.d.ts +2 -1
  29. package/resources/hris/pay-statements.d.ts.map +1 -1
  30. package/resources/hris/pay-statements.js.map +1 -1
  31. package/resources/hris/pay-statements.mjs.map +1 -1
  32. package/resources/index.d.ts +2 -1
  33. package/resources/index.d.ts.map +1 -1
  34. package/resources/index.js +3 -1
  35. package/resources/index.js.map +1 -1
  36. package/resources/index.mjs +1 -0
  37. package/resources/index.mjs.map +1 -1
  38. package/resources/jobs/automated.d.ts +101 -0
  39. package/resources/jobs/automated.d.ts.map +1 -0
  40. package/resources/jobs/automated.js +68 -0
  41. package/resources/jobs/automated.js.map +1 -0
  42. package/resources/jobs/automated.mjs +40 -0
  43. package/resources/jobs/automated.mjs.map +1 -0
  44. package/resources/jobs/index.d.ts +4 -0
  45. package/resources/jobs/index.d.ts.map +1 -0
  46. package/resources/jobs/index.js +12 -0
  47. package/resources/jobs/index.js.map +1 -0
  48. package/resources/jobs/index.mjs +5 -0
  49. package/resources/jobs/index.mjs.map +1 -0
  50. package/resources/jobs/jobs.d.ts +18 -0
  51. package/resources/jobs/jobs.d.ts.map +1 -0
  52. package/resources/jobs/jobs.js +44 -0
  53. package/resources/jobs/jobs.js.map +1 -0
  54. package/resources/jobs/jobs.mjs +17 -0
  55. package/resources/jobs/jobs.mjs.map +1 -0
  56. package/resources/jobs/manual.d.ts +22 -0
  57. package/resources/jobs/manual.d.ts.map +1 -0
  58. package/resources/jobs/manual.js +18 -0
  59. package/resources/jobs/manual.js.map +1 -0
  60. package/resources/jobs/manual.mjs +14 -0
  61. package/resources/jobs/manual.mjs.map +1 -0
  62. package/resources/shared.d.ts +10 -0
  63. package/resources/shared.d.ts.map +1 -1
  64. package/src/index.ts +8 -1
  65. package/src/pagination.ts +65 -3
  66. package/src/resources/account.ts +11 -0
  67. package/src/resources/hris/hris.ts +0 -13
  68. package/src/resources/hris/index.ts +1 -1
  69. package/src/resources/hris/pay-statements.ts +2 -1
  70. package/src/resources/index.ts +2 -1
  71. package/src/resources/jobs/automated.ts +139 -0
  72. package/src/resources/jobs/index.ts +12 -0
  73. package/src/resources/jobs/jobs.ts +21 -0
  74. package/src/resources/jobs/manual.ts +30 -0
  75. package/src/resources/shared.ts +12 -0
  76. package/src/version.ts +1 -1
  77. package/version.d.ts +1 -1
  78. package/version.js +1 -1
  79. package/version.mjs +1 -1
@@ -103,23 +103,10 @@ export interface Money {
103
103
  currency?: string;
104
104
  }
105
105
 
106
- export interface Paging {
107
- /**
108
- * The total number of elements for the entire query (not just the given page)
109
- */
110
- count?: number;
111
-
112
- /**
113
- * The current start index of the returned list of elements
114
- */
115
- offset?: number;
116
- }
117
-
118
106
  export namespace HRIS {
119
107
  export import Income = HRISAPI.Income;
120
108
  export import Location = HRISAPI.Location;
121
109
  export import Money = HRISAPI.Money;
122
- export import Paging = HRISAPI.Paging;
123
110
  export import CompanyResource = CompanyAPI.CompanyResource;
124
111
  export import Company = CompanyAPI.Company;
125
112
  export import Directory = DirectoryAPI.Directory;
@@ -26,7 +26,7 @@ export {
26
26
  EmploymentDataResponsesPage,
27
27
  Employments,
28
28
  } from './employments';
29
- export { Income, Location, Money, Paging, HRIS } from './hris';
29
+ export { Income, Location, Money, HRIS } from './hris';
30
30
  export {
31
31
  Individual,
32
32
  IndividualResponse,
@@ -3,6 +3,7 @@
3
3
  import * as Core from "../../core";
4
4
  import { APIResource } from "../../resource";
5
5
  import * as PayStatementsAPI from "./pay-statements";
6
+ import * as Shared from "../shared";
6
7
  import * as HRISAPI from "./hris";
7
8
  import * as BenefitsAPI from "./benefits/benefits";
8
9
  import { ResponsesPage } from "../../pagination";
@@ -200,7 +201,7 @@ export interface PayStatementResponse {
200
201
  }
201
202
 
202
203
  export interface PayStatementResponseBody {
203
- paging?: HRISAPI.Paging;
204
+ paging?: Shared.Paging;
204
205
 
205
206
  /**
206
207
  * The array of pay statements for the current payment.
@@ -2,7 +2,8 @@
2
2
 
3
3
  export * from './shared';
4
4
  export { DisconnectResponse, Introspection, Account } from './account';
5
- export { Income, Location, Money, Paging, HRIS } from './hris/hris';
5
+ export { Income, Location, Money, HRIS } from './hris/hris';
6
+ export { Jobs } from './jobs/jobs';
6
7
  export { Provider, ProvidersSinglePage, Providers } from './providers';
7
8
  export {
8
9
  RequestForwardingForwardResponse,
@@ -0,0 +1,139 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import * as Core from "../../core";
4
+ import { APIResource } from "../../resource";
5
+ import { isRequestOptions } from "../../core";
6
+ import * as AutomatedAPI from "./automated";
7
+ import { Page, type PageParams } from "../../pagination";
8
+
9
+ export class Automated extends APIResource {
10
+ /**
11
+ * Enqueue an automated job. Currently, only the `data_sync_all` job type is
12
+ * supported, which will enqueue a job to re-sync all data for a connection.
13
+ * `data_sync_all` has a concurrency limit of 1 job at a time per connection. This
14
+ * means that if this endpoint is called while a job is already in progress for
15
+ * this connection, Finch will return the `job_id` of the job that is currently in
16
+ * progress. Finch allows a fixed window rate limit of 1 forced refresh per hour
17
+ * per connection.
18
+ *
19
+ * This endpoint is available for _Scale_ tier customers as an add-on. To request
20
+ * access to this endpoint, please contact your Finch account manager.
21
+ */
22
+ create(
23
+ body: AutomatedCreateParams,
24
+ options?: Core.RequestOptions,
25
+ ): Core.APIPromise<AutomatedCreateResponse> {
26
+ return this._client.post('/jobs/automated', { body, ...options });
27
+ }
28
+
29
+ /**
30
+ * Get an automated job by `job_id`.
31
+ */
32
+ retrieve(jobId: string, options?: Core.RequestOptions): Core.APIPromise<AutomatedAsyncJob> {
33
+ return this._client.get(`/jobs/automated/${jobId}`, options);
34
+ }
35
+
36
+ /**
37
+ * Get all automated jobs. Automated jobs are completed by a machine. By default,
38
+ * jobs are sorted in descending order by submission time. For scheduled jobs such
39
+ * as data syncs, only the next scheduled job is shown.
40
+ */
41
+ list(
42
+ query?: AutomatedListParams,
43
+ options?: Core.RequestOptions,
44
+ ): Core.PagePromise<AutomatedAsyncJobsPage, AutomatedAsyncJob>;
45
+ list(options?: Core.RequestOptions): Core.PagePromise<AutomatedAsyncJobsPage, AutomatedAsyncJob>;
46
+ list(
47
+ query: AutomatedListParams | Core.RequestOptions = {},
48
+ options?: Core.RequestOptions,
49
+ ): Core.PagePromise<AutomatedAsyncJobsPage, AutomatedAsyncJob> {
50
+ if (isRequestOptions(query)) {
51
+ return this.list({}, query);
52
+ }
53
+ return this._client.getAPIList('/jobs/automated', AutomatedAsyncJobsPage, { query, ...options });
54
+ }
55
+ }
56
+
57
+ export class AutomatedAsyncJobsPage extends Page<AutomatedAsyncJob> {}
58
+
59
+ export interface AutomatedAsyncJob {
60
+ /**
61
+ * The datetime the job completed.
62
+ */
63
+ completed_at: string | null;
64
+
65
+ /**
66
+ * The datetime when the job was created. for scheduled jobs, this will be the
67
+ * initial connection time. For ad-hoc jobs, this will be the time the creation
68
+ * request was received.
69
+ */
70
+ created_at: string;
71
+
72
+ /**
73
+ * The id of the job that has been created.
74
+ */
75
+ job_id: string;
76
+
77
+ /**
78
+ * The url that can be used to retrieve the job status
79
+ */
80
+ job_url: string;
81
+
82
+ /**
83
+ * The datetime a job is scheduled to be run. For scheduled jobs, this datetime can
84
+ * be in the future if the job has not yet been enqueued. For ad-hoc jobs, this
85
+ * field will be null.
86
+ */
87
+ scheduled_at: string | null;
88
+
89
+ /**
90
+ * The datetime a job entered into the job queue.
91
+ */
92
+ started_at: string | null;
93
+
94
+ status: 'pending' | 'in_progress' | 'complete' | 'error' | 'reauth_error' | 'permissions_error';
95
+
96
+ /**
97
+ * Only `data_sync_all` currently supported
98
+ */
99
+ type: 'data_sync_all';
100
+ }
101
+
102
+ export interface AutomatedCreateResponse {
103
+ /**
104
+ * The number of allowed refreshes per hour (per hour, fixed window)
105
+ */
106
+ allowed_refreshes: number;
107
+
108
+ /**
109
+ * The id of the job that has been created.
110
+ */
111
+ job_id: string;
112
+
113
+ /**
114
+ * The url that can be used to retrieve the job status
115
+ */
116
+ job_url: string;
117
+
118
+ /**
119
+ * The number of remaining refreshes available (per hour, fixed window)
120
+ */
121
+ remaining_refreshes: number;
122
+ }
123
+
124
+ export interface AutomatedCreateParams {
125
+ /**
126
+ * The type of job to start. Currently the only supported type is `data_sync_all`
127
+ */
128
+ type: 'data_sync_all';
129
+ }
130
+
131
+ export interface AutomatedListParams extends PageParams {}
132
+
133
+ export namespace Automated {
134
+ export import AutomatedAsyncJob = AutomatedAPI.AutomatedAsyncJob;
135
+ export import AutomatedCreateResponse = AutomatedAPI.AutomatedCreateResponse;
136
+ export import AutomatedAsyncJobsPage = AutomatedAPI.AutomatedAsyncJobsPage;
137
+ export import AutomatedCreateParams = AutomatedAPI.AutomatedCreateParams;
138
+ export import AutomatedListParams = AutomatedAPI.AutomatedListParams;
139
+ }
@@ -0,0 +1,12 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ export {
4
+ AutomatedAsyncJob,
5
+ AutomatedCreateResponse,
6
+ AutomatedCreateParams,
7
+ AutomatedListParams,
8
+ AutomatedAsyncJobsPage,
9
+ Automated,
10
+ } from './automated';
11
+ export { Jobs } from './jobs';
12
+ export { ManualAsyncJob, Manual } from './manual';
@@ -0,0 +1,21 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import { APIResource } from "../../resource";
4
+ import * as AutomatedAPI from "./automated";
5
+ import * as ManualAPI from "./manual";
6
+
7
+ export class Jobs extends APIResource {
8
+ automated: AutomatedAPI.Automated = new AutomatedAPI.Automated(this._client);
9
+ manual: ManualAPI.Manual = new ManualAPI.Manual(this._client);
10
+ }
11
+
12
+ export namespace Jobs {
13
+ export import Automated = AutomatedAPI.Automated;
14
+ export import AutomatedAsyncJob = AutomatedAPI.AutomatedAsyncJob;
15
+ export import AutomatedCreateResponse = AutomatedAPI.AutomatedCreateResponse;
16
+ export import AutomatedAsyncJobsPage = AutomatedAPI.AutomatedAsyncJobsPage;
17
+ export import AutomatedCreateParams = AutomatedAPI.AutomatedCreateParams;
18
+ export import AutomatedListParams = AutomatedAPI.AutomatedListParams;
19
+ export import Manual = ManualAPI.Manual;
20
+ export import ManualAsyncJob = ManualAPI.ManualAsyncJob;
21
+ }
@@ -0,0 +1,30 @@
1
+ // File generated from our OpenAPI spec by Stainless.
2
+
3
+ import * as Core from "../../core";
4
+ import { APIResource } from "../../resource";
5
+ import * as ManualAPI from "./manual";
6
+
7
+ export class Manual extends APIResource {
8
+ /**
9
+ * Get a manual job by `job_id`. Manual jobs are completed by a human and include
10
+ * Assisted Benefits jobs.
11
+ */
12
+ retrieve(jobId: string, options?: Core.RequestOptions): Core.APIPromise<ManualAsyncJob> {
13
+ return this._client.get(`/jobs/manual/${jobId}`, options);
14
+ }
15
+ }
16
+
17
+ export interface ManualAsyncJob {
18
+ /**
19
+ * Specific information about the job, such as individual statuses for batch jobs.
20
+ */
21
+ body: Array<unknown> | null;
22
+
23
+ job_id: string;
24
+
25
+ status: 'pending' | 'in_progress' | 'error' | 'complete';
26
+ }
27
+
28
+ export namespace Manual {
29
+ export import ManualAsyncJob = ManualAPI.ManualAsyncJob;
30
+ }
@@ -60,3 +60,15 @@ export interface OperationSupportMatrix {
60
60
  */
61
61
  update?: OperationSupport;
62
62
  }
63
+
64
+ export interface Paging {
65
+ /**
66
+ * The total number of elements for the entire query (not just the given page)
67
+ */
68
+ count?: number;
69
+
70
+ /**
71
+ * The current start index of the returned list of elements
72
+ */
73
+ offset?: number;
74
+ }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '5.12.1'; // x-release-please-version
1
+ export const VERSION = '5.13.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "5.12.1";
1
+ export declare const VERSION = "5.13.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 = '5.12.1'; // x-release-please-version
4
+ exports.VERSION = '5.13.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '5.12.1'; // x-release-please-version
1
+ export const VERSION = '5.13.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map