@tryfinch/finch-api 5.22.7 → 5.22.10

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 (46) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/index.d.mts +203 -5
  3. package/index.d.ts +203 -5
  4. package/index.d.ts.map +1 -1
  5. package/index.js +192 -10
  6. package/index.js.map +1 -1
  7. package/index.mjs +189 -5
  8. package/index.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/access-tokens.d.ts.map +1 -1
  11. package/resources/access-tokens.js +9 -1
  12. package/resources/access-tokens.js.map +1 -1
  13. package/resources/access-tokens.mjs +9 -1
  14. package/resources/access-tokens.mjs.map +1 -1
  15. package/resources/account.d.ts +4 -4
  16. package/resources/account.d.ts.map +1 -1
  17. package/resources/hris/benefits/benefits.d.ts +1 -1
  18. package/resources/hris/benefits/benefits.d.ts.map +1 -1
  19. package/resources/hris/employments.d.ts +1 -0
  20. package/resources/hris/employments.d.ts.map +1 -1
  21. package/resources/hris/employments.js.map +1 -1
  22. package/resources/hris/employments.mjs.map +1 -1
  23. package/resources/providers.d.ts +4 -0
  24. package/resources/providers.d.ts.map +1 -1
  25. package/resources/providers.js.map +1 -1
  26. package/resources/providers.mjs.map +1 -1
  27. package/src/index.ts +367 -6
  28. package/src/resources/access-tokens.ts +9 -1
  29. package/src/resources/account.ts +4 -4
  30. package/src/resources/hris/benefits/benefits.ts +1 -1
  31. package/src/resources/hris/employments.ts +2 -0
  32. package/src/resources/providers.ts +5 -0
  33. package/src/version.ts +1 -1
  34. package/version.d.ts +1 -1
  35. package/version.d.ts.map +1 -1
  36. package/version.js +1 -1
  37. package/version.js.map +1 -1
  38. package/version.mjs +1 -1
  39. package/version.mjs.map +1 -1
  40. package/client.d.ts +0 -204
  41. package/client.d.ts.map +0 -1
  42. package/client.js +0 -218
  43. package/client.js.map +0 -1
  44. package/client.mjs +0 -191
  45. package/client.mjs.map +0 -1
  46. package/src/client.ts +0 -369
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.22.10 (2024-05-25)
4
+
5
+ Full Changelog: [v5.22.9...v5.22.10](https://github.com/Finch-API/finch-api-node/compare/v5.22.9...v5.22.10)
6
+
7
+ ### Bug Fixes
8
+
9
+ * fix bug access tokens create should set the authorization header to null ([4eb197e](https://github.com/Finch-API/finch-api-node/commit/4eb197e7e886a1a6c3a951a53a600d8d0db2c708))
10
+ * fix lint issue ([a240b14](https://github.com/Finch-API/finch-api-node/commit/a240b1416ed9bb798c079ca4262ed62848604a4f))
11
+
12
+ ## 5.22.9 (2024-05-24)
13
+
14
+ Full Changelog: [v5.22.8...v5.22.9](https://github.com/Finch-API/finch-api-node/compare/v5.22.8...v5.22.9)
15
+
16
+ ### Bug Fixes
17
+
18
+ * **api:** correct authentication methods type ([#370](https://github.com/Finch-API/finch-api-node/issues/370)) ([98a5860](https://github.com/Finch-API/finch-api-node/commit/98a5860e2434fe478f1fa2b7dabf7db1a40bdbda))
19
+ * **tests:** replace outdated example values ([3554d3f](https://github.com/Finch-API/finch-api-node/commit/3554d3fbe3d1f6f92f07339e79a60f1e2f81bf2b))
20
+ * **types:** correct index signature type ([#376](https://github.com/Finch-API/finch-api-node/issues/376)) ([5321060](https://github.com/Finch-API/finch-api-node/commit/5321060b3ec4899cd1aa53a1fa4df7e2b6666064))
21
+
22
+
23
+ ### Chores
24
+
25
+ * **docs:** add SECURITY.md ([#366](https://github.com/Finch-API/finch-api-node/issues/366)) ([bf1afea](https://github.com/Finch-API/finch-api-node/commit/bf1afead23076a071970e170d65dcea9a4ab3517))
26
+ * **internal:** add slightly better logging to scripts ([#372](https://github.com/Finch-API/finch-api-node/issues/372)) ([84de6c1](https://github.com/Finch-API/finch-api-node/commit/84de6c1226235041fe50455dfb89cbff1ca4fbd8))
27
+ * **internal:** minor updates ([#369](https://github.com/Finch-API/finch-api-node/issues/369)) ([98d4f39](https://github.com/Finch-API/finch-api-node/commit/98d4f3971e15433d613f2e07adb3575cf5cd5366))
28
+ * **internal:** remove empty file ([c199638](https://github.com/Finch-API/finch-api-node/commit/c1996384384c9ba6085b78732801851b116b2edd))
29
+ * **internal:** resolve spec formatting issue ([#375](https://github.com/Finch-API/finch-api-node/issues/375)) ([c102ea6](https://github.com/Finch-API/finch-api-node/commit/c102ea6e9fedd347850d5f382d613c8f3818b6d2))
30
+ * **tests:** example client_id ([#377](https://github.com/Finch-API/finch-api-node/issues/377)) ([4d21a7a](https://github.com/Finch-API/finch-api-node/commit/4d21a7afff7456a5e9a24e6ba5ba64bd1c8af0e5))
31
+ * **tests:** update client ID example value ([#371](https://github.com/Finch-API/finch-api-node/issues/371)) ([bf3aac1](https://github.com/Finch-API/finch-api-node/commit/bf3aac155b19f0e009cf679fcc877e56557d487f))
32
+ * **tests:** update some example values ([#374](https://github.com/Finch-API/finch-api-node/issues/374)) ([d469723](https://github.com/Finch-API/finch-api-node/commit/d469723be418afe661fbb967a3cd01acb54def2c))
33
+
34
+ ## 5.22.8 (2024-05-03)
35
+
36
+ Full Changelog: [v5.22.7...v5.22.8](https://github.com/Finch-API/finch-api-node/compare/v5.22.7...v5.22.8)
37
+
38
+ ### Bug Fixes
39
+
40
+ * **package:** revert recent client file change ([#362](https://github.com/Finch-API/finch-api-node/issues/362)) ([97d9b40](https://github.com/Finch-API/finch-api-node/commit/97d9b40534535f673b993d8da1d5f35f7ff7428e))
41
+
3
42
  ## 5.22.7 (2024-05-02)
4
43
 
5
44
  Full Changelog: [v5.22.6...v5.22.7](https://github.com/Finch-API/finch-api-node/compare/v5.22.6...v5.22.7)
package/index.d.mts CHANGED
@@ -1,10 +1,208 @@
1
+ import * as Core from "./core.js";
1
2
  import * as Errors from "./error.js";
3
+ import { type Agent } from "./_shims/index.js";
2
4
  import * as Uploads from "./uploads.js";
3
- import { Finch } from "./client.js";
4
- export { Finch };
5
- export default Finch;
5
+ import * as Pagination from '@tryfinch/finch-api/pagination';
6
+ import * as API from '@tryfinch/finch-api/resources/index';
7
+ export interface ClientOptions {
8
+ accessToken?: string | null | undefined;
9
+ /**
10
+ * Defaults to process.env['FINCH_CLIENT_ID'].
11
+ */
12
+ clientId?: string | null | undefined;
13
+ /**
14
+ * Defaults to process.env['FINCH_CLIENT_SECRET'].
15
+ */
16
+ clientSecret?: string | null | undefined;
17
+ /**
18
+ * Defaults to process.env['FINCH_SANDBOX_CLIENT_ID'].
19
+ */
20
+ sandboxClientId?: string | null | undefined;
21
+ /**
22
+ * Defaults to process.env['FINCH_SANDBOX_CLIENT_SECRET'].
23
+ */
24
+ sandboxClientSecret?: string | null | undefined;
25
+ /**
26
+ * Defaults to process.env['FINCH_WEBHOOK_SECRET'].
27
+ */
28
+ webhookSecret?: string | null | undefined;
29
+ /**
30
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
31
+ *
32
+ * Defaults to process.env['FINCH_BASE_URL'].
33
+ */
34
+ baseURL?: string | null | undefined;
35
+ /**
36
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
37
+ * from the server before timing out a single request.
38
+ *
39
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
40
+ * much longer than this timeout before the promise succeeds or fails.
41
+ */
42
+ timeout?: number;
43
+ /**
44
+ * An HTTP agent used to manage HTTP(S) connections.
45
+ *
46
+ * If not provided, an agent will be constructed by default in the Node.js environment,
47
+ * otherwise no agent is used.
48
+ */
49
+ httpAgent?: Agent;
50
+ /**
51
+ * Specify a custom `fetch` function implementation.
52
+ *
53
+ * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
54
+ * defined globally.
55
+ */
56
+ fetch?: Core.Fetch | undefined;
57
+ /**
58
+ * The maximum number of times that the client will retry a request in case of a
59
+ * temporary failure, like a network error or a 5XX error from the server.
60
+ *
61
+ * @default 2
62
+ */
63
+ maxRetries?: number;
64
+ /**
65
+ * Default headers to include with every request to the API.
66
+ *
67
+ * These can be removed in individual requests by explicitly setting the
68
+ * header to `undefined` or `null` in request options.
69
+ */
70
+ defaultHeaders?: Core.Headers;
71
+ /**
72
+ * Default query parameters to include with every request to the API.
73
+ *
74
+ * These can be removed in individual requests by explicitly setting the
75
+ * param to `undefined` in request options.
76
+ */
77
+ defaultQuery?: Core.DefaultQuery;
78
+ }
79
+ /** API Client for interfacing with the Finch API. */
80
+ export declare class Finch extends Core.APIClient {
81
+ accessToken: string | null;
82
+ clientId: string | null;
83
+ clientSecret: string | null;
84
+ sandboxClientId: string | null;
85
+ sandboxClientSecret: string | null;
86
+ webhookSecret: string | null;
87
+ private _options;
88
+ /**
89
+ * API Client for interfacing with the Finch API.
90
+ *
91
+ * @param {string | null | undefined} [opts.accessToken]
92
+ * @param {string | null | undefined} [opts.clientId=process.env['FINCH_CLIENT_ID'] ?? null]
93
+ * @param {string | null | undefined} [opts.clientSecret=process.env['FINCH_CLIENT_SECRET'] ?? null]
94
+ * @param {string | null | undefined} [opts.sandboxClientId=process.env['FINCH_SANDBOX_CLIENT_ID'] ?? null]
95
+ * @param {string | null | undefined} [opts.sandboxClientSecret=process.env['FINCH_SANDBOX_CLIENT_SECRET'] ?? null]
96
+ * @param {string | null | undefined} [opts.webhookSecret=process.env['FINCH_WEBHOOK_SECRET'] ?? null]
97
+ * @param {string} [opts.baseURL=process.env['FINCH_BASE_URL'] ?? https://api.tryfinch.com] - Override the default base URL for the API.
98
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
99
+ * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
100
+ * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
101
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
102
+ * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
103
+ * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
104
+ */
105
+ constructor({ baseURL, accessToken, clientId, clientSecret, sandboxClientId, sandboxClientSecret, webhookSecret, ...opts }?: ClientOptions);
106
+ accessTokens: API.AccessTokens;
107
+ hris: API.HRIS;
108
+ providers: API.Providers;
109
+ account: API.Account;
110
+ webhooks: API.Webhooks;
111
+ requestForwarding: API.RequestForwarding;
112
+ jobs: API.Jobs;
113
+ sandbox: API.Sandbox;
114
+ /**
115
+ * DEPRECATED: use client.accessTokens.create instead.
116
+ */
117
+ getAccessToken(code: string, options?: {
118
+ redirectUri: string;
119
+ }): Promise<string>;
120
+ /**
121
+ * Returns the authorization url which can be visited in order to obtain an
122
+ * authorization code from Finch. The authorization code can then be exchanged for
123
+ * an access token for the Finch api by calling get_access_token().
124
+ */
125
+ getAuthURL({ products, redirectUri, sandbox, }: {
126
+ products: string;
127
+ redirectUri: string;
128
+ sandbox: boolean;
129
+ }): string;
130
+ /**
131
+ * Returns a copy of the current Finch client with the given access token for
132
+ * authentication.
133
+ */
134
+ withAccessToken(accessToken: string): Finch;
135
+ protected defaultQuery(): Core.DefaultQuery | undefined;
136
+ protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
137
+ protected validateHeaders(headers: Core.Headers, customHeaders: Core.Headers): void;
138
+ protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
139
+ protected bearerAuth(opts: Core.FinalRequestOptions): Core.Headers;
140
+ protected basicAuth(opts: Core.FinalRequestOptions): Core.Headers;
141
+ static Finch: typeof Finch;
142
+ static FinchError: typeof Errors.FinchError;
143
+ static APIError: typeof Errors.APIError;
144
+ static APIConnectionError: typeof Errors.APIConnectionError;
145
+ static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
146
+ static APIUserAbortError: typeof Errors.APIUserAbortError;
147
+ static NotFoundError: typeof Errors.NotFoundError;
148
+ static ConflictError: typeof Errors.ConflictError;
149
+ static RateLimitError: typeof Errors.RateLimitError;
150
+ static BadRequestError: typeof Errors.BadRequestError;
151
+ static AuthenticationError: typeof Errors.AuthenticationError;
152
+ static InternalServerError: typeof Errors.InternalServerError;
153
+ static PermissionDeniedError: typeof Errors.PermissionDeniedError;
154
+ static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
155
+ static toFile: typeof Uploads.toFile;
156
+ static fileFromPath: typeof Uploads.fileFromPath;
157
+ }
158
+ export declare const FinchError: typeof Errors.FinchError, APIError: typeof Errors.APIError, APIConnectionError: typeof Errors.APIConnectionError, APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError, APIUserAbortError: typeof Errors.APIUserAbortError, NotFoundError: typeof Errors.NotFoundError, ConflictError: typeof Errors.ConflictError, RateLimitError: typeof Errors.RateLimitError, BadRequestError: typeof Errors.BadRequestError, AuthenticationError: typeof Errors.AuthenticationError, InternalServerError: typeof Errors.InternalServerError, PermissionDeniedError: typeof Errors.PermissionDeniedError, UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
6
159
  export import toFile = Uploads.toFile;
7
160
  export import fileFromPath = Uploads.fileFromPath;
8
- export declare const FinchError: typeof Errors.FinchError, APIError: typeof Errors.APIError, APIConnectionError: typeof Errors.APIConnectionError, APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError, APIUserAbortError: typeof Errors.APIUserAbortError, NotFoundError: typeof Errors.NotFoundError, ConflictError: typeof Errors.ConflictError, RateLimitError: typeof Errors.RateLimitError, BadRequestError: typeof Errors.BadRequestError, AuthenticationError: typeof Errors.AuthenticationError, InternalServerError: typeof Errors.InternalServerError, PermissionDeniedError: typeof Errors.PermissionDeniedError, UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
9
- export * from "./client.js";
161
+ export declare namespace Finch {
162
+ export import RequestOptions = Core.RequestOptions;
163
+ export import SinglePage = Pagination.SinglePage;
164
+ export import SinglePageResponse = Pagination.SinglePageResponse;
165
+ export import ResponsesPage = Pagination.ResponsesPage;
166
+ export import ResponsesPageResponse = Pagination.ResponsesPageResponse;
167
+ export import IndividualsPage = Pagination.IndividualsPage;
168
+ export import IndividualsPageParams = Pagination.IndividualsPageParams;
169
+ export import IndividualsPageResponse = Pagination.IndividualsPageResponse;
170
+ export import Page = Pagination.Page;
171
+ export import PageParams = Pagination.PageParams;
172
+ export import PageResponse = Pagination.PageResponse;
173
+ export import AccessTokens = API.AccessTokens;
174
+ export import CreateAccessTokenResponse = API.CreateAccessTokenResponse;
175
+ export import AccessTokenCreateParams = API.AccessTokenCreateParams;
176
+ export import HRIS = API.HRIS;
177
+ export import Income = API.Income;
178
+ export import Location = API.Location;
179
+ export import Money = API.Money;
180
+ export import Providers = API.Providers;
181
+ export import Provider = API.Provider;
182
+ export import ProvidersSinglePage = API.ProvidersSinglePage;
183
+ export import Account = API.Account;
184
+ export import DisconnectResponse = API.DisconnectResponse;
185
+ export import Introspection = API.Introspection;
186
+ export import Webhooks = API.Webhooks;
187
+ export import AccountUpdateEvent = API.AccountUpdateEvent;
188
+ export import BaseWebhookEvent = API.BaseWebhookEvent;
189
+ export import CompanyEvent = API.CompanyEvent;
190
+ export import DirectoryEvent = API.DirectoryEvent;
191
+ export import EmploymentEvent = API.EmploymentEvent;
192
+ export import IndividualEvent = API.IndividualEvent;
193
+ export import JobCompletionEvent = API.JobCompletionEvent;
194
+ export import PayStatementEvent = API.PayStatementEvent;
195
+ export import PaymentEvent = API.PaymentEvent;
196
+ export import WebhookEvent = API.WebhookEvent;
197
+ export import RequestForwarding = API.RequestForwarding;
198
+ export import RequestForwardingForwardResponse = API.RequestForwardingForwardResponse;
199
+ export import RequestForwardingForwardParams = API.RequestForwardingForwardParams;
200
+ export import Jobs = API.Jobs;
201
+ export import Sandbox = API.Sandbox;
202
+ export import ConnectionStatusType = API.ConnectionStatusType;
203
+ export import OperationSupport = API.OperationSupport;
204
+ export import OperationSupportMatrix = API.OperationSupportMatrix;
205
+ export import Paging = API.Paging;
206
+ }
207
+ export default Finch;
10
208
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts CHANGED
@@ -1,10 +1,208 @@
1
+ import * as Core from "./core.js";
1
2
  import * as Errors from "./error.js";
3
+ import { type Agent } from "./_shims/index.js";
2
4
  import * as Uploads from "./uploads.js";
3
- import { Finch } from "./client.js";
4
- export { Finch };
5
- export default Finch;
5
+ import * as Pagination from '@tryfinch/finch-api/pagination';
6
+ import * as API from '@tryfinch/finch-api/resources/index';
7
+ export interface ClientOptions {
8
+ accessToken?: string | null | undefined;
9
+ /**
10
+ * Defaults to process.env['FINCH_CLIENT_ID'].
11
+ */
12
+ clientId?: string | null | undefined;
13
+ /**
14
+ * Defaults to process.env['FINCH_CLIENT_SECRET'].
15
+ */
16
+ clientSecret?: string | null | undefined;
17
+ /**
18
+ * Defaults to process.env['FINCH_SANDBOX_CLIENT_ID'].
19
+ */
20
+ sandboxClientId?: string | null | undefined;
21
+ /**
22
+ * Defaults to process.env['FINCH_SANDBOX_CLIENT_SECRET'].
23
+ */
24
+ sandboxClientSecret?: string | null | undefined;
25
+ /**
26
+ * Defaults to process.env['FINCH_WEBHOOK_SECRET'].
27
+ */
28
+ webhookSecret?: string | null | undefined;
29
+ /**
30
+ * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
31
+ *
32
+ * Defaults to process.env['FINCH_BASE_URL'].
33
+ */
34
+ baseURL?: string | null | undefined;
35
+ /**
36
+ * The maximum amount of time (in milliseconds) that the client should wait for a response
37
+ * from the server before timing out a single request.
38
+ *
39
+ * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
40
+ * much longer than this timeout before the promise succeeds or fails.
41
+ */
42
+ timeout?: number;
43
+ /**
44
+ * An HTTP agent used to manage HTTP(S) connections.
45
+ *
46
+ * If not provided, an agent will be constructed by default in the Node.js environment,
47
+ * otherwise no agent is used.
48
+ */
49
+ httpAgent?: Agent;
50
+ /**
51
+ * Specify a custom `fetch` function implementation.
52
+ *
53
+ * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
54
+ * defined globally.
55
+ */
56
+ fetch?: Core.Fetch | undefined;
57
+ /**
58
+ * The maximum number of times that the client will retry a request in case of a
59
+ * temporary failure, like a network error or a 5XX error from the server.
60
+ *
61
+ * @default 2
62
+ */
63
+ maxRetries?: number;
64
+ /**
65
+ * Default headers to include with every request to the API.
66
+ *
67
+ * These can be removed in individual requests by explicitly setting the
68
+ * header to `undefined` or `null` in request options.
69
+ */
70
+ defaultHeaders?: Core.Headers;
71
+ /**
72
+ * Default query parameters to include with every request to the API.
73
+ *
74
+ * These can be removed in individual requests by explicitly setting the
75
+ * param to `undefined` in request options.
76
+ */
77
+ defaultQuery?: Core.DefaultQuery;
78
+ }
79
+ /** API Client for interfacing with the Finch API. */
80
+ export declare class Finch extends Core.APIClient {
81
+ accessToken: string | null;
82
+ clientId: string | null;
83
+ clientSecret: string | null;
84
+ sandboxClientId: string | null;
85
+ sandboxClientSecret: string | null;
86
+ webhookSecret: string | null;
87
+ private _options;
88
+ /**
89
+ * API Client for interfacing with the Finch API.
90
+ *
91
+ * @param {string | null | undefined} [opts.accessToken]
92
+ * @param {string | null | undefined} [opts.clientId=process.env['FINCH_CLIENT_ID'] ?? null]
93
+ * @param {string | null | undefined} [opts.clientSecret=process.env['FINCH_CLIENT_SECRET'] ?? null]
94
+ * @param {string | null | undefined} [opts.sandboxClientId=process.env['FINCH_SANDBOX_CLIENT_ID'] ?? null]
95
+ * @param {string | null | undefined} [opts.sandboxClientSecret=process.env['FINCH_SANDBOX_CLIENT_SECRET'] ?? null]
96
+ * @param {string | null | undefined} [opts.webhookSecret=process.env['FINCH_WEBHOOK_SECRET'] ?? null]
97
+ * @param {string} [opts.baseURL=process.env['FINCH_BASE_URL'] ?? https://api.tryfinch.com] - Override the default base URL for the API.
98
+ * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
99
+ * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
100
+ * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
101
+ * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
102
+ * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
103
+ * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
104
+ */
105
+ constructor({ baseURL, accessToken, clientId, clientSecret, sandboxClientId, sandboxClientSecret, webhookSecret, ...opts }?: ClientOptions);
106
+ accessTokens: API.AccessTokens;
107
+ hris: API.HRIS;
108
+ providers: API.Providers;
109
+ account: API.Account;
110
+ webhooks: API.Webhooks;
111
+ requestForwarding: API.RequestForwarding;
112
+ jobs: API.Jobs;
113
+ sandbox: API.Sandbox;
114
+ /**
115
+ * DEPRECATED: use client.accessTokens.create instead.
116
+ */
117
+ getAccessToken(code: string, options?: {
118
+ redirectUri: string;
119
+ }): Promise<string>;
120
+ /**
121
+ * Returns the authorization url which can be visited in order to obtain an
122
+ * authorization code from Finch. The authorization code can then be exchanged for
123
+ * an access token for the Finch api by calling get_access_token().
124
+ */
125
+ getAuthURL({ products, redirectUri, sandbox, }: {
126
+ products: string;
127
+ redirectUri: string;
128
+ sandbox: boolean;
129
+ }): string;
130
+ /**
131
+ * Returns a copy of the current Finch client with the given access token for
132
+ * authentication.
133
+ */
134
+ withAccessToken(accessToken: string): Finch;
135
+ protected defaultQuery(): Core.DefaultQuery | undefined;
136
+ protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
137
+ protected validateHeaders(headers: Core.Headers, customHeaders: Core.Headers): void;
138
+ protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
139
+ protected bearerAuth(opts: Core.FinalRequestOptions): Core.Headers;
140
+ protected basicAuth(opts: Core.FinalRequestOptions): Core.Headers;
141
+ static Finch: typeof Finch;
142
+ static FinchError: typeof Errors.FinchError;
143
+ static APIError: typeof Errors.APIError;
144
+ static APIConnectionError: typeof Errors.APIConnectionError;
145
+ static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
146
+ static APIUserAbortError: typeof Errors.APIUserAbortError;
147
+ static NotFoundError: typeof Errors.NotFoundError;
148
+ static ConflictError: typeof Errors.ConflictError;
149
+ static RateLimitError: typeof Errors.RateLimitError;
150
+ static BadRequestError: typeof Errors.BadRequestError;
151
+ static AuthenticationError: typeof Errors.AuthenticationError;
152
+ static InternalServerError: typeof Errors.InternalServerError;
153
+ static PermissionDeniedError: typeof Errors.PermissionDeniedError;
154
+ static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
155
+ static toFile: typeof Uploads.toFile;
156
+ static fileFromPath: typeof Uploads.fileFromPath;
157
+ }
158
+ export declare const FinchError: typeof Errors.FinchError, APIError: typeof Errors.APIError, APIConnectionError: typeof Errors.APIConnectionError, APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError, APIUserAbortError: typeof Errors.APIUserAbortError, NotFoundError: typeof Errors.NotFoundError, ConflictError: typeof Errors.ConflictError, RateLimitError: typeof Errors.RateLimitError, BadRequestError: typeof Errors.BadRequestError, AuthenticationError: typeof Errors.AuthenticationError, InternalServerError: typeof Errors.InternalServerError, PermissionDeniedError: typeof Errors.PermissionDeniedError, UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
6
159
  export import toFile = Uploads.toFile;
7
160
  export import fileFromPath = Uploads.fileFromPath;
8
- export declare const FinchError: typeof Errors.FinchError, APIError: typeof Errors.APIError, APIConnectionError: typeof Errors.APIConnectionError, APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError, APIUserAbortError: typeof Errors.APIUserAbortError, NotFoundError: typeof Errors.NotFoundError, ConflictError: typeof Errors.ConflictError, RateLimitError: typeof Errors.RateLimitError, BadRequestError: typeof Errors.BadRequestError, AuthenticationError: typeof Errors.AuthenticationError, InternalServerError: typeof Errors.InternalServerError, PermissionDeniedError: typeof Errors.PermissionDeniedError, UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
9
- export * from "./client.js";
161
+ export declare namespace Finch {
162
+ export import RequestOptions = Core.RequestOptions;
163
+ export import SinglePage = Pagination.SinglePage;
164
+ export import SinglePageResponse = Pagination.SinglePageResponse;
165
+ export import ResponsesPage = Pagination.ResponsesPage;
166
+ export import ResponsesPageResponse = Pagination.ResponsesPageResponse;
167
+ export import IndividualsPage = Pagination.IndividualsPage;
168
+ export import IndividualsPageParams = Pagination.IndividualsPageParams;
169
+ export import IndividualsPageResponse = Pagination.IndividualsPageResponse;
170
+ export import Page = Pagination.Page;
171
+ export import PageParams = Pagination.PageParams;
172
+ export import PageResponse = Pagination.PageResponse;
173
+ export import AccessTokens = API.AccessTokens;
174
+ export import CreateAccessTokenResponse = API.CreateAccessTokenResponse;
175
+ export import AccessTokenCreateParams = API.AccessTokenCreateParams;
176
+ export import HRIS = API.HRIS;
177
+ export import Income = API.Income;
178
+ export import Location = API.Location;
179
+ export import Money = API.Money;
180
+ export import Providers = API.Providers;
181
+ export import Provider = API.Provider;
182
+ export import ProvidersSinglePage = API.ProvidersSinglePage;
183
+ export import Account = API.Account;
184
+ export import DisconnectResponse = API.DisconnectResponse;
185
+ export import Introspection = API.Introspection;
186
+ export import Webhooks = API.Webhooks;
187
+ export import AccountUpdateEvent = API.AccountUpdateEvent;
188
+ export import BaseWebhookEvent = API.BaseWebhookEvent;
189
+ export import CompanyEvent = API.CompanyEvent;
190
+ export import DirectoryEvent = API.DirectoryEvent;
191
+ export import EmploymentEvent = API.EmploymentEvent;
192
+ export import IndividualEvent = API.IndividualEvent;
193
+ export import JobCompletionEvent = API.JobCompletionEvent;
194
+ export import PayStatementEvent = API.PayStatementEvent;
195
+ export import PaymentEvent = API.PaymentEvent;
196
+ export import WebhookEvent = API.WebhookEvent;
197
+ export import RequestForwarding = API.RequestForwarding;
198
+ export import RequestForwardingForwardResponse = API.RequestForwardingForwardResponse;
199
+ export import RequestForwardingForwardParams = API.RequestForwardingForwardParams;
200
+ export import Jobs = API.Jobs;
201
+ export import Sandbox = API.Sandbox;
202
+ export import ConnectionStatusType = API.ConnectionStatusType;
203
+ export import OperationSupport = API.OperationSupport;
204
+ export import OperationSupportMatrix = API.OperationSupportMatrix;
205
+ export import Paging = API.Paging;
206
+ }
207
+ export default Finch;
10
208
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,eAAe,KAAK,CAAC;AAErB,MAAM,QAAQ,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AACtC,MAAM,QAAQ,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAElD,eAAO,MACL,UAAU,4BACV,QAAQ,0BACR,kBAAkB,oCAClB,yBAAyB,2CACzB,iBAAiB,mCACjB,aAAa,+BACb,aAAa,+BACb,cAAc,gCACd,eAAe,iCACf,mBAAmB,qCACnB,mBAAmB,qCACnB,qBAAqB,uCACrB,wBAAwB,wCAChB,CAAC;AAEX,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,GAAG,MAAM,qCAAqC,CAAC;AAE3D,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAErC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEzC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,S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