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,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
import { APIResource } from 'modern-treasury/resource';
|
|
3
|
-
import { isRequestOptions } from 'modern-treasury/core';
|
|
4
|
-
import { Page } from 'modern-treasury/pagination';
|
|
2
|
+
import { APIResource } from 'modern-treasury/resource.mjs';
|
|
3
|
+
import { isRequestOptions } from 'modern-treasury/core.mjs';
|
|
4
|
+
import { Page } from 'modern-treasury/pagination.mjs';
|
|
5
5
|
export class LineItems extends APIResource {
|
|
6
6
|
list(transactionId, query = {}, options) {
|
|
7
7
|
if (isRequestOptions(query)) {
|
|
@@ -42,11 +42,11 @@ var __importStar =
|
|
|
42
42
|
};
|
|
43
43
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
44
44
|
exports.TransactionsPage = exports.Transactions = void 0;
|
|
45
|
-
const resource_1 = require('modern-treasury/resource');
|
|
46
|
-
const core_1 = require('modern-treasury/core');
|
|
45
|
+
const resource_1 = require('modern-treasury/resource.js');
|
|
46
|
+
const core_1 = require('modern-treasury/core.js');
|
|
47
47
|
const line_items_1 = require('./line-items.js');
|
|
48
48
|
const API = __importStar(require('./index.js'));
|
|
49
|
-
const pagination_1 = require('modern-treasury/pagination');
|
|
49
|
+
const pagination_1 = require('modern-treasury/pagination.js');
|
|
50
50
|
class Transactions extends resource_1.APIResource {
|
|
51
51
|
constructor() {
|
|
52
52
|
super(...arguments);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
import { APIResource } from 'modern-treasury/resource';
|
|
3
|
-
import { isRequestOptions } from 'modern-treasury/core';
|
|
2
|
+
import { APIResource } from 'modern-treasury/resource.mjs';
|
|
3
|
+
import { isRequestOptions } from 'modern-treasury/core.mjs';
|
|
4
4
|
import { LineItems } from './line-items.mjs';
|
|
5
5
|
import * as API from './index.mjs';
|
|
6
|
-
import { Page } from 'modern-treasury/pagination';
|
|
6
|
+
import { Page } from 'modern-treasury/pagination.mjs';
|
|
7
7
|
export class Transactions extends APIResource {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
package/resources/validations.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
exports.Validations = void 0;
|
|
5
|
-
const resource_1 = require('modern-treasury/resource');
|
|
5
|
+
const resource_1 = require('modern-treasury/resource.js');
|
|
6
6
|
class Validations extends resource_1.APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Validates the routing number information supplied without creating a routing
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
import { APIResource } from 'modern-treasury/resource';
|
|
2
|
+
import { APIResource } from 'modern-treasury/resource.mjs';
|
|
3
3
|
export class Validations extends APIResource {
|
|
4
4
|
/**
|
|
5
5
|
* Validates the routing number information supplied without creating a routing
|
|
@@ -93,52 +93,46 @@ export interface VirtualAccount {
|
|
|
93
93
|
}
|
|
94
94
|
export interface VirtualAccountCreateParams {
|
|
95
95
|
/**
|
|
96
|
-
*
|
|
97
|
-
* associated with.
|
|
96
|
+
* The ID of the internal account that this virtual account is associated with.
|
|
98
97
|
*/
|
|
99
98
|
internal_account_id: string;
|
|
100
99
|
/**
|
|
101
|
-
*
|
|
100
|
+
* The name of the virtual account.
|
|
102
101
|
*/
|
|
103
102
|
name: string;
|
|
104
103
|
/**
|
|
105
|
-
*
|
|
104
|
+
* An array of account detail objects.
|
|
106
105
|
*/
|
|
107
106
|
account_details?: Array<VirtualAccountCreateParams.AccountDetail>;
|
|
108
107
|
/**
|
|
109
|
-
*
|
|
108
|
+
* The ID of the counterparty that the virtual account belongs to.
|
|
110
109
|
*/
|
|
111
110
|
counterparty_id?: string;
|
|
112
111
|
/**
|
|
113
|
-
*
|
|
114
|
-
*
|
|
112
|
+
* The ID of a credit normal ledger account. When money leaves the virtual account,
|
|
113
|
+
* this ledger account will be credited. Must be accompanied by a
|
|
115
114
|
* debit_ledger_account_id if present.
|
|
116
115
|
*/
|
|
117
116
|
credit_ledger_account_id?: string;
|
|
118
117
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
118
|
+
* The ID of a debit normal ledger account. When money enters the virtual account,
|
|
119
|
+
* this ledger account will be debited. Must be accompanied by a
|
|
121
120
|
* credit_ledger_account_id if present.
|
|
122
121
|
*/
|
|
123
122
|
debit_ledger_account_id?: string;
|
|
124
123
|
/**
|
|
125
|
-
*
|
|
124
|
+
* An optional description for internal use.
|
|
126
125
|
*/
|
|
127
126
|
description?: string;
|
|
128
127
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
128
|
+
* Additional data represented as key-value pairs. Both the key and value must be
|
|
129
|
+
* strings.
|
|
131
130
|
*/
|
|
132
131
|
metadata?: Record<string, string>;
|
|
133
132
|
/**
|
|
134
|
-
*
|
|
133
|
+
* An array of routing detail objects.
|
|
135
134
|
*/
|
|
136
135
|
routing_details?: Array<VirtualAccountCreateParams.RoutingDetail>;
|
|
137
|
-
/**
|
|
138
|
-
* Header param: This key should be something unique, preferably something like an
|
|
139
|
-
* UUID.
|
|
140
|
-
*/
|
|
141
|
-
'Idempotency-Key'?: string;
|
|
142
136
|
}
|
|
143
137
|
export declare namespace VirtualAccountCreateParams {
|
|
144
138
|
interface AccountDetail {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-accounts.d.ts","sourceRoot":"","sources":["../src/resources/virtual-accounts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,KAAK,cAAc,MAAM,2CAA2C,CAAC;AAC5E,OAAO,KAAK,cAAc,MAAM,2CAA2C,CAAC;AAC5E,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE9D,qBAAa,eAAgB,SAAQ,WAAW;IAC9C;;OAEG;IACH,MAAM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AC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,yBAAiB,eAAe,CAAC;IAC/B,MAAM,QAAQ,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;IAClD,KAAY,mBAAmB,GAAG,oBAAoB,CAAC;IACvD,MAAM,QAAQ,0BAA0B,GAAG,GAAG,CAAC,0BAA0B,CAAC;IAC1E,MAAM,QAAQ,0BAA0B,GAAG,GAAG,CAAC,0BAA0B,CAAC;IAC1E,MAAM,QAAQ,wBAAwB,GAAG,GAAG,CAAC,wBAAwB,CAAC;CACvE"}
|
|
@@ -2,20 +2,26 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
exports.VirtualAccountsPage = exports.VirtualAccounts = void 0;
|
|
5
|
-
const resource_1 = require('modern-treasury/resource');
|
|
6
|
-
const core_1 = require('modern-treasury/core');
|
|
7
|
-
const pagination_1 = require('modern-treasury/pagination');
|
|
5
|
+
const resource_1 = require('modern-treasury/resource.js');
|
|
6
|
+
const core_1 = require('modern-treasury/core.js');
|
|
7
|
+
const pagination_1 = require('modern-treasury/pagination.js');
|
|
8
8
|
class VirtualAccounts extends resource_1.APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* create virtual_account
|
|
11
11
|
*/
|
|
12
12
|
create(params, options) {
|
|
13
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
13
14
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
15
|
+
if (idempotencyKey) {
|
|
16
|
+
console.warn(
|
|
17
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
18
|
+
);
|
|
19
|
+
}
|
|
14
20
|
return this.post('/api/virtual_accounts', {
|
|
15
21
|
body,
|
|
16
22
|
...options,
|
|
17
23
|
headers: {
|
|
18
|
-
'Idempotency-Key': idempotencyKey
|
|
24
|
+
'Idempotency-Key': idempotencyKey,
|
|
19
25
|
...(options === null || options === void 0 ? void 0 : options.headers),
|
|
20
26
|
},
|
|
21
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-accounts.js","sourceRoot":"","sources":["../src/resources/virtual-accounts.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,uDAAuD;AACvD,+CAAwD;AAIxD,2DAA8D;AAE9D,MAAa,eAAgB,SAAQ,sBAAW;IAC9C;;OAEG;IACH,MAAM,CAAC,MAAkC,EAAE,OAA6B;QACtE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE;YACxC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,iBAAiB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"virtual-accounts.js","sourceRoot":"","sources":["../src/resources/virtual-accounts.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,uDAAuD;AACvD,+CAAwD;AAIxD,2DAA8D;AAE9D,MAAa,eAAgB,SAAQ,sBAAW;IAC9C;;OAEG;IACH,MAAM,CAAC,MAAkC,EAAE,OAA6B;QACtE,qGAAqG;QACrG,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC9D,IAAI,cAAc,EAAE;YAClB,OAAO,CAAC,IAAI,CACV,sGAAsG,CACvG,CAAC;SACH;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,uBA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
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
import { APIResource } from 'modern-treasury/resource';
|
|
3
|
-
import { isRequestOptions } from 'modern-treasury/core';
|
|
4
|
-
import { Page } from 'modern-treasury/pagination';
|
|
2
|
+
import { APIResource } from 'modern-treasury/resource.mjs';
|
|
3
|
+
import { isRequestOptions } from 'modern-treasury/core.mjs';
|
|
4
|
+
import { Page } from 'modern-treasury/pagination.mjs';
|
|
5
5
|
export class VirtualAccounts extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* create virtual_account
|
|
8
8
|
*/
|
|
9
9
|
create(params, options) {
|
|
10
|
+
// @ts-expect-error idempotency key header isn't defined anymore but is included here for back-compat
|
|
10
11
|
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
12
|
+
if (idempotencyKey) {
|
|
13
|
+
console.warn(
|
|
14
|
+
"The Idempotency-Key request param is deprecated, the 'idempotencyToken' option should be set instead",
|
|
15
|
+
);
|
|
16
|
+
}
|
|
11
17
|
return this.post('/api/virtual_accounts', {
|
|
12
18
|
body,
|
|
13
19
|
...options,
|
|
14
20
|
headers: {
|
|
15
|
-
'Idempotency-Key': idempotencyKey
|
|
21
|
+
'Idempotency-Key': idempotencyKey,
|
|
16
22
|
...(options === null || options === void 0 ? void 0 : options.headers),
|
|
17
23
|
},
|
|
18
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-accounts.mjs","sourceRoot":"","sources":["../src/resources/virtual-accounts.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,0BAA0B;OAC/C,EAAE,gBAAgB,EAAE,MAAM,sBAAsB;OAIhD,EAAE,IAAI,EAAc,MAAM,4BAA4B;AAE7D,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C;;OAEG;IACH,MAAM,CAAC,MAAkC,EAAE,OAA6B;QACtE,MAAM,EAAE,iBAAiB,EA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AC,KAAK,CAAC,yBAAyB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAUD,IAAI,CACF,QAAwD,EAAE,EAC1D,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,EAAE,mBAAmB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,EAAU,EAAE,OAA6B;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,yBAAyB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,IAAoB;CAAG;AA+MhE,WAAiB,eAAe;AAMhC,CAAC,EANgB,eAAe,KAAf,eAAe,QAM/B"}
|
package/resources/webhooks.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
exports.Webhooks = void 0;
|
|
5
|
-
const resource_1 = require('modern-treasury/resource');
|
|
5
|
+
const resource_1 = require('modern-treasury/resource.js');
|
|
6
6
|
const crypto_1 = require('crypto');
|
|
7
|
-
const core_1 = require('modern-treasury/core');
|
|
7
|
+
const core_1 = require('modern-treasury/core.js');
|
|
8
8
|
class Webhooks extends resource_1.APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* To verify that a webhook was actually sent by Modern Treasury, every payload is
|
package/resources/webhooks.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
|
-
import { APIResource } from 'modern-treasury/resource';
|
|
2
|
+
import { APIResource } from 'modern-treasury/resource.mjs';
|
|
3
3
|
import { createHmac } from 'crypto';
|
|
4
|
-
import { getHeader } from 'modern-treasury/core';
|
|
4
|
+
import { getHeader } from 'modern-treasury/core.mjs';
|
|
5
5
|
export class Webhooks extends APIResource {
|
|
6
6
|
/**
|
|
7
7
|
* To verify that a webhook was actually sent by Modern Treasury, every payload is
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
// @ts-ignore
|
|
14
|
-
type _ReadableStream<R = any> =
|
|
14
|
+
type _ReadableStream<R = any> = ReadableStream<R>;
|
|
15
15
|
declare const _ReadableStream: {
|
|
16
16
|
prototype: _ReadableStream;
|
|
17
17
|
new (
|
|
@@ -26,13 +26,13 @@ declare const _ReadableStream: {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
// @ts-ignore
|
|
29
|
-
type _UnderlyingSource<R = any> =
|
|
29
|
+
type _UnderlyingSource<R = any> = UnderlyingSource<R>;
|
|
30
30
|
// @ts-ignore
|
|
31
|
-
type _UnderlyingByteSource =
|
|
31
|
+
type _UnderlyingByteSource = UnderlyingByteSource;
|
|
32
32
|
type _UnderlyingDefaultSource<R = any> =
|
|
33
33
|
// @ts-ignore
|
|
34
|
-
|
|
34
|
+
UnderlyingDefaultSource<R>;
|
|
35
35
|
// @ts-ignore
|
|
36
|
-
type _QueuingStrategy<R = any> =
|
|
36
|
+
type _QueuingStrategy<R = any> = QueuingStrategy<R>;
|
|
37
37
|
|
|
38
38
|
export { _ReadableStream as ReadableStream };
|
package/src/_shims/agent.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*
|
|
4
4
|
* This is a stub for non-node environments.
|
|
5
|
-
* In node environments, it gets replaced agent
|
|
5
|
+
* In node environments, it gets replaced agent-node.ts by the package export map
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export type Agent = any;
|
|
@@ -17,26 +17,26 @@ import * as nf from 'node-fetch';
|
|
|
17
17
|
// @ts-ignore
|
|
18
18
|
type _fetch = unknown extends typeof fetch ? typeof nf.default : typeof fetch;
|
|
19
19
|
// @ts-ignore
|
|
20
|
-
type _Request =
|
|
20
|
+
type _Request = Request;
|
|
21
21
|
// @ts-ignore
|
|
22
|
-
type _RequestInfo =
|
|
22
|
+
type _RequestInfo = RequestInfo;
|
|
23
23
|
// @ts-ignore
|
|
24
|
-
type _RequestInit =
|
|
24
|
+
type _RequestInit = RequestInit;
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
type _Response =
|
|
26
|
+
type _Response = Response;
|
|
27
27
|
// @ts-ignore
|
|
28
|
-
type _ResponseInit =
|
|
28
|
+
type _ResponseInit = ResponseInit;
|
|
29
29
|
type _ResponseType =
|
|
30
30
|
// @ts-ignore
|
|
31
31
|
unknown extends ResponseType ? 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'
|
|
32
32
|
: // @ts-ignore
|
|
33
33
|
ResponseType;
|
|
34
34
|
// @ts-ignore
|
|
35
|
-
type _BodyInit =
|
|
35
|
+
type _BodyInit = BodyInit;
|
|
36
36
|
// @ts-ignore
|
|
37
|
-
type _Headers =
|
|
37
|
+
type _Headers = Headers;
|
|
38
38
|
// @ts-ignore
|
|
39
|
-
type _HeadersInit =
|
|
39
|
+
type _HeadersInit = HeadersInit;
|
|
40
40
|
|
|
41
41
|
declare const _fetch: _fetch;
|
|
42
42
|
declare const _Request: {
|
|
@@ -60,4 +60,5 @@ export type {
|
|
|
60
60
|
_RequestInfo as RequestInfo,
|
|
61
61
|
_ResponseType as ResponseType,
|
|
62
62
|
_BodyInit as BodyInit,
|
|
63
|
+
_HeadersInit as HeadersInit,
|
|
63
64
|
};
|
package/src/_shims/fetch.d.ts
CHANGED
|
@@ -14,25 +14,25 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
// @ts-ignore
|
|
17
|
-
type _fetch =
|
|
17
|
+
type _fetch = typeof fetch;
|
|
18
18
|
// @ts-ignore
|
|
19
|
-
type _Request =
|
|
19
|
+
type _Request = Request;
|
|
20
20
|
// @ts-ignore
|
|
21
|
-
type _RequestInfo =
|
|
21
|
+
type _RequestInfo = RequestInfo;
|
|
22
22
|
// @ts-ignore
|
|
23
|
-
type _RequestInit =
|
|
23
|
+
type _RequestInit = RequestInit;
|
|
24
24
|
// @ts-ignore
|
|
25
|
-
type _Response =
|
|
25
|
+
type _Response = Response;
|
|
26
26
|
// @ts-ignore
|
|
27
|
-
type _ResponseInit =
|
|
27
|
+
type _ResponseInit = ResponseInit;
|
|
28
28
|
// @ts-ignore
|
|
29
|
-
type _ResponseType =
|
|
29
|
+
type _ResponseType = ResponseType;
|
|
30
30
|
// @ts-ignore
|
|
31
|
-
type _BodyInit =
|
|
31
|
+
type _BodyInit = BodyInit;
|
|
32
32
|
// @ts-ignore
|
|
33
|
-
type _Headers =
|
|
33
|
+
type _Headers = Headers;
|
|
34
34
|
// @ts-ignore
|
|
35
|
-
type _HeadersInit =
|
|
35
|
+
type _HeadersInit = HeadersInit;
|
|
36
36
|
|
|
37
37
|
declare const _fetch: _fetch;
|
|
38
38
|
declare const _Request: {
|
|
@@ -56,4 +56,5 @@ export type {
|
|
|
56
56
|
_RequestInfo as RequestInfo,
|
|
57
57
|
_ResponseType as ResponseType,
|
|
58
58
|
_BodyInit as BodyInit,
|
|
59
|
+
_HeadersInit as HeadersInit,
|
|
59
60
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { fileFromPath as _fileFromPath } from 'formdata-node/file-from-path';
|
|
6
|
-
import type { File, FilePropertyBag } from './
|
|
6
|
+
import type { File, FilePropertyBag } from './form-data-node.js';
|
|
7
7
|
|
|
8
8
|
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
9
9
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*
|
|
4
|
-
* This is a stub that gets replaced by fileFromPath
|
|
4
|
+
* This is a stub that gets replaced by fileFromPath-node.js for node environments
|
|
5
5
|
* in the package export map
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { FilePropertyBag, File } from './
|
|
8
|
+
import type { FilePropertyBag, File } from './form-data.js';
|
|
9
9
|
|
|
10
10
|
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
11
11
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as fd from 'formdata-node';
|
|
6
6
|
|
|
7
|
-
import type { BlobPart } from '../uploads';
|
|
7
|
+
import type { BlobPart } from '../uploads.js';
|
|
8
8
|
|
|
9
9
|
type EndingType = 'native' | 'transparent';
|
|
10
10
|
|
|
@@ -21,11 +21,11 @@ export interface FilePropertyBag extends BlobPropertyBag {
|
|
|
21
21
|
// Use builtin web types if present; else formdata-node types
|
|
22
22
|
|
|
23
23
|
// @ts-ignore
|
|
24
|
-
type _FormData =
|
|
24
|
+
type _FormData = FormData;
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
type _File =
|
|
26
|
+
type _File = File;
|
|
27
27
|
// @ts-ignore
|
|
28
|
-
type _Blob =
|
|
28
|
+
type _Blob = Blob;
|
|
29
29
|
|
|
30
30
|
declare const _FormData: {
|
|
31
31
|
new (form?: any): _FormData;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type { BlobPart } from '../uploads';
|
|
5
|
+
import type { BlobPart } from '../uploads.js';
|
|
6
6
|
|
|
7
7
|
type EndingType = 'native' | 'transparent';
|
|
8
8
|
|
|
@@ -19,11 +19,11 @@ export interface FilePropertyBag extends BlobPropertyBag {
|
|
|
19
19
|
// add appropriate lib or types to tsconfig)
|
|
20
20
|
|
|
21
21
|
// @ts-ignore
|
|
22
|
-
type _FormData =
|
|
22
|
+
type _FormData = FormData;
|
|
23
23
|
// @ts-ignore
|
|
24
|
-
type _File =
|
|
24
|
+
type _File = File;
|
|
25
25
|
// @ts-ignore
|
|
26
|
-
type _Blob =
|
|
26
|
+
type _Blob = Blob;
|
|
27
27
|
|
|
28
28
|
declare const _FormData: {
|
|
29
29
|
new (form?: any): _FormData;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
exports.FormData = FormData;
|
|
6
|
+
exports.Blob = Blob;
|
|
7
|
+
exports.File =
|
|
8
|
+
typeof File !== 'undefined' ? File : (
|
|
9
|
+
// Bun doesn't implement File yet, so just make a shim that throws a helpful error message
|
|
10
|
+
class File extends Blob {
|
|
11
|
+
constructor() {
|
|
12
|
+
throw new Error(`file uploads aren't supported in this environment yet as 'File' is not defined`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
exports.isPolyfilled = false;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const _FormData = FormData;
|
|
6
|
+
const _Blob = Blob;
|
|
7
|
+
|
|
8
|
+
const _File =
|
|
9
|
+
typeof File !== 'undefined' ? File : (
|
|
10
|
+
// Bun doesn't implement File yet, so just make a shim that throws a helpful error message
|
|
11
|
+
class File extends Blob {
|
|
12
|
+
constructor() {
|
|
13
|
+
throw new Error(`file uploads aren't supported in this environment yet as 'File' is not defined`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export { _FormData as FormData, _File as File, _Blob as Blob };
|
|
19
|
+
|
|
20
|
+
export const isPolyfilled = false;
|
package/src/_shims/{getMultipartRequestOptions.node.ts → getMultipartRequestOptions-node.ts}
RENAMED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { FormData } from './
|
|
6
|
-
import type { RequestOptions } from '../core';
|
|
5
|
+
import { FormData } from './form-data-node.js';
|
|
6
|
+
import type { RequestOptions } from '../core.js';
|
|
7
7
|
import { Readable } from 'node:stream';
|
|
8
8
|
import { FormDataEncoder } from 'form-data-encoder';
|
|
9
|
-
import { MultipartBody } from '../uploads';
|
|
9
|
+
import { MultipartBody } from '../uploads.js';
|
|
10
10
|
|
|
11
11
|
export async function getMultipartRequestOptions<T extends {} = Record<string, unknown>>(
|
|
12
12
|
form: FormData,
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { FormData } from './
|
|
6
|
-
import type { RequestOptions } from '../core';
|
|
7
|
-
import { MultipartBody } from '../uploads';
|
|
5
|
+
import { FormData } from './form-data.js';
|
|
6
|
+
import type { RequestOptions } from '../core.js';
|
|
7
|
+
import { MultipartBody } from '../uploads.js';
|
|
8
8
|
|
|
9
9
|
export async function getMultipartRequestOptions<T extends {} = Record<string, unknown>>(
|
|
10
10
|
form: FormData,
|