modern-treasury 2.0.0 → 2.2.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 +135 -0
- package/LICENSE +7 -0
- package/README.md +273 -0
- package/_shims/fetch.js +1 -1
- package/_shims/formdata.node.d.ts +1 -0
- package/core.d.ts +19 -11
- package/core.d.ts.map +1 -1
- package/core.js +122 -72
- package/core.js.map +1 -1
- package/core.mjs +112 -32
- package/core.mjs.map +1 -1
- package/error.d.ts +5 -0
- package/error.d.ts.map +1 -1
- package/error.js +20 -3
- package/error.js.map +1 -1
- package/error.mjs +18 -3
- package/error.mjs.map +1 -1
- package/index.d.mts +17 -8
- package/index.d.ts +17 -8
- package/index.d.ts.map +1 -1
- package/index.js +36 -20
- package/index.js.map +1 -1
- package/index.mjs +35 -20
- package/index.mjs.map +1 -1
- package/package.json +5 -5
- package/resources/account-collection-flows.d.ts +11 -11
- package/resources/account-collection-flows.d.ts.map +1 -1
- package/resources/account-collection-flows.js +4 -4
- package/resources/account-collection-flows.mjs +2 -2
- package/resources/account-details.d.ts.map +1 -1
- package/resources/connections.d.ts.map +1 -1
- package/resources/counterparties.d.ts.map +1 -1
- package/resources/documents.d.ts +2 -5
- package/resources/documents.d.ts.map +1 -1
- package/resources/documents.js +1 -7
- package/resources/documents.js.map +1 -1
- package/resources/documents.mjs +1 -7
- package/resources/documents.mjs.map +1 -1
- package/resources/events.d.ts.map +1 -1
- package/resources/expected-payments.d.ts.map +1 -1
- package/resources/external-accounts.d.ts.map +1 -1
- package/resources/incoming-payment-details.d.ts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.js +3 -3
- package/resources/index.mjs +1 -1
- package/resources/internal-accounts/balance-reports.d.ts.map +1 -1
- package/resources/internal-accounts/internal-accounts.d.ts +5 -4
- package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
- package/resources/internal-accounts/internal-accounts.js.map +1 -1
- package/resources/internal-accounts/internal-accounts.mjs.map +1 -1
- package/resources/invoices/invoices.d.ts +102 -5
- package/resources/invoices/invoices.d.ts.map +1 -1
- package/resources/invoices/invoices.js.map +1 -1
- package/resources/invoices/invoices.mjs.map +1 -1
- package/resources/invoices/line-items.d.ts +41 -0
- package/resources/invoices/line-items.d.ts.map +1 -1
- package/resources/invoices/line-items.js.map +1 -1
- package/resources/invoices/line-items.mjs.map +1 -1
- package/resources/ledger-account-categories.d.ts.map +1 -1
- package/resources/ledger-account-payouts.d.ts.map +1 -1
- package/resources/ledger-account-statements.d.ts.map +1 -1
- package/resources/ledger-accounts.d.ts +23 -16
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs.map +1 -1
- package/resources/ledger-entries.d.ts.map +1 -1
- package/resources/ledger-event-handlers.d.ts +4 -0
- package/resources/ledger-event-handlers.d.ts.map +1 -1
- package/resources/ledger-event-handlers.js.map +1 -1
- package/resources/ledger-event-handlers.mjs.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.d.ts +8 -3
- package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
- package/resources/ledger-transactions/versions.d.ts.map +1 -1
- package/resources/ledgerable-events.d.ts +0 -16
- package/resources/ledgerable-events.d.ts.map +1 -1
- package/resources/ledgerable-events.js.map +1 -1
- package/resources/ledgerable-events.mjs.map +1 -1
- package/resources/ledgers.d.ts.map +1 -1
- package/resources/line-items.d.ts.map +1 -1
- package/resources/paper-items.d.ts.map +1 -1
- package/resources/payment-flows.d.ts.map +1 -1
- package/resources/payment-orders/payment-orders.d.ts +32 -6
- package/resources/payment-orders/payment-orders.d.ts.map +1 -1
- package/resources/payment-orders/payment-orders.js.map +1 -1
- package/resources/payment-orders/payment-orders.mjs.map +1 -1
- package/resources/payment-orders/reversals.d.ts +8 -3
- package/resources/payment-orders/reversals.d.ts.map +1 -1
- package/resources/payment-orders/reversals.js.map +1 -1
- package/resources/payment-orders/reversals.mjs.map +1 -1
- package/resources/payment-references.d.ts.map +1 -1
- package/resources/returns.d.ts.map +1 -1
- package/resources/routing-details.d.ts.map +1 -1
- package/resources/top-level.d.ts.map +1 -1
- package/resources/transactions/line-items.d.ts.map +1 -1
- package/resources/transactions/transactions.d.ts.map +1 -1
- package/resources/transactions/transactions.js.map +1 -1
- package/resources/validations.d.ts.map +1 -1
- package/resources/virtual-accounts.d.ts +59 -3
- package/resources/virtual-accounts.d.ts.map +1 -1
- package/resources/virtual-accounts.js +1 -4
- package/resources/virtual-accounts.js.map +1 -1
- package/resources/virtual-accounts.mjs +1 -4
- package/resources/virtual-accounts.mjs.map +1 -1
- package/src/_shims/fetch.deno.ts +23 -0
- package/src/_shims/fetch.js +1 -1
- package/src/_shims/fileFromPath.node.ts +1 -1
- package/src/_shims/fileFromPath.ts +1 -1
- package/src/_shims/formdata.deno.ts +16 -0
- package/src/_shims/formdata.node.d.ts +1 -0
- package/src/_shims/getMultipartRequestOptions.node.ts +1 -1
- package/src/_shims/getMultipartRequestOptions.ts +1 -1
- package/src/core.ts +123 -34
- package/src/error.ts +19 -1
- package/src/index.ts +47 -28
- package/src/resources/account-collection-flows.ts +19 -19
- package/src/resources/account-details.ts +6 -6
- package/src/resources/connections.ts +5 -5
- package/src/resources/counterparties.ts +8 -8
- package/src/resources/documents.ts +9 -18
- package/src/resources/events.ts +5 -5
- package/src/resources/expected-payments.ts +6 -6
- package/src/resources/external-accounts.ts +8 -8
- package/src/resources/incoming-payment-details.ts +7 -7
- package/src/resources/index.ts +2 -2
- package/src/resources/internal-accounts/balance-reports.ts +6 -6
- package/src/resources/internal-accounts/internal-accounts.ts +15 -14
- package/src/resources/invoices/invoices.ts +121 -13
- package/src/resources/invoices/line-items.ts +51 -6
- package/src/resources/ledger-account-categories.ts +5 -5
- package/src/resources/ledger-account-payouts.ts +5 -5
- package/src/resources/ledger-account-statements.ts +3 -3
- package/src/resources/ledger-accounts.ts +29 -21
- package/src/resources/ledger-entries.ts +5 -5
- package/src/resources/ledger-event-handlers.ts +10 -5
- package/src/resources/ledger-transactions/ledger-transactions.ts +15 -9
- package/src/resources/ledger-transactions/versions.ts +5 -5
- package/src/resources/ledgerable-events.ts +3 -23
- package/src/resources/ledgers.ts +5 -5
- package/src/resources/line-items.ts +5 -5
- package/src/resources/paper-items.ts +6 -6
- package/src/resources/payment-flows.ts +5 -5
- package/src/resources/payment-orders/payment-orders.ts +45 -15
- package/src/resources/payment-orders/reversals.ts +14 -8
- package/src/resources/payment-references.ts +5 -5
- package/src/resources/returns.ts +6 -6
- package/src/resources/routing-details.ts +6 -6
- package/src/resources/top-level.ts +1 -1
- package/src/resources/transactions/line-items.ts +5 -5
- package/src/resources/transactions/transactions.ts +6 -6
- package/src/resources/validations.ts +3 -3
- package/src/resources/virtual-accounts.ts +72 -14
- package/src/resources/webhooks.ts +3 -3
- package/src/uploads.ts +16 -14
- package/src/version.ts +1 -1
- package/uploads.d.ts +6 -5
- package/uploads.d.ts.map +1 -1
- package/uploads.js +4 -3
- package/uploads.js.map +1 -1
- package/uploads.mjs +4 -3
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/src/streaming.ts +0 -204
- package/streaming.d.ts +0 -14
- package/streaming.d.ts.map +0 -1
- package/streaming.js +0 -155
- package/streaming.js.map +0 -1
- package/streaming.mjs +0 -151
- package/streaming.mjs.map +0 -1
package/src/index.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as qs from 'qs';
|
|
4
3
|
import * as Core from './core';
|
|
5
4
|
import * as Pagination from './pagination';
|
|
6
5
|
import * as API from './resources/index';
|
|
7
6
|
import * as Errors from './error';
|
|
8
|
-
import type { Agent } from '
|
|
7
|
+
import type { Agent } from './_shims/agent';
|
|
9
8
|
import * as Uploads from './uploads';
|
|
9
|
+
import * as qs from 'qs';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
export interface ClientOptions {
|
|
12
12
|
/**
|
|
13
13
|
* Defaults to process.env["MODERN_TREASURY_API_KEY"].
|
|
14
14
|
*/
|
|
@@ -36,6 +36,14 @@ type Config = {
|
|
|
36
36
|
*/
|
|
37
37
|
httpAgent?: Agent;
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Specify a custom `fetch` function implementation.
|
|
41
|
+
*
|
|
42
|
+
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
43
|
+
* defined globally.
|
|
44
|
+
*/
|
|
45
|
+
fetch?: Core.Fetch | undefined;
|
|
46
|
+
|
|
39
47
|
/**
|
|
40
48
|
* The maximum number of times that the client will retry a request in case of a
|
|
41
49
|
* temporary failure, like a network error or a 5XX error from the server.
|
|
@@ -60,10 +68,10 @@ type Config = {
|
|
|
60
68
|
*/
|
|
61
69
|
defaultQuery?: Core.DefaultQuery;
|
|
62
70
|
|
|
63
|
-
organizationId?: string
|
|
71
|
+
organizationId?: string;
|
|
64
72
|
|
|
65
73
|
webhookKey?: string | null;
|
|
66
|
-
}
|
|
74
|
+
}
|
|
67
75
|
|
|
68
76
|
/** Instantiate the API Client. */
|
|
69
77
|
export class ModernTreasury extends Core.APIClient {
|
|
@@ -71,39 +79,46 @@ export class ModernTreasury extends Core.APIClient {
|
|
|
71
79
|
organizationId: string;
|
|
72
80
|
webhookKey?: string | null;
|
|
73
81
|
|
|
74
|
-
private _options:
|
|
82
|
+
private _options: ClientOptions;
|
|
75
83
|
|
|
76
|
-
constructor(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
constructor({
|
|
85
|
+
apiKey = Core.readEnv('MODERN_TREASURY_API_KEY'),
|
|
86
|
+
organizationId = Core.readEnv('MODERN_TREASURY_ORGANIZATION_ID'),
|
|
87
|
+
webhookKey = Core.readEnv('MODERN_TREASURY_WEBHOOK_KEY') ?? null,
|
|
88
|
+
...opts
|
|
89
|
+
}: ClientOptions = {}) {
|
|
90
|
+
if (apiKey === undefined) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
'The MODERN_TREASURY_API_KEY environment variable is missing or empty; either provide it, or instantiate the ModernTreasury client with an apiKey option, like new ModernTreasury({ apiKey: undefined }).',
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
if (organizationId === undefined) {
|
|
84
96
|
throw new Error(
|
|
85
|
-
"The
|
|
97
|
+
"The MODERN_TREASURY_ORGANIZATION_ID environment variable is missing or empty; either provide it, or instantiate the ModernTreasury client with an organizationId option, like new ModernTreasury({ organizationId: 'my-organization-ID' }).",
|
|
86
98
|
);
|
|
87
99
|
}
|
|
88
100
|
|
|
101
|
+
const options: ClientOptions = {
|
|
102
|
+
apiKey,
|
|
103
|
+
organizationId,
|
|
104
|
+
webhookKey,
|
|
105
|
+
baseURL: `https://app.moderntreasury.com`,
|
|
106
|
+
...opts,
|
|
107
|
+
};
|
|
108
|
+
|
|
89
109
|
super({
|
|
90
110
|
baseURL: options.baseURL!,
|
|
91
111
|
timeout: options.timeout,
|
|
92
112
|
httpAgent: options.httpAgent,
|
|
93
113
|
maxRetries: options.maxRetries,
|
|
114
|
+
fetch: options.fetch,
|
|
94
115
|
});
|
|
95
|
-
this.apiKey = options.apiKey;
|
|
96
116
|
this._options = options;
|
|
97
117
|
this.idempotencyHeader = 'Idempotency-Key';
|
|
98
118
|
|
|
99
|
-
|
|
100
|
-
if (!organizationId) {
|
|
101
|
-
throw new Error(
|
|
102
|
-
"The MODERN_TREASURY_ORGANIZATION_ID environment variable is missing or empty; either provide it, or instantiate the ModernTreasury client with an organizationId option, like new ModernTreasury({ organizationId: 'my-organization-ID' }).",
|
|
103
|
-
);
|
|
104
|
-
}
|
|
119
|
+
this.apiKey = apiKey;
|
|
105
120
|
this.organizationId = organizationId;
|
|
106
|
-
this.webhookKey =
|
|
121
|
+
this.webhookKey = webhookKey;
|
|
107
122
|
}
|
|
108
123
|
|
|
109
124
|
connections: API.Connections = new API.Connections(this);
|
|
@@ -159,17 +174,20 @@ export class ModernTreasury extends Core.APIClient {
|
|
|
159
174
|
|
|
160
175
|
protected override authHeaders(): Core.Headers {
|
|
161
176
|
const credentials = `${this.organizationId}:${this.apiKey}`;
|
|
162
|
-
const Authorization = `Basic ${
|
|
177
|
+
const Authorization = `Basic ${Core.toBase64(credentials)}`;
|
|
163
178
|
return { Authorization };
|
|
164
179
|
}
|
|
165
180
|
|
|
166
|
-
protected override
|
|
167
|
-
return { arrayFormat: 'repeat' };
|
|
181
|
+
protected override stringifyQuery(query: Record<string, unknown>): string {
|
|
182
|
+
return qs.stringify(query, { arrayFormat: 'repeat' });
|
|
168
183
|
}
|
|
169
184
|
|
|
185
|
+
static ModernTreasury = this;
|
|
186
|
+
|
|
170
187
|
static APIError = Errors.APIError;
|
|
171
188
|
static APIConnectionError = Errors.APIConnectionError;
|
|
172
189
|
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
190
|
+
static APIUserAbortError = Errors.APIUserAbortError;
|
|
173
191
|
static NotFoundError = Errors.NotFoundError;
|
|
174
192
|
static ConflictError = Errors.ConflictError;
|
|
175
193
|
static RateLimitError = Errors.RateLimitError;
|
|
@@ -184,6 +202,7 @@ export const {
|
|
|
184
202
|
APIError,
|
|
185
203
|
APIConnectionError,
|
|
186
204
|
APIConnectionTimeoutError,
|
|
205
|
+
APIUserAbortError,
|
|
187
206
|
NotFoundError,
|
|
188
207
|
ConflictError,
|
|
189
208
|
RateLimitError,
|
|
@@ -266,8 +285,8 @@ export namespace ModernTreasury {
|
|
|
266
285
|
export import DocumentListParams = API.DocumentListParams;
|
|
267
286
|
|
|
268
287
|
export import AccountCollectionFlows = API.AccountCollectionFlows;
|
|
269
|
-
export import
|
|
270
|
-
export import
|
|
288
|
+
export import AccountCollectionFlow = API.AccountCollectionFlow;
|
|
289
|
+
export import AccountCollectionFlowsPage = API.AccountCollectionFlowsPage;
|
|
271
290
|
export import AccountCollectionFlowCreateParams = API.AccountCollectionFlowCreateParams;
|
|
272
291
|
export import AccountCollectionFlowRetrieveParams = API.AccountCollectionFlowRetrieveParams;
|
|
273
292
|
export import AccountCollectionFlowUpdateParams = API.AccountCollectionFlowUpdateParams;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as API from './';
|
|
7
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as API from './index';
|
|
7
|
+
import { Page, PageParams } from '../pagination';
|
|
8
8
|
|
|
9
9
|
export class AccountCollectionFlows extends APIResource {
|
|
10
10
|
/**
|
|
@@ -13,7 +13,7 @@ export class AccountCollectionFlows extends APIResource {
|
|
|
13
13
|
create(
|
|
14
14
|
params: AccountCollectionFlowCreateParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
|
-
): Promise<Core.APIResponse<
|
|
16
|
+
): Promise<Core.APIResponse<AccountCollectionFlow>> {
|
|
17
17
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
18
18
|
return this.post('/api/account_collection_flows', {
|
|
19
19
|
body,
|
|
@@ -29,13 +29,13 @@ export class AccountCollectionFlows extends APIResource {
|
|
|
29
29
|
id: string,
|
|
30
30
|
query?: AccountCollectionFlowRetrieveParams,
|
|
31
31
|
options?: Core.RequestOptions,
|
|
32
|
-
): Promise<Core.APIResponse<
|
|
33
|
-
retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<
|
|
32
|
+
): Promise<Core.APIResponse<AccountCollectionFlow>>;
|
|
33
|
+
retrieve(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<AccountCollectionFlow>>;
|
|
34
34
|
retrieve(
|
|
35
35
|
id: string,
|
|
36
36
|
query: AccountCollectionFlowRetrieveParams | Core.RequestOptions = {},
|
|
37
37
|
options?: Core.RequestOptions,
|
|
38
|
-
): Promise<Core.APIResponse<
|
|
38
|
+
): Promise<Core.APIResponse<AccountCollectionFlow>> {
|
|
39
39
|
if (isRequestOptions(query)) {
|
|
40
40
|
return this.retrieve(id, {}, query);
|
|
41
41
|
}
|
|
@@ -53,7 +53,7 @@ export class AccountCollectionFlows extends APIResource {
|
|
|
53
53
|
id: string,
|
|
54
54
|
params: AccountCollectionFlowUpdateParams,
|
|
55
55
|
options?: Core.RequestOptions,
|
|
56
|
-
): Promise<Core.APIResponse<
|
|
56
|
+
): Promise<Core.APIResponse<AccountCollectionFlow>> {
|
|
57
57
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
58
58
|
return this.patch(`/api/account_collection_flows/${id}`, {
|
|
59
59
|
body,
|
|
@@ -68,27 +68,27 @@ export class AccountCollectionFlows extends APIResource {
|
|
|
68
68
|
list(
|
|
69
69
|
query?: AccountCollectionFlowListParams,
|
|
70
70
|
options?: Core.RequestOptions,
|
|
71
|
-
): Core.PagePromise<
|
|
72
|
-
list(options?: Core.RequestOptions): Core.PagePromise<
|
|
71
|
+
): Core.PagePromise<AccountCollectionFlowsPage>;
|
|
72
|
+
list(options?: Core.RequestOptions): Core.PagePromise<AccountCollectionFlowsPage>;
|
|
73
73
|
list(
|
|
74
74
|
query: AccountCollectionFlowListParams | Core.RequestOptions = {},
|
|
75
75
|
options?: Core.RequestOptions,
|
|
76
|
-
): Core.PagePromise<
|
|
76
|
+
): Core.PagePromise<AccountCollectionFlowsPage> {
|
|
77
77
|
if (isRequestOptions(query)) {
|
|
78
78
|
return this.list({}, query);
|
|
79
79
|
}
|
|
80
|
-
return this.getAPIList('/api/account_collection_flows',
|
|
80
|
+
return this.getAPIList('/api/account_collection_flows', AccountCollectionFlowsPage, {
|
|
81
81
|
query,
|
|
82
82
|
...options,
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
export class
|
|
87
|
+
export class AccountCollectionFlowsPage extends Page<AccountCollectionFlow> {}
|
|
88
88
|
// alias so we can export it in the namespace
|
|
89
|
-
type
|
|
89
|
+
type _AccountCollectionFlowsPage = AccountCollectionFlowsPage;
|
|
90
90
|
|
|
91
|
-
export interface
|
|
91
|
+
export interface AccountCollectionFlow {
|
|
92
92
|
/**
|
|
93
93
|
* The ID of a counterparty. An external account created with this flow will be
|
|
94
94
|
* associated with this counterparty.
|
|
@@ -179,8 +179,8 @@ export interface AccountCollectionFlowListParams extends PageParams {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
export namespace AccountCollectionFlows {
|
|
182
|
-
export import
|
|
183
|
-
export type
|
|
182
|
+
export import AccountCollectionFlow = API.AccountCollectionFlow;
|
|
183
|
+
export type AccountCollectionFlowsPage = _AccountCollectionFlowsPage;
|
|
184
184
|
export import AccountCollectionFlowCreateParams = API.AccountCollectionFlowCreateParams;
|
|
185
185
|
export import AccountCollectionFlowRetrieveParams = API.AccountCollectionFlowRetrieveParams;
|
|
186
186
|
export import AccountCollectionFlowUpdateParams = API.AccountCollectionFlowUpdateParams;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as Shared from '
|
|
7
|
-
import * as API from './';
|
|
8
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as Shared from './shared';
|
|
7
|
+
import * as API from './index';
|
|
8
|
+
import { Page, PageParams } from '../pagination';
|
|
9
9
|
|
|
10
10
|
export class AccountDetails extends APIResource {
|
|
11
11
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as API from './';
|
|
7
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as API from './index';
|
|
7
|
+
import { Page, PageParams } from '../pagination';
|
|
8
8
|
|
|
9
9
|
export class Connections extends APIResource {
|
|
10
10
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as ExternalAccounts from '
|
|
7
|
-
import * as AccountDetails from '
|
|
8
|
-
import * as RoutingDetails from '
|
|
9
|
-
import * as API from './';
|
|
10
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as ExternalAccounts from './external-accounts';
|
|
7
|
+
import * as AccountDetails from './account-details';
|
|
8
|
+
import * as RoutingDetails from './routing-details';
|
|
9
|
+
import * as API from './index';
|
|
10
|
+
import { Page, PageParams } from '../pagination';
|
|
11
11
|
|
|
12
12
|
export class Counterparties extends APIResource {
|
|
13
13
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as API from './';
|
|
7
|
-
import { type Uploadable, multipartFormRequestOptions } from '
|
|
8
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as API from './index';
|
|
7
|
+
import { type Uploadable, multipartFormRequestOptions } from '../core';
|
|
8
|
+
import { Page, PageParams } from '../pagination';
|
|
9
9
|
|
|
10
10
|
export class Documents extends APIResource {
|
|
11
11
|
/**
|
|
@@ -15,16 +15,10 @@ export class Documents extends APIResource {
|
|
|
15
15
|
params: DocumentCreateParams,
|
|
16
16
|
options?: Core.RequestOptions,
|
|
17
17
|
): Promise<Core.APIResponse<Document>> {
|
|
18
|
-
const {
|
|
19
|
-
documentable_id: documentableId,
|
|
20
|
-
documentable_type: documentableType,
|
|
21
|
-
'Idempotency-Key': idempotencyKey,
|
|
22
|
-
...body
|
|
23
|
-
} = params;
|
|
18
|
+
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
24
19
|
return this.post(
|
|
25
20
|
'/api/documents',
|
|
26
21
|
await multipartFormRequestOptions({
|
|
27
|
-
query: { documentable_id: documentableId, documentable_type: documentableType },
|
|
28
22
|
body,
|
|
29
23
|
...options,
|
|
30
24
|
headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
|
|
@@ -157,15 +151,12 @@ export namespace Document {
|
|
|
157
151
|
|
|
158
152
|
export interface DocumentCreateParams {
|
|
159
153
|
/**
|
|
160
|
-
*
|
|
154
|
+
* Body param: The unique identifier for the associated object.
|
|
161
155
|
*/
|
|
162
156
|
documentable_id: string;
|
|
163
157
|
|
|
164
158
|
/**
|
|
165
|
-
*
|
|
166
|
-
* `payment_order`, `transaction`, `paper_item`, `expected_payment`,
|
|
167
|
-
* `counterparty`, `organization`, `case`, `internal_account`, `decision`, or
|
|
168
|
-
* `external_account`.
|
|
159
|
+
* Body param:
|
|
169
160
|
*/
|
|
170
161
|
documentable_type:
|
|
171
162
|
| 'cases'
|
package/src/resources/events.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as API from './';
|
|
7
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as API from './index';
|
|
7
|
+
import { Page, PageParams } from '../pagination';
|
|
8
8
|
|
|
9
9
|
export class Events extends APIResource {
|
|
10
10
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as Shared from '
|
|
7
|
-
import * as API from './';
|
|
8
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as Shared from './shared';
|
|
7
|
+
import * as API from './index';
|
|
8
|
+
import { Page, PageParams } from '../pagination';
|
|
9
9
|
|
|
10
10
|
export class ExpectedPayments extends APIResource {
|
|
11
11
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as AccountDetails from '
|
|
7
|
-
import * as RoutingDetails from '
|
|
8
|
-
import * as Shared from '
|
|
9
|
-
import * as API from './';
|
|
10
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as AccountDetails from './account-details';
|
|
7
|
+
import * as RoutingDetails from './routing-details';
|
|
8
|
+
import * as Shared from './shared';
|
|
9
|
+
import * as API from './index';
|
|
10
|
+
import { Page, PageParams } from '../pagination';
|
|
11
11
|
|
|
12
12
|
export class ExternalAccounts extends APIResource {
|
|
13
13
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as VirtualAccounts from '
|
|
7
|
-
import * as Shared from '
|
|
8
|
-
import * as API from './';
|
|
9
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../core';
|
|
4
|
+
import { APIResource } from '../resource';
|
|
5
|
+
import { isRequestOptions } from '../core';
|
|
6
|
+
import * as VirtualAccounts from './virtual-accounts';
|
|
7
|
+
import * as Shared from './shared';
|
|
8
|
+
import * as API from './index';
|
|
9
|
+
import { Page, PageParams } from '../pagination';
|
|
10
10
|
|
|
11
11
|
export class IncomingPaymentDetails extends APIResource {
|
|
12
12
|
/**
|
package/src/resources/index.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
export * from './shared';
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
AccountCollectionFlow,
|
|
6
6
|
AccountCollectionFlowCreateParams,
|
|
7
7
|
AccountCollectionFlowRetrieveParams,
|
|
8
8
|
AccountCollectionFlowUpdateParams,
|
|
9
9
|
AccountCollectionFlowListParams,
|
|
10
|
-
|
|
10
|
+
AccountCollectionFlowsPage,
|
|
11
11
|
AccountCollectionFlows,
|
|
12
12
|
} from './account-collection-flows';
|
|
13
13
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as Shared from '
|
|
7
|
-
import * as API from './';
|
|
8
|
-
import { Page, PageParams } from '
|
|
3
|
+
import * as Core from '../../core';
|
|
4
|
+
import { APIResource } from '../../resource';
|
|
5
|
+
import { isRequestOptions } from '../../core';
|
|
6
|
+
import * as Shared from '../shared';
|
|
7
|
+
import * as API from './index';
|
|
8
|
+
import { Page, PageParams } from '../../pagination';
|
|
9
9
|
|
|
10
10
|
export class BalanceReports extends APIResource {
|
|
11
11
|
/**
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '
|
|
4
|
-
import { APIResource } from '
|
|
5
|
-
import { isRequestOptions } from '
|
|
6
|
-
import * as AccountDetails from '
|
|
7
|
-
import * as RoutingDetails from '
|
|
8
|
-
import * as Connections from '
|
|
9
|
-
import * as Shared from '
|
|
3
|
+
import * as Core from '../../core';
|
|
4
|
+
import { APIResource } from '../../resource';
|
|
5
|
+
import { isRequestOptions } from '../../core';
|
|
6
|
+
import * as AccountDetails from '../account-details';
|
|
7
|
+
import * as RoutingDetails from '../routing-details';
|
|
8
|
+
import * as Connections from '../connections';
|
|
9
|
+
import * as Shared from '../shared';
|
|
10
10
|
import { BalanceReports } from './balance-reports';
|
|
11
|
-
import * as API from './';
|
|
12
|
-
import { Page, PageParams } from '
|
|
11
|
+
import * as API from './index';
|
|
12
|
+
import { Page, PageParams } from '../../pagination';
|
|
13
13
|
|
|
14
14
|
export class InternalAccounts extends APIResource {
|
|
15
15
|
balanceReports: BalanceReports = new BalanceReports(this.client);
|
|
@@ -234,11 +234,6 @@ export interface InternalAccountCreateParams {
|
|
|
234
234
|
*/
|
|
235
235
|
counterparty_id?: string;
|
|
236
236
|
|
|
237
|
-
/**
|
|
238
|
-
* Body param: The identifier of the entity at Increase which owns the account.
|
|
239
|
-
*/
|
|
240
|
-
entity_id?: string;
|
|
241
|
-
|
|
242
237
|
/**
|
|
243
238
|
* Body param: The parent internal account of this new account.
|
|
244
239
|
*/
|
|
@@ -249,6 +244,12 @@ export interface InternalAccountCreateParams {
|
|
|
249
244
|
*/
|
|
250
245
|
party_address?: InternalAccountCreateParams.PartyAddress;
|
|
251
246
|
|
|
247
|
+
/**
|
|
248
|
+
* Body param: A hash of vendor specific attributes that will be used when creating
|
|
249
|
+
* the account at the vendor specified by the given connection.
|
|
250
|
+
*/
|
|
251
|
+
vendor_attributes?: Record<string, string>;
|
|
252
|
+
|
|
252
253
|
/**
|
|
253
254
|
* Header param: This key should be something unique, preferably something like an
|
|
254
255
|
* UUID.
|