increase 0.3.0 → 0.4.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/.release-please-manifest.json +1 -1
- package/.stats.yml +1 -1
- package/CHANGELOG.md +46 -0
- package/README.md +3 -4
- package/api.md +11 -0
- package/core.ts +4 -140
- package/dist/cjs/core.d.ts +3 -53
- package/dist/cjs/core.d.ts.map +1 -1
- package/dist/cjs/core.js +12 -179
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/error.d.ts +72 -27
- package/dist/cjs/error.d.ts.map +1 -1
- package/dist/cjs/error.js +176 -54
- package/dist/cjs/error.js.map +1 -1
- package/dist/cjs/index.d.ts +25 -28
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +30 -77
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/resources/account-numbers.d.ts +1 -20
- package/dist/cjs/resources/account-numbers.d.ts.map +1 -1
- package/dist/cjs/resources/account-statements.d.ts +1 -20
- package/dist/cjs/resources/account-statements.d.ts.map +1 -1
- package/dist/cjs/resources/account-transfers.d.ts +1 -20
- package/dist/cjs/resources/account-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/accounts.d.ts +17 -25
- package/dist/cjs/resources/accounts.d.ts.map +1 -1
- package/dist/cjs/resources/ach-prenotifications.d.ts +6 -25
- package/dist/cjs/resources/ach-prenotifications.d.ts.map +1 -1
- package/dist/cjs/resources/ach-transfers.d.ts +70 -37
- package/dist/cjs/resources/ach-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/bookkeeping-accounts.d.ts +4 -4
- package/dist/cjs/resources/bookkeeping-accounts.d.ts.map +1 -1
- package/dist/cjs/resources/bookkeeping-entry-sets.d.ts +4 -16
- package/dist/cjs/resources/bookkeeping-entry-sets.d.ts.map +1 -1
- package/dist/cjs/resources/card-disputes.d.ts +2 -26
- package/dist/cjs/resources/card-disputes.d.ts.map +1 -1
- package/dist/cjs/resources/card-profiles.d.ts +1 -63
- package/dist/cjs/resources/card-profiles.d.ts.map +1 -1
- package/dist/cjs/resources/cards.d.ts +1 -116
- package/dist/cjs/resources/cards.d.ts.map +1 -1
- package/dist/cjs/resources/check-deposits.d.ts +3 -21
- package/dist/cjs/resources/check-deposits.d.ts.map +1 -1
- package/dist/cjs/resources/check-transfers.d.ts +10 -58
- package/dist/cjs/resources/check-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/declined-transactions.d.ts +2 -48
- package/dist/cjs/resources/declined-transactions.d.ts.map +1 -1
- package/dist/cjs/resources/digital-wallet-tokens.d.ts +1 -20
- package/dist/cjs/resources/digital-wallet-tokens.d.ts.map +1 -1
- package/dist/cjs/resources/documents.d.ts +2 -76
- package/dist/cjs/resources/documents.d.ts.map +1 -1
- package/dist/cjs/resources/entities/entities.d.ts +81 -1021
- package/dist/cjs/resources/entities/entities.d.ts.map +1 -1
- package/dist/cjs/resources/entities/index.d.ts +6 -1
- package/dist/cjs/resources/entities/index.d.ts.map +1 -1
- package/dist/cjs/resources/entities/index.js +8 -1
- package/dist/cjs/resources/entities/index.js.map +1 -1
- package/dist/cjs/resources/entities/supplemental-documents.d.ts +35 -0
- package/dist/cjs/resources/entities/supplemental-documents.d.ts.map +1 -1
- package/dist/cjs/resources/entities/supplemental-documents.js +14 -1
- package/dist/cjs/resources/entities/supplemental-documents.js.map +1 -1
- package/dist/cjs/resources/event-subscriptions.d.ts +4 -4
- package/dist/cjs/resources/event-subscriptions.d.ts.map +1 -1
- package/dist/cjs/resources/events.d.ts +24 -99
- package/dist/cjs/resources/events.d.ts.map +1 -1
- package/dist/cjs/resources/exports.d.ts +4 -86
- package/dist/cjs/resources/exports.d.ts.map +1 -1
- package/dist/cjs/resources/external-accounts.d.ts +5 -10
- package/dist/cjs/resources/external-accounts.d.ts.map +1 -1
- package/dist/cjs/resources/files.d.ts +6 -43
- package/dist/cjs/resources/files.d.ts.map +1 -1
- package/dist/cjs/resources/limits.d.ts +4 -4
- package/dist/cjs/resources/limits.d.ts.map +1 -1
- package/dist/cjs/resources/pending-transactions.d.ts +11 -86
- package/dist/cjs/resources/pending-transactions.d.ts.map +1 -1
- package/dist/cjs/resources/real-time-decisions.d.ts +0 -69
- package/dist/cjs/resources/real-time-decisions.d.ts.map +1 -1
- package/dist/cjs/resources/real-time-payments-transfers.d.ts +9 -28
- package/dist/cjs/resources/real-time-payments-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/ach-transfers.d.ts +108 -214
- package/dist/cjs/resources/simulations/ach-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/card-disputes.d.ts +4 -4
- package/dist/cjs/resources/simulations/card-disputes.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/cards.d.ts +6 -83
- package/dist/cjs/resources/simulations/cards.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/inbound-wire-drawdown-requests.d.ts +25 -25
- package/dist/cjs/resources/simulations/inbound-wire-drawdown-requests.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/index.d.ts +1 -0
- package/dist/cjs/resources/simulations/index.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/interest-payments.d.ts +57 -184
- package/dist/cjs/resources/simulations/interest-payments.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/programs.d.ts +21 -0
- package/dist/cjs/resources/simulations/programs.d.ts.map +1 -0
- package/dist/cjs/resources/simulations/programs.js +17 -0
- package/dist/cjs/resources/simulations/programs.js.map +1 -0
- package/dist/cjs/resources/simulations/real-time-payments-transfers.d.ts +58 -242
- package/dist/cjs/resources/simulations/real-time-payments-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/simulations.d.ts +2 -0
- package/dist/cjs/resources/simulations/simulations.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/simulations.js +2 -0
- package/dist/cjs/resources/simulations/simulations.js.map +1 -1
- package/dist/cjs/resources/simulations/wire-transfers.d.ts +57 -184
- package/dist/cjs/resources/simulations/wire-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/transactions.d.ts +81 -281
- package/dist/cjs/resources/transactions.d.ts.map +1 -1
- package/dist/cjs/resources/wire-drawdown-requests.d.ts +8 -8
- package/dist/cjs/resources/wire-drawdown-requests.d.ts.map +1 -1
- package/dist/cjs/resources/wire-transfers.d.ts +13 -32
- package/dist/cjs/resources/wire-transfers.d.ts.map +1 -1
- package/dist/cjs/streaming.d.ts +13 -0
- package/dist/cjs/streaming.d.ts.map +1 -0
- package/dist/cjs/streaming.js +282 -0
- package/dist/cjs/streaming.js.map +1 -0
- package/dist/cjs/tests/api-resources/account-numbers.test.js +7 -8
- package/dist/cjs/tests/api-resources/account-numbers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/account-statements.test.js +6 -4
- package/dist/cjs/tests/api-resources/account-statements.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/account-transfers.test.js +6 -5
- package/dist/cjs/tests/api-resources/account-transfers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/accounts.test.js +10 -12
- package/dist/cjs/tests/api-resources/accounts.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/ach-prenotifications.test.js +7 -15
- package/dist/cjs/tests/api-resources/ach-prenotifications.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/ach-transfers.test.js +8 -20
- package/dist/cjs/tests/api-resources/ach-transfers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/balance-lookups.test.js +1 -4
- package/dist/cjs/tests/api-resources/balance-lookups.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.js +2 -7
- package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.js +1 -3
- package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/card-disputes.test.js +7 -5
- package/dist/cjs/tests/api-resources/card-disputes.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/card-profiles.test.js +1 -1
- package/dist/cjs/tests/api-resources/card-profiles.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/cards.test.js +8 -16
- package/dist/cjs/tests/api-resources/cards.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/check-deposits.test.js +6 -4
- package/dist/cjs/tests/api-resources/check-deposits.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/check-transfers.test.js +8 -10
- package/dist/cjs/tests/api-resources/check-transfers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/declined-transactions.test.js +6 -4
- package/dist/cjs/tests/api-resources/declined-transactions.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.js +6 -4
- package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/documents.test.js +13 -9
- package/dist/cjs/tests/api-resources/documents.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/entities/entities.test.js +8 -76
- package/dist/cjs/tests/api-resources/entities/entities.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.js +12 -0
- package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/event-subscriptions.test.js +3 -7
- package/dist/cjs/tests/api-resources/event-subscriptions.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/events.test.js +7 -5
- package/dist/cjs/tests/api-resources/events.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/exports.test.js +2 -6
- package/dist/cjs/tests/api-resources/exports.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/external-accounts.test.js +3 -7
- package/dist/cjs/tests/api-resources/external-accounts.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/files.test.js +8 -7
- package/dist/cjs/tests/api-resources/files.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/limits.test.js +2 -7
- package/dist/cjs/tests/api-resources/limits.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/pending-transactions.test.js +7 -5
- package/dist/cjs/tests/api-resources/pending-transactions.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/real-time-decisions.test.js +1 -5
- package/dist/cjs/tests/api-resources/real-time-decisions.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.js +8 -10
- package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/routing-numbers.test.js +2 -6
- package/dist/cjs/tests/api-resources/routing-numbers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.js +4 -8
- package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/simulations/card-disputes.test.js +1 -2
- package/dist/cjs/tests/api-resources/simulations/card-disputes.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/simulations/cards.test.js +2 -8
- package/dist/cjs/tests/api-resources/simulations/cards.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.js +6 -18
- package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/simulations/programs.test.d.ts +2 -0
- package/dist/cjs/tests/api-resources/simulations/programs.test.d.ts.map +1 -0
- package/dist/cjs/tests/api-resources/simulations/programs.test.js +52 -0
- package/dist/cjs/tests/api-resources/simulations/programs.test.js.map +1 -0
- package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.js +1 -6
- package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.js +0 -13
- package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/transactions.test.js +9 -9
- package/dist/cjs/tests/api-resources/transactions.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.js +2 -5
- package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.js.map +1 -1
- package/dist/cjs/tests/api-resources/wire-transfers.test.js +9 -14
- package/dist/cjs/tests/api-resources/wire-transfers.test.js.map +1 -1
- package/dist/cjs/tests/index.test.js +9 -4
- package/dist/cjs/tests/index.test.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/error.ts +195 -27
- package/index.ts +26 -94
- package/package.json +1 -1
- package/release-please-config.json +5 -8
- package/resources/account-numbers.ts +1 -23
- package/resources/account-statements.ts +1 -23
- package/resources/account-transfers.ts +1 -23
- package/resources/accounts.ts +19 -28
- package/resources/ach-prenotifications.ts +7 -29
- package/resources/ach-transfers.ts +73 -42
- package/resources/bookkeeping-accounts.ts +5 -5
- package/resources/bookkeeping-entry-sets.ts +5 -19
- package/resources/card-disputes.ts +2 -29
- package/resources/card-profiles.ts +1 -74
- package/resources/cards.ts +1 -135
- package/resources/check-deposits.ts +3 -24
- package/resources/check-transfers.ts +11 -68
- package/resources/declined-transactions.ts +2 -60
- package/resources/digital-wallet-tokens.ts +1 -23
- package/resources/documents.ts +2 -79
- package/resources/entities/entities.ts +112 -1210
- package/resources/entities/index.ts +6 -1
- package/resources/entities/supplemental-documents.ts +46 -0
- package/resources/event-subscriptions.ts +5 -5
- package/resources/events.ts +28 -106
- package/resources/exports.ts +5 -99
- package/resources/external-accounts.ts +6 -11
- package/resources/files.ts +6 -46
- package/resources/limits.ts +5 -5
- package/resources/pending-transactions.ts +12 -104
- package/resources/real-time-decisions.ts +0 -77
- package/resources/real-time-payments-transfers.ts +11 -33
- package/resources/simulations/ach-transfers.ts +109 -263
- package/resources/simulations/card-disputes.ts +4 -4
- package/resources/simulations/cards.ts +7 -107
- package/resources/simulations/inbound-wire-drawdown-requests.ts +28 -28
- package/resources/simulations/index.ts +1 -0
- package/resources/simulations/interest-payments.ts +58 -224
- package/resources/simulations/programs.ts +26 -0
- package/resources/simulations/real-time-payments-transfers.ts +59 -292
- package/resources/simulations/simulations.ts +2 -0
- package/resources/simulations/wire-transfers.ts +58 -224
- package/resources/transactions.ts +86 -328
- package/resources/wire-drawdown-requests.ts +10 -10
- package/resources/wire-transfers.ts +15 -37
- package/streaming.ts +199 -0
- package/tests/api-resources/account-numbers.test.ts +7 -8
- package/tests/api-resources/account-statements.test.ts +6 -4
- package/tests/api-resources/account-transfers.test.ts +6 -5
- package/tests/api-resources/accounts.test.ts +10 -12
- package/tests/api-resources/ach-prenotifications.test.ts +7 -15
- package/tests/api-resources/ach-transfers.test.ts +8 -20
- package/tests/api-resources/balance-lookups.test.ts +1 -4
- package/tests/api-resources/bookkeeping-accounts.test.ts +2 -7
- package/tests/api-resources/bookkeeping-entry-sets.test.ts +1 -3
- package/tests/api-resources/card-disputes.test.ts +7 -5
- package/tests/api-resources/card-profiles.test.ts +1 -1
- package/tests/api-resources/cards.test.ts +8 -16
- package/tests/api-resources/check-deposits.test.ts +6 -4
- package/tests/api-resources/check-transfers.test.ts +8 -10
- package/tests/api-resources/declined-transactions.test.ts +6 -4
- package/tests/api-resources/digital-wallet-tokens.test.ts +6 -4
- package/tests/api-resources/documents.test.ts +9 -9
- package/tests/api-resources/entities/entities.test.ts +9 -80
- package/tests/api-resources/entities/supplemental-documents.test.ts +12 -0
- package/tests/api-resources/event-subscriptions.test.ts +3 -7
- package/tests/api-resources/events.test.ts +7 -5
- package/tests/api-resources/exports.test.ts +2 -6
- package/tests/api-resources/external-accounts.test.ts +3 -7
- package/tests/api-resources/files.test.ts +8 -7
- package/tests/api-resources/limits.test.ts +2 -7
- package/tests/api-resources/pending-transactions.test.ts +7 -5
- package/tests/api-resources/real-time-decisions.test.ts +1 -5
- package/tests/api-resources/real-time-payments-transfers.test.ts +8 -10
- package/tests/api-resources/routing-numbers.test.ts +2 -6
- package/tests/api-resources/simulations/ach-transfers.test.ts +1 -8
- package/tests/api-resources/simulations/card-disputes.test.ts +1 -2
- package/tests/api-resources/simulations/cards.test.ts +2 -8
- package/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.ts +6 -18
- package/tests/api-resources/simulations/programs.test.ts +15 -0
- package/tests/api-resources/simulations/real-time-payments-transfers.test.ts +1 -6
- package/tests/api-resources/simulations/wire-transfers.test.ts +0 -13
- package/tests/api-resources/transactions.test.ts +9 -9
- package/tests/api-resources/wire-drawdown-requests.test.ts +2 -5
- package/tests/api-resources/wire-transfers.test.ts +9 -14
- package/tests/index.test.ts +9 -4
- package/version.ts +1 -1
- package/.github/workflows/publish-npm.yml +0 -28
- package/.github/workflows/release-doctor.yml +0 -20
- package/.github/workflows/release.yml +0 -38
package/error.ts
CHANGED
|
@@ -1,8 +1,176 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { castToError, Headers } from '~/core';
|
|
4
4
|
|
|
5
|
-
export class
|
|
5
|
+
export class APIError extends Error {
|
|
6
|
+
readonly status: number | undefined;
|
|
7
|
+
readonly headers: Headers | undefined;
|
|
8
|
+
readonly error: Object | undefined;
|
|
9
|
+
|
|
10
|
+
constructor(
|
|
11
|
+
status: number | undefined,
|
|
12
|
+
error: Object | undefined,
|
|
13
|
+
message: string | undefined,
|
|
14
|
+
headers: Headers | undefined,
|
|
15
|
+
) {
|
|
16
|
+
super(message || (error as any)?.message || 'Unknown error occurred.');
|
|
17
|
+
this.status = status;
|
|
18
|
+
this.headers = headers;
|
|
19
|
+
this.error = error;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static generate(
|
|
23
|
+
status: number | undefined,
|
|
24
|
+
errorResponse: Object | undefined,
|
|
25
|
+
message: string | undefined,
|
|
26
|
+
headers: Headers | undefined,
|
|
27
|
+
) {
|
|
28
|
+
if (!status) {
|
|
29
|
+
return new APIConnectionError({ cause: castToError(errorResponse) });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const error = errorResponse as Record<string, any>;
|
|
33
|
+
|
|
34
|
+
const type = error?.['type'];
|
|
35
|
+
|
|
36
|
+
if (type === 'invalid_parameters_error') {
|
|
37
|
+
return new InvalidParametersError(status, error, message, headers);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (type === 'malformed_request_error') {
|
|
41
|
+
return new MalformedRequestError(status, error, message, headers);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (type === 'invalid_api_key_error') {
|
|
45
|
+
return new InvalidAPIKeyError(status, error, message, headers);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (type === 'environment_mismatch_error') {
|
|
49
|
+
return new EnvironmentMismatchError(status, error, message, headers);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (type === 'insufficient_permissions_error') {
|
|
53
|
+
return new InsufficientPermissionsError(status, error, message, headers);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (type === 'private_feature_error') {
|
|
57
|
+
return new PrivateFeatureError(status, error, message, headers);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (type === 'api_method_not_found_error') {
|
|
61
|
+
return new APIMethodNotFoundError(status, error, message, headers);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (type === 'object_not_found_error') {
|
|
65
|
+
return new ObjectNotFoundError(status, error, message, headers);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (type === 'idempotency_conflict_error') {
|
|
69
|
+
return new IdempotencyConflictError(status, error, message, headers);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (type === 'invalid_operation_error') {
|
|
73
|
+
return new InvalidOperationError(status, error, message, headers);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (type === 'idempotency_unprocessable_error') {
|
|
77
|
+
return new IdempotencyUnprocessableError(status, error, message, headers);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (type === 'rate_limited_error') {
|
|
81
|
+
return new RateLimitedError(status, error, message, headers);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (type === 'internal_server_error') {
|
|
85
|
+
return new InternalServerError(status, error, message, headers);
|
|
86
|
+
}
|
|
87
|
+
if (status === 500) {
|
|
88
|
+
return new InternalServerError(
|
|
89
|
+
status,
|
|
90
|
+
{ type: 'internal_server_error', title: '', detail: null, status: 500 },
|
|
91
|
+
message,
|
|
92
|
+
headers,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (status === 400) {
|
|
97
|
+
return new BadRequestError(status, error, message, headers);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (status === 401) {
|
|
101
|
+
return new AuthenticationError(status, error, message, headers);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (status === 403) {
|
|
105
|
+
return new PermissionDeniedError(status, error, message, headers);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (status === 404) {
|
|
109
|
+
return new NotFoundError(status, error, message, headers);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (status === 409) {
|
|
113
|
+
return new ConflictError(status, error, message, headers);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (status === 422) {
|
|
117
|
+
return new UnprocessableEntityError(status, error, message, headers);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (status === 429) {
|
|
121
|
+
return new RateLimitError(status, error, message, headers);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return new APIError(status, error, message, headers);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export class APIConnectionError extends APIError {
|
|
129
|
+
override readonly status: undefined = undefined;
|
|
130
|
+
|
|
131
|
+
constructor({ message, cause }: { message?: string; cause?: Error | undefined }) {
|
|
132
|
+
super(undefined, undefined, message || 'Connection error.', undefined);
|
|
133
|
+
// in some environments the 'cause' property is already declared
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
if (cause) this.cause = cause;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export class APIConnectionTimeoutError extends APIConnectionError {
|
|
140
|
+
constructor() {
|
|
141
|
+
super({ message: 'Request timed out.' });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export class BadRequestError extends APIError {
|
|
146
|
+
override readonly status: 400 = 400;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export class AuthenticationError extends APIError {
|
|
150
|
+
override readonly status: 401 = 401;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export class PermissionDeniedError extends APIError {
|
|
154
|
+
override readonly status: 403 = 403;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export class NotFoundError extends APIError {
|
|
158
|
+
override readonly status: 404 = 404;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export class ConflictError extends APIError {
|
|
162
|
+
override readonly status: 409 = 409;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export class UnprocessableEntityError extends APIError {
|
|
166
|
+
override readonly status: 422 = 422;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export class RateLimitError extends APIError {
|
|
170
|
+
override readonly status: 429 = 429;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export class InvalidParametersError extends BadRequestError {
|
|
6
174
|
detail: string | null;
|
|
7
175
|
|
|
8
176
|
/**
|
|
@@ -20,7 +188,7 @@ export class InvalidParametersError extends Core.BadRequestError {
|
|
|
20
188
|
status: number | undefined,
|
|
21
189
|
error: Object | undefined,
|
|
22
190
|
message: string | undefined,
|
|
23
|
-
headers:
|
|
191
|
+
headers: Headers | undefined,
|
|
24
192
|
) {
|
|
25
193
|
const data = error as Record<string, any>;
|
|
26
194
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -33,7 +201,7 @@ export class InvalidParametersError extends Core.BadRequestError {
|
|
|
33
201
|
}
|
|
34
202
|
}
|
|
35
203
|
|
|
36
|
-
export class MalformedRequestError extends
|
|
204
|
+
export class MalformedRequestError extends BadRequestError {
|
|
37
205
|
detail: string | null;
|
|
38
206
|
|
|
39
207
|
override status: 400;
|
|
@@ -46,7 +214,7 @@ export class MalformedRequestError extends Core.BadRequestError {
|
|
|
46
214
|
status: number | undefined,
|
|
47
215
|
error: Object | undefined,
|
|
48
216
|
message: string | undefined,
|
|
49
|
-
headers:
|
|
217
|
+
headers: Headers | undefined,
|
|
50
218
|
) {
|
|
51
219
|
const data = error as Record<string, any>;
|
|
52
220
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -58,7 +226,7 @@ export class MalformedRequestError extends Core.BadRequestError {
|
|
|
58
226
|
}
|
|
59
227
|
}
|
|
60
228
|
|
|
61
|
-
export class InvalidAPIKeyError extends
|
|
229
|
+
export class InvalidAPIKeyError extends AuthenticationError {
|
|
62
230
|
detail: string | null;
|
|
63
231
|
|
|
64
232
|
override status: 401;
|
|
@@ -71,7 +239,7 @@ export class InvalidAPIKeyError extends Core.AuthenticationError {
|
|
|
71
239
|
status: number | undefined,
|
|
72
240
|
error: Object | undefined,
|
|
73
241
|
message: string | undefined,
|
|
74
|
-
headers:
|
|
242
|
+
headers: Headers | undefined,
|
|
75
243
|
) {
|
|
76
244
|
const data = error as Record<string, any>;
|
|
77
245
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -83,7 +251,7 @@ export class InvalidAPIKeyError extends Core.AuthenticationError {
|
|
|
83
251
|
}
|
|
84
252
|
}
|
|
85
253
|
|
|
86
|
-
export class EnvironmentMismatchError extends
|
|
254
|
+
export class EnvironmentMismatchError extends PermissionDeniedError {
|
|
87
255
|
detail: string | null;
|
|
88
256
|
|
|
89
257
|
override status: 403;
|
|
@@ -96,7 +264,7 @@ export class EnvironmentMismatchError extends Core.PermissionDeniedError {
|
|
|
96
264
|
status: number | undefined,
|
|
97
265
|
error: Object | undefined,
|
|
98
266
|
message: string | undefined,
|
|
99
|
-
headers:
|
|
267
|
+
headers: Headers | undefined,
|
|
100
268
|
) {
|
|
101
269
|
const data = error as Record<string, any>;
|
|
102
270
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -108,7 +276,7 @@ export class EnvironmentMismatchError extends Core.PermissionDeniedError {
|
|
|
108
276
|
}
|
|
109
277
|
}
|
|
110
278
|
|
|
111
|
-
export class InsufficientPermissionsError extends
|
|
279
|
+
export class InsufficientPermissionsError extends PermissionDeniedError {
|
|
112
280
|
detail: string | null;
|
|
113
281
|
|
|
114
282
|
override status: 403;
|
|
@@ -121,7 +289,7 @@ export class InsufficientPermissionsError extends Core.PermissionDeniedError {
|
|
|
121
289
|
status: number | undefined,
|
|
122
290
|
error: Object | undefined,
|
|
123
291
|
message: string | undefined,
|
|
124
|
-
headers:
|
|
292
|
+
headers: Headers | undefined,
|
|
125
293
|
) {
|
|
126
294
|
const data = error as Record<string, any>;
|
|
127
295
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -133,7 +301,7 @@ export class InsufficientPermissionsError extends Core.PermissionDeniedError {
|
|
|
133
301
|
}
|
|
134
302
|
}
|
|
135
303
|
|
|
136
|
-
export class PrivateFeatureError extends
|
|
304
|
+
export class PrivateFeatureError extends PermissionDeniedError {
|
|
137
305
|
detail: string | null;
|
|
138
306
|
|
|
139
307
|
override status: 403;
|
|
@@ -146,7 +314,7 @@ export class PrivateFeatureError extends Core.PermissionDeniedError {
|
|
|
146
314
|
status: number | undefined,
|
|
147
315
|
error: Object | undefined,
|
|
148
316
|
message: string | undefined,
|
|
149
|
-
headers:
|
|
317
|
+
headers: Headers | undefined,
|
|
150
318
|
) {
|
|
151
319
|
const data = error as Record<string, any>;
|
|
152
320
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -158,7 +326,7 @@ export class PrivateFeatureError extends Core.PermissionDeniedError {
|
|
|
158
326
|
}
|
|
159
327
|
}
|
|
160
328
|
|
|
161
|
-
export class APIMethodNotFoundError extends
|
|
329
|
+
export class APIMethodNotFoundError extends NotFoundError {
|
|
162
330
|
detail: string | null;
|
|
163
331
|
|
|
164
332
|
override status: 404;
|
|
@@ -171,7 +339,7 @@ export class APIMethodNotFoundError extends Core.NotFoundError {
|
|
|
171
339
|
status: number | undefined,
|
|
172
340
|
error: Object | undefined,
|
|
173
341
|
message: string | undefined,
|
|
174
|
-
headers:
|
|
342
|
+
headers: Headers | undefined,
|
|
175
343
|
) {
|
|
176
344
|
const data = error as Record<string, any>;
|
|
177
345
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -183,7 +351,7 @@ export class APIMethodNotFoundError extends Core.NotFoundError {
|
|
|
183
351
|
}
|
|
184
352
|
}
|
|
185
353
|
|
|
186
|
-
export class ObjectNotFoundError extends
|
|
354
|
+
export class ObjectNotFoundError extends NotFoundError {
|
|
187
355
|
detail: string | null;
|
|
188
356
|
|
|
189
357
|
override status: 404;
|
|
@@ -196,7 +364,7 @@ export class ObjectNotFoundError extends Core.NotFoundError {
|
|
|
196
364
|
status: number | undefined,
|
|
197
365
|
error: Object | undefined,
|
|
198
366
|
message: string | undefined,
|
|
199
|
-
headers:
|
|
367
|
+
headers: Headers | undefined,
|
|
200
368
|
) {
|
|
201
369
|
const data = error as Record<string, any>;
|
|
202
370
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -208,7 +376,7 @@ export class ObjectNotFoundError extends Core.NotFoundError {
|
|
|
208
376
|
}
|
|
209
377
|
}
|
|
210
378
|
|
|
211
|
-
export class IdempotencyConflictError extends
|
|
379
|
+
export class IdempotencyConflictError extends ConflictError {
|
|
212
380
|
detail: string | null;
|
|
213
381
|
|
|
214
382
|
override status: 409;
|
|
@@ -221,7 +389,7 @@ export class IdempotencyConflictError extends Core.ConflictError {
|
|
|
221
389
|
status: number | undefined,
|
|
222
390
|
error: Object | undefined,
|
|
223
391
|
message: string | undefined,
|
|
224
|
-
headers:
|
|
392
|
+
headers: Headers | undefined,
|
|
225
393
|
) {
|
|
226
394
|
const data = error as Record<string, any>;
|
|
227
395
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -233,7 +401,7 @@ export class IdempotencyConflictError extends Core.ConflictError {
|
|
|
233
401
|
}
|
|
234
402
|
}
|
|
235
403
|
|
|
236
|
-
export class InvalidOperationError extends
|
|
404
|
+
export class InvalidOperationError extends ConflictError {
|
|
237
405
|
detail: string | null;
|
|
238
406
|
|
|
239
407
|
override status: 409;
|
|
@@ -246,7 +414,7 @@ export class InvalidOperationError extends Core.ConflictError {
|
|
|
246
414
|
status: number | undefined,
|
|
247
415
|
error: Object | undefined,
|
|
248
416
|
message: string | undefined,
|
|
249
|
-
headers:
|
|
417
|
+
headers: Headers | undefined,
|
|
250
418
|
) {
|
|
251
419
|
const data = error as Record<string, any>;
|
|
252
420
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -258,7 +426,7 @@ export class InvalidOperationError extends Core.ConflictError {
|
|
|
258
426
|
}
|
|
259
427
|
}
|
|
260
428
|
|
|
261
|
-
export class IdempotencyUnprocessableError extends
|
|
429
|
+
export class IdempotencyUnprocessableError extends UnprocessableEntityError {
|
|
262
430
|
detail: string | null;
|
|
263
431
|
|
|
264
432
|
override status: 422;
|
|
@@ -271,7 +439,7 @@ export class IdempotencyUnprocessableError extends Core.UnprocessableEntityError
|
|
|
271
439
|
status: number | undefined,
|
|
272
440
|
error: Object | undefined,
|
|
273
441
|
message: string | undefined,
|
|
274
|
-
headers:
|
|
442
|
+
headers: Headers | undefined,
|
|
275
443
|
) {
|
|
276
444
|
const data = error as Record<string, any>;
|
|
277
445
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -283,7 +451,7 @@ export class IdempotencyUnprocessableError extends Core.UnprocessableEntityError
|
|
|
283
451
|
}
|
|
284
452
|
}
|
|
285
453
|
|
|
286
|
-
export class RateLimitedError extends
|
|
454
|
+
export class RateLimitedError extends RateLimitError {
|
|
287
455
|
detail: string | null;
|
|
288
456
|
|
|
289
457
|
override status: 429;
|
|
@@ -298,7 +466,7 @@ export class RateLimitedError extends Core.RateLimitError {
|
|
|
298
466
|
status: number | undefined,
|
|
299
467
|
error: Object | undefined,
|
|
300
468
|
message: string | undefined,
|
|
301
|
-
headers:
|
|
469
|
+
headers: Headers | undefined,
|
|
302
470
|
) {
|
|
303
471
|
const data = error as Record<string, any>;
|
|
304
472
|
super(status, error, data?.['title'] || message, headers);
|
|
@@ -311,7 +479,7 @@ export class RateLimitedError extends Core.RateLimitError {
|
|
|
311
479
|
}
|
|
312
480
|
}
|
|
313
481
|
|
|
314
|
-
export class InternalServerError extends
|
|
482
|
+
export class InternalServerError extends APIError {
|
|
315
483
|
detail: string | null;
|
|
316
484
|
|
|
317
485
|
override status: 500;
|
|
@@ -324,7 +492,7 @@ export class InternalServerError extends Core.InternalServerError {
|
|
|
324
492
|
status: number | undefined,
|
|
325
493
|
error: Object | undefined,
|
|
326
494
|
message: string | undefined,
|
|
327
|
-
headers:
|
|
495
|
+
headers: Headers | undefined,
|
|
328
496
|
) {
|
|
329
497
|
const data = error as Record<string, any>;
|
|
330
498
|
super(status, error, data?.['title'] || message, headers);
|
package/index.ts
CHANGED
|
@@ -4,9 +4,9 @@ import qs from 'qs';
|
|
|
4
4
|
import * as Core from './core';
|
|
5
5
|
import * as Pagination from './pagination';
|
|
6
6
|
import * as API from './resources';
|
|
7
|
+
import * as Errors from '~/error';
|
|
7
8
|
import type { Agent } from 'http';
|
|
8
9
|
import * as FileFromPath from 'formdata-node/file-from-path';
|
|
9
|
-
import * as Errors from '~/error';
|
|
10
10
|
|
|
11
11
|
const environments = {
|
|
12
12
|
production: 'https://api.increase.com',
|
|
@@ -23,12 +23,15 @@ type Config = {
|
|
|
23
23
|
timeout?: number;
|
|
24
24
|
httpAgent?: Agent;
|
|
25
25
|
maxRetries?: number;
|
|
26
|
+
defaultHeaders?: Core.Headers;
|
|
26
27
|
};
|
|
27
28
|
|
|
28
29
|
/** Instantiate the API Client. */
|
|
29
30
|
export class Increase extends Core.APIClient {
|
|
30
31
|
apiKey: string;
|
|
31
32
|
|
|
33
|
+
private _options: Config;
|
|
34
|
+
|
|
32
35
|
constructor(config?: Config) {
|
|
33
36
|
const options: Config = {
|
|
34
37
|
apiKey: process.env['INCREASE_API_KEY'] || '',
|
|
@@ -49,6 +52,7 @@ export class Increase extends Core.APIClient {
|
|
|
49
52
|
maxRetries: options.maxRetries,
|
|
50
53
|
});
|
|
51
54
|
this.apiKey = options.apiKey;
|
|
55
|
+
this._options = options;
|
|
52
56
|
this.idempotencyHeader = 'Idempotency-Key';
|
|
53
57
|
}
|
|
54
58
|
|
|
@@ -91,107 +95,40 @@ export class Increase extends Core.APIClient {
|
|
|
91
95
|
accountStatements: API.AccountStatements = new API.AccountStatements(this);
|
|
92
96
|
simulations: API.Simulations = new API.Simulations(this);
|
|
93
97
|
|
|
94
|
-
protected override
|
|
95
|
-
return {
|
|
98
|
+
protected override defaultHeaders(): Core.Headers {
|
|
99
|
+
return {
|
|
100
|
+
...super.defaultHeaders(),
|
|
101
|
+
...this._options.defaultHeaders,
|
|
102
|
+
};
|
|
96
103
|
}
|
|
97
104
|
|
|
98
|
-
protected override
|
|
99
|
-
|
|
100
|
-
error: Object | undefined,
|
|
101
|
-
message: string | undefined,
|
|
102
|
-
headers: Core.Headers | undefined,
|
|
103
|
-
) {
|
|
104
|
-
const type = (error as Record<string, any>)?.['type'];
|
|
105
|
-
|
|
106
|
-
if (type === 'invalid_parameters_error') {
|
|
107
|
-
return new Errors.InvalidParametersError(status, error, message, headers);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (type === 'malformed_request_error') {
|
|
111
|
-
return new Errors.MalformedRequestError(status, error, message, headers);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (type === 'invalid_api_key_error') {
|
|
115
|
-
return new Errors.InvalidAPIKeyError(status, error, message, headers);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (type === 'environment_mismatch_error') {
|
|
119
|
-
return new Errors.EnvironmentMismatchError(status, error, message, headers);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (type === 'insufficient_permissions_error') {
|
|
123
|
-
return new Errors.InsufficientPermissionsError(status, error, message, headers);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (type === 'private_feature_error') {
|
|
127
|
-
return new Errors.PrivateFeatureError(status, error, message, headers);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (type === 'api_method_not_found_error') {
|
|
131
|
-
return new Errors.APIMethodNotFoundError(status, error, message, headers);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (type === 'object_not_found_error') {
|
|
135
|
-
return new Errors.ObjectNotFoundError(status, error, message, headers);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if (type === 'idempotency_conflict_error') {
|
|
139
|
-
return new Errors.IdempotencyConflictError(status, error, message, headers);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (type === 'invalid_operation_error') {
|
|
143
|
-
return new Errors.InvalidOperationError(status, error, message, headers);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
if (type === 'idempotency_unprocessable_error') {
|
|
147
|
-
return new Errors.IdempotencyUnprocessableError(status, error, message, headers);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (type === 'rate_limited_error') {
|
|
151
|
-
return new Errors.RateLimitedError(status, error, message, headers);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (type === 'internal_server_error') {
|
|
155
|
-
return new Errors.InternalServerError(status, error, message, headers);
|
|
156
|
-
}
|
|
157
|
-
if (status === 500) {
|
|
158
|
-
return new Errors.InternalServerError(
|
|
159
|
-
status,
|
|
160
|
-
{ type: 'internal_server_error', title: '', detail: null, status: 500 },
|
|
161
|
-
message,
|
|
162
|
-
headers,
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return super.makeStatusError(status, error, message, headers);
|
|
105
|
+
protected override authHeaders(): Core.Headers {
|
|
106
|
+
return { Authorization: `Bearer ${this.apiKey}` };
|
|
167
107
|
}
|
|
168
108
|
|
|
169
109
|
protected override qsOptions(): qs.IStringifyOptions {
|
|
170
110
|
return { allowDots: true, arrayFormat: 'comma' };
|
|
171
111
|
}
|
|
172
112
|
|
|
173
|
-
static APIError =
|
|
174
|
-
|
|
175
|
-
static
|
|
176
|
-
static
|
|
177
|
-
|
|
178
|
-
static
|
|
179
|
-
static
|
|
180
|
-
static PermissionDeniedError = Core.PermissionDeniedError;
|
|
181
|
-
static NotFoundError = Core.NotFoundError;
|
|
182
|
-
static ConflictError = Core.ConflictError;
|
|
183
|
-
static UnprocessableEntityError = Core.UnprocessableEntityError;
|
|
184
|
-
static RateLimitError = Core.RateLimitError;
|
|
185
|
-
|
|
113
|
+
static APIError = Errors.APIError;
|
|
114
|
+
static APIConnectionError = Errors.APIConnectionError;
|
|
115
|
+
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
116
|
+
static NotFoundError = Errors.NotFoundError;
|
|
117
|
+
static ConflictError = Errors.ConflictError;
|
|
118
|
+
static RateLimitError = Errors.RateLimitError;
|
|
119
|
+
static BadRequestError = Errors.BadRequestError;
|
|
186
120
|
static RateLimitedError = Errors.RateLimitedError;
|
|
187
121
|
static InvalidAPIKeyError = Errors.InvalidAPIKeyError;
|
|
122
|
+
static AuthenticationError = Errors.AuthenticationError;
|
|
188
123
|
static InternalServerError = Errors.InternalServerError;
|
|
189
124
|
static ObjectNotFoundError = Errors.ObjectNotFoundError;
|
|
190
125
|
static PrivateFeatureError = Errors.PrivateFeatureError;
|
|
126
|
+
static PermissionDeniedError = Errors.PermissionDeniedError;
|
|
191
127
|
static InvalidOperationError = Errors.InvalidOperationError;
|
|
192
128
|
static MalformedRequestError = Errors.MalformedRequestError;
|
|
193
129
|
static APIMethodNotFoundError = Errors.APIMethodNotFoundError;
|
|
194
130
|
static InvalidParametersError = Errors.InvalidParametersError;
|
|
131
|
+
static UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
195
132
|
static EnvironmentMismatchError = Errors.EnvironmentMismatchError;
|
|
196
133
|
static IdempotencyConflictError = Errors.IdempotencyConflictError;
|
|
197
134
|
static InsufficientPermissionsError = Errors.InsufficientPermissionsError;
|
|
@@ -200,29 +137,24 @@ export class Increase extends Core.APIClient {
|
|
|
200
137
|
|
|
201
138
|
export const {
|
|
202
139
|
APIError,
|
|
203
|
-
|
|
204
140
|
APIConnectionError,
|
|
205
141
|
APIConnectionTimeoutError,
|
|
206
|
-
|
|
207
|
-
BadRequestError,
|
|
208
|
-
AuthenticationError,
|
|
209
|
-
PermissionDeniedError,
|
|
210
142
|
NotFoundError,
|
|
211
143
|
ConflictError,
|
|
212
|
-
UnprocessableEntityError,
|
|
213
144
|
RateLimitError,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
export const {
|
|
145
|
+
BadRequestError,
|
|
217
146
|
RateLimitedError,
|
|
218
147
|
InvalidAPIKeyError,
|
|
148
|
+
AuthenticationError,
|
|
219
149
|
InternalServerError,
|
|
220
150
|
ObjectNotFoundError,
|
|
221
151
|
PrivateFeatureError,
|
|
152
|
+
PermissionDeniedError,
|
|
222
153
|
InvalidOperationError,
|
|
223
154
|
MalformedRequestError,
|
|
224
155
|
APIMethodNotFoundError,
|
|
225
156
|
InvalidParametersError,
|
|
157
|
+
UnprocessableEntityError,
|
|
226
158
|
EnvironmentMismatchError,
|
|
227
159
|
IdempotencyConflictError,
|
|
228
160
|
InsufficientPermissionsError,
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
|
|
6
6
|
"include-v-in-tag": true,
|
|
7
|
+
"include-component-in-tag": false,
|
|
7
8
|
"bump-minor-pre-major": true,
|
|
8
9
|
"bump-patch-for-minor-pre-major": true,
|
|
9
10
|
"pull-request-header": "Automated Release PR",
|
|
@@ -26,18 +27,15 @@
|
|
|
26
27
|
},
|
|
27
28
|
{
|
|
28
29
|
"type": "chore",
|
|
29
|
-
"section": "
|
|
30
|
-
"hidden": true
|
|
30
|
+
"section": "Chores"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"type": "docs",
|
|
34
|
-
"section": "Documentation"
|
|
35
|
-
"hidden": true
|
|
34
|
+
"section": "Documentation"
|
|
36
35
|
},
|
|
37
36
|
{
|
|
38
37
|
"type": "style",
|
|
39
|
-
"section": "Styles"
|
|
40
|
-
"hidden": true
|
|
38
|
+
"section": "Styles"
|
|
41
39
|
},
|
|
42
40
|
{
|
|
43
41
|
"type": "refactor",
|
|
@@ -50,8 +48,7 @@
|
|
|
50
48
|
},
|
|
51
49
|
{
|
|
52
50
|
"type": "build",
|
|
53
|
-
"section": "Build System"
|
|
54
|
-
"hidden": true
|
|
51
|
+
"section": "Build System"
|
|
55
52
|
},
|
|
56
53
|
{
|
|
57
54
|
"type": "ci",
|
|
@@ -133,29 +133,7 @@ export interface AccountNumberListParams extends PageParams {
|
|
|
133
133
|
*/
|
|
134
134
|
account_id?: string;
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
* Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
|
|
138
|
-
* timestamp.
|
|
139
|
-
*/
|
|
140
|
-
'created_at.after'?: string;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
|
|
144
|
-
* timestamp.
|
|
145
|
-
*/
|
|
146
|
-
'created_at.before'?: string;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Return results on or after this
|
|
150
|
-
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
|
|
151
|
-
*/
|
|
152
|
-
'created_at.on_or_after'?: string;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Return results on or before this
|
|
156
|
-
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
|
|
157
|
-
*/
|
|
158
|
-
'created_at.on_or_before'?: string;
|
|
136
|
+
created_at?: AccountNumberListParams.CreatedAt;
|
|
159
137
|
|
|
160
138
|
/**
|
|
161
139
|
* The status to retrieve Account Numbers for.
|
|
@@ -99,29 +99,7 @@ export interface AccountStatementListParams extends PageParams {
|
|
|
99
99
|
*/
|
|
100
100
|
account_id?: string;
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
* Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
|
|
104
|
-
* timestamp.
|
|
105
|
-
*/
|
|
106
|
-
'statement_period_start.after'?: string;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
|
|
110
|
-
* timestamp.
|
|
111
|
-
*/
|
|
112
|
-
'statement_period_start.before'?: string;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Return results on or after this
|
|
116
|
-
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
|
|
117
|
-
*/
|
|
118
|
-
'statement_period_start.on_or_after'?: string;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Return results on or before this
|
|
122
|
-
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
|
|
123
|
-
*/
|
|
124
|
-
'statement_period_start.on_or_before'?: string;
|
|
102
|
+
statement_period_start?: AccountStatementListParams.StatementPeriodStart;
|
|
125
103
|
}
|
|
126
104
|
|
|
127
105
|
export namespace AccountStatementListParams {
|