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,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);
|
|
@@ -17,19 +17,25 @@ export class LedgerTransactions extends APIResource {
|
|
|
17
17
|
create(
|
|
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
|
|
|
29
35
|
/**
|
|
30
36
|
* Get details on a single ledger transaction.
|
|
31
37
|
*/
|
|
32
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
38
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerTransaction> {
|
|
33
39
|
return this.get(`/api/ledger_transactions/${id}`, options);
|
|
34
40
|
}
|
|
35
41
|
|
|
@@ -40,13 +46,13 @@ export class LedgerTransactions extends APIResource {
|
|
|
40
46
|
id: string,
|
|
41
47
|
body?: LedgerTransactionUpdateParams,
|
|
42
48
|
options?: Core.RequestOptions,
|
|
43
|
-
):
|
|
44
|
-
update(id: string, options?: Core.RequestOptions):
|
|
49
|
+
): Core.APIPromise<LedgerTransaction>;
|
|
50
|
+
update(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerTransaction>;
|
|
45
51
|
update(
|
|
46
52
|
id: string,
|
|
47
53
|
body: LedgerTransactionUpdateParams | Core.RequestOptions = {},
|
|
48
54
|
options?: Core.RequestOptions,
|
|
49
|
-
):
|
|
55
|
+
): Core.APIPromise<LedgerTransaction> {
|
|
50
56
|
if (isRequestOptions(body)) {
|
|
51
57
|
return this.update(id, {}, body);
|
|
52
58
|
}
|
|
@@ -59,12 +65,12 @@ export class LedgerTransactions extends APIResource {
|
|
|
59
65
|
list(
|
|
60
66
|
query?: LedgerTransactionListParams,
|
|
61
67
|
options?: Core.RequestOptions,
|
|
62
|
-
): Core.PagePromise<LedgerTransactionsPage>;
|
|
63
|
-
list(options?: Core.RequestOptions): Core.PagePromise<LedgerTransactionsPage>;
|
|
68
|
+
): Core.PagePromise<LedgerTransactionsPage, LedgerTransaction>;
|
|
69
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LedgerTransactionsPage, LedgerTransaction>;
|
|
64
70
|
list(
|
|
65
71
|
query: LedgerTransactionListParams | Core.RequestOptions = {},
|
|
66
72
|
options?: Core.RequestOptions,
|
|
67
|
-
): Core.PagePromise<LedgerTransactionsPage> {
|
|
73
|
+
): Core.PagePromise<LedgerTransactionsPage, LedgerTransaction> {
|
|
68
74
|
if (isRequestOptions(query)) {
|
|
69
75
|
return this.list({}, query);
|
|
70
76
|
}
|
|
@@ -75,23 +81,20 @@ export class LedgerTransactions extends APIResource {
|
|
|
75
81
|
* Create a ledger transaction reversal.
|
|
76
82
|
*/
|
|
77
83
|
createReversal(
|
|
78
|
-
|
|
84
|
+
id: string,
|
|
79
85
|
body?: LedgerTransactionCreateReversalParams,
|
|
80
86
|
options?: Core.RequestOptions,
|
|
81
|
-
):
|
|
82
|
-
createReversal(
|
|
83
|
-
ledgerTransactionId: string,
|
|
84
|
-
options?: Core.RequestOptions,
|
|
85
|
-
): Promise<Core.APIResponse<LedgerTransaction>>;
|
|
87
|
+
): Core.APIPromise<LedgerTransaction>;
|
|
88
|
+
createReversal(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerTransaction>;
|
|
86
89
|
createReversal(
|
|
87
|
-
|
|
90
|
+
id: string,
|
|
88
91
|
body: LedgerTransactionCreateReversalParams | Core.RequestOptions = {},
|
|
89
92
|
options?: Core.RequestOptions,
|
|
90
|
-
):
|
|
93
|
+
): Core.APIPromise<LedgerTransaction> {
|
|
91
94
|
if (isRequestOptions(body)) {
|
|
92
|
-
return this.createReversal(
|
|
95
|
+
return this.createReversal(id, {}, body);
|
|
93
96
|
}
|
|
94
|
-
return this.post(`/api/ledger_transactions/${
|
|
97
|
+
return this.post(`/api/ledger_transactions/${id}/reversal`, { body, ...options });
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
|
|
@@ -196,44 +199,43 @@ export interface LedgerTransaction {
|
|
|
196
199
|
|
|
197
200
|
export interface LedgerTransactionCreateParams {
|
|
198
201
|
/**
|
|
199
|
-
*
|
|
200
|
-
* happened for reporting purposes.
|
|
201
|
-
*/
|
|
202
|
-
effective_at: string;
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Body param: An array of ledger entry objects.
|
|
202
|
+
* An array of ledger entry objects.
|
|
206
203
|
*/
|
|
207
204
|
ledger_entries: Array<LedgerTransactionCreateParams.LedgerEntry>;
|
|
208
205
|
|
|
209
206
|
/**
|
|
210
|
-
*
|
|
207
|
+
* An optional description for internal use.
|
|
211
208
|
*/
|
|
212
209
|
description?: string | null;
|
|
213
210
|
|
|
214
211
|
/**
|
|
215
|
-
*
|
|
212
|
+
* The timestamp (ISO8601 format) at which the ledger transaction happened for
|
|
216
213
|
* reporting purposes.
|
|
217
214
|
*/
|
|
215
|
+
effective_at?: string;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* The date (YYYY-MM-DD) on which the ledger transaction happened for reporting
|
|
219
|
+
* purposes.
|
|
220
|
+
*/
|
|
218
221
|
effective_date?: string;
|
|
219
222
|
|
|
220
223
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
224
|
+
* A unique string to represent the ledger transaction. Only one pending or posted
|
|
225
|
+
* ledger transaction may have this ID in the ledger.
|
|
223
226
|
*/
|
|
224
227
|
external_id?: string;
|
|
225
228
|
|
|
226
229
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
230
|
+
* If the ledger transaction can be reconciled to another object in Modern
|
|
231
|
+
* Treasury, the id will be populated here, otherwise null.
|
|
229
232
|
*/
|
|
230
233
|
ledgerable_id?: string;
|
|
231
234
|
|
|
232
235
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
* 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.
|
|
237
239
|
*/
|
|
238
240
|
ledgerable_type?:
|
|
239
241
|
| 'counterparty'
|
|
@@ -248,21 +250,15 @@ export interface LedgerTransactionCreateParams {
|
|
|
248
250
|
| 'reversal';
|
|
249
251
|
|
|
250
252
|
/**
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
254
|
+
* strings.
|
|
253
255
|
*/
|
|
254
256
|
metadata?: Record<string, string>;
|
|
255
257
|
|
|
256
258
|
/**
|
|
257
|
-
*
|
|
259
|
+
* To post a ledger transaction at creation, use `posted`.
|
|
258
260
|
*/
|
|
259
261
|
status?: 'archived' | 'pending' | 'posted';
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Header param: This key should be something unique, preferably something like an
|
|
263
|
-
* UUID.
|
|
264
|
-
*/
|
|
265
|
-
'Idempotency-Key'?: string;
|
|
266
262
|
}
|
|
267
263
|
|
|
268
264
|
export namespace LedgerTransactionCreateParams {
|
|
@@ -301,6 +297,12 @@ export namespace LedgerTransactionCreateParams {
|
|
|
301
297
|
*/
|
|
302
298
|
lock_version?: number | null;
|
|
303
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
302
|
+
* strings.
|
|
303
|
+
*/
|
|
304
|
+
metadata?: Record<string, string>;
|
|
305
|
+
|
|
304
306
|
/**
|
|
305
307
|
* Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
306
308
|
* account’s pending balance. If any of these conditions would be false after the
|
|
@@ -329,6 +331,12 @@ export interface LedgerTransactionUpdateParams {
|
|
|
329
331
|
*/
|
|
330
332
|
description?: string | null;
|
|
331
333
|
|
|
334
|
+
/**
|
|
335
|
+
* The timestamp (ISO8601 format) at which the ledger transaction happened for
|
|
336
|
+
* reporting purposes.
|
|
337
|
+
*/
|
|
338
|
+
effective_at?: string;
|
|
339
|
+
|
|
332
340
|
/**
|
|
333
341
|
* An array of ledger entry objects.
|
|
334
342
|
*/
|
|
@@ -382,6 +390,12 @@ export namespace LedgerTransactionUpdateParams {
|
|
|
382
390
|
*/
|
|
383
391
|
lock_version?: number | null;
|
|
384
392
|
|
|
393
|
+
/**
|
|
394
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
395
|
+
* strings.
|
|
396
|
+
*/
|
|
397
|
+
metadata?: Record<string, string>;
|
|
398
|
+
|
|
385
399
|
/**
|
|
386
400
|
* Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
387
401
|
* account’s pending balance. If any of these conditions would be false after the
|
|
@@ -405,7 +419,11 @@ export namespace LedgerTransactionUpdateParams {
|
|
|
405
419
|
}
|
|
406
420
|
|
|
407
421
|
export interface LedgerTransactionListParams extends PageParams {
|
|
408
|
-
|
|
422
|
+
/**
|
|
423
|
+
* If you have specific IDs to retrieve in bulk, you can pass them as query
|
|
424
|
+
* parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
|
|
425
|
+
*/
|
|
426
|
+
id?: Array<string>;
|
|
409
427
|
|
|
410
428
|
/**
|
|
411
429
|
* Use "gt" (>), "gte" (>=), "lt" (<), "lte" (<=), or "eq" (=) to filter by
|
|
@@ -427,6 +445,8 @@ export interface LedgerTransactionListParams extends PageParams {
|
|
|
427
445
|
|
|
428
446
|
ledger_account_id?: string;
|
|
429
447
|
|
|
448
|
+
ledger_account_payout_id?: string;
|
|
449
|
+
|
|
430
450
|
ledger_id?: string;
|
|
431
451
|
|
|
432
452
|
ledgerable_id?: string;
|
|
@@ -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
|
/**
|
|
@@ -13,12 +13,14 @@ export class Versions extends APIResource {
|
|
|
13
13
|
list(
|
|
14
14
|
query?: VersionListParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
|
-
): Core.PagePromise<LedgerTransactionVersionsPage>;
|
|
17
|
-
list(
|
|
16
|
+
): Core.PagePromise<LedgerTransactionVersionsPage, LedgerTransactionVersion>;
|
|
17
|
+
list(
|
|
18
|
+
options?: Core.RequestOptions,
|
|
19
|
+
): Core.PagePromise<LedgerTransactionVersionsPage, LedgerTransactionVersion>;
|
|
18
20
|
list(
|
|
19
21
|
query: VersionListParams | Core.RequestOptions = {},
|
|
20
22
|
options?: Core.RequestOptions,
|
|
21
|
-
): Core.PagePromise<LedgerTransactionVersionsPage> {
|
|
23
|
+
): Core.PagePromise<LedgerTransactionVersionsPage, LedgerTransactionVersion> {
|
|
22
24
|
if (isRequestOptions(query)) {
|
|
23
25
|
return this.list({}, query);
|
|
24
26
|
}
|
|
@@ -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
|
/**
|
|
@@ -12,19 +12,25 @@ export class LedgerableEvents extends APIResource {
|
|
|
12
12
|
create(
|
|
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
|
|
|
24
30
|
/**
|
|
25
31
|
* Get details on a single ledgerable event.
|
|
26
32
|
*/
|
|
27
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
33
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<LedgerableEvent> {
|
|
28
34
|
return this.get(`/api/ledgerable_events/${id}`, options);
|
|
29
35
|
}
|
|
30
36
|
}
|
|
@@ -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,45 +1,47 @@
|
|
|
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
|
-
create(params: LedgerCreateParams, options?: Core.RequestOptions):
|
|
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
|
|
|
22
28
|
/**
|
|
23
29
|
* Get details on a single ledger.
|
|
24
30
|
*/
|
|
25
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
31
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Ledger> {
|
|
26
32
|
return this.get(`/api/ledgers/${id}`, options);
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* Update the details of a ledger.
|
|
31
37
|
*/
|
|
32
|
-
update(
|
|
33
|
-
|
|
34
|
-
body?: LedgerUpdateParams,
|
|
35
|
-
options?: Core.RequestOptions,
|
|
36
|
-
): Promise<Core.APIResponse<Ledger>>;
|
|
37
|
-
update(id: string, options?: Core.RequestOptions): Promise<Core.APIResponse<Ledger>>;
|
|
38
|
+
update(id: string, body?: LedgerUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Ledger>;
|
|
39
|
+
update(id: string, options?: Core.RequestOptions): Core.APIPromise<Ledger>;
|
|
38
40
|
update(
|
|
39
41
|
id: string,
|
|
40
42
|
body: LedgerUpdateParams | Core.RequestOptions = {},
|
|
41
43
|
options?: Core.RequestOptions,
|
|
42
|
-
):
|
|
44
|
+
): Core.APIPromise<Ledger> {
|
|
43
45
|
if (isRequestOptions(body)) {
|
|
44
46
|
return this.update(id, {}, body);
|
|
45
47
|
}
|
|
@@ -49,12 +51,12 @@ export class Ledgers extends APIResource {
|
|
|
49
51
|
/**
|
|
50
52
|
* Get a list of ledgers.
|
|
51
53
|
*/
|
|
52
|
-
list(query?: LedgerListParams, options?: Core.RequestOptions): Core.PagePromise<LedgersPage>;
|
|
53
|
-
list(options?: Core.RequestOptions): Core.PagePromise<LedgersPage>;
|
|
54
|
+
list(query?: LedgerListParams, options?: Core.RequestOptions): Core.PagePromise<LedgersPage, Ledger>;
|
|
55
|
+
list(options?: Core.RequestOptions): Core.PagePromise<LedgersPage, Ledger>;
|
|
54
56
|
list(
|
|
55
57
|
query: LedgerListParams | Core.RequestOptions = {},
|
|
56
58
|
options?: Core.RequestOptions,
|
|
57
|
-
): Core.PagePromise<LedgersPage> {
|
|
59
|
+
): Core.PagePromise<LedgersPage, Ledger> {
|
|
58
60
|
if (isRequestOptions(query)) {
|
|
59
61
|
return this.list({}, query);
|
|
60
62
|
}
|
|
@@ -64,7 +66,7 @@ export class Ledgers extends APIResource {
|
|
|
64
66
|
/**
|
|
65
67
|
* Delete a ledger.
|
|
66
68
|
*/
|
|
67
|
-
del(id: string, options?: Core.RequestOptions):
|
|
69
|
+
del(id: string, options?: Core.RequestOptions): Core.APIPromise<Ledger> {
|
|
68
70
|
return this.delete(`/api/ledgers/${id}`, options);
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -110,26 +112,20 @@ export interface Ledger {
|
|
|
110
112
|
|
|
111
113
|
export interface LedgerCreateParams {
|
|
112
114
|
/**
|
|
113
|
-
*
|
|
115
|
+
* The name of the ledger.
|
|
114
116
|
*/
|
|
115
117
|
name: string;
|
|
116
118
|
|
|
117
119
|
/**
|
|
118
|
-
*
|
|
120
|
+
* An optional free-form description for internal use.
|
|
119
121
|
*/
|
|
120
122
|
description?: string | null;
|
|
121
123
|
|
|
122
124
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
126
|
+
* strings.
|
|
125
127
|
*/
|
|
126
128
|
metadata?: Record<string, string>;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Header param: This key should be something unique, preferably something like an
|
|
130
|
-
* UUID.
|
|
131
|
-
*/
|
|
132
|
-
'Idempotency-Key'?: string;
|
|
133
129
|
}
|
|
134
130
|
|
|
135
131
|
export interface LedgerUpdateParams {
|
|
@@ -151,6 +147,12 @@ export interface LedgerUpdateParams {
|
|
|
151
147
|
}
|
|
152
148
|
|
|
153
149
|
export interface LedgerListParams extends PageParams {
|
|
150
|
+
/**
|
|
151
|
+
* If you have specific IDs to retrieve in bulk, you can pass them as query
|
|
152
|
+
* parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`.
|
|
153
|
+
*/
|
|
154
|
+
id?: Array<string>;
|
|
155
|
+
|
|
154
156
|
/**
|
|
155
157
|
* For example, if you want to query for records with metadata key `Type` and value
|
|
156
158
|
* `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
|
|
@@ -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,7 +15,7 @@ export class LineItems extends APIResource {
|
|
|
15
15
|
itemizableId: string,
|
|
16
16
|
id: string,
|
|
17
17
|
options?: Core.RequestOptions,
|
|
18
|
-
):
|
|
18
|
+
): Core.APIPromise<LineItem> {
|
|
19
19
|
return this.get(`/api/${itemizableType}/${itemizableId}/line_items/${id}`, options);
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -28,20 +28,20 @@ export class LineItems extends APIResource {
|
|
|
28
28
|
id: string,
|
|
29
29
|
body?: LineItemUpdateParams,
|
|
30
30
|
options?: Core.RequestOptions,
|
|
31
|
-
):
|
|
31
|
+
): Core.APIPromise<LineItem>;
|
|
32
32
|
update(
|
|
33
33
|
itemizableType: 'expected_payments' | 'payment_orders',
|
|
34
34
|
itemizableId: string,
|
|
35
35
|
id: string,
|
|
36
36
|
options?: Core.RequestOptions,
|
|
37
|
-
):
|
|
37
|
+
): Core.APIPromise<LineItem>;
|
|
38
38
|
update(
|
|
39
39
|
itemizableType: 'expected_payments' | 'payment_orders',
|
|
40
40
|
itemizableId: string,
|
|
41
41
|
id: string,
|
|
42
42
|
body: LineItemUpdateParams | Core.RequestOptions = {},
|
|
43
43
|
options?: Core.RequestOptions,
|
|
44
|
-
):
|
|
44
|
+
): Core.APIPromise<LineItem> {
|
|
45
45
|
if (isRequestOptions(body)) {
|
|
46
46
|
return this.update(itemizableType, itemizableId, id, {}, body);
|
|
47
47
|
}
|
|
@@ -56,18 +56,18 @@ export class LineItems extends APIResource {
|
|
|
56
56
|
itemizableId: string,
|
|
57
57
|
query?: LineItemListParams,
|
|
58
58
|
options?: Core.RequestOptions,
|
|
59
|
-
): Core.PagePromise<LineItemsPage>;
|
|
59
|
+
): Core.PagePromise<LineItemsPage, LineItem>;
|
|
60
60
|
list(
|
|
61
61
|
itemizableType: 'expected_payments' | 'payment_orders',
|
|
62
62
|
itemizableId: string,
|
|
63
63
|
options?: Core.RequestOptions,
|
|
64
|
-
): Core.PagePromise<LineItemsPage>;
|
|
64
|
+
): Core.PagePromise<LineItemsPage, LineItem>;
|
|
65
65
|
list(
|
|
66
66
|
itemizableType: 'expected_payments' | 'payment_orders',
|
|
67
67
|
itemizableId: string,
|
|
68
68
|
query: LineItemListParams | Core.RequestOptions = {},
|
|
69
69
|
options?: Core.RequestOptions,
|
|
70
|
-
): Core.PagePromise<LineItemsPage> {
|
|
70
|
+
): Core.PagePromise<LineItemsPage, LineItem> {
|
|
71
71
|
if (isRequestOptions(query)) {
|
|
72
72
|
return this.list(itemizableType, itemizableId, {}, query);
|
|
73
73
|
}
|
|
@@ -1,29 +1,32 @@
|
|
|
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
|
/**
|
|
12
12
|
* Get details on a single paper item.
|
|
13
13
|
*/
|
|
14
|
-
retrieve(id: string, options?: Core.RequestOptions):
|
|
14
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<PaperItem> {
|
|
15
15
|
return this.get(`/api/paper_items/${id}`, options);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Get a list of all paper items.
|
|
20
20
|
*/
|
|
21
|
-
list(
|
|
22
|
-
|
|
21
|
+
list(
|
|
22
|
+
query?: PaperItemListParams,
|
|
23
|
+
options?: Core.RequestOptions,
|
|
24
|
+
): Core.PagePromise<PaperItemsPage, PaperItem>;
|
|
25
|
+
list(options?: Core.RequestOptions): Core.PagePromise<PaperItemsPage, PaperItem>;
|
|
23
26
|
list(
|
|
24
27
|
query: PaperItemListParams | Core.RequestOptions = {},
|
|
25
28
|
options?: Core.RequestOptions,
|
|
26
|
-
): Core.PagePromise<PaperItemsPage> {
|
|
29
|
+
): Core.PagePromise<PaperItemsPage, PaperItem> {
|
|
27
30
|
if (isRequestOptions(query)) {
|
|
28
31
|
return this.list({}, query);
|
|
29
32
|
}
|