appium-mac2-driver 4.4.0 → 4.5.1
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 +16 -0
- package/WebDriverAgentMac/IntegrationTests/AMWindowTests.m +427 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/AMWindowCommands.m +63 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/FBDebugCommands.m +2 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBCommandStatus.h +3 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBCommandStatus.m +13 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMScreenUtils.h +4 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMScreenUtils.m +23 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMSnapshotUtils.h +18 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMSnapshotUtils.m +43 -28
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMWindowUtils.h +111 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMWindowUtils.m +780 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMXCTAccessibility.h +61 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/AMXCTAccessibility.m +108 -0
- package/WebDriverAgentMac/WebDriverAgentMac.xcodeproj/project.pbxproj +20 -0
- package/build/lib/commands/native-record-screen.d.ts +2 -0
- package/build/lib/commands/native-record-screen.d.ts.map +1 -1
- package/build/lib/commands/native-record-screen.js.map +1 -1
- package/build/lib/commands/windows.d.ts +22 -0
- package/build/lib/commands/windows.d.ts.map +1 -0
- package/build/lib/commands/windows.js +32 -0
- package/build/lib/commands/windows.js.map +1 -0
- package/build/lib/driver.d.ts +12 -0
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +3 -0
- package/build/lib/driver.js.map +1 -1
- package/build/lib/execute-method-map.d.ts +9 -0
- package/build/lib/execute-method-map.d.ts.map +1 -1
- package/build/lib/execute-method-map.js +9 -0
- package/build/lib/execute-method-map.js.map +1 -1
- package/build/lib/session-claim-handler.d.ts.map +1 -1
- package/build/lib/session-claim-handler.js +1 -2
- package/build/lib/session-claim-handler.js.map +1 -1
- package/build/lib/types.d.ts +26 -0
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/wda-mac.d.ts +0 -1
- package/build/lib/wda-mac.d.ts.map +1 -1
- package/build/lib/wda-mac.js +1 -1
- package/lib/commands/native-record-screen.ts +2 -0
- package/lib/commands/windows.ts +44 -0
- package/lib/driver.ts +4 -0
- package/lib/execute-method-map.ts +9 -0
- package/lib/session-claim-handler.ts +1 -2
- package/lib/types.ts +28 -0
- package/lib/wda-mac.ts +1 -2
- package/node_modules/@appium/support/build/lib/npm.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/npm.js +2 -1
- package/node_modules/@appium/support/build/lib/npm.js.map +1 -1
- package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/util.js +13 -1
- package/node_modules/@appium/support/build/lib/util.js.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.d.ts +2 -1
- package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.js +193 -64
- package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
- package/node_modules/@appium/support/lib/npm.ts +2 -1
- package/node_modules/@appium/support/lib/util.ts +13 -1
- package/node_modules/@appium/support/lib/zip.ts +231 -71
- package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +1934 -0
- package/node_modules/@appium/support/node_modules/axios/LICENSE +7 -0
- package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +877 -0
- package/node_modules/@appium/support/node_modules/axios/README.md +2851 -0
- package/node_modules/@appium/support/node_modules/axios/dist/axios.js +5807 -0
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +5 -0
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +1 -0
- package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +5829 -0
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +5850 -0
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +3 -0
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +1 -0
- package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +6808 -0
- package/node_modules/@appium/support/node_modules/axios/index.d.cts +766 -0
- package/node_modules/@appium/support/node_modules/axios/index.d.ts +787 -0
- package/node_modules/@appium/support/node_modules/axios/index.js +45 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +36 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +132 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +696 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +1490 -0
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +277 -0
- package/node_modules/@appium/support/node_modules/axios/lib/axios.js +89 -0
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +135 -0
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +22 -0
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +306 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +219 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +171 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +8 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +76 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +95 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +174 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +27 -0
- package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +28 -0
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +178 -0
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +10 -0
- package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +1 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +7 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +14 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +69 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +18 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +23 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +68 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +64 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +2 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +15 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +28 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +45 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +279 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +89 -0
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +112 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +13 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +52 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +7 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +37 -0
- package/node_modules/@appium/support/node_modules/axios/lib/utils.js +1150 -0
- package/node_modules/@appium/support/node_modules/axios/package.json +203 -0
- package/node_modules/@appium/support/package.json +6 -6
- package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts +6 -4
- package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts.map +1 -1
- package/node_modules/@appium/types/lib/commands/basedriver.ts +4 -4
- package/node_modules/@appium/types/package.json +2 -2
- package/node_modules/appium-xcode/CHANGELOG.md +7 -0
- package/node_modules/appium-xcode/package.json +4 -4
- package/node_modules/asyncbox/README.md +43 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +35 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.js +23 -0
- package/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.d.ts +9 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.js +20 -0
- package/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/index.d.ts +12 -0
- package/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/index.js +24 -0
- package/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts +3 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.js +15 -0
- package/node_modules/asyncbox/build/cjs/lib/limit-function.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.d.ts +74 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.js +295 -0
- package/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts +15 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.js +36 -0
- package/node_modules/asyncbox/build/cjs/lib/long-sleep.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.d.ts +17 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.js +57 -0
- package/node_modules/asyncbox/build/cjs/lib/retry.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts +20 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.js +61 -0
- package/node_modules/asyncbox/build/cjs/lib/sleep.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +18 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +51 -0
- package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts +16 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts.map +1 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.js +45 -0
- package/node_modules/asyncbox/build/cjs/lib/with-timeout.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.js +32 -0
- package/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.js +20 -0
- package/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/errors.d.ts +9 -0
- package/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/errors.js +15 -0
- package/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/index.d.ts +12 -0
- package/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/index.js +10 -0
- package/node_modules/asyncbox/build/esm/lib/index.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts +3 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.js +12 -0
- package/node_modules/asyncbox/build/esm/lib/limit-function.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/lock.d.ts +74 -0
- package/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/lock.js +291 -0
- package/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts +15 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.js +33 -0
- package/node_modules/asyncbox/build/esm/lib/long-sleep.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/retry.d.ts +17 -0
- package/node_modules/asyncbox/build/esm/lib/retry.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/retry.js +53 -0
- package/node_modules/asyncbox/build/esm/lib/retry.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.d.ts +20 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.js +58 -0
- package/node_modules/asyncbox/build/esm/lib/sleep.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +18 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +48 -0
- package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts +16 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts.map +1 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.js +42 -0
- package/node_modules/asyncbox/build/esm/lib/with-timeout.js.map +1 -0
- package/node_modules/asyncbox/lib/asyncfilter.ts +38 -0
- package/node_modules/asyncbox/lib/asyncmap.ts +29 -0
- package/node_modules/asyncbox/lib/errors.ts +15 -0
- package/node_modules/asyncbox/lib/index.ts +21 -0
- package/node_modules/asyncbox/lib/limit-function.ts +18 -0
- package/node_modules/asyncbox/lib/lock.ts +360 -0
- package/node_modules/asyncbox/lib/long-sleep.ts +38 -0
- package/node_modules/asyncbox/lib/retry.ts +61 -0
- package/node_modules/asyncbox/lib/sleep.ts +79 -0
- package/node_modules/asyncbox/lib/wait-for-condition.ts +52 -0
- package/node_modules/asyncbox/lib/with-timeout.ts +43 -0
- package/node_modules/asyncbox/package.json +8 -8
- package/node_modules/axios/README.md +41 -106
- package/node_modules/axios/dist/axios.js +931 -278
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +948 -268
- package/node_modules/axios/dist/esm/axios.js +948 -268
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +925 -242
- package/node_modules/axios/index.d.cts +20 -1
- package/node_modules/axios/index.d.ts +18 -1
- package/node_modules/axios/lib/adapters/fetch.js +73 -20
- package/node_modules/axios/lib/adapters/http.js +145 -26
- package/node_modules/axios/lib/adapters/xhr.js +120 -13
- package/node_modules/axios/lib/core/Axios.js +67 -12
- package/node_modules/axios/lib/core/AxiosError.js +59 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +17 -4
- package/node_modules/axios/lib/core/InterceptorManager.js +13 -2
- package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
- package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +20 -0
- package/node_modules/axios/lib/core/mergeConfig.js +183 -120
- package/node_modules/axios/lib/defaults/transitional.js +1 -0
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +11 -2
- package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -1
- package/node_modules/axios/lib/helpers/composeSignals.js +6 -3
- package/node_modules/axios/lib/helpers/cookies.js +30 -6
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +34 -7
- package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +25 -1
- package/node_modules/axios/lib/helpers/fromDataURI.js +8 -2
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +4 -9
- package/node_modules/axios/lib/helpers/parseHeaders.js +2 -1
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/resolveConfig.js +16 -3
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +16 -1
- package/node_modules/axios/lib/utils.js +61 -10
- package/node_modules/axios/package.json +1 -2
- package/node_modules/bare-url/README.md +4 -0
- package/node_modules/bare-url/index.d.ts +3 -0
- package/node_modules/bare-url/index.js +42 -18
- package/node_modules/bare-url/lib/errors.js +4 -0
- package/node_modules/bare-url/package.json +1 -1
- package/node_modules/bare-url/prebuilds/android-arm/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-ia32/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/android-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/darwin-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-arm64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/ios-x64-simulator/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/linux-x64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-arm64/bare-url.bare +0 -0
- package/node_modules/bare-url/prebuilds/win32-x64/bare-url.bare +0 -0
- package/node_modules/follow-redirects/README.md +27 -1
- package/node_modules/follow-redirects/index.js +1 -5
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/shell-quote/README.md +37 -4
- package/node_modules/shell-quote/package.json +10 -6
- package/node_modules/shell-quote/parse.d.ts +1 -1
- package/node_modules/shell-quote/parse.js +63 -11
- package/node_modules/shell-quote/quote.d.ts +2 -1
- package/node_modules/shell-quote/quote.js +23 -3
- package/node_modules/uuid/package.json +17 -17
- package/package.json +6 -7
- package/scripts/setup-accessibility.mjs +175 -0
- package/node_modules/async-lock/AUTHORS +0 -21
- package/node_modules/async-lock/History.md +0 -132
- package/node_modules/async-lock/LICENSE +0 -22
- package/node_modules/async-lock/README.md +0 -177
- package/node_modules/async-lock/index.js +0 -2
- package/node_modules/async-lock/lib/index.js +0 -312
- package/node_modules/async-lock/package.json +0 -48
- package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
- package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -311
- package/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
- package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
- package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -298
- package/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
- package/node_modules/asyncbox/lib/asyncbox.ts +0 -382
- package/node_modules/shell-quote/.nycrc +0 -14
- package/node_modules/shell-quote/eslint.config.mjs +0 -29
- package/node_modules/shell-quote/security.md +0 -11
- package/node_modules/shell-quote/test/comment.js +0 -16
- package/node_modules/shell-quote/test/env.js +0 -52
- package/node_modules/shell-quote/test/env_fn.js +0 -21
- package/node_modules/shell-quote/test/op.js +0 -102
- package/node_modules/shell-quote/test/parse.js +0 -149
- package/node_modules/shell-quote/test/quote.js +0 -145
- package/node_modules/shell-quote/test/set.js +0 -31
|
@@ -181,7 +181,7 @@ declare class CanceledError<T, D = any, P = any> extends AxiosError<T, D, P> {
|
|
|
181
181
|
|
|
182
182
|
declare const axiosResponseDefault: unique symbol;
|
|
183
183
|
|
|
184
|
-
type AxiosResponseDefault =
|
|
184
|
+
type AxiosResponseDefault = axios.AxiosResponseDefault;
|
|
185
185
|
|
|
186
186
|
type AxiosResponseResult<T, R, D, P> = R extends AxiosResponseDefault
|
|
187
187
|
? axios.AxiosResponse<T, D, {}, P>
|
|
@@ -331,6 +331,10 @@ declare enum HttpStatusCode {
|
|
|
331
331
|
type InternalAxiosError<T = unknown, D = any, P = any> = AxiosError<T, D, P>;
|
|
332
332
|
|
|
333
333
|
declare namespace axios {
|
|
334
|
+
interface AxiosResponseDefault {
|
|
335
|
+
readonly [axiosResponseDefault]: true;
|
|
336
|
+
}
|
|
337
|
+
|
|
334
338
|
type AxiosHeaderParameters = Record<string, string>;
|
|
335
339
|
|
|
336
340
|
type AxiosError<T = unknown, D = any, P = any> = InternalAxiosError<T, D, P>;
|
|
@@ -430,6 +434,8 @@ declare namespace axios {
|
|
|
430
434
|
legacyInterceptorReqResOrdering?: boolean;
|
|
431
435
|
advertiseZstdAcceptEncoding?: boolean;
|
|
432
436
|
validateStatusUndefinedResolves?: boolean;
|
|
437
|
+
/** Opt in to UTF-8 Basic auth usernames in XHR/Fetch config resolution. Defaults to false. */
|
|
438
|
+
encodeBasicAuthUsername?: boolean;
|
|
433
439
|
}
|
|
434
440
|
|
|
435
441
|
interface GenericAbortSignal {
|
|
@@ -561,6 +567,14 @@ declare namespace axios {
|
|
|
561
567
|
FormData?: new (...args: any[]) => object;
|
|
562
568
|
fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
|
|
563
569
|
Request?: new (input: URL | Request | string, init?: RequestInit) => Request;
|
|
570
|
+
/**
|
|
571
|
+
* Custom Response constructor for the fetch adapter.
|
|
572
|
+
* When response-body streaming is supported, must also accept
|
|
573
|
+
* `ReadableStream<Uint8Array>` bodies at runtime for `onDownloadProgress`,
|
|
574
|
+
* enabled `maxContentLength` limits, or cancellation/timeout tracking with
|
|
575
|
+
* `responseType: 'stream'` or `'response'`.
|
|
576
|
+
* The body parameter retains its legacy type for compatibility.
|
|
577
|
+
*/
|
|
564
578
|
Response?: new (
|
|
565
579
|
body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null,
|
|
566
580
|
init?: ResponseInit
|
|
@@ -636,6 +650,11 @@ declare namespace axios {
|
|
|
636
650
|
data: T;
|
|
637
651
|
status: number;
|
|
638
652
|
statusText: string;
|
|
653
|
+
/**
|
|
654
|
+
* Wall-clock milliseconds from adapter invocation to settlement, clamped at zero.
|
|
655
|
+
* Excludes interceptors and request/response transforms. Stream consumption is not included.
|
|
656
|
+
*/
|
|
657
|
+
duration?: number;
|
|
639
658
|
headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;
|
|
640
659
|
config: InternalAxiosRequestConfig<D, P>;
|
|
641
660
|
request?: any;
|
|
@@ -304,6 +304,8 @@ export interface TransitionalOptions {
|
|
|
304
304
|
legacyInterceptorReqResOrdering?: boolean;
|
|
305
305
|
advertiseZstdAcceptEncoding?: boolean;
|
|
306
306
|
validateStatusUndefinedResolves?: boolean;
|
|
307
|
+
/** Opt in to UTF-8 Basic auth usernames in XHR/Fetch config resolution. Defaults to false. */
|
|
308
|
+
encodeBasicAuthUsername?: boolean;
|
|
307
309
|
}
|
|
308
310
|
|
|
309
311
|
export interface GenericAbortSignal {
|
|
@@ -444,6 +446,14 @@ export interface AxiosRequestConfig<D = any, P = any> {
|
|
|
444
446
|
FormData?: new (...args: any[]) => object;
|
|
445
447
|
fetch?: (input: URL | Request | string, init?: RequestInit) => Promise<Response>;
|
|
446
448
|
Request?: new (input: URL | Request | string, init?: RequestInit) => Request;
|
|
449
|
+
/**
|
|
450
|
+
* Custom Response constructor for the fetch adapter.
|
|
451
|
+
* When response-body streaming is supported, must also accept
|
|
452
|
+
* `ReadableStream<Uint8Array>` bodies at runtime for `onDownloadProgress`,
|
|
453
|
+
* enabled `maxContentLength` limits, or cancellation/timeout tracking with
|
|
454
|
+
* `responseType: 'stream'` or `'response'`.
|
|
455
|
+
* The body parameter retains its legacy type for compatibility.
|
|
456
|
+
*/
|
|
447
457
|
Response?: new (
|
|
448
458
|
body?: ArrayBuffer | ArrayBufferView | Blob | FormData | URLSearchParams | string | null,
|
|
449
459
|
init?: ResponseInit
|
|
@@ -516,6 +526,11 @@ export interface AxiosResponse<T = any, D = any, H = {}, P = any> {
|
|
|
516
526
|
data: T;
|
|
517
527
|
status: number;
|
|
518
528
|
statusText: string;
|
|
529
|
+
/**
|
|
530
|
+
* Wall-clock milliseconds from adapter invocation to settlement, clamped at zero.
|
|
531
|
+
* Excludes interceptors and request/response transforms. Stream consumption is not included.
|
|
532
|
+
*/
|
|
533
|
+
duration?: number;
|
|
519
534
|
headers: (H & RawAxiosResponseHeaders) | AxiosResponseHeaders;
|
|
520
535
|
config: InternalAxiosRequestConfig<D, P>;
|
|
521
536
|
request?: any;
|
|
@@ -571,7 +586,9 @@ export class CanceledError<T, D = any, P = any> extends AxiosError<T, D, P> {
|
|
|
571
586
|
|
|
572
587
|
declare const axiosResponseDefault: unique symbol;
|
|
573
588
|
|
|
574
|
-
|
|
589
|
+
export interface AxiosResponseDefault {
|
|
590
|
+
readonly [axiosResponseDefault]: true;
|
|
591
|
+
}
|
|
575
592
|
|
|
576
593
|
type AxiosResponseResult<T, R, D, P> = R extends AxiosResponseDefault
|
|
577
594
|
? AxiosResponse<T, D, {}, P>
|
|
@@ -3,6 +3,7 @@ import utils from '../utils.js';
|
|
|
3
3
|
import AxiosError from '../core/AxiosError.js';
|
|
4
4
|
import composeSignals from '../helpers/composeSignals.js';
|
|
5
5
|
import { trackStream } from '../helpers/trackStream.js';
|
|
6
|
+
import createMultipartBody from '../core/createMultipartBody.js';
|
|
6
7
|
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
7
8
|
import {
|
|
8
9
|
progressEventReducer,
|
|
@@ -89,11 +90,13 @@ const factory = (env) => {
|
|
|
89
90
|
{
|
|
90
91
|
Request: globalObject.Request,
|
|
91
92
|
Response: globalObject.Response,
|
|
93
|
+
Blob: globalObject.Blob,
|
|
92
94
|
},
|
|
93
95
|
env
|
|
94
96
|
);
|
|
95
97
|
|
|
96
|
-
const
|
|
98
|
+
const envFetch = utils.hasOwnProp(env, 'fetch') ? env.fetch : undefined;
|
|
99
|
+
const { Request, Response, Blob } = env;
|
|
97
100
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
98
101
|
const isRequestSupported = isFunction(Request);
|
|
99
102
|
const isResponseSupported = isFunction(Response);
|
|
@@ -142,6 +145,20 @@ const factory = (env) => {
|
|
|
142
145
|
isReadableStreamSupported &&
|
|
143
146
|
test(() => utils.isReadableStream(new Response('').body));
|
|
144
147
|
|
|
148
|
+
// Some runtimes reject every explicit cache mode. Use own defaults for both
|
|
149
|
+
// probes so unrelated polluted options cannot affect cache-mode detection.
|
|
150
|
+
const requestDefaults = Object.assign(Object.create(null), DEFAULT_REQUEST_OPTIONS);
|
|
151
|
+
|
|
152
|
+
if (isRequestSupported && !test(() => new Request(platform.origin, requestDefaults))) {
|
|
153
|
+
delete requestDefaults.cache;
|
|
154
|
+
|
|
155
|
+
// Only omit cache when that makes Request construction succeed. Otherwise
|
|
156
|
+
// retain the explicit default that protects supporting runtimes from pollution.
|
|
157
|
+
if (!test(() => new Request(platform.origin, requestDefaults))) {
|
|
158
|
+
requestDefaults.cache = DEFAULT_REQUEST_OPTIONS.cache;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
145
162
|
const resolvers = {
|
|
146
163
|
stream: supportsResponseStream && ((res) => res.body),
|
|
147
164
|
};
|
|
@@ -175,14 +192,6 @@ const factory = (env) => {
|
|
|
175
192
|
return body.size;
|
|
176
193
|
}
|
|
177
194
|
|
|
178
|
-
if (utils.isSpecCompliantForm(body)) {
|
|
179
|
-
const _request = new Request(platform.origin, {
|
|
180
|
-
method: 'POST',
|
|
181
|
-
body,
|
|
182
|
-
});
|
|
183
|
-
return (await _request.arrayBuffer()).byteLength;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
195
|
if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
|
|
187
196
|
return body.byteLength;
|
|
188
197
|
}
|
|
@@ -245,11 +254,12 @@ const factory = (env) => {
|
|
|
245
254
|
|
|
246
255
|
let requestContentLength;
|
|
247
256
|
|
|
248
|
-
//
|
|
257
|
+
// AxiosErrors we raise while request or response bodies are being streamed. Captured
|
|
249
258
|
// by identity so the catch block can surface it directly, regardless of
|
|
250
259
|
// how the runtime wraps the resulting fetch rejection (undici exposes it
|
|
251
260
|
// as `err.cause`; some browsers drop the original error entirely).
|
|
252
261
|
let pendingBodyError = null;
|
|
262
|
+
let pendingResponseError = null;
|
|
253
263
|
|
|
254
264
|
const maxBodyLengthError = () =>
|
|
255
265
|
new AxiosError(
|
|
@@ -273,8 +283,9 @@ const factory = (env) => {
|
|
|
273
283
|
};
|
|
274
284
|
}
|
|
275
285
|
|
|
286
|
+
let parsedURL;
|
|
276
287
|
if (maybeWithAuthCredentials(url)) {
|
|
277
|
-
|
|
288
|
+
parsedURL = new URL(url, platform.origin);
|
|
278
289
|
|
|
279
290
|
if (!auth && (parsedURL.username || parsedURL.password)) {
|
|
280
291
|
const urlUsername = decodeURIComponentSafe(parsedURL.username);
|
|
@@ -303,8 +314,8 @@ const factory = (env) => {
|
|
|
303
314
|
// Enforce maxContentLength for data: URLs up-front so we never materialize
|
|
304
315
|
// an oversized payload. The HTTP adapter applies the same check (see http.js
|
|
305
316
|
// "if (protocol === 'data:')" branch).
|
|
306
|
-
if (hasMaxContentLength &&
|
|
307
|
-
const estimated = estimateDataURLDecodedBytes(
|
|
317
|
+
if (hasMaxContentLength && parsedURL && parsedURL.protocol === 'data:') {
|
|
318
|
+
const estimated = estimateDataURLDecodedBytes(parsedURL.href);
|
|
308
319
|
if (estimated > maxContentLength) {
|
|
309
320
|
throw new AxiosError(
|
|
310
321
|
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
@@ -315,6 +326,38 @@ const factory = (env) => {
|
|
|
315
326
|
}
|
|
316
327
|
}
|
|
317
328
|
|
|
329
|
+
const formContentType =
|
|
330
|
+
utils.isSpecCompliantForm(data) && AxiosHeaders.from(own('headers')).getContentType();
|
|
331
|
+
let formBoundary;
|
|
332
|
+
if (
|
|
333
|
+
utils.isString(formContentType) &&
|
|
334
|
+
/^multipart\/form-data(?:\s*;|$)/i.test(formContentType.trim())
|
|
335
|
+
) {
|
|
336
|
+
const parameters = AxiosHeaders.parseParameters(formContentType);
|
|
337
|
+
if (utils.hasOwnProp(parameters, 'boundary')) formBoundary = parameters.boundary;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (
|
|
341
|
+
utils.isSpecCompliantForm(data) &&
|
|
342
|
+
method !== 'get' &&
|
|
343
|
+
method !== 'head' &&
|
|
344
|
+
(hasMaxBodyLength ||
|
|
345
|
+
(onUploadProgress && supportsRequestStream) ||
|
|
346
|
+
formBoundary !== undefined)
|
|
347
|
+
) {
|
|
348
|
+
data = createMultipartBody(
|
|
349
|
+
data,
|
|
350
|
+
Blob,
|
|
351
|
+
hasMaxBodyLength ? maxBodyLength : Infinity,
|
|
352
|
+
maxBodyLengthError,
|
|
353
|
+
formBoundary
|
|
354
|
+
);
|
|
355
|
+
// Blob.type lowercases its value, including a case-sensitive boundary.
|
|
356
|
+
// Retain the caller's header when an explicit boundary was serialized.
|
|
357
|
+
headers.setContentType(formBoundary === undefined ? data.type : formContentType);
|
|
358
|
+
requestContentLength = data.size;
|
|
359
|
+
}
|
|
360
|
+
|
|
318
361
|
// Enforce maxBodyLength against known-size bodies before dispatch using
|
|
319
362
|
// the body's *actual* size — never a caller-declared Content-Length,
|
|
320
363
|
// which could under-report to slip an oversized body past the check.
|
|
@@ -460,7 +503,7 @@ const factory = (env) => {
|
|
|
460
503
|
});
|
|
461
504
|
|
|
462
505
|
if (isRequestSupported) {
|
|
463
|
-
utils.forEach(
|
|
506
|
+
utils.forEach(requestDefaults, (value, key) => {
|
|
464
507
|
if (resolvedOptions[key] === undefined) {
|
|
465
508
|
resolvedOptions[key] = value;
|
|
466
509
|
}
|
|
@@ -534,12 +577,12 @@ const factory = (env) => {
|
|
|
534
577
|
if (hasMaxContentLength) {
|
|
535
578
|
bytesRead = loadedBytes;
|
|
536
579
|
if (bytesRead > maxContentLength) {
|
|
537
|
-
throw new AxiosError(
|
|
580
|
+
throw (pendingResponseError = new AxiosError(
|
|
538
581
|
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
539
582
|
AxiosError.ERR_BAD_RESPONSE,
|
|
540
583
|
config,
|
|
541
584
|
request
|
|
542
|
-
);
|
|
585
|
+
));
|
|
543
586
|
}
|
|
544
587
|
}
|
|
545
588
|
onProgress && onProgress(loadedBytes);
|
|
@@ -625,7 +668,7 @@ const factory = (env) => {
|
|
|
625
668
|
}
|
|
626
669
|
|
|
627
670
|
// Surface a maxBodyLength violation we raised while the request body was
|
|
628
|
-
// being streamed.
|
|
671
|
+
// being streamed. Keeping the original error (rather than reading
|
|
629
672
|
// `err.cause.isAxiosError`) keeps the error deterministic across runtimes
|
|
630
673
|
// and avoids both prototype-pollution reads and mis-attributing a foreign
|
|
631
674
|
// AxiosError that merely happened to land in `err.cause`.
|
|
@@ -634,6 +677,10 @@ const factory = (env) => {
|
|
|
634
677
|
throw pendingBodyError;
|
|
635
678
|
}
|
|
636
679
|
|
|
680
|
+
if (pendingResponseError) {
|
|
681
|
+
throw pendingResponseError;
|
|
682
|
+
}
|
|
683
|
+
|
|
637
684
|
// Re-throw AxiosErrors we raised synchronously (data: URL / content-length
|
|
638
685
|
// pre-checks, response size enforcement) without re-wrapping them.
|
|
639
686
|
if (err instanceof AxiosError) {
|
|
@@ -669,9 +716,15 @@ const factory = (env) => {
|
|
|
669
716
|
const seedCache = new Map();
|
|
670
717
|
|
|
671
718
|
export const getFetch = (config) => {
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
|
|
719
|
+
const env = Object.create(null);
|
|
720
|
+
const configuredEnv = config && utils.hasOwnProp(config, 'env') && config.env;
|
|
721
|
+
['fetch', 'Request', 'Response', 'Blob'].forEach((key) => {
|
|
722
|
+
if (configuredEnv && utils.hasOwnProp(configuredEnv, key)) {
|
|
723
|
+
env[key] = configuredEnv[key];
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
const { fetch, Request, Response, Blob } = env;
|
|
727
|
+
const seeds = [Request, Response, fetch, Blob];
|
|
675
728
|
|
|
676
729
|
let len = seeds.length,
|
|
677
730
|
i = len,
|
|
@@ -28,6 +28,7 @@ import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';
|
|
|
28
28
|
import Http2Sessions from '../helpers/Http2Sessions.js';
|
|
29
29
|
import callbackify from '../helpers/callbackify.js';
|
|
30
30
|
import shouldBypassProxy from '../helpers/shouldBypassProxy.js';
|
|
31
|
+
import bind from '../helpers/bind.js';
|
|
31
32
|
import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';
|
|
32
33
|
import {
|
|
33
34
|
progressEventReducer,
|
|
@@ -87,6 +88,18 @@ const kAxiosInstalledTunnel = Symbol('axios.http.installedTunnel');
|
|
|
87
88
|
// so unbounded growth is not a concern in practice.
|
|
88
89
|
const tunnelingAgentCache = new Map();
|
|
89
90
|
const tunnelingAgentCacheUser = new WeakMap();
|
|
91
|
+
const directAgents = new WeakMap();
|
|
92
|
+
const directAgentHooks = ['createConnection', 'getName'];
|
|
93
|
+
const nativeAgentPoolHooks = [
|
|
94
|
+
'addRequest',
|
|
95
|
+
'createSocket',
|
|
96
|
+
'removeSocket',
|
|
97
|
+
'keepSocketAlive',
|
|
98
|
+
'reuseSocket',
|
|
99
|
+
'_getSession',
|
|
100
|
+
'_cacheSession',
|
|
101
|
+
'_evictSession',
|
|
102
|
+
];
|
|
90
103
|
// Minimum minor versions where Node's HTTP Agent supports native proxyEnv
|
|
91
104
|
// handling. Checking the selected agent below also covers startup modes such
|
|
92
105
|
// as NODE_OPTIONS=--use-env-proxy and --no-use-env-proxy precedence.
|
|
@@ -133,6 +146,83 @@ function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
|
|
|
133
146
|
: configHttpAgent || http.globalAgent;
|
|
134
147
|
}
|
|
135
148
|
|
|
149
|
+
function getDirectAgent(configuredAgent, transport) {
|
|
150
|
+
if (
|
|
151
|
+
!process.allowedNodeEnvironmentFlags ||
|
|
152
|
+
!process.allowedNodeEnvironmentFlags.has('--use-env-proxy')
|
|
153
|
+
) {
|
|
154
|
+
return configuredAgent;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const agent = configuredAgent || transport.globalAgent;
|
|
158
|
+
const options = agent && agent.options;
|
|
159
|
+
if (
|
|
160
|
+
!(agent instanceof transport.Agent) ||
|
|
161
|
+
agent.protocol !== transport.globalAgent.protocol ||
|
|
162
|
+
!options ||
|
|
163
|
+
!utils.hasOwnProp(options, 'proxyEnv') ||
|
|
164
|
+
typeof options.proxyEnv !== 'object' ||
|
|
165
|
+
options.proxyEnv === null
|
|
166
|
+
) {
|
|
167
|
+
return configuredAgent;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// These hooks own pool queues or TLS session state. Neither binding them to
|
|
171
|
+
// the source agent nor copying them without subclass state preserves their
|
|
172
|
+
// behavior on a separate direct pool.
|
|
173
|
+
for (const hook of nativeAgentPoolHooks) {
|
|
174
|
+
if (
|
|
175
|
+
utils.isFunction(transport.Agent.prototype[hook]) &&
|
|
176
|
+
agent[hook] !== transport.Agent.prototype[hook]
|
|
177
|
+
) {
|
|
178
|
+
throw new AxiosError(
|
|
179
|
+
'proxy: false cannot adapt an agent overriding ' +
|
|
180
|
+
hook +
|
|
181
|
+
'; use an agent constructed without proxyEnv',
|
|
182
|
+
AxiosError.ERR_BAD_OPTION_VALUE
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Node snapshots proxyEnv when constructing the agent. Keep this check
|
|
188
|
+
// conservative even when the caller later removes protocol-specific entries.
|
|
189
|
+
let direct = directAgents.get(agent);
|
|
190
|
+
if (!direct) {
|
|
191
|
+
direct = new transport.Agent({ ...options, proxyEnv: undefined });
|
|
192
|
+
|
|
193
|
+
// Agent.destroy() does not emit an event. Keep the associated pool under
|
|
194
|
+
// the configured agent's lifetime, including agents reused after destroy().
|
|
195
|
+
const destroy = agent.destroy;
|
|
196
|
+
agent.destroy = function destroyWithDirectAgent() {
|
|
197
|
+
try {
|
|
198
|
+
return destroy.apply(this, arguments);
|
|
199
|
+
} finally {
|
|
200
|
+
direct.destroy();
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
directAgents.set(agent, direct);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Connections and pool keys do not own the direct pool's queues. Preserve
|
|
207
|
+
// their configured receiver and refresh hooks that change between requests.
|
|
208
|
+
for (const hook of directAgentHooks) {
|
|
209
|
+
direct[hook] =
|
|
210
|
+
agent[hook] === transport.Agent.prototype[hook]
|
|
211
|
+
? transport.Agent.prototype[hook]
|
|
212
|
+
: bind(agent[hook], agent);
|
|
213
|
+
}
|
|
214
|
+
return direct;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function setDirectAgent(options, configHttpAgent, configHttpsAgent) {
|
|
218
|
+
const secure = isHttps.test(options.protocol);
|
|
219
|
+
const agent = getDirectAgent(secure ? configHttpsAgent : configHttpAgent, secure ? https : http);
|
|
220
|
+
options.agent = agent;
|
|
221
|
+
if (options.agents) {
|
|
222
|
+
options.agents[secure ? 'https' : 'http'] = agent;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
136
226
|
function getTunnelingAgent(agentOptions, userHttpsAgent) {
|
|
137
227
|
const key =
|
|
138
228
|
agentOptions.protocol +
|
|
@@ -148,22 +238,24 @@ function getTunnelingAgent(agentOptions, userHttpsAgent) {
|
|
|
148
238
|
: tunnelingAgentCache;
|
|
149
239
|
let agent = cache.get(key);
|
|
150
240
|
if (agent) return agent;
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
//
|
|
241
|
+
// Preserve per-request TLS options for the proxy connection, with our proxy
|
|
242
|
+
// fields taking precedence. Global-agent options belong only to the origin
|
|
243
|
+
// TLS upgrade in the callback below.
|
|
154
244
|
const merged =
|
|
155
245
|
userHttpsAgent && userHttpsAgent.options
|
|
156
246
|
? { ...userHttpsAgent.options, ...agentOptions }
|
|
157
247
|
: agentOptions;
|
|
158
248
|
agent = new HttpsProxyAgent(merged);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
249
|
+
const callback = agent.callback;
|
|
250
|
+
agent.callback = function axiosTunnelingAgentCallback(req, opts) {
|
|
251
|
+
// Without a proxy the origin TLS connection would be made by https.globalAgent,
|
|
252
|
+
// so its options have to reach the tunneled origin too. Resolved per request
|
|
253
|
+
// because the tunneling agent outlives any one of them.
|
|
254
|
+
const originTLSAgent = userHttpsAgent || https.globalAgent;
|
|
255
|
+
const originTLSOptions = originTLSAgent && originTLSAgent.options;
|
|
256
|
+
// HttpsProxyAgent v5 reads callback opts for the post-CONNECT origin TLS upgrade.
|
|
257
|
+
return callback.call(this, req, { ...originTLSOptions, ...opts });
|
|
258
|
+
};
|
|
167
259
|
agent[kAxiosInstalledTunnel] = true;
|
|
168
260
|
cache.set(key, agent);
|
|
169
261
|
return agent;
|
|
@@ -206,6 +298,10 @@ const http2Sessions = new Http2Sessions();
|
|
|
206
298
|
* @returns {Object<string, any>}
|
|
207
299
|
*/
|
|
208
300
|
function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
|
|
301
|
+
if (!isSameOriginRedirect(options, requestDetails)) {
|
|
302
|
+
stripMatchingHeaders(options.headers, new Set(['authorization', 'cookie']));
|
|
303
|
+
delete options.auth;
|
|
304
|
+
}
|
|
209
305
|
if (options.beforeRedirects.proxy) {
|
|
210
306
|
options.beforeRedirects.proxy(options);
|
|
211
307
|
}
|
|
@@ -215,6 +311,9 @@ function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
|
|
|
215
311
|
if (options.beforeRedirects.sensitiveHeaders) {
|
|
216
312
|
options.beforeRedirects.sensitiveHeaders(options, requestDetails);
|
|
217
313
|
}
|
|
314
|
+
if (options.beforeRedirects.direct) {
|
|
315
|
+
options.beforeRedirects.direct(options);
|
|
316
|
+
}
|
|
218
317
|
if (options.beforeRedirects.config) {
|
|
219
318
|
options.beforeRedirects.config(options, responseDetails, requestDetails);
|
|
220
319
|
}
|
|
@@ -292,6 +391,14 @@ function setProxy(
|
|
|
292
391
|
if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
|
|
293
392
|
options.agent = undefined;
|
|
294
393
|
}
|
|
394
|
+
if (
|
|
395
|
+
isRedirect &&
|
|
396
|
+
options.agents &&
|
|
397
|
+
options.agents.https &&
|
|
398
|
+
options.agents.https[kAxiosInstalledTunnel]
|
|
399
|
+
) {
|
|
400
|
+
options.agents.https = configHttpsAgent;
|
|
401
|
+
}
|
|
295
402
|
if (proxy) {
|
|
296
403
|
// Read proxy fields without traversing the prototype chain. URL instances expose
|
|
297
404
|
// username/password/hostname/host/port/protocol via getters on URL.prototype (so
|
|
@@ -429,8 +536,7 @@ function setProxy(
|
|
|
429
536
|
};
|
|
430
537
|
|
|
431
538
|
return Boolean(
|
|
432
|
-
proxy ||
|
|
433
|
-
(configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent))
|
|
539
|
+
proxy || (configProxy !== false && allowEnvProxy && isNodeEnvProxyEnabled(proxyEnvAgent))
|
|
434
540
|
);
|
|
435
541
|
}
|
|
436
542
|
|
|
@@ -580,9 +686,9 @@ export default isHttpAdapterSupported &&
|
|
|
580
686
|
if (httpVersion === undefined) httpVersion = 1;
|
|
581
687
|
const rawHttpVersion = httpVersion;
|
|
582
688
|
let http2Options = own('http2Options');
|
|
689
|
+
const configProxy = own('proxy');
|
|
583
690
|
const httpAgent = own('httpAgent');
|
|
584
691
|
const httpsAgent = own('httpsAgent');
|
|
585
|
-
const configProxy = own('proxy');
|
|
586
692
|
const responseType = own('responseType');
|
|
587
693
|
const responseEncoding = own('responseEncoding');
|
|
588
694
|
const socketPath = own('socketPath');
|
|
@@ -761,6 +867,20 @@ export default isHttpAdapterSupported &&
|
|
|
761
867
|
throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
|
|
762
868
|
}
|
|
763
869
|
|
|
870
|
+
// Check bytes before converting the result to text or a stream.
|
|
871
|
+
if (
|
|
872
|
+
maxContentLength > -1 &&
|
|
873
|
+
(responseType === 'blob' ? convertedData.size : convertedData.length) > maxContentLength
|
|
874
|
+
) {
|
|
875
|
+
return reject(
|
|
876
|
+
new AxiosError(
|
|
877
|
+
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
878
|
+
AxiosError.ERR_BAD_RESPONSE,
|
|
879
|
+
config
|
|
880
|
+
)
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
|
|
764
884
|
if (responseType === 'text') {
|
|
765
885
|
convertedData = convertedData.toString(responseEncoding);
|
|
766
886
|
|
|
@@ -1020,15 +1140,15 @@ export default isHttpAdapterSupported &&
|
|
|
1020
1140
|
}
|
|
1021
1141
|
let transport;
|
|
1022
1142
|
let isNativeTransport = false;
|
|
1023
|
-
// True only for the follow-redirects transport, which applies
|
|
1024
|
-
// options.maxBodyLength itself. Every other transport (http2, native
|
|
1025
|
-
// http/https, a user-supplied custom transport) needs the explicit
|
|
1026
|
-
// byte-counting pipeline below to enforce maxBodyLength on streamed uploads.
|
|
1027
|
-
let transportEnforcesMaxBodyLength = false;
|
|
1028
1143
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
1029
1144
|
// Don't clobber a CONNECT-tunneling agent installed by setProxy() for an
|
|
1030
1145
|
// HTTPS target.
|
|
1031
|
-
if (
|
|
1146
|
+
if (!isHttp2 && configProxy === false) {
|
|
1147
|
+
setDirectAgent(options, httpAgent, httpsAgent);
|
|
1148
|
+
options.beforeRedirects.direct = (redirectOptions) => {
|
|
1149
|
+
setDirectAgent(redirectOptions, httpAgent, httpsAgent);
|
|
1150
|
+
};
|
|
1151
|
+
} else if (options.agent == null) {
|
|
1032
1152
|
options.agent = isHttpsRequest ? httpsAgent : httpAgent;
|
|
1033
1153
|
}
|
|
1034
1154
|
|
|
@@ -1052,7 +1172,6 @@ export default isHttpAdapterSupported &&
|
|
|
1052
1172
|
transport = isHttpsRequest ? https : http;
|
|
1053
1173
|
isNativeTransport = true;
|
|
1054
1174
|
} else {
|
|
1055
|
-
transportEnforcesMaxBodyLength = true;
|
|
1056
1175
|
options.sensitiveHeaders = [];
|
|
1057
1176
|
if (maxRedirects) {
|
|
1058
1177
|
options.maxRedirects = maxRedirects;
|
|
@@ -1442,12 +1561,10 @@ export default isHttpAdapterSupported &&
|
|
|
1442
1561
|
}
|
|
1443
1562
|
});
|
|
1444
1563
|
|
|
1445
|
-
//
|
|
1446
|
-
//
|
|
1447
|
-
// and user-supplied custom transports). The follow-redirects transport
|
|
1448
|
-
// enforces it on the redirected HTTP/1 path.
|
|
1564
|
+
// Transform decodes string chunks to Buffers before counting, so every
|
|
1565
|
+
// transport receives at most maxBodyLength encoded bytes.
|
|
1449
1566
|
let uploadStream = data;
|
|
1450
|
-
if (maxBodyLength > -1
|
|
1567
|
+
if (maxBodyLength > -1) {
|
|
1451
1568
|
const limit = maxBodyLength;
|
|
1452
1569
|
let bytesSent = 0;
|
|
1453
1570
|
uploadStream = stream.pipeline(
|
|
@@ -1486,5 +1603,7 @@ export default isHttpAdapterSupported &&
|
|
|
1486
1603
|
};
|
|
1487
1604
|
|
|
1488
1605
|
export const __setProxy = setProxy;
|
|
1606
|
+
export const __getDirectAgent = getDirectAgent;
|
|
1607
|
+
export const __isNodeNativeEnvProxySupported = isNodeNativeEnvProxySupported;
|
|
1489
1608
|
export const __isNodeEnvProxyEnabled = isNodeEnvProxyEnabled;
|
|
1490
1609
|
export const __isSameOriginRedirect = isSameOriginRedirect;
|