@tryfinch/finch-api 1.0.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/.eslintrc.js +10 -0
- package/.github/workflows/publish-npm.yml +28 -0
- package/.github/workflows/release-doctor.yml +20 -0
- package/.github/workflows/release.yml +38 -0
- package/.prettierrc +6 -0
- package/.release-please-manifest.json +3 -0
- package/.stats.yml +1 -0
- package/CHANGELOG.md +7 -0
- package/LICENSE +201 -0
- package/README.md +220 -0
- package/api.md +186 -0
- package/bin/check-release-environment +25 -0
- package/bin/check-test-server +50 -0
- package/bin/publish-npm +6 -0
- package/build +12 -0
- package/check-version.ts +18 -0
- package/core.ts +926 -0
- package/dist/cjs/check-version.d.ts +2 -0
- package/dist/cjs/check-version.d.ts.map +1 -0
- package/dist/cjs/check-version.js +23 -0
- package/dist/cjs/check-version.js.map +1 -0
- package/dist/cjs/core.d.ts +268 -0
- package/dist/cjs/core.d.ts.map +1 -0
- package/dist/cjs/core.js +994 -0
- package/dist/cjs/core.js.map +1 -0
- package/dist/cjs/fetch-polyfill.d.ts +6 -0
- package/dist/cjs/fetch-polyfill.d.ts.map +1 -0
- package/dist/cjs/fetch-polyfill.js +57 -0
- package/dist/cjs/fetch-polyfill.js.map +1 -0
- package/dist/cjs/index.d.ts +115 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +198 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/pagination.d.ts +166 -0
- package/dist/cjs/pagination.d.ts.map +1 -0
- package/dist/cjs/pagination.js +215 -0
- package/dist/cjs/pagination.js.map +1 -0
- package/dist/cjs/resource.d.ts +12 -0
- package/dist/cjs/resource.d.ts.map +1 -0
- package/dist/cjs/resource.js +17 -0
- package/dist/cjs/resource.js.map +1 -0
- package/dist/cjs/resources/account.d.ts +49 -0
- package/dist/cjs/resources/account.d.ts.map +1 -0
- package/dist/cjs/resources/account.js +23 -0
- package/dist/cjs/resources/account.js.map +1 -0
- package/dist/cjs/resources/ats/applications.d.ts +31 -0
- package/dist/cjs/resources/ats/applications.d.ts.map +1 -0
- package/dist/cjs/resources/ats/applications.js +27 -0
- package/dist/cjs/resources/ats/applications.js.map +1 -0
- package/dist/cjs/resources/ats/ats.d.ts +14 -0
- package/dist/cjs/resources/ats/ats.d.ts.map +1 -0
- package/dist/cjs/resources/ats/ats.js +22 -0
- package/dist/cjs/resources/ats/ats.js.map +1 -0
- package/dist/cjs/resources/ats/candidates.d.ts +45 -0
- package/dist/cjs/resources/ats/candidates.d.ts.map +1 -0
- package/dist/cjs/resources/ats/candidates.js +24 -0
- package/dist/cjs/resources/ats/candidates.js.map +1 -0
- package/dist/cjs/resources/ats/index.d.ts +6 -0
- package/dist/cjs/resources/ats/index.d.ts.map +1 -0
- package/dist/cjs/resources/ats/index.js +12 -0
- package/dist/cjs/resources/ats/index.js.map +1 -0
- package/dist/cjs/resources/ats/jobs.d.ts +42 -0
- package/dist/cjs/resources/ats/jobs.d.ts.map +1 -0
- package/dist/cjs/resources/ats/jobs.js +23 -0
- package/dist/cjs/resources/ats/jobs.js.map +1 -0
- package/dist/cjs/resources/ats/offers.d.ts +34 -0
- package/dist/cjs/resources/ats/offers.d.ts.map +1 -0
- package/dist/cjs/resources/ats/offers.js +23 -0
- package/dist/cjs/resources/ats/offers.js.map +1 -0
- package/dist/cjs/resources/ats/stages.d.ts +23 -0
- package/dist/cjs/resources/ats/stages.d.ts.map +1 -0
- package/dist/cjs/resources/ats/stages.js +21 -0
- package/dist/cjs/resources/ats/stages.js.map +1 -0
- package/dist/cjs/resources/hris/benefits/benefits.d.ts +155 -0
- package/dist/cjs/resources/hris/benefits/benefits.d.ts.map +1 -0
- package/dist/cjs/resources/hris/benefits/benefits.js +57 -0
- package/dist/cjs/resources/hris/benefits/benefits.js.map +1 -0
- package/dist/cjs/resources/hris/benefits/index.d.ts +26 -0
- package/dist/cjs/resources/hris/benefits/index.d.ts.map +1 -0
- package/dist/cjs/resources/hris/benefits/index.js +42 -0
- package/dist/cjs/resources/hris/benefits/index.js.map +1 -0
- package/dist/cjs/resources/hris/benefits/individuals.d.ts +163 -0
- package/dist/cjs/resources/hris/benefits/individuals.d.ts.map +1 -0
- package/dist/cjs/resources/hris/benefits/individuals.js +68 -0
- package/dist/cjs/resources/hris/benefits/individuals.js.map +1 -0
- package/dist/cjs/resources/hris/company.d.ts +104 -0
- package/dist/cjs/resources/hris/company.d.ts.map +1 -0
- package/dist/cjs/resources/hris/company.js +15 -0
- package/dist/cjs/resources/hris/company.js.map +1 -0
- package/dist/cjs/resources/hris/directory.d.ts +65 -0
- package/dist/cjs/resources/hris/directory.d.ts.map +1 -0
- package/dist/cjs/resources/hris/directory.js +21 -0
- package/dist/cjs/resources/hris/directory.js.map +1 -0
- package/dist/cjs/resources/hris/hris.d.ts +95 -0
- package/dist/cjs/resources/hris/hris.d.ts.map +1 -0
- package/dist/cjs/resources/hris/hris.js +24 -0
- package/dist/cjs/resources/hris/hris.js.map +1 -0
- package/dist/cjs/resources/hris/index.d.ts +31 -0
- package/dist/cjs/resources/hris/index.d.ts.map +1 -0
- package/dist/cjs/resources/hris/index.js +44 -0
- package/dist/cjs/resources/hris/index.js.map +1 -0
- package/dist/cjs/resources/hris/individuals/employment-data.d.ts +151 -0
- package/dist/cjs/resources/hris/individuals/employment-data.d.ts.map +1 -0
- package/dist/cjs/resources/hris/individuals/employment-data.js +26 -0
- package/dist/cjs/resources/hris/individuals/employment-data.js.map +1 -0
- package/dist/cjs/resources/hris/individuals/index.d.ts +13 -0
- package/dist/cjs/resources/hris/individuals/index.d.ts.map +1 -0
- package/dist/cjs/resources/hris/individuals/index.js +28 -0
- package/dist/cjs/resources/hris/individuals/index.js.map +1 -0
- package/dist/cjs/resources/hris/individuals/individuals.d.ts +86 -0
- package/dist/cjs/resources/hris/individuals/individuals.d.ts.map +1 -0
- package/dist/cjs/resources/hris/individuals/individuals.js +28 -0
- package/dist/cjs/resources/hris/individuals/individuals.js.map +1 -0
- package/dist/cjs/resources/hris/pay-statements.d.ts +201 -0
- package/dist/cjs/resources/hris/pay-statements.d.ts.map +1 -0
- package/dist/cjs/resources/hris/pay-statements.js +25 -0
- package/dist/cjs/resources/hris/pay-statements.js.map +1 -0
- package/dist/cjs/resources/hris/payments.d.ts +54 -0
- package/dist/cjs/resources/hris/payments.d.ts.map +1 -0
- package/dist/cjs/resources/hris/payments.js +18 -0
- package/dist/cjs/resources/hris/payments.js.map +1 -0
- package/dist/cjs/resources/index.d.ts +5 -0
- package/dist/cjs/resources/index.d.ts.map +1 -0
- package/dist/cjs/resources/index.js +39 -0
- package/dist/cjs/resources/index.js.map +1 -0
- package/dist/cjs/resources/providers.d.ts +46 -0
- package/dist/cjs/resources/providers.d.ts.map +1 -0
- package/dist/cjs/resources/providers.js +18 -0
- package/dist/cjs/resources/providers.js.map +1 -0
- package/dist/cjs/resources/top-level.d.ts +2 -0
- package/dist/cjs/resources/top-level.d.ts.map +1 -0
- package/dist/cjs/resources/top-level.js +4 -0
- package/dist/cjs/resources/top-level.js.map +1 -0
- package/dist/cjs/tests/api-resources/account.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/account.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/account.test.js +66 -0
- package/dist/cjs/tests/api-resources/account.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/ats/applications.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/ats/applications.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/ats/applications.test.js +73 -0
- package/dist/cjs/tests/api-resources/ats/applications.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/ats/candidates.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/ats/candidates.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/ats/candidates.test.js +73 -0
- package/dist/cjs/tests/api-resources/ats/candidates.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/ats/jobs.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/ats/jobs.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/ats/jobs.test.js +73 -0
- package/dist/cjs/tests/api-resources/ats/jobs.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/ats/offers.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/ats/offers.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/ats/offers.test.js +73 -0
- package/dist/cjs/tests/api-resources/ats/offers.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/ats/stages.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/ats/stages.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/ats/stages.test.js +55 -0
- package/dist/cjs/tests/api-resources/ats/stages.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/hris/benefits/benefits.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/hris/benefits/benefits.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/hris/benefits/benefits.test.js +116 -0
- package/dist/cjs/tests/api-resources/hris/benefits/benefits.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/hris/benefits/individuals.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/hris/benefits/individuals.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/hris/benefits/individuals.test.js +103 -0
- package/dist/cjs/tests/api-resources/hris/benefits/individuals.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/hris/company.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/hris/company.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/hris/company.test.js +55 -0
- package/dist/cjs/tests/api-resources/hris/company.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/hris/directory.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/hris/directory.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/hris/directory.test.js +62 -0
- package/dist/cjs/tests/api-resources/hris/directory.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/hris/individuals/employment-data.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/hris/individuals/employment-data.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/hris/individuals/employment-data.test.js +56 -0
- package/dist/cjs/tests/api-resources/hris/individuals/employment-data.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/hris/individuals/individuals.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/hris/individuals/individuals.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/hris/individuals/individuals.test.js +68 -0
- package/dist/cjs/tests/api-resources/hris/individuals/individuals.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/hris/pay-statements.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/hris/pay-statements.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/hris/pay-statements.test.js +64 -0
- package/dist/cjs/tests/api-resources/hris/pay-statements.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/hris/payments.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/hris/payments.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/hris/payments.test.js +52 -0
- package/dist/cjs/tests/api-resources/hris/payments.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/providers.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/providers.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/providers.test.js +55 -0
- package/dist/cjs/tests/api-resources/providers.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/top-level.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/top-level.test.js +52 -0
- package/dist/cjs/tests/api-resources/top-level.test.js.map +1 -0
- package/dist/cjs/tests/form.test.d.ts +2 -0
- package/dist/cjs/tests/form.test.d.ts.map +1 -0
- package/dist/cjs/tests/form.test.js +61 -0
- package/dist/cjs/tests/form.test.js.map +1 -0
- package/dist/cjs/tests/index.test.d.ts +2 -0
- package/dist/cjs/tests/index.test.d.ts.map +1 -0
- package/dist/cjs/tests/index.test.js +34 -0
- package/dist/cjs/tests/index.test.js.map +1 -0
- package/dist/cjs/tests/responses.test.d.ts +2 -0
- package/dist/cjs/tests/responses.test.d.ts.map +1 -0
- package/dist/cjs/tests/responses.test.js +60 -0
- package/dist/cjs/tests/responses.test.js.map +1 -0
- package/dist/cjs/version.d.ts +2 -0
- package/dist/cjs/version.d.ts.map +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/version.js.map +1 -0
- package/fetch-polyfill.ts +69 -0
- package/index.ts +212 -0
- package/jest.config.js +8 -0
- package/package.json +47 -0
- package/pagination.ts +401 -0
- package/release-please-config.json +12 -0
- package/resource.ts +24 -0
- package/resources/account.ts +63 -0
- package/resources/ats/applications.ts +55 -0
- package/resources/ats/ats.ts +16 -0
- package/resources/ats/candidates.ts +74 -0
- package/resources/ats/index.ts +7 -0
- package/resources/ats/jobs.ts +70 -0
- package/resources/ats/offers.ts +57 -0
- package/resources/ats/stages.ts +31 -0
- package/resources/hris/benefits/benefits.ts +214 -0
- package/resources/hris/benefits/index.ts +27 -0
- package/resources/hris/benefits/individuals.ts +234 -0
- package/resources/hris/company.ts +127 -0
- package/resources/hris/directory.ts +87 -0
- package/resources/hris/hris.ts +113 -0
- package/resources/hris/index.ts +32 -0
- package/resources/hris/individuals/employment-data.ts +188 -0
- package/resources/hris/individuals/index.ts +14 -0
- package/resources/hris/individuals/individuals.ts +128 -0
- package/resources/hris/pay-statements.ts +251 -0
- package/resources/hris/payments.ts +73 -0
- package/resources/index.ts +6 -0
- package/resources/providers.ts +59 -0
- package/resources/top-level.ts +3 -0
- package/tests/api-resources/account.test.ts +29 -0
- package/tests/api-resources/ats/applications.test.ts +36 -0
- package/tests/api-resources/ats/candidates.test.ts +36 -0
- package/tests/api-resources/ats/jobs.test.ts +36 -0
- package/tests/api-resources/ats/offers.test.ts +36 -0
- package/tests/api-resources/ats/stages.test.ts +18 -0
- package/tests/api-resources/hris/benefits/benefits.test.ts +79 -0
- package/tests/api-resources/hris/benefits/individuals.test.ts +66 -0
- package/tests/api-resources/hris/company.test.ts +18 -0
- package/tests/api-resources/hris/directory.test.ts +25 -0
- package/tests/api-resources/hris/individuals/employment-data.test.ts +19 -0
- package/tests/api-resources/hris/individuals/individuals.test.ts +31 -0
- package/tests/api-resources/hris/pay-statements.test.ts +27 -0
- package/tests/api-resources/hris/payments.test.ts +15 -0
- package/tests/api-resources/providers.test.ts +18 -0
- package/tests/api-resources/top-level.test.ts +15 -0
- package/tests/form.test.ts +27 -0
- package/tests/index.test.ts +34 -0
- package/tests/responses.test.ts +25 -0
- package/tsconfig.cjs.json +8 -0
- package/tsconfig.json +39 -0
- package/typings/digest-fetch/index.d.ts +33 -0
- package/version.ts +1 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('resource individuals', () => {
|
|
8
|
+
test('enrollMany', async () => {
|
|
9
|
+
const response = await finch.hris.benefits.individuals.enrollMany('string', [{}, {}, {}]);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('enrolledIds', async () => {
|
|
13
|
+
const response = await finch.hris.benefits.individuals.enrolledIds('string');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('enrolledIds: request options instead of params are passed correctly', async () => {
|
|
17
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
18
|
+
await expect(
|
|
19
|
+
finch.hris.benefits.individuals.enrolledIds('string', { path: '/_stainless_unknown_path' }),
|
|
20
|
+
).rejects.toThrow(Finch.NotFoundError);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('retrieveManyBenefits', async () => {
|
|
24
|
+
const response = await finch.hris.benefits.individuals.retrieveManyBenefits('string');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('retrieveManyBenefits: request options instead of params are passed correctly', async () => {
|
|
28
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
29
|
+
await expect(
|
|
30
|
+
finch.hris.benefits.individuals.retrieveManyBenefits('string', { path: '/_stainless_unknown_path' }),
|
|
31
|
+
).rejects.toThrow(Finch.NotFoundError);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('retrieveManyBenefits: request options and params are passed correctly', async () => {
|
|
35
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
36
|
+
await expect(
|
|
37
|
+
finch.hris.benefits.individuals.retrieveManyBenefits(
|
|
38
|
+
'string',
|
|
39
|
+
{ individual_ids: 'd675d2b7-6d7b-41a8-b2d3-001eb3fb88f6,d02a6346-1f08-4312-a064-49ff3cafaa7a' },
|
|
40
|
+
{ path: '/_stainless_unknown_path' },
|
|
41
|
+
),
|
|
42
|
+
).rejects.toThrow(Finch.NotFoundError);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('unenroll', async () => {
|
|
46
|
+
const response = await finch.hris.benefits.individuals.unenroll('string');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('unenroll: request options instead of params are passed correctly', async () => {
|
|
50
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
51
|
+
await expect(
|
|
52
|
+
finch.hris.benefits.individuals.unenroll('string', { path: '/_stainless_unknown_path' }),
|
|
53
|
+
).rejects.toThrow(Finch.NotFoundError);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test('unenroll: request options and params are passed correctly', async () => {
|
|
57
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
58
|
+
await expect(
|
|
59
|
+
finch.hris.benefits.individuals.unenroll(
|
|
60
|
+
'string',
|
|
61
|
+
{ individual_ids: ['string', 'string', 'string'] },
|
|
62
|
+
{ path: '/_stainless_unknown_path' },
|
|
63
|
+
),
|
|
64
|
+
).rejects.toThrow(Finch.NotFoundError);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('resource company', () => {
|
|
8
|
+
test('retrieve', async () => {
|
|
9
|
+
const response = await finch.hris.company.retrieve();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('retrieve: request options instead of params are passed correctly', async () => {
|
|
13
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
14
|
+
await expect(finch.hris.company.retrieve({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
15
|
+
Finch.NotFoundError,
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('resource directory', () => {
|
|
8
|
+
test('listIndividuals', async () => {
|
|
9
|
+
const response = await finch.hris.directory.listIndividuals();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('listIndividuals: request options instead of params are passed correctly', async () => {
|
|
13
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
14
|
+
await expect(finch.hris.directory.listIndividuals({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
15
|
+
Finch.NotFoundError,
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('listIndividuals: request options and params are passed correctly', async () => {
|
|
20
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
21
|
+
await expect(
|
|
22
|
+
finch.hris.directory.listIndividuals({ limit: 0, offset: 0 }, { path: '/_stainless_unknown_path' }),
|
|
23
|
+
).rejects.toThrow(Finch.NotFoundError);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('resource employmentData', () => {
|
|
8
|
+
test('retrieveMany: only required params', async () => {
|
|
9
|
+
const response = await finch.hris.individuals.employmentData.retrieveMany({
|
|
10
|
+
requests: [{ individual_id: 'string' }, { individual_id: 'string' }, { individual_id: 'string' }],
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('retrieveMany: required and optional params', async () => {
|
|
15
|
+
const response = await finch.hris.individuals.employmentData.retrieveMany({
|
|
16
|
+
requests: [{ individual_id: 'string' }, { individual_id: 'string' }, { individual_id: 'string' }],
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('resource individuals', () => {
|
|
8
|
+
test('retrieveMany', async () => {
|
|
9
|
+
const response = await finch.hris.individuals.retrieveMany();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('retrieveMany: request options instead of params are passed correctly', async () => {
|
|
13
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
14
|
+
await expect(finch.hris.individuals.retrieveMany({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
15
|
+
Finch.NotFoundError,
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('retrieveMany: request options and params are passed correctly', async () => {
|
|
20
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
21
|
+
await expect(
|
|
22
|
+
finch.hris.individuals.retrieveMany(
|
|
23
|
+
{
|
|
24
|
+
options: { include: ['string', 'string', 'string'] },
|
|
25
|
+
requests: [{ individual_id: 'string' }, { individual_id: 'string' }, { individual_id: 'string' }],
|
|
26
|
+
},
|
|
27
|
+
{ path: '/_stainless_unknown_path' },
|
|
28
|
+
),
|
|
29
|
+
).rejects.toThrow(Finch.NotFoundError);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('resource payStatements', () => {
|
|
8
|
+
test('retrieveMany: only required params', async () => {
|
|
9
|
+
const response = await finch.hris.payStatements.retrieveMany({
|
|
10
|
+
requests: [
|
|
11
|
+
{ payment_id: 'e8b90071-0c11-471c-86e8-e303ef2f6782' },
|
|
12
|
+
{ payment_id: 'e8b90071-0c11-471c-86e8-e303ef2f6782' },
|
|
13
|
+
{ payment_id: 'e8b90071-0c11-471c-86e8-e303ef2f6782' },
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('retrieveMany: required and optional params', async () => {
|
|
19
|
+
const response = await finch.hris.payStatements.retrieveMany({
|
|
20
|
+
requests: [
|
|
21
|
+
{ payment_id: 'e8b90071-0c11-471c-86e8-e303ef2f6782', limit: 0, offset: 0 },
|
|
22
|
+
{ payment_id: 'e8b90071-0c11-471c-86e8-e303ef2f6782', limit: 0, offset: 0 },
|
|
23
|
+
{ payment_id: 'e8b90071-0c11-471c-86e8-e303ef2f6782', limit: 0, offset: 0 },
|
|
24
|
+
],
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('resource payments', () => {
|
|
8
|
+
test('list: only required params', async () => {
|
|
9
|
+
const response = await finch.hris.payments.list({ end_date: '2021-01-01', start_date: '2021-01-01' });
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('list: required and optional params', async () => {
|
|
13
|
+
const response = await finch.hris.payments.list({ end_date: '2021-01-01', start_date: '2021-01-01' });
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('resource providers', () => {
|
|
8
|
+
test('list', async () => {
|
|
9
|
+
const response = await finch.providers.list();
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('list: request options instead of params are passed correctly', async () => {
|
|
13
|
+
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
|
|
14
|
+
await expect(finch.providers.list({ path: '/_stainless_unknown_path' })).rejects.toThrow(
|
|
15
|
+
Finch.NotFoundError,
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '~/index';
|
|
4
|
+
|
|
5
|
+
const finch = new Finch({ accessToken: 'something1234', baseURL: 'http://127.0.0.1:4010' });
|
|
6
|
+
|
|
7
|
+
describe('top level methods', () => {
|
|
8
|
+
test('getAccessToken', async () => {
|
|
9
|
+
// TODO
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test('getAuthUrl', async () => {
|
|
13
|
+
// TODO
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { multipartFormRequestOptions } from '~/core';
|
|
2
|
+
import { Blob } from 'formdata-node';
|
|
3
|
+
import { fileFromPath } from 'formdata-node/file-from-path';
|
|
4
|
+
|
|
5
|
+
describe('form data validation', () => {
|
|
6
|
+
test('valid values do not error', async () => {
|
|
7
|
+
multipartFormRequestOptions({
|
|
8
|
+
body: {
|
|
9
|
+
foo: 'foo',
|
|
10
|
+
string: 1,
|
|
11
|
+
bool: true,
|
|
12
|
+
file: await fileFromPath('README.md'),
|
|
13
|
+
blob: new Blob(['Some content'], { type: 'text/plain' }),
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('null', async () => {
|
|
19
|
+
expect(() =>
|
|
20
|
+
multipartFormRequestOptions({
|
|
21
|
+
body: {
|
|
22
|
+
null: null,
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
).toThrow(TypeError);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
+
|
|
3
|
+
import Finch from '../index';
|
|
4
|
+
|
|
5
|
+
describe('instantiate client', () => {
|
|
6
|
+
const env = process.env;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
jest.resetModules();
|
|
10
|
+
process.env = { ...env };
|
|
11
|
+
|
|
12
|
+
console.warn = jest.fn();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
process.env = env;
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('with accessToken argument', () => {
|
|
20
|
+
const client = new Finch({ accessToken: 'another access token' });
|
|
21
|
+
expect(client.accessToken).toBe('another access token');
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('with options argument', () => {
|
|
25
|
+
// accessToken
|
|
26
|
+
const client = new Finch({ accessToken: 'my access token' });
|
|
27
|
+
expect(client.accessToken).toBe('my access token');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('with disabled authentication', () => {
|
|
31
|
+
const client = new Finch({ accessToken: null });
|
|
32
|
+
expect(client.accessToken).toBeNull();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createResponseHeaders } from '~/core';
|
|
2
|
+
import { Headers } from 'node-fetch';
|
|
3
|
+
|
|
4
|
+
describe('response parsing', () => {
|
|
5
|
+
// TODO: test unicode characters
|
|
6
|
+
test('headers are case agnostic', async () => {
|
|
7
|
+
const headers = createResponseHeaders(new Headers({ 'Content-Type': 'foo', Accept: 'text/plain' }));
|
|
8
|
+
expect(headers['content-type']).toEqual('foo');
|
|
9
|
+
expect(headers['Content-type']).toEqual('foo');
|
|
10
|
+
expect(headers['Content-Type']).toEqual('foo');
|
|
11
|
+
expect(headers['accept']).toEqual('text/plain');
|
|
12
|
+
expect(headers['Accept']).toEqual('text/plain');
|
|
13
|
+
expect(headers['Hello-World']).toBeUndefined();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('duplicate headers are concatenated', () => {
|
|
17
|
+
const headers = createResponseHeaders(
|
|
18
|
+
new Headers([
|
|
19
|
+
['Content-Type', 'text/xml'],
|
|
20
|
+
['Content-Type', 'application/json'],
|
|
21
|
+
]),
|
|
22
|
+
);
|
|
23
|
+
expect(headers['content-type']).toBe('text/xml, application/json');
|
|
24
|
+
});
|
|
25
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2019",
|
|
4
|
+
"lib": ["es2020"],
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"rootDir": "./",
|
|
9
|
+
"baseUrl": "./",
|
|
10
|
+
"paths": {
|
|
11
|
+
"~/*": ["*"],
|
|
12
|
+
"digest-fetch": ["./typings/digest-fetch"]
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"declarationMap": true,
|
|
17
|
+
"outDir": "dist",
|
|
18
|
+
"pretty": true,
|
|
19
|
+
"sourceMap": true,
|
|
20
|
+
"resolveJsonModule": true,
|
|
21
|
+
|
|
22
|
+
"forceConsistentCasingInFileNames": true,
|
|
23
|
+
|
|
24
|
+
"strict": true,
|
|
25
|
+
"noImplicitAny": true,
|
|
26
|
+
"strictNullChecks": true,
|
|
27
|
+
"strictFunctionTypes": true,
|
|
28
|
+
"strictBindCallApply": true,
|
|
29
|
+
"strictPropertyInitialization": true,
|
|
30
|
+
"noImplicitThis": true,
|
|
31
|
+
"alwaysStrict": true,
|
|
32
|
+
"exactOptionalPropertyTypes": true,
|
|
33
|
+
"noUncheckedIndexedAccess": true,
|
|
34
|
+
"noImplicitOverride": true,
|
|
35
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
36
|
+
|
|
37
|
+
"skipLibCheck": true
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
declare module 'digest-fetch';
|
|
2
|
+
|
|
3
|
+
import type { RequestInfo, RequestInit, Response } from 'node-fetch';
|
|
4
|
+
|
|
5
|
+
type Algorithm = 'MD5' | 'MD5-sess';
|
|
6
|
+
|
|
7
|
+
type Options = {
|
|
8
|
+
algorithm?: Algorithm;
|
|
9
|
+
statusCode?: number;
|
|
10
|
+
cnonceSize?: number;
|
|
11
|
+
basic?: boolean;
|
|
12
|
+
precomputeHash?: boolean;
|
|
13
|
+
logger?: typeof console;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
class DigestClient {
|
|
17
|
+
user: string;
|
|
18
|
+
password: string;
|
|
19
|
+
|
|
20
|
+
private nonceRaw: string;
|
|
21
|
+
private logger?: typeof console;
|
|
22
|
+
private precomputedHash?: boolean;
|
|
23
|
+
private statusCode?: number;
|
|
24
|
+
private basic: boolean;
|
|
25
|
+
private cnonceSize: number;
|
|
26
|
+
private hasAuth: boolean;
|
|
27
|
+
private digest: { nc: number; algorithm: Algorithm; realm: string };
|
|
28
|
+
|
|
29
|
+
constructor(user: string, password: string, options: Options = {});
|
|
30
|
+
async fetch(url: RequestInfo, options: RequestInit = {}): Promise<Response>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default DigestClient;
|
package/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = '1.0.0'; // x-release-please-version
|