@vitable-inc/vitable-connect 0.1.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 +52 -0
- package/LICENSE +201 -0
- package/README.md +400 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +225 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +225 -0
- package/client.d.ts.map +1 -0
- package/client.js +509 -0
- package/client.js.map +1 -0
- package/client.mjs +505 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +60 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +60 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +101 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +95 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +7 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +40 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +37 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +8 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +8 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +12 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +9 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +168 -0
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/auth.d.mts +92 -0
- package/resources/auth.d.mts.map +1 -0
- package/resources/auth.d.ts +92 -0
- package/resources/auth.d.ts.map +1 -0
- package/resources/auth.js +27 -0
- package/resources/auth.js.map +1 -0
- package/resources/auth.mjs +23 -0
- package/resources/auth.mjs.map +1 -0
- package/resources/benefit-eligibility-policies.d.mts +31 -0
- package/resources/benefit-eligibility-policies.d.mts.map +1 -0
- package/resources/benefit-eligibility-policies.d.ts +31 -0
- package/resources/benefit-eligibility-policies.d.ts.map +1 -0
- package/resources/benefit-eligibility-policies.js +19 -0
- package/resources/benefit-eligibility-policies.js.map +1 -0
- package/resources/benefit-eligibility-policies.mjs +15 -0
- package/resources/benefit-eligibility-policies.mjs.map +1 -0
- package/resources/employees.d.mts +184 -0
- package/resources/employees.d.mts.map +1 -0
- package/resources/employees.d.ts +184 -0
- package/resources/employees.d.ts.map +1 -0
- package/resources/employees.js +24 -0
- package/resources/employees.js.map +1 -0
- package/resources/employees.mjs +20 -0
- package/resources/employees.mjs.map +1 -0
- package/resources/employers.d.mts +412 -0
- package/resources/employers.d.mts.map +1 -0
- package/resources/employers.d.ts +412 -0
- package/resources/employers.d.ts.map +1 -0
- package/resources/employers.js +144 -0
- package/resources/employers.js.map +1 -0
- package/resources/employers.mjs +140 -0
- package/resources/employers.mjs.map +1 -0
- package/resources/enrollments.d.mts +128 -0
- package/resources/enrollments.d.mts.map +1 -0
- package/resources/enrollments.d.ts +128 -0
- package/resources/enrollments.d.ts.map +1 -0
- package/resources/enrollments.js +19 -0
- package/resources/enrollments.js.map +1 -0
- package/resources/enrollments.mjs +15 -0
- package/resources/enrollments.mjs.map +1 -0
- package/resources/index.d.mts +7 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +7 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +17 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/webhook-events.d.mts +132 -0
- package/resources/webhook-events.d.mts.map +1 -0
- package/resources/webhook-events.d.ts +132 -0
- package/resources/webhook-events.d.ts.map +1 -0
- package/resources/webhook-events.js +33 -0
- package/resources/webhook-events.js.map +1 -0
- package/resources/webhook-events.mjs +29 -0
- package/resources/webhook-events.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +893 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +166 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +23 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +56 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +9 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/auth.ts +115 -0
- package/src/resources/benefit-eligibility-policies.ts +48 -0
- package/src/resources/employees.ts +247 -0
- package/src/resources/employers.ts +581 -0
- package/src/resources/enrollments.ts +173 -0
- package/src/resources/index.ts +44 -0
- package/src/resources/webhook-events.ts +187 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as BenefitEligibilityPoliciesAPI from './benefit-eligibility-policies';
|
|
5
|
+
import * as EmployeesAPI from './employees';
|
|
6
|
+
import { EmployeesPageNumberPage } from './employees';
|
|
7
|
+
import { APIPromise } from '../core/api-promise';
|
|
8
|
+
import { PageNumberPage, type PageNumberPageParams, PagePromise } from '../core/pagination';
|
|
9
|
+
import { RequestOptions } from '../internal/request-options';
|
|
10
|
+
import { path } from '../internal/utils/path';
|
|
11
|
+
|
|
12
|
+
export class Employers extends APIResource {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new employer for the authenticated organization. Requires employer
|
|
15
|
+
* name, legal name, EIN, email, and address information. Returns the created
|
|
16
|
+
* employer with its assigned ID.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const employerResponse = await client.employers.create({
|
|
21
|
+
* address: {
|
|
22
|
+
* address_line_1: '789 Business Blvd',
|
|
23
|
+
* address_line_2: 'Floor 5',
|
|
24
|
+
* city: 'Seattle',
|
|
25
|
+
* state: 'WA',
|
|
26
|
+
* zipcode: '98101',
|
|
27
|
+
* },
|
|
28
|
+
* ein: '12-3456789',
|
|
29
|
+
* email: 'hr@newco.com',
|
|
30
|
+
* legal_name: 'NewCo Industries LLC',
|
|
31
|
+
* name: 'NewCo Industries',
|
|
32
|
+
* phone_number: '2065550100',
|
|
33
|
+
* reference_id: 'partner-emp-001',
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
create(body: EmployerCreateParams, options?: RequestOptions): APIPromise<EmployerResponse> {
|
|
38
|
+
return this._client.post('/v1/employers', { body, ...options });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves detailed information for a specific employer by ID. The employer must
|
|
43
|
+
* belong to the authenticated organization.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const employerResponse = await client.employers.retrieve(
|
|
48
|
+
* 'empr_abc123def456',
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
retrieve(employerID: string, options?: RequestOptions): APIPromise<EmployerResponse> {
|
|
53
|
+
return this._client.get(path`/v1/employers/${employerID}`, options);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves a paginated list of all employers belonging to the authenticated
|
|
58
|
+
* organization. Results are sorted by creation date (newest first) and paginated
|
|
59
|
+
* using page and limit parameters.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* // Automatically fetches more pages as needed.
|
|
64
|
+
* for await (const employer of client.employers.list()) {
|
|
65
|
+
* // ...
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
list(
|
|
70
|
+
query: EmployerListParams | null | undefined = {},
|
|
71
|
+
options?: RequestOptions,
|
|
72
|
+
): PagePromise<EmployersPageNumberPage, Employer> {
|
|
73
|
+
return this._client.getAPIList('/v1/employers', PageNumberPage<Employer>, { query, ...options });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Creates a benefit eligibility policy for the specified employer.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* const benefitEligibilityPolicyResponse =
|
|
82
|
+
* await client.employers.createBenefitEligibilityPolicy(
|
|
83
|
+
* 'empr_abc123def456',
|
|
84
|
+
* {
|
|
85
|
+
* classification: 'classification',
|
|
86
|
+
* waiting_period: 'waiting_period',
|
|
87
|
+
* },
|
|
88
|
+
* );
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
createBenefitEligibilityPolicy(
|
|
92
|
+
employerID: string,
|
|
93
|
+
body: EmployerCreateBenefitEligibilityPolicyParams,
|
|
94
|
+
options?: RequestOptions,
|
|
95
|
+
): APIPromise<BenefitEligibilityPoliciesAPI.BenefitEligibilityPolicyResponse> {
|
|
96
|
+
return this._client.post(path`/v1/employers/${employerID}/benefit-eligibility-policies`, {
|
|
97
|
+
body,
|
|
98
|
+
...options,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Retrieves a paginated list of all employees for a specific employer. Results are
|
|
104
|
+
* paginated using page and limit parameters.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* // Automatically fetches more pages as needed.
|
|
109
|
+
* for await (const employee of client.employers.listEmployees(
|
|
110
|
+
* 'empr_abc123def456',
|
|
111
|
+
* )) {
|
|
112
|
+
* // ...
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
listEmployees(
|
|
117
|
+
employerID: string,
|
|
118
|
+
query: EmployerListEmployeesParams | null | undefined = {},
|
|
119
|
+
options?: RequestOptions,
|
|
120
|
+
): PagePromise<EmployeesPageNumberPage, EmployeesAPI.Employee> {
|
|
121
|
+
return this._client.getAPIList(
|
|
122
|
+
path`/v1/employers/${employerID}/employees`,
|
|
123
|
+
PageNumberPage<EmployeesAPI.Employee>,
|
|
124
|
+
{ query, ...options },
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Submits a census sync payload for the specified employer. The employees in the
|
|
130
|
+
* payload will be queued for processing. Returns an accepted response with the
|
|
131
|
+
* timestamp of acceptance.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```ts
|
|
135
|
+
* const response = await client.employers.submitCensusSync('empr_abc123def456', {
|
|
136
|
+
* employees: [
|
|
137
|
+
* {
|
|
138
|
+
* reference_id: 'EMP-001',
|
|
139
|
+
* first_name: 'Jane',
|
|
140
|
+
* last_name: 'Doe',
|
|
141
|
+
* date_of_birth: '1990-05-15',
|
|
142
|
+
* email: 'jane.doe@acme.com',
|
|
143
|
+
* phone: '4155550100',
|
|
144
|
+
* address: { ... },
|
|
145
|
+
* start_date: '2024-01-15',
|
|
146
|
+
* employee_class: 'Full Time',
|
|
147
|
+
* compensation_type: 'Salary',
|
|
148
|
+
* },
|
|
149
|
+
* {
|
|
150
|
+
* first_name: 'John',
|
|
151
|
+
* last_name: 'Smith',
|
|
152
|
+
* date_of_birth: '1985-11-20',
|
|
153
|
+
* email: 'john.smith@acme.com',
|
|
154
|
+
* phone: '4155550101',
|
|
155
|
+
* start_date: '2024-03-01',
|
|
156
|
+
* employee_class: 'Part Time',
|
|
157
|
+
* compensation_type: 'Hourly',
|
|
158
|
+
* },
|
|
159
|
+
* ],
|
|
160
|
+
* });
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
submitCensusSync(
|
|
164
|
+
employerID: string,
|
|
165
|
+
body: EmployerSubmitCensusSyncParams,
|
|
166
|
+
options?: RequestOptions,
|
|
167
|
+
): APIPromise<EmployerSubmitCensusSyncResponse> {
|
|
168
|
+
return this._client.post(path`/v1/employers/${employerID}/census-sync`, { body, ...options });
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type EmployersPageNumberPage = PageNumberPage<Employer>;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Serializer for Employer entity in public API responses.
|
|
176
|
+
*/
|
|
177
|
+
export interface Employer {
|
|
178
|
+
/**
|
|
179
|
+
* Unique employer identifier with 'empr\_' prefix
|
|
180
|
+
*/
|
|
181
|
+
id: string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Whether the employer is currently active in the system
|
|
185
|
+
*/
|
|
186
|
+
active: boolean;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Nested address within EmployerSerializer.
|
|
190
|
+
*/
|
|
191
|
+
address: Employer.Address;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Timestamp when the employer was created
|
|
195
|
+
*/
|
|
196
|
+
created_at: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Employer Identification Number (masked in responses)
|
|
200
|
+
*/
|
|
201
|
+
ein: string | null;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* ID of the benefit eligibility policy (epol\_\*), if assigned
|
|
205
|
+
*/
|
|
206
|
+
eligibility_policy_id: string | null;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Legal business name for compliance and tax purposes
|
|
210
|
+
*/
|
|
211
|
+
legal_name: string;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Display name of the employer
|
|
215
|
+
*/
|
|
216
|
+
name: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* ID of the parent organization (org\_\*)
|
|
220
|
+
*/
|
|
221
|
+
organization_id: string | null;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Timestamp when the employer was last updated
|
|
225
|
+
*/
|
|
226
|
+
updated_at: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Email address for billing and communications
|
|
230
|
+
*/
|
|
231
|
+
email?: string | null;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Employer phone number (E.164 format recommended)
|
|
235
|
+
*/
|
|
236
|
+
phone_number?: string | null;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Partner-assigned reference ID for the employer
|
|
240
|
+
*/
|
|
241
|
+
reference_id?: string | null;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export namespace Employer {
|
|
245
|
+
/**
|
|
246
|
+
* Nested address within EmployerSerializer.
|
|
247
|
+
*/
|
|
248
|
+
export interface Address {
|
|
249
|
+
/**
|
|
250
|
+
* Primary street address
|
|
251
|
+
*/
|
|
252
|
+
address_line_1: string;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* City name
|
|
256
|
+
*/
|
|
257
|
+
city: string;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Two-letter state code (e.g., CA, NY)
|
|
261
|
+
*/
|
|
262
|
+
state: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* ZIP code (5 or 9 digit)
|
|
266
|
+
*/
|
|
267
|
+
zipcode: string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Secondary street address (apt, suite, etc.)
|
|
271
|
+
*/
|
|
272
|
+
address_line_2?: string | null;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Response containing a single employer resource.
|
|
278
|
+
*/
|
|
279
|
+
export interface EmployerResponse {
|
|
280
|
+
/**
|
|
281
|
+
* Serializer for Employer entity in public API responses.
|
|
282
|
+
*/
|
|
283
|
+
data: Employer;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Response containing a single census sync detail resource.
|
|
288
|
+
*/
|
|
289
|
+
export interface EmployerSubmitCensusSyncResponse {
|
|
290
|
+
data: EmployerSubmitCensusSyncResponse.Data;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export namespace EmployerSubmitCensusSyncResponse {
|
|
294
|
+
export interface Data {
|
|
295
|
+
accepted_at: string;
|
|
296
|
+
|
|
297
|
+
employer_id: string;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export interface EmployerCreateParams {
|
|
302
|
+
/**
|
|
303
|
+
* Employer address
|
|
304
|
+
*/
|
|
305
|
+
address: EmployerCreateParams.Address;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Employer Identification Number (format: XX-XXXXXXX)
|
|
309
|
+
*/
|
|
310
|
+
ein: string;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Email address for billing and communications
|
|
314
|
+
*/
|
|
315
|
+
email: string;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Legal business name
|
|
319
|
+
*/
|
|
320
|
+
legal_name: string;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Employer display name
|
|
324
|
+
*/
|
|
325
|
+
name: string;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Employer phone number (10-digit US format, e.g. 5551234567)
|
|
329
|
+
*/
|
|
330
|
+
phone_number?: string | null;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* External reference ID for this employer
|
|
334
|
+
*/
|
|
335
|
+
reference_id?: string | null;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export namespace EmployerCreateParams {
|
|
339
|
+
/**
|
|
340
|
+
* Employer address
|
|
341
|
+
*/
|
|
342
|
+
export interface Address {
|
|
343
|
+
/**
|
|
344
|
+
* Primary street address
|
|
345
|
+
*/
|
|
346
|
+
address_line_1: string;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* City name
|
|
350
|
+
*/
|
|
351
|
+
city: string;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Two-letter state code
|
|
355
|
+
*/
|
|
356
|
+
state: string;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* ZIP code
|
|
360
|
+
*/
|
|
361
|
+
zipcode: string;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Secondary street address
|
|
365
|
+
*/
|
|
366
|
+
address_line_2?: string | null;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export interface EmployerListParams extends PageNumberPageParams {}
|
|
371
|
+
|
|
372
|
+
export interface EmployerCreateBenefitEligibilityPolicyParams {
|
|
373
|
+
/**
|
|
374
|
+
* Which employee classifications are eligible. One of: full_time, part_time, all
|
|
375
|
+
*/
|
|
376
|
+
classification: string;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Waiting period before eligibility. One of: first_of_following_month, 30_days,
|
|
380
|
+
* 60_days, none
|
|
381
|
+
*/
|
|
382
|
+
waiting_period: string;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface EmployerListEmployeesParams extends PageNumberPageParams {}
|
|
386
|
+
|
|
387
|
+
export interface EmployerSubmitCensusSyncParams {
|
|
388
|
+
employees: Array<EmployerSubmitCensusSyncParams.Employee>;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
export namespace EmployerSubmitCensusSyncParams {
|
|
392
|
+
export interface Employee {
|
|
393
|
+
date_of_birth: string;
|
|
394
|
+
|
|
395
|
+
email: string;
|
|
396
|
+
|
|
397
|
+
first_name: string;
|
|
398
|
+
|
|
399
|
+
last_name: string;
|
|
400
|
+
|
|
401
|
+
phone: string;
|
|
402
|
+
|
|
403
|
+
address?: Employee.Address | null;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* - `Salary` - Salary
|
|
407
|
+
* - `Hourly` - Hourly
|
|
408
|
+
*/
|
|
409
|
+
compensation_type?: 'Salary' | 'Hourly' | null;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* - `Full Time` - Full Time
|
|
413
|
+
* - `Part Time` - Part Time
|
|
414
|
+
* - `Temporary` - Temporary
|
|
415
|
+
* - `Intern` - Intern
|
|
416
|
+
* - `Seasonal` - Seasonal
|
|
417
|
+
* - `Individual Contractor` - Individual Contractor
|
|
418
|
+
*/
|
|
419
|
+
employee_class?: EmployeesAPI.EmployeeClass | null;
|
|
420
|
+
|
|
421
|
+
reference_id?: string | null;
|
|
422
|
+
|
|
423
|
+
start_date?: string | null;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export namespace Employee {
|
|
427
|
+
export interface Address {
|
|
428
|
+
address_line_1: string;
|
|
429
|
+
|
|
430
|
+
city: string;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* - `AL` - AL
|
|
434
|
+
* - `AK` - AK
|
|
435
|
+
* - `AZ` - AZ
|
|
436
|
+
* - `AR` - AR
|
|
437
|
+
* - `CA` - CA
|
|
438
|
+
* - `CO` - CO
|
|
439
|
+
* - `CT` - CT
|
|
440
|
+
* - `DC` - DC
|
|
441
|
+
* - `DE` - DE
|
|
442
|
+
* - `FL` - FL
|
|
443
|
+
* - `GA` - GA
|
|
444
|
+
* - `HI` - HI
|
|
445
|
+
* - `ID` - ID
|
|
446
|
+
* - `IL` - IL
|
|
447
|
+
* - `IN` - IN
|
|
448
|
+
* - `IA` - IA
|
|
449
|
+
* - `KS` - KS
|
|
450
|
+
* - `KY` - KY
|
|
451
|
+
* - `LA` - LA
|
|
452
|
+
* - `ME` - ME
|
|
453
|
+
* - `MD` - MD
|
|
454
|
+
* - `MA` - MA
|
|
455
|
+
* - `MI` - MI
|
|
456
|
+
* - `MN` - MN
|
|
457
|
+
* - `MS` - MS
|
|
458
|
+
* - `MO` - MO
|
|
459
|
+
* - `MT` - MT
|
|
460
|
+
* - `NE` - NE
|
|
461
|
+
* - `NV` - NV
|
|
462
|
+
* - `NH` - NH
|
|
463
|
+
* - `NJ` - NJ
|
|
464
|
+
* - `NM` - NM
|
|
465
|
+
* - `NY` - NY
|
|
466
|
+
* - `NC` - NC
|
|
467
|
+
* - `ND` - ND
|
|
468
|
+
* - `OH` - OH
|
|
469
|
+
* - `OK` - OK
|
|
470
|
+
* - `OR` - OR
|
|
471
|
+
* - `PA` - PA
|
|
472
|
+
* - `RI` - RI
|
|
473
|
+
* - `SC` - SC
|
|
474
|
+
* - `SD` - SD
|
|
475
|
+
* - `TN` - TN
|
|
476
|
+
* - `TX` - TX
|
|
477
|
+
* - `UT` - UT
|
|
478
|
+
* - `VT` - VT
|
|
479
|
+
* - `VA` - VA
|
|
480
|
+
* - `WA` - WA
|
|
481
|
+
* - `WI` - WI
|
|
482
|
+
* - `WV` - WV
|
|
483
|
+
* - `WY` - WY
|
|
484
|
+
* - `PR` - PR
|
|
485
|
+
* - `GU` - GU
|
|
486
|
+
* - `AS` - AS
|
|
487
|
+
* - `VI` - VI
|
|
488
|
+
* - `MP` - MP
|
|
489
|
+
* - `MH` - MH
|
|
490
|
+
* - `PW` - PW
|
|
491
|
+
* - `FM` - FM
|
|
492
|
+
* - `AE` - AE
|
|
493
|
+
* - `AA` - AA
|
|
494
|
+
* - `AP` - AP
|
|
495
|
+
*/
|
|
496
|
+
state:
|
|
497
|
+
| 'AL'
|
|
498
|
+
| 'AK'
|
|
499
|
+
| 'AZ'
|
|
500
|
+
| 'AR'
|
|
501
|
+
| 'CA'
|
|
502
|
+
| 'CO'
|
|
503
|
+
| 'CT'
|
|
504
|
+
| 'DC'
|
|
505
|
+
| 'DE'
|
|
506
|
+
| 'FL'
|
|
507
|
+
| 'GA'
|
|
508
|
+
| 'HI'
|
|
509
|
+
| 'ID'
|
|
510
|
+
| 'IL'
|
|
511
|
+
| 'IN'
|
|
512
|
+
| 'IA'
|
|
513
|
+
| 'KS'
|
|
514
|
+
| 'KY'
|
|
515
|
+
| 'LA'
|
|
516
|
+
| 'ME'
|
|
517
|
+
| 'MD'
|
|
518
|
+
| 'MA'
|
|
519
|
+
| 'MI'
|
|
520
|
+
| 'MN'
|
|
521
|
+
| 'MS'
|
|
522
|
+
| 'MO'
|
|
523
|
+
| 'MT'
|
|
524
|
+
| 'NE'
|
|
525
|
+
| 'NV'
|
|
526
|
+
| 'NH'
|
|
527
|
+
| 'NJ'
|
|
528
|
+
| 'NM'
|
|
529
|
+
| 'NY'
|
|
530
|
+
| 'NC'
|
|
531
|
+
| 'ND'
|
|
532
|
+
| 'OH'
|
|
533
|
+
| 'OK'
|
|
534
|
+
| 'OR'
|
|
535
|
+
| 'PA'
|
|
536
|
+
| 'RI'
|
|
537
|
+
| 'SC'
|
|
538
|
+
| 'SD'
|
|
539
|
+
| 'TN'
|
|
540
|
+
| 'TX'
|
|
541
|
+
| 'UT'
|
|
542
|
+
| 'VT'
|
|
543
|
+
| 'VA'
|
|
544
|
+
| 'WA'
|
|
545
|
+
| 'WI'
|
|
546
|
+
| 'WV'
|
|
547
|
+
| 'WY'
|
|
548
|
+
| 'PR'
|
|
549
|
+
| 'GU'
|
|
550
|
+
| 'AS'
|
|
551
|
+
| 'VI'
|
|
552
|
+
| 'MP'
|
|
553
|
+
| 'MH'
|
|
554
|
+
| 'PW'
|
|
555
|
+
| 'FM'
|
|
556
|
+
| 'AE'
|
|
557
|
+
| 'AA'
|
|
558
|
+
| 'AP';
|
|
559
|
+
|
|
560
|
+
zipcode: string;
|
|
561
|
+
|
|
562
|
+
address_line_2?: string | null;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export declare namespace Employers {
|
|
568
|
+
export {
|
|
569
|
+
type Employer as Employer,
|
|
570
|
+
type EmployerResponse as EmployerResponse,
|
|
571
|
+
type EmployerSubmitCensusSyncResponse as EmployerSubmitCensusSyncResponse,
|
|
572
|
+
type EmployersPageNumberPage as EmployersPageNumberPage,
|
|
573
|
+
type EmployerCreateParams as EmployerCreateParams,
|
|
574
|
+
type EmployerListParams as EmployerListParams,
|
|
575
|
+
type EmployerCreateBenefitEligibilityPolicyParams as EmployerCreateBenefitEligibilityPolicyParams,
|
|
576
|
+
type EmployerListEmployeesParams as EmployerListEmployeesParams,
|
|
577
|
+
type EmployerSubmitCensusSyncParams as EmployerSubmitCensusSyncParams,
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export { type EmployeesPageNumberPage };
|