increase 0.3.0 → 0.5.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 +87 -0
- package/README.md +22 -8
- package/_shims/agent.node.ts +20 -0
- package/_shims/agent.ts +12 -0
- package/_shims/fetch.node.ts +11 -0
- package/_shims/fetch.ts +32 -0
- package/_shims/fileFromPath.node.ts +30 -0
- package/_shims/fileFromPath.ts +30 -0
- package/_shims/formdata.node.ts +9 -0
- package/_shims/formdata.ts +22 -0
- package/_shims/getMultipartRequestOptions.node.ts +24 -0
- package/_shims/getMultipartRequestOptions.ts +13 -0
- package/_shims/newFileArgs.ts +94 -0
- package/_shims/toFile.node.ts +25 -0
- package/_shims/toFile.ts +26 -0
- package/_shims/uploadable.node.ts +21 -0
- package/_shims/uploadable.ts +82 -0
- package/core.ts +38 -227
- package/dist/cjs/_shims/agent.d.ts +9 -0
- package/dist/cjs/_shims/agent.d.ts.map +1 -0
- package/dist/cjs/_shims/agent.js +14 -0
- package/dist/cjs/_shims/agent.js.map +1 -0
- package/dist/cjs/_shims/agent.node.d.ts +6 -0
- package/dist/cjs/_shims/agent.node.d.ts.map +1 -0
- package/dist/cjs/_shims/agent.node.js +28 -0
- package/dist/cjs/_shims/agent.node.js.map +1 -0
- package/dist/cjs/_shims/fetch.d.ts +19 -0
- package/dist/cjs/_shims/fetch.d.ts.map +1 -0
- package/dist/cjs/_shims/fetch.js +24 -0
- package/dist/cjs/_shims/fetch.js.map +1 -0
- package/dist/cjs/_shims/fetch.node.d.ts +9 -0
- package/dist/cjs/_shims/fetch.node.d.ts.map +1 -0
- package/dist/cjs/_shims/fetch.node.js +68 -0
- package/dist/cjs/_shims/fetch.node.js.map +1 -0
- package/dist/cjs/_shims/fileFromPath.d.ts +23 -0
- package/dist/cjs/_shims/fileFromPath.d.ts.map +1 -0
- package/dist/cjs/{tests/api-resources/simulations/documents.test.js → _shims/fileFromPath.js} +16 -19
- package/dist/cjs/_shims/fileFromPath.js.map +1 -0
- package/dist/cjs/_shims/fileFromPath.node.d.ts +18 -0
- package/dist/cjs/_shims/fileFromPath.node.d.ts.map +1 -0
- package/dist/cjs/{tests/form.test.js → _shims/fileFromPath.node.js} +16 -27
- package/dist/cjs/_shims/fileFromPath.node.js.map +1 -0
- package/dist/cjs/_shims/formdata.d.ts +13 -0
- package/dist/cjs/_shims/formdata.d.ts.map +1 -0
- package/dist/cjs/_shims/formdata.js +20 -0
- package/dist/cjs/_shims/formdata.js.map +1 -0
- package/dist/cjs/_shims/formdata.node.d.ts +7 -0
- package/dist/cjs/_shims/formdata.node.d.ts.map +1 -0
- package/dist/cjs/_shims/formdata.node.js +27 -0
- package/dist/cjs/_shims/formdata.node.js.map +1 -0
- package/dist/cjs/_shims/getMultipartRequestOptions.d.ts +10 -0
- package/dist/cjs/_shims/getMultipartRequestOptions.d.ts.map +1 -0
- package/dist/cjs/{tests/api-resources/simulations/card-refunds.test.js → _shims/getMultipartRequestOptions.js} +11 -19
- package/dist/cjs/_shims/getMultipartRequestOptions.js.map +1 -0
- package/dist/cjs/_shims/getMultipartRequestOptions.node.d.ts +10 -0
- package/dist/cjs/_shims/getMultipartRequestOptions.node.d.ts.map +1 -0
- package/dist/cjs/{tests/api-resources/simulations/account-statements.test.js → _shims/getMultipartRequestOptions.node.js} +19 -19
- package/dist/cjs/_shims/getMultipartRequestOptions.node.js.map +1 -0
- package/dist/cjs/_shims/newFileArgs.d.ts +19 -0
- package/dist/cjs/_shims/newFileArgs.d.ts.map +1 -0
- package/dist/cjs/_shims/newFileArgs.js +169 -0
- package/dist/cjs/_shims/newFileArgs.js.map +1 -0
- package/dist/cjs/_shims/toFile.d.ts +21 -0
- package/dist/cjs/_shims/toFile.d.ts.map +1 -0
- package/dist/cjs/_shims/toFile.js +56 -0
- package/dist/cjs/_shims/toFile.js.map +1 -0
- package/dist/cjs/_shims/toFile.node.d.ts +20 -0
- package/dist/cjs/_shims/toFile.node.d.ts.map +1 -0
- package/dist/cjs/_shims/toFile.node.js +56 -0
- package/dist/cjs/_shims/toFile.node.js.map +1 -0
- package/dist/cjs/_shims/uploadable.d.ts +56 -0
- package/dist/cjs/_shims/uploadable.d.ts.map +1 -0
- package/dist/cjs/_shims/uploadable.js +37 -0
- package/dist/cjs/_shims/uploadable.js.map +1 -0
- package/dist/cjs/_shims/uploadable.node.d.ts +7 -0
- package/dist/cjs/_shims/uploadable.node.d.ts.map +1 -0
- package/dist/cjs/_shims/uploadable.node.js +23 -0
- package/dist/cjs/_shims/uploadable.node.js.map +1 -0
- package/dist/cjs/core.d.ts +9 -70
- package/dist/cjs/core.d.ts.map +1 -1
- package/dist/cjs/core.js +57 -253
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/error.d.ts +72 -27
- package/dist/cjs/error.d.ts.map +1 -1
- package/dist/cjs/error.js +203 -81
- package/dist/cjs/error.js.map +1 -1
- package/dist/cjs/index.d.ts +68 -31
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +77 -80
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/pagination.d.ts +3 -1
- package/dist/cjs/pagination.d.ts.map +1 -1
- package/dist/cjs/pagination.js.map +1 -1
- package/dist/cjs/resources/account-numbers.d.ts +13 -24
- package/dist/cjs/resources/account-numbers.d.ts.map +1 -1
- package/dist/cjs/resources/account-numbers.js +44 -0
- package/dist/cjs/resources/account-numbers.js.map +1 -1
- package/dist/cjs/resources/account-statements.d.ts +11 -24
- package/dist/cjs/resources/account-statements.d.ts.map +1 -1
- package/dist/cjs/resources/account-statements.js +44 -0
- package/dist/cjs/resources/account-statements.js.map +1 -1
- package/dist/cjs/resources/account-transfers.d.ts +12 -24
- package/dist/cjs/resources/account-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/account-transfers.js +44 -0
- package/dist/cjs/resources/account-transfers.js.map +1 -1
- package/dist/cjs/resources/accounts.d.ts +29 -29
- package/dist/cjs/resources/accounts.d.ts.map +1 -1
- package/dist/cjs/resources/accounts.js +44 -0
- package/dist/cjs/resources/accounts.js.map +1 -1
- package/dist/cjs/resources/ach-prenotifications.d.ts +17 -29
- package/dist/cjs/resources/ach-prenotifications.d.ts.map +1 -1
- package/dist/cjs/resources/ach-prenotifications.js +44 -0
- package/dist/cjs/resources/ach-prenotifications.js.map +1 -1
- package/dist/cjs/resources/ach-transfers.d.ts +80 -41
- package/dist/cjs/resources/ach-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/ach-transfers.js +44 -0
- package/dist/cjs/resources/ach-transfers.js.map +1 -1
- package/dist/cjs/resources/balance-lookups.d.ts +5 -0
- package/dist/cjs/resources/balance-lookups.d.ts.map +1 -1
- package/dist/cjs/resources/balance-lookups.js +1 -0
- package/dist/cjs/resources/balance-lookups.js.map +1 -1
- package/dist/cjs/resources/bookkeeping-accounts.d.ts +15 -8
- package/dist/cjs/resources/bookkeeping-accounts.d.ts.map +1 -1
- package/dist/cjs/resources/bookkeeping-accounts.js +44 -0
- package/dist/cjs/resources/bookkeeping-accounts.js.map +1 -1
- package/dist/cjs/resources/bookkeeping-entries.d.ts +10 -4
- package/dist/cjs/resources/bookkeeping-entries.d.ts.map +1 -1
- package/dist/cjs/resources/bookkeeping-entries.js +44 -0
- package/dist/cjs/resources/bookkeeping-entries.js.map +1 -1
- package/dist/cjs/resources/bookkeeping-entry-sets.d.ts +20 -27
- package/dist/cjs/resources/bookkeeping-entry-sets.d.ts.map +1 -1
- package/dist/cjs/resources/bookkeeping-entry-sets.js +3 -0
- package/dist/cjs/resources/bookkeeping-entry-sets.js.map +1 -1
- package/dist/cjs/resources/card-disputes.d.ts +13 -30
- package/dist/cjs/resources/card-disputes.d.ts.map +1 -1
- package/dist/cjs/resources/card-disputes.js +44 -0
- package/dist/cjs/resources/card-disputes.js.map +1 -1
- package/dist/cjs/resources/card-profiles.d.ts +12 -67
- package/dist/cjs/resources/card-profiles.d.ts.map +1 -1
- package/dist/cjs/resources/card-profiles.js +44 -0
- package/dist/cjs/resources/card-profiles.js.map +1 -1
- package/dist/cjs/resources/cards.d.ts +16 -122
- package/dist/cjs/resources/cards.d.ts.map +1 -1
- package/dist/cjs/resources/cards.js +44 -0
- package/dist/cjs/resources/cards.js.map +1 -1
- package/dist/cjs/resources/check-deposits.d.ts +14 -25
- package/dist/cjs/resources/check-deposits.d.ts.map +1 -1
- package/dist/cjs/resources/check-deposits.js +44 -0
- package/dist/cjs/resources/check-deposits.js.map +1 -1
- package/dist/cjs/resources/check-transfers.d.ts +92 -132
- package/dist/cjs/resources/check-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/check-transfers.js +44 -0
- package/dist/cjs/resources/check-transfers.js.map +1 -1
- package/dist/cjs/resources/declined-transactions.d.ts +12 -52
- package/dist/cjs/resources/declined-transactions.d.ts.map +1 -1
- package/dist/cjs/resources/declined-transactions.js +44 -0
- package/dist/cjs/resources/declined-transactions.js.map +1 -1
- package/dist/cjs/resources/digital-wallet-tokens.d.ts +11 -24
- package/dist/cjs/resources/digital-wallet-tokens.d.ts.map +1 -1
- package/dist/cjs/resources/digital-wallet-tokens.js +44 -0
- package/dist/cjs/resources/digital-wallet-tokens.js.map +1 -1
- package/dist/cjs/resources/documents.d.ts +14 -181
- package/dist/cjs/resources/documents.d.ts.map +1 -1
- package/dist/cjs/resources/documents.js +44 -0
- package/dist/cjs/resources/documents.js.map +1 -1
- package/dist/cjs/resources/entities/entities.d.ts +297 -1225
- package/dist/cjs/resources/entities/entities.d.ts.map +1 -1
- package/dist/cjs/resources/entities/entities.js +46 -0
- package/dist/cjs/resources/entities/entities.js.map +1 -1
- package/dist/cjs/resources/entities/index.d.ts +8 -2
- package/dist/cjs/resources/entities/index.d.ts.map +1 -1
- package/dist/cjs/resources/entities/index.js +24 -1
- package/dist/cjs/resources/entities/index.js.map +1 -1
- package/dist/cjs/resources/entities/supplemental-documents.d.ts +42 -0
- package/dist/cjs/resources/entities/supplemental-documents.d.ts.map +1 -1
- package/dist/cjs/resources/entities/supplemental-documents.js +58 -1
- package/dist/cjs/resources/entities/supplemental-documents.js.map +1 -1
- package/dist/cjs/resources/event-subscriptions.d.ts +16 -8
- package/dist/cjs/resources/event-subscriptions.d.ts.map +1 -1
- package/dist/cjs/resources/event-subscriptions.js +44 -0
- package/dist/cjs/resources/event-subscriptions.js.map +1 -1
- package/dist/cjs/resources/events.d.ts +34 -103
- package/dist/cjs/resources/events.d.ts.map +1 -1
- package/dist/cjs/resources/events.js +44 -0
- package/dist/cjs/resources/events.js.map +1 -1
- package/dist/cjs/resources/exports.d.ts +15 -90
- package/dist/cjs/resources/exports.d.ts.map +1 -1
- package/dist/cjs/resources/exports.js +44 -0
- package/dist/cjs/resources/exports.js.map +1 -1
- package/dist/cjs/resources/external-accounts.d.ts +17 -14
- package/dist/cjs/resources/external-accounts.d.ts.map +1 -1
- package/dist/cjs/resources/external-accounts.js +44 -0
- package/dist/cjs/resources/external-accounts.js.map +1 -1
- package/dist/cjs/resources/files.d.ts +25 -49
- package/dist/cjs/resources/files.d.ts.map +1 -1
- package/dist/cjs/resources/files.js +82 -2
- package/dist/cjs/resources/files.js.map +1 -1
- package/dist/cjs/resources/groups.d.ts +8 -4
- package/dist/cjs/resources/groups.d.ts.map +1 -1
- package/dist/cjs/resources/groups.js +1 -0
- package/dist/cjs/resources/groups.js.map +1 -1
- package/dist/cjs/resources/inbound-ach-transfer-returns.d.ts +7 -0
- package/dist/cjs/resources/inbound-ach-transfer-returns.d.ts.map +1 -1
- package/dist/cjs/resources/inbound-ach-transfer-returns.js +46 -0
- package/dist/cjs/resources/inbound-ach-transfer-returns.js.map +1 -1
- package/dist/cjs/resources/inbound-wire-drawdown-requests.d.ts +10 -4
- package/dist/cjs/resources/inbound-wire-drawdown-requests.d.ts.map +1 -1
- package/dist/cjs/resources/inbound-wire-drawdown-requests.js +47 -0
- package/dist/cjs/resources/inbound-wire-drawdown-requests.js.map +1 -1
- package/dist/cjs/resources/limits.d.ts +12 -4
- package/dist/cjs/resources/limits.d.ts.map +1 -1
- package/dist/cjs/resources/limits.js +44 -0
- package/dist/cjs/resources/limits.js.map +1 -1
- package/dist/cjs/resources/oauth-connections.d.ts +10 -4
- package/dist/cjs/resources/oauth-connections.d.ts.map +1 -1
- package/dist/cjs/resources/oauth-connections.js +44 -0
- package/dist/cjs/resources/oauth-connections.js.map +1 -1
- package/dist/cjs/resources/pending-transactions.d.ts +25 -94
- package/dist/cjs/resources/pending-transactions.d.ts.map +1 -1
- package/dist/cjs/resources/pending-transactions.js +44 -0
- package/dist/cjs/resources/pending-transactions.js.map +1 -1
- package/dist/cjs/resources/programs.d.ts +10 -4
- package/dist/cjs/resources/programs.d.ts.map +1 -1
- package/dist/cjs/resources/programs.js +44 -0
- package/dist/cjs/resources/programs.js.map +1 -1
- package/dist/cjs/resources/real-time-decisions.d.ts +33 -97
- package/dist/cjs/resources/real-time-decisions.d.ts.map +1 -1
- package/dist/cjs/resources/real-time-decisions.js +3 -0
- package/dist/cjs/resources/real-time-decisions.js.map +1 -1
- package/dist/cjs/resources/real-time-payments-transfers.d.ts +35 -47
- package/dist/cjs/resources/real-time-payments-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/real-time-payments-transfers.js +46 -0
- package/dist/cjs/resources/real-time-payments-transfers.js.map +1 -1
- package/dist/cjs/resources/routing-numbers.d.ts +6 -0
- package/dist/cjs/resources/routing-numbers.d.ts.map +1 -1
- package/dist/cjs/resources/routing-numbers.js +44 -0
- package/dist/cjs/resources/routing-numbers.js.map +1 -1
- package/dist/cjs/resources/simulations/account-statements.d.ts +4 -0
- package/dist/cjs/resources/simulations/account-statements.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/account-statements.js +3 -0
- package/dist/cjs/resources/simulations/account-statements.js.map +1 -1
- package/dist/cjs/resources/simulations/ach-transfers.d.ts +1264 -1335
- package/dist/cjs/resources/simulations/ach-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/ach-transfers.js +1 -0
- package/dist/cjs/resources/simulations/ach-transfers.js.map +1 -1
- package/dist/cjs/resources/simulations/card-disputes.d.ts +8 -4
- package/dist/cjs/resources/simulations/card-disputes.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/card-disputes.js +1 -0
- package/dist/cjs/resources/simulations/card-disputes.js.map +1 -1
- package/dist/cjs/resources/simulations/card-refunds.d.ts +4 -0
- package/dist/cjs/resources/simulations/card-refunds.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/card-refunds.js +1 -0
- package/dist/cjs/resources/simulations/card-refunds.js.map +1 -1
- package/dist/cjs/resources/simulations/cards.d.ts +449 -520
- package/dist/cjs/resources/simulations/cards.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/cards.js +1 -0
- package/dist/cjs/resources/simulations/cards.js.map +1 -1
- package/dist/cjs/resources/simulations/check-transfers.d.ts +4 -0
- package/dist/cjs/resources/simulations/check-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/check-transfers.js +1 -0
- package/dist/cjs/resources/simulations/check-transfers.js.map +1 -1
- package/dist/cjs/resources/simulations/digital-wallet-token-requests.d.ts +5 -0
- package/dist/cjs/resources/simulations/digital-wallet-token-requests.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/digital-wallet-token-requests.js +4 -0
- package/dist/cjs/resources/simulations/digital-wallet-token-requests.js.map +1 -1
- package/dist/cjs/resources/simulations/documents.d.ts +4 -0
- package/dist/cjs/resources/simulations/documents.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/documents.js +1 -0
- package/dist/cjs/resources/simulations/documents.js.map +1 -1
- package/dist/cjs/resources/simulations/inbound-wire-drawdown-requests.d.ts +29 -25
- package/dist/cjs/resources/simulations/inbound-wire-drawdown-requests.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/inbound-wire-drawdown-requests.js +4 -0
- package/dist/cjs/resources/simulations/inbound-wire-drawdown-requests.js.map +1 -1
- package/dist/cjs/resources/simulations/index.d.ts +23 -9
- package/dist/cjs/resources/simulations/index.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/index.js +129 -0
- package/dist/cjs/resources/simulations/index.js.map +1 -1
- package/dist/cjs/resources/simulations/interest-payments.d.ts +173 -265
- package/dist/cjs/resources/simulations/interest-payments.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/interest-payments.js +3 -0
- package/dist/cjs/resources/simulations/interest-payments.js.map +1 -1
- package/dist/cjs/resources/simulations/programs.d.ts +25 -0
- package/dist/cjs/resources/simulations/programs.d.ts.map +1 -0
- package/dist/cjs/resources/simulations/programs.js +18 -0
- package/dist/cjs/resources/simulations/programs.js.map +1 -0
- package/dist/cjs/resources/simulations/real-time-payments-transfers.d.ts +1225 -1373
- package/dist/cjs/resources/simulations/real-time-payments-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/real-time-payments-transfers.js +3 -0
- package/dist/cjs/resources/simulations/real-time-payments-transfers.js.map +1 -1
- package/dist/cjs/resources/simulations/simulations.d.ts +42 -0
- package/dist/cjs/resources/simulations/simulations.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/simulations.js +60 -0
- package/dist/cjs/resources/simulations/simulations.js.map +1 -1
- package/dist/cjs/resources/simulations/wire-transfers.d.ts +173 -265
- package/dist/cjs/resources/simulations/wire-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/simulations/wire-transfers.js +1 -0
- package/dist/cjs/resources/simulations/wire-transfers.js.map +1 -1
- package/dist/cjs/resources/transactions.d.ts +202 -365
- package/dist/cjs/resources/transactions.d.ts.map +1 -1
- package/dist/cjs/resources/transactions.js +44 -0
- package/dist/cjs/resources/transactions.js.map +1 -1
- package/dist/cjs/resources/wire-drawdown-requests.d.ts +19 -12
- package/dist/cjs/resources/wire-drawdown-requests.d.ts.map +1 -1
- package/dist/cjs/resources/wire-drawdown-requests.js +44 -0
- package/dist/cjs/resources/wire-drawdown-requests.js.map +1 -1
- package/dist/cjs/resources/wire-transfers.d.ts +24 -36
- package/dist/cjs/resources/wire-transfers.d.ts.map +1 -1
- package/dist/cjs/resources/wire-transfers.js +44 -0
- package/dist/cjs/resources/wire-transfers.js.map +1 -1
- package/dist/cjs/streaming.d.ts +12 -0
- package/dist/cjs/streaming.d.ts.map +1 -0
- package/dist/cjs/streaming.js +284 -0
- package/dist/cjs/streaming.js.map +1 -0
- package/dist/cjs/uploads.d.ts +24 -0
- package/dist/cjs/uploads.d.ts.map +1 -0
- package/dist/cjs/uploads.js +121 -0
- package/dist/cjs/uploads.js.map +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/_shims/agent.d.ts +9 -0
- package/dist/esm/_shims/agent.d.ts.map +1 -0
- package/dist/esm/_shims/agent.js +10 -0
- package/dist/esm/_shims/agent.js.map +1 -0
- package/dist/esm/_shims/agent.node.d.ts +6 -0
- package/dist/esm/_shims/agent.node.d.ts.map +1 -0
- package/dist/esm/_shims/agent.node.js +16 -0
- package/dist/esm/_shims/agent.node.js.map +1 -0
- package/dist/esm/_shims/fetch.d.ts +19 -0
- package/dist/esm/_shims/fetch.d.ts.map +1 -0
- package/dist/esm/_shims/fetch.js +18 -0
- package/dist/esm/_shims/fetch.js.map +1 -0
- package/dist/esm/_shims/fetch.node.d.ts +9 -0
- package/dist/esm/_shims/fetch.node.d.ts.map +1 -0
- package/dist/esm/_shims/fetch.node.js +7 -0
- package/dist/esm/_shims/fetch.node.js.map +1 -0
- package/dist/esm/_shims/fileFromPath.d.ts +23 -0
- package/dist/esm/_shims/fileFromPath.d.ts.map +1 -0
- package/dist/esm/_shims/fileFromPath.js +12 -0
- package/dist/esm/_shims/fileFromPath.js.map +1 -0
- package/dist/esm/_shims/fileFromPath.node.d.ts +18 -0
- package/dist/esm/_shims/fileFromPath.node.d.ts.map +1 -0
- package/dist/esm/_shims/fileFromPath.node.js +13 -0
- package/dist/esm/_shims/fileFromPath.node.js.map +1 -0
- package/dist/esm/_shims/formdata.d.ts +13 -0
- package/dist/esm/_shims/formdata.d.ts.map +1 -0
- package/dist/esm/_shims/formdata.js +15 -0
- package/dist/esm/_shims/formdata.js.map +1 -0
- package/dist/esm/_shims/formdata.node.d.ts +7 -0
- package/dist/esm/_shims/formdata.node.d.ts.map +1 -0
- package/dist/esm/_shims/formdata.node.js +7 -0
- package/dist/esm/_shims/formdata.node.js.map +1 -0
- package/dist/esm/_shims/getMultipartRequestOptions.d.ts +10 -0
- package/dist/esm/_shims/getMultipartRequestOptions.d.ts.map +1 -0
- package/dist/esm/_shims/getMultipartRequestOptions.js +7 -0
- package/dist/esm/_shims/getMultipartRequestOptions.js.map +1 -0
- package/dist/esm/_shims/getMultipartRequestOptions.node.d.ts +10 -0
- package/dist/esm/_shims/getMultipartRequestOptions.node.d.ts.map +1 -0
- package/dist/esm/_shims/getMultipartRequestOptions.node.js +17 -0
- package/dist/esm/_shims/getMultipartRequestOptions.node.js.map +1 -0
- package/dist/esm/_shims/newFileArgs.d.ts +19 -0
- package/dist/esm/_shims/newFileArgs.d.ts.map +1 -0
- package/dist/esm/_shims/newFileArgs.js +66 -0
- package/dist/esm/_shims/newFileArgs.js.map +1 -0
- package/dist/esm/_shims/toFile.d.ts +21 -0
- package/dist/esm/_shims/toFile.d.ts.map +1 -0
- package/dist/esm/_shims/toFile.js +19 -0
- package/dist/esm/_shims/toFile.js.map +1 -0
- package/dist/esm/_shims/toFile.node.d.ts +20 -0
- package/dist/esm/_shims/toFile.node.d.ts.map +1 -0
- package/dist/esm/_shims/toFile.node.js +19 -0
- package/dist/esm/_shims/toFile.node.js.map +1 -0
- package/dist/esm/_shims/uploadable.d.ts +56 -0
- package/dist/esm/_shims/uploadable.d.ts.map +1 -0
- package/dist/esm/_shims/uploadable.js +30 -0
- package/dist/esm/_shims/uploadable.js.map +1 -0
- package/dist/esm/_shims/uploadable.node.d.ts +7 -0
- package/dist/esm/_shims/uploadable.node.d.ts.map +1 -0
- package/dist/esm/_shims/uploadable.node.js +10 -0
- package/dist/esm/_shims/uploadable.node.js.map +1 -0
- package/dist/esm/check-version.d.ts +2 -0
- package/dist/esm/check-version.d.ts.map +1 -0
- package/dist/esm/check-version.js +16 -0
- package/dist/esm/check-version.js.map +1 -0
- package/dist/esm/core.d.ts +221 -0
- package/dist/esm/core.d.ts.map +1 -0
- package/dist/esm/core.js +556 -0
- package/dist/esm/core.js.map +1 -0
- package/dist/esm/error.d.ts +208 -0
- package/dist/esm/error.d.ts.map +1 -0
- package/dist/esm/error.js +275 -0
- package/dist/esm/error.js.map +1 -0
- package/dist/esm/index.d.ts +301 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +213 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/pagination.d.ts +34 -0
- package/dist/esm/pagination.d.ts.map +1 -0
- package/dist/esm/pagination.js +26 -0
- package/dist/esm/pagination.js.map +1 -0
- package/dist/esm/resource.d.ts +12 -0
- package/dist/esm/resource.d.ts.map +1 -0
- package/dist/esm/resource.js +13 -0
- package/dist/esm/resource.js.map +1 -0
- package/dist/esm/resources/account-numbers.d.ts +137 -0
- package/dist/esm/resources/account-numbers.d.ts.map +1 -0
- package/dist/esm/resources/account-numbers.js +36 -0
- package/dist/esm/resources/account-numbers.js.map +1 -0
- package/dist/esm/resources/account-statements.d.ts +106 -0
- package/dist/esm/resources/account-statements.d.ts.map +1 -0
- package/dist/esm/resources/account-statements.js +24 -0
- package/dist/esm/resources/account-statements.js.map +1 -0
- package/dist/esm/resources/account-transfers.d.ts +205 -0
- package/dist/esm/resources/account-transfers.d.ts.map +1 -0
- package/dist/esm/resources/account-transfers.js +42 -0
- package/dist/esm/resources/account-transfers.js.map +1 -0
- package/dist/esm/resources/accounts.d.ts +163 -0
- package/dist/esm/resources/accounts.d.ts.map +1 -0
- package/dist/esm/resources/accounts.js +42 -0
- package/dist/esm/resources/accounts.js.map +1 -0
- package/dist/esm/resources/ach-prenotifications.d.ts +199 -0
- package/dist/esm/resources/ach-prenotifications.d.ts.map +1 -0
- package/dist/esm/resources/ach-prenotifications.js +30 -0
- package/dist/esm/resources/ach-prenotifications.js.map +1 -0
- package/dist/esm/resources/ach-transfers.d.ts +461 -0
- package/dist/esm/resources/ach-transfers.d.ts.map +1 -0
- package/dist/esm/resources/ach-transfers.js +42 -0
- package/dist/esm/resources/ach-transfers.js.map +1 -0
- package/dist/esm/resources/balance-lookups.d.ts +52 -0
- package/dist/esm/resources/balance-lookups.d.ts.map +1 -0
- package/dist/esm/resources/balance-lookups.js +12 -0
- package/dist/esm/resources/balance-lookups.js.map +1 -0
- package/dist/esm/resources/bookkeeping-accounts.d.ts +78 -0
- package/dist/esm/resources/bookkeeping-accounts.d.ts.map +1 -0
- package/dist/esm/resources/bookkeeping-accounts.js +24 -0
- package/dist/esm/resources/bookkeeping-accounts.js.map +1 -0
- package/dist/esm/resources/bookkeeping-entries.d.ts +49 -0
- package/dist/esm/resources/bookkeeping-entries.d.ts.map +1 -0
- package/dist/esm/resources/bookkeeping-entries.js +18 -0
- package/dist/esm/resources/bookkeeping-entries.js.map +1 -0
- package/dist/esm/resources/bookkeeping-entry-sets.d.ts +88 -0
- package/dist/esm/resources/bookkeeping-entry-sets.d.ts.map +1 -0
- package/dist/esm/resources/bookkeeping-entry-sets.js +12 -0
- package/dist/esm/resources/bookkeeping-entry-sets.js.map +1 -0
- package/dist/esm/resources/card-disputes.d.ts +160 -0
- package/dist/esm/resources/card-disputes.d.ts.map +1 -0
- package/dist/esm/resources/card-disputes.js +30 -0
- package/dist/esm/resources/card-disputes.js.map +1 -0
- package/dist/esm/resources/card-profiles.d.ts +206 -0
- package/dist/esm/resources/card-profiles.d.ts.map +1 -0
- package/dist/esm/resources/card-profiles.js +30 -0
- package/dist/esm/resources/card-profiles.js.map +1 -0
- package/dist/esm/resources/cards.d.ts +354 -0
- package/dist/esm/resources/cards.d.ts.map +1 -0
- package/dist/esm/resources/cards.js +42 -0
- package/dist/esm/resources/cards.js.map +1 -0
- package/dist/esm/resources/check-deposits.d.ts +263 -0
- package/dist/esm/resources/check-deposits.d.ts.map +1 -0
- package/dist/esm/resources/check-deposits.js +30 -0
- package/dist/esm/resources/check-deposits.js.map +1 -0
- package/dist/esm/resources/check-transfers.d.ts +438 -0
- package/dist/esm/resources/check-transfers.d.ts.map +1 -0
- package/dist/esm/resources/check-transfers.js +48 -0
- package/dist/esm/resources/check-transfers.js.map +1 -0
- package/dist/esm/resources/declined-transactions.d.ts +492 -0
- package/dist/esm/resources/declined-transactions.d.ts.map +1 -0
- package/dist/esm/resources/declined-transactions.js +24 -0
- package/dist/esm/resources/declined-transactions.js.map +1 -0
- package/dist/esm/resources/digital-wallet-tokens.d.ts +92 -0
- package/dist/esm/resources/digital-wallet-tokens.d.ts.map +1 -0
- package/dist/esm/resources/digital-wallet-tokens.js +24 -0
- package/dist/esm/resources/digital-wallet-tokens.js.map +1 -0
- package/dist/esm/resources/documents.d.ts +95 -0
- package/dist/esm/resources/documents.d.ts.map +1 -0
- package/dist/esm/resources/documents.js +24 -0
- package/dist/esm/resources/documents.js.map +1 -0
- package/dist/esm/resources/entities/entities.d.ts +1622 -0
- package/dist/esm/resources/entities/entities.d.ts.map +1 -0
- package/dist/esm/resources/entities/entities.js +37 -0
- package/dist/esm/resources/entities/entities.js.map +1 -0
- package/dist/esm/resources/entities/index.d.ts +9 -0
- package/dist/esm/resources/entities/index.d.ts.map +1 -0
- package/dist/esm/resources/entities/index.js +4 -0
- package/dist/esm/resources/entities/index.js.map +1 -0
- package/dist/esm/resources/entities/supplemental-documents.d.ts +62 -0
- package/dist/esm/resources/entities/supplemental-documents.d.ts.map +1 -0
- package/dist/esm/resources/entities/supplemental-documents.js +26 -0
- package/dist/esm/resources/entities/supplemental-documents.js.map +1 -0
- package/dist/esm/resources/event-subscriptions.d.ts +209 -0
- package/dist/esm/resources/event-subscriptions.d.ts.map +1 -0
- package/dist/esm/resources/event-subscriptions.js +36 -0
- package/dist/esm/resources/event-subscriptions.js.map +1 -0
- package/dist/esm/resources/events.d.ts +195 -0
- package/dist/esm/resources/events.d.ts.map +1 -0
- package/dist/esm/resources/events.js +24 -0
- package/dist/esm/resources/events.js.map +1 -0
- package/dist/esm/resources/exports.d.ts +169 -0
- package/dist/esm/resources/exports.d.ts.map +1 -0
- package/dist/esm/resources/exports.js +30 -0
- package/dist/esm/resources/exports.js.map +1 -0
- package/dist/esm/resources/external-accounts.d.ts +131 -0
- package/dist/esm/resources/external-accounts.d.ts.map +1 -0
- package/dist/esm/resources/external-accounts.js +36 -0
- package/dist/esm/resources/external-accounts.js.map +1 -0
- package/dist/esm/resources/files.d.ts +167 -0
- package/dist/esm/resources/files.d.ts.map +1 -0
- package/dist/esm/resources/files.js +33 -0
- package/dist/esm/resources/files.js.map +1 -0
- package/dist/esm/resources/groups.d.ts +42 -0
- package/dist/esm/resources/groups.d.ts.map +1 -0
- package/dist/esm/resources/groups.js +12 -0
- package/dist/esm/resources/groups.js.map +1 -0
- package/dist/esm/resources/inbound-ach-transfer-returns.d.ts +117 -0
- package/dist/esm/resources/inbound-ach-transfer-returns.d.ts.map +1 -0
- package/dist/esm/resources/inbound-ach-transfer-returns.js +33 -0
- package/dist/esm/resources/inbound-ach-transfer-returns.js.map +1 -0
- package/dist/esm/resources/inbound-wire-drawdown-requests.d.ts +131 -0
- package/dist/esm/resources/inbound-wire-drawdown-requests.d.ts.map +1 -0
- package/dist/esm/resources/inbound-wire-drawdown-requests.js +27 -0
- package/dist/esm/resources/inbound-wire-drawdown-requests.js.map +1 -0
- package/dist/esm/resources/index.d.ts +199 -0
- package/dist/esm/resources/index.d.ts.map +1 -0
- package/dist/esm/resources/index.js +44 -0
- package/dist/esm/resources/index.js.map +1 -0
- package/dist/esm/resources/limits.d.ts +114 -0
- package/dist/esm/resources/limits.d.ts.map +1 -0
- package/dist/esm/resources/limits.js +36 -0
- package/dist/esm/resources/limits.js.map +1 -0
- package/dist/esm/resources/oauth-connections.d.ts +57 -0
- package/dist/esm/resources/oauth-connections.d.ts.map +1 -0
- package/dist/esm/resources/oauth-connections.js +24 -0
- package/dist/esm/resources/oauth-connections.js.map +1 -0
- package/dist/esm/resources/pending-transactions.d.ts +482 -0
- package/dist/esm/resources/pending-transactions.d.ts.map +1 -0
- package/dist/esm/resources/pending-transactions.js +24 -0
- package/dist/esm/resources/pending-transactions.js.map +1 -0
- package/dist/esm/resources/programs.d.ts +54 -0
- package/dist/esm/resources/programs.d.ts.map +1 -0
- package/dist/esm/resources/programs.js +24 -0
- package/dist/esm/resources/programs.js.map +1 -0
- package/dist/esm/resources/real-time-decisions.d.ts +330 -0
- package/dist/esm/resources/real-time-decisions.d.ts.map +1 -0
- package/dist/esm/resources/real-time-decisions.js +18 -0
- package/dist/esm/resources/real-time-decisions.js.map +1 -0
- package/dist/esm/resources/real-time-payments-transfers.d.ts +294 -0
- package/dist/esm/resources/real-time-payments-transfers.d.ts.map +1 -0
- package/dist/esm/resources/real-time-payments-transfers.js +33 -0
- package/dist/esm/resources/real-time-payments-transfers.js.map +1 -0
- package/dist/esm/resources/routing-numbers.d.ts +56 -0
- package/dist/esm/resources/routing-numbers.d.ts.map +1 -0
- package/dist/esm/resources/routing-numbers.js +20 -0
- package/dist/esm/resources/routing-numbers.js.map +1 -0
- package/dist/esm/resources/shared.d.ts +16 -0
- package/dist/esm/resources/shared.d.ts.map +1 -0
- package/dist/esm/resources/shared.js +3 -0
- package/dist/esm/resources/shared.js.map +1 -0
- package/dist/esm/resources/simulations/account-statements.d.ts +24 -0
- package/dist/esm/resources/simulations/account-statements.d.ts.map +1 -0
- package/dist/esm/resources/simulations/account-statements.js +13 -0
- package/dist/esm/resources/simulations/account-statements.js.map +1 -0
- package/dist/esm/resources/simulations/account-transfers.d.ts +16 -0
- package/dist/esm/resources/simulations/account-transfers.d.ts.map +1 -0
- package/dist/esm/resources/simulations/account-transfers.js +14 -0
- package/dist/esm/resources/simulations/account-transfers.js.map +1 -0
- package/dist/esm/resources/simulations/ach-transfers.d.ts +1836 -0
- package/dist/esm/resources/simulations/ach-transfers.d.ts.map +1 -0
- package/dist/esm/resources/simulations/ach-transfers.js +36 -0
- package/dist/esm/resources/simulations/ach-transfers.js.map +1 -0
- package/dist/esm/resources/simulations/card-disputes.d.ts +31 -0
- package/dist/esm/resources/simulations/card-disputes.d.ts.map +1 -0
- package/dist/esm/resources/simulations/card-disputes.js +15 -0
- package/dist/esm/resources/simulations/card-disputes.js.map +1 -0
- package/dist/esm/resources/simulations/card-refunds.d.ts +25 -0
- package/dist/esm/resources/simulations/card-refunds.d.ts.map +1 -0
- package/dist/esm/resources/simulations/card-refunds.js +13 -0
- package/dist/esm/resources/simulations/card-refunds.js.map +1 -0
- package/dist/esm/resources/simulations/cards.d.ts +931 -0
- package/dist/esm/resources/simulations/cards.d.ts.map +1 -0
- package/dist/esm/resources/simulations/cards.js +28 -0
- package/dist/esm/resources/simulations/cards.js.map +1 -0
- package/dist/esm/resources/simulations/check-deposits.d.ts +31 -0
- package/dist/esm/resources/simulations/check-deposits.d.ts.map +1 -0
- package/dist/esm/resources/simulations/check-deposits.js +27 -0
- package/dist/esm/resources/simulations/check-deposits.js.map +1 -0
- package/dist/esm/resources/simulations/check-transfers.d.ts +42 -0
- package/dist/esm/resources/simulations/check-transfers.d.ts.map +1 -0
- package/dist/esm/resources/simulations/check-transfers.js +28 -0
- package/dist/esm/resources/simulations/check-transfers.js.map +1 -0
- package/dist/esm/resources/simulations/digital-wallet-token-requests.d.ts +49 -0
- package/dist/esm/resources/simulations/digital-wallet-token-requests.d.ts.map +1 -0
- package/dist/esm/resources/simulations/digital-wallet-token-requests.js +13 -0
- package/dist/esm/resources/simulations/digital-wallet-token-requests.js.map +1 -0
- package/dist/esm/resources/simulations/documents.d.ts +23 -0
- package/dist/esm/resources/simulations/documents.d.ts.map +1 -0
- package/dist/esm/resources/simulations/documents.js +12 -0
- package/dist/esm/resources/simulations/documents.js.map +1 -0
- package/dist/esm/resources/simulations/inbound-wire-drawdown-requests.d.ts +106 -0
- package/dist/esm/resources/simulations/inbound-wire-drawdown-requests.d.ts.map +1 -0
- package/dist/esm/resources/simulations/inbound-wire-drawdown-requests.js +15 -0
- package/dist/esm/resources/simulations/inbound-wire-drawdown-requests.js.map +1 -0
- package/dist/esm/resources/simulations/index.d.ts +38 -0
- package/dist/esm/resources/simulations/index.d.ts.map +1 -0
- package/dist/esm/resources/simulations/index.js +18 -0
- package/dist/esm/resources/simulations/index.js.map +1 -0
- package/dist/esm/resources/simulations/interest-payments.d.ts +1272 -0
- package/dist/esm/resources/simulations/interest-payments.d.ts.map +1 -0
- package/dist/esm/resources/simulations/interest-payments.js +13 -0
- package/dist/esm/resources/simulations/interest-payments.js.map +1 -0
- package/dist/esm/resources/simulations/programs.d.ts +25 -0
- package/dist/esm/resources/simulations/programs.d.ts.map +1 -0
- package/dist/esm/resources/simulations/programs.js +14 -0
- package/dist/esm/resources/simulations/programs.js.map +1 -0
- package/dist/esm/resources/simulations/real-time-payments-transfers.d.ts +1782 -0
- package/dist/esm/resources/simulations/real-time-payments-transfers.d.ts.map +1 -0
- package/dist/esm/resources/simulations/real-time-payments-transfers.js +24 -0
- package/dist/esm/resources/simulations/real-time-payments-transfers.js.map +1 -0
- package/dist/esm/resources/simulations/simulations.d.ts +74 -0
- package/dist/esm/resources/simulations/simulations.d.ts.map +1 -0
- package/dist/esm/resources/simulations/simulations.js +56 -0
- package/dist/esm/resources/simulations/simulations.js.map +1 -0
- package/dist/esm/resources/simulations/wire-transfers.d.ts +1338 -0
- package/dist/esm/resources/simulations/wire-transfers.d.ts.map +1 -0
- package/dist/esm/resources/simulations/wire-transfers.js +12 -0
- package/dist/esm/resources/simulations/wire-transfers.js.map +1 -0
- package/dist/esm/resources/transactions.d.ts +1326 -0
- package/dist/esm/resources/transactions.d.ts.map +1 -0
- package/dist/esm/resources/transactions.js +24 -0
- package/dist/esm/resources/transactions.js.map +1 -0
- package/dist/esm/resources/wire-drawdown-requests.d.ts +160 -0
- package/dist/esm/resources/wire-drawdown-requests.d.ts.map +1 -0
- package/dist/esm/resources/wire-drawdown-requests.js +30 -0
- package/dist/esm/resources/wire-drawdown-requests.js.map +1 -0
- package/dist/esm/resources/wire-transfers.d.ts +352 -0
- package/dist/esm/resources/wire-transfers.d.ts.map +1 -0
- package/dist/esm/resources/wire-transfers.js +59 -0
- package/dist/esm/resources/wire-transfers.js.map +1 -0
- package/dist/esm/streaming.d.ts +12 -0
- package/dist/esm/streaming.d.ts.map +1 -0
- package/dist/esm/streaming.js +150 -0
- package/dist/esm/streaming.js.map +1 -0
- package/dist/esm/uploads.d.ts +24 -0
- package/dist/esm/uploads.d.ts.map +1 -0
- package/dist/esm/uploads.js +61 -0
- package/dist/esm/uploads.js.map +1 -0
- package/dist/esm/version.d.ts +2 -0
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/error.ts +222 -54
- package/index.ts +71 -100
- package/package.json +85 -5
- package/pagination.ts +4 -1
- package/resources/account-numbers.ts +15 -28
- package/resources/account-statements.ts +13 -28
- package/resources/account-transfers.ts +14 -28
- package/resources/accounts.ts +33 -33
- package/resources/ach-prenotifications.ts +20 -34
- package/resources/ach-transfers.ts +85 -47
- package/resources/balance-lookups.ts +6 -0
- package/resources/bookkeeping-accounts.ts +18 -10
- package/resources/bookkeeping-entries.ts +12 -5
- package/resources/bookkeeping-entry-sets.ts +23 -31
- package/resources/card-disputes.ts +15 -34
- package/resources/card-profiles.ts +14 -79
- package/resources/cards.ts +18 -142
- package/resources/check-deposits.ts +16 -29
- package/resources/check-transfers.ts +101 -149
- package/resources/declined-transactions.ts +14 -65
- package/resources/digital-wallet-tokens.ts +13 -28
- package/resources/documents.ts +16 -185
- package/resources/entities/entities.ts +393 -1477
- package/resources/entities/index.ts +8 -2
- package/resources/entities/supplemental-documents.ts +54 -0
- package/resources/event-subscriptions.ts +18 -9
- package/resources/events.ts +40 -111
- package/resources/exports.ts +18 -104
- package/resources/external-accounts.ts +20 -16
- package/resources/files.ts +29 -56
- package/resources/groups.ts +10 -5
- package/resources/inbound-ach-transfer-returns.ts +8 -0
- package/resources/inbound-wire-drawdown-requests.ts +12 -5
- package/resources/limits.ts +14 -5
- package/resources/oauth-connections.ts +12 -5
- package/resources/pending-transactions.ts +29 -114
- package/resources/programs.ts +12 -5
- package/resources/real-time-decisions.ts +39 -110
- package/resources/real-time-payments-transfers.ts +41 -55
- package/resources/routing-numbers.ts +7 -0
- package/resources/simulations/account-statements.ts +5 -0
- package/resources/simulations/ach-transfers.ts +1398 -1511
- package/resources/simulations/card-disputes.ts +9 -4
- package/resources/simulations/card-refunds.ts +5 -0
- package/resources/simulations/cards.ts +542 -635
- package/resources/simulations/check-transfers.ts +5 -0
- package/resources/simulations/digital-wallet-token-requests.ts +6 -0
- package/resources/simulations/documents.ts +5 -0
- package/resources/simulations/inbound-wire-drawdown-requests.ts +32 -27
- package/resources/simulations/index.ts +23 -9
- package/resources/simulations/interest-payments.ts +202 -327
- package/resources/simulations/programs.ts +31 -0
- package/resources/simulations/real-time-payments-transfers.ts +1400 -1591
- package/resources/simulations/simulations.ts +57 -0
- package/resources/simulations/wire-transfers.ts +202 -327
- package/resources/transactions.ts +235 -434
- package/resources/wire-drawdown-requests.ts +23 -15
- package/resources/wire-transfers.ts +28 -42
- package/streaming.ts +201 -0
- package/uploads.ts +81 -0
- package/version.ts +1 -1
- package/.eslintrc.js +0 -10
- package/.github/workflows/publish-npm.yml +0 -28
- package/.github/workflows/release-doctor.yml +0 -20
- package/.github/workflows/release.yml +0 -38
- package/.prettierignore +0 -1
- package/.prettierrc +0 -6
- package/.release-please-manifest.json +0 -3
- package/.stats.yml +0 -1
- package/api.md +0 -565
- package/bin/check-release-environment +0 -25
- package/bin/check-test-server +0 -50
- package/bin/publish-npm +0 -6
- package/build +0 -12
- package/dist/cjs/examples/api-error.d.ts +0 -3
- package/dist/cjs/examples/api-error.d.ts.map +0 -1
- package/dist/cjs/examples/api-error.js +0 -92
- package/dist/cjs/examples/api-error.js.map +0 -1
- package/dist/cjs/fetch-polyfill.d.ts +0 -6
- package/dist/cjs/fetch-polyfill.d.ts.map +0 -1
- package/dist/cjs/fetch-polyfill.js +0 -57
- package/dist/cjs/fetch-polyfill.js.map +0 -1
- package/dist/cjs/tests/api-resources/account-numbers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/account-numbers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/account-numbers.test.js +0 -102
- package/dist/cjs/tests/api-resources/account-numbers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/account-statements.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/account-statements.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/account-statements.test.js +0 -86
- package/dist/cjs/tests/api-resources/account-statements.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/account-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/account-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/account-transfers.test.js +0 -132
- package/dist/cjs/tests/api-resources/account-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/accounts.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/accounts.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/accounts.test.js +0 -120
- package/dist/cjs/tests/api-resources/accounts.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/ach-prenotifications.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/ach-prenotifications.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/ach-prenotifications.test.js +0 -121
- package/dist/cjs/tests/api-resources/ach-prenotifications.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/ach-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/ach-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/ach-transfers.test.js +0 -157
- package/dist/cjs/tests/api-resources/ach-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/balance-lookups.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/balance-lookups.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/balance-lookups.test.js +0 -58
- package/dist/cjs/tests/api-resources/balance-lookups.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.js +0 -83
- package/dist/cjs/tests/api-resources/bookkeeping-accounts.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/bookkeeping-entries.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/bookkeeping-entries.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/bookkeeping-entries.test.js +0 -65
- package/dist/cjs/tests/api-resources/bookkeeping-entries.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.js +0 -68
- package/dist/cjs/tests/api-resources/bookkeeping-entry-sets.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/card-disputes.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/card-disputes.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/card-disputes.test.js +0 -100
- package/dist/cjs/tests/api-resources/card-disputes.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/card-profiles.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/card-profiles.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/card-profiles.test.js +0 -106
- package/dist/cjs/tests/api-resources/card-profiles.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/cards.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/cards.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/cards.test.js +0 -124
- package/dist/cjs/tests/api-resources/cards.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/check-deposits.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/check-deposits.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/check-deposits.test.js +0 -108
- package/dist/cjs/tests/api-resources/check-deposits.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/check-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/check-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/check-transfers.test.js +0 -161
- package/dist/cjs/tests/api-resources/check-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/declined-transactions.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/declined-transactions.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/declined-transactions.test.js +0 -89
- package/dist/cjs/tests/api-resources/declined-transactions.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.js +0 -88
- package/dist/cjs/tests/api-resources/digital-wallet-tokens.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/documents.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/documents.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/documents.test.js +0 -89
- package/dist/cjs/tests/api-resources/documents.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/entities/entities.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/entities/entities.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/entities/entities.test.js +0 -357
- package/dist/cjs/tests/api-resources/entities/entities.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.js +0 -56
- package/dist/cjs/tests/api-resources/entities/supplemental-documents.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/event-subscriptions.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/event-subscriptions.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/event-subscriptions.test.js +0 -103
- package/dist/cjs/tests/api-resources/event-subscriptions.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/events.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/events.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/events.test.js +0 -85
- package/dist/cjs/tests/api-resources/events.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/exports.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/exports.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/exports.test.js +0 -105
- package/dist/cjs/tests/api-resources/exports.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/external-accounts.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/external-accounts.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/external-accounts.test.js +0 -103
- package/dist/cjs/tests/api-resources/external-accounts.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/files.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/files.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/files.test.js +0 -103
- package/dist/cjs/tests/api-resources/files.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/groups.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/groups.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/groups.test.js +0 -55
- package/dist/cjs/tests/api-resources/groups.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/inbound-ach-transfer-returns.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/inbound-ach-transfer-returns.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/inbound-ach-transfer-returns.test.js +0 -94
- package/dist/cjs/tests/api-resources/inbound-ach-transfer-returns.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/inbound-wire-drawdown-requests.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/inbound-wire-drawdown-requests.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/inbound-wire-drawdown-requests.test.js +0 -80
- package/dist/cjs/tests/api-resources/inbound-wire-drawdown-requests.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/limits.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/limits.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/limits.test.js +0 -102
- package/dist/cjs/tests/api-resources/limits.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/oauth-connections.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/oauth-connections.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/oauth-connections.test.js +0 -75
- package/dist/cjs/tests/api-resources/oauth-connections.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/pending-transactions.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/pending-transactions.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/pending-transactions.test.js +0 -91
- package/dist/cjs/tests/api-resources/pending-transactions.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/programs.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/programs.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/programs.test.js +0 -73
- package/dist/cjs/tests/api-resources/programs.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/real-time-decisions.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/real-time-decisions.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/real-time-decisions.test.js +0 -65
- package/dist/cjs/tests/api-resources/real-time-decisions.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.js +0 -115
- package/dist/cjs/tests/api-resources/real-time-payments-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/routing-numbers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/routing-numbers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/routing-numbers.test.js +0 -60
- package/dist/cjs/tests/api-resources/routing-numbers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/account-statements.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/account-statements.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/account-statements.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/account-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/account-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/account-transfers.test.js +0 -61
- package/dist/cjs/tests/api-resources/simulations/account-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.js +0 -90
- package/dist/cjs/tests/api-resources/simulations/ach-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/card-disputes.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/card-disputes.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/card-disputes.test.js +0 -58
- package/dist/cjs/tests/api-resources/simulations/card-disputes.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/card-refunds.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/card-refunds.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/card-refunds.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/cards.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/cards.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/cards.test.js +0 -78
- package/dist/cjs/tests/api-resources/simulations/cards.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/check-deposits.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/check-deposits.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/check-deposits.test.js +0 -87
- package/dist/cjs/tests/api-resources/simulations/check-deposits.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/check-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/check-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/check-transfers.test.js +0 -92
- package/dist/cjs/tests/api-resources/simulations/check-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/digital-wallet-token-requests.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/digital-wallet-token-requests.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/digital-wallet-token-requests.test.js +0 -52
- package/dist/cjs/tests/api-resources/simulations/digital-wallet-token-requests.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/documents.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/documents.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/documents.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.js +0 -94
- package/dist/cjs/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/interest-payments.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/interest-payments.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/interest-payments.test.js +0 -58
- package/dist/cjs/tests/api-resources/simulations/interest-payments.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.js +0 -75
- package/dist/cjs/tests/api-resources/simulations/real-time-payments-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.js +0 -84
- package/dist/cjs/tests/api-resources/simulations/wire-transfers.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/transactions.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/transactions.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/transactions.test.js +0 -92
- package/dist/cjs/tests/api-resources/transactions.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.js +0 -110
- package/dist/cjs/tests/api-resources/wire-drawdown-requests.test.js.map +0 -1
- package/dist/cjs/tests/api-resources/wire-transfers.test.d.ts +0 -2
- package/dist/cjs/tests/api-resources/wire-transfers.test.d.ts.map +0 -1
- package/dist/cjs/tests/api-resources/wire-transfers.test.js +0 -175
- package/dist/cjs/tests/api-resources/wire-transfers.test.js.map +0 -1
- package/dist/cjs/tests/form.test.d.ts +0 -2
- package/dist/cjs/tests/form.test.d.ts.map +0 -1
- package/dist/cjs/tests/form.test.js.map +0 -1
- package/dist/cjs/tests/index.test.d.ts +0 -2
- package/dist/cjs/tests/index.test.d.ts.map +0 -1
- package/dist/cjs/tests/index.test.js +0 -108
- package/dist/cjs/tests/index.test.js.map +0 -1
- package/dist/cjs/tests/responses.test.d.ts +0 -2
- package/dist/cjs/tests/responses.test.d.ts.map +0 -1
- package/dist/cjs/tests/responses.test.js +0 -60
- package/dist/cjs/tests/responses.test.js.map +0 -1
- package/examples/api-error.ts +0 -21
- package/fetch-polyfill.ts +0 -69
- package/jest.config.js +0 -8
- package/release-please-config.json +0 -64
- package/tests/api-resources/account-numbers.test.ts +0 -65
- package/tests/api-resources/account-statements.test.ts +0 -49
- package/tests/api-resources/account-transfers.test.ts +0 -95
- package/tests/api-resources/accounts.test.ts +0 -83
- package/tests/api-resources/ach-prenotifications.test.ts +0 -82
- package/tests/api-resources/ach-transfers.test.ts +0 -118
- package/tests/api-resources/balance-lookups.test.ts +0 -21
- package/tests/api-resources/bookkeeping-accounts.test.ts +0 -43
- package/tests/api-resources/bookkeeping-entries.test.ts +0 -25
- package/tests/api-resources/bookkeeping-entry-sets.test.ts +0 -31
- package/tests/api-resources/card-disputes.test.ts +0 -63
- package/tests/api-resources/card-profiles.test.ts +0 -69
- package/tests/api-resources/cards.test.ts +0 -87
- package/tests/api-resources/check-deposits.test.ts +0 -69
- package/tests/api-resources/check-transfers.test.ts +0 -124
- package/tests/api-resources/declined-transactions.test.ts +0 -52
- package/tests/api-resources/digital-wallet-tokens.test.ts +0 -49
- package/tests/api-resources/documents.test.ts +0 -52
- package/tests/api-resources/entities/entities.test.ts +0 -320
- package/tests/api-resources/entities/supplemental-documents.test.ts +0 -19
- package/tests/api-resources/event-subscriptions.test.ts +0 -63
- package/tests/api-resources/events.test.ts +0 -48
- package/tests/api-resources/exports.test.ts +0 -68
- package/tests/api-resources/external-accounts.test.ts +0 -66
- package/tests/api-resources/files.test.ts +0 -66
- package/tests/api-resources/groups.test.ts +0 -18
- package/tests/api-resources/inbound-ach-transfer-returns.test.ts +0 -57
- package/tests/api-resources/inbound-wire-drawdown-requests.test.ts +0 -43
- package/tests/api-resources/limits.test.ts +0 -65
- package/tests/api-resources/oauth-connections.test.ts +0 -38
- package/tests/api-resources/pending-transactions.test.ts +0 -52
- package/tests/api-resources/programs.test.ts +0 -36
- package/tests/api-resources/real-time-decisions.test.ts +0 -28
- package/tests/api-resources/real-time-payments-transfers.test.ts +0 -78
- package/tests/api-resources/routing-numbers.test.ts +0 -23
- package/tests/api-resources/simulations/account-statements.test.ts +0 -15
- package/tests/api-resources/simulations/account-transfers.test.ts +0 -24
- package/tests/api-resources/simulations/ach-transfers.test.ts +0 -53
- package/tests/api-resources/simulations/card-disputes.test.ts +0 -21
- package/tests/api-resources/simulations/card-refunds.test.ts +0 -15
- package/tests/api-resources/simulations/cards.test.ts +0 -41
- package/tests/api-resources/simulations/check-deposits.test.ts +0 -50
- package/tests/api-resources/simulations/check-transfers.test.ts +0 -47
- package/tests/api-resources/simulations/digital-wallet-token-requests.test.ts +0 -15
- package/tests/api-resources/simulations/documents.test.ts +0 -15
- package/tests/api-resources/simulations/inbound-wire-drawdown-requests.test.ts +0 -57
- package/tests/api-resources/simulations/interest-payments.test.ts +0 -15
- package/tests/api-resources/simulations/real-time-payments-transfers.test.ts +0 -38
- package/tests/api-resources/simulations/wire-transfers.test.ts +0 -47
- package/tests/api-resources/transactions.test.ts +0 -53
- package/tests/api-resources/wire-drawdown-requests.test.ts +0 -73
- package/tests/api-resources/wire-transfers.test.ts +0 -138
- package/tests/form.test.ts +0 -27
- package/tests/index.test.ts +0 -78
- package/tests/responses.test.ts +0 -25
- package/tsconfig.cjs.json +0 -8
- package/tsconfig.json +0 -39
- package/typings/digest-fetch/index.d.ts +0 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0](https://github.com/Increase/increase-node/compare/v0.4.0...v0.5.0) (2023-06-29)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **api:** remove many enum members from document category ([#27](https://github.com/Increase/increase-node/issues/27))
|
|
9
|
+
* **types:** singularize array item types ([#25](https://github.com/Increase/increase-node/issues/25))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **api/types:** mark more check transfer intention properties as nullable ([#26](https://github.com/Increase/increase-node/issues/26)) ([324580e](https://github.com/Increase/increase-node/commit/324580e75db774e8ca3c6561e288c217915b7722))
|
|
14
|
+
* support ESM and web platform runtimes; easier file uploads ([#28](https://github.com/Increase/increase-node/issues/28)) ([1d53a8d](https://github.com/Increase/increase-node/commit/1d53a8dd26cfa10c36a1813a9e8d5a78697439e4))
|
|
15
|
+
* **types:** export nested types through the root client export ([#23](https://github.com/Increase/increase-node/issues/23)) ([c68b1ae](https://github.com/Increase/increase-node/commit/c68b1ae49b52828121c5042303d74dc10f2960fc))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **form-data:** strip out undefined properties ([#21](https://github.com/Increase/increase-node/issues/21)) ([dd73783](https://github.com/Increase/increase-node/commit/dd73783b3541ff86ac53e22f397d53a87872f925))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Refactors
|
|
24
|
+
|
|
25
|
+
* **api:** remove `other` from reason enum ([#24](https://github.com/Increase/increase-node/issues/24)) ([5d7206a](https://github.com/Increase/increase-node/commit/5d7206a911039f9f2b8c8f40db589777afbad113))
|
|
26
|
+
* **api:** remove many enum members from document category ([#27](https://github.com/Increase/increase-node/issues/27)) ([ddcd780](https://github.com/Increase/increase-node/commit/ddcd7807953bc64a4e9f055bb9cd1a671554eaa5))
|
|
27
|
+
* **types:** singularize array item types ([#25](https://github.com/Increase/increase-node/issues/25)) ([bb00a48](https://github.com/Increase/increase-node/commit/bb00a48c7c6aee72593c9e79decc9a4127873587))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Styles
|
|
31
|
+
|
|
32
|
+
* minor reordering of types and properties ([#29](https://github.com/Increase/increase-node/issues/29)) ([0e6dbc5](https://github.com/Increase/increase-node/commit/0e6dbc537b6a5ff9464de3f3ce2c164f00b79680))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Chores
|
|
36
|
+
|
|
37
|
+
* speed up build script slightly ([#30](https://github.com/Increase/increase-node/issues/30)) ([b8ad73c](https://github.com/Increase/increase-node/commit/b8ad73c54aacb5a582826a4d8cfb594f3e1450ee))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Documentation
|
|
41
|
+
|
|
42
|
+
* rearrange sections in api.md ([#31](https://github.com/Increase/increase-node/issues/31)) ([a8859f4](https://github.com/Increase/increase-node/commit/a8859f4fcca63820dc3568f7fd9c5a8c5b79c445))
|
|
43
|
+
|
|
44
|
+
## [0.4.0](https://github.com/Increase/increase-node/compare/v0.3.0...v0.4.0) (2023-06-19)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### ⚠ BREAKING CHANGES
|
|
48
|
+
|
|
49
|
+
* drop official support for EOL Node versions (Node 12, 13, 14, 15) ([#18](https://github.com/Increase/increase-node/issues/18))
|
|
50
|
+
* **api:** rename return reason enum member ([#12](https://github.com/Increase/increase-node/issues/12))
|
|
51
|
+
* change nested query parameters to be objects ([#8](https://github.com/Increase/increase-node/issues/8))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
* **client:** add support for specifying client-level default headers ([#5](https://github.com/Increase/increase-node/issues/5)) ([609c71a](https://github.com/Increase/increase-node/commit/609c71a7f657ec14fba3fa919d8b0dd4ff1ecb5d))
|
|
56
|
+
* **api:** add new endpoints + properties + enums ([#9](https://github.com/Increase/increase-node/issues/9)) ([8fd90c4](https://github.com/Increase/increase-node/commit/8fd90c4b8a50ce9f5a23cc17ee71508df6e34eca))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
* **internal:** improve stream cancellation handling of abort controllers ([#17](https://github.com/Increase/increase-node/issues/17)) ([e8f15dd](https://github.com/Increase/increase-node/commit/e8f15dd5c2001dd6b3023266a2471c019ed96739))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Chores
|
|
65
|
+
|
|
66
|
+
* **internal:** improve SSE decoding of lines ([#14](https://github.com/Increase/increase-node/issues/14)) ([74b9bdc](https://github.com/Increase/increase-node/commit/74b9bdcaa44639cd99865d8a2701a2232314f0fd))
|
|
67
|
+
* **internal:** restructure core streaming implementation ([#7](https://github.com/Increase/increase-node/issues/7)) ([b97964b](https://github.com/Increase/increase-node/commit/b97964bd5e22ed7ce4ffdd8e4a8fe5005db40976))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Refactors
|
|
71
|
+
|
|
72
|
+
* **api:** remove unused properties and enum members ([#16](https://github.com/Increase/increase-node/issues/16)) ([51c8ab5](https://github.com/Increase/increase-node/commit/51c8ab5e5415d722768af8c53c5c8453398545a6))
|
|
73
|
+
* change nested query parameters to be objects ([#8](https://github.com/Increase/increase-node/issues/8)) ([fdcd3a4](https://github.com/Increase/increase-node/commit/fdcd3a47ff31cece47a646853086f9d9e024720c))
|
|
74
|
+
* **api:** rename return reason enum member ([#12](https://github.com/Increase/increase-node/issues/12)) ([51ba5d4](https://github.com/Increase/increase-node/commit/51ba5d42e07dbde522cf7ff49863fc0935c350bb))
|
|
75
|
+
* **docs:** cleanup api.md response types ([539848e](https://github.com/Increase/increase-node/commit/539848e9001e424f9492f60d82cfb861316cfcb2))
|
|
76
|
+
* move error type definitions to error.ts ([#15](https://github.com/Increase/increase-node/issues/15)) ([e50a9a1](https://github.com/Increase/increase-node/commit/e50a9a1f43e107ae989306f73f210e6b88493d60))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
### Documentation
|
|
80
|
+
|
|
81
|
+
* drop official support for EOL Node versions (Node 12, 13, 14, 15) ([#18](https://github.com/Increase/increase-node/issues/18)) ([f3be71b](https://github.com/Increase/increase-node/commit/f3be71b1191f72a6785f6be07dcf79b45b9640ac))
|
|
82
|
+
* point to github repo instead of email contact ([#13](https://github.com/Increase/increase-node/issues/13)) ([72d7fef](https://github.com/Increase/increase-node/commit/72d7fef408e625906e2ec59c29b9a63ea5a9d64c))
|
|
83
|
+
* slight improvement to file uploads example ([#10](https://github.com/Increase/increase-node/issues/10)) ([b134725](https://github.com/Increase/increase-node/commit/b1347253a900c1af41a66363bc225a2b09a9e4c3))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Build System
|
|
87
|
+
|
|
88
|
+
* add `.github` folder to `.npmignore` ([#19](https://github.com/Increase/increase-node/issues/19)) ([a263289](https://github.com/Increase/increase-node/commit/a263289da32b5e0d708c5c21a92a6a58faf74abc))
|
|
89
|
+
|
|
3
90
|
## [0.3.0](https://github.com/Increase/increase-node/compare/increase-v0.2.0...increase-v0.3.0) (2023-05-31)
|
|
4
91
|
|
|
5
92
|
|
package/README.md
CHANGED
|
@@ -61,17 +61,32 @@ Documentation for each method, request param, and response field are available i
|
|
|
61
61
|
|
|
62
62
|
## File Uploads
|
|
63
63
|
|
|
64
|
-
Request parameters that correspond to file uploads can be passed
|
|
64
|
+
Request parameters that correspond to file uploads can be passed in many different forms:
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
- `File` (or an object with the same structure)
|
|
67
|
+
- a `fetch` `Response` (or an object with the same structure)
|
|
68
|
+
- an `fs.ReadStream`
|
|
69
|
+
- the return value of our `toFile` helper
|
|
67
70
|
|
|
68
71
|
```ts
|
|
69
|
-
import
|
|
72
|
+
import fs from 'fs';
|
|
73
|
+
import fetch from 'node-fetch';
|
|
74
|
+
import Increase, { toFile } from 'increase';
|
|
70
75
|
|
|
71
76
|
const increase = new Increase();
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
await increase.files.create({ file: file, purpose: 'other' });
|
|
78
|
+
// If you have access to Node `fs` we recommend using `fs.createReadStream()`:
|
|
79
|
+
await increase.files.create({ file: fs.createReadStream('my/file.txt'), purpose: 'other' });
|
|
80
|
+
|
|
81
|
+
// Or if you have the web `File` API you can pass a `File` instance:
|
|
82
|
+
await increase.files.create({ file: new File(['my bytes'], 'file.txt'), purpose: 'other' });
|
|
83
|
+
|
|
84
|
+
// You can also pass a `fetch` `Response`:
|
|
85
|
+
await increase.files.create({ file: await fetch('https://somesite/file.txt'), purpose: 'other' });
|
|
86
|
+
|
|
87
|
+
// Finally, if none of the above are convenient, you can use our `toFile` helper:
|
|
88
|
+
await increase.files.create({ file: await toFile(Buffer.from('my bytes'), 'file.txt'), purpose: 'other' });
|
|
89
|
+
await increase.files.create({ file: await toFile(new Uint8Array([0, 1, 2]), 'file.txt'), purpose: 'other' });
|
|
75
90
|
```
|
|
76
91
|
|
|
77
92
|
## Handling errors
|
|
@@ -212,14 +227,13 @@ This package is in beta. Its internals and interfaces are not stable
|
|
|
212
227
|
and subject to change without a major semver bump;
|
|
213
228
|
please reach out if you rely on any undocumented behavior.
|
|
214
229
|
|
|
215
|
-
We are keen for your feedback; please
|
|
216
|
-
or open an issue with questions, bugs, or suggestions.
|
|
230
|
+
We are keen for your feedback; please open an [issue](https://www.github.com/increase/increase-node/issues) with questions, bugs, or suggestions.
|
|
217
231
|
|
|
218
232
|
## Requirements
|
|
219
233
|
|
|
220
234
|
The following runtimes are supported:
|
|
221
235
|
|
|
222
|
-
- Node.js
|
|
236
|
+
- Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
|
|
223
237
|
- Deno v1.28.0 or higher (experimental).
|
|
224
238
|
Use `import Increase from "npm:increase"`.
|
|
225
239
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import KeepAliveAgent from 'agentkeepalive';
|
|
6
|
+
import type { Agent } from 'node:http';
|
|
7
|
+
import { AbortController as AbortControllerPolyfill } from 'abort-controller';
|
|
8
|
+
|
|
9
|
+
const defaultHttpAgent: Agent = new KeepAliveAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
|
10
|
+
const defaultHttpsAgent: Agent = new KeepAliveAgent.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
|
11
|
+
|
|
12
|
+
// Polyfill global object if needed.
|
|
13
|
+
if (typeof AbortController === 'undefined') {
|
|
14
|
+
AbortController = AbortControllerPolyfill as any as typeof AbortController;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const getDefaultAgent = (url: string): Agent | undefined => {
|
|
18
|
+
if (defaultHttpsAgent && url.startsWith('https')) return defaultHttpsAgent;
|
|
19
|
+
return defaultHttpAgent;
|
|
20
|
+
};
|
package/_shims/agent.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*
|
|
4
|
+
* This is a stub for non-node environments.
|
|
5
|
+
* In node environments, it gets replaced agent.node.ts by the package export map
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { Agent } from 'node:http';
|
|
9
|
+
|
|
10
|
+
export const getDefaultAgent = (url: string): Agent | undefined => {
|
|
11
|
+
return undefined;
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import fetch, { Request, Response, Headers } from 'node-fetch';
|
|
6
|
+
import type { RequestInfo, RequestInit, BodyInit } from 'node-fetch';
|
|
7
|
+
|
|
8
|
+
export { fetch, Request, Response, Headers };
|
|
9
|
+
export type { RequestInfo, RequestInit, BodyInit };
|
|
10
|
+
|
|
11
|
+
export const isPolyfilled = true;
|
package/_shims/fetch.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type * as nf from 'node-fetch';
|
|
6
|
+
|
|
7
|
+
const _fetch: typeof nf.default =
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
fetch as any;
|
|
10
|
+
type _fetch = typeof nf.default;
|
|
11
|
+
const _Request: typeof nf.Request =
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
Request as any;
|
|
14
|
+
type _Request = nf.Request;
|
|
15
|
+
const _Response: typeof nf.Response =
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
Response as any;
|
|
18
|
+
type _Response = nf.Response;
|
|
19
|
+
const _Headers: typeof nf.Headers =
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
Headers as any;
|
|
22
|
+
type _Headers = nf.Headers;
|
|
23
|
+
|
|
24
|
+
export const isPolyfilled = false;
|
|
25
|
+
|
|
26
|
+
export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
|
|
27
|
+
|
|
28
|
+
type _RequestInfo = nf.RequestInfo;
|
|
29
|
+
type _RequestInit = nf.RequestInit;
|
|
30
|
+
type _BodyInit = nf.BodyInit;
|
|
31
|
+
|
|
32
|
+
export type { _RequestInit as RequestInit, _RequestInfo as RequestInfo, _BodyInit as BodyInit };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { FilePropertyBag } from 'formdata-node';
|
|
6
|
+
import { fileFromPath as _fileFromPath } from 'formdata-node/file-from-path';
|
|
7
|
+
import type { File } from './formdata.node';
|
|
8
|
+
|
|
9
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
10
|
+
|
|
11
|
+
let warned = false;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated use fs.createReadStream('./my/file.txt') instead
|
|
15
|
+
*/
|
|
16
|
+
export async function fileFromPath(path: string): Promise<File>;
|
|
17
|
+
export async function fileFromPath(path: string, filename?: string): Promise<File>;
|
|
18
|
+
export async function fileFromPath(path: string, options?: FileFromPathOptions): Promise<File>;
|
|
19
|
+
export async function fileFromPath(
|
|
20
|
+
path: string,
|
|
21
|
+
filename?: string,
|
|
22
|
+
options?: FileFromPathOptions,
|
|
23
|
+
): Promise<File>;
|
|
24
|
+
export async function fileFromPath(path: string, ...args: any[]): Promise<File> {
|
|
25
|
+
if (!warned) {
|
|
26
|
+
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
|
|
27
|
+
warned = true;
|
|
28
|
+
}
|
|
29
|
+
return await _fileFromPath(path, ...args);
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*
|
|
4
|
+
* This is a stub that gets replaced by fileFromPath.node.js for node environments
|
|
5
|
+
* in the package export map
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { FilePropertyBag } from 'formdata-node';
|
|
9
|
+
import type { File } from './formdata';
|
|
10
|
+
|
|
11
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* This is a stub for non-node environments that just throws an error.
|
|
15
|
+
* In node environments, this module will be replaced by util/node/fileFromPath by the
|
|
16
|
+
* package import map.
|
|
17
|
+
*/
|
|
18
|
+
export async function fileFromPath(path: string): Promise<File>;
|
|
19
|
+
export async function fileFromPath(path: string, filename?: string): Promise<File>;
|
|
20
|
+
export async function fileFromPath(path: string, options?: FileFromPathOptions): Promise<File>;
|
|
21
|
+
export async function fileFromPath(
|
|
22
|
+
path: string,
|
|
23
|
+
filename?: string,
|
|
24
|
+
options?: FileFromPathOptions,
|
|
25
|
+
): Promise<File>;
|
|
26
|
+
export async function fileFromPath(): Promise<File> {
|
|
27
|
+
throw new Error(
|
|
28
|
+
'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/increase/increase-node#file-uploads',
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type * as fd from 'formdata-node';
|
|
6
|
+
|
|
7
|
+
const _FormData: typeof fd.FormData =
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
FormData as any;
|
|
10
|
+
type _FormData = fd.FormData;
|
|
11
|
+
const _File: typeof fd.File =
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
File as any;
|
|
14
|
+
type _File = fd.File;
|
|
15
|
+
const _Blob: typeof fd.Blob =
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
Blob as any;
|
|
18
|
+
type _Blob = fd.Blob;
|
|
19
|
+
|
|
20
|
+
export const isPolyfilled = false;
|
|
21
|
+
|
|
22
|
+
export { _FormData as FormData, _File as File, _Blob as Blob };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { FormData } from './formdata.node';
|
|
6
|
+
import type { RequestOptions } from '../core';
|
|
7
|
+
import { Readable } from 'node:stream';
|
|
8
|
+
import { FormDataEncoder } from 'form-data-encoder';
|
|
9
|
+
|
|
10
|
+
export async function getMultipartRequestOptions<T extends {} = Record<string, unknown>>(
|
|
11
|
+
form: FormData,
|
|
12
|
+
opts: RequestOptions<T>,
|
|
13
|
+
): Promise<RequestOptions<T>> {
|
|
14
|
+
const encoder = new FormDataEncoder(form);
|
|
15
|
+
const readable = Readable.from(encoder);
|
|
16
|
+
const body = { __multipartBody__: readable };
|
|
17
|
+
const headers = {
|
|
18
|
+
...opts.headers,
|
|
19
|
+
...encoder.headers,
|
|
20
|
+
'Content-Length': encoder.contentLength,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return { ...opts, body: body as any, headers };
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { FormData } from './formdata';
|
|
6
|
+
import type { RequestOptions } from '../core';
|
|
7
|
+
|
|
8
|
+
export async function getMultipartRequestOptions<T extends {} = Record<string, unknown>>(
|
|
9
|
+
form: FormData,
|
|
10
|
+
opts: RequestOptions<T>,
|
|
11
|
+
): Promise<RequestOptions<T>> {
|
|
12
|
+
return { ...opts, body: { __multipartBody__: form } as any };
|
|
13
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { type BlobPart, type Uploadable, isResponseLike, isBlobLike } from './uploadable';
|
|
6
|
+
|
|
7
|
+
export type ToFileInput = Uploadable | Exclude<BlobPart, string> | AsyncIterable<BlobPart>;
|
|
8
|
+
|
|
9
|
+
export type FilePropertyBag = {
|
|
10
|
+
type?: string;
|
|
11
|
+
lastModified?: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export async function newFileArgs(
|
|
15
|
+
value: ToFileInput,
|
|
16
|
+
name?: string | null,
|
|
17
|
+
options: FilePropertyBag = {},
|
|
18
|
+
): Promise<{
|
|
19
|
+
bits: BlobPart[];
|
|
20
|
+
name: string;
|
|
21
|
+
options: FilePropertyBag;
|
|
22
|
+
}> {
|
|
23
|
+
if (isResponseLike(value)) {
|
|
24
|
+
const blob = await value.blob();
|
|
25
|
+
name ||= new URL(value.url).pathname.split(/[\\/]/).pop() ?? 'unknown_file';
|
|
26
|
+
|
|
27
|
+
return { bits: [blob as any], name, options };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const bits = await getBytes(value);
|
|
31
|
+
|
|
32
|
+
name ||= getName(value) ?? 'unknown_file';
|
|
33
|
+
|
|
34
|
+
if (!options.type) {
|
|
35
|
+
const type = (bits[0] as any)?.type;
|
|
36
|
+
if (typeof type === 'string') {
|
|
37
|
+
options = { ...options, type };
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return { bits, name, options };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function getBytes(value: ToFileInput): Promise<Array<BlobPart>> {
|
|
45
|
+
if (value instanceof Promise) return getBytes(await (value as any));
|
|
46
|
+
|
|
47
|
+
let parts: Array<BlobPart> = [];
|
|
48
|
+
if (
|
|
49
|
+
typeof value === 'string' ||
|
|
50
|
+
ArrayBuffer.isView(value) || // includes Uint8Array, Buffer, etc.
|
|
51
|
+
value instanceof ArrayBuffer
|
|
52
|
+
) {
|
|
53
|
+
parts.push(value);
|
|
54
|
+
} else if (isBlobLike(value)) {
|
|
55
|
+
parts.push(await value.arrayBuffer());
|
|
56
|
+
} else if (
|
|
57
|
+
isAsyncIterableIterator(value) // includes Readable, ReadableStream, etc.
|
|
58
|
+
) {
|
|
59
|
+
for await (const chunk of value) {
|
|
60
|
+
parts.push(chunk as BlobPart); // TODO, consider validating?
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
throw new Error(
|
|
64
|
+
`Unexpected data type: ${typeof value}; constructor: ${
|
|
65
|
+
value?.constructor?.name
|
|
66
|
+
}; props: ${propsForError(value)}`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return parts;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function propsForError(value: any): string {
|
|
74
|
+
const props = Object.getOwnPropertyNames(value);
|
|
75
|
+
return `[${props.map((p) => `"${p}"`).join(', ')}]`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getName(value: any): string | undefined {
|
|
79
|
+
return (
|
|
80
|
+
getStringFromMaybeBuffer(value.name) ||
|
|
81
|
+
getStringFromMaybeBuffer(value.filename) ||
|
|
82
|
+
// For fs.ReadStream
|
|
83
|
+
getStringFromMaybeBuffer(value.path)?.split(/[\\/]/).pop()
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const getStringFromMaybeBuffer = (x: string | Buffer | unknown): string | undefined => {
|
|
88
|
+
if (typeof x === 'string') return x;
|
|
89
|
+
if (typeof Buffer !== 'undefined' && x instanceof Buffer) return String(x);
|
|
90
|
+
return undefined;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const isAsyncIterableIterator = (value: any): value is AsyncIterableIterator<unknown> =>
|
|
94
|
+
value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { File } from 'formdata-node';
|
|
6
|
+
import { type ToFileInput, newFileArgs, type FilePropertyBag } from './newFileArgs';
|
|
7
|
+
import type { Uploadable, BlobPart, FileLike } from './uploadable.node'; // eslint-disable-line
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
11
|
+
* @param bits the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
|
|
12
|
+
* @param name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
13
|
+
* @param {Object=} options additional properties
|
|
14
|
+
* @param {string=} options.type the MIME type of the content
|
|
15
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
16
|
+
* @returns a {@link File} with the given properties
|
|
17
|
+
*/
|
|
18
|
+
export async function toFile(
|
|
19
|
+
bits: ToFileInput,
|
|
20
|
+
name?: string | null | undefined,
|
|
21
|
+
options: FilePropertyBag | undefined = {},
|
|
22
|
+
): Promise<FileLike> {
|
|
23
|
+
const args = await newFileArgs(bits, name, options);
|
|
24
|
+
return new File(args.bits, args.name, args.options);
|
|
25
|
+
}
|
package/_shims/toFile.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference lib="dom" />;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { type ToFileInput, newFileArgs, type FilePropertyBag } from './newFileArgs';
|
|
8
|
+
import type { FileLike, Uploadable } from './uploadable'; // eslint-disable-line
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
|
|
12
|
+
* @param bits the raw content of the file. Can be an {@link Uploadable}, {@link BlobPart}, or {@link AsyncIterable} of {@link BlobPart}s
|
|
13
|
+
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
|
|
14
|
+
* @param {Object=} options additional properties
|
|
15
|
+
* @param {string=} options.type the MIME type of the content
|
|
16
|
+
* @param {number=} options.lastModified the last modified timestamp
|
|
17
|
+
* @returns a {@link File} with the given properties
|
|
18
|
+
*/
|
|
19
|
+
export async function toFile(
|
|
20
|
+
bits: ToFileInput,
|
|
21
|
+
name?: string | null | undefined,
|
|
22
|
+
options: FilePropertyBag | undefined = {},
|
|
23
|
+
): Promise<FileLike> {
|
|
24
|
+
const args = await newFileArgs(bits, name, options);
|
|
25
|
+
return new File(args.bits as BlobPart[], args.name, args.options);
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ReadStream } from 'node:fs';
|
|
6
|
+
import {
|
|
7
|
+
BlobPart,
|
|
8
|
+
Uploadable,
|
|
9
|
+
BlobLike,
|
|
10
|
+
FileLike,
|
|
11
|
+
ResponseLike,
|
|
12
|
+
isBlobLike,
|
|
13
|
+
isFileLike,
|
|
14
|
+
isResponseLike,
|
|
15
|
+
} from './uploadable';
|
|
16
|
+
|
|
17
|
+
export { BlobPart, BlobLike, FileLike, ResponseLike, isBlobLike, Uploadable };
|
|
18
|
+
|
|
19
|
+
export const isUploadable = (value: any): value is Uploadable => {
|
|
20
|
+
return isFileLike(value) || isResponseLike(value) || value instanceof ReadStream;
|
|
21
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type * as fs from 'node:fs';
|
|
6
|
+
import type { toFile } from 'increase/_shims/toFile'; // eslint-disable-line
|
|
7
|
+
|
|
8
|
+
export type BlobPart = string | ArrayBuffer | ArrayBufferView | BlobLike | Uint8Array | DataView;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Typically, this is a native "File" class.
|
|
12
|
+
*
|
|
13
|
+
* We provide the {@link toFile} utility to convert a variety of objects
|
|
14
|
+
* into the File class.
|
|
15
|
+
*
|
|
16
|
+
* For convenience, you can also pass a fetch Response
|
|
17
|
+
* or, on Node, the result of {@link fs.createReadStream}('./myfile').
|
|
18
|
+
*/
|
|
19
|
+
export type Uploadable = FileLike | ResponseLike | fs.ReadStream;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Intended to match web.Blob, node.Blob, node-fetch.Blob, etc.
|
|
23
|
+
*/
|
|
24
|
+
export interface BlobLike {
|
|
25
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/size) */
|
|
26
|
+
readonly size: number;
|
|
27
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/type) */
|
|
28
|
+
readonly type: string;
|
|
29
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/text) */
|
|
30
|
+
text(): Promise<string>;
|
|
31
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Blob/slice) */
|
|
32
|
+
slice(start?: number, end?: number): BlobLike;
|
|
33
|
+
// unfortunately @types/node-fetch@^2.6.4 doesn't type the arrayBuffer method
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Intended to match web.File, node.File, node-fetch.File, etc.
|
|
38
|
+
*/
|
|
39
|
+
export interface FileLike extends BlobLike {
|
|
40
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/lastModified) */
|
|
41
|
+
readonly lastModified: number;
|
|
42
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/File/name) */
|
|
43
|
+
readonly name: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Intended to match web.Response, node.Response, node-fetch.Response, etc.
|
|
48
|
+
*/
|
|
49
|
+
export interface ResponseLike {
|
|
50
|
+
url: string;
|
|
51
|
+
blob(): Promise<BlobLike>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const isResponseLike = (value: any): value is ResponseLike =>
|
|
55
|
+
value != null &&
|
|
56
|
+
typeof value === 'object' &&
|
|
57
|
+
typeof value.url === 'string' &&
|
|
58
|
+
typeof value.blob === 'function';
|
|
59
|
+
|
|
60
|
+
export const isFileLike = (value: any): value is FileLike =>
|
|
61
|
+
value != null &&
|
|
62
|
+
typeof value === 'object' &&
|
|
63
|
+
typeof value.name === 'string' &&
|
|
64
|
+
typeof value.lastModified === 'number' &&
|
|
65
|
+
isBlobLike(value);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The BlobLike type omits arrayBuffer() because @types/node-fetch@^2.6.4 lacks it; but this check
|
|
69
|
+
* adds the arrayBuffer() method type because it is available and used at runtime
|
|
70
|
+
*/
|
|
71
|
+
export const isBlobLike = (value: any): value is BlobLike & { arrayBuffer(): Promise<ArrayBuffer> } =>
|
|
72
|
+
value != null &&
|
|
73
|
+
typeof value === 'object' &&
|
|
74
|
+
typeof value.size === 'number' &&
|
|
75
|
+
typeof value.type === 'string' &&
|
|
76
|
+
typeof value.text === 'function' &&
|
|
77
|
+
typeof value.slice === 'function' &&
|
|
78
|
+
typeof value.arrayBuffer === 'function';
|
|
79
|
+
|
|
80
|
+
export const isUploadable = (value: any): value is Uploadable => {
|
|
81
|
+
return isFileLike(value) || isResponseLike(value);
|
|
82
|
+
};
|