@tryfinch/finch-api 6.30.0 → 7.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/CHANGELOG.md +320 -0
- package/README.md +129 -68
- 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/bin/cli +53 -0
- package/bin/migration-config.json +6 -0
- package/client.d.mts +258 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +258 -0
- package/client.d.ts.map +1 -0
- package/client.js +553 -0
- package/client.js.map +1 -0
- package/client.mjs +549 -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 +105 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +105 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +163 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +154 -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 +1 -46
- package/error.d.ts.map +1 -1
- package/error.js +3 -110
- package/error.js.map +1 -1
- package/error.mjs +1 -96
- package/error.mjs.map +1 -1
- package/index.d.mts +7 -197
- package/index.d.mts.map +1 -0
- package/index.d.ts +6 -196
- package/index.d.ts.map +1 -1
- package/index.js +14 -235
- package/index.js.map +1 -1
- package/index.mjs +6 -208
- package/index.mjs.map +1 -1
- 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 +26 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +26 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +120 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +112 -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 +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +1 -0
- package/internal/qs/formats.d.ts.map +1 -1
- package/internal/qs/formats.js +4 -2
- package/internal/qs/formats.js.map +1 -1
- package/internal/qs/formats.mjs +2 -1
- package/internal/qs/formats.mjs.map +1 -1
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts.map +1 -1
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts.map +1 -1
- package/internal/qs/stringify.js +16 -19
- package/internal/qs/stringify.js.map +1 -1
- package/internal/qs/stringify.mjs +17 -19
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +1 -0
- package/internal/qs/utils.d.ts.map +1 -1
- package/internal/qs/utils.js +22 -21
- package/internal/qs/utils.js.map +1 -1
- package/internal/qs/utils.mjs +12 -12
- package/internal/qs/utils.mjs.map +1 -1
- 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/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 +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +116 -67
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +1 -79
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -123
- package/pagination.js.map +1 -1
- package/pagination.mjs +1 -118
- package/pagination.mjs.map +1 -1
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +1 -5
- package/resource.d.ts.map +1 -1
- package/resource.js +3 -8
- package/resource.js.map +1 -1
- package/resource.mjs +1 -6
- package/resource.mjs.map +1 -1
- package/resources/access-tokens.d.mts +83 -0
- package/resources/access-tokens.d.mts.map +1 -0
- package/resources/access-tokens.d.ts +42 -33
- package/resources/access-tokens.d.ts.map +1 -1
- package/resources/access-tokens.js +2 -10
- package/resources/access-tokens.js.map +1 -1
- package/resources/access-tokens.mjs +2 -10
- package/resources/access-tokens.mjs.map +1 -1
- package/resources/account.d.mts +149 -0
- package/resources/account.d.mts.map +1 -0
- package/resources/account.d.ts +73 -49
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +1 -1
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +1 -1
- package/resources/account.mjs.map +1 -1
- package/resources/connect/connect.d.mts +10 -0
- package/resources/connect/connect.d.mts.map +1 -0
- package/resources/connect/connect.d.ts +1 -1
- package/resources/connect/connect.d.ts.map +1 -1
- package/resources/connect/connect.js +3 -25
- package/resources/connect/connect.js.map +1 -1
- package/resources/connect/connect.mjs +1 -1
- package/resources/connect/index.d.mts +3 -0
- package/resources/connect/index.d.mts.map +1 -0
- package/resources/connect/index.d.ts.map +1 -1
- package/resources/connect/sessions.d.mts +110 -0
- package/resources/connect/sessions.d.mts.map +1 -0
- package/resources/connect/sessions.d.ts +44 -10
- package/resources/connect/sessions.d.ts.map +1 -1
- package/resources/connect/sessions.js +1 -1
- package/resources/connect/sessions.js.map +1 -1
- package/resources/connect/sessions.mjs +1 -1
- package/resources/connect/sessions.mjs.map +1 -1
- package/resources/connect.d.mts +2 -0
- package/resources/connect.d.mts.map +1 -0
- package/resources/connect.d.ts.map +1 -1
- package/resources/connect.js +2 -15
- package/resources/connect.js.map +1 -1
- package/resources/hris/benefits/benefits.d.mts +298 -0
- package/resources/hris/benefits/benefits.d.mts.map +1 -0
- package/resources/hris/benefits/benefits.d.ts +103 -115
- package/resources/hris/benefits/benefits.d.ts.map +1 -1
- package/resources/hris/benefits/benefits.js +45 -54
- package/resources/hris/benefits/benefits.js.map +1 -1
- package/resources/hris/benefits/benefits.mjs +43 -28
- package/resources/hris/benefits/benefits.mjs.map +1 -1
- package/resources/hris/benefits/index.d.mts +3 -0
- package/resources/hris/benefits/index.d.mts.map +1 -0
- package/resources/hris/benefits/index.d.ts +2 -2
- package/resources/hris/benefits/index.d.ts.map +1 -1
- package/resources/hris/benefits/index.js +1 -4
- package/resources/hris/benefits/index.js.map +1 -1
- package/resources/hris/benefits/index.mjs +2 -2
- package/resources/hris/benefits/index.mjs.map +1 -1
- package/resources/hris/benefits/individuals.d.mts +288 -0
- package/resources/hris/benefits/individuals.d.mts.map +1 -0
- package/resources/hris/benefits/individuals.d.ts +145 -27
- package/resources/hris/benefits/individuals.d.ts.map +1 -1
- package/resources/hris/benefits/individuals.js +61 -26
- package/resources/hris/benefits/individuals.js.map +1 -1
- package/resources/hris/benefits/individuals.mjs +60 -24
- package/resources/hris/benefits/individuals.mjs.map +1 -1
- package/resources/hris/benefits.d.mts +2 -0
- package/resources/hris/benefits.d.mts.map +1 -0
- package/resources/hris/benefits.d.ts.map +1 -1
- package/resources/hris/benefits.js +2 -15
- package/resources/hris/benefits.js.map +1 -1
- package/resources/hris/company/company.d.mts +124 -0
- package/resources/hris/company/company.d.mts.map +1 -0
- package/resources/hris/company/company.d.ts +12 -5
- package/resources/hris/company/company.d.ts.map +1 -1
- package/resources/hris/company/company.js +5 -28
- package/resources/hris/company/company.js.map +1 -1
- package/resources/hris/company/company.mjs +4 -5
- package/resources/hris/company/company.mjs.map +1 -1
- package/resources/hris/company/index.d.mts +3 -0
- package/resources/hris/company/index.d.mts.map +1 -0
- package/resources/hris/company/index.d.ts +2 -2
- package/resources/hris/company/index.d.ts.map +1 -1
- package/resources/hris/company/index.js +1 -2
- package/resources/hris/company/index.js.map +1 -1
- package/resources/hris/company/index.mjs +1 -1
- package/resources/hris/company/index.mjs.map +1 -1
- package/resources/hris/company/pay-statement-item/index.d.mts +3 -0
- package/resources/hris/company/pay-statement-item/index.d.mts.map +1 -0
- package/resources/hris/company/pay-statement-item/index.d.ts +2 -2
- package/resources/hris/company/pay-statement-item/index.d.ts.map +1 -1
- package/resources/hris/company/pay-statement-item/index.js +1 -3
- package/resources/hris/company/pay-statement-item/index.js.map +1 -1
- package/resources/hris/company/pay-statement-item/index.mjs +2 -2
- package/resources/hris/company/pay-statement-item/index.mjs.map +1 -1
- package/resources/hris/company/pay-statement-item/pay-statement-item.d.mts +99 -0
- package/resources/hris/company/pay-statement-item/pay-statement-item.d.mts.map +1 -0
- package/resources/hris/company/pay-statement-item/pay-statement-item.d.ts +22 -18
- package/resources/hris/company/pay-statement-item/pay-statement-item.d.ts.map +1 -1
- package/resources/hris/company/pay-statement-item/pay-statement-item.js +19 -40
- package/resources/hris/company/pay-statement-item/pay-statement-item.js.map +1 -1
- package/resources/hris/company/pay-statement-item/pay-statement-item.mjs +17 -15
- package/resources/hris/company/pay-statement-item/pay-statement-item.mjs.map +1 -1
- package/resources/hris/company/pay-statement-item/rules.d.mts +398 -0
- package/resources/hris/company/pay-statement-item/rules.d.mts.map +1 -0
- package/resources/hris/company/pay-statement-item/rules.d.ts +56 -21
- package/resources/hris/company/pay-statement-item/rules.d.ts.map +1 -1
- package/resources/hris/company/pay-statement-item/rules.js +55 -22
- package/resources/hris/company/pay-statement-item/rules.js.map +1 -1
- package/resources/hris/company/pay-statement-item/rules.mjs +54 -20
- package/resources/hris/company/pay-statement-item/rules.mjs.map +1 -1
- package/resources/hris/company/pay-statement-item.d.mts +2 -0
- package/resources/hris/company/pay-statement-item.d.mts.map +1 -0
- package/resources/hris/company/pay-statement-item.d.ts.map +1 -1
- package/resources/hris/company/pay-statement-item.js +2 -15
- package/resources/hris/company/pay-statement-item.js.map +1 -1
- package/resources/hris/company.d.mts +2 -0
- package/resources/hris/company.d.mts.map +1 -0
- package/resources/hris/company.d.ts.map +1 -1
- package/resources/hris/company.js +2 -15
- package/resources/hris/company.js.map +1 -1
- package/resources/hris/directory.d.mts +87 -0
- package/resources/hris/directory.d.mts.map +1 -0
- package/resources/hris/directory.d.ts +13 -9
- package/resources/hris/directory.d.ts.map +1 -1
- package/resources/hris/directory.js +17 -7
- package/resources/hris/directory.js.map +1 -1
- package/resources/hris/directory.mjs +17 -7
- package/resources/hris/directory.mjs.map +1 -1
- package/resources/hris/documents.d.mts +198 -0
- package/resources/hris/documents.d.mts.map +1 -0
- package/resources/hris/documents.d.ts +40 -30
- package/resources/hris/documents.d.ts.map +1 -1
- package/resources/hris/documents.js +13 -7
- package/resources/hris/documents.js.map +1 -1
- package/resources/hris/documents.mjs +13 -7
- package/resources/hris/documents.mjs.map +1 -1
- package/resources/hris/employments.d.mts +175 -0
- package/resources/hris/employments.d.mts.map +1 -0
- package/resources/hris/employments.d.ts +23 -19
- package/resources/hris/employments.d.ts.map +1 -1
- package/resources/hris/employments.js +7 -9
- package/resources/hris/employments.js.map +1 -1
- package/resources/hris/employments.mjs +6 -7
- package/resources/hris/employments.mjs.map +1 -1
- package/resources/hris/hris.d.mts +98 -0
- package/resources/hris/hris.d.mts.map +1 -0
- package/resources/hris/hris.d.ts +14 -14
- package/resources/hris/hris.d.ts.map +1 -1
- package/resources/hris/hris.js +10 -38
- package/resources/hris/hris.js.map +1 -1
- package/resources/hris/hris.mjs +6 -12
- package/resources/hris/hris.mjs.map +1 -1
- package/resources/hris/index.d.mts +10 -0
- package/resources/hris/index.d.mts.map +1 -0
- package/resources/hris/index.d.ts +7 -7
- package/resources/hris/index.d.ts.map +1 -1
- package/resources/hris/index.js +1 -7
- package/resources/hris/index.js.map +1 -1
- package/resources/hris/index.mjs +5 -5
- package/resources/hris/index.mjs.map +1 -1
- package/resources/hris/individuals.d.mts +116 -0
- package/resources/hris/individuals.d.mts.map +1 -0
- package/resources/hris/individuals.d.ts +16 -8
- package/resources/hris/individuals.d.ts.map +1 -1
- package/resources/hris/individuals.js +18 -13
- package/resources/hris/individuals.js.map +1 -1
- package/resources/hris/individuals.mjs +17 -11
- package/resources/hris/individuals.mjs.map +1 -1
- package/resources/hris/pay-statements.d.mts +268 -0
- package/resources/hris/pay-statements.d.mts.map +1 -0
- package/resources/hris/pay-statements.d.ts +113 -100
- package/resources/hris/pay-statements.d.ts.map +1 -1
- package/resources/hris/pay-statements.js +7 -9
- package/resources/hris/pay-statements.js.map +1 -1
- package/resources/hris/pay-statements.mjs +6 -7
- package/resources/hris/pay-statements.mjs.map +1 -1
- package/resources/hris/payments.d.mts +80 -0
- package/resources/hris/payments.d.mts.map +1 -0
- package/resources/hris/payments.d.ts +24 -21
- package/resources/hris/payments.d.ts.map +1 -1
- package/resources/hris/payments.js +4 -8
- package/resources/hris/payments.js.map +1 -1
- package/resources/hris/payments.mjs +3 -6
- package/resources/hris/payments.mjs.map +1 -1
- package/resources/hris.d.mts +2 -0
- package/resources/hris.d.mts.map +1 -0
- package/resources/hris.d.ts.map +1 -1
- package/resources/hris.js +2 -15
- package/resources/hris.js.map +1 -1
- package/resources/index.d.mts +12 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -17
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/jobs/automated.d.mts +174 -0
- package/resources/jobs/automated.d.mts.map +1 -0
- package/resources/jobs/automated.d.ts +15 -11
- package/resources/jobs/automated.d.ts.map +1 -1
- package/resources/jobs/automated.js +9 -7
- package/resources/jobs/automated.js.map +1 -1
- package/resources/jobs/automated.mjs +9 -7
- package/resources/jobs/automated.mjs.map +1 -1
- package/resources/jobs/index.d.mts +4 -0
- package/resources/jobs/index.d.mts.map +1 -0
- package/resources/jobs/index.d.ts.map +1 -1
- package/resources/jobs/jobs.d.mts +14 -0
- package/resources/jobs/jobs.d.mts.map +1 -0
- package/resources/jobs/jobs.d.ts +1 -1
- package/resources/jobs/jobs.d.ts.map +1 -1
- package/resources/jobs/jobs.js +4 -26
- package/resources/jobs/jobs.js.map +1 -1
- package/resources/jobs/jobs.mjs +1 -1
- package/resources/jobs/manual.d.mts +22 -0
- package/resources/jobs/manual.d.mts.map +1 -0
- package/resources/jobs/manual.d.ts +4 -3
- package/resources/jobs/manual.d.ts.map +1 -1
- package/resources/jobs/manual.js +4 -3
- package/resources/jobs/manual.js.map +1 -1
- package/resources/jobs/manual.mjs +4 -3
- package/resources/jobs/manual.mjs.map +1 -1
- package/resources/jobs.d.mts +2 -0
- package/resources/jobs.d.mts.map +1 -0
- package/resources/jobs.d.ts.map +1 -1
- package/resources/jobs.js +2 -15
- package/resources/jobs.js.map +1 -1
- package/resources/payroll/index.d.mts +3 -0
- package/resources/payroll/index.d.mts.map +1 -0
- package/resources/payroll/index.d.ts +1 -1
- package/resources/payroll/index.d.ts.map +1 -1
- package/resources/payroll/index.js +1 -2
- package/resources/payroll/index.js.map +1 -1
- package/resources/payroll/index.mjs +1 -1
- package/resources/payroll/index.mjs.map +1 -1
- package/resources/payroll/pay-groups.d.mts +62 -0
- package/resources/payroll/pay-groups.d.mts.map +1 -0
- package/resources/payroll/pay-groups.d.ts +22 -13
- package/resources/payroll/pay-groups.d.ts.map +1 -1
- package/resources/payroll/pay-groups.js +10 -14
- package/resources/payroll/pay-groups.js.map +1 -1
- package/resources/payroll/pay-groups.mjs +9 -12
- package/resources/payroll/pay-groups.mjs.map +1 -1
- package/resources/payroll/payroll.d.mts +10 -0
- package/resources/payroll/payroll.d.mts.map +1 -0
- package/resources/payroll/payroll.d.ts +3 -3
- package/resources/payroll/payroll.d.ts.map +1 -1
- package/resources/payroll/payroll.js +3 -26
- package/resources/payroll/payroll.js.map +1 -1
- package/resources/payroll/payroll.mjs +2 -3
- package/resources/payroll/payroll.mjs.map +1 -1
- package/resources/payroll.d.mts +2 -0
- package/resources/payroll.d.mts.map +1 -0
- package/resources/payroll.d.ts.map +1 -1
- package/resources/payroll.js +2 -15
- package/resources/payroll.js.map +1 -1
- package/resources/providers.d.mts +142 -0
- package/resources/providers.d.mts.map +1 -0
- package/resources/providers.d.ts +90 -258
- package/resources/providers.d.ts.map +1 -1
- package/resources/providers.js +4 -8
- package/resources/providers.js.map +1 -1
- package/resources/providers.mjs +3 -6
- package/resources/providers.mjs.map +1 -1
- package/resources/request-forwarding.d.mts +109 -0
- package/resources/request-forwarding.d.mts.map +1 -0
- package/resources/request-forwarding.d.ts +48 -49
- package/resources/request-forwarding.d.ts.map +1 -1
- package/resources/request-forwarding.js +3 -13
- package/resources/request-forwarding.js.map +1 -1
- package/resources/request-forwarding.mjs +3 -13
- package/resources/request-forwarding.mjs.map +1 -1
- package/resources/sandbox/company.d.mts +219 -0
- package/resources/sandbox/company.d.mts.map +1 -0
- package/resources/sandbox/company.d.ts +4 -3
- package/resources/sandbox/company.d.ts.map +1 -1
- package/resources/sandbox/company.js +1 -1
- package/resources/sandbox/company.js.map +1 -1
- package/resources/sandbox/company.mjs +1 -1
- package/resources/sandbox/company.mjs.map +1 -1
- package/resources/sandbox/connections/accounts.d.mts +97 -0
- package/resources/sandbox/connections/accounts.d.mts.map +1 -0
- package/resources/sandbox/connections/accounts.d.ts +5 -5
- package/resources/sandbox/connections/accounts.d.ts.map +1 -1
- package/resources/sandbox/connections/accounts.js +13 -5
- package/resources/sandbox/connections/accounts.js.map +1 -1
- package/resources/sandbox/connections/accounts.mjs +13 -5
- package/resources/sandbox/connections/accounts.mjs.map +1 -1
- package/resources/sandbox/connections/connections.d.mts +62 -0
- package/resources/sandbox/connections/connections.d.mts.map +1 -0
- package/resources/sandbox/connections/connections.d.ts +4 -3
- package/resources/sandbox/connections/connections.d.ts.map +1 -1
- package/resources/sandbox/connections/connections.js +3 -25
- package/resources/sandbox/connections/connections.js.map +1 -1
- package/resources/sandbox/connections/connections.mjs +1 -1
- package/resources/sandbox/connections/connections.mjs.map +1 -1
- package/resources/sandbox/connections/index.d.mts +3 -0
- package/resources/sandbox/connections/index.d.mts.map +1 -0
- package/resources/sandbox/connections/index.d.ts.map +1 -1
- package/resources/sandbox/connections.d.mts +2 -0
- package/resources/sandbox/connections.d.mts.map +1 -0
- package/resources/sandbox/connections.d.ts.map +1 -1
- package/resources/sandbox/connections.js +2 -15
- package/resources/sandbox/connections.js.map +1 -1
- package/resources/sandbox/directory.d.mts +174 -0
- package/resources/sandbox/directory.d.mts.map +1 -0
- package/resources/sandbox/directory.d.ts +18 -12
- package/resources/sandbox/directory.d.ts.map +1 -1
- package/resources/sandbox/directory.js +12 -7
- package/resources/sandbox/directory.js.map +1 -1
- package/resources/sandbox/directory.mjs +12 -7
- package/resources/sandbox/directory.mjs.map +1 -1
- package/resources/sandbox/employment.d.mts +235 -0
- package/resources/sandbox/employment.d.mts.map +1 -0
- package/resources/sandbox/employment.d.ts +16 -12
- package/resources/sandbox/employment.d.ts.map +1 -1
- package/resources/sandbox/employment.js +14 -7
- package/resources/sandbox/employment.js.map +1 -1
- package/resources/sandbox/employment.mjs +14 -7
- package/resources/sandbox/employment.mjs.map +1 -1
- package/resources/sandbox/index.d.mts +9 -0
- package/resources/sandbox/index.d.mts.map +1 -0
- package/resources/sandbox/index.d.ts.map +1 -1
- package/resources/sandbox/individual.d.mts +131 -0
- package/resources/sandbox/individual.d.mts.map +1 -0
- package/resources/sandbox/individual.d.ts +4 -4
- package/resources/sandbox/individual.d.ts.map +1 -1
- package/resources/sandbox/individual.js +14 -7
- package/resources/sandbox/individual.js.map +1 -1
- package/resources/sandbox/individual.mjs +14 -7
- package/resources/sandbox/individual.mjs.map +1 -1
- package/resources/sandbox/jobs/configuration.d.mts +41 -0
- package/resources/sandbox/jobs/configuration.d.mts.map +1 -0
- package/resources/sandbox/jobs/configuration.d.ts +5 -4
- package/resources/sandbox/jobs/configuration.d.ts.map +1 -1
- package/resources/sandbox/jobs/configuration.js +1 -1
- package/resources/sandbox/jobs/configuration.js.map +1 -1
- package/resources/sandbox/jobs/configuration.mjs +1 -1
- package/resources/sandbox/jobs/configuration.mjs.map +1 -1
- package/resources/sandbox/jobs/index.d.mts +3 -0
- package/resources/sandbox/jobs/index.d.mts.map +1 -0
- package/resources/sandbox/jobs/index.d.ts.map +1 -1
- package/resources/sandbox/jobs/jobs.d.mts +48 -0
- package/resources/sandbox/jobs/jobs.d.mts.map +1 -0
- package/resources/sandbox/jobs/jobs.d.ts +4 -3
- package/resources/sandbox/jobs/jobs.d.ts.map +1 -1
- package/resources/sandbox/jobs/jobs.js +3 -25
- package/resources/sandbox/jobs/jobs.js.map +1 -1
- package/resources/sandbox/jobs/jobs.mjs +1 -1
- package/resources/sandbox/jobs/jobs.mjs.map +1 -1
- package/resources/sandbox/jobs.d.mts +2 -0
- package/resources/sandbox/jobs.d.mts.map +1 -0
- package/resources/sandbox/jobs.d.ts.map +1 -1
- package/resources/sandbox/jobs.js +2 -15
- package/resources/sandbox/jobs.js.map +1 -1
- package/resources/sandbox/payment.d.mts +81 -0
- package/resources/sandbox/payment.d.mts.map +1 -0
- package/resources/sandbox/payment.d.ts +34 -188
- package/resources/sandbox/payment.d.ts.map +1 -1
- package/resources/sandbox/payment.js +9 -5
- package/resources/sandbox/payment.js.map +1 -1
- package/resources/sandbox/payment.mjs +9 -5
- package/resources/sandbox/payment.mjs.map +1 -1
- package/resources/sandbox/sandbox.d.mts +34 -0
- package/resources/sandbox/sandbox.d.mts.map +1 -0
- package/resources/sandbox/sandbox.d.ts +1 -1
- package/resources/sandbox/sandbox.d.ts.map +1 -1
- package/resources/sandbox/sandbox.js +9 -31
- package/resources/sandbox/sandbox.js.map +1 -1
- package/resources/sandbox/sandbox.mjs +1 -1
- package/resources/sandbox.d.mts +2 -0
- package/resources/sandbox.d.mts.map +1 -0
- package/resources/sandbox.d.ts.map +1 -1
- package/resources/sandbox.js +2 -15
- package/resources/sandbox.js.map +1 -1
- package/resources/shared.d.mts +64 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/top-level.d.mts +2 -0
- package/resources/top-level.d.mts.map +1 -0
- package/resources/webhooks.d.mts +396 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +5 -3
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +9 -8
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +3 -2
- package/resources/webhooks.mjs.map +1 -1
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/api-promise.ts +2 -0
- package/src/client.ts +967 -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 +292 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -130
- package/src/index.ts +6 -432
- 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 +144 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/qs/formats.ts +3 -2
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +18 -21
- package/src/internal/qs/utils.ts +16 -16
- 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/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 +8 -0
- package/src/pagination.ts +2 -221
- package/src/resource.ts +2 -11
- package/src/resources/access-tokens.ts +46 -39
- package/src/resources/account.ts +86 -57
- package/src/resources/connect/connect.ts +3 -3
- package/src/resources/connect/index.ts +2 -2
- package/src/resources/connect/sessions.ts +52 -18
- package/src/resources/connect.ts +1 -1
- package/src/resources/hris/benefits/benefits.ts +163 -173
- package/src/resources/hris/benefits/index.ts +9 -6
- package/src/resources/hris/benefits/individuals.ts +202 -79
- package/src/resources/hris/benefits.ts +1 -1
- package/src/resources/hris/company/company.ts +20 -10
- package/src/resources/hris/company/index.ts +3 -3
- package/src/resources/hris/company/pay-statement-item/index.ts +6 -4
- package/src/resources/hris/company/pay-statement-item/pay-statement-item.ts +34 -37
- package/src/resources/hris/company/pay-statement-item/rules.ts +85 -43
- package/src/resources/hris/company/pay-statement-item.ts +1 -1
- package/src/resources/hris/company.ts +1 -1
- package/src/resources/hris/directory.ts +22 -18
- package/src/resources/hris/documents.ts +51 -38
- package/src/resources/hris/employments.ts +33 -27
- package/src/resources/hris/hris.ts +41 -35
- package/src/resources/hris/index.ts +19 -15
- package/src/resources/hris/individuals.ts +23 -21
- package/src/resources/hris/pay-statements.ts +130 -116
- package/src/resources/hris/payments.ts +32 -32
- package/src/resources/hris.ts +1 -1
- package/src/resources/index.ts +16 -11
- package/src/resources/jobs/automated.ts +20 -22
- package/src/resources/jobs/index.ts +3 -3
- package/src/resources/jobs/jobs.ts +5 -5
- package/src/resources/jobs/manual.ts +6 -4
- package/src/resources/jobs.ts +1 -1
- package/src/resources/payroll/index.ts +4 -3
- package/src/resources/payroll/pay-groups.ts +43 -37
- package/src/resources/payroll/payroll.ts +6 -5
- package/src/resources/payroll.ts +1 -1
- package/src/resources/providers.ts +91 -397
- package/src/resources/request-forwarding.ts +38 -51
- package/src/resources/sandbox/company.ts +5 -4
- package/src/resources/sandbox/connections/accounts.ts +8 -13
- package/src/resources/sandbox/connections/connections.ts +6 -8
- package/src/resources/sandbox/connections/index.ts +2 -2
- package/src/resources/sandbox/connections.ts +1 -1
- package/src/resources/sandbox/directory.ts +23 -24
- package/src/resources/sandbox/employment.ts +22 -26
- package/src/resources/sandbox/index.ts +8 -8
- package/src/resources/sandbox/individual.ts +10 -18
- package/src/resources/sandbox/jobs/configuration.ts +5 -7
- package/src/resources/sandbox/jobs/index.ts +2 -2
- package/src/resources/sandbox/jobs/jobs.ts +6 -5
- package/src/resources/sandbox/jobs.ts +1 -1
- package/src/resources/sandbox/payment.ts +82 -220
- package/src/resources/sandbox/sandbox.ts +15 -15
- package/src/resources/sandbox.ts +1 -1
- package/src/resources/webhooks.ts +7 -5
- package/src/resources.ts +1 -1
- package/src/tsconfig.json +2 -2
- package/src/uploads.ts +2 -255
- package/src/version.ts +1 -1
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +1 -74
- package/uploads.d.ts.map +1 -1
- package/uploads.js +3 -168
- package/uploads.js.map +1 -1
- package/uploads.mjs +1 -157
- package/uploads.mjs.map +1 -1
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/_shims/MultipartBody.d.ts +0 -9
- package/_shims/MultipartBody.d.ts.map +0 -1
- package/_shims/MultipartBody.js +0 -16
- package/_shims/MultipartBody.js.map +0 -1
- package/_shims/MultipartBody.mjs +0 -12
- package/_shims/MultipartBody.mjs.map +0 -1
- package/_shims/README.md +0 -46
- package/_shims/auto/runtime-bun.d.ts +0 -5
- package/_shims/auto/runtime-bun.d.ts.map +0 -1
- package/_shims/auto/runtime-bun.js +0 -21
- package/_shims/auto/runtime-bun.js.map +0 -1
- package/_shims/auto/runtime-bun.mjs +0 -2
- package/_shims/auto/runtime-bun.mjs.map +0 -1
- package/_shims/auto/runtime-node.d.ts +0 -5
- package/_shims/auto/runtime-node.d.ts.map +0 -1
- package/_shims/auto/runtime-node.js +0 -21
- package/_shims/auto/runtime-node.js.map +0 -1
- package/_shims/auto/runtime-node.mjs +0 -2
- package/_shims/auto/runtime-node.mjs.map +0 -1
- package/_shims/auto/runtime.d.ts +0 -5
- package/_shims/auto/runtime.d.ts.map +0 -1
- package/_shims/auto/runtime.js +0 -21
- package/_shims/auto/runtime.js.map +0 -1
- package/_shims/auto/runtime.mjs +0 -2
- package/_shims/auto/runtime.mjs.map +0 -1
- package/_shims/auto/types-node.d.ts +0 -5
- package/_shims/auto/types-node.d.ts.map +0 -1
- package/_shims/auto/types-node.js +0 -21
- package/_shims/auto/types-node.js.map +0 -1
- package/_shims/auto/types-node.mjs +0 -2
- package/_shims/auto/types-node.mjs.map +0 -1
- package/_shims/auto/types.d.ts +0 -101
- package/_shims/auto/types.js +0 -3
- package/_shims/auto/types.mjs +0 -3
- package/_shims/bun-runtime.d.ts +0 -6
- package/_shims/bun-runtime.d.ts.map +0 -1
- package/_shims/bun-runtime.js +0 -14
- package/_shims/bun-runtime.js.map +0 -1
- package/_shims/bun-runtime.mjs +0 -10
- package/_shims/bun-runtime.mjs.map +0 -1
- package/_shims/index.d.ts +0 -83
- package/_shims/index.js +0 -17
- package/_shims/index.mjs +0 -11
- package/_shims/manual-types.d.ts +0 -12
- package/_shims/manual-types.js +0 -3
- package/_shims/manual-types.mjs +0 -3
- package/_shims/node-runtime.d.ts +0 -3
- package/_shims/node-runtime.d.ts.map +0 -1
- package/_shims/node-runtime.js +0 -89
- package/_shims/node-runtime.js.map +0 -1
- package/_shims/node-runtime.mjs +0 -56
- package/_shims/node-runtime.mjs.map +0 -1
- package/_shims/node-types.d.ts +0 -42
- package/_shims/node-types.js +0 -3
- package/_shims/node-types.mjs +0 -3
- package/_shims/registry.d.ts +0 -37
- package/_shims/registry.d.ts.map +0 -1
- package/_shims/registry.js +0 -41
- package/_shims/registry.js.map +0 -1
- package/_shims/registry.mjs +0 -37
- package/_shims/registry.mjs.map +0 -1
- package/_shims/web-runtime.d.ts +0 -5
- package/_shims/web-runtime.d.ts.map +0 -1
- package/_shims/web-runtime.js +0 -78
- package/_shims/web-runtime.js.map +0 -1
- package/_shims/web-runtime.mjs +0 -71
- package/_shims/web-runtime.mjs.map +0 -1
- package/_shims/web-types.d.ts +0 -83
- package/_shims/web-types.js +0 -3
- package/_shims/web-types.mjs +0 -3
- package/core.d.ts +0 -253
- package/core.d.ts.map +0 -1
- package/core.js +0 -932
- package/core.js.map +0 -1
- package/core.mjs +0 -899
- package/core.mjs.map +0 -1
- package/shims/node.d.ts +0 -30
- package/shims/node.d.ts.map +0 -1
- package/shims/node.js +0 -31
- package/shims/node.js.map +0 -1
- package/shims/node.mjs +0 -5
- package/shims/node.mjs.map +0 -1
- package/shims/web.d.ts +0 -26
- package/shims/web.d.ts.map +0 -1
- package/shims/web.js +0 -31
- package/shims/web.js.map +0 -1
- package/shims/web.mjs +0 -5
- package/shims/web.mjs.map +0 -1
- package/src/_shims/MultipartBody.ts +0 -9
- package/src/_shims/README.md +0 -46
- package/src/_shims/auto/runtime-bun.ts +0 -4
- package/src/_shims/auto/runtime-node.ts +0 -4
- package/src/_shims/auto/runtime.ts +0 -4
- package/src/_shims/auto/types-node.ts +0 -4
- package/src/_shims/auto/types.d.ts +0 -101
- package/src/_shims/auto/types.js +0 -3
- package/src/_shims/auto/types.mjs +0 -3
- package/src/_shims/bun-runtime.ts +0 -14
- package/src/_shims/index.d.ts +0 -83
- package/src/_shims/index.js +0 -17
- package/src/_shims/index.mjs +0 -11
- package/src/_shims/manual-types.d.ts +0 -12
- package/src/_shims/manual-types.js +0 -3
- package/src/_shims/manual-types.mjs +0 -3
- package/src/_shims/node-runtime.ts +0 -81
- package/src/_shims/node-types.d.ts +0 -42
- package/src/_shims/node-types.js +0 -3
- package/src/_shims/node-types.mjs +0 -3
- package/src/_shims/registry.ts +0 -67
- package/src/_shims/web-runtime.ts +0 -103
- package/src/_shims/web-types.d.ts +0 -83
- package/src/_shims/web-types.js +0 -3
- package/src/_shims/web-types.mjs +0 -3
- package/src/core.ts +0 -1248
- package/src/shims/node.ts +0 -50
- package/src/shims/web.ts +0 -50
package/error.js
CHANGED
|
@@ -1,113 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
exports.FinchError = FinchError;
|
|
9
|
-
class APIError extends FinchError {
|
|
10
|
-
constructor(status, error, message, headers) {
|
|
11
|
-
super(`${APIError.makeMessage(status, error, message)}`);
|
|
12
|
-
this.status = status;
|
|
13
|
-
this.headers = headers;
|
|
14
|
-
this.error = error;
|
|
15
|
-
}
|
|
16
|
-
static makeMessage(status, error, message) {
|
|
17
|
-
const msg = error?.message ?
|
|
18
|
-
typeof error.message === 'string' ?
|
|
19
|
-
error.message
|
|
20
|
-
: JSON.stringify(error.message)
|
|
21
|
-
: error ? JSON.stringify(error)
|
|
22
|
-
: message;
|
|
23
|
-
if (status && msg) {
|
|
24
|
-
return `${status} ${msg}`;
|
|
25
|
-
}
|
|
26
|
-
if (status) {
|
|
27
|
-
return `${status} status code (no body)`;
|
|
28
|
-
}
|
|
29
|
-
if (msg) {
|
|
30
|
-
return msg;
|
|
31
|
-
}
|
|
32
|
-
return '(no status code or body)';
|
|
33
|
-
}
|
|
34
|
-
static generate(status, errorResponse, message, headers) {
|
|
35
|
-
if (!status || !headers) {
|
|
36
|
-
return new APIConnectionError({ message, cause: (0, core_1.castToError)(errorResponse) });
|
|
37
|
-
}
|
|
38
|
-
const error = errorResponse;
|
|
39
|
-
if (status === 400) {
|
|
40
|
-
return new BadRequestError(status, error, message, headers);
|
|
41
|
-
}
|
|
42
|
-
if (status === 401) {
|
|
43
|
-
return new AuthenticationError(status, error, message, headers);
|
|
44
|
-
}
|
|
45
|
-
if (status === 403) {
|
|
46
|
-
return new PermissionDeniedError(status, error, message, headers);
|
|
47
|
-
}
|
|
48
|
-
if (status === 404) {
|
|
49
|
-
return new NotFoundError(status, error, message, headers);
|
|
50
|
-
}
|
|
51
|
-
if (status === 409) {
|
|
52
|
-
return new ConflictError(status, error, message, headers);
|
|
53
|
-
}
|
|
54
|
-
if (status === 422) {
|
|
55
|
-
return new UnprocessableEntityError(status, error, message, headers);
|
|
56
|
-
}
|
|
57
|
-
if (status === 429) {
|
|
58
|
-
return new RateLimitError(status, error, message, headers);
|
|
59
|
-
}
|
|
60
|
-
if (status >= 500) {
|
|
61
|
-
return new InternalServerError(status, error, message, headers);
|
|
62
|
-
}
|
|
63
|
-
return new APIError(status, error, message, headers);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.APIError = APIError;
|
|
67
|
-
class APIUserAbortError extends APIError {
|
|
68
|
-
constructor({ message } = {}) {
|
|
69
|
-
super(undefined, undefined, message || 'Request was aborted.', undefined);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.APIUserAbortError = APIUserAbortError;
|
|
73
|
-
class APIConnectionError extends APIError {
|
|
74
|
-
constructor({ message, cause }) {
|
|
75
|
-
super(undefined, undefined, message || 'Connection error.', undefined);
|
|
76
|
-
// in some environments the 'cause' property is already declared
|
|
77
|
-
// @ts-ignore
|
|
78
|
-
if (cause)
|
|
79
|
-
this.cause = cause;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.APIConnectionError = APIConnectionError;
|
|
83
|
-
class APIConnectionTimeoutError extends APIConnectionError {
|
|
84
|
-
constructor({ message } = {}) {
|
|
85
|
-
super({ message: message ?? 'Request timed out.' });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.APIConnectionTimeoutError = APIConnectionTimeoutError;
|
|
89
|
-
class BadRequestError extends APIError {
|
|
90
|
-
}
|
|
91
|
-
exports.BadRequestError = BadRequestError;
|
|
92
|
-
class AuthenticationError extends APIError {
|
|
93
|
-
}
|
|
94
|
-
exports.AuthenticationError = AuthenticationError;
|
|
95
|
-
class PermissionDeniedError extends APIError {
|
|
96
|
-
}
|
|
97
|
-
exports.PermissionDeniedError = PermissionDeniedError;
|
|
98
|
-
class NotFoundError extends APIError {
|
|
99
|
-
}
|
|
100
|
-
exports.NotFoundError = NotFoundError;
|
|
101
|
-
class ConflictError extends APIError {
|
|
102
|
-
}
|
|
103
|
-
exports.ConflictError = ConflictError;
|
|
104
|
-
class UnprocessableEntityError extends APIError {
|
|
105
|
-
}
|
|
106
|
-
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
107
|
-
class RateLimitError extends APIError {
|
|
108
|
-
}
|
|
109
|
-
exports.RateLimitError = RateLimitError;
|
|
110
|
-
class InternalServerError extends APIError {
|
|
111
|
-
}
|
|
112
|
-
exports.InternalServerError = InternalServerError;
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
|
+
/** @deprecated Import from ./core/error instead */
|
|
5
|
+
tslib_1.__exportStar(require("./core/error.js"), exports);
|
|
113
6
|
//# sourceMappingURL=error.js.map
|
package/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":";;;AAAA,mDAAmD;AACnD,0DAA6B"}
|
package/error.mjs
CHANGED
|
@@ -1,97 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { castToError } from "./core.mjs";
|
|
3
|
-
export class FinchError extends Error {
|
|
4
|
-
}
|
|
5
|
-
export class APIError extends FinchError {
|
|
6
|
-
constructor(status, error, message, headers) {
|
|
7
|
-
super(`${APIError.makeMessage(status, error, message)}`);
|
|
8
|
-
this.status = status;
|
|
9
|
-
this.headers = headers;
|
|
10
|
-
this.error = error;
|
|
11
|
-
}
|
|
12
|
-
static makeMessage(status, error, message) {
|
|
13
|
-
const msg = error?.message ?
|
|
14
|
-
typeof error.message === 'string' ?
|
|
15
|
-
error.message
|
|
16
|
-
: JSON.stringify(error.message)
|
|
17
|
-
: error ? JSON.stringify(error)
|
|
18
|
-
: message;
|
|
19
|
-
if (status && msg) {
|
|
20
|
-
return `${status} ${msg}`;
|
|
21
|
-
}
|
|
22
|
-
if (status) {
|
|
23
|
-
return `${status} status code (no body)`;
|
|
24
|
-
}
|
|
25
|
-
if (msg) {
|
|
26
|
-
return msg;
|
|
27
|
-
}
|
|
28
|
-
return '(no status code or body)';
|
|
29
|
-
}
|
|
30
|
-
static generate(status, errorResponse, message, headers) {
|
|
31
|
-
if (!status || !headers) {
|
|
32
|
-
return new APIConnectionError({ message, cause: castToError(errorResponse) });
|
|
33
|
-
}
|
|
34
|
-
const error = errorResponse;
|
|
35
|
-
if (status === 400) {
|
|
36
|
-
return new BadRequestError(status, error, message, headers);
|
|
37
|
-
}
|
|
38
|
-
if (status === 401) {
|
|
39
|
-
return new AuthenticationError(status, error, message, headers);
|
|
40
|
-
}
|
|
41
|
-
if (status === 403) {
|
|
42
|
-
return new PermissionDeniedError(status, error, message, headers);
|
|
43
|
-
}
|
|
44
|
-
if (status === 404) {
|
|
45
|
-
return new NotFoundError(status, error, message, headers);
|
|
46
|
-
}
|
|
47
|
-
if (status === 409) {
|
|
48
|
-
return new ConflictError(status, error, message, headers);
|
|
49
|
-
}
|
|
50
|
-
if (status === 422) {
|
|
51
|
-
return new UnprocessableEntityError(status, error, message, headers);
|
|
52
|
-
}
|
|
53
|
-
if (status === 429) {
|
|
54
|
-
return new RateLimitError(status, error, message, headers);
|
|
55
|
-
}
|
|
56
|
-
if (status >= 500) {
|
|
57
|
-
return new InternalServerError(status, error, message, headers);
|
|
58
|
-
}
|
|
59
|
-
return new APIError(status, error, message, headers);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export class APIUserAbortError extends APIError {
|
|
63
|
-
constructor({ message } = {}) {
|
|
64
|
-
super(undefined, undefined, message || 'Request was aborted.', undefined);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
export class APIConnectionError extends APIError {
|
|
68
|
-
constructor({ message, cause }) {
|
|
69
|
-
super(undefined, undefined, message || 'Connection error.', undefined);
|
|
70
|
-
// in some environments the 'cause' property is already declared
|
|
71
|
-
// @ts-ignore
|
|
72
|
-
if (cause)
|
|
73
|
-
this.cause = cause;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
export class APIConnectionTimeoutError extends APIConnectionError {
|
|
77
|
-
constructor({ message } = {}) {
|
|
78
|
-
super({ message: message ?? 'Request timed out.' });
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
export class BadRequestError extends APIError {
|
|
82
|
-
}
|
|
83
|
-
export class AuthenticationError extends APIError {
|
|
84
|
-
}
|
|
85
|
-
export class PermissionDeniedError extends APIError {
|
|
86
|
-
}
|
|
87
|
-
export class NotFoundError extends APIError {
|
|
88
|
-
}
|
|
89
|
-
export class ConflictError extends APIError {
|
|
90
|
-
}
|
|
91
|
-
export class UnprocessableEntityError extends APIError {
|
|
92
|
-
}
|
|
93
|
-
export class RateLimitError extends APIError {
|
|
94
|
-
}
|
|
95
|
-
export class InternalServerError extends APIError {
|
|
96
|
-
}
|
|
1
|
+
export * from "./core/error.mjs";
|
|
97
2
|
//# sourceMappingURL=error.mjs.map
|
package/error.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.mjs","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.mjs","sourceRoot":"","sources":["src/error.ts"],"names":[],"mappings":""}
|
package/index.d.mts
CHANGED
|
@@ -1,197 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { AccessTokenCreateParams, AccessTokens, CreateAccessTokenResponse } from "./resources/access-tokens.js";
|
|
9
|
-
import { Account, DisconnectResponse, Introspection } from "./resources/account.js";
|
|
10
|
-
import { Provider, Providers, ProvidersSinglePage } from "./resources/providers.js";
|
|
11
|
-
import { RequestForwarding, RequestForwardingForwardParams, RequestForwardingForwardResponse } from "./resources/request-forwarding.js";
|
|
12
|
-
import { AccountUpdateEvent, BaseWebhookEvent, CompanyEvent, DirectoryEvent, EmploymentEvent, IndividualEvent, JobCompletionEvent, PayStatementEvent, PaymentEvent, WebhookEvent, Webhooks } from "./resources/webhooks.js";
|
|
13
|
-
import { Connect } from "./resources/connect/connect.js";
|
|
14
|
-
import { HRIS, Income, Location, Money } from "./resources/hris/hris.js";
|
|
15
|
-
import { Jobs } from "./resources/jobs/jobs.js";
|
|
16
|
-
import { Payroll } from "./resources/payroll/payroll.js";
|
|
17
|
-
import { Sandbox } from "./resources/sandbox/sandbox.js";
|
|
18
|
-
export interface ClientOptions {
|
|
19
|
-
accessToken?: string | null | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Defaults to process.env['FINCH_CLIENT_ID'].
|
|
22
|
-
*/
|
|
23
|
-
clientId?: string | null | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Defaults to process.env['FINCH_CLIENT_SECRET'].
|
|
26
|
-
*/
|
|
27
|
-
clientSecret?: string | null | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Defaults to process.env['FINCH_WEBHOOK_SECRET'].
|
|
30
|
-
*/
|
|
31
|
-
webhookSecret?: string | null | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
34
|
-
*
|
|
35
|
-
* Defaults to process.env['FINCH_BASE_URL'].
|
|
36
|
-
*/
|
|
37
|
-
baseURL?: string | null | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
40
|
-
* from the server before timing out a single request.
|
|
41
|
-
*
|
|
42
|
-
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
43
|
-
* much longer than this timeout before the promise succeeds or fails.
|
|
44
|
-
*/
|
|
45
|
-
timeout?: number | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* An HTTP agent used to manage HTTP(S) connections.
|
|
48
|
-
*
|
|
49
|
-
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
50
|
-
* otherwise no agent is used.
|
|
51
|
-
*/
|
|
52
|
-
httpAgent?: Agent | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Specify a custom `fetch` function implementation.
|
|
55
|
-
*
|
|
56
|
-
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
57
|
-
* defined globally.
|
|
58
|
-
*/
|
|
59
|
-
fetch?: Core.Fetch | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* The maximum number of times that the client will retry a request in case of a
|
|
62
|
-
* temporary failure, like a network error or a 5XX error from the server.
|
|
63
|
-
*
|
|
64
|
-
* @default 2
|
|
65
|
-
*/
|
|
66
|
-
maxRetries?: number | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Default headers to include with every request to the API.
|
|
69
|
-
*
|
|
70
|
-
* These can be removed in individual requests by explicitly setting the
|
|
71
|
-
* header to `undefined` or `null` in request options.
|
|
72
|
-
*/
|
|
73
|
-
defaultHeaders?: Core.Headers | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Default query parameters to include with every request to the API.
|
|
76
|
-
*
|
|
77
|
-
* These can be removed in individual requests by explicitly setting the
|
|
78
|
-
* param to `undefined` in request options.
|
|
79
|
-
*/
|
|
80
|
-
defaultQuery?: Core.DefaultQuery | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
|
|
83
|
-
* Only set this option to `true` if you understand the risks and have appropriate mitigations in place.
|
|
84
|
-
*/
|
|
85
|
-
dangerouslyAllowBrowser?: boolean | undefined;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* API Client for interfacing with the Finch API.
|
|
89
|
-
*/
|
|
90
|
-
export declare class Finch extends Core.APIClient {
|
|
91
|
-
accessToken: string | null;
|
|
92
|
-
clientId: string | null;
|
|
93
|
-
clientSecret: string | null;
|
|
94
|
-
webhookSecret: string | null;
|
|
95
|
-
private _options;
|
|
96
|
-
/**
|
|
97
|
-
* API Client for interfacing with the Finch API.
|
|
98
|
-
*
|
|
99
|
-
* @param {string | null | undefined} [opts.accessToken]
|
|
100
|
-
* @param {string | null | undefined} [opts.clientId=process.env['FINCH_CLIENT_ID'] ?? null]
|
|
101
|
-
* @param {string | null | undefined} [opts.clientSecret=process.env['FINCH_CLIENT_SECRET'] ?? null]
|
|
102
|
-
* @param {string | null | undefined} [opts.webhookSecret=process.env['FINCH_WEBHOOK_SECRET'] ?? null]
|
|
103
|
-
* @param {string} [opts.baseURL=process.env['FINCH_BASE_URL'] ?? https://api.tryfinch.com] - Override the default base URL for the API.
|
|
104
|
-
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
105
|
-
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
106
|
-
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
107
|
-
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
108
|
-
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
109
|
-
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
110
|
-
* @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
|
|
111
|
-
*/
|
|
112
|
-
constructor({ baseURL, accessToken, clientId, clientSecret, webhookSecret, ...opts }?: ClientOptions);
|
|
113
|
-
accessTokens: API.AccessTokens;
|
|
114
|
-
hris: API.HRIS;
|
|
115
|
-
providers: API.Providers;
|
|
116
|
-
account: API.Account;
|
|
117
|
-
webhooks: API.Webhooks;
|
|
118
|
-
requestForwarding: API.RequestForwarding;
|
|
119
|
-
jobs: API.Jobs;
|
|
120
|
-
sandbox: API.Sandbox;
|
|
121
|
-
payroll: API.Payroll;
|
|
122
|
-
connect: API.Connect;
|
|
123
|
-
/**
|
|
124
|
-
* DEPRECATED: use client.accessTokens.create instead.
|
|
125
|
-
*/
|
|
126
|
-
getAccessToken(code: string, options?: {
|
|
127
|
-
redirectUri: string;
|
|
128
|
-
}): Promise<string>;
|
|
129
|
-
/**
|
|
130
|
-
* Returns the authorization url which can be visited in order to obtain an
|
|
131
|
-
* authorization code from Finch. The authorization code can then be exchanged for
|
|
132
|
-
* an access token for the Finch api by calling get_access_token().
|
|
133
|
-
*/
|
|
134
|
-
getAuthURL({ products, redirectUri, sandbox, }: {
|
|
135
|
-
products: string;
|
|
136
|
-
redirectUri: string;
|
|
137
|
-
sandbox: boolean;
|
|
138
|
-
}): string;
|
|
139
|
-
/**
|
|
140
|
-
* Returns a copy of the current Finch client with the given access token for
|
|
141
|
-
* authentication.
|
|
142
|
-
*/
|
|
143
|
-
withAccessToken(accessToken: string): Finch;
|
|
144
|
-
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
145
|
-
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
146
|
-
protected validateHeaders(headers: Core.Headers, customHeaders: Core.Headers): void;
|
|
147
|
-
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
148
|
-
protected bearerAuth(opts: Core.FinalRequestOptions): Core.Headers;
|
|
149
|
-
protected basicAuth(opts: Core.FinalRequestOptions): Core.Headers;
|
|
150
|
-
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
151
|
-
static Finch: typeof Finch;
|
|
152
|
-
static DEFAULT_TIMEOUT: number;
|
|
153
|
-
static FinchError: typeof Errors.FinchError;
|
|
154
|
-
static APIError: typeof Errors.APIError;
|
|
155
|
-
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
156
|
-
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
157
|
-
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
|
158
|
-
static NotFoundError: typeof Errors.NotFoundError;
|
|
159
|
-
static ConflictError: typeof Errors.ConflictError;
|
|
160
|
-
static RateLimitError: typeof Errors.RateLimitError;
|
|
161
|
-
static BadRequestError: typeof Errors.BadRequestError;
|
|
162
|
-
static AuthenticationError: typeof Errors.AuthenticationError;
|
|
163
|
-
static InternalServerError: typeof Errors.InternalServerError;
|
|
164
|
-
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
165
|
-
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
166
|
-
static toFile: typeof Uploads.toFile;
|
|
167
|
-
static fileFromPath: typeof Uploads.fileFromPath;
|
|
168
|
-
}
|
|
169
|
-
export declare namespace Finch {
|
|
170
|
-
export type RequestOptions = Core.RequestOptions;
|
|
171
|
-
export import SinglePage = Pagination.SinglePage;
|
|
172
|
-
export { type SinglePageResponse as SinglePageResponse };
|
|
173
|
-
export import ResponsesPage = Pagination.ResponsesPage;
|
|
174
|
-
export { type ResponsesPageResponse as ResponsesPageResponse };
|
|
175
|
-
export import IndividualsPage = Pagination.IndividualsPage;
|
|
176
|
-
export { type IndividualsPageParams as IndividualsPageParams, type IndividualsPageResponse as IndividualsPageResponse, };
|
|
177
|
-
export import Page = Pagination.Page;
|
|
178
|
-
export { type PageParams as PageParams, type PageResponse as PageResponse };
|
|
179
|
-
export { AccessTokens as AccessTokens, type CreateAccessTokenResponse as CreateAccessTokenResponse, type AccessTokenCreateParams as AccessTokenCreateParams, };
|
|
180
|
-
export { HRIS as HRIS, type Income as Income, type Location as Location, type Money as Money };
|
|
181
|
-
export { Providers as Providers, type Provider as Provider, ProvidersSinglePage as ProvidersSinglePage };
|
|
182
|
-
export { Account as Account, type DisconnectResponse as DisconnectResponse, type Introspection as Introspection, };
|
|
183
|
-
export { Webhooks as Webhooks, type AccountUpdateEvent as AccountUpdateEvent, type BaseWebhookEvent as BaseWebhookEvent, type CompanyEvent as CompanyEvent, type DirectoryEvent as DirectoryEvent, type EmploymentEvent as EmploymentEvent, type IndividualEvent as IndividualEvent, type JobCompletionEvent as JobCompletionEvent, type PayStatementEvent as PayStatementEvent, type PaymentEvent as PaymentEvent, type WebhookEvent as WebhookEvent, };
|
|
184
|
-
export { RequestForwarding as RequestForwarding, type RequestForwardingForwardResponse as RequestForwardingForwardResponse, type RequestForwardingForwardParams as RequestForwardingForwardParams, };
|
|
185
|
-
export { Jobs as Jobs };
|
|
186
|
-
export { Sandbox as Sandbox };
|
|
187
|
-
export { Payroll as Payroll };
|
|
188
|
-
export { Connect as Connect };
|
|
189
|
-
export type ConnectionStatusType = API.ConnectionStatusType;
|
|
190
|
-
export type OperationSupport = API.OperationSupport;
|
|
191
|
-
export type OperationSupportMatrix = API.OperationSupportMatrix;
|
|
192
|
-
export type Paging = API.Paging;
|
|
193
|
-
}
|
|
194
|
-
export { toFile, fileFromPath } from "./uploads.js";
|
|
195
|
-
export { FinchError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
|
196
|
-
export default Finch;
|
|
197
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { Finch as default } from "./client.mjs";
|
|
2
|
+
export { type Uploadable, toFile } from "./core/uploads.mjs";
|
|
3
|
+
export { APIPromise } from "./core/api-promise.mjs";
|
|
4
|
+
export { Finch, type ClientOptions } from "./client.mjs";
|
|
5
|
+
export { PagePromise } from "./core/pagination.mjs";
|
|
6
|
+
export { FinchError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.mjs";
|
|
7
|
+
//# sourceMappingURL=index.d.mts.map
|
package/index.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,IAAI,OAAO,EAAE;OAEpB,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE;OAC3B,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE;OAC7B,EAAE,WAAW,EAAE;OACf,EACL,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB"}
|
package/index.d.ts
CHANGED
|
@@ -1,197 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import * as API from "./resources/index.js";
|
|
8
|
-
import { AccessTokenCreateParams, AccessTokens, CreateAccessTokenResponse } from "./resources/access-tokens.js";
|
|
9
|
-
import { Account, DisconnectResponse, Introspection } from "./resources/account.js";
|
|
10
|
-
import { Provider, Providers, ProvidersSinglePage } from "./resources/providers.js";
|
|
11
|
-
import { RequestForwarding, RequestForwardingForwardParams, RequestForwardingForwardResponse } from "./resources/request-forwarding.js";
|
|
12
|
-
import { AccountUpdateEvent, BaseWebhookEvent, CompanyEvent, DirectoryEvent, EmploymentEvent, IndividualEvent, JobCompletionEvent, PayStatementEvent, PaymentEvent, WebhookEvent, Webhooks } from "./resources/webhooks.js";
|
|
13
|
-
import { Connect } from "./resources/connect/connect.js";
|
|
14
|
-
import { HRIS, Income, Location, Money } from "./resources/hris/hris.js";
|
|
15
|
-
import { Jobs } from "./resources/jobs/jobs.js";
|
|
16
|
-
import { Payroll } from "./resources/payroll/payroll.js";
|
|
17
|
-
import { Sandbox } from "./resources/sandbox/sandbox.js";
|
|
18
|
-
export interface ClientOptions {
|
|
19
|
-
accessToken?: string | null | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* Defaults to process.env['FINCH_CLIENT_ID'].
|
|
22
|
-
*/
|
|
23
|
-
clientId?: string | null | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Defaults to process.env['FINCH_CLIENT_SECRET'].
|
|
26
|
-
*/
|
|
27
|
-
clientSecret?: string | null | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Defaults to process.env['FINCH_WEBHOOK_SECRET'].
|
|
30
|
-
*/
|
|
31
|
-
webhookSecret?: string | null | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
34
|
-
*
|
|
35
|
-
* Defaults to process.env['FINCH_BASE_URL'].
|
|
36
|
-
*/
|
|
37
|
-
baseURL?: string | null | undefined;
|
|
38
|
-
/**
|
|
39
|
-
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
40
|
-
* from the server before timing out a single request.
|
|
41
|
-
*
|
|
42
|
-
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
43
|
-
* much longer than this timeout before the promise succeeds or fails.
|
|
44
|
-
*/
|
|
45
|
-
timeout?: number | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* An HTTP agent used to manage HTTP(S) connections.
|
|
48
|
-
*
|
|
49
|
-
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
50
|
-
* otherwise no agent is used.
|
|
51
|
-
*/
|
|
52
|
-
httpAgent?: Agent | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Specify a custom `fetch` function implementation.
|
|
55
|
-
*
|
|
56
|
-
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
57
|
-
* defined globally.
|
|
58
|
-
*/
|
|
59
|
-
fetch?: Core.Fetch | undefined;
|
|
60
|
-
/**
|
|
61
|
-
* The maximum number of times that the client will retry a request in case of a
|
|
62
|
-
* temporary failure, like a network error or a 5XX error from the server.
|
|
63
|
-
*
|
|
64
|
-
* @default 2
|
|
65
|
-
*/
|
|
66
|
-
maxRetries?: number | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Default headers to include with every request to the API.
|
|
69
|
-
*
|
|
70
|
-
* These can be removed in individual requests by explicitly setting the
|
|
71
|
-
* header to `undefined` or `null` in request options.
|
|
72
|
-
*/
|
|
73
|
-
defaultHeaders?: Core.Headers | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Default query parameters to include with every request to the API.
|
|
76
|
-
*
|
|
77
|
-
* These can be removed in individual requests by explicitly setting the
|
|
78
|
-
* param to `undefined` in request options.
|
|
79
|
-
*/
|
|
80
|
-
defaultQuery?: Core.DefaultQuery | undefined;
|
|
81
|
-
/**
|
|
82
|
-
* By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
|
|
83
|
-
* Only set this option to `true` if you understand the risks and have appropriate mitigations in place.
|
|
84
|
-
*/
|
|
85
|
-
dangerouslyAllowBrowser?: boolean | undefined;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* API Client for interfacing with the Finch API.
|
|
89
|
-
*/
|
|
90
|
-
export declare class Finch extends Core.APIClient {
|
|
91
|
-
accessToken: string | null;
|
|
92
|
-
clientId: string | null;
|
|
93
|
-
clientSecret: string | null;
|
|
94
|
-
webhookSecret: string | null;
|
|
95
|
-
private _options;
|
|
96
|
-
/**
|
|
97
|
-
* API Client for interfacing with the Finch API.
|
|
98
|
-
*
|
|
99
|
-
* @param {string | null | undefined} [opts.accessToken]
|
|
100
|
-
* @param {string | null | undefined} [opts.clientId=process.env['FINCH_CLIENT_ID'] ?? null]
|
|
101
|
-
* @param {string | null | undefined} [opts.clientSecret=process.env['FINCH_CLIENT_SECRET'] ?? null]
|
|
102
|
-
* @param {string | null | undefined} [opts.webhookSecret=process.env['FINCH_WEBHOOK_SECRET'] ?? null]
|
|
103
|
-
* @param {string} [opts.baseURL=process.env['FINCH_BASE_URL'] ?? https://api.tryfinch.com] - Override the default base URL for the API.
|
|
104
|
-
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
105
|
-
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
106
|
-
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
107
|
-
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
108
|
-
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
109
|
-
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
110
|
-
* @param {boolean} [opts.dangerouslyAllowBrowser=false] - By default, client-side use of this library is not allowed, as it risks exposing your secret API credentials to attackers.
|
|
111
|
-
*/
|
|
112
|
-
constructor({ baseURL, accessToken, clientId, clientSecret, webhookSecret, ...opts }?: ClientOptions);
|
|
113
|
-
accessTokens: API.AccessTokens;
|
|
114
|
-
hris: API.HRIS;
|
|
115
|
-
providers: API.Providers;
|
|
116
|
-
account: API.Account;
|
|
117
|
-
webhooks: API.Webhooks;
|
|
118
|
-
requestForwarding: API.RequestForwarding;
|
|
119
|
-
jobs: API.Jobs;
|
|
120
|
-
sandbox: API.Sandbox;
|
|
121
|
-
payroll: API.Payroll;
|
|
122
|
-
connect: API.Connect;
|
|
123
|
-
/**
|
|
124
|
-
* DEPRECATED: use client.accessTokens.create instead.
|
|
125
|
-
*/
|
|
126
|
-
getAccessToken(code: string, options?: {
|
|
127
|
-
redirectUri: string;
|
|
128
|
-
}): Promise<string>;
|
|
129
|
-
/**
|
|
130
|
-
* Returns the authorization url which can be visited in order to obtain an
|
|
131
|
-
* authorization code from Finch. The authorization code can then be exchanged for
|
|
132
|
-
* an access token for the Finch api by calling get_access_token().
|
|
133
|
-
*/
|
|
134
|
-
getAuthURL({ products, redirectUri, sandbox, }: {
|
|
135
|
-
products: string;
|
|
136
|
-
redirectUri: string;
|
|
137
|
-
sandbox: boolean;
|
|
138
|
-
}): string;
|
|
139
|
-
/**
|
|
140
|
-
* Returns a copy of the current Finch client with the given access token for
|
|
141
|
-
* authentication.
|
|
142
|
-
*/
|
|
143
|
-
withAccessToken(accessToken: string): Finch;
|
|
144
|
-
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
145
|
-
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
146
|
-
protected validateHeaders(headers: Core.Headers, customHeaders: Core.Headers): void;
|
|
147
|
-
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
148
|
-
protected bearerAuth(opts: Core.FinalRequestOptions): Core.Headers;
|
|
149
|
-
protected basicAuth(opts: Core.FinalRequestOptions): Core.Headers;
|
|
150
|
-
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
151
|
-
static Finch: typeof Finch;
|
|
152
|
-
static DEFAULT_TIMEOUT: number;
|
|
153
|
-
static FinchError: typeof Errors.FinchError;
|
|
154
|
-
static APIError: typeof Errors.APIError;
|
|
155
|
-
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
156
|
-
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
157
|
-
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
|
158
|
-
static NotFoundError: typeof Errors.NotFoundError;
|
|
159
|
-
static ConflictError: typeof Errors.ConflictError;
|
|
160
|
-
static RateLimitError: typeof Errors.RateLimitError;
|
|
161
|
-
static BadRequestError: typeof Errors.BadRequestError;
|
|
162
|
-
static AuthenticationError: typeof Errors.AuthenticationError;
|
|
163
|
-
static InternalServerError: typeof Errors.InternalServerError;
|
|
164
|
-
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
165
|
-
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
166
|
-
static toFile: typeof Uploads.toFile;
|
|
167
|
-
static fileFromPath: typeof Uploads.fileFromPath;
|
|
168
|
-
}
|
|
169
|
-
export declare namespace Finch {
|
|
170
|
-
export type RequestOptions = Core.RequestOptions;
|
|
171
|
-
export import SinglePage = Pagination.SinglePage;
|
|
172
|
-
export { type SinglePageResponse as SinglePageResponse };
|
|
173
|
-
export import ResponsesPage = Pagination.ResponsesPage;
|
|
174
|
-
export { type ResponsesPageResponse as ResponsesPageResponse };
|
|
175
|
-
export import IndividualsPage = Pagination.IndividualsPage;
|
|
176
|
-
export { type IndividualsPageParams as IndividualsPageParams, type IndividualsPageResponse as IndividualsPageResponse, };
|
|
177
|
-
export import Page = Pagination.Page;
|
|
178
|
-
export { type PageParams as PageParams, type PageResponse as PageResponse };
|
|
179
|
-
export { AccessTokens as AccessTokens, type CreateAccessTokenResponse as CreateAccessTokenResponse, type AccessTokenCreateParams as AccessTokenCreateParams, };
|
|
180
|
-
export { HRIS as HRIS, type Income as Income, type Location as Location, type Money as Money };
|
|
181
|
-
export { Providers as Providers, type Provider as Provider, ProvidersSinglePage as ProvidersSinglePage };
|
|
182
|
-
export { Account as Account, type DisconnectResponse as DisconnectResponse, type Introspection as Introspection, };
|
|
183
|
-
export { Webhooks as Webhooks, type AccountUpdateEvent as AccountUpdateEvent, type BaseWebhookEvent as BaseWebhookEvent, type CompanyEvent as CompanyEvent, type DirectoryEvent as DirectoryEvent, type EmploymentEvent as EmploymentEvent, type IndividualEvent as IndividualEvent, type JobCompletionEvent as JobCompletionEvent, type PayStatementEvent as PayStatementEvent, type PaymentEvent as PaymentEvent, type WebhookEvent as WebhookEvent, };
|
|
184
|
-
export { RequestForwarding as RequestForwarding, type RequestForwardingForwardResponse as RequestForwardingForwardResponse, type RequestForwardingForwardParams as RequestForwardingForwardParams, };
|
|
185
|
-
export { Jobs as Jobs };
|
|
186
|
-
export { Sandbox as Sandbox };
|
|
187
|
-
export { Payroll as Payroll };
|
|
188
|
-
export { Connect as Connect };
|
|
189
|
-
export type ConnectionStatusType = API.ConnectionStatusType;
|
|
190
|
-
export type OperationSupport = API.OperationSupport;
|
|
191
|
-
export type OperationSupportMatrix = API.OperationSupportMatrix;
|
|
192
|
-
export type Paging = API.Paging;
|
|
193
|
-
}
|
|
194
|
-
export { toFile, fileFromPath } from "./uploads.js";
|
|
195
|
-
export { FinchError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
|
196
|
-
export default Finch;
|
|
1
|
+
export { Finch as default } from "./client.js";
|
|
2
|
+
export { type Uploadable, toFile } from "./core/uploads.js";
|
|
3
|
+
export { APIPromise } from "./core/api-promise.js";
|
|
4
|
+
export { Finch, type ClientOptions } from "./client.js";
|
|
5
|
+
export { PagePromise } from "./core/pagination.js";
|
|
6
|
+
export { FinchError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.js";
|
|
197
7
|
//# sourceMappingURL=index.d.ts.map
|