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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.4.0 (2023-09-05)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.3.0...v2.4.0](https://github.com/Modern-Treasury/modern-treasury-node/compare/v2.3.0...v2.4.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **client:** improve compatibility with Bun ([#204](https://github.com/Modern-Treasury/modern-treasury-node/issues/204)) ([1248e3a](https://github.com/Modern-Treasury/modern-treasury-node/commit/1248e3afb21ce1a2cdf1524094f4a2ecd4718c45))
|
|
10
|
+
* **docs:** add documentation to the client constructor ([#203](https://github.com/Modern-Treasury/modern-treasury-node/issues/203)) ([e558d7b](https://github.com/Modern-Treasury/modern-treasury-node/commit/e558d7b0fcaa7cd3be30b224058d56c3b3f4e882))
|
|
11
|
+
* **package:** add Bun export map ([#215](https://github.com/Modern-Treasury/modern-treasury-node/issues/215)) ([e796a08](https://github.com/Modern-Treasury/modern-treasury-node/commit/e796a0801f5b6d18d9b3fc67db290af0e67fbb23))
|
|
12
|
+
* **types:** export RequestOptions type ([#209](https://github.com/Modern-Treasury/modern-treasury-node/issues/209)) ([0b46351](https://github.com/Modern-Treasury/modern-treasury-node/commit/0b463516c8fe941cb66adb56ab9f922e43ffeca8))
|
|
13
|
+
* **types:** remove incorrectly included Idempotency-Key param ([#218](https://github.com/Modern-Treasury/modern-treasury-node/issues/218)) ([905b43e](https://github.com/Modern-Treasury/modern-treasury-node/commit/905b43e16f599be6ec6f542da435ea68ecca5334))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **client:** fix TS errors that appear when users Go to Source in VSCode ([#219](https://github.com/Modern-Treasury/modern-treasury-node/issues/219)) ([de2b2a1](https://github.com/Modern-Treasury/modern-treasury-node/commit/de2b2a17f7b5d2ae7c8af4154fca52c371cfa9a2))
|
|
19
|
+
* **client:** fix TypeError when a request gets retried ([#201](https://github.com/Modern-Treasury/modern-treasury-node/issues/201)) ([ad59570](https://github.com/Modern-Treasury/modern-treasury-node/commit/ad59570a2801c4d393b3802decd880e1743f05a7))
|
|
20
|
+
* **client:** handle case where the client is instantiated with a undefined baseURL ([#220](https://github.com/Modern-Treasury/modern-treasury-node/issues/220)) ([894890e](https://github.com/Modern-Treasury/modern-treasury-node/commit/894890e6c584c607092f71eeb9ad31a2fa5e3706))
|
|
21
|
+
* **client:** use explicit file extensions in _shims imports ([#217](https://github.com/Modern-Treasury/modern-treasury-node/issues/217)) ([15df031](https://github.com/Modern-Treasury/modern-treasury-node/commit/15df03142c07c7ab1d2a0d983df67c8fb23bbdeb))
|
|
22
|
+
* **core:** fix navigator check for strange environments ([#207](https://github.com/Modern-Treasury/modern-treasury-node/issues/207)) ([2b6e569](https://github.com/Modern-Treasury/modern-treasury-node/commit/2b6e5695c924f779825de7464c3d9aba821ab266))
|
|
23
|
+
* **types:** improve getNextPage() return type ([#214](https://github.com/Modern-Treasury/modern-treasury-node/issues/214)) ([eb7e51f](https://github.com/Modern-Treasury/modern-treasury-node/commit/eb7e51fbf51ce3771a382cee983f540c089bea18))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Chores
|
|
27
|
+
|
|
28
|
+
* **ci:** setup workflows to create releases and release PRs ([#212](https://github.com/Modern-Treasury/modern-treasury-node/issues/212)) ([fb97629](https://github.com/Modern-Treasury/modern-treasury-node/commit/fb9762939152c2752365ac4b044851f07bc69b70))
|
|
29
|
+
* **internal:** add helper method ([#211](https://github.com/Modern-Treasury/modern-treasury-node/issues/211)) ([a9d85e6](https://github.com/Modern-Treasury/modern-treasury-node/commit/a9d85e6edf6cf503b29c51e704514cbd952556fb))
|
|
30
|
+
* **internal:** add missing eslint-plugin-prettier ([#206](https://github.com/Modern-Treasury/modern-treasury-node/issues/206)) ([baa9264](https://github.com/Modern-Treasury/modern-treasury-node/commit/baa926436226ba74cafc24937261e10d853fb0db))
|
|
31
|
+
* **internal:** export HeadersInit type shim ([#210](https://github.com/Modern-Treasury/modern-treasury-node/issues/210)) ([a5e0cfe](https://github.com/Modern-Treasury/modern-treasury-node/commit/a5e0cfe4b3025d5263b5739d6a59bb5f519628a8))
|
|
32
|
+
* **internal:** minor reformatting of code ([#205](https://github.com/Modern-Treasury/modern-treasury-node/issues/205)) ([709c87f](https://github.com/Modern-Treasury/modern-treasury-node/commit/709c87ffe9130a6191ed145a57c0f16398a62bb8))
|
|
33
|
+
|
|
34
|
+
## [2.3.0](https://github.com/Modern-Treasury/modern-treasury-node/compare/v2.2.0...v2.3.0) (2023-08-15)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### ⚠ BREAKING CHANGES
|
|
38
|
+
|
|
39
|
+
* **client:** support accessing raw response + remove deprecated features ([#191](https://github.com/Modern-Treasury/modern-treasury-node/issues/191))
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* allow a default timeout to be set for clients ([#196](https://github.com/Modern-Treasury/modern-treasury-node/issues/196)) ([5403497](https://github.com/Modern-Treasury/modern-treasury-node/commit/54034973c70908750a4cc53130782d247bde6e5f))
|
|
44
|
+
* **api:** add `metadata` in several places it was missing; add `description` ([#179](https://github.com/Modern-Treasury/modern-treasury-node/issues/179)) ([639f25b](https://github.com/Modern-Treasury/modern-treasury-node/commit/639f25ba064edf2ab637f572a803fd3b7d59087b))
|
|
45
|
+
* **api:** support multiple `id`s in `ledger` `retrieve`/`list` endpoints ([#194](https://github.com/Modern-Treasury/modern-treasury-node/issues/194)) ([a8a1a87](https://github.com/Modern-Treasury/modern-treasury-node/commit/a8a1a879d41da3cefce4acdfa5f4951e01a0399c))
|
|
46
|
+
* **api:** updates ([#180](https://github.com/Modern-Treasury/modern-treasury-node/issues/180)) ([24c193d](https://github.com/Modern-Treasury/modern-treasury-node/commit/24c193d346a555d5274de5ba94dfc3ce756d1c8e))
|
|
47
|
+
* **client:** detect browser usage ([#182](https://github.com/Modern-Treasury/modern-treasury-node/issues/182)) ([f571e78](https://github.com/Modern-Treasury/modern-treasury-node/commit/f571e786840477c48411e227f015ddceeac5e239))
|
|
48
|
+
* **client:** support accessing raw response + remove deprecated features ([#191](https://github.com/Modern-Treasury/modern-treasury-node/issues/191)) ([ca27da3](https://github.com/Modern-Treasury/modern-treasury-node/commit/ca27da367bb37e7045b15ccc01fccebeafdc9ce9))
|
|
49
|
+
* **streaming:** add `.toReadableStream()` method ([#185](https://github.com/Modern-Treasury/modern-treasury-node/issues/185)) ([7765c7b](https://github.com/Modern-Treasury/modern-treasury-node/commit/7765c7b08ab0c873da97af25cd6b4c35a967ab7f))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* **client:** fix array query param serialization ([#195](https://github.com/Modern-Treasury/modern-treasury-node/issues/195)) ([c091449](https://github.com/Modern-Treasury/modern-treasury-node/commit/c091449e81b50a16f05cf06c822251d2c0154f48))
|
|
55
|
+
* remove redundant `Content-Type` header param ([#190](https://github.com/Modern-Treasury/modern-treasury-node/issues/190)) ([0dedec0](https://github.com/Modern-Treasury/modern-treasury-node/commit/0dedec00c9daec61162ad04548287b7cb7581e29))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Documentation
|
|
59
|
+
|
|
60
|
+
* **api:** improve custom method arguments ([#184](https://github.com/Modern-Treasury/modern-treasury-node/issues/184)) ([ea440fd](https://github.com/Modern-Treasury/modern-treasury-node/commit/ea440fd721ef06b2b9e75293da3aee4bb3f91748))
|
|
61
|
+
* **readme:** minor updates ([#192](https://github.com/Modern-Treasury/modern-treasury-node/issues/192)) ([94a83be](https://github.com/Modern-Treasury/modern-treasury-node/commit/94a83bec5981737f9186850c8ec8ecab0e9db27c))
|
|
62
|
+
* **readme:** remove beta status + document versioning policy ([#181](https://github.com/Modern-Treasury/modern-treasury-node/issues/181)) ([5a7f4a4](https://github.com/Modern-Treasury/modern-treasury-node/commit/5a7f4a4a43f4e20f3012ca9ba39d1803ad4bcc45))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
### Chores
|
|
66
|
+
|
|
67
|
+
* assign default reviewers to release PRs ([#197](https://github.com/Modern-Treasury/modern-treasury-node/issues/197)) ([ef8f6b0](https://github.com/Modern-Treasury/modern-treasury-node/commit/ef8f6b07e4ec54b107f80d1e87221a28fdfda349))
|
|
68
|
+
* **internal:** change jest exclude patterns ([#189](https://github.com/Modern-Treasury/modern-treasury-node/issues/189)) ([2f59bf2](https://github.com/Modern-Treasury/modern-treasury-node/commit/2f59bf2c195abb237839b8a8b2e9b744b7c6c0bc))
|
|
69
|
+
* **internal:** conditionally include bin during build output ([#193](https://github.com/Modern-Treasury/modern-treasury-node/issues/193)) ([7dfe154](https://github.com/Modern-Treasury/modern-treasury-node/commit/7dfe154c8c49d319d5e98be7f380c209f796772c))
|
|
70
|
+
* **internal:** fix deno build ([#177](https://github.com/Modern-Treasury/modern-treasury-node/issues/177)) ([f04bfc3](https://github.com/Modern-Treasury/modern-treasury-node/commit/f04bfc305c3e5430284502d0fdbdb4578f1f28d8))
|
|
71
|
+
* **internal:** fix error happening in CloudFlare pages ([#198](https://github.com/Modern-Treasury/modern-treasury-node/issues/198)) ([5fa6d25](https://github.com/Modern-Treasury/modern-treasury-node/commit/5fa6d25ec13fc37d70da3be68792eecf2d4f4d99))
|
|
72
|
+
* **internal:** improve error message when option is missing ([#199](https://github.com/Modern-Treasury/modern-treasury-node/issues/199)) ([db2e836](https://github.com/Modern-Treasury/modern-treasury-node/commit/db2e836f9d046ec1cc517afe20fda116f0b9f4d8))
|
|
73
|
+
* **internal:** remove deno build ([#183](https://github.com/Modern-Treasury/modern-treasury-node/issues/183)) ([3db3231](https://github.com/Modern-Treasury/modern-treasury-node/commit/3db3231509cfc949fdd672ec54d48d4f96a315ac))
|
|
74
|
+
* **internal:** update eslint ([#187](https://github.com/Modern-Treasury/modern-treasury-node/issues/187)) ([0d185b0](https://github.com/Modern-Treasury/modern-treasury-node/commit/0d185b0a0935704ab3ce5098743db28eee36ff02))
|
|
75
|
+
* **internal:** update tsconfig-paths dep ([#188](https://github.com/Modern-Treasury/modern-treasury-node/issues/188)) ([9370fe5](https://github.com/Modern-Treasury/modern-treasury-node/commit/9370fe52fdf84e3d0737629eaf5714d6563bbb08))
|
|
76
|
+
* **internal:** update typescript ([#186](https://github.com/Modern-Treasury/modern-treasury-node/issues/186)) ([7186ad6](https://github.com/Modern-Treasury/modern-treasury-node/commit/7186ad6e0ba1fb096cfad4852b9670e2b43f9113))
|
|
77
|
+
|
|
3
78
|
## [2.2.0](https://github.com/Modern-Treasury/modern-treasury-node/compare/v2.1.0...v3.0.0) (2023-08-01)
|
|
4
79
|
|
|
5
80
|
|
package/README.md
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://npmjs.org/package/modern-treasury)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
It includes TypeScript definitions for all request params and response fields.
|
|
7
|
-
|
|
8
|
-
## Documentation
|
|
5
|
+
This library provides convenient access to the Modern Treasury Node REST API from server-side TypeScript or JavaScript.
|
|
9
6
|
|
|
10
7
|
The API documentation can be found [here](https://docs.moderntreasury.com).
|
|
11
8
|
|
|
@@ -39,10 +36,9 @@ async function main() {
|
|
|
39
36
|
main();
|
|
40
37
|
```
|
|
41
38
|
|
|
42
|
-
###
|
|
39
|
+
### Request & Response types
|
|
43
40
|
|
|
44
|
-
|
|
45
|
-
If you like, you may reference our types directly:
|
|
41
|
+
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
|
|
46
42
|
|
|
47
43
|
```ts
|
|
48
44
|
import ModernTreasury from 'modern-treasury';
|
|
@@ -179,13 +175,13 @@ await modernTreasury.externalAccounts.list({
|
|
|
179
175
|
|
|
180
176
|
### Timeouts
|
|
181
177
|
|
|
182
|
-
Requests time out after
|
|
178
|
+
Requests time out after 1 minute by default. You can configure this with a `timeout` option:
|
|
183
179
|
|
|
184
180
|
<!-- prettier-ignore -->
|
|
185
181
|
```ts
|
|
186
182
|
// Configure the default for all requests:
|
|
187
183
|
const modernTreasury = new ModernTreasury({
|
|
188
|
-
timeout: 20 * 1000, // 20 seconds (default is
|
|
184
|
+
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
|
|
189
185
|
organizationId: 'my-organization-ID',
|
|
190
186
|
});
|
|
191
187
|
|
|
@@ -230,6 +226,30 @@ while (page.hasNextPage()) {
|
|
|
230
226
|
}
|
|
231
227
|
```
|
|
232
228
|
|
|
229
|
+
## Advanced Usage
|
|
230
|
+
|
|
231
|
+
### Accessing raw Response data (e.g., headers)
|
|
232
|
+
|
|
233
|
+
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
|
|
234
|
+
|
|
235
|
+
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
const modernTreasury = new ModernTreasury();
|
|
239
|
+
|
|
240
|
+
const response = await modernTreasury.externalAccounts
|
|
241
|
+
.create({ counterparty_id: '9eba513a-53fd-4d6d-ad52-ccce122ab92a', name: 'my bank' })
|
|
242
|
+
.asResponse();
|
|
243
|
+
console.log(response.headers.get('X-My-Header'));
|
|
244
|
+
console.log(response.statusText); // access the underlying Response object
|
|
245
|
+
|
|
246
|
+
const { data: externalAccounts, response: raw } = await modernTreasury.externalAccounts
|
|
247
|
+
.create({ counterparty_id: '9eba513a-53fd-4d6d-ad52-ccce122ab92a', name: 'my bank' })
|
|
248
|
+
.withResponse();
|
|
249
|
+
console.log(raw.headers.get('X-My-Header'));
|
|
250
|
+
console.log(externalAccounts.id);
|
|
251
|
+
```
|
|
252
|
+
|
|
233
253
|
## Configuring an HTTP(S) Agent (e.g., for proxies)
|
|
234
254
|
|
|
235
255
|
By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests.
|
|
@@ -254,20 +274,28 @@ await modernTreasury.externalAccounts.list({
|
|
|
254
274
|
})
|
|
255
275
|
```
|
|
256
276
|
|
|
257
|
-
##
|
|
277
|
+
## Semantic Versioning
|
|
258
278
|
|
|
259
|
-
This package
|
|
260
|
-
|
|
261
|
-
|
|
279
|
+
This package generally attempts to follow [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
280
|
+
|
|
281
|
+
1. Changes that only affect static types, without breaking runtime behavior.
|
|
282
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
|
|
283
|
+
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
284
|
+
|
|
285
|
+
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
262
286
|
|
|
263
287
|
We are keen for your feedback; please open an [issue](https://www.github.com/Modern-Treasury/modern-treasury-node/issues) with questions, bugs, or suggestions.
|
|
264
288
|
|
|
265
289
|
## Requirements
|
|
266
290
|
|
|
291
|
+
TypeScript >= 4.5 is supported.
|
|
292
|
+
|
|
267
293
|
The following runtimes are supported:
|
|
268
294
|
|
|
269
295
|
- Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
|
|
270
|
-
- Deno v1.28.0 or higher
|
|
271
|
-
|
|
296
|
+
- Deno v1.28.0 or higher, using `import ModernTreasury from "npm:modern-treasury"`.
|
|
297
|
+
Deno Deploy is not yet supported.
|
|
298
|
+
- Cloudflare Workers.
|
|
299
|
+
- Vercel Edge Runtime.
|
|
272
300
|
|
|
273
301
|
If you are interested in other runtime environments, please open or upvote an issue on GitHub.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadableStream-node.d.ts","sourceRoot":"","sources":["../src/_shims/ReadableStream-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.ReadableStream = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
6
|
+
*/
|
|
7
|
+
const web_streams_polyfill_1 = require('web-streams-polyfill');
|
|
8
|
+
Object.defineProperty(exports, 'ReadableStream', {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return web_streams_polyfill_1.ReadableStream;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=ReadableStream-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadableStream-node.js","sourceRoot":"","sources":["../src/_shims/ReadableStream-node.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+DAAsD;AAE7C,+FAFA,qCAAc,OAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadableStream-node.mjs","sourceRoot":"","sources":["../src/_shims/ReadableStream-node.ts"],"names":[],"mappings":"OAGO,EAAE,cAAc,EAAE,MAAM,sBAAsB;AAErD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* >>> Confused? <<<
|
|
7
|
+
*
|
|
8
|
+
* If you're getting errors from these types, try adding "lib": ["DOM"]
|
|
9
|
+
* to your tsconfig.json, or otherwise configure the appropriate builtin
|
|
10
|
+
* `ReadableStream` type for your environment.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
type _ReadableStream<R = any> = unknown extends ReadableStream ? never : ReadableStream<R>;
|
|
15
|
+
declare const _ReadableStream: {
|
|
16
|
+
prototype: _ReadableStream;
|
|
17
|
+
new (
|
|
18
|
+
underlyingSource: _UnderlyingByteSource,
|
|
19
|
+
strategy?: { highWaterMark?: number },
|
|
20
|
+
): _ReadableStream<Uint8Array>;
|
|
21
|
+
new <R = any>(
|
|
22
|
+
underlyingSource: _UnderlyingDefaultSource<R>,
|
|
23
|
+
strategy?: _QueuingStrategy<R>,
|
|
24
|
+
): _ReadableStream<R>;
|
|
25
|
+
new <R = any>(underlyingSource?: _UnderlyingSource<R>, strategy?: _QueuingStrategy<R>): _ReadableStream<R>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
type _UnderlyingSource<R = any> = unknown extends UnderlyingSource ? never : UnderlyingSource<R>;
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
type _UnderlyingByteSource = unknown extends UnderlyingByteSource ? never : UnderlyingByteSource;
|
|
32
|
+
type _UnderlyingDefaultSource<R = any> =
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
unknown extends UnderlyingDefaultSource ? never : UnderlyingDefaultSource<R>;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
type _QueuingStrategy<R = any> = unknown extends QueuingStrategy ? never : QueuingStrategy<R>;
|
|
37
|
+
|
|
38
|
+
export { _ReadableStream as ReadableStream };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-node.d.ts","sourceRoot":"","sources":["../src/_shims/agent-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGvC,YAAY,EAAE,KAAK,EAAE,CAAC;AAUtB,eAAO,MAAM,eAAe,QAAS,MAAM,KAAG,KAAK,GAAG,SAGrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent
|
|
1
|
+
{"version":3,"file":"agent-node.js","sourceRoot":"","sources":["../src/_shims/agent-node.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;AAEH,oEAA4C;AAE5C,uDAA8E;AAI9E,MAAM,gBAAgB,GAAU,IAAI,wBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAChG,MAAM,iBAAiB,GAAU,IAAI,wBAAc,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAE5G,oCAAoC;AACpC,IAAI,OAAO,eAAe,KAAK,WAAW,EAAE;IAC1C,eAAe,GAAG,kCAAwD,CAAC;CAC5E;AAEM,MAAM,eAAe,GAAG,CAAC,GAAW,EAAqB,EAAE;IAChE,IAAI,iBAAiB,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,iBAAiB,CAAC;IAC3E,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent
|
|
1
|
+
{"version":3,"file":"agent-node.mjs","sourceRoot":"","sources":["../src/_shims/agent-node.ts"],"names":[],"mappings":"AAAA;;GAEG;OAEI,cAAc,MAAM,gBAAgB;OAEpC,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,kBAAkB;AAI7E,MAAM,gBAAgB,GAAU,IAAI,cAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAChG,MAAM,iBAAiB,GAAU,IAAI,cAAc,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAE5G,oCAAoC;AACpC,IAAI,OAAO,eAAe,KAAK,WAAW,EAAE;IAC1C,eAAe,GAAG,uBAAwD,CAAC;CAC5E;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAqB,EAAE;IAChE,IAAI,iBAAiB,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,iBAAiB,CAAC;IAC3E,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC"}
|
package/_shims/agent.d.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
|
export type Agent = any;
|
|
8
8
|
export declare const getDefaultAgent: (url: string) => any;
|
package/_shims/agent.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
4
4
|
*
|
|
5
5
|
* This is a stub for non-node environments.
|
|
6
|
-
* In node environments, it gets replaced agent
|
|
6
|
+
* In node environments, it gets replaced agent-node.ts by the package export map
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
exports.getDefaultAgent = void 0;
|
package/_shims/agent.mjs
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
|
export const getDefaultAgent = (url) => {
|
|
8
8
|
return undefined;
|
|
@@ -26,6 +26,11 @@ type _RequestInit = unknown extends RequestInit ? nf.RequestInit : RequestInit;
|
|
|
26
26
|
type _Response = unknown extends Response ? nf.Response : Response;
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
type _ResponseInit = unknown extends ResponseInit ? nf.ResponseInit : ResponseInit;
|
|
29
|
+
type _ResponseType =
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
unknown extends ResponseType ? 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'
|
|
32
|
+
: // @ts-ignore
|
|
33
|
+
ResponseType;
|
|
29
34
|
// @ts-ignore
|
|
30
35
|
type _BodyInit = unknown extends BodyInit ? nf.BodyInit : BodyInit;
|
|
31
36
|
// @ts-ignore
|
|
@@ -50,4 +55,10 @@ declare const _Headers: {
|
|
|
50
55
|
export const isPolyfilled = false;
|
|
51
56
|
|
|
52
57
|
export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
|
|
53
|
-
export type {
|
|
58
|
+
export type {
|
|
59
|
+
_RequestInit as RequestInit,
|
|
60
|
+
_RequestInfo as RequestInfo,
|
|
61
|
+
_ResponseType as ResponseType,
|
|
62
|
+
_BodyInit as BodyInit,
|
|
63
|
+
_HeadersInit as HeadersInit,
|
|
64
|
+
};
|
package/_shims/fetch.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ type _Response = unknown extends Response ? never : Response;
|
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
|
|
28
28
|
// @ts-ignore
|
|
29
|
+
type _ResponseType = unknown extends ResponseType ? never : ResponseType;
|
|
30
|
+
// @ts-ignore
|
|
29
31
|
type _BodyInit = unknown extends BodyInit ? never : BodyInit;
|
|
30
32
|
// @ts-ignore
|
|
31
33
|
type _Headers = unknown extends Headers ? never : Headers;
|
|
@@ -49,4 +51,10 @@ declare const _Headers: {
|
|
|
49
51
|
export const isPolyfilled = false;
|
|
50
52
|
|
|
51
53
|
export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
|
|
52
|
-
export type {
|
|
54
|
+
export type {
|
|
55
|
+
_RequestInit as RequestInit,
|
|
56
|
+
_RequestInfo as RequestInfo,
|
|
57
|
+
_ResponseType as ResponseType,
|
|
58
|
+
_BodyInit as BodyInit,
|
|
59
|
+
_HeadersInit as HeadersInit,
|
|
60
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
|
-
import type { File, FilePropertyBag } from './
|
|
4
|
+
import type { File, FilePropertyBag } from './form-data-node.js';
|
|
5
5
|
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated use fs.createReadStream('./my/file.txt') instead
|
|
@@ -14,4 +14,4 @@ export declare function fileFromPath(
|
|
|
14
14
|
filename?: string,
|
|
15
15
|
options?: FileFromPathOptions,
|
|
16
16
|
): Promise<File>;
|
|
17
|
-
//# sourceMappingURL=fileFromPath
|
|
17
|
+
//# sourceMappingURL=fileFromPath-node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileFromPath
|
|
1
|
+
{"version":3,"file":"fileFromPath-node.d.ts","sourceRoot":"","sources":["../src/_shims/fileFromPath-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAIxE;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAChE,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACnF,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/F,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileFromPath
|
|
1
|
+
{"version":3,"file":"fileFromPath-node.js","sourceRoot":"","sources":["../src/_shims/fileFromPath-node.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iEAA6E;AAK7E,IAAI,MAAM,GAAG,KAAK,CAAC;AAaZ,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,GAAG,IAAW;IAC7D,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,CAAC,IAAI,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrG,MAAM,GAAG,IAAI,CAAC;KACf;IACD,OAAO,MAAM,IAAA,6BAAa,EAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;AAC5C,CAAC;AAND,oCAMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileFromPath
|
|
1
|
+
{"version":3,"file":"fileFromPath-node.mjs","sourceRoot":"","sources":["../src/_shims/fileFromPath-node.ts"],"names":[],"mappings":"AAAA;;GAEG;OAEI,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,8BAA8B;AAK5E,IAAI,MAAM,GAAG,KAAK,CAAC;AAanB,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,GAAG,IAAW;IAC7D,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,CAAC,IAAI,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrG,MAAM,GAAG,IAAI,CAAC;KACf;IACD,OAAO,MAAM,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;AAC5C,CAAC"}
|
package/_shims/fileFromPath.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
|
-
import type { FilePropertyBag, File } from './
|
|
7
|
+
import type { FilePropertyBag, File } from './form-data.js';
|
|
8
8
|
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
9
9
|
/**
|
|
10
10
|
* This is a stub for non-node environments that just throws an error.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileFromPath.d.ts","sourceRoot":"","sources":["../src/_shims/fileFromPath.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fileFromPath.d.ts","sourceRoot":"","sources":["../src/_shims/fileFromPath.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;AAExE;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAChE,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACnF,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC/F,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
package/_shims/fileFromPath.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
4
4
|
*
|
|
5
|
-
* This is a stub that gets replaced by fileFromPath
|
|
5
|
+
* This is a stub that gets replaced by fileFromPath-node.js for node environments
|
|
6
6
|
* in the package export map
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
package/_shims/fileFromPath.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
export async function fileFromPath() {
|
|
@@ -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/_shims/{getMultipartRequestOptions.node.d.ts → getMultipartRequestOptions-node.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
|
-
import { FormData } from './
|
|
4
|
+
import { FormData } from './form-data-node.js';
|
|
5
5
|
import type { RequestOptions } from '../core.js';
|
|
6
6
|
export declare function getMultipartRequestOptions<T extends {} = Record<string, unknown>>(
|
|
7
7
|
form: FormData,
|
|
8
8
|
opts: RequestOptions<T>,
|
|
9
9
|
): Promise<RequestOptions<T>>;
|
|
10
|
-
//# sourceMappingURL=getMultipartRequestOptions
|
|
10
|
+
//# sourceMappingURL=getMultipartRequestOptions-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMultipartRequestOptions-node.d.ts","sourceRoot":"","sources":["../src/_shims/getMultipartRequestOptions-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK9C,wBAAsB,0BAA0B,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrF,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAW5B"}
|
|
@@ -19,4 +19,4 @@ async function getMultipartRequestOptions(form, opts) {
|
|
|
19
19
|
return { ...opts, body: body, headers };
|
|
20
20
|
}
|
|
21
21
|
exports.getMultipartRequestOptions = getMultipartRequestOptions;
|
|
22
|
-
//# sourceMappingURL=getMultipartRequestOptions
|
|
22
|
+
//# sourceMappingURL=getMultipartRequestOptions-node.js.map
|
package/_shims/{getMultipartRequestOptions.node.js.map → getMultipartRequestOptions-node.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultipartRequestOptions
|
|
1
|
+
{"version":3,"file":"getMultipartRequestOptions-node.js","sourceRoot":"","sources":["../src/_shims/getMultipartRequestOptions-node.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,6CAAuC;AACvC,yDAAoD;AACpD,2CAA2C;AAEpC,KAAK,UAAU,0BAA0B,CAC9C,IAAc,EACd,IAAuB;IAEvB,MAAM,OAAO,GAAG,IAAI,mCAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,sBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,uBAAa,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG;QACd,GAAG,IAAI,CAAC,OAAO;QACf,GAAG,OAAO,CAAC,OAAO;QAClB,gBAAgB,EAAE,OAAO,CAAC,aAAa;KACxC,CAAC;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC;AAdD,gEAcC"}
|
package/_shims/{getMultipartRequestOptions.node.mjs.map → getMultipartRequestOptions-node.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultipartRequestOptions
|
|
1
|
+
{"version":3,"file":"getMultipartRequestOptions-node.mjs","sourceRoot":"","sources":["../src/_shims/getMultipartRequestOptions-node.ts"],"names":[],"mappings":"AAAA;;GAEG;OAII,EAAE,QAAQ,EAAE,MAAM,aAAa;OAC/B,EAAE,eAAe,EAAE,MAAM,mBAAmB;OAC5C,EAAE,aAAa,EAAE;AAExB,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,IAAc,EACd,IAAuB;IAEvB,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG;QACd,GAAG,IAAI,CAAC,OAAO;QACf,GAAG,OAAO,CAAC,OAAO;QAClB,gBAAgB,EAAE,OAAO,CAAC,aAAa;KACxC,CAAC;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
3
|
*/
|
|
4
|
-
import { FormData } from './
|
|
4
|
+
import { FormData } from './form-data.js';
|
|
5
5
|
import type { RequestOptions } from '../core.js';
|
|
6
6
|
export declare function getMultipartRequestOptions<T extends {} = Record<string, unknown>>(
|
|
7
7
|
form: FormData,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMultipartRequestOptions.d.ts","sourceRoot":"","sources":["../src/_shims/getMultipartRequestOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getMultipartRequestOptions.d.ts","sourceRoot":"","sources":["../src/_shims/getMultipartRequestOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,wBAAsB,0BAA0B,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrF,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAE5B"}
|
|
@@ -5,4 +5,4 @@ export type { Readable } from 'node:stream';
|
|
|
5
5
|
import { ReadStream as FsReadStream } from 'node:fs';
|
|
6
6
|
export type { FsReadStream };
|
|
7
7
|
export declare function isFsReadStream(value: any): value is FsReadStream;
|
|
8
|
-
//# sourceMappingURL=node-readable
|
|
8
|
+
//# sourceMappingURL=node-readable-node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-readable
|
|
1
|
+
{"version":3,"file":"node-readable-node.d.ts","sourceRoot":"","sources":["../src/_shims/node-readable-node.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,CAAC;AAE7B,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,YAAY,CAEhE"}
|