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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
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
|
+
|
|
3
34
|
## [2.3.0](https://github.com/Modern-Treasury/modern-treasury-node/compare/v2.2.0...v2.3.0) (2023-08-15)
|
|
4
35
|
|
|
5
36
|
|
package/README.md
CHANGED
|
@@ -288,6 +288,8 @@ We are keen for your feedback; please open an [issue](https://www.github.com/Mod
|
|
|
288
288
|
|
|
289
289
|
## Requirements
|
|
290
290
|
|
|
291
|
+
TypeScript >= 4.5 is supported.
|
|
292
|
+
|
|
291
293
|
The following runtimes are supported:
|
|
292
294
|
|
|
293
295
|
- Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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;
|
package/_shims/fetch.d.ts
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
|
-
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-readable-node.js","sourceRoot":"","sources":["../src/_shims/node-readable-node.ts"],"names":[],"mappings":";;;AAIA,qCAAqD;AAGrD,SAAgB,cAAc,CAAC,KAAU;IACvC,OAAO,KAAK,YAAY,oBAAY,CAAC;AACvC,CAAC;AAFD,wCAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-readable-node.mjs","sourceRoot":"","sources":["../src/_shims/node-readable-node.ts"],"names":[],"mappings":"OAIO,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,SAAS;AAGpD,MAAM,UAAU,cAAc,CAAC,KAAU;IACvC,OAAO,KAAK,YAAY,YAAY,CAAC;AACvC,CAAC"}
|
package/core.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { APIError } from './error.js';
|
|
2
2
|
import type { Readable } from 'modern-treasury/_shims/node-readable';
|
|
3
3
|
import { type Agent } from 'modern-treasury/_shims/agent';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
type RequestInfo,
|
|
6
|
+
type RequestInit,
|
|
7
|
+
type Response,
|
|
8
|
+
type HeadersInit,
|
|
9
|
+
} from 'modern-treasury/_shims/fetch';
|
|
5
10
|
export { type Response };
|
|
6
11
|
export {
|
|
7
12
|
maybeMultipartFormRequestOptions,
|
|
@@ -77,7 +82,7 @@ export declare abstract class APIClient {
|
|
|
77
82
|
httpAgent: Agent | undefined;
|
|
78
83
|
fetch: Fetch | undefined;
|
|
79
84
|
});
|
|
80
|
-
protected authHeaders(): Headers;
|
|
85
|
+
protected authHeaders(opts: FinalRequestOptions): Headers;
|
|
81
86
|
/**
|
|
82
87
|
* Override this to add your own default headers, for example:
|
|
83
88
|
*
|
|
@@ -86,7 +91,7 @@ export declare abstract class APIClient {
|
|
|
86
91
|
* Authorization: 'Bearer 123',
|
|
87
92
|
* }
|
|
88
93
|
*/
|
|
89
|
-
protected defaultHeaders(): Headers;
|
|
94
|
+
protected defaultHeaders(opts: FinalRequestOptions): Headers;
|
|
90
95
|
protected abstract defaultQuery(): DefaultQuery | undefined;
|
|
91
96
|
/**
|
|
92
97
|
* Override this to add your own headers validation:
|
|
@@ -122,10 +127,13 @@ export declare abstract class APIClient {
|
|
|
122
127
|
request: RequestInit,
|
|
123
128
|
{
|
|
124
129
|
url,
|
|
130
|
+
options,
|
|
125
131
|
}: {
|
|
126
132
|
url: string;
|
|
133
|
+
options: FinalRequestOptions;
|
|
127
134
|
},
|
|
128
135
|
): Promise<void>;
|
|
136
|
+
protected parseHeaders(headers: HeadersInit | null | undefined): Record<string, string>;
|
|
129
137
|
protected makeStatusError(
|
|
130
138
|
status: number | undefined,
|
|
131
139
|
error: Object | undefined,
|
|
@@ -141,7 +149,7 @@ export declare abstract class APIClient {
|
|
|
141
149
|
Page: new (...args: ConstructorParameters<typeof AbstractPage>) => PageClass,
|
|
142
150
|
options: FinalRequestOptions,
|
|
143
151
|
): PagePromise<PageClass, Item>;
|
|
144
|
-
buildURL<Req
|
|
152
|
+
buildURL<Req extends Record<string, unknown>>(path: string, query: Req | null | undefined): string;
|
|
145
153
|
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
146
154
|
fetchWithTimeout(
|
|
147
155
|
url: RequestInfo,
|
|
@@ -185,7 +193,7 @@ export declare abstract class AbstractPage<Item> implements AsyncIterable<Item>
|
|
|
185
193
|
abstract nextPageInfo(): PageInfo | null;
|
|
186
194
|
abstract getPaginatedItems(): Item[];
|
|
187
195
|
hasNextPage(): boolean;
|
|
188
|
-
getNextPage(): Promise<
|
|
196
|
+
getNextPage(): Promise<this>;
|
|
189
197
|
iterPages(): AsyncGenerator<AbstractPage<Item>, void, unknown>;
|
|
190
198
|
[Symbol.asyncIterator](): AsyncGenerator<Awaited<Item>, void, unknown>;
|
|
191
199
|
}
|
package/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["src/core.ts"],"names":[],"mappings":";;;;AACA,OAAO,EAAE,QAAQ,EAAoE,MAAM,SAAS,CAAC;AACrG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAmB,KAAK,KAAK,EAAE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AAG,OAAO,CAExD;AAED,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAInD;AAaD,eAAO,MAAM,kBAAkB,eAS9B,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACpD;AACD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,eAAe,CAAC;AAE1F,eAAO,MAAM,iBAAiB,YAAa,GAAG,+BAE7C,CAAC;AAEF,eAAO,MAAM,SAAS,YAAa,WAAW,OAAO,MAAM,KAAG,MAAM,GAAG,IAAI,GAAG,SAU7E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,QAAS,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,MAWzD,CAAC"}
|
package/core.js
CHANGED
|
@@ -58,8 +58,8 @@ exports.toBase64 =
|
|
|
58
58
|
void 0;
|
|
59
59
|
const version_1 = require('./version.js');
|
|
60
60
|
const error_1 = require('./error.js');
|
|
61
|
-
const agent_1 = require('modern-treasury/_shims/agent');
|
|
62
|
-
const fetch_1 = require('modern-treasury/_shims/fetch');
|
|
61
|
+
const agent_1 = require('modern-treasury/_shims/agent.js');
|
|
62
|
+
const fetch_1 = require('modern-treasury/_shims/fetch.js');
|
|
63
63
|
const uploads_1 = require('./uploads.js');
|
|
64
64
|
var uploads_2 = require('./uploads.js');
|
|
65
65
|
Object.defineProperty(exports, 'maybeMultipartFormRequestOptions', {
|
|
@@ -166,7 +166,7 @@ class APIClient {
|
|
|
166
166
|
this.httpAgent = httpAgent;
|
|
167
167
|
this.fetch = overridenFetch !== null && overridenFetch !== void 0 ? overridenFetch : fetch_1.fetch;
|
|
168
168
|
}
|
|
169
|
-
authHeaders() {
|
|
169
|
+
authHeaders(opts) {
|
|
170
170
|
return {};
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
@@ -177,13 +177,13 @@ class APIClient {
|
|
|
177
177
|
* Authorization: 'Bearer 123',
|
|
178
178
|
* }
|
|
179
179
|
*/
|
|
180
|
-
defaultHeaders() {
|
|
180
|
+
defaultHeaders(opts) {
|
|
181
181
|
return {
|
|
182
182
|
Accept: 'application/json',
|
|
183
183
|
'Content-Type': 'application/json',
|
|
184
184
|
'User-Agent': this.getUserAgent(),
|
|
185
185
|
...getPlatformHeaders(),
|
|
186
|
-
...this.authHeaders(),
|
|
186
|
+
...this.authHeaders(opts),
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
@@ -267,7 +267,7 @@ class APIClient {
|
|
|
267
267
|
}
|
|
268
268
|
const reqHeaders = {
|
|
269
269
|
...(contentLength && { 'Content-Length': contentLength }),
|
|
270
|
-
...this.defaultHeaders(),
|
|
270
|
+
...this.defaultHeaders(options),
|
|
271
271
|
...headers,
|
|
272
272
|
};
|
|
273
273
|
// let builtin fetch set the Content-Type for multipart bodies
|
|
@@ -294,7 +294,14 @@ class APIClient {
|
|
|
294
294
|
* This is useful for cases where you want to add certain headers based off of
|
|
295
295
|
* the request properties, e.g. `method` or `url`.
|
|
296
296
|
*/
|
|
297
|
-
async prepareRequest(request, { url }) {}
|
|
297
|
+
async prepareRequest(request, { url, options }) {}
|
|
298
|
+
parseHeaders(headers) {
|
|
299
|
+
return (
|
|
300
|
+
!headers ? {}
|
|
301
|
+
: Symbol.iterator in headers ? Object.fromEntries(Array.from(headers).map((header) => [...header]))
|
|
302
|
+
: { ...headers }
|
|
303
|
+
);
|
|
304
|
+
}
|
|
298
305
|
makeStatusError(status, error, message, headers) {
|
|
299
306
|
return error_1.APIError.generate(status, error, message, headers);
|
|
300
307
|
}
|
|
@@ -308,7 +315,7 @@ class APIClient {
|
|
|
308
315
|
retriesRemaining = (_a = options.maxRetries) !== null && _a !== void 0 ? _a : this.maxRetries;
|
|
309
316
|
}
|
|
310
317
|
const { req, url, timeout } = this.buildRequest(options);
|
|
311
|
-
await this.prepareRequest(req, { url });
|
|
318
|
+
await this.prepareRequest(req, { url, options });
|
|
312
319
|
debug('request', url, options, req.headers);
|
|
313
320
|
if ((_b = options.signal) === null || _b === void 0 ? void 0 : _b.aborted) {
|
|
314
321
|
throw new error_1.APIUserAbortError();
|
|
@@ -416,7 +423,7 @@ class APIClient {
|
|
|
416
423
|
const maxRetries = (_a = options.maxRetries) !== null && _a !== void 0 ? _a : this.maxRetries;
|
|
417
424
|
const timeout = this.calculateRetryTimeoutSeconds(retriesRemaining, retryAfter, maxRetries) * 1000;
|
|
418
425
|
await sleep(timeout);
|
|
419
|
-
return this.
|
|
426
|
+
return this.makeRequest(options, retriesRemaining);
|
|
420
427
|
}
|
|
421
428
|
calculateRetryTimeoutSeconds(retriesRemaining, retryAfter, maxRetries) {
|
|
422
429
|
const initialRetryDelay = 0.5;
|
|
@@ -630,7 +637,7 @@ const getPlatformProperties = () => {
|
|
|
630
637
|
};
|
|
631
638
|
// Note: modified from https://github.com/JS-DevTools/host-environment/blob/b1ab79ecde37db5d6e163c050e54fe7d287d7c92/src/isomorphic.browser.ts
|
|
632
639
|
function getBrowserInfo() {
|
|
633
|
-
if (
|
|
640
|
+
if (typeof navigator === 'undefined' || !navigator) {
|
|
634
641
|
return null;
|
|
635
642
|
}
|
|
636
643
|
// NOTE: The order matters here!
|