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,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
|
/**
|
|
@@ -15,11 +15,17 @@ export class LineItems extends APIResource {
|
|
|
15
15
|
params: LineItemCreateParams,
|
|
16
16
|
options?: Core.RequestOptions,
|
|
17
17
|
): Core.APIPromise<InvoiceLineItem> {
|
|
18
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
18
19
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
20
|
+
if (idempotencyKey) {
|
|
21
|
+
console.warn(
|
|
22
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
23
|
+
);
|
|
24
|
+
}
|
|
19
25
|
return this.post(`/api/invoices/${invoiceId}/invoice_line_items`, {
|
|
20
26
|
body,
|
|
21
27
|
...options,
|
|
22
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
28
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
23
29
|
});
|
|
24
30
|
}
|
|
25
31
|
|
|
@@ -143,39 +149,33 @@ export interface InvoiceLineItem {
|
|
|
143
149
|
|
|
144
150
|
export interface LineItemCreateParams {
|
|
145
151
|
/**
|
|
146
|
-
*
|
|
152
|
+
* The name of the line item, typically a product or SKU name.
|
|
147
153
|
*/
|
|
148
154
|
name: string;
|
|
149
155
|
|
|
150
156
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
157
|
+
* The cost per unit of the product or service that this line item is for,
|
|
158
|
+
* specified in the invoice currency's smallest unit.
|
|
153
159
|
*/
|
|
154
160
|
unit_amount: number;
|
|
155
161
|
|
|
156
162
|
/**
|
|
157
|
-
*
|
|
163
|
+
* An optional free-form description of the line item.
|
|
158
164
|
*/
|
|
159
165
|
description?: string;
|
|
160
166
|
|
|
161
167
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
168
|
+
* Either `debit` or `credit`. `debit` indicates that a client owes the business
|
|
169
|
+
* money and increases the invoice's `total_amount` due. `credit` has the opposite
|
|
170
|
+
* intention and effect.
|
|
165
171
|
*/
|
|
166
172
|
direction?: string;
|
|
167
173
|
|
|
168
174
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
175
|
+
* The number of units of a product or service that this line item is for. Must be
|
|
176
|
+
* a whole number. Defaults to 1 if not provided.
|
|
171
177
|
*/
|
|
172
178
|
quantity?: number;
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Header param: This key should be something unique, preferably something like an
|
|
176
|
-
* UUID.
|
|
177
|
-
*/
|
|
178
|
-
'Idempotency-Key'?: string;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
export interface LineItemUpdateParams {
|
|
@@ -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 LedgerAccountCategories extends APIResource {
|
|
10
10
|
/**
|
|
@@ -14,11 +14,17 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
14
14
|
params: LedgerAccountCategoryCreateParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
16
|
): Core.APIPromise<LedgerAccountCategory> {
|
|
17
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
17
18
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
19
|
+
if (idempotencyKey) {
|
|
20
|
+
console.warn(
|
|
21
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
22
|
+
);
|
|
23
|
+
}
|
|
18
24
|
return this.post('/api/ledger_account_categories', {
|
|
19
25
|
body,
|
|
20
26
|
...options,
|
|
21
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
27
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
22
28
|
});
|
|
23
29
|
}
|
|
24
30
|
|
|
@@ -299,46 +305,40 @@ export namespace LedgerAccountCategory {
|
|
|
299
305
|
|
|
300
306
|
export interface LedgerAccountCategoryCreateParams {
|
|
301
307
|
/**
|
|
302
|
-
*
|
|
308
|
+
* The currency of the ledger account category.
|
|
303
309
|
*/
|
|
304
310
|
currency: string;
|
|
305
311
|
|
|
306
312
|
/**
|
|
307
|
-
*
|
|
313
|
+
* The id of the ledger that this account category belongs to.
|
|
308
314
|
*/
|
|
309
315
|
ledger_id: string;
|
|
310
316
|
|
|
311
317
|
/**
|
|
312
|
-
*
|
|
318
|
+
* The name of the ledger account category.
|
|
313
319
|
*/
|
|
314
320
|
name: string;
|
|
315
321
|
|
|
316
322
|
/**
|
|
317
|
-
*
|
|
323
|
+
* The normal balance of the ledger account category.
|
|
318
324
|
*/
|
|
319
325
|
normal_balance: 'credit' | 'debit';
|
|
320
326
|
|
|
321
327
|
/**
|
|
322
|
-
*
|
|
328
|
+
* The currency exponent of the ledger account category.
|
|
323
329
|
*/
|
|
324
330
|
currency_exponent?: number | null;
|
|
325
331
|
|
|
326
332
|
/**
|
|
327
|
-
*
|
|
333
|
+
* The description of the ledger account category.
|
|
328
334
|
*/
|
|
329
335
|
description?: string | null;
|
|
330
336
|
|
|
331
337
|
/**
|
|
332
|
-
*
|
|
333
|
-
*
|
|
338
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
339
|
+
* strings.
|
|
334
340
|
*/
|
|
335
341
|
metadata?: Record<string, string>;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Header param: This key should be something unique, preferably something like an
|
|
339
|
-
* UUID.
|
|
340
|
-
*/
|
|
341
|
-
'Idempotency-Key'?: string;
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
export interface LedgerAccountCategoryRetrieveParams {
|
|
@@ -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 LedgerAccountPayouts extends APIResource {
|
|
10
10
|
/**
|
|
@@ -14,11 +14,17 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
14
14
|
params: LedgerAccountPayoutCreateParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
16
|
): Core.APIPromise<LedgerAccountPayout> {
|
|
17
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
17
18
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
19
|
+
if (idempotencyKey) {
|
|
20
|
+
console.warn(
|
|
21
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
22
|
+
);
|
|
23
|
+
}
|
|
18
24
|
return this.post('/api/ledger_account_payouts', {
|
|
19
25
|
body,
|
|
20
26
|
...options,
|
|
21
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
27
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
22
28
|
});
|
|
23
29
|
}
|
|
24
30
|
|
|
@@ -151,52 +157,46 @@ export interface LedgerAccountPayout {
|
|
|
151
157
|
|
|
152
158
|
export interface LedgerAccountPayoutCreateParams {
|
|
153
159
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
160
|
+
* The id of the funding ledger account that sends to or receives funds from the
|
|
161
|
+
* payout ledger account.
|
|
156
162
|
*/
|
|
157
163
|
funding_ledger_account_id: string;
|
|
158
164
|
|
|
159
165
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
166
|
+
* The id of the payout ledger account whose ledger entries are queried against,
|
|
167
|
+
* and its balance is reduced as a result.
|
|
162
168
|
*/
|
|
163
169
|
payout_ledger_account_id: string;
|
|
164
170
|
|
|
165
171
|
/**
|
|
166
|
-
*
|
|
172
|
+
* The description of the ledger account payout.
|
|
167
173
|
*/
|
|
168
174
|
description?: string | null;
|
|
169
175
|
|
|
170
176
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
177
|
+
* The exclusive upper bound of the effective_at timestamp of the ledger entries to
|
|
178
|
+
* be included in the ledger account payout. The default value is the created_at
|
|
179
|
+
* timestamp of the ledger account payout.
|
|
174
180
|
*/
|
|
175
181
|
effective_at_upper_bound?: string | null;
|
|
176
182
|
|
|
177
183
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
184
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
185
|
+
* strings.
|
|
180
186
|
*/
|
|
181
187
|
metadata?: Record<string, string>;
|
|
182
188
|
|
|
183
189
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
190
|
+
* It is set to `false` by default. It should be set to `true` when migrating
|
|
191
|
+
* existing payouts.
|
|
186
192
|
*/
|
|
187
193
|
skip_payout_ledger_transaction?: boolean | null;
|
|
188
194
|
|
|
189
195
|
/**
|
|
190
|
-
*
|
|
191
|
-
*
|
|
196
|
+
* The status of the ledger account payout. It is set to `pending` by default. To
|
|
197
|
+
* post a ledger account payout at creation, use `posted`.
|
|
192
198
|
*/
|
|
193
199
|
status?: 'pending' | 'posted' | null;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Header param: This key should be something unique, preferably something like an
|
|
197
|
-
* UUID.
|
|
198
|
-
*/
|
|
199
|
-
'Idempotency-Key'?: string;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
202
|
export interface LedgerAccountPayoutUpdateParams {
|
|
@@ -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 LedgerAccountStatements extends APIResource {
|
|
8
8
|
/**
|
|
@@ -12,11 +12,17 @@ export class LedgerAccountStatements extends APIResource {
|
|
|
12
12
|
params: LedgerAccountStatementCreateParams,
|
|
13
13
|
options?: Core.RequestOptions,
|
|
14
14
|
): Core.APIPromise<LedgerAccountStatementCreateResponse> {
|
|
15
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
15
16
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
17
|
+
if (idempotencyKey) {
|
|
18
|
+
console.warn(
|
|
19
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
20
|
+
);
|
|
21
|
+
}
|
|
16
22
|
return this.post('/api/ledger_account_statements', {
|
|
17
23
|
body,
|
|
18
24
|
...options,
|
|
19
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
25
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
20
26
|
});
|
|
21
27
|
}
|
|
22
28
|
|
|
@@ -573,39 +579,33 @@ export namespace LedgerAccountStatementRetrieveResponse {
|
|
|
573
579
|
|
|
574
580
|
export interface LedgerAccountStatementCreateParams {
|
|
575
581
|
/**
|
|
576
|
-
*
|
|
577
|
-
*
|
|
582
|
+
* The inclusive lower bound of the effective_at timestamp of the ledger entries to
|
|
583
|
+
* be included in the ledger account statement.
|
|
578
584
|
*/
|
|
579
585
|
effective_at_lower_bound: string;
|
|
580
586
|
|
|
581
587
|
/**
|
|
582
|
-
*
|
|
583
|
-
*
|
|
588
|
+
* The exclusive upper bound of the effective_at timestamp of the ledger entries to
|
|
589
|
+
* be included in the ledger account statement.
|
|
584
590
|
*/
|
|
585
591
|
effective_at_upper_bound: string;
|
|
586
592
|
|
|
587
593
|
/**
|
|
588
|
-
*
|
|
589
|
-
*
|
|
594
|
+
* The id of the ledger account whose ledger entries are queried against, and its
|
|
595
|
+
* balances are computed as a result.
|
|
590
596
|
*/
|
|
591
597
|
ledger_account_id: string;
|
|
592
598
|
|
|
593
599
|
/**
|
|
594
|
-
*
|
|
600
|
+
* The description of the ledger account statement.
|
|
595
601
|
*/
|
|
596
602
|
description?: string | null;
|
|
597
603
|
|
|
598
604
|
/**
|
|
599
|
-
*
|
|
600
|
-
*
|
|
605
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
606
|
+
* strings.
|
|
601
607
|
*/
|
|
602
608
|
metadata?: Record<string, string>;
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Header param: This key should be something unique, preferably something like an
|
|
606
|
-
* UUID.
|
|
607
|
-
*/
|
|
608
|
-
'Idempotency-Key'?: string;
|
|
609
609
|
}
|
|
610
610
|
|
|
611
611
|
export namespace LedgerAccountStatements {
|
|
@@ -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 LedgerAccounts extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Create a ledger account.
|
|
12
12
|
*/
|
|
13
13
|
create(params: LedgerAccountCreateParams, options?: Core.RequestOptions): Core.APIPromise<LedgerAccount> {
|
|
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/ledger_accounts', {
|
|
16
22
|
body,
|
|
17
23
|
...options,
|
|
18
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
24
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
19
25
|
});
|
|
20
26
|
}
|
|
21
27
|
|
|
@@ -271,59 +277,53 @@ export namespace LedgerAccount {
|
|
|
271
277
|
|
|
272
278
|
export interface LedgerAccountCreateParams {
|
|
273
279
|
/**
|
|
274
|
-
*
|
|
280
|
+
* The currency of the ledger account.
|
|
275
281
|
*/
|
|
276
282
|
currency: string;
|
|
277
283
|
|
|
278
284
|
/**
|
|
279
|
-
*
|
|
285
|
+
* The id of the ledger that this account belongs to.
|
|
280
286
|
*/
|
|
281
287
|
ledger_id: string;
|
|
282
288
|
|
|
283
289
|
/**
|
|
284
|
-
*
|
|
290
|
+
* The name of the ledger account.
|
|
285
291
|
*/
|
|
286
292
|
name: string;
|
|
287
293
|
|
|
288
294
|
/**
|
|
289
|
-
*
|
|
295
|
+
* The normal balance of the ledger account.
|
|
290
296
|
*/
|
|
291
297
|
normal_balance: 'credit' | 'debit';
|
|
292
298
|
|
|
293
299
|
/**
|
|
294
|
-
*
|
|
300
|
+
* The currency exponent of the ledger account.
|
|
295
301
|
*/
|
|
296
302
|
currency_exponent?: number | null;
|
|
297
303
|
|
|
298
304
|
/**
|
|
299
|
-
*
|
|
305
|
+
* The description of the ledger account.
|
|
300
306
|
*/
|
|
301
307
|
description?: string | null;
|
|
302
308
|
|
|
303
309
|
/**
|
|
304
|
-
*
|
|
305
|
-
*
|
|
310
|
+
* If the ledger account links to another object in Modern Treasury, the id will be
|
|
311
|
+
* populated here, otherwise null.
|
|
306
312
|
*/
|
|
307
313
|
ledgerable_id?: string;
|
|
308
314
|
|
|
309
315
|
/**
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
316
|
+
* If the ledger account links to another object in Modern Treasury, the type will
|
|
317
|
+
* be populated here, otherwise null. The value is one of internal_account or
|
|
318
|
+
* external_account.
|
|
313
319
|
*/
|
|
314
320
|
ledgerable_type?: 'external_account' | 'internal_account';
|
|
315
321
|
|
|
316
322
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
323
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
324
|
+
* strings.
|
|
319
325
|
*/
|
|
320
326
|
metadata?: Record<string, string>;
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Header param: This key should be something unique, preferably something like an
|
|
324
|
-
* UUID.
|
|
325
|
-
*/
|
|
326
|
-
'Idempotency-Key'?: string;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
export interface LedgerAccountRetrieveParams {
|
|
@@ -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 LedgerEntries extends APIResource {
|
|
10
10
|
/**
|
|
@@ -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 LedgerEventHandlers extends APIResource {
|
|
10
10
|
/**
|
|
@@ -14,11 +14,17 @@ export class LedgerEventHandlers extends APIResource {
|
|
|
14
14
|
params: LedgerEventHandlerCreateParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
16
|
): Core.APIPromise<LedgerEventHandlerCreateResponse> {
|
|
17
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
17
18
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
19
|
+
if (idempotencyKey) {
|
|
20
|
+
console.warn(
|
|
21
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
22
|
+
);
|
|
23
|
+
}
|
|
18
24
|
return this.post('/api/ledger_event_handlers', {
|
|
19
25
|
body,
|
|
20
26
|
...options,
|
|
21
|
-
headers: { 'Idempotency-Key': idempotencyKey
|
|
27
|
+
headers: { 'Idempotency-Key': idempotencyKey, ...options?.headers },
|
|
22
28
|
});
|
|
23
29
|
}
|
|
24
30
|
|
|
@@ -473,42 +479,30 @@ export namespace LedgerEventHandlerDeleteResponse {
|
|
|
473
479
|
}
|
|
474
480
|
|
|
475
481
|
export interface LedgerEventHandlerCreateParams {
|
|
476
|
-
/**
|
|
477
|
-
* Body param:
|
|
478
|
-
*/
|
|
479
482
|
ledger_transaction_template: LedgerEventHandlerCreateParams.LedgerTransactionTemplate;
|
|
480
483
|
|
|
481
484
|
/**
|
|
482
|
-
*
|
|
485
|
+
* Name of the ledger event handler.
|
|
483
486
|
*/
|
|
484
487
|
name: string;
|
|
485
488
|
|
|
486
|
-
/**
|
|
487
|
-
* Body param:
|
|
488
|
-
*/
|
|
489
489
|
conditions?: LedgerEventHandlerCreateParams.Conditions | null;
|
|
490
490
|
|
|
491
491
|
/**
|
|
492
|
-
*
|
|
492
|
+
* An optional description.
|
|
493
493
|
*/
|
|
494
494
|
description?: string | null;
|
|
495
495
|
|
|
496
496
|
/**
|
|
497
|
-
*
|
|
497
|
+
* The id of the ledger that this account belongs to.
|
|
498
498
|
*/
|
|
499
499
|
ledger_id?: string;
|
|
500
500
|
|
|
501
501
|
/**
|
|
502
|
-
*
|
|
503
|
-
*
|
|
502
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
503
|
+
* strings.
|
|
504
504
|
*/
|
|
505
505
|
metadata?: Record<string, string> | null;
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Header param: This key should be something unique, preferably something like an
|
|
509
|
-
* UUID.
|
|
510
|
-
*/
|
|
511
|
-
'Idempotency-Key'?: string;
|
|
512
506
|
}
|
|
513
507
|
|
|
514
508
|
export namespace LedgerEventHandlerCreateParams {
|
|
@@ -8,10 +8,10 @@ export {
|
|
|
8
8
|
LedgerTransactionCreateReversalParams,
|
|
9
9
|
LedgerTransactionsPage,
|
|
10
10
|
LedgerTransactions,
|
|
11
|
-
} from './ledger-transactions';
|
|
11
|
+
} from './ledger-transactions.js';
|
|
12
12
|
export {
|
|
13
13
|
LedgerTransactionVersion,
|
|
14
14
|
VersionListParams,
|
|
15
15
|
LedgerTransactionVersionsPage,
|
|
16
16
|
Versions,
|
|
17
|
-
} from './versions';
|
|
17
|
+
} from './versions.js';
|