modern-treasury 2.3.0 → 2.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/CHANGELOG.md +31 -0
- package/README.md +2 -0
- package/_shims/{ReadableStream.node.d.ts → ReadableStream-node.d.ts} +1 -1
- package/_shims/ReadableStream-node.d.ts.map +1 -0
- package/_shims/{ReadableStream.node.js → ReadableStream-node.js} +1 -1
- package/_shims/ReadableStream-node.js.map +1 -0
- package/_shims/{ReadableStream.node.mjs → ReadableStream-node.mjs} +1 -1
- package/_shims/ReadableStream-node.mjs.map +1 -0
- package/_shims/{agent.node.d.ts → agent-node.d.ts} +1 -1
- package/_shims/agent-node.d.ts.map +1 -0
- package/_shims/{agent.node.js → agent-node.js} +1 -1
- package/_shims/{agent.node.js.map → agent-node.js.map} +1 -1
- package/_shims/{agent.node.mjs → agent-node.mjs} +1 -1
- package/_shims/{agent.node.mjs.map → agent-node.mjs.map} +1 -1
- package/_shims/agent.d.ts +1 -1
- package/_shims/agent.js +1 -1
- package/_shims/agent.mjs +1 -1
- package/{src/_shims/fetch.node.d.ts → _shims/fetch-node.d.ts} +1 -0
- package/_shims/fetch.d.ts +1 -0
- package/_shims/{fileFromPath.node.d.ts → fileFromPath-node.d.ts} +2 -2
- package/_shims/{fileFromPath.node.d.ts.map → fileFromPath-node.d.ts.map} +1 -1
- package/_shims/{fileFromPath.node.js → fileFromPath-node.js} +1 -1
- package/_shims/{fileFromPath.node.js.map → fileFromPath-node.js.map} +1 -1
- package/_shims/{fileFromPath.node.mjs → fileFromPath-node.mjs} +1 -1
- package/_shims/{fileFromPath.node.mjs.map → fileFromPath-node.mjs.map} +1 -1
- package/_shims/fileFromPath.d.ts +2 -2
- package/_shims/fileFromPath.d.ts.map +1 -1
- package/_shims/fileFromPath.js +1 -1
- package/_shims/fileFromPath.mjs +1 -1
- package/_shims/form-data.js +17 -0
- package/_shims/form-data.mjs +20 -0
- package/_shims/{getMultipartRequestOptions.node.d.ts → getMultipartRequestOptions-node.d.ts} +2 -2
- package/_shims/getMultipartRequestOptions-node.d.ts.map +1 -0
- package/_shims/{getMultipartRequestOptions.node.js → getMultipartRequestOptions-node.js} +1 -1
- package/_shims/{getMultipartRequestOptions.node.js.map → getMultipartRequestOptions-node.js.map} +1 -1
- package/_shims/{getMultipartRequestOptions.node.mjs → getMultipartRequestOptions-node.mjs} +1 -1
- package/_shims/{getMultipartRequestOptions.node.mjs.map → getMultipartRequestOptions-node.mjs.map} +1 -1
- package/_shims/getMultipartRequestOptions.d.ts +1 -1
- package/_shims/getMultipartRequestOptions.d.ts.map +1 -1
- package/_shims/{node-readable.node.d.ts → node-readable-node.d.ts} +1 -1
- package/_shims/{node-readable.node.d.ts.map → node-readable-node.d.ts.map} +1 -1
- package/_shims/{node-readable.node.js → node-readable-node.js} +1 -1
- package/_shims/node-readable-node.js.map +1 -0
- package/_shims/{node-readable.node.mjs → node-readable-node.mjs} +1 -1
- package/_shims/node-readable-node.mjs.map +1 -0
- package/core.d.ts +13 -5
- package/core.d.ts.map +1 -1
- package/core.js +17 -10
- package/core.js.map +1 -1
- package/core.mjs +17 -10
- package/core.mjs.map +1 -1
- package/index.d.mts +18 -5
- package/index.d.ts +18 -5
- package/index.d.ts.map +1 -1
- package/index.js +21 -7
- package/index.js.map +1 -1
- package/index.mjs +21 -7
- package/index.mjs.map +1 -1
- package/package.json +32 -9
- package/resources/account-collection-flows.d.ts +3 -28
- package/resources/account-collection-flows.d.ts.map +1 -1
- package/resources/account-collection-flows.js +22 -17
- package/resources/account-collection-flows.js.map +1 -1
- package/resources/account-collection-flows.mjs +22 -17
- package/resources/account-collection-flows.mjs.map +1 -1
- package/resources/account-details.d.ts +3 -8
- package/resources/account-details.d.ts.map +1 -1
- package/resources/account-details.js +10 -4
- package/resources/account-details.js.map +1 -1
- package/resources/account-details.mjs +10 -4
- package/resources/account-details.mjs.map +1 -1
- package/resources/connections.js +3 -3
- package/resources/connections.mjs +3 -3
- package/resources/counterparties.d.ts +26 -40
- package/resources/counterparties.d.ts.map +1 -1
- package/resources/counterparties.js +17 -5
- package/resources/counterparties.js.map +1 -1
- package/resources/counterparties.mjs +17 -5
- package/resources/counterparties.mjs.map +1 -1
- package/resources/documents.d.ts +2 -13
- package/resources/documents.d.ts.map +1 -1
- package/resources/documents.js +11 -5
- package/resources/documents.js.map +1 -1
- package/resources/documents.mjs +11 -5
- package/resources/documents.mjs.map +1 -1
- package/resources/events.js +3 -3
- package/resources/events.mjs +3 -3
- package/resources/expected-payments.d.ts +23 -32
- package/resources/expected-payments.d.ts.map +1 -1
- package/resources/expected-payments.js +10 -4
- package/resources/expected-payments.js.map +1 -1
- package/resources/expected-payments.mjs +10 -4
- package/resources/expected-payments.mjs.map +1 -1
- package/resources/external-accounts.d.ts +17 -51
- package/resources/external-accounts.d.ts.map +1 -1
- package/resources/external-accounts.js +24 -6
- package/resources/external-accounts.js.map +1 -1
- package/resources/external-accounts.mjs +24 -6
- package/resources/external-accounts.mjs.map +1 -1
- package/resources/incoming-payment-details.d.ts +10 -15
- package/resources/incoming-payment-details.d.ts.map +1 -1
- package/resources/incoming-payment-details.js +10 -4
- package/resources/incoming-payment-details.js.map +1 -1
- package/resources/incoming-payment-details.mjs +10 -4
- package/resources/incoming-payment-details.mjs.map +1 -1
- package/resources/index.d.ts +0 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/internal-accounts/balance-reports.js +3 -3
- package/resources/internal-accounts/balance-reports.mjs +3 -3
- package/resources/internal-accounts/internal-accounts.d.ts +10 -15
- package/resources/internal-accounts/internal-accounts.d.ts.map +1 -1
- package/resources/internal-accounts/internal-accounts.js +10 -4
- package/resources/internal-accounts/internal-accounts.js.map +1 -1
- package/resources/internal-accounts/internal-accounts.mjs +10 -4
- package/resources/internal-accounts/internal-accounts.mjs.map +1 -1
- package/resources/invoices/invoices.d.ts +24 -32
- package/resources/invoices/invoices.d.ts.map +1 -1
- package/resources/invoices/invoices.js +10 -4
- package/resources/invoices/invoices.js.map +1 -1
- package/resources/invoices/invoices.mjs +10 -4
- package/resources/invoices/invoices.mjs.map +1 -1
- package/resources/invoices/line-items.d.ts +9 -14
- package/resources/invoices/line-items.d.ts.map +1 -1
- package/resources/invoices/line-items.js +10 -4
- package/resources/invoices/line-items.js.map +1 -1
- package/resources/invoices/line-items.mjs +10 -4
- package/resources/invoices/line-items.mjs.map +1 -1
- package/resources/ledger-account-categories.d.ts +8 -13
- package/resources/ledger-account-categories.d.ts.map +1 -1
- package/resources/ledger-account-categories.js +10 -4
- package/resources/ledger-account-categories.js.map +1 -1
- package/resources/ledger-account-categories.mjs +10 -4
- package/resources/ledger-account-categories.mjs.map +1 -1
- package/resources/ledger-account-payouts.d.ts +14 -19
- package/resources/ledger-account-payouts.d.ts.map +1 -1
- package/resources/ledger-account-payouts.js +10 -4
- package/resources/ledger-account-payouts.js.map +1 -1
- package/resources/ledger-account-payouts.mjs +10 -4
- package/resources/ledger-account-payouts.mjs.map +1 -1
- package/resources/ledger-account-statements.d.ts +9 -14
- package/resources/ledger-account-statements.d.ts.map +1 -1
- package/resources/ledger-account-statements.js +8 -2
- package/resources/ledger-account-statements.js.map +1 -1
- package/resources/ledger-account-statements.mjs +8 -2
- package/resources/ledger-account-statements.mjs.map +1 -1
- package/resources/ledger-accounts.d.ts +13 -18
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/ledger-accounts.js +10 -4
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs +10 -4
- package/resources/ledger-accounts.mjs.map +1 -1
- package/resources/ledger-entries.js +3 -3
- package/resources/ledger-entries.mjs +3 -3
- package/resources/ledger-event-handlers.d.ts +5 -16
- package/resources/ledger-event-handlers.d.ts.map +1 -1
- package/resources/ledger-event-handlers.js +10 -4
- package/resources/ledger-event-handlers.js.map +1 -1
- package/resources/ledger-event-handlers.mjs +10 -4
- package/resources/ledger-event-handlers.mjs.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.d.ts +16 -22
- package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.js +10 -4
- package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.mjs +10 -4
- package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
- package/resources/ledger-transactions/versions.js +3 -3
- package/resources/ledger-transactions/versions.mjs +3 -3
- package/resources/ledgerable-events.d.ts +11 -16
- package/resources/ledgerable-events.d.ts.map +1 -1
- package/resources/ledgerable-events.js +8 -2
- package/resources/ledgerable-events.js.map +1 -1
- package/resources/ledgerable-events.mjs +8 -2
- package/resources/ledgerable-events.mjs.map +1 -1
- package/resources/ledgers.d.ts +4 -9
- package/resources/ledgers.d.ts.map +1 -1
- package/resources/ledgers.js +10 -4
- package/resources/ledgers.js.map +1 -1
- package/resources/ledgers.mjs +10 -4
- package/resources/ledgers.mjs.map +1 -1
- package/resources/line-items.js +3 -3
- package/resources/line-items.mjs +3 -3
- package/resources/paper-items.js +3 -3
- package/resources/paper-items.mjs +3 -3
- package/resources/payment-flows.d.ts +10 -34
- package/resources/payment-flows.d.ts.map +1 -1
- package/resources/payment-flows.js +22 -17
- package/resources/payment-flows.js.map +1 -1
- package/resources/payment-flows.mjs +22 -17
- package/resources/payment-flows.mjs.map +1 -1
- package/resources/payment-orders/payment-orders.d.ts +142 -167
- package/resources/payment-orders/payment-orders.d.ts.map +1 -1
- package/resources/payment-orders/payment-orders.js +18 -6
- package/resources/payment-orders/payment-orders.js.map +1 -1
- package/resources/payment-orders/payment-orders.mjs +18 -6
- package/resources/payment-orders/payment-orders.mjs.map +1 -1
- package/resources/payment-orders/reversals.d.ts +7 -13
- package/resources/payment-orders/reversals.d.ts.map +1 -1
- package/resources/payment-orders/reversals.js +10 -4
- package/resources/payment-orders/reversals.js.map +1 -1
- package/resources/payment-orders/reversals.mjs +10 -4
- package/resources/payment-orders/reversals.mjs.map +1 -1
- package/resources/payment-references.js +3 -3
- package/resources/payment-references.mjs +3 -3
- package/resources/returns.d.ts +9 -15
- package/resources/returns.d.ts.map +1 -1
- package/resources/returns.js +10 -4
- package/resources/returns.js.map +1 -1
- package/resources/returns.mjs +10 -4
- package/resources/returns.mjs.map +1 -1
- package/resources/routing-details.d.ts +4 -10
- package/resources/routing-details.d.ts.map +1 -1
- package/resources/routing-details.js +10 -4
- package/resources/routing-details.js.map +1 -1
- package/resources/routing-details.mjs +10 -4
- package/resources/routing-details.mjs.map +1 -1
- package/resources/transactions/line-items.js +3 -3
- package/resources/transactions/line-items.mjs +3 -3
- package/resources/transactions/transactions.js +3 -3
- package/resources/transactions/transactions.mjs +3 -3
- package/resources/validations.js +1 -1
- package/resources/validations.mjs +1 -1
- package/resources/virtual-accounts.d.ts +12 -18
- package/resources/virtual-accounts.d.ts.map +1 -1
- package/resources/virtual-accounts.js +10 -4
- package/resources/virtual-accounts.js.map +1 -1
- package/resources/virtual-accounts.mjs +10 -4
- package/resources/virtual-accounts.mjs.map +1 -1
- package/resources/webhooks.js +2 -2
- package/resources/webhooks.mjs +2 -2
- package/src/_shims/ReadableStream.d.ts +5 -5
- package/src/_shims/agent.ts +1 -1
- package/{_shims/fetch.node.d.ts → src/_shims/fetch-node.d.ts} +9 -8
- package/src/_shims/fetch.d.ts +11 -10
- package/src/_shims/{fileFromPath.node.ts → fileFromPath-node.ts} +1 -1
- package/src/_shims/fileFromPath.ts +2 -2
- package/src/_shims/{formdata.node.d.ts → form-data-node.d.ts} +4 -4
- package/src/_shims/{formdata.d.ts → form-data.d.ts} +4 -4
- package/src/_shims/form-data.js +17 -0
- package/src/_shims/form-data.mjs +20 -0
- package/src/_shims/{getMultipartRequestOptions.node.ts → getMultipartRequestOptions-node.ts} +3 -3
- package/src/_shims/getMultipartRequestOptions.ts +3 -3
- package/src/core.ts +35 -22
- package/src/error.ts +1 -1
- package/src/index.ts +27 -13
- package/src/pagination.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/resources/account-collection-flows.ts +24 -52
- package/src/resources/account-details.ts +16 -16
- package/src/resources/connections.ts +5 -5
- package/src/resources/counterparties.ts +48 -52
- package/src/resources/documents.ts +15 -21
- package/src/resources/events.ts +5 -5
- package/src/resources/expected-payments.ts +36 -40
- package/src/resources/external-accounts.ts +46 -65
- package/src/resources/incoming-payment-details.ts +24 -24
- package/src/resources/index.ts +39 -35
- package/src/resources/internal-accounts/balance-reports.ts +6 -6
- package/src/resources/internal-accounts/index.ts +2 -2
- package/src/resources/internal-accounts/internal-accounts.ts +27 -27
- package/src/resources/invoices/index.ts +2 -2
- package/src/resources/invoices/invoices.ts +39 -42
- package/src/resources/invoices/line-items.ts +21 -21
- package/src/resources/ledger-account-categories.ts +20 -20
- package/src/resources/ledger-account-payouts.ts +26 -26
- package/src/resources/ledger-account-statements.ts +19 -19
- package/src/resources/ledger-accounts.ts +25 -25
- package/src/resources/ledger-entries.ts +5 -5
- package/src/resources/ledger-event-handlers.ts +17 -23
- package/src/resources/ledger-transactions/index.ts +2 -2
- package/src/resources/ledger-transactions/ledger-transactions.ts +30 -31
- package/src/resources/ledger-transactions/versions.ts +5 -5
- package/src/resources/ledgerable-events.ts +21 -21
- package/src/resources/ledgers.ts +16 -16
- package/src/resources/line-items.ts +5 -5
- package/src/resources/paper-items.ts +6 -6
- package/src/resources/payment-flows.ts +31 -58
- package/src/resources/payment-orders/index.ts +2 -2
- package/src/resources/payment-orders/payment-orders.ts +166 -181
- package/src/resources/payment-orders/reversals.ts +19 -20
- package/src/resources/payment-references.ts +5 -5
- package/src/resources/returns.ts +22 -23
- package/src/resources/routing-details.ts +17 -18
- package/src/resources/top-level.ts +1 -1
- package/src/resources/transactions/index.ts +7 -2
- package/src/resources/transactions/line-items.ts +5 -5
- package/src/resources/transactions/transactions.ts +7 -7
- package/src/resources/validations.ts +3 -3
- package/src/resources/virtual-accounts.ts +26 -27
- package/src/resources/webhooks.ts +3 -3
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +6 -6
- package/src/version.ts +1 -1
- package/uploads.d.ts +1 -1
- package/uploads.d.ts.map +1 -1
- package/uploads.js +7 -7
- package/uploads.js.map +1 -1
- package/uploads.mjs +4 -4
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/_shims/ReadableStream.node.d.ts.map +0 -1
- package/_shims/ReadableStream.node.js.map +0 -1
- package/_shims/ReadableStream.node.mjs.map +0 -1
- package/_shims/agent.node.d.ts.map +0 -1
- package/_shims/formdata.js +0 -9
- package/_shims/formdata.mjs +0 -11
- package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
- package/_shims/node-readable.node.js.map +0 -1
- package/_shims/node-readable.node.mjs.map +0 -1
- package/src/_shims/fetch.deno.ts +0 -23
- package/src/_shims/formdata.deno.ts +0 -16
- package/src/_shims/formdata.js +0 -9
- package/src/_shims/formdata.mjs +0 -11
- /package/_shims/{fetch.node.js → fetch-node.js} +0 -0
- /package/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
- /package/_shims/{formdata.node.d.ts → form-data-node.d.ts} +0 -0
- /package/_shims/{formdata.node.js → form-data-node.js} +0 -0
- /package/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
- /package/_shims/{formdata.d.ts → form-data.d.ts} +0 -0
- /package/src/_shims/{ReadableStream.node.ts → ReadableStream-node.ts} +0 -0
- /package/src/_shims/{agent.node.ts → agent-node.ts} +0 -0
- /package/src/_shims/{fetch.node.js → fetch-node.js} +0 -0
- /package/src/_shims/{fetch.node.mjs → fetch-node.mjs} +0 -0
- /package/src/_shims/{formdata.node.js → form-data-node.js} +0 -0
- /package/src/_shims/{formdata.node.mjs → form-data-node.mjs} +0 -0
- /package/src/_shims/{node-readable.node.ts → node-readable-node.ts} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '../../core';
|
|
4
|
-
import { APIResource } from '../../resource';
|
|
5
|
-
import { isRequestOptions } from '../../core';
|
|
6
|
-
import * as LedgerEntries from '../ledger-entries';
|
|
7
|
-
import { Versions } from './versions';
|
|
8
|
-
import * as API from './index';
|
|
9
|
-
import { Page, PageParams } from '../../pagination';
|
|
3
|
+
import * as Core from '../../core.js';
|
|
4
|
+
import { APIResource } from '../../resource.js';
|
|
5
|
+
import { isRequestOptions } from '../../core.js';
|
|
6
|
+
import * as LedgerEntries from '../ledger-entries.js';
|
|
7
|
+
import { Versions } from './versions.js';
|
|
8
|
+
import * as API from './index.js';
|
|
9
|
+
import { Page, PageParams } from '../../pagination.js';
|
|
10
10
|
|
|
11
11
|
export class LedgerTransactions extends APIResource {
|
|
12
12
|
versions: Versions = new Versions(this.client);
|
|
@@ -18,11 +18,17 @@ export class LedgerTransactions extends APIResource {
|
|
|
18
18
|
params: LedgerTransactionCreateParams,
|
|
19
19
|
options?: Core.RequestOptions,
|
|
20
20
|
): Core.APIPromise<LedgerTransaction> {
|
|
21
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
21
22
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
23
|
+
if (idempotencyKey) {
|
|
24
|
+
console.warn(
|
|
25
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
26
|
+
);
|
|
27
|
+
}
|
|
22
28
|
return this.post('/api/ledger_transactions', {
|
|
23
29
|
body,
|
|
24
30
|
...options,
|
|
25
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
31
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
26
32
|
});
|
|
27
33
|
}
|
|
28
34
|
|
|
@@ -193,44 +199,43 @@ export interface LedgerTransaction {
|
|
|
193
199
|
|
|
194
200
|
export interface LedgerTransactionCreateParams {
|
|
195
201
|
/**
|
|
196
|
-
*
|
|
202
|
+
* An array of ledger entry objects.
|
|
197
203
|
*/
|
|
198
204
|
ledger_entries: Array<LedgerTransactionCreateParams.LedgerEntry>;
|
|
199
205
|
|
|
200
206
|
/**
|
|
201
|
-
*
|
|
207
|
+
* An optional description for internal use.
|
|
202
208
|
*/
|
|
203
209
|
description?: string | null;
|
|
204
210
|
|
|
205
211
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
212
|
+
* The timestamp (ISO8601 format) at which the ledger transaction happened for
|
|
213
|
+
* reporting purposes.
|
|
208
214
|
*/
|
|
209
215
|
effective_at?: string;
|
|
210
216
|
|
|
211
217
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
218
|
+
* The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
|
|
219
|
+
* purposes.
|
|
214
220
|
*/
|
|
215
221
|
effective_date?: string;
|
|
216
222
|
|
|
217
223
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
224
|
+
* A unique string to represent the ledger transaction. Only one pending or posted
|
|
225
|
+
* ledger transaction may have this ID in the ledger.
|
|
220
226
|
*/
|
|
221
227
|
external_id?: string;
|
|
222
228
|
|
|
223
229
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
230
|
+
* If the ledger transaction can be reconciled to another object in Modern
|
|
231
|
+
* Treasury, the id will be populated here, otherwise null.
|
|
226
232
|
*/
|
|
227
233
|
ledgerable_id?: string;
|
|
228
234
|
|
|
229
235
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* reversal.
|
|
236
|
+
* If the ledger transaction can be reconciled to another object in Modern
|
|
237
|
+
* Treasury, the type will be populated here, otherwise null. This can be one of
|
|
238
|
+
* payment_order, incoming_payment_detail, expected_payment, return, or reversal.
|
|
234
239
|
*/
|
|
235
240
|
ledgerable_type?:
|
|
236
241
|
| 'counterparty'
|
|
@@ -245,21 +250,15 @@ export interface LedgerTransactionCreateParams {
|
|
|
245
250
|
| 'reversal';
|
|
246
251
|
|
|
247
252
|
/**
|
|
248
|
-
*
|
|
249
|
-
*
|
|
253
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
254
|
+
* strings.
|
|
250
255
|
*/
|
|
251
256
|
metadata?: Record<string, string>;
|
|
252
257
|
|
|
253
258
|
/**
|
|
254
|
-
*
|
|
259
|
+
* To post a ledger transaction at creation, use `posted`.
|
|
255
260
|
*/
|
|
256
261
|
status?: 'archived' | 'pending' | 'posted';
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Header param: This key should be something unique, preferably something like an
|
|
260
|
-
* UUID.
|
|
261
|
-
*/
|
|
262
|
-
'Idempotency-Key'?: string;
|
|
263
262
|
}
|
|
264
263
|
|
|
265
264
|
export namespace LedgerTransactionCreateParams {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
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';
|
|
3
|
+
import * as Core from '../../core.js';
|
|
4
|
+
import { APIResource } from '../../resource.js';
|
|
5
|
+
import { isRequestOptions } from '../../core.js';
|
|
6
|
+
import * as API from './index.js';
|
|
7
|
+
import { Page, PageParams } from '../../pagination.js';
|
|
8
8
|
|
|
9
9
|
export class Versions extends APIResource {
|
|
10
10
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
3
|
-
import * as Core from '../core';
|
|
4
|
-
import { APIResource } from '../resource';
|
|
5
|
-
import * as API from './index';
|
|
3
|
+
import * as Core from '../core.js';
|
|
4
|
+
import { APIResource } from '../resource.js';
|
|
5
|
+
import * as API from './index.js';
|
|
6
6
|
|
|
7
7
|
export class LedgerableEvents extends APIResource {
|
|
8
8
|
/**
|
|
@@ -13,11 +13,17 @@ export class LedgerableEvents extends APIResource {
|
|
|
13
13
|
params: LedgerableEventCreateParams,
|
|
14
14
|
options?: Core.RequestOptions,
|
|
15
15
|
): Core.APIPromise<LedgerableEvent> {
|
|
16
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
16
17
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
18
|
+
if (idempotencyKey) {
|
|
19
|
+
console.warn(
|
|
20
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
21
|
+
);
|
|
22
|
+
}
|
|
17
23
|
return this.post('/api/ledgerable_events', {
|
|
18
24
|
body,
|
|
19
25
|
...options,
|
|
20
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
26
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
21
27
|
});
|
|
22
28
|
}
|
|
23
29
|
|
|
@@ -95,53 +101,47 @@ export interface LedgerableEvent {
|
|
|
95
101
|
|
|
96
102
|
export interface LedgerableEventCreateParams {
|
|
97
103
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
104
|
+
* Value in specified currency's smallest unit. e.g. $10 would be represented
|
|
105
|
+
* as 1000.
|
|
100
106
|
*/
|
|
101
107
|
amount: number;
|
|
102
108
|
|
|
103
109
|
/**
|
|
104
|
-
*
|
|
110
|
+
* Name of the ledgerable event.
|
|
105
111
|
*/
|
|
106
112
|
name: string;
|
|
107
113
|
|
|
108
114
|
/**
|
|
109
|
-
*
|
|
115
|
+
* An ISO 4217 conformed currency or a custom currency.
|
|
110
116
|
*/
|
|
111
117
|
currency?: string | null;
|
|
112
118
|
|
|
113
119
|
/**
|
|
114
|
-
*
|
|
115
|
-
*
|
|
120
|
+
* Must be included if currency is a custom currency. The currency_exponent cannot
|
|
121
|
+
* exceed 30.
|
|
116
122
|
*/
|
|
117
123
|
currency_exponent?: number | null;
|
|
118
124
|
|
|
119
125
|
/**
|
|
120
|
-
*
|
|
126
|
+
* Additionally data to be used by the Ledger Event Handler.
|
|
121
127
|
*/
|
|
122
128
|
custom_data?: unknown | null;
|
|
123
129
|
|
|
124
130
|
/**
|
|
125
|
-
*
|
|
131
|
+
* Description of the ledgerable event.
|
|
126
132
|
*/
|
|
127
133
|
description?: string | null;
|
|
128
134
|
|
|
129
135
|
/**
|
|
130
|
-
*
|
|
136
|
+
* One of `credit`, `debit`.
|
|
131
137
|
*/
|
|
132
138
|
direction?: string | null;
|
|
133
139
|
|
|
134
140
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
141
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
142
|
+
* strings.
|
|
137
143
|
*/
|
|
138
144
|
metadata?: Record<string, string>;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Header param: This key should be something unique, preferably something like an
|
|
142
|
-
* UUID.
|
|
143
|
-
*/
|
|
144
|
-
'Idempotency-Key'?: string;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
export namespace LedgerableEvents {
|
package/src/resources/ledgers.ts
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
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';
|
|
3
|
+
import * as Core from '../core.js';
|
|
4
|
+
import { APIResource } from '../resource.js';
|
|
5
|
+
import { isRequestOptions } from '../core.js';
|
|
6
|
+
import * as API from './index.js';
|
|
7
|
+
import { Page, PageParams } from '../pagination.js';
|
|
8
8
|
|
|
9
9
|
export class Ledgers extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Create a ledger.
|
|
12
12
|
*/
|
|
13
13
|
create(params: LedgerCreateParams, options?: Core.RequestOptions): Core.APIPromise<Ledger> {
|
|
14
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
14
15
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
16
|
+
if (idempotencyKey) {
|
|
17
|
+
console.warn(
|
|
18
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
19
|
+
);
|
|
20
|
+
}
|
|
15
21
|
return this.post('/api/ledgers', {
|
|
16
22
|
body,
|
|
17
23
|
...options,
|
|
18
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
24
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
19
25
|
});
|
|
20
26
|
}
|
|
21
27
|
|
|
@@ -106,26 +112,20 @@ export interface Ledger {
|
|
|
106
112
|
|
|
107
113
|
export interface LedgerCreateParams {
|
|
108
114
|
/**
|
|
109
|
-
*
|
|
115
|
+
* The name of the ledger.
|
|
110
116
|
*/
|
|
111
117
|
name: string;
|
|
112
118
|
|
|
113
119
|
/**
|
|
114
|
-
*
|
|
120
|
+
* An optional free-form description for internal use.
|
|
115
121
|
*/
|
|
116
122
|
description?: string | null;
|
|
117
123
|
|
|
118
124
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
125
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
126
|
+
* strings.
|
|
121
127
|
*/
|
|
122
128
|
metadata?: Record<string, string>;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Header param: This key should be something unique, preferably something like an
|
|
126
|
-
* UUID.
|
|
127
|
-
*/
|
|
128
|
-
'Idempotency-Key'?: string;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
export interface LedgerUpdateParams {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
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';
|
|
3
|
+
import * as Core from '../core.js';
|
|
4
|
+
import { APIResource } from '../resource.js';
|
|
5
|
+
import { isRequestOptions } from '../core.js';
|
|
6
|
+
import * as API from './index.js';
|
|
7
|
+
import { Page, PageParams } from '../pagination.js';
|
|
8
8
|
|
|
9
9
|
export class LineItems 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 '../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';
|
|
3
|
+
import * as Core from '../core.js';
|
|
4
|
+
import { APIResource } from '../resource.js';
|
|
5
|
+
import { isRequestOptions } from '../core.js';
|
|
6
|
+
import * as Shared from './shared.js';
|
|
7
|
+
import * as API from './index.js';
|
|
8
|
+
import { Page, PageParams } from '../pagination.js';
|
|
9
9
|
|
|
10
10
|
export class PaperItems extends APIResource {
|
|
11
11
|
/**
|
|
@@ -1,46 +1,35 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
|
|
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';
|
|
3
|
+
import * as Core from '../core.js';
|
|
4
|
+
import { APIResource } from '../resource.js';
|
|
5
|
+
import { isRequestOptions } from '../core.js';
|
|
6
|
+
import * as API from './index.js';
|
|
7
|
+
import { Page, PageParams } from '../pagination.js';
|
|
8
8
|
|
|
9
9
|
export class PaymentFlows extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* create payment_flow
|
|
12
12
|
*/
|
|
13
13
|
create(params: PaymentFlowCreateParams, options?: Core.RequestOptions): Core.APIPromise<PaymentFlow> {
|
|
14
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
14
15
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
16
|
+
if (idempotencyKey) {
|
|
17
|
+
console.warn(
|
|
18
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
19
|
+
);
|
|
20
|
+
}
|
|
15
21
|
return this.post('/api/payment_flows', {
|
|
16
22
|
body,
|
|
17
23
|
...options,
|
|
18
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
24
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
19
25
|
});
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
/**
|
|
23
29
|
* get payment_flow
|
|
24
30
|
*/
|
|
25
|
-
retrieve(
|
|
26
|
-
id
|
|
27
|
-
query?: PaymentFlowRetrieveParams,
|
|
28
|
-
options?: Core.RequestOptions,
|
|
29
|
-
): Core.APIPromise<PaymentFlow>;
|
|
30
|
-
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<PaymentFlow>;
|
|
31
|
-
retrieve(
|
|
32
|
-
id: string,
|
|
33
|
-
query: PaymentFlowRetrieveParams | Core.RequestOptions = {},
|
|
34
|
-
options?: Core.RequestOptions,
|
|
35
|
-
): Core.APIPromise<PaymentFlow> {
|
|
36
|
-
if (isRequestOptions(query)) {
|
|
37
|
-
return this.retrieve(id, {}, query);
|
|
38
|
-
}
|
|
39
|
-
const { 'Idempotency-Key': idempotencyKey } = query;
|
|
40
|
-
return this.get(`/api/payment_flows/${id}`, {
|
|
41
|
-
...options,
|
|
42
|
-
headers: { 'Idempotency-Key': idempotencyKey || '', ...options?.headers },
|
|
43
|
-
});
|
|
31
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<PaymentFlow> {
|
|
32
|
+
return this.get(`/api/payment_flows/${id}`, options);
|
|
44
33
|
}
|
|
45
34
|
|
|
46
35
|
/**
|
|
@@ -51,11 +40,17 @@ export class PaymentFlows extends APIResource {
|
|
|
51
40
|
params: PaymentFlowUpdateParams,
|
|
52
41
|
options?: Core.RequestOptions,
|
|
53
42
|
): Core.APIPromise<PaymentFlow> {
|
|
43
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
54
44
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
45
|
+
if (idempotencyKey) {
|
|
46
|
+
console.warn(
|
|
47
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
48
|
+
);
|
|
49
|
+
}
|
|
55
50
|
return this.patch(`/api/payment_flows/${id}`, {
|
|
56
51
|
body,
|
|
57
52
|
...options,
|
|
58
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
53
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
59
54
|
});
|
|
60
55
|
}
|
|
61
56
|
|
|
@@ -150,61 +145,40 @@ export interface PaymentFlow {
|
|
|
150
145
|
|
|
151
146
|
export interface PaymentFlowCreateParams {
|
|
152
147
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
148
|
+
* Required. Value in specified currency's smallest unit. e.g. $10 would be
|
|
149
|
+
* represented as 1000. Can be any integer up to 36 digits.
|
|
155
150
|
*/
|
|
156
151
|
amount: number;
|
|
157
152
|
|
|
158
153
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* model.
|
|
154
|
+
* Required. The ID of a counterparty associated with the payment. As part of the
|
|
155
|
+
* payment workflow an external account will be associated with this model.
|
|
162
156
|
*/
|
|
163
157
|
counterparty_id: string;
|
|
164
158
|
|
|
165
159
|
/**
|
|
166
|
-
*
|
|
160
|
+
* Required. The currency of the payment.
|
|
167
161
|
*/
|
|
168
162
|
currency: string;
|
|
169
163
|
|
|
170
164
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* account to your own.
|
|
165
|
+
* Required. Describes the direction money is flowing in the transaction. Can only
|
|
166
|
+
* be `debit`. A `debit` pulls money from someone else's account to your own.
|
|
174
167
|
*/
|
|
175
168
|
direction: 'credit' | 'debit';
|
|
176
169
|
|
|
177
170
|
/**
|
|
178
|
-
*
|
|
171
|
+
* Required. The ID of one of your organization's internal accounts.
|
|
179
172
|
*/
|
|
180
173
|
originating_account_id: string;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Header param: This key should be something unique, preferably something like an
|
|
184
|
-
* UUID.
|
|
185
|
-
*/
|
|
186
|
-
'Idempotency-Key'?: string;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export interface PaymentFlowRetrieveParams {
|
|
190
|
-
/**
|
|
191
|
-
* This key should be something unique, preferably something like an UUID.
|
|
192
|
-
*/
|
|
193
|
-
'Idempotency-Key'?: string;
|
|
194
174
|
}
|
|
195
175
|
|
|
196
176
|
export interface PaymentFlowUpdateParams {
|
|
197
177
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
178
|
+
* Required. The updated status of the payment flow. Can only be used to mark a
|
|
179
|
+
* flow as `cancelled`.
|
|
200
180
|
*/
|
|
201
181
|
status: 'cancelled';
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Header param: This key should be something unique, preferably something like an
|
|
205
|
-
* UUID.
|
|
206
|
-
*/
|
|
207
|
-
'Idempotency-Key'?: string;
|
|
208
182
|
}
|
|
209
183
|
|
|
210
184
|
export interface PaymentFlowListParams extends PageParams {
|
|
@@ -225,7 +199,6 @@ export namespace PaymentFlows {
|
|
|
225
199
|
export import PaymentFlow = API.PaymentFlow;
|
|
226
200
|
export type PaymentFlowsPage = _PaymentFlowsPage;
|
|
227
201
|
export import PaymentFlowCreateParams = API.PaymentFlowCreateParams;
|
|
228
|
-
export import PaymentFlowRetrieveParams = API.PaymentFlowRetrieveParams;
|
|
229
202
|
export import PaymentFlowUpdateParams = API.PaymentFlowUpdateParams;
|
|
230
203
|
export import PaymentFlowListParams = API.PaymentFlowListParams;
|
|
231
204
|
}
|
|
@@ -10,5 +10,5 @@ export {
|
|
|
10
10
|
PaymentOrderCreateAsyncParams,
|
|
11
11
|
PaymentOrdersPage,
|
|
12
12
|
PaymentOrders,
|
|
13
|
-
} from './payment-orders';
|
|
14
|
-
export { Reversal, ReversalCreateParams, ReversalListParams, ReversalsPage, Reversals } from './reversals';
|
|
13
|
+
} from './payment-orders.js';
|
|
14
|
+
export { Reversal, ReversalCreateParams, ReversalListParams, ReversalsPage, Reversals } from './reversals.js';
|