modern-treasury 2.6.0 → 2.7.2
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 +33 -0
- package/README.md +8 -4
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/{src/_shims/ReadableStream-node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +99 -0
- package/_shims/{ReadableStream.js → auto/types.js} +0 -2
- package/{src/_shims/ReadableStream.js → _shims/auto/types.mjs} +0 -2
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +79 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +87 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +54 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +35 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +39 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +35 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +70 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +63 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +82 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +170 -223
- package/core.d.ts.map +1 -1
- package/core.js +678 -731
- package/core.js.map +1 -1
- package/core.mjs +672 -682
- package/core.mjs.map +1 -1
- package/error.d.ts +32 -32
- package/error.d.ts.map +1 -1
- package/error.js +95 -106
- package/error.js.map +1 -1
- package/error.mjs +91 -91
- package/error.mjs.map +1 -1
- package/index.d.mts +323 -333
- package/index.d.ts +323 -333
- package/index.d.ts.map +1 -1
- package/index.js +190 -243
- package/index.js.map +1 -1
- package/index.mjs +167 -190
- package/index.mjs.map +1 -1
- package/package.json +32 -58
- package/pagination.d.ts +11 -11
- package/pagination.js +30 -26
- package/pagination.mjs +28 -24
- package/resource.d.ts +10 -10
- package/resource.js +12 -12
- package/resource.mjs +10 -10
- package/resources/account-collection-flows.d.ts +71 -116
- package/resources/account-collection-flows.js +52 -62
- package/resources/account-collection-flows.js.map +1 -1
- package/resources/account-collection-flows.mjs +47 -55
- package/resources/account-collection-flows.mjs.map +1 -1
- package/resources/account-details.d.ts +59 -81
- package/resources/account-details.js +47 -50
- package/resources/account-details.js.map +1 -1
- package/resources/account-details.mjs +42 -45
- package/resources/account-details.mjs.map +1 -1
- package/resources/connections.d.ts +42 -44
- package/resources/connections.js +15 -13
- package/resources/connections.mjs +10 -8
- package/resources/counterparties.d.ts +400 -466
- package/resources/counterparties.js +63 -71
- package/resources/counterparties.js.map +1 -1
- package/resources/counterparties.mjs +58 -66
- package/resources/counterparties.mjs.map +1 -1
- package/resources/documents.d.ts +88 -120
- package/resources/documents.js +36 -42
- package/resources/documents.js.map +1 -1
- package/resources/documents.mjs +30 -36
- package/resources/documents.mjs.map +1 -1
- package/resources/events.d.ts +56 -55
- package/resources/events.js +21 -19
- package/resources/events.mjs +16 -14
- package/resources/expected-payments.d.ts +321 -373
- package/resources/expected-payments.js +46 -51
- package/resources/expected-payments.js.map +1 -1
- package/resources/expected-payments.mjs +41 -44
- package/resources/expected-payments.mjs.map +1 -1
- package/resources/external-accounts.d.ts +295 -373
- package/resources/external-accounts.js +76 -91
- package/resources/external-accounts.js.map +1 -1
- package/resources/external-accounts.mjs +71 -84
- package/resources/external-accounts.mjs.map +1 -1
- package/resources/incoming-payment-details.d.ts +200 -222
- package/resources/incoming-payment-details.js +42 -47
- package/resources/incoming-payment-details.js.map +1 -1
- package/resources/incoming-payment-details.mjs +37 -40
- package/resources/incoming-payment-details.mjs.map +1 -1
- package/resources/index.d.ts +35 -212
- package/resources/index.js +111 -484
- package/resources/index.mjs +34 -37
- package/resources/internal-accounts/balance-reports.d.ts +74 -113
- package/resources/internal-accounts/balance-reports.js +21 -23
- package/resources/internal-accounts/balance-reports.mjs +16 -18
- package/resources/internal-accounts/index.d.ts +3 -15
- package/resources/internal-accounts/index.js +10 -34
- package/resources/internal-accounts/index.mjs +3 -3
- package/resources/internal-accounts/internal-accounts.d.ts +203 -233
- package/resources/internal-accounts/internal-accounts.js +65 -86
- package/resources/internal-accounts/internal-accounts.js.map +1 -1
- package/resources/internal-accounts/internal-accounts.mjs +41 -45
- package/resources/internal-accounts/internal-accounts.mjs.map +1 -1
- package/resources/invoices/index.d.ts +3 -17
- package/resources/invoices/index.js +9 -29
- package/resources/invoices/index.mjs +3 -3
- package/resources/invoices/invoices.d.ts +509 -549
- package/resources/invoices/invoices.js +74 -95
- package/resources/invoices/invoices.js.map +1 -1
- package/resources/invoices/invoices.mjs +50 -54
- package/resources/invoices/invoices.mjs.map +1 -1
- package/resources/invoices/line-items.d.ts +119 -133
- package/resources/invoices/line-items.js +49 -52
- package/resources/invoices/line-items.js.map +1 -1
- package/resources/invoices/line-items.mjs +44 -47
- package/resources/invoices/line-items.mjs.map +1 -1
- package/resources/ledger-account-balance-monitors.d.ts +213 -224
- package/resources/ledger-account-balance-monitors.js +49 -55
- package/resources/ledger-account-balance-monitors.js.map +1 -1
- package/resources/ledger-account-balance-monitors.mjs +44 -49
- package/resources/ledger-account-balance-monitors.mjs.map +1 -1
- package/resources/ledger-account-categories.d.ts +255 -276
- package/resources/ledger-account-categories.js +84 -89
- package/resources/ledger-account-categories.js.map +1 -1
- package/resources/ledger-account-categories.mjs +79 -82
- package/resources/ledger-account-categories.mjs.map +1 -1
- package/resources/ledger-account-payouts.d.ts +151 -160
- package/resources/ledger-account-payouts.js +45 -50
- package/resources/ledger-account-payouts.js.map +1 -1
- package/resources/ledger-account-payouts.mjs +40 -43
- package/resources/ledger-account-payouts.mjs.map +1 -1
- package/resources/ledger-account-statements.d.ts +455 -461
- package/resources/ledger-account-statements.js +26 -32
- package/resources/ledger-account-statements.js.map +1 -1
- package/resources/ledger-account-statements.mjs +23 -27
- package/resources/ledger-account-statements.mjs.map +1 -1
- package/resources/ledger-accounts.d.ts +347 -357
- package/resources/ledger-accounts.js +45 -48
- package/resources/ledger-accounts.js.map +1 -1
- package/resources/ledger-accounts.mjs +40 -43
- package/resources/ledger-accounts.mjs.map +1 -1
- package/resources/ledger-entries.d.ts +244 -250
- package/resources/ledger-entries.js +20 -18
- package/resources/ledger-entries.mjs +15 -13
- package/resources/ledger-event-handlers.d.ts +369 -376
- package/resources/ledger-event-handlers.js +44 -49
- package/resources/ledger-event-handlers.js.map +1 -1
- package/resources/ledger-event-handlers.mjs +39 -42
- package/resources/ledger-event-handlers.mjs.map +1 -1
- package/resources/ledger-transactions/index.d.ts +3 -16
- package/resources/ledger-transactions/index.js +10 -34
- package/resources/ledger-transactions/index.mjs +3 -3
- package/resources/ledger-transactions/ledger-transactions.d.ts +335 -389
- package/resources/ledger-transactions/ledger-transactions.js +70 -91
- package/resources/ledger-transactions/ledger-transactions.js.map +1 -1
- package/resources/ledger-transactions/ledger-transactions.mjs +46 -50
- package/resources/ledger-transactions/ledger-transactions.mjs.map +1 -1
- package/resources/ledger-transactions/versions.d.ts +199 -214
- package/resources/ledger-transactions/versions.js +18 -16
- package/resources/ledger-transactions/versions.mjs +13 -11
- package/resources/ledgerable-events.d.ts +96 -99
- package/resources/ledgerable-events.js +27 -33
- package/resources/ledgerable-events.js.map +1 -1
- package/resources/ledgerable-events.mjs +24 -28
- package/resources/ledgerable-events.mjs.map +1 -1
- package/resources/ledgers.d.ts +98 -97
- package/resources/ledgers.js +46 -49
- package/resources/ledgers.js.map +1 -1
- package/resources/ledgers.mjs +41 -44
- package/resources/ledgers.mjs.map +1 -1
- package/resources/line-items.d.ts +78 -101
- package/resources/line-items.js +29 -27
- package/resources/line-items.mjs +24 -22
- package/resources/paper-items.d.ts +91 -93
- package/resources/paper-items.js +21 -19
- package/resources/paper-items.mjs +16 -14
- package/resources/payment-flows.d.ts +132 -138
- package/resources/payment-flows.js +49 -57
- package/resources/payment-flows.js.map +1 -1
- package/resources/payment-flows.mjs +44 -52
- package/resources/payment-flows.mjs.map +1 -1
- package/resources/payment-orders/index.d.ts +3 -13
- package/resources/payment-orders/index.js +9 -29
- package/resources/payment-orders/index.mjs +3 -3
- package/resources/payment-orders/payment-orders.d.ts +1416 -1696
- package/resources/payment-orders/payment-orders.js +80 -109
- package/resources/payment-orders/payment-orders.js.map +1 -1
- package/resources/payment-orders/payment-orders.mjs +55 -67
- package/resources/payment-orders/payment-orders.mjs.map +1 -1
- package/resources/payment-orders/reversals.d.ts +153 -183
- package/resources/payment-orders/reversals.js +38 -41
- package/resources/payment-orders/reversals.js.map +1 -1
- package/resources/payment-orders/reversals.mjs +33 -36
- package/resources/payment-orders/reversals.mjs.map +1 -1
- package/resources/payment-references.d.ts +61 -118
- package/resources/payment-references.js +26 -26
- package/resources/payment-references.mjs +21 -19
- package/resources/returns.d.ts +167 -324
- package/resources/returns.js +35 -38
- package/resources/returns.js.map +1 -1
- package/resources/returns.mjs +30 -33
- package/resources/returns.mjs.map +1 -1
- package/resources/routing-details.d.ts +83 -173
- package/resources/routing-details.js +47 -50
- package/resources/routing-details.js.map +1 -1
- package/resources/routing-details.mjs +42 -45
- package/resources/routing-details.mjs.map +1 -1
- package/resources/shared.d.ts +4 -194
- package/resources/shared.js +3 -3
- package/resources/shared.mjs +1 -1
- package/resources/top-level.d.ts +4 -4
- package/resources/top-level.js +5 -4
- package/resources/top-level.mjs +3 -2
- package/resources/transactions/index.d.ts +3 -14
- package/resources/transactions/index.js +10 -34
- package/resources/transactions/index.mjs +3 -3
- package/resources/transactions/line-items.d.ts +69 -78
- package/resources/transactions/line-items.js +21 -19
- package/resources/transactions/line-items.mjs +16 -14
- package/resources/transactions/transactions.d.ts +163 -211
- package/resources/transactions/transactions.js +51 -67
- package/resources/transactions/transactions.mjs +27 -26
- package/resources/validations.d.ts +67 -111
- package/resources/validations.js +13 -12
- package/resources/validations.mjs +10 -9
- package/resources/virtual-accounts.d.ts +161 -201
- package/resources/virtual-accounts.js +46 -51
- package/resources/virtual-accounts.js.map +1 -1
- package/resources/virtual-accounts.mjs +41 -44
- package/resources/virtual-accounts.mjs.map +1 -1
- package/resources/webhooks.d.ts +21 -28
- package/resources/webhooks.js +35 -37
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +30 -31
- package/resources/webhooks.mjs.map +1 -1
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +99 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +79 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +79 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +64 -0
- package/src/_shims/web-runtime.ts +91 -0
- package/src/_shims/web-types.d.ts +82 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +72 -43
- package/src/error.ts +4 -2
- package/src/index.ts +10 -8
- package/src/pagination.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/resources/account-collection-flows.ts +5 -5
- package/src/resources/account-details.ts +6 -6
- package/src/resources/connections.ts +5 -5
- package/src/resources/counterparties.ts +8 -8
- package/src/resources/documents.ts +6 -6
- package/src/resources/events.ts +5 -5
- package/src/resources/expected-payments.ts +6 -6
- package/src/resources/external-accounts.ts +8 -8
- package/src/resources/incoming-payment-details.ts +7 -7
- package/src/resources/index.ts +34 -40
- 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 +10 -10
- package/src/resources/invoices/index.ts +2 -2
- package/src/resources/invoices/invoices.ts +8 -8
- package/src/resources/invoices/line-items.ts +5 -5
- package/src/resources/ledger-account-balance-monitors.ts +5 -5
- package/src/resources/ledger-account-categories.ts +5 -5
- package/src/resources/ledger-account-payouts.ts +5 -5
- package/src/resources/ledger-account-statements.ts +3 -3
- package/src/resources/ledger-accounts.ts +5 -5
- package/src/resources/ledger-entries.ts +5 -5
- package/src/resources/ledger-event-handlers.ts +5 -5
- package/src/resources/ledger-transactions/index.ts +2 -2
- package/src/resources/ledger-transactions/ledger-transactions.ts +7 -7
- package/src/resources/ledger-transactions/versions.ts +5 -5
- package/src/resources/ledgerable-events.ts +3 -3
- package/src/resources/ledgers.ts +5 -5
- package/src/resources/line-items.ts +5 -5
- package/src/resources/paper-items.ts +6 -6
- package/src/resources/payment-flows.ts +5 -5
- package/src/resources/payment-orders/index.ts +2 -2
- package/src/resources/payment-orders/payment-orders.ts +10 -10
- package/src/resources/payment-orders/reversals.ts +5 -5
- package/src/resources/payment-references.ts +5 -5
- package/src/resources/returns.ts +6 -6
- package/src/resources/routing-details.ts +6 -6
- package/src/resources/top-level.ts +1 -1
- package/src/resources/transactions/index.ts +2 -7
- 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 +7 -7
- package/src/resources/webhooks.ts +3 -3
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/uploads.ts +12 -16
- package/src/version.ts +1 -1
- package/uploads.d.ts +23 -39
- package/uploads.d.ts.map +1 -1
- package/uploads.js +111 -157
- package/uploads.js.map +1 -1
- package/uploads.mjs +107 -133
- package/uploads.mjs.map +1 -1
- package/version.d.ts +2 -2
- package/version.js +4 -4
- package/version.mjs +2 -2
- package/_shims/ReadableStream-node.d.ts +0 -6
- package/_shims/ReadableStream-node.d.ts.map +0 -1
- package/_shims/ReadableStream-node.js +0 -14
- package/_shims/ReadableStream-node.js.map +0 -1
- package/_shims/ReadableStream-node.mjs +0 -3
- package/_shims/ReadableStream-node.mjs.map +0 -1
- package/_shims/ReadableStream.d.ts +0 -38
- package/_shims/ReadableStream.mjs +0 -7
- package/_shims/agent-node.d.ts +0 -7
- package/_shims/agent-node.d.ts.map +0 -1
- package/_shims/agent-node.js +0 -28
- package/_shims/agent-node.js.map +0 -1
- package/_shims/agent-node.mjs +0 -16
- package/_shims/agent-node.mjs.map +0 -1
- package/_shims/agent.d.ts +0 -9
- package/_shims/agent.d.ts.map +0 -1
- package/_shims/agent.js +0 -14
- package/_shims/agent.js.map +0 -1
- package/_shims/agent.mjs +0 -10
- package/_shims/agent.mjs.map +0 -1
- package/_shims/fetch-node.d.ts +0 -64
- package/_shims/fetch-node.js +0 -12
- package/_shims/fetch-node.mjs +0 -14
- package/_shims/fetch.d.ts +0 -60
- package/_shims/fetch.js +0 -13
- package/_shims/fetch.mjs +0 -15
- package/_shims/fileFromPath-node.d.ts +0 -17
- package/_shims/fileFromPath-node.d.ts.map +0 -1
- package/_shims/fileFromPath-node.js +0 -17
- package/_shims/fileFromPath-node.js.map +0 -1
- package/_shims/fileFromPath-node.mjs +0 -13
- package/_shims/fileFromPath-node.mjs.map +0 -1
- package/_shims/fileFromPath.d.ts +0 -22
- package/_shims/fileFromPath.d.ts.map +0 -1
- package/_shims/fileFromPath.js +0 -16
- package/_shims/fileFromPath.js.map +0 -1
- package/_shims/fileFromPath.mjs +0 -12
- package/_shims/fileFromPath.mjs.map +0 -1
- package/_shims/form-data-node.d.ts +0 -45
- package/_shims/form-data-node.js +0 -11
- package/_shims/form-data-node.mjs +0 -9
- package/_shims/form-data.d.ts +0 -43
- package/_shims/form-data.js +0 -17
- package/_shims/form-data.mjs +0 -20
- package/_shims/getMultipartRequestOptions-node.d.ts +0 -10
- package/_shims/getMultipartRequestOptions-node.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions-node.js +0 -22
- package/_shims/getMultipartRequestOptions-node.js.map +0 -1
- package/_shims/getMultipartRequestOptions-node.mjs +0 -18
- package/_shims/getMultipartRequestOptions-node.mjs.map +0 -1
- package/_shims/getMultipartRequestOptions.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.js +0 -12
- package/_shims/getMultipartRequestOptions.js.map +0 -1
- package/_shims/getMultipartRequestOptions.mjs +0 -8
- package/_shims/getMultipartRequestOptions.mjs.map +0 -1
- package/_shims/node-readable-node.d.ts +0 -8
- package/_shims/node-readable-node.d.ts.map +0 -1
- package/_shims/node-readable-node.js +0 -9
- package/_shims/node-readable-node.js.map +0 -1
- package/_shims/node-readable-node.mjs +0 -5
- package/_shims/node-readable-node.mjs.map +0 -1
- package/_shims/node-readable.d.ts +0 -23
- package/_shims/node-readable.d.ts.map +0 -1
- package/_shims/node-readable.js +0 -11
- package/_shims/node-readable.js.map +0 -1
- package/_shims/node-readable.mjs +0 -7
- package/_shims/node-readable.mjs.map +0 -1
- package/src/_shims/ReadableStream.d.ts +0 -38
- package/src/_shims/ReadableStream.mjs +0 -7
- package/src/_shims/agent-node.ts +0 -22
- package/src/_shims/agent.ts +0 -12
- package/src/_shims/fetch-node.d.ts +0 -64
- package/src/_shims/fetch-node.js +0 -12
- package/src/_shims/fetch-node.mjs +0 -14
- package/src/_shims/fetch.d.ts +0 -60
- package/src/_shims/fetch.js +0 -13
- package/src/_shims/fetch.mjs +0 -15
- package/src/_shims/fileFromPath-node.ts +0 -29
- package/src/_shims/fileFromPath.ts +0 -29
- package/src/_shims/form-data-node.d.ts +0 -45
- package/src/_shims/form-data-node.js +0 -11
- package/src/_shims/form-data-node.mjs +0 -9
- package/src/_shims/form-data.d.ts +0 -43
- package/src/_shims/form-data.js +0 -17
- package/src/_shims/form-data.mjs +0 -20
- package/src/_shims/getMultipartRequestOptions-node.ts +0 -25
- package/src/_shims/getMultipartRequestOptions.ts +0 -14
- package/src/_shims/node-readable-node.ts +0 -10
- package/src/_shims/node-readable.ts +0 -30
package/index.mjs
CHANGED
|
@@ -1,124 +1,114 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless.
|
|
2
2
|
var _a;
|
|
3
|
-
import * as Core from
|
|
4
|
-
import * as Pagination from
|
|
5
|
-
import * as API from
|
|
6
|
-
import * as Errors from
|
|
7
|
-
import * as Uploads from
|
|
3
|
+
import * as Core from "./core.mjs";
|
|
4
|
+
import * as Pagination from "./pagination.mjs";
|
|
5
|
+
import * as API from "./resources/index.mjs";
|
|
6
|
+
import * as Errors from "./error.mjs";
|
|
7
|
+
import * as Uploads from "./uploads.mjs";
|
|
8
8
|
import * as qs from 'qs';
|
|
9
9
|
/** API Client for interfacing with the Modern Treasury API. */
|
|
10
10
|
export class ModernTreasury extends Core.APIClient {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
/**
|
|
12
|
+
* API Client for interfacing with the Modern Treasury API.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} [opts.apiKey=process.env['MODERN_TREASURY_API_KEY']] - The API Key to send to the API.
|
|
15
|
+
* @param {string} [opts.baseURL] - Override the default base URL for the API.
|
|
16
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
17
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
18
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
19
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
20
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
21
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
22
|
+
* @param {string} [opts.organizationId]
|
|
23
|
+
* @param {string | null} [opts.webhookKey]
|
|
24
|
+
*/
|
|
25
|
+
constructor({ apiKey = Core.readEnv('MODERN_TREASURY_API_KEY'), organizationId = Core.readEnv('MODERN_TREASURY_ORGANIZATION_ID'), webhookKey = Core.readEnv('MODERN_TREASURY_WEBHOOK_KEY') ?? null, ...opts } = {}) {
|
|
26
|
+
if (apiKey === undefined) {
|
|
27
|
+
throw new Errors.ModernTreasuryError("The MODERN_TREASURY_API_KEY environment variable is missing or empty; either provide it, or instantiate the ModernTreasury client with an apiKey option, like new ModernTreasury({ apiKey: 'my apiKey' }).");
|
|
28
|
+
}
|
|
29
|
+
if (organizationId === undefined) {
|
|
30
|
+
throw new Errors.ModernTreasuryError("The MODERN_TREASURY_ORGANIZATION_ID environment variable is missing or empty; either provide it, or instantiate the ModernTreasury client with an organizationId option, like new ModernTreasury({ organizationId: 'my-organization-ID' }).");
|
|
31
|
+
}
|
|
32
|
+
const options = {
|
|
33
|
+
apiKey,
|
|
34
|
+
organizationId,
|
|
35
|
+
webhookKey,
|
|
36
|
+
...opts,
|
|
37
|
+
baseURL: opts.baseURL ?? `https://app.moderntreasury.com`,
|
|
38
|
+
};
|
|
39
|
+
super({
|
|
40
|
+
baseURL: options.baseURL,
|
|
41
|
+
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
42
|
+
httpAgent: options.httpAgent,
|
|
43
|
+
maxRetries: options.maxRetries,
|
|
44
|
+
fetch: options.fetch,
|
|
45
|
+
});
|
|
46
|
+
this.connections = new API.Connections(this);
|
|
47
|
+
this.counterparties = new API.Counterparties(this);
|
|
48
|
+
this.events = new API.Events(this);
|
|
49
|
+
this.expectedPayments = new API.ExpectedPayments(this);
|
|
50
|
+
this.externalAccounts = new API.ExternalAccounts(this);
|
|
51
|
+
this.incomingPaymentDetails = new API.IncomingPaymentDetails(this);
|
|
52
|
+
this.invoices = new API.Invoices(this);
|
|
53
|
+
this.documents = new API.Documents(this);
|
|
54
|
+
this.accountCollectionFlows = new API.AccountCollectionFlows(this);
|
|
55
|
+
this.accountDetails = new API.AccountDetails(this);
|
|
56
|
+
this.routingDetails = new API.RoutingDetails(this);
|
|
57
|
+
this.internalAccounts = new API.InternalAccounts(this);
|
|
58
|
+
this.ledgers = new API.Ledgers(this);
|
|
59
|
+
this.ledgerableEvents = new API.LedgerableEvents(this);
|
|
60
|
+
this.ledgerAccountCategories = new API.LedgerAccountCategories(this);
|
|
61
|
+
this.ledgerAccounts = new API.LedgerAccounts(this);
|
|
62
|
+
this.ledgerAccountBalanceMonitors = new API.LedgerAccountBalanceMonitors(this);
|
|
63
|
+
this.ledgerAccountPayouts = new API.LedgerAccountPayouts(this);
|
|
64
|
+
this.ledgerAccountStatements = new API.LedgerAccountStatements(this);
|
|
65
|
+
this.ledgerEntries = new API.LedgerEntries(this);
|
|
66
|
+
this.ledgerEventHandlers = new API.LedgerEventHandlers(this);
|
|
67
|
+
this.ledgerTransactions = new API.LedgerTransactions(this);
|
|
68
|
+
this.lineItems = new API.LineItems(this);
|
|
69
|
+
this.paymentFlows = new API.PaymentFlows(this);
|
|
70
|
+
this.paymentOrders = new API.PaymentOrders(this);
|
|
71
|
+
this.paymentReferences = new API.PaymentReferences(this);
|
|
72
|
+
this.returns = new API.Returns(this);
|
|
73
|
+
this.transactions = new API.Transactions(this);
|
|
74
|
+
this.validations = new API.Validations(this);
|
|
75
|
+
this.paperItems = new API.PaperItems(this);
|
|
76
|
+
this.webhooks = new API.Webhooks(this);
|
|
77
|
+
this.virtualAccounts = new API.VirtualAccounts(this);
|
|
78
|
+
this._options = options;
|
|
79
|
+
this.idempotencyHeader = 'Idempotency-Key';
|
|
80
|
+
this.apiKey = apiKey;
|
|
81
|
+
this.organizationId = organizationId;
|
|
82
|
+
this.webhookKey = webhookKey;
|
|
37
83
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
84
|
+
/**
|
|
85
|
+
* A test endpoint often used to confirm credentials and headers are being passed
|
|
86
|
+
* in correctly.
|
|
87
|
+
*/
|
|
88
|
+
ping(options) {
|
|
89
|
+
return this.get('/api/ping', options);
|
|
90
|
+
}
|
|
91
|
+
defaultQuery() {
|
|
92
|
+
return this._options.defaultQuery;
|
|
93
|
+
}
|
|
94
|
+
defaultHeaders(opts) {
|
|
95
|
+
return {
|
|
96
|
+
...super.defaultHeaders(opts),
|
|
97
|
+
...this._options.defaultHeaders,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
authHeaders(opts) {
|
|
101
|
+
const credentials = `${this.organizationId}:${this.apiKey}`;
|
|
102
|
+
const Authorization = `Basic ${Core.toBase64(credentials)}`;
|
|
103
|
+
return { Authorization };
|
|
104
|
+
}
|
|
105
|
+
stringifyQuery(query) {
|
|
106
|
+
return qs.stringify(query, { arrayFormat: 'brackets' });
|
|
42
107
|
}
|
|
43
|
-
const options = {
|
|
44
|
-
apiKey,
|
|
45
|
-
organizationId,
|
|
46
|
-
webhookKey,
|
|
47
|
-
...opts,
|
|
48
|
-
baseURL: (_d = opts.baseURL) !== null && _d !== void 0 ? _d : `https://app.moderntreasury.com`,
|
|
49
|
-
};
|
|
50
|
-
super({
|
|
51
|
-
baseURL: options.baseURL,
|
|
52
|
-
timeout: (_e = options.timeout) !== null && _e !== void 0 ? _e : 60000 /* 1 minute */,
|
|
53
|
-
httpAgent: options.httpAgent,
|
|
54
|
-
maxRetries: options.maxRetries,
|
|
55
|
-
fetch: options.fetch,
|
|
56
|
-
});
|
|
57
|
-
this.connections = new API.Connections(this);
|
|
58
|
-
this.counterparties = new API.Counterparties(this);
|
|
59
|
-
this.events = new API.Events(this);
|
|
60
|
-
this.expectedPayments = new API.ExpectedPayments(this);
|
|
61
|
-
this.externalAccounts = new API.ExternalAccounts(this);
|
|
62
|
-
this.incomingPaymentDetails = new API.IncomingPaymentDetails(this);
|
|
63
|
-
this.invoices = new API.Invoices(this);
|
|
64
|
-
this.documents = new API.Documents(this);
|
|
65
|
-
this.accountCollectionFlows = new API.AccountCollectionFlows(this);
|
|
66
|
-
this.accountDetails = new API.AccountDetails(this);
|
|
67
|
-
this.routingDetails = new API.RoutingDetails(this);
|
|
68
|
-
this.internalAccounts = new API.InternalAccounts(this);
|
|
69
|
-
this.ledgers = new API.Ledgers(this);
|
|
70
|
-
this.ledgerableEvents = new API.LedgerableEvents(this);
|
|
71
|
-
this.ledgerAccountCategories = new API.LedgerAccountCategories(this);
|
|
72
|
-
this.ledgerAccounts = new API.LedgerAccounts(this);
|
|
73
|
-
this.ledgerAccountBalanceMonitors = new API.LedgerAccountBalanceMonitors(this);
|
|
74
|
-
this.ledgerAccountPayouts = new API.LedgerAccountPayouts(this);
|
|
75
|
-
this.ledgerAccountStatements = new API.LedgerAccountStatements(this);
|
|
76
|
-
this.ledgerEntries = new API.LedgerEntries(this);
|
|
77
|
-
this.ledgerEventHandlers = new API.LedgerEventHandlers(this);
|
|
78
|
-
this.ledgerTransactions = new API.LedgerTransactions(this);
|
|
79
|
-
this.lineItems = new API.LineItems(this);
|
|
80
|
-
this.paymentFlows = new API.PaymentFlows(this);
|
|
81
|
-
this.paymentOrders = new API.PaymentOrders(this);
|
|
82
|
-
this.paymentReferences = new API.PaymentReferences(this);
|
|
83
|
-
this.returns = new API.Returns(this);
|
|
84
|
-
this.transactions = new API.Transactions(this);
|
|
85
|
-
this.validations = new API.Validations(this);
|
|
86
|
-
this.paperItems = new API.PaperItems(this);
|
|
87
|
-
this.webhooks = new API.Webhooks(this);
|
|
88
|
-
this.virtualAccounts = new API.VirtualAccounts(this);
|
|
89
|
-
this._options = options;
|
|
90
|
-
this.idempotencyHeader = 'Idempotency-Key';
|
|
91
|
-
this.apiKey = apiKey;
|
|
92
|
-
this.organizationId = organizationId;
|
|
93
|
-
this.webhookKey = webhookKey;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* A test endpoint often used to confirm credentials and headers are being passed
|
|
97
|
-
* in correctly.
|
|
98
|
-
*/
|
|
99
|
-
ping(options) {
|
|
100
|
-
return this.get('/api/ping', options);
|
|
101
|
-
}
|
|
102
|
-
defaultQuery() {
|
|
103
|
-
return this._options.defaultQuery;
|
|
104
|
-
}
|
|
105
|
-
defaultHeaders(opts) {
|
|
106
|
-
return {
|
|
107
|
-
...super.defaultHeaders(opts),
|
|
108
|
-
...this._options.defaultHeaders,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
authHeaders(opts) {
|
|
112
|
-
const credentials = `${this.organizationId}:${this.apiKey}`;
|
|
113
|
-
const Authorization = `Basic ${Core.toBase64(credentials)}`;
|
|
114
|
-
return { Authorization };
|
|
115
|
-
}
|
|
116
|
-
stringifyQuery(query) {
|
|
117
|
-
return qs.stringify(query, { arrayFormat: 'brackets' });
|
|
118
|
-
}
|
|
119
108
|
}
|
|
120
109
|
_a = ModernTreasury;
|
|
121
110
|
ModernTreasury.ModernTreasury = _a;
|
|
111
|
+
ModernTreasury.ModernTreasuryError = Errors.ModernTreasuryError;
|
|
122
112
|
ModernTreasury.APIError = Errors.APIError;
|
|
123
113
|
ModernTreasury.APIConnectionError = Errors.APIConnectionError;
|
|
124
114
|
ModernTreasury.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
@@ -131,87 +121,74 @@ ModernTreasury.AuthenticationError = Errors.AuthenticationError;
|
|
|
131
121
|
ModernTreasury.InternalServerError = Errors.InternalServerError;
|
|
132
122
|
ModernTreasury.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
133
123
|
ModernTreasury.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
134
|
-
export const {
|
|
135
|
-
APIError,
|
|
136
|
-
APIConnectionError,
|
|
137
|
-
APIConnectionTimeoutError,
|
|
138
|
-
APIUserAbortError,
|
|
139
|
-
NotFoundError,
|
|
140
|
-
ConflictError,
|
|
141
|
-
RateLimitError,
|
|
142
|
-
BadRequestError,
|
|
143
|
-
AuthenticationError,
|
|
144
|
-
InternalServerError,
|
|
145
|
-
PermissionDeniedError,
|
|
146
|
-
UnprocessableEntityError,
|
|
147
|
-
} = Errors;
|
|
124
|
+
export const { ModernTreasuryError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } = Errors;
|
|
148
125
|
export var toFile = Uploads.toFile;
|
|
149
126
|
export var fileFromPath = Uploads.fileFromPath;
|
|
150
127
|
(function (ModernTreasury) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
128
|
+
// Helper functions
|
|
129
|
+
ModernTreasury.toFile = Uploads.toFile;
|
|
130
|
+
ModernTreasury.fileFromPath = Uploads.fileFromPath;
|
|
131
|
+
ModernTreasury.Page = Pagination.Page;
|
|
132
|
+
ModernTreasury.Connections = API.Connections;
|
|
133
|
+
ModernTreasury.ConnectionsPage = API.ConnectionsPage;
|
|
134
|
+
ModernTreasury.Counterparties = API.Counterparties;
|
|
135
|
+
ModernTreasury.CounterpartiesPage = API.CounterpartiesPage;
|
|
136
|
+
ModernTreasury.Events = API.Events;
|
|
137
|
+
ModernTreasury.EventsPage = API.EventsPage;
|
|
138
|
+
ModernTreasury.ExpectedPayments = API.ExpectedPayments;
|
|
139
|
+
ModernTreasury.ExpectedPaymentsPage = API.ExpectedPaymentsPage;
|
|
140
|
+
ModernTreasury.ExternalAccounts = API.ExternalAccounts;
|
|
141
|
+
ModernTreasury.ExternalAccountsPage = API.ExternalAccountsPage;
|
|
142
|
+
ModernTreasury.IncomingPaymentDetails = API.IncomingPaymentDetails;
|
|
143
|
+
ModernTreasury.IncomingPaymentDetailsPage = API.IncomingPaymentDetailsPage;
|
|
144
|
+
ModernTreasury.Invoices = API.Invoices;
|
|
145
|
+
ModernTreasury.InvoicesPage = API.InvoicesPage;
|
|
146
|
+
ModernTreasury.Documents = API.Documents;
|
|
147
|
+
ModernTreasury.DocumentsPage = API.DocumentsPage;
|
|
148
|
+
ModernTreasury.AccountCollectionFlows = API.AccountCollectionFlows;
|
|
149
|
+
ModernTreasury.AccountCollectionFlowsPage = API.AccountCollectionFlowsPage;
|
|
150
|
+
ModernTreasury.AccountDetails = API.AccountDetails;
|
|
151
|
+
ModernTreasury.AccountDetailsPage = API.AccountDetailsPage;
|
|
152
|
+
ModernTreasury.RoutingDetails = API.RoutingDetails;
|
|
153
|
+
ModernTreasury.RoutingDetailsPage = API.RoutingDetailsPage;
|
|
154
|
+
ModernTreasury.InternalAccounts = API.InternalAccounts;
|
|
155
|
+
ModernTreasury.InternalAccountsPage = API.InternalAccountsPage;
|
|
156
|
+
ModernTreasury.Ledgers = API.Ledgers;
|
|
157
|
+
ModernTreasury.LedgersPage = API.LedgersPage;
|
|
158
|
+
ModernTreasury.LedgerableEvents = API.LedgerableEvents;
|
|
159
|
+
ModernTreasury.LedgerAccountCategories = API.LedgerAccountCategories;
|
|
160
|
+
ModernTreasury.LedgerAccountCategoriesPage = API.LedgerAccountCategoriesPage;
|
|
161
|
+
ModernTreasury.LedgerAccounts = API.LedgerAccounts;
|
|
162
|
+
ModernTreasury.LedgerAccountsPage = API.LedgerAccountsPage;
|
|
163
|
+
ModernTreasury.LedgerAccountBalanceMonitors = API.LedgerAccountBalanceMonitors;
|
|
164
|
+
ModernTreasury.LedgerAccountBalanceMonitorsPage = API.LedgerAccountBalanceMonitorsPage;
|
|
165
|
+
ModernTreasury.LedgerAccountPayouts = API.LedgerAccountPayouts;
|
|
166
|
+
ModernTreasury.LedgerAccountPayoutsPage = API.LedgerAccountPayoutsPage;
|
|
167
|
+
ModernTreasury.LedgerAccountStatements = API.LedgerAccountStatements;
|
|
168
|
+
ModernTreasury.LedgerEntries = API.LedgerEntries;
|
|
169
|
+
ModernTreasury.LedgerEntriesPage = API.LedgerEntriesPage;
|
|
170
|
+
ModernTreasury.LedgerEventHandlers = API.LedgerEventHandlers;
|
|
171
|
+
ModernTreasury.LedgerEventHandlerListResponsesPage = API.LedgerEventHandlerListResponsesPage;
|
|
172
|
+
ModernTreasury.LedgerTransactions = API.LedgerTransactions;
|
|
173
|
+
ModernTreasury.LedgerTransactionsPage = API.LedgerTransactionsPage;
|
|
174
|
+
ModernTreasury.LineItems = API.LineItems;
|
|
175
|
+
ModernTreasury.LineItemsPage = API.LineItemsPage;
|
|
176
|
+
ModernTreasury.PaymentFlows = API.PaymentFlows;
|
|
177
|
+
ModernTreasury.PaymentFlowsPage = API.PaymentFlowsPage;
|
|
178
|
+
ModernTreasury.PaymentOrders = API.PaymentOrders;
|
|
179
|
+
ModernTreasury.PaymentOrdersPage = API.PaymentOrdersPage;
|
|
180
|
+
ModernTreasury.PaymentReferences = API.PaymentReferences;
|
|
181
|
+
ModernTreasury.PaymentReferencesPage = API.PaymentReferencesPage;
|
|
182
|
+
ModernTreasury.Returns = API.Returns;
|
|
183
|
+
ModernTreasury.ReturnObjectsPage = API.ReturnObjectsPage;
|
|
184
|
+
ModernTreasury.Transactions = API.Transactions;
|
|
185
|
+
ModernTreasury.TransactionsPage = API.TransactionsPage;
|
|
186
|
+
ModernTreasury.Validations = API.Validations;
|
|
187
|
+
ModernTreasury.PaperItems = API.PaperItems;
|
|
188
|
+
ModernTreasury.PaperItemsPage = API.PaperItemsPage;
|
|
189
|
+
ModernTreasury.Webhooks = API.Webhooks;
|
|
190
|
+
ModernTreasury.VirtualAccounts = API.VirtualAccounts;
|
|
191
|
+
ModernTreasury.VirtualAccountsPage = API.VirtualAccountsPage;
|
|
215
192
|
})(ModernTreasury || (ModernTreasury = {}));
|
|
216
193
|
export default ModernTreasury;
|
|
217
|
-
//# sourceMappingURL=index.mjs.map
|
|
194
|
+
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;;OAE9C,KAAK,IAAI;OACT,KAAK,UAAU;OACf,KAAK,GAAG;OACR,KAAK,MAAM;OAEX,KAAK,OAAO;OACZ,KAA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modern Treasury <sdk-feedback@moderntreasury.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -9,76 +9,49 @@
|
|
|
9
9
|
"repository": "github:Modern-Treasury/modern-treasury-node",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"private": false,
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"./_shims/index.js",
|
|
14
|
+
"./_shims/index.mjs",
|
|
15
|
+
"./shims/node.js",
|
|
16
|
+
"./shims/node.mjs",
|
|
17
|
+
"./shims/web.js",
|
|
18
|
+
"./shims/web.mjs"
|
|
19
|
+
],
|
|
12
20
|
"exports": {
|
|
13
|
-
"./_shims/
|
|
21
|
+
"./_shims/auto/*": {
|
|
14
22
|
"deno": {
|
|
15
|
-
"types": "./_shims/
|
|
16
|
-
"require": "./_shims/
|
|
17
|
-
"default": "./_shims/
|
|
23
|
+
"types": "./_shims/auto/*.d.ts",
|
|
24
|
+
"require": "./_shims/auto/*.js",
|
|
25
|
+
"default": "./_shims/auto/*.mjs"
|
|
18
26
|
},
|
|
19
27
|
"bun": {
|
|
20
|
-
"types": "./_shims/
|
|
21
|
-
"require": "./_shims/
|
|
22
|
-
"default": "./_shims/
|
|
28
|
+
"types": "./_shims/auto/*.d.ts",
|
|
29
|
+
"require": "./_shims/auto/*-bun.js",
|
|
30
|
+
"default": "./_shims/auto/*-bun.mjs"
|
|
23
31
|
},
|
|
24
32
|
"browser": {
|
|
25
|
-
"types": "./_shims/
|
|
26
|
-
"require": "./_shims/
|
|
27
|
-
"default": "./_shims/
|
|
33
|
+
"types": "./_shims/auto/*.d.ts",
|
|
34
|
+
"require": "./_shims/auto/*.js",
|
|
35
|
+
"default": "./_shims/auto/*.mjs"
|
|
28
36
|
},
|
|
29
37
|
"worker": {
|
|
30
|
-
"types": "./_shims/
|
|
31
|
-
"require": "./_shims/
|
|
32
|
-
"default": "./_shims/
|
|
38
|
+
"types": "./_shims/auto/*.d.ts",
|
|
39
|
+
"require": "./_shims/auto/*.js",
|
|
40
|
+
"default": "./_shims/auto/*.mjs"
|
|
33
41
|
},
|
|
34
42
|
"workerd": {
|
|
35
|
-
"types": "./_shims/
|
|
36
|
-
"require": "./_shims/
|
|
37
|
-
"default": "./_shims/
|
|
43
|
+
"types": "./_shims/auto/*.d.ts",
|
|
44
|
+
"require": "./_shims/auto/*.js",
|
|
45
|
+
"default": "./_shims/auto/*.mjs"
|
|
38
46
|
},
|
|
39
47
|
"node": {
|
|
40
|
-
"types": "./_shims/node
|
|
41
|
-
"require": "./_shims/node
|
|
42
|
-
"default": "./_shims/node
|
|
48
|
+
"types": "./_shims/auto/*-node.d.ts",
|
|
49
|
+
"require": "./_shims/auto/*-node.js",
|
|
50
|
+
"default": "./_shims/auto/*-node.mjs"
|
|
43
51
|
},
|
|
44
|
-
"types": "./_shims/
|
|
45
|
-
"require": "./_shims/
|
|
46
|
-
"default": "./_shims/
|
|
47
|
-
},
|
|
48
|
-
"./_shims/*": {
|
|
49
|
-
"deno": {
|
|
50
|
-
"types": "./_shims/*.d.ts",
|
|
51
|
-
"require": "./_shims/*.js",
|
|
52
|
-
"default": "./_shims/*.mjs"
|
|
53
|
-
},
|
|
54
|
-
"bun": {
|
|
55
|
-
"types": "./_shims/*.d.ts",
|
|
56
|
-
"require": "./_shims/*.js",
|
|
57
|
-
"default": "./_shims/*.mjs"
|
|
58
|
-
},
|
|
59
|
-
"browser": {
|
|
60
|
-
"types": "./_shims/*.d.ts",
|
|
61
|
-
"require": "./_shims/*.js",
|
|
62
|
-
"default": "./_shims/*.mjs"
|
|
63
|
-
},
|
|
64
|
-
"worker": {
|
|
65
|
-
"types": "./_shims/*.d.ts",
|
|
66
|
-
"require": "./_shims/*.js",
|
|
67
|
-
"default": "./_shims/*.mjs"
|
|
68
|
-
},
|
|
69
|
-
"workerd": {
|
|
70
|
-
"types": "./_shims/*.d.ts",
|
|
71
|
-
"require": "./_shims/*.js",
|
|
72
|
-
"default": "./_shims/*.mjs"
|
|
73
|
-
},
|
|
74
|
-
"node": {
|
|
75
|
-
"types": "./_shims/*-node.d.ts",
|
|
76
|
-
"require": "./_shims/*-node.js",
|
|
77
|
-
"default": "./_shims/*-node.mjs"
|
|
78
|
-
},
|
|
79
|
-
"types": "./_shims/*.d.ts",
|
|
80
|
-
"require": "./_shims/*.js",
|
|
81
|
-
"default": "./_shims/*.mjs"
|
|
52
|
+
"types": "./_shims/auto/*.d.ts",
|
|
53
|
+
"require": "./_shims/auto/*.js",
|
|
54
|
+
"default": "./_shims/auto/*.mjs"
|
|
82
55
|
},
|
|
83
56
|
".": {
|
|
84
57
|
"require": {
|
|
@@ -107,6 +80,7 @@
|
|
|
107
80
|
"build": "bash ./build",
|
|
108
81
|
"format": "prettier --write --cache --cache-strategy metadata . !dist",
|
|
109
82
|
"tsn": "ts-node -r tsconfig-paths/register",
|
|
83
|
+
"lint": "eslint --ext ts,js .",
|
|
110
84
|
"fix": "eslint --fix --ext ts,js ."
|
|
111
85
|
},
|
|
112
86
|
"dependencies": {
|
package/pagination.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from
|
|
1
|
+
import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from "./core.js";
|
|
2
2
|
export type PageResponse<Item> = Item[];
|
|
3
3
|
export interface PageParams {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
after_cursor?: string | null;
|
|
5
|
+
per_page?: number;
|
|
6
6
|
}
|
|
7
7
|
export declare class Page<Item> extends AbstractPage<Item> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
items: Array<Item>;
|
|
9
|
+
per_page: number | null;
|
|
10
|
+
after_cursor: string | null;
|
|
11
|
+
constructor(client: APIClient, response: Response, body: PageResponse<Item>, options: FinalRequestOptions);
|
|
12
|
+
getPaginatedItems(): Item[];
|
|
13
|
+
nextPageParams(): Partial<PageParams> | null;
|
|
14
|
+
nextPageInfo(): PageInfo | null;
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=pagination.d.ts.map
|
|
16
|
+
//# sourceMappingURL=pagination.d.ts.map
|
package/pagination.js
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
Object.defineProperty(exports,
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Page = void 0;
|
|
5
|
-
const core_1 = require(
|
|
5
|
+
const core_1 = require("./core.js");
|
|
6
6
|
class Page extends core_1.AbstractPage {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
7
|
+
constructor(client, response, body, options) {
|
|
8
|
+
super(client, response, body, options);
|
|
9
|
+
this.items = body || [];
|
|
10
|
+
this.per_page = (0, core_1.coerceInteger)(this.response.headers.get('x-per-page') || null);
|
|
11
|
+
this.after_cursor = this.response.headers.get('x-after-cursor') || null;
|
|
12
|
+
}
|
|
13
|
+
getPaginatedItems() {
|
|
14
|
+
return this.items;
|
|
15
|
+
}
|
|
16
|
+
// @deprecated Please use `nextPageInfo()` instead
|
|
17
|
+
nextPageParams() {
|
|
18
|
+
const info = this.nextPageInfo();
|
|
19
|
+
if (!info)
|
|
20
|
+
return null;
|
|
21
|
+
if ('params' in info)
|
|
22
|
+
return info.params;
|
|
23
|
+
const params = Object.fromEntries(info.url.searchParams);
|
|
24
|
+
if (!Object.keys(params).length)
|
|
25
|
+
return null;
|
|
26
|
+
return params;
|
|
27
|
+
}
|
|
28
|
+
nextPageInfo() {
|
|
29
|
+
if (!this.after_cursor)
|
|
30
|
+
return null;
|
|
31
|
+
return { params: { after_cursor: this.after_cursor } };
|
|
32
|
+
}
|
|
29
33
|
}
|
|
30
34
|
exports.Page = Page;
|
|
31
|
-
//# sourceMappingURL=pagination.js.map
|
|
35
|
+
//# sourceMappingURL=pagination.js.map
|