increase 0.11.1 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +7 -3
- 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 -218
- package/core.d.ts.map +1 -1
- package/core.js +682 -731
- package/core.js.map +1 -1
- package/core.mjs +676 -682
- package/core.mjs.map +1 -1
- package/error.d.ts +107 -178
- package/error.d.ts.map +1 -1
- package/error.js +251 -281
- package/error.js.map +1 -1
- package/error.mjs +247 -253
- package/error.mjs.map +1 -1
- package/index.d.mts +333 -356
- package/index.d.ts +333 -356
- package/index.d.ts.map +1 -1
- package/index.js +194 -264
- package/index.js.map +1 -1
- package/index.mjs +171 -198
- package/index.mjs.map +1 -1
- package/package.json +31 -58
- package/pagination.d.ts +25 -25
- package/pagination.js +29 -25
- package/pagination.mjs +27 -23
- package/resource.d.ts +10 -10
- package/resource.js +12 -12
- package/resource.mjs +10 -10
- package/resources/account-numbers.d.ts +202 -168
- package/resources/account-numbers.d.ts.map +1 -1
- package/resources/account-numbers.js +33 -31
- package/resources/account-numbers.js.map +1 -1
- package/resources/account-numbers.mjs +28 -26
- package/resources/account-numbers.mjs.map +1 -1
- package/resources/account-statements.d.ts +79 -81
- package/resources/account-statements.js +21 -21
- package/resources/account-statements.mjs +16 -14
- package/resources/account-transfers.d.ts +192 -194
- package/resources/account-transfers.js +39 -39
- package/resources/account-transfers.mjs +34 -32
- package/resources/accounts.d.ts +148 -151
- package/resources/accounts.js +39 -37
- package/resources/accounts.mjs +34 -32
- package/resources/ach-prenotifications.d.ts +370 -438
- package/resources/ach-prenotifications.d.ts.map +1 -1
- package/resources/ach-prenotifications.js +27 -27
- package/resources/ach-prenotifications.js.map +1 -1
- package/resources/ach-prenotifications.mjs +22 -20
- package/resources/ach-prenotifications.mjs.map +1 -1
- package/resources/ach-transfers.d.ts +604 -679
- package/resources/ach-transfers.d.ts.map +1 -1
- package/resources/ach-transfers.js +39 -37
- package/resources/ach-transfers.js.map +1 -1
- package/resources/ach-transfers.mjs +34 -32
- package/resources/ach-transfers.mjs.map +1 -1
- package/resources/balance-lookups.d.ts +35 -38
- package/resources/balance-lookups.js +12 -11
- package/resources/balance-lookups.mjs +9 -8
- package/resources/bookkeeping-accounts.d.ts +66 -70
- package/resources/bookkeeping-accounts.js +21 -21
- package/resources/bookkeeping-accounts.mjs +16 -14
- package/resources/bookkeeping-entries.d.ts +36 -37
- package/resources/bookkeeping-entries.js +15 -15
- package/resources/bookkeeping-entries.mjs +10 -8
- package/resources/bookkeeping-entry-sets.d.ts +61 -64
- package/resources/bookkeeping-entry-sets.js +12 -13
- package/resources/bookkeeping-entry-sets.mjs +9 -8
- package/resources/card-disputes.d.ts +127 -129
- package/resources/card-disputes.js +27 -25
- package/resources/card-disputes.mjs +22 -20
- package/resources/card-profiles.d.ts +235 -245
- package/resources/card-profiles.js +33 -31
- package/resources/card-profiles.mjs +28 -26
- package/resources/card-purchase-supplements.d.ts +219 -238
- package/resources/card-purchase-supplements.js +21 -21
- package/resources/card-purchase-supplements.mjs +16 -14
- package/resources/cards.d.ts +288 -279
- package/resources/cards.d.ts.map +1 -1
- package/resources/cards.js +39 -37
- package/resources/cards.js.map +1 -1
- package/resources/cards.mjs +34 -32
- package/resources/cards.mjs.map +1 -1
- package/resources/check-deposits.d.ts +238 -260
- package/resources/check-deposits.js +27 -25
- package/resources/check-deposits.mjs +22 -20
- package/resources/check-transfers.d.ts +487 -503
- package/resources/check-transfers.js +45 -43
- package/resources/check-transfers.mjs +40 -38
- package/resources/declined-transactions.d.ts +811 -926
- package/resources/declined-transactions.d.ts.map +1 -1
- package/resources/declined-transactions.js +21 -21
- package/resources/declined-transactions.js.map +1 -1
- package/resources/declined-transactions.mjs +16 -14
- package/resources/declined-transactions.mjs.map +1 -1
- package/resources/digital-wallet-tokens.d.ts +75 -77
- package/resources/digital-wallet-tokens.js +21 -21
- package/resources/digital-wallet-tokens.mjs +16 -14
- package/resources/documents.d.ts +78 -77
- package/resources/documents.js +21 -19
- package/resources/documents.mjs +16 -14
- package/resources/entities/beneficial-owners.d.ts +233 -244
- package/resources/entities/beneficial-owners.js +24 -25
- package/resources/entities/beneficial-owners.mjs +21 -20
- package/resources/entities/entities.d.ts +1532 -1585
- package/resources/entities/entities.d.ts.map +1 -1
- package/resources/entities/entities.js +67 -83
- package/resources/entities/entities.mjs +43 -42
- package/resources/entities/index.d.ts +4 -22
- package/resources/entities/index.js +12 -42
- package/resources/entities/index.mjs +4 -4
- package/resources/entities/supplemental-documents.d.ts +38 -44
- package/resources/entities/supplemental-documents.js +24 -24
- package/resources/entities/supplemental-documents.mjs +20 -18
- package/resources/event-subscriptions.d.ts +246 -355
- package/resources/event-subscriptions.d.ts.map +1 -1
- package/resources/event-subscriptions.js +33 -33
- package/resources/event-subscriptions.js.map +1 -1
- package/resources/event-subscriptions.mjs +28 -26
- package/resources/event-subscriptions.mjs.map +1 -1
- package/resources/events.d.ts +152 -254
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +21 -19
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +16 -14
- package/resources/events.mjs.map +1 -1
- package/resources/exports.d.ts +210 -158
- package/resources/exports.d.ts.map +1 -1
- package/resources/exports.js +27 -25
- package/resources/exports.js.map +1 -1
- package/resources/exports.mjs +22 -20
- package/resources/exports.mjs.map +1 -1
- package/resources/external-accounts.d.ts +122 -128
- package/resources/external-accounts.js +33 -33
- package/resources/external-accounts.mjs +28 -26
- package/resources/files.d.ts +149 -196
- package/resources/files.js +30 -28
- package/resources/files.mjs +24 -22
- package/resources/groups.d.ts +35 -35
- package/resources/groups.js +12 -11
- package/resources/groups.mjs +9 -8
- package/resources/inbound-ach-transfers.d.ts +270 -305
- package/resources/inbound-ach-transfers.d.ts.map +1 -1
- package/resources/inbound-ach-transfers.js +42 -42
- package/resources/inbound-ach-transfers.js.map +1 -1
- package/resources/inbound-ach-transfers.mjs +37 -35
- package/resources/inbound-ach-transfers.mjs.map +1 -1
- package/resources/inbound-wire-drawdown-requests.d.ts +113 -119
- package/resources/inbound-wire-drawdown-requests.js +24 -25
- package/resources/inbound-wire-drawdown-requests.mjs +19 -19
- package/resources/index.d.ts +39 -205
- package/resources/index.js +114 -540
- package/resources/index.mjs +39 -42
- package/resources/oauth-connections.d.ts +43 -44
- package/resources/oauth-connections.js +21 -21
- package/resources/oauth-connections.mjs +16 -14
- package/resources/pending-transactions.d.ts +560 -601
- package/resources/pending-transactions.js +21 -21
- package/resources/pending-transactions.mjs +16 -14
- package/resources/programs.d.ts +41 -39
- package/resources/programs.js +21 -19
- package/resources/programs.mjs +16 -14
- package/resources/real-time-decisions.d.ts +384 -411
- package/resources/real-time-decisions.js +18 -19
- package/resources/real-time-decisions.mjs +15 -14
- package/resources/real-time-payments-transfers.d.ts +304 -342
- package/resources/real-time-payments-transfers.js +30 -30
- package/resources/real-time-payments-transfers.mjs +25 -23
- package/resources/routing-numbers.d.ts +52 -54
- package/resources/routing-numbers.js +18 -16
- package/resources/routing-numbers.mjs +14 -12
- package/resources/simulations/account-statements.d.ts +12 -15
- package/resources/simulations/account-statements.js +13 -14
- package/resources/simulations/account-statements.mjs +10 -9
- package/resources/simulations/account-transfers.d.ts +8 -11
- package/resources/simulations/account-transfers.js +13 -13
- package/resources/simulations/account-transfers.mjs +10 -10
- package/resources/simulations/ach-transfers.d.ts +3636 -3845
- package/resources/simulations/ach-transfers.d.ts.map +1 -1
- package/resources/simulations/ach-transfers.js +40 -35
- package/resources/simulations/ach-transfers.js.map +1 -1
- package/resources/simulations/ach-transfers.mjs +37 -32
- package/resources/simulations/ach-transfers.mjs.map +1 -1
- package/resources/simulations/card-disputes.d.ts +22 -26
- package/resources/simulations/card-disputes.js +15 -14
- package/resources/simulations/card-disputes.mjs +12 -11
- package/resources/simulations/card-profiles.d.ts +9 -9
- package/resources/simulations/card-profiles.js +14 -14
- package/resources/simulations/card-profiles.mjs +11 -11
- package/resources/simulations/card-refunds.d.ts +13 -16
- package/resources/simulations/card-refunds.js +13 -12
- package/resources/simulations/card-refunds.mjs +10 -9
- package/resources/simulations/cards.d.ts +1311 -1448
- package/resources/simulations/cards.d.ts.map +1 -1
- package/resources/simulations/cards.js +28 -27
- package/resources/simulations/cards.js.map +1 -1
- package/resources/simulations/cards.mjs +25 -24
- package/resources/simulations/cards.mjs.map +1 -1
- package/resources/simulations/check-deposits.d.ts +17 -17
- package/resources/simulations/check-deposits.js +26 -26
- package/resources/simulations/check-deposits.mjs +23 -23
- package/resources/simulations/check-transfers.d.ts +12 -18
- package/resources/simulations/check-transfers.js +19 -19
- package/resources/simulations/check-transfers.mjs +16 -16
- package/resources/simulations/digital-wallet-token-requests.d.ts +35 -43
- package/resources/simulations/digital-wallet-token-requests.js +13 -15
- package/resources/simulations/digital-wallet-token-requests.mjs +10 -9
- package/resources/simulations/documents.d.ts +11 -11
- package/resources/simulations/documents.js +12 -11
- package/resources/simulations/documents.mjs +9 -8
- package/resources/simulations/inbound-funds-holds.d.ts +63 -66
- package/resources/simulations/inbound-funds-holds.js +13 -14
- package/resources/simulations/inbound-funds-holds.mjs +10 -9
- package/resources/simulations/inbound-wire-drawdown-requests.d.ts +94 -97
- package/resources/simulations/inbound-wire-drawdown-requests.js +13 -15
- package/resources/simulations/inbound-wire-drawdown-requests.mjs +10 -11
- package/resources/simulations/index.d.ts +19 -40
- package/resources/simulations/index.js +40 -148
- package/resources/simulations/index.mjs +19 -19
- package/resources/simulations/interest-payments.d.ts +2503 -2752
- package/resources/simulations/interest-payments.d.ts.map +1 -1
- package/resources/simulations/interest-payments.js +13 -14
- package/resources/simulations/interest-payments.js.map +1 -1
- package/resources/simulations/interest-payments.mjs +10 -9
- package/resources/simulations/interest-payments.mjs.map +1 -1
- package/resources/simulations/programs.d.ts +13 -13
- package/resources/simulations/programs.js +14 -13
- package/resources/simulations/programs.mjs +11 -10
- package/resources/simulations/real-time-payments-transfers.d.ts +3368 -3744
- package/resources/simulations/real-time-payments-transfers.d.ts.map +1 -1
- package/resources/simulations/real-time-payments-transfers.js +24 -25
- package/resources/simulations/real-time-payments-transfers.js.map +1 -1
- package/resources/simulations/real-time-payments-transfers.mjs +21 -20
- package/resources/simulations/real-time-payments-transfers.mjs.map +1 -1
- package/resources/simulations/simulations.d.ts +75 -75
- package/resources/simulations/simulations.js +78 -101
- package/resources/simulations/simulations.mjs +56 -56
- package/resources/simulations/wire-transfers.d.ts +2566 -2810
- package/resources/simulations/wire-transfers.d.ts.map +1 -1
- package/resources/simulations/wire-transfers.js +12 -11
- package/resources/simulations/wire-transfers.js.map +1 -1
- package/resources/simulations/wire-transfers.mjs +9 -8
- package/resources/simulations/wire-transfers.mjs.map +1 -1
- package/resources/transactions.d.ts +2559 -2838
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +21 -19
- package/resources/transactions.js.map +1 -1
- package/resources/transactions.mjs +16 -14
- package/resources/transactions.mjs.map +1 -1
- package/resources/wire-drawdown-requests.d.ts +140 -147
- package/resources/wire-drawdown-requests.js +27 -27
- package/resources/wire-drawdown-requests.mjs +22 -20
- package/resources/wire-transfers.d.ts +320 -324
- package/resources/wire-transfers.d.ts.map +1 -1
- package/resources/wire-transfers.js +56 -54
- package/resources/wire-transfers.js.map +1 -1
- package/resources/wire-transfers.mjs +51 -49
- package/resources/wire-transfers.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 +71 -43
- package/src/error.ts +4 -2
- package/src/index.ts +9 -7
- package/src/pagination.ts +1 -1
- package/src/resource.ts +1 -1
- package/src/resources/account-numbers.ts +49 -5
- package/src/resources/account-statements.ts +5 -5
- package/src/resources/account-transfers.ts +5 -5
- package/src/resources/accounts.ts +5 -5
- package/src/resources/ach-prenotifications.ts +45 -16
- package/src/resources/ach-transfers.ts +47 -17
- package/src/resources/balance-lookups.ts +3 -3
- package/src/resources/bookkeeping-accounts.ts +5 -5
- package/src/resources/bookkeeping-entries.ts +5 -5
- package/src/resources/bookkeeping-entry-sets.ts +3 -3
- package/src/resources/card-disputes.ts +5 -5
- package/src/resources/card-profiles.ts +5 -5
- package/src/resources/card-purchase-supplements.ts +5 -5
- package/src/resources/cards.ts +15 -5
- package/src/resources/check-deposits.ts +5 -5
- package/src/resources/check-transfers.ts +5 -5
- package/src/resources/declined-transactions.ts +11 -5
- package/src/resources/digital-wallet-tokens.ts +5 -5
- package/src/resources/documents.ts +5 -5
- package/src/resources/entities/beneficial-owners.ts +5 -5
- package/src/resources/entities/entities.ts +18 -18
- package/src/resources/entities/index.ts +3 -3
- package/src/resources/entities/supplemental-documents.ts +5 -5
- package/src/resources/event-subscriptions.ts +13 -5
- package/src/resources/events.ts +11 -5
- package/src/resources/exports.ts +64 -7
- package/src/resources/external-accounts.ts +5 -5
- package/src/resources/files.ts +6 -6
- package/src/resources/groups.ts +3 -3
- package/src/resources/inbound-ach-transfers.ts +11 -5
- package/src/resources/inbound-wire-drawdown-requests.ts +5 -5
- package/src/resources/index.ts +38 -38
- package/src/resources/oauth-connections.ts +5 -5
- package/src/resources/pending-transactions.ts +5 -5
- package/src/resources/programs.ts +5 -5
- package/src/resources/real-time-decisions.ts +3 -3
- package/src/resources/real-time-payments-transfers.ts +5 -5
- package/src/resources/routing-numbers.ts +4 -4
- package/src/resources/simulations/account-statements.ts +4 -4
- package/src/resources/simulations/account-transfers.ts +3 -3
- package/src/resources/simulations/ach-transfers.ts +333 -29
- package/src/resources/simulations/card-disputes.ts +4 -4
- package/src/resources/simulations/card-profiles.ts +3 -3
- package/src/resources/simulations/card-refunds.ts +4 -4
- package/src/resources/simulations/cards.ts +10 -4
- package/src/resources/simulations/check-deposits.ts +3 -3
- package/src/resources/simulations/check-transfers.ts +3 -3
- package/src/resources/simulations/digital-wallet-token-requests.ts +3 -3
- package/src/resources/simulations/documents.ts +4 -4
- package/src/resources/simulations/inbound-funds-holds.ts +3 -3
- package/src/resources/simulations/inbound-wire-drawdown-requests.ts +4 -4
- package/src/resources/simulations/index.ts +18 -18
- package/src/resources/simulations/interest-payments.ts +42 -14
- package/src/resources/simulations/programs.ts +4 -4
- package/src/resources/simulations/real-time-payments-transfers.ts +49 -15
- package/src/resources/simulations/simulations.ts +19 -19
- package/src/resources/simulations/wire-transfers.ts +48 -14
- package/src/resources/transactions.ts +44 -16
- package/src/resources/wire-drawdown-requests.ts +5 -5
- package/src/resources/wire-transfers.ts +11 -5
- 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 +115 -157
- package/uploads.js.map +1 -1
- package/uploads.mjs +111 -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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-runtime.d.ts","sourceRoot":"","sources":["../src/_shims/node-runtime.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AA4CxC,wBAAgB,UAAU,IAAI,KAAK,CAoBlC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.getRuntime = void 0;
|
|
30
|
+
/**
|
|
31
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
32
|
+
*/
|
|
33
|
+
const nf = __importStar(require("node-fetch"));
|
|
34
|
+
const fd = __importStar(require("formdata-node"));
|
|
35
|
+
const agentkeepalive_1 = __importDefault(require("agentkeepalive"));
|
|
36
|
+
const abort_controller_1 = require("abort-controller");
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const form_data_encoder_1 = require("form-data-encoder");
|
|
39
|
+
const node_stream_1 = require("node:stream");
|
|
40
|
+
const MultipartBody_1 = require("./MultipartBody.js");
|
|
41
|
+
let fileFromPathWarned = false;
|
|
42
|
+
async function fileFromPath(path, ...args) {
|
|
43
|
+
// this import fails in environments that don't handle export maps correctly, like old versions of Jest
|
|
44
|
+
const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => __importStar(require('formdata-node/file-from-path')));
|
|
45
|
+
if (!fileFromPathWarned) {
|
|
46
|
+
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
|
|
47
|
+
fileFromPathWarned = true;
|
|
48
|
+
}
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
return await _fileFromPath(path, ...args);
|
|
51
|
+
}
|
|
52
|
+
const defaultHttpAgent = new agentkeepalive_1.default({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
|
53
|
+
const defaultHttpsAgent = new agentkeepalive_1.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
|
54
|
+
async function getMultipartRequestOptions(form, opts) {
|
|
55
|
+
const encoder = new form_data_encoder_1.FormDataEncoder(form);
|
|
56
|
+
const readable = node_stream_1.Readable.from(encoder);
|
|
57
|
+
const body = new MultipartBody_1.MultipartBody(readable);
|
|
58
|
+
const headers = {
|
|
59
|
+
...opts.headers,
|
|
60
|
+
...encoder.headers,
|
|
61
|
+
'Content-Length': encoder.contentLength,
|
|
62
|
+
};
|
|
63
|
+
return { ...opts, body: body, headers };
|
|
64
|
+
}
|
|
65
|
+
function getRuntime() {
|
|
66
|
+
// Polyfill global object if needed.
|
|
67
|
+
if (typeof AbortController === 'undefined') {
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
AbortController = abort_controller_1.AbortController;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
kind: 'node',
|
|
73
|
+
fetch: nf.default,
|
|
74
|
+
Request: nf.Request,
|
|
75
|
+
Response: nf.Response,
|
|
76
|
+
Headers: nf.Headers,
|
|
77
|
+
FormData: fd.FormData,
|
|
78
|
+
Blob: fd.Blob,
|
|
79
|
+
File: fd.File,
|
|
80
|
+
getMultipartRequestOptions,
|
|
81
|
+
getDefaultAgent: (url) => (url.startsWith('https') ? defaultHttpsAgent : defaultHttpAgent),
|
|
82
|
+
fileFromPath,
|
|
83
|
+
isFsReadStream: (value) => value instanceof node_fs_1.ReadStream,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
exports.getRuntime = getRuntime;
|
|
87
|
+
//# sourceMappingURL=node-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-runtime.js","sourceRoot":"","sources":["../src/_shims/node-runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,+CAAiC;AACjC,kDAAoC;AAEpC,oEAA4C;AAC5C,uDAA8E;AAC9E,qCAAqD;AAErD,yDAAoD;AACpD,6CAAuC;AAEvC,sDAAgD;AAKhD,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAS/B,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,GAAG,IAAW;IACtD,uGAAuG;IACvG,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,wDAAa,8BAA8B,GAAC,CAAC;IAErF,IAAI,CAAC,kBAAkB,EAAE;QACvB,OAAO,CAAC,IAAI,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrG,kBAAkB,GAAG,IAAI,CAAC;KAC3B;IACD,aAAa;IACb,OAAO,MAAM,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,gBAAgB,GAAU,IAAI,wBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAChG,MAAM,iBAAiB,GAAU,IAAI,wBAAc,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAE5G,KAAK,UAAU,0BAA0B,CACvC,IAAiB,EACjB,IAAuB;IAEvB,MAAM,OAAO,GAAG,IAAI,mCAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,sBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,6BAAa,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG;QACd,GAAG,IAAI,CAAC,OAAO;QACf,GAAG,OAAO,CAAC,OAAO;QAClB,gBAAgB,EAAE,OAAO,CAAC,aAAa;KACxC,CAAC;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC;AAED,SAAgB,UAAU;IACxB,oCAAoC;IACpC,IAAI,OAAO,eAAe,KAAK,WAAW,EAAE;QAC1C,aAAa;QACb,eAAe,GAAG,kCAAuB,CAAC;KAC3C;IACD,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,EAAE,CAAC,OAAO;QACjB,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,IAAI,EAAE,EAAE,CAAC,IAAI;QACb,IAAI,EAAE,EAAE,CAAC,IAAI;QACb,0BAA0B;QAC1B,eAAe,EAAE,CAAC,GAAW,EAAS,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,CAAC;QACzG,YAAY;QACZ,cAAc,EAAE,CAAC,KAAU,EAAyB,EAAE,CAAC,KAAK,YAAY,oBAAY;KACrF,CAAC;AACJ,CAAC;AApBD,gCAoBC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as nf from 'node-fetch';
|
|
2
|
+
import * as fd from 'formdata-node';
|
|
3
|
+
import KeepAliveAgent from 'agentkeepalive';
|
|
4
|
+
import { AbortController as AbortControllerPolyfill } from 'abort-controller';
|
|
5
|
+
import { ReadStream as FsReadStream } from 'node:fs';
|
|
6
|
+
import { FormDataEncoder } from 'form-data-encoder';
|
|
7
|
+
import { Readable } from 'node:stream';
|
|
8
|
+
import { MultipartBody } from "./MultipartBody.mjs";
|
|
9
|
+
let fileFromPathWarned = false;
|
|
10
|
+
async function fileFromPath(path, ...args) {
|
|
11
|
+
// this import fails in environments that don't handle export maps correctly, like old versions of Jest
|
|
12
|
+
const { fileFromPath: _fileFromPath } = await import('formdata-node/file-from-path');
|
|
13
|
+
if (!fileFromPathWarned) {
|
|
14
|
+
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
|
|
15
|
+
fileFromPathWarned = true;
|
|
16
|
+
}
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
return await _fileFromPath(path, ...args);
|
|
19
|
+
}
|
|
20
|
+
const defaultHttpAgent = new KeepAliveAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
|
21
|
+
const defaultHttpsAgent = new KeepAliveAgent.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
|
|
22
|
+
async function getMultipartRequestOptions(form, opts) {
|
|
23
|
+
const encoder = new FormDataEncoder(form);
|
|
24
|
+
const readable = Readable.from(encoder);
|
|
25
|
+
const body = new MultipartBody(readable);
|
|
26
|
+
const headers = {
|
|
27
|
+
...opts.headers,
|
|
28
|
+
...encoder.headers,
|
|
29
|
+
'Content-Length': encoder.contentLength,
|
|
30
|
+
};
|
|
31
|
+
return { ...opts, body: body, headers };
|
|
32
|
+
}
|
|
33
|
+
export function getRuntime() {
|
|
34
|
+
// Polyfill global object if needed.
|
|
35
|
+
if (typeof AbortController === 'undefined') {
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
AbortController = AbortControllerPolyfill;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
kind: 'node',
|
|
41
|
+
fetch: nf.default,
|
|
42
|
+
Request: nf.Request,
|
|
43
|
+
Response: nf.Response,
|
|
44
|
+
Headers: nf.Headers,
|
|
45
|
+
FormData: fd.FormData,
|
|
46
|
+
Blob: fd.Blob,
|
|
47
|
+
File: fd.File,
|
|
48
|
+
getMultipartRequestOptions,
|
|
49
|
+
getDefaultAgent: (url) => (url.startsWith('https') ? defaultHttpsAgent : defaultHttpAgent),
|
|
50
|
+
fileFromPath,
|
|
51
|
+
isFsReadStream: (value) => value instanceof FsReadStream,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=node-runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-runtime.mjs","sourceRoot":"","sources":["../src/_shims/node-runtime.ts"],"names":[],"mappings":"OAGO,KAAK,EAAE,MAAM,YAAY;OACzB,KAAK,EAAE,MAAM,eAAe;OAE5B,cAAc,MAAM,gBAAgB;OACpC,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,kBAAkB;OACtE,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,SAAS;OAE7C,EAAE,eAAe,EAAE,MAAM,mBAAmB;OAC5C,EAAE,QAAQ,EAAE,MAAM,aAAa;OAE/B,EAAE,aAAa,EAAE;AAKxB,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAS/B,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,GAAG,IAAW;IACtD,uGAAuG;IACvG,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC;IAErF,IAAI,CAAC,kBAAkB,EAAE;QACvB,OAAO,CAAC,IAAI,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrG,kBAAkB,GAAG,IAAI,CAAC;KAC3B;IACD,aAAa;IACb,OAAO,MAAM,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,gBAAgB,GAAU,IAAI,cAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAChG,MAAM,iBAAiB,GAAU,IAAI,cAAc,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAE5G,KAAK,UAAU,0BAA0B,CACvC,IAAiB,EACjB,IAAuB;IAEvB,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG;QACd,GAAG,IAAI,CAAC,OAAO;QACf,GAAG,OAAO,CAAC,OAAO;QAClB,gBAAgB,EAAE,OAAO,CAAC,aAAa;KACxC,CAAC;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,oCAAoC;IACpC,IAAI,OAAO,eAAe,KAAK,WAAW,EAAE;QAC1C,aAAa;QACb,eAAe,GAAG,uBAAuB,CAAC;KAC3C;IACD,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,EAAE,CAAC,OAAO;QACjB,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,QAAQ,EAAE,EAAE,CAAC,QAAQ;QACrB,IAAI,EAAE,EAAE,CAAC,IAAI;QACb,IAAI,EAAE,EAAE,CAAC,IAAI;QACb,0BAA0B;QAC1B,eAAe,EAAE,CAAC,GAAW,EAAS,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,CAAC;QACzG,YAAY;QACZ,cAAc,EAAE,CAAC,KAAU,EAAyB,EAAE,CAAC,KAAK,YAAY,YAAY;KACrF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
import * as nf from 'node-fetch';
|
|
5
|
+
import * as fd from 'formdata-node';
|
|
6
|
+
|
|
7
|
+
export { type Agent } from 'node:http';
|
|
8
|
+
export { type Readable } from 'node:stream';
|
|
9
|
+
export { type ReadStream as FsReadStream } from 'node:fs';
|
|
10
|
+
export { type ReadableStream } from 'web-streams-polyfill';
|
|
11
|
+
|
|
12
|
+
export const fetch: typeof nf.default;
|
|
13
|
+
|
|
14
|
+
export type Request = nf.Request;
|
|
15
|
+
export type RequestInfo = nf.RequestInfo;
|
|
16
|
+
export type RequestInit = nf.RequestInit;
|
|
17
|
+
|
|
18
|
+
export type Response = nf.Response;
|
|
19
|
+
export type ResponseInit = nf.ResponseInit;
|
|
20
|
+
export type ResponseType = nf.ResponseType;
|
|
21
|
+
export type BodyInit = nf.BodyInit;
|
|
22
|
+
export type Headers = nf.Headers;
|
|
23
|
+
export type HeadersInit = nf.HeadersInit;
|
|
24
|
+
|
|
25
|
+
type EndingType = 'native' | 'transparent';
|
|
26
|
+
export interface BlobPropertyBag {
|
|
27
|
+
endings?: EndingType;
|
|
28
|
+
type?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
|
32
|
+
lastModified?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
36
|
+
|
|
37
|
+
export type FormData = fd.FormData;
|
|
38
|
+
export const FormData: typeof fd.FormData;
|
|
39
|
+
export type File = fd.File;
|
|
40
|
+
export const File: typeof fd.File;
|
|
41
|
+
export type Blob = fd.Blob;
|
|
42
|
+
export const Blob: typeof fd.Blob;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
import { type RequestOptions } from "../core.js";
|
|
5
|
+
export interface Shims {
|
|
6
|
+
kind: string;
|
|
7
|
+
fetch: any;
|
|
8
|
+
Request: any;
|
|
9
|
+
Response: any;
|
|
10
|
+
Headers: any;
|
|
11
|
+
FormData: any;
|
|
12
|
+
Blob: any;
|
|
13
|
+
File: any;
|
|
14
|
+
getMultipartRequestOptions: <T extends {} = Record<string, unknown>>(form: Shims['FormData'], opts: RequestOptions<T>) => Promise<RequestOptions<T>>;
|
|
15
|
+
getDefaultAgent: (url: string) => any;
|
|
16
|
+
fileFromPath: ((path: string, filename?: string, options?: {}) => Promise<Shims['File']>) | ((path: string, options?: {}) => Promise<Shims['File']>);
|
|
17
|
+
isFsReadStream: (value: any) => boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare let auto: boolean;
|
|
20
|
+
export declare let kind: Shims['kind'] | undefined;
|
|
21
|
+
export declare let fetch: Shims['fetch'] | undefined;
|
|
22
|
+
export declare let Request: Shims['Request'] | undefined;
|
|
23
|
+
export declare let Response: Shims['Response'] | undefined;
|
|
24
|
+
export declare let Headers: Shims['Headers'] | undefined;
|
|
25
|
+
export declare let FormData: Shims['FormData'] | undefined;
|
|
26
|
+
export declare let Blob: Shims['Blob'] | undefined;
|
|
27
|
+
export declare let File: Shims['File'] | undefined;
|
|
28
|
+
export declare let getMultipartRequestOptions: Shims['getMultipartRequestOptions'] | undefined;
|
|
29
|
+
export declare let getDefaultAgent: Shims['getDefaultAgent'] | undefined;
|
|
30
|
+
export declare let fileFromPath: Shims['fileFromPath'] | undefined;
|
|
31
|
+
export declare let isFsReadStream: Shims['isFsReadStream'] | undefined;
|
|
32
|
+
export declare function setShims(shims: Shims, options?: {
|
|
33
|
+
auto: boolean;
|
|
34
|
+
}): void;
|
|
35
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/_shims/registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;IACV,0BAA0B,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,EACvB,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,KACpB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAChC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;IACtC,YAAY,EACR,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAC3E,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC7D,cAAc,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC;CACzC;AAED,eAAO,IAAI,IAAI,SAAQ,CAAC;AACxB,eAAO,IAAI,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAqB,CAAC;AACvD,eAAO,IAAI,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,SAAqB,CAAC;AACzD,eAAO,IAAI,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,SAAqB,CAAC;AAC7D,eAAO,IAAI,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,SAAqB,CAAC;AAC/D,eAAO,IAAI,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,SAAqB,CAAC;AAC7D,eAAO,IAAI,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,SAAqB,CAAC;AAC/D,eAAO,IAAI,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAqB,CAAC;AACvD,eAAO,IAAI,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAqB,CAAC;AACvD,eAAO,IAAI,0BAA0B,EAAE,KAAK,CAAC,4BAA4B,CAAC,GAAG,SAAqB,CAAC;AACnG,eAAO,IAAI,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,SAAqB,CAAC;AAC7E,eAAO,IAAI,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,SAAqB,CAAC;AACvE,eAAO,IAAI,cAAc,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,SAAqB,CAAC;AAE3E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,GAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAoB,QAwBlF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setShims = exports.isFsReadStream = exports.fileFromPath = exports.getDefaultAgent = exports.getMultipartRequestOptions = exports.File = exports.Blob = exports.FormData = exports.Headers = exports.Response = exports.Request = exports.fetch = exports.kind = exports.auto = void 0;
|
|
4
|
+
exports.auto = false;
|
|
5
|
+
exports.kind = undefined;
|
|
6
|
+
exports.fetch = undefined;
|
|
7
|
+
exports.Request = undefined;
|
|
8
|
+
exports.Response = undefined;
|
|
9
|
+
exports.Headers = undefined;
|
|
10
|
+
exports.FormData = undefined;
|
|
11
|
+
exports.Blob = undefined;
|
|
12
|
+
exports.File = undefined;
|
|
13
|
+
exports.getMultipartRequestOptions = undefined;
|
|
14
|
+
exports.getDefaultAgent = undefined;
|
|
15
|
+
exports.fileFromPath = undefined;
|
|
16
|
+
exports.isFsReadStream = undefined;
|
|
17
|
+
function setShims(shims, options = { auto: false }) {
|
|
18
|
+
if (exports.auto) {
|
|
19
|
+
throw new Error(`you must \`import 'increase/shims/${shims.kind}'\` before importing anything else from increase`);
|
|
20
|
+
}
|
|
21
|
+
if (exports.kind) {
|
|
22
|
+
throw new Error(`can't \`import 'increase/shims/${shims.kind}'\` after \`import 'increase/shims/${exports.kind}'\``);
|
|
23
|
+
}
|
|
24
|
+
exports.auto = options.auto;
|
|
25
|
+
exports.kind = shims.kind;
|
|
26
|
+
exports.fetch = shims.fetch;
|
|
27
|
+
exports.Request = shims.Request;
|
|
28
|
+
exports.Response = shims.Response;
|
|
29
|
+
exports.Headers = shims.Headers;
|
|
30
|
+
exports.FormData = shims.FormData;
|
|
31
|
+
exports.Blob = shims.Blob;
|
|
32
|
+
exports.File = shims.File;
|
|
33
|
+
exports.getMultipartRequestOptions = shims.getMultipartRequestOptions;
|
|
34
|
+
exports.getDefaultAgent = shims.getDefaultAgent;
|
|
35
|
+
exports.fileFromPath = shims.fileFromPath;
|
|
36
|
+
exports.isFsReadStream = shims.isFsReadStream;
|
|
37
|
+
}
|
|
38
|
+
exports.setShims = setShims;
|
|
39
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/_shims/registry.ts"],"names":[],"mappings":";;;AAyBW,QAAA,IAAI,GAAG,KAAK,CAAC;AACb,QAAA,IAAI,GAA8B,SAAS,CAAC;AAC5C,QAAA,KAAK,GAA+B,SAAS,CAAC;AAC9C,QAAA,OAAO,GAAiC,SAAS,CAAC;AAClD,QAAA,QAAQ,GAAkC,SAAS,CAAC;AACpD,QAAA,OAAO,GAAiC,SAAS,CAAC;AAClD,QAAA,QAAQ,GAAkC,SAAS,CAAC;AACpD,QAAA,IAAI,GAA8B,SAAS,CAAC;AAC5C,QAAA,IAAI,GAA8B,SAAS,CAAC;AAC5C,QAAA,0BAA0B,GAAoD,SAAS,CAAC;AACxF,QAAA,eAAe,GAAyC,SAAS,CAAC;AAClE,QAAA,YAAY,GAAsC,SAAS,CAAC;AAC5D,QAAA,cAAc,GAAwC,SAAS,CAAC;AAE3E,SAAgB,QAAQ,CAAC,KAAY,EAAE,UAA6B,EAAE,IAAI,EAAE,KAAK,EAAE;IACjF,IAAI,YAAI,EAAE;QACR,MAAM,IAAI,KAAK,CACb,qCAAqC,KAAK,CAAC,IAAI,kDAAkD,CAClG,CAAC;KACH;IACD,IAAI,YAAI,EAAE;QACR,MAAM,IAAI,KAAK,CACb,kCAAkC,KAAK,CAAC,IAAI,sCAAsC,YAAI,KAAK,CAC5F,CAAC;KACH;IACD,YAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IACpB,YAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,aAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACpB,eAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACxB,gBAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,eAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACxB,gBAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,YAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,YAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,kCAA0B,GAAG,KAAK,CAAC,0BAA0B,CAAC;IAC9D,uBAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IACxC,oBAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAClC,sBAAc,GAAG,KAAK,CAAC,cAAc,CAAC;AACxC,CAAC;AAxBD,4BAwBC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export let auto = false;
|
|
2
|
+
export let kind = undefined;
|
|
3
|
+
export let fetch = undefined;
|
|
4
|
+
export let Request = undefined;
|
|
5
|
+
export let Response = undefined;
|
|
6
|
+
export let Headers = undefined;
|
|
7
|
+
export let FormData = undefined;
|
|
8
|
+
export let Blob = undefined;
|
|
9
|
+
export let File = undefined;
|
|
10
|
+
export let getMultipartRequestOptions = undefined;
|
|
11
|
+
export let getDefaultAgent = undefined;
|
|
12
|
+
export let fileFromPath = undefined;
|
|
13
|
+
export let isFsReadStream = undefined;
|
|
14
|
+
export function setShims(shims, options = { auto: false }) {
|
|
15
|
+
if (auto) {
|
|
16
|
+
throw new Error(`you must \`import 'increase/shims/${shims.kind}'\` before importing anything else from increase`);
|
|
17
|
+
}
|
|
18
|
+
if (kind) {
|
|
19
|
+
throw new Error(`can't \`import 'increase/shims/${shims.kind}'\` after \`import 'increase/shims/${kind}'\``);
|
|
20
|
+
}
|
|
21
|
+
auto = options.auto;
|
|
22
|
+
kind = shims.kind;
|
|
23
|
+
fetch = shims.fetch;
|
|
24
|
+
Request = shims.Request;
|
|
25
|
+
Response = shims.Response;
|
|
26
|
+
Headers = shims.Headers;
|
|
27
|
+
FormData = shims.FormData;
|
|
28
|
+
Blob = shims.Blob;
|
|
29
|
+
File = shims.File;
|
|
30
|
+
getMultipartRequestOptions = shims.getMultipartRequestOptions;
|
|
31
|
+
getDefaultAgent = shims.getDefaultAgent;
|
|
32
|
+
fileFromPath = shims.fileFromPath;
|
|
33
|
+
isFsReadStream = shims.isFsReadStream;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=registry.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.mjs","sourceRoot":"","sources":["../src/_shims/registry.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,IAAI,IAAI,GAAG,KAAK,CAAC;AACxB,MAAM,CAAC,IAAI,IAAI,GAA8B,SAAS,CAAC;AACvD,MAAM,CAAC,IAAI,KAAK,GAA+B,SAAS,CAAC;AACzD,MAAM,CAAC,IAAI,OAAO,GAAiC,SAAS,CAAC;AAC7D,MAAM,CAAC,IAAI,QAAQ,GAAkC,SAAS,CAAC;AAC/D,MAAM,CAAC,IAAI,OAAO,GAAiC,SAAS,CAAC;AAC7D,MAAM,CAAC,IAAI,QAAQ,GAAkC,SAAS,CAAC;AAC/D,MAAM,CAAC,IAAI,IAAI,GAA8B,SAAS,CAAC;AACvD,MAAM,CAAC,IAAI,IAAI,GAA8B,SAAS,CAAC;AACvD,MAAM,CAAC,IAAI,0BAA0B,GAAoD,SAAS,CAAC;AACnG,MAAM,CAAC,IAAI,eAAe,GAAyC,SAAS,CAAC;AAC7E,MAAM,CAAC,IAAI,YAAY,GAAsC,SAAS,CAAC;AACvE,MAAM,CAAC,IAAI,cAAc,GAAwC,SAAS,CAAC;AAE3E,MAAM,UAAU,QAAQ,CAAC,KAAY,EAAE,UAA6B,EAAE,IAAI,EAAE,KAAK,EAAE;IACjF,IAAI,IAAI,EAAE;QACR,MAAM,IAAI,KAAK,CACb,qCAAqC,KAAK,CAAC,IAAI,kDAAkD,CAClG,CAAC;KACH;IACD,IAAI,IAAI,EAAE;QACR,MAAM,IAAI,KAAK,CACb,kCAAkC,KAAK,CAAC,IAAI,sCAAsC,IAAI,KAAK,CAC5F,CAAC;KACH;IACD,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IACpB,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACpB,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACxB,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACxB,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,0BAA0B,GAAG,KAAK,CAAC,0BAA0B,CAAC;IAC9D,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IACxC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAClC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-runtime.d.ts","sourceRoot":"","sources":["../src/_shims/web-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,wBAAgB,UAAU,CAAC,EAAE,gBAAgB,EAAE,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,KAAK,CAmF3F"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntime = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
6
|
+
*/
|
|
7
|
+
const MultipartBody_1 = require("./MultipartBody.js");
|
|
8
|
+
function getRuntime({ manuallyImported } = {}) {
|
|
9
|
+
const recommendation = manuallyImported ?
|
|
10
|
+
`You may need to use polyfills`
|
|
11
|
+
: `Add one of these imports before your first \`import … from 'increase'\`:
|
|
12
|
+
- \`import 'increase/shims/node'\` (if you're running on Node)
|
|
13
|
+
- \`import 'increase/shims/web'\` (otherwise)
|
|
14
|
+
`;
|
|
15
|
+
let _fetch, _Request, _Response, _Headers;
|
|
16
|
+
try {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
_fetch = fetch;
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
_Request = Request;
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
_Response = Response;
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
_Headers = Headers;
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw new Error(`this environment is missing the following Web Fetch API type: ${error.message}. ${recommendation}`);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
kind: 'web',
|
|
31
|
+
fetch: _fetch,
|
|
32
|
+
Request: _Request,
|
|
33
|
+
Response: _Response,
|
|
34
|
+
Headers: _Headers,
|
|
35
|
+
FormData:
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
typeof FormData !== 'undefined' ? FormData : (class FormData {
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
constructor() {
|
|
40
|
+
throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${recommendation}`);
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
Blob: typeof Blob !== 'undefined' ? Blob : (class Blob {
|
|
44
|
+
constructor() {
|
|
45
|
+
throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${recommendation}`);
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
File:
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
typeof File !== 'undefined' ? File : (class File {
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
constructor() {
|
|
53
|
+
throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${recommendation}`);
|
|
54
|
+
}
|
|
55
|
+
}),
|
|
56
|
+
getMultipartRequestOptions: async (
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
form, opts) => ({
|
|
59
|
+
...opts,
|
|
60
|
+
body: new MultipartBody_1.MultipartBody(form),
|
|
61
|
+
}),
|
|
62
|
+
getDefaultAgent: (url) => undefined,
|
|
63
|
+
fileFromPath: () => {
|
|
64
|
+
throw new Error('The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/increase/increase-node#file-uploads');
|
|
65
|
+
},
|
|
66
|
+
isFsReadStream: (value) => false,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
exports.getRuntime = getRuntime;
|
|
70
|
+
//# sourceMappingURL=web-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-runtime.js","sourceRoot":"","sources":["../src/_shims/web-runtime.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,sDAAgD;AAIhD,SAAgB,UAAU,CAAC,EAAE,gBAAgB,KAAqC,EAAE;IAClF,MAAM,cAAc,GAClB,gBAAgB,CAAC,CAAC;QAChB,+BAA+B;QACjC,CAAC,CAAC;;;CAGL,CAAC;IAEA,IAAI,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;IAC1C,IAAI;QACF,aAAa;QACb,MAAM,GAAG,KAAK,CAAC;QACf,aAAa;QACb,QAAQ,GAAG,OAAO,CAAC;QACnB,aAAa;QACb,SAAS,GAAG,QAAQ,CAAC;QACrB,aAAa;QACb,QAAQ,GAAG,OAAO,CAAC;KACpB;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,iEACG,KAAa,CAAC,OACjB,KAAK,cAAc,EAAE,CACtB,CAAC;KACH;IAED,OAAO;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,QAAQ;QACjB,QAAQ;QACN,aAAa;QACb,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC3C,MAAM,QAAQ;YACZ,aAAa;YACb;gBACE,MAAM,IAAI,KAAK,CACb,qFAAqF,cAAc,EAAE,CACtG,CAAC;YACJ,CAAC;SACF,CACF;QACH,IAAI,EACF,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnC,MAAM,IAAI;YACR;gBACE,MAAM,IAAI,KAAK,CACb,iFAAiF,cAAc,EAAE,CAClG,CAAC;YACJ,CAAC;SACF,CACF;QACH,IAAI;QACF,aAAa;QACb,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnC,MAAM,IAAI;YACR,aAAa;YACb;gBACE,MAAM,IAAI,KAAK,CACb,iFAAiF,cAAc,EAAE,CAClG,CAAC;YACJ,CAAC;SACF,CACF;QACH,0BAA0B,EAAE,KAAK;QAC/B,aAAa;QACb,IAAc,EACd,IAAuB,EACK,EAAE,CAAC,CAAC;YAChC,GAAG,IAAI;YACP,IAAI,EAAE,IAAI,6BAAa,CAAC,IAAI,CAAQ;SACrC,CAAC;QACF,eAAe,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,SAAS;QAC3C,YAAY,EAAE,GAAG,EAAE;YACjB,MAAM,IAAI,KAAK,CACb,oJAAoJ,CACrJ,CAAC;QACJ,CAAC;QACD,cAAc,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK;KACtC,CAAC;AACJ,CAAC;AAnFD,gCAmFC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { MultipartBody } from "./MultipartBody.mjs";
|
|
2
|
+
export function getRuntime({ manuallyImported } = {}) {
|
|
3
|
+
const recommendation = manuallyImported ?
|
|
4
|
+
`You may need to use polyfills`
|
|
5
|
+
: `Add one of these imports before your first \`import … from 'increase'\`:
|
|
6
|
+
- \`import 'increase/shims/node'\` (if you're running on Node)
|
|
7
|
+
- \`import 'increase/shims/web'\` (otherwise)
|
|
8
|
+
`;
|
|
9
|
+
let _fetch, _Request, _Response, _Headers;
|
|
10
|
+
try {
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
_fetch = fetch;
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
_Request = Request;
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
_Response = Response;
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
_Headers = Headers;
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
throw new Error(`this environment is missing the following Web Fetch API type: ${error.message}. ${recommendation}`);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
kind: 'web',
|
|
25
|
+
fetch: _fetch,
|
|
26
|
+
Request: _Request,
|
|
27
|
+
Response: _Response,
|
|
28
|
+
Headers: _Headers,
|
|
29
|
+
FormData:
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
typeof FormData !== 'undefined' ? FormData : (class FormData {
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
constructor() {
|
|
34
|
+
throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${recommendation}`);
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
Blob: typeof Blob !== 'undefined' ? Blob : (class Blob {
|
|
38
|
+
constructor() {
|
|
39
|
+
throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${recommendation}`);
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
File:
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
typeof File !== 'undefined' ? File : (class File {
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
constructor() {
|
|
47
|
+
throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${recommendation}`);
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
getMultipartRequestOptions: async (
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
form, opts) => ({
|
|
53
|
+
...opts,
|
|
54
|
+
body: new MultipartBody(form),
|
|
55
|
+
}),
|
|
56
|
+
getDefaultAgent: (url) => undefined,
|
|
57
|
+
fileFromPath: () => {
|
|
58
|
+
throw new Error('The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/increase/increase-node#file-uploads');
|
|
59
|
+
},
|
|
60
|
+
isFsReadStream: (value) => false,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=web-runtime.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-runtime.mjs","sourceRoot":"","sources":["../src/_shims/web-runtime.ts"],"names":[],"mappings":"OAGO,EAAE,aAAa,EAAE;AAIxB,MAAM,UAAU,UAAU,CAAC,EAAE,gBAAgB,KAAqC,EAAE;IAClF,MAAM,cAAc,GAClB,gBAAgB,CAAC,CAAC;QAChB,+BAA+B;QACjC,CAAC,CAAC;;;CAGL,CAAC;IAEA,IAAI,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;IAC1C,IAAI;QACF,aAAa;QACb,MAAM,GAAG,KAAK,CAAC;QACf,aAAa;QACb,QAAQ,GAAG,OAAO,CAAC;QACnB,aAAa;QACb,SAAS,GAAG,QAAQ,CAAC;QACrB,aAAa;QACb,QAAQ,GAAG,OAAO,CAAC;KACpB;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,iEACG,KAAa,CAAC,OACjB,KAAK,cAAc,EAAE,CACtB,CAAC;KACH;IAED,OAAO;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,QAAQ;QACjB,QAAQ;QACN,aAAa;QACb,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC3C,MAAM,QAAQ;YACZ,aAAa;YACb;gBACE,MAAM,IAAI,KAAK,CACb,qFAAqF,cAAc,EAAE,CACtG,CAAC;YACJ,CAAC;SACF,CACF;QACH,IAAI,EACF,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnC,MAAM,IAAI;YACR;gBACE,MAAM,IAAI,KAAK,CACb,iFAAiF,cAAc,EAAE,CAClG,CAAC;YACJ,CAAC;SACF,CACF;QACH,IAAI;QACF,aAAa;QACb,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnC,MAAM,IAAI;YACR,aAAa;YACb;gBACE,MAAM,IAAI,KAAK,CACb,iFAAiF,cAAc,EAAE,CAClG,CAAC;YACJ,CAAC;SACF,CACF;QACH,0BAA0B,EAAE,KAAK;QAC/B,aAAa;QACb,IAAc,EACd,IAAuB,EACK,EAAE,CAAC,CAAC;YAChC,GAAG,IAAI;YACP,IAAI,EAAE,IAAI,aAAa,CAAC,IAAI,CAAQ;SACrC,CAAC;QACF,eAAe,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,SAAS;QAC3C,YAAY,EAAE,GAAG,EAAE;YACjB,MAAM,IAAI,KAAK,CACb,oJAAoJ,CACrJ,CAAC;QACJ,CAAC;QACD,cAAc,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
export type Agent = any;
|
|
5
|
+
|
|
6
|
+
declare const _fetch: typeof fetch;
|
|
7
|
+
export { _fetch as fetch };
|
|
8
|
+
|
|
9
|
+
type _Request = Request;
|
|
10
|
+
export { _Request as Request };
|
|
11
|
+
|
|
12
|
+
type _RequestInfo = RequestInfo;
|
|
13
|
+
export { type _RequestInfo as RequestInfo };
|
|
14
|
+
|
|
15
|
+
type _RequestInit = RequestInit;
|
|
16
|
+
export { type _RequestInit as RequestInit };
|
|
17
|
+
|
|
18
|
+
type _Response = Response;
|
|
19
|
+
export { _Response as Response };
|
|
20
|
+
|
|
21
|
+
type _ResponseInit = ResponseInit;
|
|
22
|
+
export { type _ResponseInit as ResponseInit };
|
|
23
|
+
|
|
24
|
+
type _ResponseType = ResponseType;
|
|
25
|
+
export { type _ResponseType as ResponseType };
|
|
26
|
+
|
|
27
|
+
type _BodyInit = BodyInit;
|
|
28
|
+
export { type _BodyInit as BodyInit };
|
|
29
|
+
|
|
30
|
+
type _Headers = Headers;
|
|
31
|
+
export { _Headers as Headers };
|
|
32
|
+
|
|
33
|
+
type _HeadersInit = HeadersInit;
|
|
34
|
+
export { type _HeadersInit as HeadersInit };
|
|
35
|
+
|
|
36
|
+
type EndingType = 'native' | 'transparent';
|
|
37
|
+
|
|
38
|
+
export interface BlobPropertyBag {
|
|
39
|
+
endings?: EndingType;
|
|
40
|
+
type?: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface FilePropertyBag extends BlobPropertyBag {
|
|
44
|
+
lastModified?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
|
|
48
|
+
|
|
49
|
+
type _FormData = FormData;
|
|
50
|
+
declare const _FormData: typeof FormData;
|
|
51
|
+
export { _FormData as FormData };
|
|
52
|
+
|
|
53
|
+
type _File = File;
|
|
54
|
+
declare const _File: typeof File;
|
|
55
|
+
export { _File as File };
|
|
56
|
+
|
|
57
|
+
type _Blob = Blob;
|
|
58
|
+
declare const _Blob: typeof Blob;
|
|
59
|
+
export { _Blob as Blob };
|
|
60
|
+
|
|
61
|
+
export declare class Readable {
|
|
62
|
+
readable: boolean;
|
|
63
|
+
readonly readableEnded: boolean;
|
|
64
|
+
readonly readableFlowing: boolean | null;
|
|
65
|
+
readonly readableHighWaterMark: number;
|
|
66
|
+
readonly readableLength: number;
|
|
67
|
+
readonly readableObjectMode: boolean;
|
|
68
|
+
destroyed: boolean;
|
|
69
|
+
read(size?: number): any;
|
|
70
|
+
pause(): this;
|
|
71
|
+
resume(): this;
|
|
72
|
+
isPaused(): boolean;
|
|
73
|
+
destroy(error?: Error): this;
|
|
74
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare class FsReadStream extends Readable {
|
|
78
|
+
path: {}; // node type is string | Buffer
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type _ReadableStream<R = any> = ReadableStream<R>;
|
|
82
|
+
export { type _ReadableStream as ReadableStream };
|