modern-treasury 2.2.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 +75 -0
- package/README.md +43 -15
- package/_shims/ReadableStream-node.d.ts +6 -0
- package/_shims/ReadableStream-node.d.ts.map +1 -0
- package/_shims/ReadableStream-node.js +14 -0
- package/_shims/ReadableStream-node.js.map +1 -0
- package/_shims/ReadableStream-node.mjs +3 -0
- package/_shims/ReadableStream-node.mjs.map +1 -0
- package/_shims/ReadableStream.d.ts +38 -0
- package/_shims/ReadableStream.js +5 -0
- package/_shims/ReadableStream.mjs +7 -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/_shims/{fetch.node.d.ts → fetch-node.d.ts} +12 -1
- package/_shims/fetch.d.ts +9 -1
- 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 +91 -34
- package/core.d.ts.map +1 -1
- package/core.js +201 -70
- package/core.js.map +1 -1
- package/core.mjs +195 -70
- package/core.mjs.map +1 -1
- package/index.d.mts +19 -7
- package/index.d.ts +19 -7
- package/index.d.ts.map +1 -1
- package/index.js +23 -9
- package/index.js.map +1 -1
- package/index.mjs +23 -9
- package/index.mjs.map +1 -1
- package/package.json +32 -9
- package/pagination.d.ts +2 -2
- package/pagination.d.ts.map +1 -1
- package/pagination.js +5 -5
- package/pagination.js.map +1 -1
- package/pagination.mjs +5 -5
- package/pagination.mjs.map +1 -1
- package/resources/account-collection-flows.d.ts +8 -33
- 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 +8 -13
- 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.d.ts +5 -2
- package/resources/connections.d.ts.map +1 -1
- package/resources/connections.js +3 -3
- package/resources/connections.js.map +1 -1
- package/resources/connections.mjs +3 -3
- package/resources/connections.mjs.map +1 -1
- package/resources/counterparties.d.ts +37 -51
- 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 +6 -17
- package/resources/documents.d.ts.map +1 -1
- package/resources/documents.js +13 -7
- package/resources/documents.js.map +1 -1
- package/resources/documents.mjs +13 -7
- package/resources/documents.mjs.map +1 -1
- package/resources/events.d.ts +3 -3
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +3 -3
- package/resources/events.mjs +3 -3
- package/resources/expected-payments.d.ts +30 -39
- 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 +27 -61
- 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 +20 -21
- 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 -3
- 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.d.ts +6 -3
- package/resources/internal-accounts/balance-reports.d.ts.map +1 -1
- package/resources/internal-accounts/balance-reports.js +3 -3
- package/resources/internal-accounts/balance-reports.js.map +1 -1
- package/resources/internal-accounts/balance-reports.mjs +3 -3
- package/resources/internal-accounts/balance-reports.mjs.map +1 -1
- package/resources/internal-accounts/internal-accounts.d.ts +16 -21
- 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 +67 -42
- 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 +32 -185
- 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 +47 -87
- package/resources/ledger-account-categories.d.ts.map +1 -1
- package/resources/ledger-account-categories.js +21 -17
- package/resources/ledger-account-categories.js.map +1 -1
- package/resources/ledger-account-categories.mjs +21 -17
- package/resources/ledger-account-categories.mjs.map +1 -1
- package/resources/ledger-account-payouts.d.ts +33 -22
- 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 +11 -16
- 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 +30 -30
- 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.d.ts +20 -6
- package/resources/ledger-entries.d.ts.map +1 -1
- package/resources/ledger-entries.js +3 -3
- package/resources/ledger-entries.js.map +1 -1
- package/resources/ledger-entries.mjs +3 -3
- package/resources/ledger-entries.mjs.map +1 -1
- package/resources/ledger-event-handlers.d.ts +12 -24
- 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 +48 -37
- package/resources/ledger-transactions/ledger-transactions.d.ts.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.js +13 -7
- package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.mjs +13 -7
- package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
- package/resources/ledger-transactions/versions.d.ts +4 -2
- package/resources/ledger-transactions/versions.d.ts.map +1 -1
- package/resources/ledger-transactions/versions.js +3 -3
- package/resources/ledger-transactions/versions.js.map +1 -1
- package/resources/ledger-transactions/versions.mjs +3 -3
- package/resources/ledger-transactions/versions.mjs.map +1 -1
- package/resources/ledgerable-events.d.ts +13 -18
- 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 +16 -20
- 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.d.ts +5 -5
- package/resources/line-items.d.ts.map +1 -1
- package/resources/line-items.js +3 -3
- package/resources/line-items.mjs +3 -3
- package/resources/paper-items.d.ts +6 -3
- package/resources/paper-items.d.ts.map +1 -1
- package/resources/paper-items.js +3 -3
- package/resources/paper-items.js.map +1 -1
- package/resources/paper-items.mjs +3 -3
- package/resources/paper-items.mjs.map +1 -1
- package/resources/payment-flows.d.ts +18 -42
- 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 +172 -191
- package/resources/payment-orders/payment-orders.d.ts.map +1 -1
- package/resources/payment-orders/payment-orders.js +21 -11
- package/resources/payment-orders/payment-orders.js.map +1 -1
- package/resources/payment-orders/payment-orders.mjs +21 -11
- package/resources/payment-orders/payment-orders.mjs.map +1 -1
- package/resources/payment-orders/reversals.d.ts +21 -22
- 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.d.ts +3 -3
- package/resources/payment-references.d.ts.map +1 -1
- package/resources/payment-references.js +3 -3
- package/resources/payment-references.mjs +3 -3
- package/resources/returns.d.ts +16 -19
- 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 +9 -15
- 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.d.ts +5 -2
- package/resources/transactions/line-items.d.ts.map +1 -1
- package/resources/transactions/line-items.js +3 -3
- package/resources/transactions/line-items.js.map +1 -1
- package/resources/transactions/line-items.mjs +3 -3
- package/resources/transactions/line-items.mjs.map +1 -1
- package/resources/transactions/transactions.d.ts +8 -5
- package/resources/transactions/transactions.d.ts.map +1 -1
- package/resources/transactions/transactions.js +3 -3
- package/resources/transactions/transactions.js.map +1 -1
- package/resources/transactions/transactions.mjs +3 -3
- package/resources/transactions/transactions.mjs.map +1 -1
- package/resources/validations.d.ts +1 -1
- package/resources/validations.d.ts.map +1 -1
- package/resources/validations.js +1 -1
- package/resources/validations.mjs +1 -1
- package/resources/virtual-accounts.d.ts +19 -28
- 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-node.ts +6 -0
- package/src/_shims/ReadableStream.d.ts +38 -0
- package/src/_shims/ReadableStream.js +5 -0
- package/src/_shims/ReadableStream.mjs +7 -0
- package/src/_shims/agent.ts +1 -1
- package/src/_shims/{fetch.node.d.ts → fetch-node.d.ts} +20 -9
- package/src/_shims/fetch.d.ts +18 -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 +275 -97
- package/src/error.ts +1 -1
- package/src/index.ts +31 -18
- package/src/pagination.ts +6 -6
- package/src/resource.ts +1 -1
- package/src/resources/account-collection-flows.ts +29 -57
- package/src/resources/account-details.ts +22 -22
- package/src/resources/connections.ts +11 -8
- package/src/resources/counterparties.ts +61 -65
- package/src/resources/documents.ts +21 -30
- package/src/resources/events.ts +9 -9
- package/src/resources/expected-payments.ts +45 -49
- package/src/resources/external-accounts.ts +59 -78
- package/src/resources/incoming-payment-details.ts +38 -33
- package/src/resources/index.ts +39 -36
- package/src/resources/internal-accounts/balance-reports.ts +13 -10
- package/src/resources/internal-accounts/index.ts +2 -2
- package/src/resources/internal-accounts/internal-accounts.ts +35 -35
- package/src/resources/invoices/index.ts +2 -2
- package/src/resources/invoices/invoices.ts +91 -54
- package/src/resources/invoices/line-items.ts +46 -228
- package/src/resources/ledger-account-categories.ts +67 -111
- package/src/resources/ledger-account-payouts.ts +49 -30
- package/src/resources/ledger-account-statements.ts +21 -21
- package/src/resources/ledger-accounts.ts +46 -40
- package/src/resources/ledger-entries.ts +29 -13
- package/src/resources/ledger-event-handlers.ts +25 -35
- package/src/resources/ledger-transactions/index.ts +2 -2
- package/src/resources/ledger-transactions/ledger-transactions.ts +73 -53
- package/src/resources/ledger-transactions/versions.ts +10 -8
- package/src/resources/ledgerable-events.ts +23 -23
- package/src/resources/ledgers.ts +31 -29
- package/src/resources/line-items.ts +12 -12
- package/src/resources/paper-items.ts +13 -10
- package/src/resources/payment-flows.ts +39 -66
- package/src/resources/payment-orders/index.ts +2 -2
- package/src/resources/payment-orders/payment-orders.ts +204 -216
- package/src/resources/payment-orders/reversals.ts +36 -31
- package/src/resources/payment-references.ts +9 -9
- package/src/resources/returns.ts +30 -28
- package/src/resources/routing-details.ts +23 -24
- package/src/resources/top-level.ts +1 -1
- package/src/resources/transactions/index.ts +7 -2
- package/src/resources/transactions/line-items.ts +11 -8
- package/src/resources/transactions/transactions.ts +17 -14
- package/src/resources/validations.ts +4 -4
- package/src/resources/virtual-accounts.ts +35 -39
- 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/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/{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 LedgerAccountCategories extends APIResource {
|
|
10
10
|
/**
|
|
@@ -13,12 +13,18 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
13
13
|
create(
|
|
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
|
|
|
@@ -29,13 +35,13 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
29
35
|
id: string,
|
|
30
36
|
query?: LedgerAccountCategoryRetrieveParams,
|
|
31
37
|
options?: Core.RequestOptions,
|
|
32
|
-
):
|
|
33
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
38
|
+
): Core.APIPromise<LedgerAccountCategory>;
|
|
39
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountCategory>;
|
|
34
40
|
retrieve(
|
|
35
41
|
id: string,
|
|
36
42
|
query: LedgerAccountCategoryRetrieveParams | Core.RequestOptions = {},
|
|
37
43
|
options?: Core.RequestOptions,
|
|
38
|
-
):
|
|
44
|
+
): Core.APIPromise<LedgerAccountCategory> {
|
|
39
45
|
if (isRequestOptions(query)) {
|
|
40
46
|
return this.retrieve(id, {}, query);
|
|
41
47
|
}
|
|
@@ -47,20 +53,19 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
47
53
|
*/
|
|
48
54
|
update(
|
|
49
55
|
id: string,
|
|
50
|
-
|
|
56
|
+
body?: LedgerAccountCategoryUpdateParams,
|
|
51
57
|
options?: Core.RequestOptions,
|
|
52
|
-
):
|
|
53
|
-
update(id: string, options?: Core.RequestOptions):
|
|
58
|
+
): Core.APIPromise<LedgerAccountCategory>;
|
|
59
|
+
update(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountCategory>;
|
|
54
60
|
update(
|
|
55
61
|
id: string,
|
|
56
|
-
|
|
62
|
+
body: LedgerAccountCategoryUpdateParams | Core.RequestOptions = {},
|
|
57
63
|
options?: Core.RequestOptions,
|
|
58
|
-
):
|
|
59
|
-
if (isRequestOptions(
|
|
60
|
-
return this.update(id, {},
|
|
64
|
+
): Core.APIPromise<LedgerAccountCategory> {
|
|
65
|
+
if (isRequestOptions(body)) {
|
|
66
|
+
return this.update(id, {}, body);
|
|
61
67
|
}
|
|
62
|
-
|
|
63
|
-
return this.patch(`/api/ledger_account_categories/${id}`, { query: { balances }, body, ...options });
|
|
68
|
+
return this.patch(`/api/ledger_account_categories/${id}`, { body, ...options });
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
/**
|
|
@@ -69,12 +74,12 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
69
74
|
list(
|
|
70
75
|
query?: LedgerAccountCategoryListParams,
|
|
71
76
|
options?: Core.RequestOptions,
|
|
72
|
-
): Core.PagePromise<LedgerAccountCategoriesPage>;
|
|
73
|
-
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountCategoriesPage>;
|
|
77
|
+
): Core.PagePromise<LedgerAccountCategoriesPage, LedgerAccountCategory>;
|
|
78
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountCategoriesPage, LedgerAccountCategory>;
|
|
74
79
|
list(
|
|
75
80
|
query: LedgerAccountCategoryListParams | Core.RequestOptions = {},
|
|
76
81
|
options?: Core.RequestOptions,
|
|
77
|
-
): Core.PagePromise<LedgerAccountCategoriesPage> {
|
|
82
|
+
): Core.PagePromise<LedgerAccountCategoriesPage, LedgerAccountCategory> {
|
|
78
83
|
if (isRequestOptions(query)) {
|
|
79
84
|
return this.list({}, query);
|
|
80
85
|
}
|
|
@@ -87,32 +92,18 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
87
92
|
/**
|
|
88
93
|
* Delete a ledger account category.
|
|
89
94
|
*/
|
|
90
|
-
del(
|
|
91
|
-
id
|
|
92
|
-
body?: LedgerAccountCategoryDeleteParams,
|
|
93
|
-
options?: Core.RequestOptions,
|
|
94
|
-
): Promise<Core.APIResponse<LedgerAccountCategory>>;
|
|
95
|
-
del(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<LedgerAccountCategory>>;
|
|
96
|
-
del(
|
|
97
|
-
id: string,
|
|
98
|
-
body: LedgerAccountCategoryDeleteParams | Core.RequestOptions = {},
|
|
99
|
-
options?: Core.RequestOptions,
|
|
100
|
-
): Promise<Core.APIResponse<LedgerAccountCategory>> {
|
|
101
|
-
if (isRequestOptions(body)) {
|
|
102
|
-
return this.del(id, {}, body);
|
|
103
|
-
}
|
|
104
|
-
const { balances } = body;
|
|
105
|
-
return this.delete(`/api/ledger_account_categories/${id}`, { query: { balances }, ...options });
|
|
95
|
+
del(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountCategory> {
|
|
96
|
+
return this.delete(`/api/ledger_account_categories/${id}`, options);
|
|
106
97
|
}
|
|
107
98
|
|
|
108
99
|
/**
|
|
109
|
-
* Add a ledger account
|
|
100
|
+
* Add a ledger account to a ledger account category.
|
|
110
101
|
*/
|
|
111
102
|
addLedgerAccount(
|
|
112
103
|
id: string,
|
|
113
104
|
ledgerAccountId: string,
|
|
114
105
|
options?: Core.RequestOptions,
|
|
115
|
-
):
|
|
106
|
+
): Core.APIPromise<void> {
|
|
116
107
|
return this.put(`/api/ledger_account_categories/${id}/ledger_accounts/${ledgerAccountId}`, {
|
|
117
108
|
...options,
|
|
118
109
|
headers: { Accept: '', ...options?.headers },
|
|
@@ -122,11 +113,7 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
122
113
|
/**
|
|
123
114
|
* Add a ledger account category to a ledger account category.
|
|
124
115
|
*/
|
|
125
|
-
addNestedCategory(
|
|
126
|
-
id: string,
|
|
127
|
-
subCategoryId: string,
|
|
128
|
-
options?: Core.RequestOptions,
|
|
129
|
-
): Promise<Core.APIResponse<void>> {
|
|
116
|
+
addNestedCategory(id: string, subCategoryId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
130
117
|
return this.put(`/api/ledger_account_categories/${id}/ledger_account_categories/${subCategoryId}`, {
|
|
131
118
|
...options,
|
|
132
119
|
headers: { Accept: '', ...options?.headers },
|
|
@@ -134,13 +121,13 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
134
121
|
}
|
|
135
122
|
|
|
136
123
|
/**
|
|
137
|
-
*
|
|
124
|
+
* Remove a ledger account from a ledger account category.
|
|
138
125
|
*/
|
|
139
126
|
removeLedgerAccount(
|
|
140
127
|
id: string,
|
|
141
128
|
ledgerAccountId: string,
|
|
142
129
|
options?: Core.RequestOptions,
|
|
143
|
-
):
|
|
130
|
+
): Core.APIPromise<void> {
|
|
144
131
|
return this.delete(`/api/ledger_account_categories/${id}/ledger_accounts/${ledgerAccountId}`, {
|
|
145
132
|
...options,
|
|
146
133
|
headers: { Accept: '', ...options?.headers },
|
|
@@ -154,7 +141,7 @@ export class LedgerAccountCategories extends APIResource {
|
|
|
154
141
|
id: string,
|
|
155
142
|
subCategoryId: string,
|
|
156
143
|
options?: Core.RequestOptions,
|
|
157
|
-
):
|
|
144
|
+
): Core.APIPromise<void> {
|
|
158
145
|
return this.delete(`/api/ledger_account_categories/${id}/ledger_account_categories/${subCategoryId}`, {
|
|
159
146
|
...options,
|
|
160
147
|
headers: { Accept: '', ...options?.headers },
|
|
@@ -318,64 +305,56 @@ export namespace LedgerAccountCategory {
|
|
|
318
305
|
|
|
319
306
|
export interface LedgerAccountCategoryCreateParams {
|
|
320
307
|
/**
|
|
321
|
-
*
|
|
308
|
+
* The currency of the ledger account category.
|
|
322
309
|
*/
|
|
323
310
|
currency: string;
|
|
324
311
|
|
|
325
312
|
/**
|
|
326
|
-
*
|
|
313
|
+
* The id of the ledger that this account category belongs to.
|
|
327
314
|
*/
|
|
328
315
|
ledger_id: string;
|
|
329
316
|
|
|
330
317
|
/**
|
|
331
|
-
*
|
|
318
|
+
* The name of the ledger account category.
|
|
332
319
|
*/
|
|
333
320
|
name: string;
|
|
334
321
|
|
|
335
322
|
/**
|
|
336
|
-
*
|
|
323
|
+
* The normal balance of the ledger account category.
|
|
337
324
|
*/
|
|
338
325
|
normal_balance: 'credit' | 'debit';
|
|
339
326
|
|
|
340
327
|
/**
|
|
341
|
-
*
|
|
328
|
+
* The currency exponent of the ledger account category.
|
|
342
329
|
*/
|
|
343
330
|
currency_exponent?: number | null;
|
|
344
331
|
|
|
345
332
|
/**
|
|
346
|
-
*
|
|
333
|
+
* The description of the ledger account category.
|
|
347
334
|
*/
|
|
348
335
|
description?: string | null;
|
|
349
336
|
|
|
350
337
|
/**
|
|
351
|
-
*
|
|
352
|
-
*
|
|
338
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
339
|
+
* strings.
|
|
353
340
|
*/
|
|
354
341
|
metadata?: Record<string, string>;
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Header param: This key should be something unique, preferably something like an
|
|
358
|
-
* UUID.
|
|
359
|
-
*/
|
|
360
|
-
'Idempotency-Key'?: string;
|
|
361
342
|
}
|
|
362
343
|
|
|
363
344
|
export interface LedgerAccountCategoryRetrieveParams {
|
|
364
345
|
/**
|
|
365
|
-
* For example, if you want the balances as of a particular
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
* entries with that exact date.
|
|
346
|
+
* For example, if you want the balances as of a particular time (ISO8601), the
|
|
347
|
+
* encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
|
|
348
|
+
* The balances as of a time are inclusive of entries with that exact time.
|
|
369
349
|
*/
|
|
370
350
|
balances?: LedgerAccountCategoryRetrieveParams.Balances;
|
|
371
351
|
}
|
|
372
352
|
|
|
373
353
|
export namespace LedgerAccountCategoryRetrieveParams {
|
|
374
354
|
/**
|
|
375
|
-
* For example, if you want the balances as of a particular
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
* entries with that exact date.
|
|
355
|
+
* For example, if you want the balances as of a particular time (ISO8601), the
|
|
356
|
+
* encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
|
|
357
|
+
* The balances as of a time are inclusive of entries with that exact time.
|
|
379
358
|
*/
|
|
380
359
|
export interface Balances {
|
|
381
360
|
as_of_date?: string;
|
|
@@ -386,45 +365,36 @@ export namespace LedgerAccountCategoryRetrieveParams {
|
|
|
386
365
|
|
|
387
366
|
export interface LedgerAccountCategoryUpdateParams {
|
|
388
367
|
/**
|
|
389
|
-
*
|
|
390
|
-
* date (YYYY-MM-DD), the encoded query string would be
|
|
391
|
-
* balances%5Bas_of_date%5D=2000-12-31. The balances as of a date are exclusive of
|
|
392
|
-
* entries with that exact date.
|
|
393
|
-
*/
|
|
394
|
-
balances?: LedgerAccountCategoryUpdateParams.Balances;
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* Body param: The description of the ledger account category.
|
|
368
|
+
* The description of the ledger account category.
|
|
398
369
|
*/
|
|
399
370
|
description?: string | null;
|
|
400
371
|
|
|
401
372
|
/**
|
|
402
|
-
*
|
|
403
|
-
*
|
|
373
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
374
|
+
* strings.
|
|
404
375
|
*/
|
|
405
376
|
metadata?: Record<string, string>;
|
|
406
377
|
|
|
407
378
|
/**
|
|
408
|
-
*
|
|
379
|
+
* The name of the ledger account category.
|
|
409
380
|
*/
|
|
410
381
|
name?: string;
|
|
411
382
|
}
|
|
412
383
|
|
|
413
|
-
export
|
|
384
|
+
export interface LedgerAccountCategoryListParams extends PageParams {
|
|
414
385
|
/**
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
* balances%5Bas_of_date%5D=2000-12-31. The balances as of a date are exclusive of
|
|
418
|
-
* entries with that exact date.
|
|
386
|
+
* If you have specific IDs to retrieve in bulk, you can pass them as query
|
|
387
|
+
* parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
|
|
419
388
|
*/
|
|
420
|
-
|
|
421
|
-
as_of_date?: string;
|
|
389
|
+
id?: Array<string>;
|
|
422
390
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
391
|
+
/**
|
|
392
|
+
* For example, if you want the balances as of a particular time (ISO8601), the
|
|
393
|
+
* encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
|
|
394
|
+
* The balances as of a time are inclusive of entries with that exact time.
|
|
395
|
+
*/
|
|
396
|
+
balances?: LedgerAccountCategoryListParams.Balances;
|
|
426
397
|
|
|
427
|
-
export interface LedgerAccountCategoryListParams extends PageParams {
|
|
428
398
|
/**
|
|
429
399
|
* Query categories which contain a ledger account directly or through child
|
|
430
400
|
* categories.
|
|
@@ -448,26 +418,13 @@ export interface LedgerAccountCategoryListParams extends PageParams {
|
|
|
448
418
|
parent_ledger_account_category_id?: string;
|
|
449
419
|
}
|
|
450
420
|
|
|
451
|
-
export
|
|
452
|
-
/**
|
|
453
|
-
* For example, if you want the balances as of a particular effective date
|
|
454
|
-
* (YYYY-MM-DD), the encoded query string would be
|
|
455
|
-
* balances%5Bas_of_date%5D=2000-12-31. The balances as of a date are exclusive of
|
|
456
|
-
* entries with that exact date.
|
|
457
|
-
*/
|
|
458
|
-
balances?: LedgerAccountCategoryDeleteParams.Balances;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
export namespace LedgerAccountCategoryDeleteParams {
|
|
421
|
+
export namespace LedgerAccountCategoryListParams {
|
|
462
422
|
/**
|
|
463
|
-
* For example, if you want the balances as of a particular
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
* entries with that exact date.
|
|
423
|
+
* For example, if you want the balances as of a particular time (ISO8601), the
|
|
424
|
+
* encoded query string would be `balances%5Beffective_at%5D=2000-12-31T12:00:00Z`.
|
|
425
|
+
* The balances as of a time are inclusive of entries with that exact time.
|
|
467
426
|
*/
|
|
468
427
|
export interface Balances {
|
|
469
|
-
as_of_date?: string;
|
|
470
|
-
|
|
471
428
|
effective_at?: string;
|
|
472
429
|
}
|
|
473
430
|
}
|
|
@@ -479,5 +436,4 @@ export namespace LedgerAccountCategories {
|
|
|
479
436
|
export import LedgerAccountCategoryRetrieveParams = API.LedgerAccountCategoryRetrieveParams;
|
|
480
437
|
export import LedgerAccountCategoryUpdateParams = API.LedgerAccountCategoryUpdateParams;
|
|
481
438
|
export import LedgerAccountCategoryListParams = API.LedgerAccountCategoryListParams;
|
|
482
|
-
export import LedgerAccountCategoryDeleteParams = API.LedgerAccountCategoryDeleteParams;
|
|
483
439
|
}
|
|
@@ -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
|
/**
|
|
@@ -13,12 +13,18 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
13
13
|
create(
|
|
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
|
|
|
@@ -29,13 +35,13 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
29
35
|
id: string,
|
|
30
36
|
body?: LedgerAccountPayoutUpdateParams,
|
|
31
37
|
options?: Core.RequestOptions,
|
|
32
|
-
):
|
|
33
|
-
update(id: string, options?: Core.RequestOptions):
|
|
38
|
+
): Core.APIPromise<LedgerAccountPayout>;
|
|
39
|
+
update(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountPayout>;
|
|
34
40
|
update(
|
|
35
41
|
id: string,
|
|
36
42
|
body: LedgerAccountPayoutUpdateParams | Core.RequestOptions = {},
|
|
37
43
|
options?: Core.RequestOptions,
|
|
38
|
-
):
|
|
44
|
+
): Core.APIPromise<LedgerAccountPayout> {
|
|
39
45
|
if (isRequestOptions(body)) {
|
|
40
46
|
return this.update(id, {}, body);
|
|
41
47
|
}
|
|
@@ -48,12 +54,12 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
48
54
|
list(
|
|
49
55
|
query?: LedgerAccountPayoutListParams,
|
|
50
56
|
options?: Core.RequestOptions,
|
|
51
|
-
): Core.PagePromise<LedgerAccountPayoutsPage>;
|
|
52
|
-
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountPayoutsPage>;
|
|
57
|
+
): Core.PagePromise<LedgerAccountPayoutsPage, LedgerAccountPayout>;
|
|
58
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LedgerAccountPayoutsPage, LedgerAccountPayout>;
|
|
53
59
|
list(
|
|
54
60
|
query: LedgerAccountPayoutListParams | Core.RequestOptions = {},
|
|
55
61
|
options?: Core.RequestOptions,
|
|
56
|
-
): Core.PagePromise<LedgerAccountPayoutsPage> {
|
|
62
|
+
): Core.PagePromise<LedgerAccountPayoutsPage, LedgerAccountPayout> {
|
|
57
63
|
if (isRequestOptions(query)) {
|
|
58
64
|
return this.list({}, query);
|
|
59
65
|
}
|
|
@@ -63,7 +69,7 @@ export class LedgerAccountPayouts extends APIResource {
|
|
|
63
69
|
/**
|
|
64
70
|
* Get details on a single ledger account payout.
|
|
65
71
|
*/
|
|
66
|
-
retireve(id: string, options?: Core.RequestOptions):
|
|
72
|
+
retireve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerAccountPayout> {
|
|
67
73
|
return this.get(`/api/ledger_account_payouts/${id}`, options);
|
|
68
74
|
}
|
|
69
75
|
}
|
|
@@ -151,46 +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
200
|
}
|
|
195
201
|
|
|
196
202
|
export interface LedgerAccountPayoutUpdateParams {
|
|
@@ -213,6 +219,19 @@ export interface LedgerAccountPayoutUpdateParams {
|
|
|
213
219
|
}
|
|
214
220
|
|
|
215
221
|
export interface LedgerAccountPayoutListParams extends PageParams {
|
|
222
|
+
/**
|
|
223
|
+
* If you have specific IDs to retrieve in bulk, you can pass them as query
|
|
224
|
+
* parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
|
|
225
|
+
*/
|
|
226
|
+
id?: Array<string>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* For example, if you want to query for records with metadata key `Type` and value
|
|
230
|
+
* `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
|
|
231
|
+
* parameters.
|
|
232
|
+
*/
|
|
233
|
+
metadata?: Record<string, string>;
|
|
234
|
+
|
|
216
235
|
payout_ledger_account_id?: string;
|
|
217
236
|
}
|
|
218
237
|
|
|
@@ -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
|
/**
|
|
@@ -11,12 +11,18 @@ export class LedgerAccountStatements extends APIResource {
|
|
|
11
11
|
create(
|
|
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
|
|
|
@@ -26,7 +32,7 @@ export class LedgerAccountStatements extends APIResource {
|
|
|
26
32
|
retrieve(
|
|
27
33
|
id: string,
|
|
28
34
|
options?: Core.RequestOptions,
|
|
29
|
-
):
|
|
35
|
+
): Core.APIPromise<LedgerAccountStatementRetrieveResponse> {
|
|
30
36
|
return this.get(`/api/ledger_account_statements/${id}`, options);
|
|
31
37
|
}
|
|
32
38
|
}
|
|
@@ -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 {
|