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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Axios v1.
|
|
1
|
+
/*! Axios v1.21.0 Copyright (c) 2026 Matt Zabriskie and contributors */
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -325,11 +325,17 @@ const isPlainObject = (val) => {
|
|
|
325
325
|
const prototype = getPrototypeOf(val);
|
|
326
326
|
return (
|
|
327
327
|
(prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&
|
|
328
|
-
// Treat
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
|
|
332
|
-
|
|
328
|
+
// Treat own Symbol.toStringTag or Symbol.iterator members as evidence the
|
|
329
|
+
// value is tagged/iterable, ignoring members reachable only through shared
|
|
330
|
+
// or terminal prototype boundaries. This is exactly what
|
|
331
|
+
// hasOwnInPrototypeChain(val, prop) computes here: every prototype admitted
|
|
332
|
+
// above (null, Object.prototype, or a terminal null-prototype template) is
|
|
333
|
+
// a boundary, so the walk never inspects anything but `val`'s own members,
|
|
334
|
+
// and stops before even those when `val` is itself the boundary
|
|
335
|
+
// Object.prototype. Checking that inline avoids allocating the walker's
|
|
336
|
+
// `seen` list twice per call on the mergeConfig / merge hot path.
|
|
337
|
+
(isPrototypeBoundary(val, prototype, true) ||
|
|
338
|
+
(!hasOwnProperty(val, toStringTag) && !hasOwnProperty(val, iterator)))
|
|
333
339
|
);
|
|
334
340
|
};
|
|
335
341
|
|
|
@@ -593,15 +599,30 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
|
|
|
593
599
|
function merge(...objs) {
|
|
594
600
|
const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
|
|
595
601
|
const result = {};
|
|
602
|
+
// Caseless lookup only applies to string keys — symbol keys are
|
|
603
|
+
// identity-matched. Every string key that reaches `result` passes through
|
|
604
|
+
// this index first, so it can never hold two case variants of one key and a
|
|
605
|
+
// lowercase -> key map is exactly what findKey(result, key) would rescan
|
|
606
|
+
// Object.keys(result) for on each assignment.
|
|
607
|
+
const lowerCaseKeys = caseless ? Object.create(null) : null;
|
|
596
608
|
const assignValue = (val, key) => {
|
|
597
609
|
// Skip dangerous property names to prevent prototype pollution
|
|
598
610
|
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
599
611
|
return;
|
|
600
612
|
}
|
|
601
613
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
614
|
+
let targetKey = key;
|
|
615
|
+
if (lowerCaseKeys && typeof key === 'string') {
|
|
616
|
+
const lowerKey = key.toLowerCase();
|
|
617
|
+
const knownKey = lowerCaseKeys[lowerKey];
|
|
618
|
+
// A key recorded but absent from `result` was skipped by skipUndefined;
|
|
619
|
+
// the later spelling wins then, as it does for findKey.
|
|
620
|
+
if (knownKey !== undefined && hasOwnProperty(result, knownKey)) {
|
|
621
|
+
targetKey = knownKey;
|
|
622
|
+
} else {
|
|
623
|
+
lowerCaseKeys[lowerKey] = key;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
605
626
|
// Read via own-prop only — a bare `result[targetKey]` walks the prototype
|
|
606
627
|
// chain, so a polluted Object.prototype value could surface here and get
|
|
607
628
|
// copied into the merged result.
|
|
@@ -625,7 +646,7 @@ function merge(...objs) {
|
|
|
625
646
|
|
|
626
647
|
forEach(source, assignValue);
|
|
627
648
|
|
|
628
|
-
if (typeof source !== 'object' || isArray(source)) {
|
|
649
|
+
if (typeof source !== 'object' || isArray(source) || !Object.getOwnPropertySymbols) {
|
|
629
650
|
continue;
|
|
630
651
|
}
|
|
631
652
|
|
|
@@ -784,7 +805,37 @@ const toArray = (thing) => {
|
|
|
784
805
|
if (!thing) return null;
|
|
785
806
|
if (isArray(thing)) return thing;
|
|
786
807
|
let i = thing.length;
|
|
787
|
-
if (!
|
|
808
|
+
if (!Number.isSafeInteger(i) || i < 0 || i > 0xffffffff) return null;
|
|
809
|
+
|
|
810
|
+
// Bound the copy by actual indexed properties, including hidden and inherited
|
|
811
|
+
// members of array-like collections, rather than by the declared length alone.
|
|
812
|
+
const indexes = new Set();
|
|
813
|
+
const seen = new Set();
|
|
814
|
+
let source = thing;
|
|
815
|
+
|
|
816
|
+
while (source != null && indexes.size < i) {
|
|
817
|
+
if (seen.has(source)) return null;
|
|
818
|
+
seen.add(source);
|
|
819
|
+
|
|
820
|
+
const prototype = getPrototypeOf(source);
|
|
821
|
+
if (isPrototypeBoundary(source, prototype, source === thing)) break;
|
|
822
|
+
|
|
823
|
+
Object.getOwnPropertyNames(source).forEach((key) => {
|
|
824
|
+
const index = +key;
|
|
825
|
+
if (
|
|
826
|
+
Number.isInteger(index) &&
|
|
827
|
+
index >= 0 &&
|
|
828
|
+
index < i &&
|
|
829
|
+
String(index) === key &&
|
|
830
|
+
hasOwnProperty(source, key)
|
|
831
|
+
) {
|
|
832
|
+
indexes.add(index);
|
|
833
|
+
}
|
|
834
|
+
});
|
|
835
|
+
source = prototype;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
if (indexes.size !== i) return null;
|
|
788
839
|
const arr = new Array(i);
|
|
789
840
|
while (i-- > 0) {
|
|
790
841
|
arr[i] = thing[i];
|
|
@@ -1198,7 +1249,8 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
|
|
|
1198
1249
|
* @returns {Object} Headers parsed into an object
|
|
1199
1250
|
*/
|
|
1200
1251
|
var parseHeaders = (rawHeaders) => {
|
|
1201
|
-
|
|
1252
|
+
// Header names are data, including __proto__; avoid inherited setters.
|
|
1253
|
+
const parsed = Object.create(null);
|
|
1202
1254
|
let key;
|
|
1203
1255
|
let val;
|
|
1204
1256
|
let i;
|
|
@@ -1432,9 +1484,22 @@ function parseParameters(value) {
|
|
|
1432
1484
|
|
|
1433
1485
|
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
1434
1486
|
|
|
1487
|
+
// `__proto__` is a valid field name, and the one name the uppercase mapping at
|
|
1488
|
+
// the bottom of this file cannot reach: it is inherited from Object.prototype
|
|
1489
|
+
// instead of being declared on AxiosHeaders.prototype, so `self.__proto__ = v`
|
|
1490
|
+
// runs the inherited setter. That silently discards the header, and an array
|
|
1491
|
+
// value replaces the instance prototype, taking every method with it.
|
|
1492
|
+
// Store it under the same kind of case variant that mapping uses for `set` and
|
|
1493
|
+
// `constructor`. Header lookup is caseless, so it reads back under either
|
|
1494
|
+
// spelling, and no own `__proto__` slot is ever created for a later
|
|
1495
|
+
// `Object.assign` to copy onto a plain object through the same setter.
|
|
1496
|
+
const PROTO_HEADER_SLOT = '__Proto__';
|
|
1497
|
+
|
|
1498
|
+
const headerSlot = (name) => (name === '__proto__' ? PROTO_HEADER_SLOT : name);
|
|
1499
|
+
|
|
1435
1500
|
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
1436
1501
|
if (utils$1.isFunction(filter)) {
|
|
1437
|
-
return filter.call(
|
|
1502
|
+
return filter.call(context, value, header);
|
|
1438
1503
|
}
|
|
1439
1504
|
|
|
1440
1505
|
if (isHeaderNameFilter) {
|
|
@@ -1500,7 +1565,7 @@ class AxiosHeaders {
|
|
|
1500
1565
|
_rewrite === true ||
|
|
1501
1566
|
(_rewrite === undefined && self[key] !== false)
|
|
1502
1567
|
) {
|
|
1503
|
-
self[key || _header] = normalizeValue(_value);
|
|
1568
|
+
self[headerSlot(key || _header)] = normalizeValue(_value);
|
|
1504
1569
|
}
|
|
1505
1570
|
}
|
|
1506
1571
|
|
|
@@ -1629,7 +1694,7 @@ class AxiosHeaders {
|
|
|
1629
1694
|
|
|
1630
1695
|
normalize(format) {
|
|
1631
1696
|
const self = this;
|
|
1632
|
-
const headers =
|
|
1697
|
+
const headers = Object.create(null);
|
|
1633
1698
|
|
|
1634
1699
|
utils$1.forEach(this, (value, header) => {
|
|
1635
1700
|
const key = utils$1.findKey(headers, header);
|
|
@@ -1640,7 +1705,7 @@ class AxiosHeaders {
|
|
|
1640
1705
|
return;
|
|
1641
1706
|
}
|
|
1642
1707
|
|
|
1643
|
-
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
1708
|
+
const normalized = headerSlot(format ? formatHeader(header) : String(header).trim());
|
|
1644
1709
|
|
|
1645
1710
|
if (normalized !== header) {
|
|
1646
1711
|
delete self[header];
|
|
@@ -1845,6 +1910,61 @@ function aggregateErrorMessage(error) {
|
|
|
1845
1910
|
return message || error.name || 'AggregateError';
|
|
1846
1911
|
}
|
|
1847
1912
|
|
|
1913
|
+
// Shared with `Axios.prototype.request`, which splices the reconstructed
|
|
1914
|
+
// caller frames in ahead of this marker.
|
|
1915
|
+
const CAUSED_BY_SEPARATOR = '\nCaused by: ';
|
|
1916
|
+
const $causeStack = Symbol('causeStack');
|
|
1917
|
+
|
|
1918
|
+
// Match the section we appended, not marker-like text in an error message or
|
|
1919
|
+
// a replacement stack supplied by the caller. Do not re-read the cause's stack.
|
|
1920
|
+
function getCauseStackIndex(error, stack) {
|
|
1921
|
+
const causeStack = utils$1.hasOwnProp(error, $causeStack) && error[$causeStack];
|
|
1922
|
+
|
|
1923
|
+
return causeStack && stack.endsWith(causeStack) ? stack.length - causeStack.length : -1;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
/**
|
|
1927
|
+
* Append the stack of a wrapped error to `target.stack`.
|
|
1928
|
+
*
|
|
1929
|
+
* `cause` already exposes the original error for tooling that walks the standard
|
|
1930
|
+
* cause chain, but many error reporters read `stack` and nothing else. Inlining
|
|
1931
|
+
* the wrapped stack there means those reporters surface the underlying failure
|
|
1932
|
+
* instead of the axios frames that normalized it (see #6670).
|
|
1933
|
+
*
|
|
1934
|
+
* Every read is defensive: a custom `Error.prepareStackTrace` hook, a runtime
|
|
1935
|
+
* without stack support, or a replaced `stack` property can leave the value
|
|
1936
|
+
* missing, non-string, or read-only, and normalizing an error must not throw
|
|
1937
|
+
* because of that.
|
|
1938
|
+
*
|
|
1939
|
+
* @param {Error} target The AxiosError being built.
|
|
1940
|
+
* @param {Error} source The error being wrapped.
|
|
1941
|
+
*
|
|
1942
|
+
* @returns {void}
|
|
1943
|
+
*/
|
|
1944
|
+
function appendCauseStack(target, source) {
|
|
1945
|
+
try {
|
|
1946
|
+
const sourceStack = source && source.stack;
|
|
1947
|
+
|
|
1948
|
+
if (typeof sourceStack !== 'string' || !sourceStack) {
|
|
1949
|
+
return;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
const targetStack = target.stack;
|
|
1953
|
+
|
|
1954
|
+
if (typeof targetStack !== 'string' || !targetStack) {
|
|
1955
|
+
return;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
// Each call to `from()` creates a fresh target. Re-wrapping includes the
|
|
1959
|
+
// previous stack verbatim, adding one cause section per wrap.
|
|
1960
|
+
const causeStack = CAUSED_BY_SEPARATOR + sourceStack;
|
|
1961
|
+
target.stack = targetStack + causeStack;
|
|
1962
|
+
Object.defineProperty(target, $causeStack, { __proto__: null, value: causeStack });
|
|
1963
|
+
} catch (e) {
|
|
1964
|
+
// Ignore failures from custom stack hooks or un-writable stack properties.
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1848
1968
|
class AxiosError extends Error {
|
|
1849
1969
|
static from(error, code, config, request, response, customProps) {
|
|
1850
1970
|
// `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection
|
|
@@ -1871,6 +1991,10 @@ class AxiosError extends Error {
|
|
|
1871
1991
|
});
|
|
1872
1992
|
axiosError.name = error.name;
|
|
1873
1993
|
|
|
1994
|
+
// Inline the wrapped stack for reporters that read only `stack`; the `cause`
|
|
1995
|
+
// property above already covers cause-aware tooling.
|
|
1996
|
+
appendCauseStack(axiosError, error);
|
|
1997
|
+
|
|
1874
1998
|
// Preserve status from the original error if not already set from response
|
|
1875
1999
|
if (error.status != null && axiosError.status == null) {
|
|
1876
2000
|
axiosError.status = error.status;
|
|
@@ -2374,6 +2498,16 @@ function trimHandlers(handlers) {
|
|
|
2374
2498
|
}
|
|
2375
2499
|
}
|
|
2376
2500
|
|
|
2501
|
+
// Preserve the array-key coercion used before IDs were stored in a Map, without
|
|
2502
|
+
// treating null, empty strings, or noncanonical numeric strings as ID zero.
|
|
2503
|
+
function normalizeHandlerId(id) {
|
|
2504
|
+
if (typeof id === 'string' && id !== '' && String(Number(id)) === id) {
|
|
2505
|
+
return Number(id);
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
return id;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2377
2511
|
function syncHandlerEntries(manager, internals) {
|
|
2378
2512
|
const handlers = manager.handlers;
|
|
2379
2513
|
const length = countHandlers(handlers);
|
|
@@ -2456,10 +2590,11 @@ class InterceptorManager {
|
|
|
2456
2590
|
|
|
2457
2591
|
syncHandlerEntries(this, internals);
|
|
2458
2592
|
|
|
2459
|
-
const
|
|
2593
|
+
const handlerId = normalizeHandlerId(id);
|
|
2594
|
+
const entry = internals.handlerEntries.get(handlerId);
|
|
2460
2595
|
|
|
2461
2596
|
if (entry) {
|
|
2462
|
-
internals.handlerEntries.delete(
|
|
2597
|
+
internals.handlerEntries.delete(handlerId);
|
|
2463
2598
|
|
|
2464
2599
|
// Ignore IDs invalidated by clear or direct replacement of handlers.
|
|
2465
2600
|
if (this.handlers[entry.index] !== entry.handler) {
|
|
@@ -2528,6 +2663,7 @@ var transitionalDefaults = {
|
|
|
2528
2663
|
legacyInterceptorReqResOrdering: true,
|
|
2529
2664
|
advertiseZstdAcceptEncoding: false,
|
|
2530
2665
|
validateStatusUndefinedResolves: true,
|
|
2666
|
+
encodeBasicAuthUsername: false,
|
|
2531
2667
|
};
|
|
2532
2668
|
|
|
2533
2669
|
var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
|
|
@@ -2680,6 +2816,29 @@ function arrayToObject(arr) {
|
|
|
2680
2816
|
return obj;
|
|
2681
2817
|
}
|
|
2682
2818
|
|
|
2819
|
+
function normalizeArray(value) {
|
|
2820
|
+
if (!utils$1.isArray(value)) return value;
|
|
2821
|
+
|
|
2822
|
+
const keys = Object.keys(value);
|
|
2823
|
+
return keys.length !== value.length || keys.some((key, index) => key !== String(index))
|
|
2824
|
+
? arrayToObject(value)
|
|
2825
|
+
: value;
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
function normalizeArrays(obj) {
|
|
2829
|
+
const pending = [obj];
|
|
2830
|
+
while (pending.length) {
|
|
2831
|
+
const target = pending.pop();
|
|
2832
|
+
Object.keys(target).forEach((key) => {
|
|
2833
|
+
const value = (target[key] = normalizeArray(target[key]));
|
|
2834
|
+
if (utils$1.isArray(value) || utils$1.isPlainObject(value)) {
|
|
2835
|
+
pending.push(value);
|
|
2836
|
+
}
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
return obj;
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2683
2842
|
/**
|
|
2684
2843
|
* It takes a FormData object and returns a JavaScript object
|
|
2685
2844
|
*
|
|
@@ -2701,6 +2860,7 @@ function formDataToJSON(formData) {
|
|
|
2701
2860
|
|
|
2702
2861
|
if (isLast) {
|
|
2703
2862
|
if (utils$1.hasOwnProp(target, name)) {
|
|
2863
|
+
target[name] = normalizeArray(target[name]);
|
|
2704
2864
|
target[name] = utils$1.isArray(target[name])
|
|
2705
2865
|
? target[name].concat(value)
|
|
2706
2866
|
: [target[name], value];
|
|
@@ -2731,7 +2891,7 @@ function formDataToJSON(formData) {
|
|
|
2731
2891
|
buildPath(parsePropPath(name), value, obj, 0);
|
|
2732
2892
|
});
|
|
2733
2893
|
|
|
2734
|
-
return obj;
|
|
2894
|
+
return normalizeArrays(obj);
|
|
2735
2895
|
}
|
|
2736
2896
|
|
|
2737
2897
|
return null;
|
|
@@ -3010,9 +3170,95 @@ function normalizeURLForProtocolCheck(url) {
|
|
|
3010
3170
|
|
|
3011
3171
|
function parseProtocol(url) {
|
|
3012
3172
|
const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
|
|
3013
|
-
return (match && match[1]) || '';
|
|
3173
|
+
return (match && match[1].toLowerCase()) || '';
|
|
3014
3174
|
}
|
|
3015
3175
|
|
|
3176
|
+
const decodeCookieValue = (value) => {
|
|
3177
|
+
try {
|
|
3178
|
+
return decodeURIComponent(value);
|
|
3179
|
+
} catch (e) {
|
|
3180
|
+
return value;
|
|
3181
|
+
}
|
|
3182
|
+
};
|
|
3183
|
+
|
|
3184
|
+
var cookies = platform.hasStandardBrowserEnv
|
|
3185
|
+
? // Standard browser envs support document.cookie
|
|
3186
|
+
{
|
|
3187
|
+
write(name, value, expires, path, domain, secure, sameSite) {
|
|
3188
|
+
if (typeof document === 'undefined') return;
|
|
3189
|
+
|
|
3190
|
+
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
3191
|
+
|
|
3192
|
+
if (utils$1.isNumber(expires)) {
|
|
3193
|
+
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
3194
|
+
}
|
|
3195
|
+
if (utils$1.isString(path)) {
|
|
3196
|
+
cookie.push(`path=${path}`);
|
|
3197
|
+
}
|
|
3198
|
+
if (utils$1.isString(domain)) {
|
|
3199
|
+
cookie.push(`domain=${domain}`);
|
|
3200
|
+
}
|
|
3201
|
+
if (secure === true) {
|
|
3202
|
+
cookie.push('secure');
|
|
3203
|
+
}
|
|
3204
|
+
if (utils$1.isString(sameSite)) {
|
|
3205
|
+
cookie.push(`SameSite=${sameSite}`);
|
|
3206
|
+
}
|
|
3207
|
+
|
|
3208
|
+
document.cookie = cookie.join('; ');
|
|
3209
|
+
},
|
|
3210
|
+
|
|
3211
|
+
read(name) {
|
|
3212
|
+
if (typeof document === 'undefined') return null;
|
|
3213
|
+
const cookieString = document.cookie;
|
|
3214
|
+
if (!cookieString) return null;
|
|
3215
|
+
// Match name=value by splitting on the semicolon separator instead of building a
|
|
3216
|
+
// RegExp from `name` — interpolating an unescaped string into a RegExp would let
|
|
3217
|
+
// metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
|
|
3218
|
+
// match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
|
|
3219
|
+
// "; ", so ignore optional whitespace before each cookie name.
|
|
3220
|
+
const cookies = cookieString.split(';');
|
|
3221
|
+
for (let i = 0; i < cookies.length; i++) {
|
|
3222
|
+
const cookie = cookies[i].replace(/^\s+/, '');
|
|
3223
|
+
const eq = cookie.indexOf('=');
|
|
3224
|
+
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
3225
|
+
return decodeCookieValue(cookie.slice(eq + 1));
|
|
3226
|
+
}
|
|
3227
|
+
}
|
|
3228
|
+
return null;
|
|
3229
|
+
},
|
|
3230
|
+
|
|
3231
|
+
async readAsync(name) {
|
|
3232
|
+
try {
|
|
3233
|
+
const store = typeof window !== 'undefined' && window.cookieStore;
|
|
3234
|
+
if (store && utils$1.isFunction(store.get)) {
|
|
3235
|
+
const cookie = await store.get(name);
|
|
3236
|
+
// Both APIs expose stored bytes; preserve Axios's existing URI decoding.
|
|
3237
|
+
return cookie ? decodeCookieValue(cookie.value) : null;
|
|
3238
|
+
}
|
|
3239
|
+
} catch (e) {
|
|
3240
|
+
// Restricted or unavailable storage retains the synchronous fallback.
|
|
3241
|
+
}
|
|
3242
|
+
|
|
3243
|
+
return this.read(name);
|
|
3244
|
+
},
|
|
3245
|
+
|
|
3246
|
+
remove(name) {
|
|
3247
|
+
this.write(name, '', Date.now() - 86400000, '/');
|
|
3248
|
+
},
|
|
3249
|
+
}
|
|
3250
|
+
: // Non-standard browser env (web workers, react-native) lack needed support.
|
|
3251
|
+
{
|
|
3252
|
+
write() {},
|
|
3253
|
+
read() {
|
|
3254
|
+
return null;
|
|
3255
|
+
},
|
|
3256
|
+
async readAsync() {
|
|
3257
|
+
return null;
|
|
3258
|
+
},
|
|
3259
|
+
remove() {},
|
|
3260
|
+
};
|
|
3261
|
+
|
|
3016
3262
|
/**
|
|
3017
3263
|
* Calculate data maxRate
|
|
3018
3264
|
* @param {Number} [samplesCount= 10]
|
|
@@ -3161,82 +3407,15 @@ const asyncDecorator =
|
|
|
3161
3407
|
scheduler(() => fn(...args));
|
|
3162
3408
|
|
|
3163
3409
|
var isURLSameOrigin = platform.hasStandardBrowserEnv
|
|
3164
|
-
? ((origin
|
|
3165
|
-
url = new URL(url, platform.origin);
|
|
3410
|
+
? ((origin) => (url) => {
|
|
3411
|
+
url = new URL(url, document.baseURI || platform.origin);
|
|
3166
3412
|
|
|
3167
3413
|
return (
|
|
3168
|
-
origin.protocol === url.protocol &&
|
|
3169
|
-
origin.host === url.host &&
|
|
3170
|
-
(isMSIE || origin.port === url.port)
|
|
3414
|
+
origin.protocol === url.protocol && origin.host === url.host && origin.port === url.port
|
|
3171
3415
|
);
|
|
3172
|
-
})(
|
|
3173
|
-
new URL(platform.origin),
|
|
3174
|
-
platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
|
|
3175
|
-
)
|
|
3416
|
+
})(new URL(platform.origin))
|
|
3176
3417
|
: () => true;
|
|
3177
3418
|
|
|
3178
|
-
var cookies = platform.hasStandardBrowserEnv
|
|
3179
|
-
? // Standard browser envs support document.cookie
|
|
3180
|
-
{
|
|
3181
|
-
write(name, value, expires, path, domain, secure, sameSite) {
|
|
3182
|
-
if (typeof document === 'undefined') return;
|
|
3183
|
-
|
|
3184
|
-
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
3185
|
-
|
|
3186
|
-
if (utils$1.isNumber(expires)) {
|
|
3187
|
-
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
3188
|
-
}
|
|
3189
|
-
if (utils$1.isString(path)) {
|
|
3190
|
-
cookie.push(`path=${path}`);
|
|
3191
|
-
}
|
|
3192
|
-
if (utils$1.isString(domain)) {
|
|
3193
|
-
cookie.push(`domain=${domain}`);
|
|
3194
|
-
}
|
|
3195
|
-
if (secure === true) {
|
|
3196
|
-
cookie.push('secure');
|
|
3197
|
-
}
|
|
3198
|
-
if (utils$1.isString(sameSite)) {
|
|
3199
|
-
cookie.push(`SameSite=${sameSite}`);
|
|
3200
|
-
}
|
|
3201
|
-
|
|
3202
|
-
document.cookie = cookie.join('; ');
|
|
3203
|
-
},
|
|
3204
|
-
|
|
3205
|
-
read(name) {
|
|
3206
|
-
if (typeof document === 'undefined') return null;
|
|
3207
|
-
// Match name=value by splitting on the semicolon separator instead of building a
|
|
3208
|
-
// RegExp from `name` — interpolating an unescaped string into a RegExp would let
|
|
3209
|
-
// metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
|
|
3210
|
-
// match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
|
|
3211
|
-
// "; ", so ignore optional whitespace before each cookie name.
|
|
3212
|
-
const cookies = document.cookie.split(';');
|
|
3213
|
-
for (let i = 0; i < cookies.length; i++) {
|
|
3214
|
-
const cookie = cookies[i].replace(/^\s+/, '');
|
|
3215
|
-
const eq = cookie.indexOf('=');
|
|
3216
|
-
if (eq !== -1 && cookie.slice(0, eq) === name) {
|
|
3217
|
-
try {
|
|
3218
|
-
return decodeURIComponent(cookie.slice(eq + 1));
|
|
3219
|
-
} catch (e) {
|
|
3220
|
-
return cookie.slice(eq + 1);
|
|
3221
|
-
}
|
|
3222
|
-
}
|
|
3223
|
-
}
|
|
3224
|
-
return null;
|
|
3225
|
-
},
|
|
3226
|
-
|
|
3227
|
-
remove(name) {
|
|
3228
|
-
this.write(name, '', Date.now() - 86400000, '/');
|
|
3229
|
-
},
|
|
3230
|
-
}
|
|
3231
|
-
: // Non-standard browser env (web workers, react-native) lack needed support.
|
|
3232
|
-
{
|
|
3233
|
-
write() {},
|
|
3234
|
-
read() {
|
|
3235
|
-
return null;
|
|
3236
|
-
},
|
|
3237
|
-
remove() {},
|
|
3238
|
-
};
|
|
3239
|
-
|
|
3240
3419
|
/**
|
|
3241
3420
|
* Determines whether the specified URL is absolute
|
|
3242
3421
|
*
|
|
@@ -3347,19 +3526,234 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
|
3347
3526
|
return requestedURL;
|
|
3348
3527
|
}
|
|
3349
3528
|
|
|
3529
|
+
function assertParamsAcyclic(params) {
|
|
3530
|
+
const pending = [{ value: params }];
|
|
3531
|
+
const active = new WeakSet();
|
|
3532
|
+
const visited = new WeakSet();
|
|
3533
|
+
|
|
3534
|
+
while (pending.length) {
|
|
3535
|
+
const { value, done } = pending.pop();
|
|
3536
|
+
if (!utils$1.isPlainObject(value) && !utils$1.isArray(value)) continue;
|
|
3537
|
+
if (done) {
|
|
3538
|
+
active.delete(value);
|
|
3539
|
+
continue;
|
|
3540
|
+
}
|
|
3541
|
+
if (active.has(value)) {
|
|
3542
|
+
throw new AxiosError(
|
|
3543
|
+
'Circular reference detected in params',
|
|
3544
|
+
AxiosError.ERR_BAD_OPTION_VALUE
|
|
3545
|
+
);
|
|
3546
|
+
}
|
|
3547
|
+
if (visited.has(value)) continue;
|
|
3548
|
+
visited.add(value);
|
|
3549
|
+
active.add(value);
|
|
3550
|
+
pending.push({ value, done: true });
|
|
3551
|
+
|
|
3552
|
+
const keys = Object.keys(value);
|
|
3553
|
+
if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
|
|
3554
|
+
Object.getOwnPropertySymbols(value).forEach((key) => {
|
|
3555
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
3556
|
+
if (descriptor && descriptor.enumerable) keys.push(key);
|
|
3557
|
+
});
|
|
3558
|
+
}
|
|
3559
|
+
// Shallow array elements retain fields filtered during plain-object merges.
|
|
3560
|
+
// Inspect reserved data properties without evaluating their accessors.
|
|
3561
|
+
keys.forEach((key) => {
|
|
3562
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
|
3563
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
3564
|
+
if (descriptor && utils$1.hasOwnProp(descriptor, 'value')) {
|
|
3565
|
+
pending.push({ value: descriptor.value });
|
|
3566
|
+
}
|
|
3567
|
+
} else {
|
|
3568
|
+
pending.push({ value: value[key] });
|
|
3569
|
+
}
|
|
3570
|
+
});
|
|
3571
|
+
}
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3350
3574
|
const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);
|
|
3351
3575
|
|
|
3352
3576
|
const ownEnumerableKeys = (thing) => {
|
|
3353
3577
|
if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
|
|
3354
3578
|
return Object.keys(thing).concat(
|
|
3355
|
-
Object.getOwnPropertySymbols(thing).filter(
|
|
3356
|
-
|
|
3357
|
-
|
|
3579
|
+
Object.getOwnPropertySymbols(thing).filter((symbol) => {
|
|
3580
|
+
const descriptor = Object.getOwnPropertyDescriptor(thing, symbol);
|
|
3581
|
+
return descriptor && descriptor.enumerable;
|
|
3582
|
+
})
|
|
3358
3583
|
);
|
|
3359
3584
|
}
|
|
3360
3585
|
return Object.keys(thing);
|
|
3361
3586
|
};
|
|
3362
3587
|
|
|
3588
|
+
// Copy params without recursive merges so the serializer remains responsible
|
|
3589
|
+
// for its depth policy. Only visit defaults that contribute to the result.
|
|
3590
|
+
function mergeParams(a, b) {
|
|
3591
|
+
const pending = [];
|
|
3592
|
+
const copies = new WeakMap();
|
|
3593
|
+
const empty = {};
|
|
3594
|
+
|
|
3595
|
+
function copy(target, source) {
|
|
3596
|
+
if (!utils$1.isPlainObject(source)) {
|
|
3597
|
+
return utils$1.isArray(source) ? source.slice() : source;
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
const base = utils$1.isPlainObject(target) ? target : empty;
|
|
3601
|
+
let bases = copies.get(source);
|
|
3602
|
+
if (!bases) {
|
|
3603
|
+
bases = new WeakMap();
|
|
3604
|
+
copies.set(source, bases);
|
|
3605
|
+
}
|
|
3606
|
+
if (bases.has(base)) return bases.get(base);
|
|
3607
|
+
|
|
3608
|
+
const result = {};
|
|
3609
|
+
bases.set(base, result);
|
|
3610
|
+
pending.push({ base, source, result });
|
|
3611
|
+
return result;
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
const result = utils$1.isUndefined(b) ? copy(undefined, a) : copy(a, b);
|
|
3615
|
+
while (pending.length) {
|
|
3616
|
+
const { base, source, result: target } = pending.pop();
|
|
3617
|
+
const baseKeys = new Set(ownEnumerableKeys(base));
|
|
3618
|
+
const sourceKeys = new Set(ownEnumerableKeys(source));
|
|
3619
|
+
const keys = new Set([...baseKeys, ...sourceKeys]);
|
|
3620
|
+
|
|
3621
|
+
keys.forEach((key) => {
|
|
3622
|
+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') return;
|
|
3623
|
+
const hasSource = sourceKeys.has(key);
|
|
3624
|
+
const value = hasSource ? source[key] : undefined;
|
|
3625
|
+
const previous =
|
|
3626
|
+
(!hasSource || utils$1.isPlainObject(value)) && baseKeys.has(key) ? base[key] : undefined;
|
|
3627
|
+
target[key] = hasSource ? copy(previous, value) : copy(undefined, previous);
|
|
3628
|
+
});
|
|
3629
|
+
}
|
|
3630
|
+
|
|
3631
|
+
assertParamsAcyclic(result);
|
|
3632
|
+
return result;
|
|
3633
|
+
}
|
|
3634
|
+
|
|
3635
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
3636
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
3637
|
+
return utils$1.merge.call({ caseless }, target, source);
|
|
3638
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
3639
|
+
return utils$1.merge({}, source);
|
|
3640
|
+
} else if (utils$1.isArray(source)) {
|
|
3641
|
+
return source.slice();
|
|
3642
|
+
}
|
|
3643
|
+
return source;
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
3647
|
+
if (!utils$1.isUndefined(b)) {
|
|
3648
|
+
return getMergedValue(a, b, prop, caseless);
|
|
3649
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
3650
|
+
return getMergedValue(undefined, a, prop, caseless);
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
// eslint-disable-next-line consistent-return
|
|
3655
|
+
function valueFromConfig2(a, b) {
|
|
3656
|
+
if (!utils$1.isUndefined(b)) {
|
|
3657
|
+
return getMergedValue(undefined, b);
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
|
|
3661
|
+
// eslint-disable-next-line consistent-return
|
|
3662
|
+
function defaultToConfig2(a, b) {
|
|
3663
|
+
if (!utils$1.isUndefined(b)) {
|
|
3664
|
+
return getMergedValue(undefined, b);
|
|
3665
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
3666
|
+
return getMergedValue(undefined, a);
|
|
3667
|
+
}
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
function getMergedTransitionalOption(config1, config2, prop) {
|
|
3671
|
+
const transitional2 = utils$1.hasOwnProp(config2, 'transitional')
|
|
3672
|
+
? config2.transitional
|
|
3673
|
+
: undefined;
|
|
3674
|
+
|
|
3675
|
+
if (!utils$1.isUndefined(transitional2)) {
|
|
3676
|
+
if (utils$1.isPlainObject(transitional2)) {
|
|
3677
|
+
if (utils$1.hasOwnProp(transitional2, prop)) {
|
|
3678
|
+
return transitional2[prop];
|
|
3679
|
+
}
|
|
3680
|
+
} else {
|
|
3681
|
+
return undefined;
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
|
|
3685
|
+
const transitional1 = utils$1.hasOwnProp(config1, 'transitional')
|
|
3686
|
+
? config1.transitional
|
|
3687
|
+
: undefined;
|
|
3688
|
+
|
|
3689
|
+
if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
|
|
3690
|
+
return transitional1[prop];
|
|
3691
|
+
}
|
|
3692
|
+
|
|
3693
|
+
return undefined;
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
// eslint-disable-next-line consistent-return
|
|
3697
|
+
function mergeDirectKeys(a, b, prop, config1, config2) {
|
|
3698
|
+
if (utils$1.hasOwnProp(config2, prop)) {
|
|
3699
|
+
return getMergedValue(a, b);
|
|
3700
|
+
} else if (utils$1.hasOwnProp(config1, prop)) {
|
|
3701
|
+
return getMergedValue(undefined, a);
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3705
|
+
function mergeHeaders(a, b, prop) {
|
|
3706
|
+
return mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true);
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
// Null-proto, frozen descriptor so a polluted Object.prototype.get cannot turn
|
|
3710
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
3711
|
+
// defineProperty only reads it, so one shared instance serves every call.
|
|
3712
|
+
const hasOwnPropertyDescriptor = Object.freeze({
|
|
3713
|
+
__proto__: null,
|
|
3714
|
+
value: Object.prototype.hasOwnProperty,
|
|
3715
|
+
enumerable: false,
|
|
3716
|
+
writable: true,
|
|
3717
|
+
configurable: true,
|
|
3718
|
+
});
|
|
3719
|
+
|
|
3720
|
+
// The strategy table and the strategies above are stateless, so they are
|
|
3721
|
+
// built once at module load instead of on every call: mergeConfig runs at
|
|
3722
|
+
// most twice per request (once from a method alias, once from `_request`).
|
|
3723
|
+
const mergeMap = {
|
|
3724
|
+
url: valueFromConfig2,
|
|
3725
|
+
method: valueFromConfig2,
|
|
3726
|
+
data: valueFromConfig2,
|
|
3727
|
+
baseURL: defaultToConfig2,
|
|
3728
|
+
transformRequest: defaultToConfig2,
|
|
3729
|
+
transformResponse: defaultToConfig2,
|
|
3730
|
+
params: mergeParams,
|
|
3731
|
+
paramsSerializer: defaultToConfig2,
|
|
3732
|
+
timeout: defaultToConfig2,
|
|
3733
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
3734
|
+
withCredentials: defaultToConfig2,
|
|
3735
|
+
withXSRFToken: defaultToConfig2,
|
|
3736
|
+
adapter: defaultToConfig2,
|
|
3737
|
+
responseType: defaultToConfig2,
|
|
3738
|
+
xsrfCookieName: defaultToConfig2,
|
|
3739
|
+
xsrfHeaderName: defaultToConfig2,
|
|
3740
|
+
onUploadProgress: defaultToConfig2,
|
|
3741
|
+
onDownloadProgress: defaultToConfig2,
|
|
3742
|
+
decompress: defaultToConfig2,
|
|
3743
|
+
maxContentLength: defaultToConfig2,
|
|
3744
|
+
maxBodyLength: defaultToConfig2,
|
|
3745
|
+
beforeRedirect: defaultToConfig2,
|
|
3746
|
+
transport: defaultToConfig2,
|
|
3747
|
+
httpAgent: defaultToConfig2,
|
|
3748
|
+
httpsAgent: defaultToConfig2,
|
|
3749
|
+
cancelToken: defaultToConfig2,
|
|
3750
|
+
socketPath: defaultToConfig2,
|
|
3751
|
+
allowedSocketPaths: defaultToConfig2,
|
|
3752
|
+
responseEncoding: defaultToConfig2,
|
|
3753
|
+
validateStatus: mergeDirectKeys,
|
|
3754
|
+
headers: mergeHeaders,
|
|
3755
|
+
};
|
|
3756
|
+
|
|
3363
3757
|
/**
|
|
3364
3758
|
* Config-specific merge-function which creates a new config-object
|
|
3365
3759
|
* by merging two configuration objects together.
|
|
@@ -3379,133 +3773,25 @@ function mergeConfig(config1, config2) {
|
|
|
3379
3773
|
// `hasOwnProperty` is restored as a non-enumerable own slot to preserve
|
|
3380
3774
|
// ergonomics for user code that relies on it.
|
|
3381
3775
|
const config = Object.create(null);
|
|
3382
|
-
Object.defineProperty(config, 'hasOwnProperty',
|
|
3383
|
-
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
3384
|
-
// this data descriptor into an accessor descriptor on the way in.
|
|
3385
|
-
__proto__: null,
|
|
3386
|
-
value: Object.prototype.hasOwnProperty,
|
|
3387
|
-
enumerable: false,
|
|
3388
|
-
writable: true,
|
|
3389
|
-
configurable: true,
|
|
3390
|
-
});
|
|
3776
|
+
Object.defineProperty(config, 'hasOwnProperty', hasOwnPropertyDescriptor);
|
|
3391
3777
|
|
|
3392
|
-
|
|
3393
|
-
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
3394
|
-
return utils$1.merge.call({ caseless }, target, source);
|
|
3395
|
-
} else if (utils$1.isPlainObject(source)) {
|
|
3396
|
-
return utils$1.merge({}, source);
|
|
3397
|
-
} else if (utils$1.isArray(source)) {
|
|
3398
|
-
return source.slice();
|
|
3399
|
-
}
|
|
3400
|
-
return source;
|
|
3401
|
-
}
|
|
3402
|
-
|
|
3403
|
-
function mergeDeepProperties(a, b, prop, caseless) {
|
|
3404
|
-
if (!utils$1.isUndefined(b)) {
|
|
3405
|
-
return getMergedValue(a, b, prop, caseless);
|
|
3406
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
3407
|
-
return getMergedValue(undefined, a, prop, caseless);
|
|
3408
|
-
}
|
|
3409
|
-
}
|
|
3410
|
-
|
|
3411
|
-
// eslint-disable-next-line consistent-return
|
|
3412
|
-
function valueFromConfig2(a, b) {
|
|
3413
|
-
if (!utils$1.isUndefined(b)) {
|
|
3414
|
-
return getMergedValue(undefined, b);
|
|
3415
|
-
}
|
|
3416
|
-
}
|
|
3417
|
-
|
|
3418
|
-
// eslint-disable-next-line consistent-return
|
|
3419
|
-
function defaultToConfig2(a, b) {
|
|
3420
|
-
if (!utils$1.isUndefined(b)) {
|
|
3421
|
-
return getMergedValue(undefined, b);
|
|
3422
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
3423
|
-
return getMergedValue(undefined, a);
|
|
3424
|
-
}
|
|
3425
|
-
}
|
|
3426
|
-
|
|
3427
|
-
function getMergedTransitionalOption(prop) {
|
|
3428
|
-
const transitional2 = utils$1.hasOwnProp(config2, 'transitional')
|
|
3429
|
-
? config2.transitional
|
|
3430
|
-
: undefined;
|
|
3778
|
+
const keys = ownEnumerableKeys({ ...config1, ...config2 });
|
|
3431
3779
|
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
return transitional2[prop];
|
|
3436
|
-
}
|
|
3437
|
-
} else {
|
|
3438
|
-
return undefined;
|
|
3439
|
-
}
|
|
3440
|
-
}
|
|
3441
|
-
|
|
3442
|
-
const transitional1 = utils$1.hasOwnProp(config1, 'transitional')
|
|
3443
|
-
? config1.transitional
|
|
3444
|
-
: undefined;
|
|
3445
|
-
|
|
3446
|
-
if (utils$1.isPlainObject(transitional1) && utils$1.hasOwnProp(transitional1, prop)) {
|
|
3447
|
-
return transitional1[prop];
|
|
3448
|
-
}
|
|
3449
|
-
|
|
3450
|
-
return undefined;
|
|
3451
|
-
}
|
|
3452
|
-
|
|
3453
|
-
// eslint-disable-next-line consistent-return
|
|
3454
|
-
function mergeDirectKeys(a, b, prop) {
|
|
3455
|
-
if (utils$1.hasOwnProp(config2, prop)) {
|
|
3456
|
-
return getMergedValue(a, b);
|
|
3457
|
-
} else if (utils$1.hasOwnProp(config1, prop)) {
|
|
3458
|
-
return getMergedValue(undefined, a);
|
|
3459
|
-
}
|
|
3460
|
-
}
|
|
3461
|
-
|
|
3462
|
-
const mergeMap = {
|
|
3463
|
-
url: valueFromConfig2,
|
|
3464
|
-
method: valueFromConfig2,
|
|
3465
|
-
data: valueFromConfig2,
|
|
3466
|
-
baseURL: defaultToConfig2,
|
|
3467
|
-
transformRequest: defaultToConfig2,
|
|
3468
|
-
transformResponse: defaultToConfig2,
|
|
3469
|
-
paramsSerializer: defaultToConfig2,
|
|
3470
|
-
timeout: defaultToConfig2,
|
|
3471
|
-
timeoutErrorMessage: defaultToConfig2,
|
|
3472
|
-
withCredentials: defaultToConfig2,
|
|
3473
|
-
withXSRFToken: defaultToConfig2,
|
|
3474
|
-
adapter: defaultToConfig2,
|
|
3475
|
-
responseType: defaultToConfig2,
|
|
3476
|
-
xsrfCookieName: defaultToConfig2,
|
|
3477
|
-
xsrfHeaderName: defaultToConfig2,
|
|
3478
|
-
onUploadProgress: defaultToConfig2,
|
|
3479
|
-
onDownloadProgress: defaultToConfig2,
|
|
3480
|
-
decompress: defaultToConfig2,
|
|
3481
|
-
maxContentLength: defaultToConfig2,
|
|
3482
|
-
maxBodyLength: defaultToConfig2,
|
|
3483
|
-
beforeRedirect: defaultToConfig2,
|
|
3484
|
-
transport: defaultToConfig2,
|
|
3485
|
-
httpAgent: defaultToConfig2,
|
|
3486
|
-
httpsAgent: defaultToConfig2,
|
|
3487
|
-
cancelToken: defaultToConfig2,
|
|
3488
|
-
socketPath: defaultToConfig2,
|
|
3489
|
-
allowedSocketPaths: defaultToConfig2,
|
|
3490
|
-
responseEncoding: defaultToConfig2,
|
|
3491
|
-
validateStatus: mergeDirectKeys,
|
|
3492
|
-
headers: (a, b, prop) =>
|
|
3493
|
-
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
3494
|
-
};
|
|
3495
|
-
|
|
3496
|
-
utils$1.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
3497
|
-
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
3780
|
+
for (let i = 0, len = keys.length; i < len; i++) {
|
|
3781
|
+
const prop = keys[i];
|
|
3782
|
+
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') continue;
|
|
3498
3783
|
const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
3499
3784
|
const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
|
3500
3785
|
const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
|
3501
|
-
const configValue =
|
|
3786
|
+
const configValue =
|
|
3787
|
+
merge === mergeDirectKeys ? merge(a, b, prop, config1, config2) : merge(a, b, prop);
|
|
3502
3788
|
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
3503
|
-
}
|
|
3789
|
+
}
|
|
3504
3790
|
|
|
3505
3791
|
if (
|
|
3506
3792
|
utils$1.hasOwnProp(config2, 'validateStatus') &&
|
|
3507
3793
|
utils$1.isUndefined(config2.validateStatus) &&
|
|
3508
|
-
getMergedTransitionalOption('validateStatusUndefinedResolves') === false
|
|
3794
|
+
getMergedTransitionalOption(config1, config2, 'validateStatusUndefinedResolves') === false
|
|
3509
3795
|
) {
|
|
3510
3796
|
if (utils$1.hasOwnProp(config1, 'validateStatus')) {
|
|
3511
3797
|
config.validateStatus = getMergedValue(undefined, config1.validateStatus);
|
|
@@ -3556,7 +3842,9 @@ const encodeUTF8$1 = (str) =>
|
|
|
3556
3842
|
String.fromCharCode(parseInt(hex, 16))
|
|
3557
3843
|
);
|
|
3558
3844
|
|
|
3559
|
-
|
|
3845
|
+
const readCookie = (name) => cookies.read(name);
|
|
3846
|
+
|
|
3847
|
+
function resolveConfig(config, readXsrfCookie = readCookie) {
|
|
3560
3848
|
const newConfig = mergeConfig({}, config);
|
|
3561
3849
|
|
|
3562
3850
|
// Read only own properties to prevent prototype pollution gadgets
|
|
@@ -3585,11 +3873,22 @@ function resolveConfig(config) {
|
|
|
3585
3873
|
if (auth) {
|
|
3586
3874
|
const username = utils$1.getSafeProp(auth, 'username') || '';
|
|
3587
3875
|
const password = utils$1.getSafeProp(auth, 'password') || '';
|
|
3876
|
+
const transitional = own('transitional');
|
|
3877
|
+
const encodeUsername =
|
|
3878
|
+
transitional &&
|
|
3879
|
+
utils$1.hasOwnProp(transitional, 'encodeBasicAuthUsername') &&
|
|
3880
|
+
transitional.encodeBasicAuthUsername === true;
|
|
3588
3881
|
|
|
3589
3882
|
try {
|
|
3590
3883
|
headers.set(
|
|
3591
3884
|
'Authorization',
|
|
3592
|
-
|
|
3885
|
+
// Preserve legacy username bytes unless the caller opts in to UTF-8.
|
|
3886
|
+
'Basic ' +
|
|
3887
|
+
btoa(
|
|
3888
|
+
(encodeUsername ? encodeUTF8$1(username) : username) +
|
|
3889
|
+
':' +
|
|
3890
|
+
(password ? encodeUTF8$1(password) : '')
|
|
3891
|
+
)
|
|
3593
3892
|
);
|
|
3594
3893
|
} catch (e) {
|
|
3595
3894
|
throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
|
|
@@ -3627,7 +3926,7 @@ function resolveConfig(config) {
|
|
|
3627
3926
|
withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
|
|
3628
3927
|
|
|
3629
3928
|
if (shouldSendXSRF) {
|
|
3630
|
-
const xsrfValue = xsrfHeaderName && xsrfCookieName &&
|
|
3929
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && readXsrfCookie(xsrfCookieName);
|
|
3631
3930
|
|
|
3632
3931
|
if (xsrfValue) {
|
|
3633
3932
|
headers.set(xsrfHeaderName, xsrfValue);
|
|
@@ -3643,17 +3942,60 @@ const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
|
3643
3942
|
var xhrAdapter = isXHRAdapterSupported &&
|
|
3644
3943
|
function (config) {
|
|
3645
3944
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3646
|
-
|
|
3945
|
+
let useAsyncXsrf;
|
|
3946
|
+
try {
|
|
3947
|
+
const store =
|
|
3948
|
+
platform.hasStandardBrowserEnv && typeof window !== 'undefined' && window.cookieStore;
|
|
3949
|
+
useAsyncXsrf = store && utils$1.isFunction(store.get);
|
|
3950
|
+
} catch (e) {
|
|
3951
|
+
// A restricted Cookie Store getter must retain the synchronous fallback.
|
|
3952
|
+
}
|
|
3953
|
+
let xsrfCookieName;
|
|
3954
|
+
const _config = resolveConfig(
|
|
3955
|
+
config,
|
|
3956
|
+
useAsyncXsrf
|
|
3957
|
+
? (name) => {
|
|
3958
|
+
xsrfCookieName = name;
|
|
3959
|
+
return null;
|
|
3960
|
+
}
|
|
3961
|
+
: undefined
|
|
3962
|
+
);
|
|
3647
3963
|
let requestData = _config.data;
|
|
3648
3964
|
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
|
3649
3965
|
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
3650
3966
|
let onCanceled;
|
|
3967
|
+
let timeoutId;
|
|
3651
3968
|
let uploadThrottled, downloadThrottled;
|
|
3652
3969
|
let flushUpload, flushDownload, flushDownloadWithEvent;
|
|
3653
3970
|
|
|
3654
3971
|
function done() {
|
|
3655
|
-
|
|
3656
|
-
|
|
3972
|
+
clearTimeout(timeoutId);
|
|
3973
|
+
// A final progress callback must not prevent the remaining cleanup.
|
|
3974
|
+
// Report errors asynchronously, as onloadend and the throttle timer do.
|
|
3975
|
+
try {
|
|
3976
|
+
flushUpload && flushUpload(); // flush events
|
|
3977
|
+
} catch (err) {
|
|
3978
|
+
setTimeout(() => {
|
|
3979
|
+
throw err;
|
|
3980
|
+
});
|
|
3981
|
+
}
|
|
3982
|
+
try {
|
|
3983
|
+
flushDownload && flushDownload(); // flush events
|
|
3984
|
+
} catch (err) {
|
|
3985
|
+
setTimeout(() => {
|
|
3986
|
+
throw err;
|
|
3987
|
+
});
|
|
3988
|
+
}
|
|
3989
|
+
|
|
3990
|
+
// A flush can synchronously cancel the request and reenter done().
|
|
3991
|
+
// In that case the inner call has already detached these listeners.
|
|
3992
|
+
if (request) {
|
|
3993
|
+
downloadThrottled && request.removeEventListener('progress', downloadThrottled);
|
|
3994
|
+
if (request.upload) {
|
|
3995
|
+
uploadThrottled && request.upload.removeEventListener('progress', uploadThrottled);
|
|
3996
|
+
flushUpload && request.upload.removeEventListener('loadend', flushUpload);
|
|
3997
|
+
}
|
|
3998
|
+
}
|
|
3657
3999
|
|
|
3658
4000
|
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
3659
4001
|
|
|
@@ -3804,6 +4146,7 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
3804
4146
|
|
|
3805
4147
|
// Handle timeout
|
|
3806
4148
|
request.ontimeout = function handleTimeout() {
|
|
4149
|
+
if (!request) return;
|
|
3807
4150
|
let timeoutErrorMessage = _config.timeout
|
|
3808
4151
|
? 'timeout of ' + _config.timeout + 'ms exceeded'
|
|
3809
4152
|
: 'timeout exceeded';
|
|
@@ -3828,13 +4171,6 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
3828
4171
|
// Remove Content-Type if data is undefined
|
|
3829
4172
|
requestData === undefined && requestHeaders.setContentType(null);
|
|
3830
4173
|
|
|
3831
|
-
// Add headers to the request
|
|
3832
|
-
if ('setRequestHeader' in request) {
|
|
3833
|
-
utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
|
|
3834
|
-
request.setRequestHeader(key, val);
|
|
3835
|
-
});
|
|
3836
|
-
}
|
|
3837
|
-
|
|
3838
4174
|
// Add withCredentials to request if needed
|
|
3839
4175
|
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
3840
4176
|
request.withCredentials = !!_config.withCredentials;
|
|
@@ -3871,12 +4207,14 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
3871
4207
|
return;
|
|
3872
4208
|
}
|
|
3873
4209
|
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
3874
|
-
request
|
|
4210
|
+
const xhr = request;
|
|
3875
4211
|
done();
|
|
3876
4212
|
request = null;
|
|
4213
|
+
xhr.abort();
|
|
3877
4214
|
};
|
|
3878
4215
|
|
|
3879
4216
|
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
4217
|
+
if (!request) return;
|
|
3880
4218
|
if (_config.signal) {
|
|
3881
4219
|
_config.signal.aborted
|
|
3882
4220
|
? onCanceled()
|
|
@@ -3884,6 +4222,8 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
3884
4222
|
}
|
|
3885
4223
|
}
|
|
3886
4224
|
|
|
4225
|
+
if (!request) return;
|
|
4226
|
+
|
|
3887
4227
|
const protocol = parseProtocol(_config.url);
|
|
3888
4228
|
|
|
3889
4229
|
if (protocol && !platform.protocols.includes(protocol)) {
|
|
@@ -3898,8 +4238,73 @@ var xhrAdapter = isXHRAdapterSupported &&
|
|
|
3898
4238
|
return;
|
|
3899
4239
|
}
|
|
3900
4240
|
|
|
3901
|
-
|
|
3902
|
-
|
|
4241
|
+
const sendRequest = () => {
|
|
4242
|
+
if (!request) return;
|
|
4243
|
+
// Apply headers after an asynchronous XSRF read so existing headers are
|
|
4244
|
+
// replaced through AxiosHeaders rather than appended by the native XHR.
|
|
4245
|
+
if ('setRequestHeader' in request) {
|
|
4246
|
+
utils$1.forEach(
|
|
4247
|
+
toByteStringHeaderObject(requestHeaders),
|
|
4248
|
+
function setRequestHeader(val, key) {
|
|
4249
|
+
request.setRequestHeader(key, val);
|
|
4250
|
+
}
|
|
4251
|
+
);
|
|
4252
|
+
}
|
|
4253
|
+
request.send(requestData || null);
|
|
4254
|
+
};
|
|
4255
|
+
|
|
4256
|
+
if (xsrfCookieName) {
|
|
4257
|
+
// Native XHR timeout starts at send(). Cover cookie preparation and the
|
|
4258
|
+
// subsequent request with the same budget and existing timeout handler.
|
|
4259
|
+
const now =
|
|
4260
|
+
typeof performance !== 'undefined' && utils$1.isFunction(performance.now)
|
|
4261
|
+
? () => performance.now()
|
|
4262
|
+
: Date.now;
|
|
4263
|
+
const deadline = request.timeout > 0 ? now() + Number(request.timeout) : undefined;
|
|
4264
|
+
const abortOnTimeout = () => {
|
|
4265
|
+
if (!request) return;
|
|
4266
|
+
const xhr = request;
|
|
4267
|
+
xhr.ontimeout();
|
|
4268
|
+
xhr.abort();
|
|
4269
|
+
};
|
|
4270
|
+
if (deadline !== undefined) {
|
|
4271
|
+
const scheduleTimeout = () => {
|
|
4272
|
+
const remaining = deadline - now();
|
|
4273
|
+
if (remaining > 0) {
|
|
4274
|
+
// Browser timers overflow above the signed 32-bit delay limit.
|
|
4275
|
+
timeoutId = setTimeout(scheduleTimeout, Math.min(remaining, 0x7fffffff));
|
|
4276
|
+
} else {
|
|
4277
|
+
abortOnTimeout();
|
|
4278
|
+
}
|
|
4279
|
+
};
|
|
4280
|
+
scheduleTimeout();
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
cookies
|
|
4284
|
+
.readAsync(xsrfCookieName)
|
|
4285
|
+
.then((value) => {
|
|
4286
|
+
if (!request) return;
|
|
4287
|
+
// Promise callbacks may run before an overdue timer after a busy task.
|
|
4288
|
+
if (deadline !== undefined && now() >= deadline) {
|
|
4289
|
+
abortOnTimeout();
|
|
4290
|
+
return;
|
|
4291
|
+
}
|
|
4292
|
+
if (value) {
|
|
4293
|
+
const headerName =
|
|
4294
|
+
utils$1.hasOwnProp(_config, 'xsrfHeaderName') && _config.xsrfHeaderName;
|
|
4295
|
+
requestHeaders.set(headerName, value);
|
|
4296
|
+
}
|
|
4297
|
+
sendRequest();
|
|
4298
|
+
})
|
|
4299
|
+
.catch((error) => {
|
|
4300
|
+
if (!request) return;
|
|
4301
|
+
reject(AxiosError.from(error, null, config, request));
|
|
4302
|
+
done();
|
|
4303
|
+
request = null;
|
|
4304
|
+
});
|
|
4305
|
+
} else {
|
|
4306
|
+
sendRequest();
|
|
4307
|
+
}
|
|
3903
4308
|
});
|
|
3904
4309
|
};
|
|
3905
4310
|
|
|
@@ -3935,12 +4340,15 @@ const composeSignals = (signals, timeout) => {
|
|
|
3935
4340
|
}, timeout);
|
|
3936
4341
|
|
|
3937
4342
|
const unsubscribe = () => {
|
|
3938
|
-
if (!signals) {
|
|
4343
|
+
if (!signals) {
|
|
4344
|
+
return;
|
|
4345
|
+
}
|
|
3939
4346
|
timer && clearTimeout(timer);
|
|
3940
4347
|
timer = null;
|
|
3941
4348
|
signals.forEach((signal) => {
|
|
3942
|
-
signal
|
|
3943
|
-
|
|
4349
|
+
const unsubscribeSignal = utils$1.getSafeProp(signal, 'unsubscribe');
|
|
4350
|
+
utils$1.isFunction(unsubscribeSignal)
|
|
4351
|
+
? unsubscribeSignal.call(signal, onabort)
|
|
3944
4352
|
: signal.removeEventListener('abort', onabort);
|
|
3945
4353
|
});
|
|
3946
4354
|
signals = null;
|
|
@@ -4056,11 +4464,156 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
|
4056
4464
|
);
|
|
4057
4465
|
};
|
|
4058
4466
|
|
|
4467
|
+
const CRLF = '\r\n';
|
|
4468
|
+
const normalizeLines = (value) => String(value).replace(/\r\n|\r|\n/g, CRLF);
|
|
4469
|
+
const escapeName = (value) =>
|
|
4470
|
+
String(value).replace(/[\r\n"]/g, (char) =>
|
|
4471
|
+
char === '\r' ? '%0D' : char === '\n' ? '%0A' : '%22'
|
|
4472
|
+
);
|
|
4473
|
+
|
|
4474
|
+
// Count UTF-8 bytes without allocating an encoded copy of a field. FormData
|
|
4475
|
+
// string values normalize line endings; Blob/File contents remain unchanged.
|
|
4476
|
+
const stringBytes = (value, normalize) => {
|
|
4477
|
+
let length = 0;
|
|
4478
|
+
for (let i = 0; i < value.length; i++) {
|
|
4479
|
+
const code = value.charCodeAt(i);
|
|
4480
|
+
if (normalize && (code === 13 || code === 10)) {
|
|
4481
|
+
if (code === 13 && value.charCodeAt(i + 1) === 10) i++;
|
|
4482
|
+
length += 2;
|
|
4483
|
+
} else if (code < 0x80) {
|
|
4484
|
+
length++;
|
|
4485
|
+
} else if (code < 0x800) {
|
|
4486
|
+
length += 2;
|
|
4487
|
+
} else if (
|
|
4488
|
+
code >= 0xd800 &&
|
|
4489
|
+
code <= 0xdbff &&
|
|
4490
|
+
value.charCodeAt(i + 1) >= 0xdc00 &&
|
|
4491
|
+
value.charCodeAt(i + 1) <= 0xdfff
|
|
4492
|
+
) {
|
|
4493
|
+
length += 4;
|
|
4494
|
+
i++;
|
|
4495
|
+
} else {
|
|
4496
|
+
length += 3;
|
|
4497
|
+
}
|
|
4498
|
+
}
|
|
4499
|
+
return length;
|
|
4500
|
+
};
|
|
4501
|
+
|
|
4502
|
+
// Describe serialization failures independently of any request library.
|
|
4503
|
+
class FormDataError extends TypeError {
|
|
4504
|
+
constructor(message, reason) {
|
|
4505
|
+
super(message);
|
|
4506
|
+
this.name = 'FormDataError';
|
|
4507
|
+
this.reason = reason;
|
|
4508
|
+
}
|
|
4509
|
+
}
|
|
4510
|
+
|
|
4511
|
+
// The caller supplies the boundary, Blob implementation, and limit error.
|
|
4512
|
+
function formDataToBlob(form, Blob, limit, limitError, boundary) {
|
|
4513
|
+
if (!utils$1.isFunction(Blob)) {
|
|
4514
|
+
throw new FormDataError('Blob is not supported', 'blob');
|
|
4515
|
+
}
|
|
4516
|
+
|
|
4517
|
+
if (
|
|
4518
|
+
!utils$1.isString(boundary) ||
|
|
4519
|
+
!/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(boundary) ||
|
|
4520
|
+
/ $/.test(boundary)
|
|
4521
|
+
) {
|
|
4522
|
+
throw new FormDataError('Invalid multipart boundary', 'boundary');
|
|
4523
|
+
}
|
|
4524
|
+
const footer = '--' + boundary + '--' + CRLF;
|
|
4525
|
+
let length = footer.length;
|
|
4526
|
+
const parts = [];
|
|
4527
|
+
const checkLength = (extra) => {
|
|
4528
|
+
if (length + extra > limit) throw limitError();
|
|
4529
|
+
};
|
|
4530
|
+
checkLength(0);
|
|
4531
|
+
|
|
4532
|
+
for (const [name, value] of form) {
|
|
4533
|
+
const isString = utils$1.isString(value);
|
|
4534
|
+
const valueLength = isString ? stringBytes(value, true) : value.size;
|
|
4535
|
+
if (!Number.isFinite(valueLength) || valueLength < 0) {
|
|
4536
|
+
throw new FormDataError('Unsupported FormData part size', 'part');
|
|
4537
|
+
}
|
|
4538
|
+
// Reject large values and names before building normalized header strings.
|
|
4539
|
+
checkLength(
|
|
4540
|
+
valueLength +
|
|
4541
|
+
stringBytes(name, true) +
|
|
4542
|
+
(!isString && value.name ? stringBytes(value.name, false) : 0) +
|
|
4543
|
+
(!isString && value.type ? stringBytes(value.type, false) : 0)
|
|
4544
|
+
);
|
|
4545
|
+
|
|
4546
|
+
let header =
|
|
4547
|
+
'--' +
|
|
4548
|
+
boundary +
|
|
4549
|
+
CRLF +
|
|
4550
|
+
'Content-Disposition: form-data; name="' +
|
|
4551
|
+
escapeName(normalizeLines(name)) +
|
|
4552
|
+
'"';
|
|
4553
|
+
if (!isString) {
|
|
4554
|
+
header +=
|
|
4555
|
+
'; filename="' +
|
|
4556
|
+
escapeName(utils$1.isString(value.name) ? value.name : 'blob') +
|
|
4557
|
+
'"' +
|
|
4558
|
+
CRLF +
|
|
4559
|
+
'Content-Type: ' +
|
|
4560
|
+
String(value.type || 'application/octet-stream').replace(/[\r\n]/g, '');
|
|
4561
|
+
}
|
|
4562
|
+
header += CRLF + CRLF;
|
|
4563
|
+
const partLength = stringBytes(header, false) + valueLength + CRLF.length;
|
|
4564
|
+
checkLength(partLength);
|
|
4565
|
+
length += partLength;
|
|
4566
|
+
parts.push({ header, value, isString });
|
|
4567
|
+
}
|
|
4568
|
+
|
|
4569
|
+
// Native Blob composition retains existing Blob/File data. No file is read
|
|
4570
|
+
// and no complete multipart ArrayBuffer is created to determine its length.
|
|
4571
|
+
const blobParts = [];
|
|
4572
|
+
for (const part of parts) {
|
|
4573
|
+
blobParts.push(part.header, part.isString ? normalizeLines(part.value) : part.value, CRLF);
|
|
4574
|
+
}
|
|
4575
|
+
blobParts.push(footer);
|
|
4576
|
+
return new Blob(blobParts, { type: 'multipart/form-data; boundary=' + boundary });
|
|
4577
|
+
}
|
|
4578
|
+
|
|
4579
|
+
function createMultipartBody(form, Blob, limit, limitError, boundary) {
|
|
4580
|
+
// Report missing Blob support before trying to select a random source.
|
|
4581
|
+
if (!utils$1.isFunction(Blob)) {
|
|
4582
|
+
throw new AxiosError('Blob is not supported', AxiosError.ERR_NOT_SUPPORT);
|
|
4583
|
+
}
|
|
4584
|
+
|
|
4585
|
+
if (boundary === undefined) {
|
|
4586
|
+
if (utils$1.isFunction(platform.generateString)) {
|
|
4587
|
+
boundary = 'axios-' + platform.generateString(36, '0123456789abcdef');
|
|
4588
|
+
} else {
|
|
4589
|
+
const crypto = utils$1.global.crypto;
|
|
4590
|
+
if (!crypto || !utils$1.isFunction(crypto.getRandomValues)) {
|
|
4591
|
+
throw new AxiosError('Random byte generation is not supported', AxiosError.ERR_NOT_SUPPORT);
|
|
4592
|
+
}
|
|
4593
|
+
const random = new Uint8Array(18);
|
|
4594
|
+
crypto.getRandomValues(random);
|
|
4595
|
+
boundary =
|
|
4596
|
+
'axios-' + Array.from(random, (value) => ('0' + value.toString(16)).slice(-2)).join('');
|
|
4597
|
+
}
|
|
4598
|
+
}
|
|
4599
|
+
|
|
4600
|
+
try {
|
|
4601
|
+
return formDataToBlob(form, Blob, limit, limitError, boundary);
|
|
4602
|
+
} catch (error) {
|
|
4603
|
+
if (error instanceof FormDataError) {
|
|
4604
|
+
const code =
|
|
4605
|
+
error.reason === 'boundary' ? AxiosError.ERR_BAD_OPTION_VALUE : AxiosError.ERR_BAD_REQUEST;
|
|
4606
|
+
throw new AxiosError(error.message, code);
|
|
4607
|
+
}
|
|
4608
|
+
throw error;
|
|
4609
|
+
}
|
|
4610
|
+
}
|
|
4611
|
+
|
|
4059
4612
|
/**
|
|
4060
4613
|
* Estimate data: URL byte lengths *without* allocating large buffers.
|
|
4061
4614
|
* - Fetch percent-decodes a base64 body before decoding it.
|
|
4062
4615
|
* - Node's Buffer.from(body, 'base64') sizes its backing allocation from the
|
|
4063
|
-
*
|
|
4616
|
+
* percent-decoded body, including ignored characters and content after padding.
|
|
4064
4617
|
* - Non-base64 data is percent-decoded and then encoded as UTF-8.
|
|
4065
4618
|
*/
|
|
4066
4619
|
const isHexDigit = (charCode) =>
|
|
@@ -4153,16 +4706,16 @@ const estimatePercentDecodedBase64Bytes = (body) => {
|
|
|
4153
4706
|
return base64Bytes(significant);
|
|
4154
4707
|
};
|
|
4155
4708
|
|
|
4156
|
-
const estimateDataURLBytes = (url, estimateBase64) => {
|
|
4709
|
+
const estimateDataURLBytes = (url, estimateBase64, base64Pattern) => {
|
|
4157
4710
|
if (!url || typeof url !== 'string') return 0;
|
|
4158
|
-
if (
|
|
4711
|
+
if (!/^data:/i.test(url)) return 0;
|
|
4159
4712
|
|
|
4160
4713
|
const comma = url.indexOf(',');
|
|
4161
4714
|
if (comma < 0) return 0;
|
|
4162
4715
|
|
|
4163
4716
|
const meta = url.slice(5, comma);
|
|
4164
4717
|
const body = url.slice(comma + 1);
|
|
4165
|
-
const isBase64 =
|
|
4718
|
+
const isBase64 = base64Pattern.test(meta);
|
|
4166
4719
|
|
|
4167
4720
|
if (isBase64) {
|
|
4168
4721
|
return estimateBase64(body);
|
|
@@ -4209,11 +4762,12 @@ function estimateDataURLDecodedBytes(url) {
|
|
|
4209
4762
|
|
|
4210
4763
|
return estimateDataURLBytes(
|
|
4211
4764
|
fragmentIndex === -1 ? url : url.slice(0, fragmentIndex),
|
|
4212
|
-
estimatePercentDecodedBase64Bytes
|
|
4765
|
+
estimatePercentDecodedBase64Bytes,
|
|
4766
|
+
/; *base64[\t\n\f\r ]*$/i
|
|
4213
4767
|
);
|
|
4214
4768
|
}
|
|
4215
4769
|
|
|
4216
|
-
const VERSION = "1.
|
|
4770
|
+
const VERSION = "1.21.0";
|
|
4217
4771
|
|
|
4218
4772
|
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
4219
4773
|
|
|
@@ -4289,11 +4843,13 @@ const factory = (env) => {
|
|
|
4289
4843
|
{
|
|
4290
4844
|
Request: globalObject.Request,
|
|
4291
4845
|
Response: globalObject.Response,
|
|
4846
|
+
Blob: globalObject.Blob,
|
|
4292
4847
|
},
|
|
4293
4848
|
env
|
|
4294
4849
|
);
|
|
4295
4850
|
|
|
4296
|
-
const
|
|
4851
|
+
const envFetch = utils$1.hasOwnProp(env, 'fetch') ? env.fetch : undefined;
|
|
4852
|
+
const { Request, Response, Blob } = env;
|
|
4297
4853
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
|
|
4298
4854
|
const isRequestSupported = isFunction(Request);
|
|
4299
4855
|
const isResponseSupported = isFunction(Response);
|
|
@@ -4342,6 +4898,20 @@ const factory = (env) => {
|
|
|
4342
4898
|
isReadableStreamSupported &&
|
|
4343
4899
|
test(() => utils$1.isReadableStream(new Response('').body));
|
|
4344
4900
|
|
|
4901
|
+
// Some runtimes reject every explicit cache mode. Use own defaults for both
|
|
4902
|
+
// probes so unrelated polluted options cannot affect cache-mode detection.
|
|
4903
|
+
const requestDefaults = Object.assign(Object.create(null), DEFAULT_REQUEST_OPTIONS);
|
|
4904
|
+
|
|
4905
|
+
if (isRequestSupported && !test(() => new Request(platform.origin, requestDefaults))) {
|
|
4906
|
+
delete requestDefaults.cache;
|
|
4907
|
+
|
|
4908
|
+
// Only omit cache when that makes Request construction succeed. Otherwise
|
|
4909
|
+
// retain the explicit default that protects supporting runtimes from pollution.
|
|
4910
|
+
if (!test(() => new Request(platform.origin, requestDefaults))) {
|
|
4911
|
+
requestDefaults.cache = DEFAULT_REQUEST_OPTIONS.cache;
|
|
4912
|
+
}
|
|
4913
|
+
}
|
|
4914
|
+
|
|
4345
4915
|
const resolvers = {
|
|
4346
4916
|
stream: supportsResponseStream && ((res) => res.body),
|
|
4347
4917
|
};
|
|
@@ -4375,14 +4945,6 @@ const factory = (env) => {
|
|
|
4375
4945
|
return body.size;
|
|
4376
4946
|
}
|
|
4377
4947
|
|
|
4378
|
-
if (utils$1.isSpecCompliantForm(body)) {
|
|
4379
|
-
const _request = new Request(platform.origin, {
|
|
4380
|
-
method: 'POST',
|
|
4381
|
-
body,
|
|
4382
|
-
});
|
|
4383
|
-
return (await _request.arrayBuffer()).byteLength;
|
|
4384
|
-
}
|
|
4385
|
-
|
|
4386
4948
|
if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
4387
4949
|
return body.byteLength;
|
|
4388
4950
|
}
|
|
@@ -4445,11 +5007,12 @@ const factory = (env) => {
|
|
|
4445
5007
|
|
|
4446
5008
|
let requestContentLength;
|
|
4447
5009
|
|
|
4448
|
-
//
|
|
5010
|
+
// AxiosErrors we raise while request or response bodies are being streamed. Captured
|
|
4449
5011
|
// by identity so the catch block can surface it directly, regardless of
|
|
4450
5012
|
// how the runtime wraps the resulting fetch rejection (undici exposes it
|
|
4451
5013
|
// as `err.cause`; some browsers drop the original error entirely).
|
|
4452
5014
|
let pendingBodyError = null;
|
|
5015
|
+
let pendingResponseError = null;
|
|
4453
5016
|
|
|
4454
5017
|
const maxBodyLengthError = () =>
|
|
4455
5018
|
new AxiosError(
|
|
@@ -4473,8 +5036,9 @@ const factory = (env) => {
|
|
|
4473
5036
|
};
|
|
4474
5037
|
}
|
|
4475
5038
|
|
|
5039
|
+
let parsedURL;
|
|
4476
5040
|
if (maybeWithAuthCredentials(url)) {
|
|
4477
|
-
|
|
5041
|
+
parsedURL = new URL(url, platform.origin);
|
|
4478
5042
|
|
|
4479
5043
|
if (!auth && (parsedURL.username || parsedURL.password)) {
|
|
4480
5044
|
const urlUsername = decodeURIComponentSafe(parsedURL.username);
|
|
@@ -4503,8 +5067,8 @@ const factory = (env) => {
|
|
|
4503
5067
|
// Enforce maxContentLength for data: URLs up-front so we never materialize
|
|
4504
5068
|
// an oversized payload. The HTTP adapter applies the same check (see http.js
|
|
4505
5069
|
// "if (protocol === 'data:')" branch).
|
|
4506
|
-
if (hasMaxContentLength &&
|
|
4507
|
-
const estimated = estimateDataURLDecodedBytes(
|
|
5070
|
+
if (hasMaxContentLength && parsedURL && parsedURL.protocol === 'data:') {
|
|
5071
|
+
const estimated = estimateDataURLDecodedBytes(parsedURL.href);
|
|
4508
5072
|
if (estimated > maxContentLength) {
|
|
4509
5073
|
throw new AxiosError(
|
|
4510
5074
|
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
@@ -4515,6 +5079,38 @@ const factory = (env) => {
|
|
|
4515
5079
|
}
|
|
4516
5080
|
}
|
|
4517
5081
|
|
|
5082
|
+
const formContentType =
|
|
5083
|
+
utils$1.isSpecCompliantForm(data) && AxiosHeaders.from(own('headers')).getContentType();
|
|
5084
|
+
let formBoundary;
|
|
5085
|
+
if (
|
|
5086
|
+
utils$1.isString(formContentType) &&
|
|
5087
|
+
/^multipart\/form-data(?:\s*;|$)/i.test(formContentType.trim())
|
|
5088
|
+
) {
|
|
5089
|
+
const parameters = AxiosHeaders.parseParameters(formContentType);
|
|
5090
|
+
if (utils$1.hasOwnProp(parameters, 'boundary')) formBoundary = parameters.boundary;
|
|
5091
|
+
}
|
|
5092
|
+
|
|
5093
|
+
if (
|
|
5094
|
+
utils$1.isSpecCompliantForm(data) &&
|
|
5095
|
+
method !== 'get' &&
|
|
5096
|
+
method !== 'head' &&
|
|
5097
|
+
(hasMaxBodyLength ||
|
|
5098
|
+
(onUploadProgress && supportsRequestStream) ||
|
|
5099
|
+
formBoundary !== undefined)
|
|
5100
|
+
) {
|
|
5101
|
+
data = createMultipartBody(
|
|
5102
|
+
data,
|
|
5103
|
+
Blob,
|
|
5104
|
+
hasMaxBodyLength ? maxBodyLength : Infinity,
|
|
5105
|
+
maxBodyLengthError,
|
|
5106
|
+
formBoundary
|
|
5107
|
+
);
|
|
5108
|
+
// Blob.type lowercases its value, including a case-sensitive boundary.
|
|
5109
|
+
// Retain the caller's header when an explicit boundary was serialized.
|
|
5110
|
+
headers.setContentType(formBoundary === undefined ? data.type : formContentType);
|
|
5111
|
+
requestContentLength = data.size;
|
|
5112
|
+
}
|
|
5113
|
+
|
|
4518
5114
|
// Enforce maxBodyLength against known-size bodies before dispatch using
|
|
4519
5115
|
// the body's *actual* size — never a caller-declared Content-Length,
|
|
4520
5116
|
// which could under-report to slip an oversized body past the check.
|
|
@@ -4660,7 +5256,7 @@ const factory = (env) => {
|
|
|
4660
5256
|
});
|
|
4661
5257
|
|
|
4662
5258
|
if (isRequestSupported) {
|
|
4663
|
-
utils$1.forEach(
|
|
5259
|
+
utils$1.forEach(requestDefaults, (value, key) => {
|
|
4664
5260
|
if (resolvedOptions[key] === undefined) {
|
|
4665
5261
|
resolvedOptions[key] = value;
|
|
4666
5262
|
}
|
|
@@ -4734,12 +5330,12 @@ const factory = (env) => {
|
|
|
4734
5330
|
if (hasMaxContentLength) {
|
|
4735
5331
|
bytesRead = loadedBytes;
|
|
4736
5332
|
if (bytesRead > maxContentLength) {
|
|
4737
|
-
throw new AxiosError(
|
|
5333
|
+
throw (pendingResponseError = new AxiosError(
|
|
4738
5334
|
'maxContentLength size of ' + maxContentLength + ' exceeded',
|
|
4739
5335
|
AxiosError.ERR_BAD_RESPONSE,
|
|
4740
5336
|
config,
|
|
4741
5337
|
request
|
|
4742
|
-
);
|
|
5338
|
+
));
|
|
4743
5339
|
}
|
|
4744
5340
|
}
|
|
4745
5341
|
onProgress && onProgress(loadedBytes);
|
|
@@ -4825,7 +5421,7 @@ const factory = (env) => {
|
|
|
4825
5421
|
}
|
|
4826
5422
|
|
|
4827
5423
|
// Surface a maxBodyLength violation we raised while the request body was
|
|
4828
|
-
// being streamed.
|
|
5424
|
+
// being streamed. Keeping the original error (rather than reading
|
|
4829
5425
|
// `err.cause.isAxiosError`) keeps the error deterministic across runtimes
|
|
4830
5426
|
// and avoids both prototype-pollution reads and mis-attributing a foreign
|
|
4831
5427
|
// AxiosError that merely happened to land in `err.cause`.
|
|
@@ -4834,6 +5430,10 @@ const factory = (env) => {
|
|
|
4834
5430
|
throw pendingBodyError;
|
|
4835
5431
|
}
|
|
4836
5432
|
|
|
5433
|
+
if (pendingResponseError) {
|
|
5434
|
+
throw pendingResponseError;
|
|
5435
|
+
}
|
|
5436
|
+
|
|
4837
5437
|
// Re-throw AxiosErrors we raised synchronously (data: URL / content-length
|
|
4838
5438
|
// pre-checks, response size enforcement) without re-wrapping them.
|
|
4839
5439
|
if (err instanceof AxiosError) {
|
|
@@ -4869,9 +5469,15 @@ const factory = (env) => {
|
|
|
4869
5469
|
const seedCache = new Map();
|
|
4870
5470
|
|
|
4871
5471
|
const getFetch = (config) => {
|
|
4872
|
-
|
|
4873
|
-
const
|
|
4874
|
-
|
|
5472
|
+
const env = Object.create(null);
|
|
5473
|
+
const configuredEnv = config && utils$1.hasOwnProp(config, 'env') && config.env;
|
|
5474
|
+
['fetch', 'Request', 'Response', 'Blob'].forEach((key) => {
|
|
5475
|
+
if (configuredEnv && utils$1.hasOwnProp(configuredEnv, key)) {
|
|
5476
|
+
env[key] = configuredEnv[key];
|
|
5477
|
+
}
|
|
5478
|
+
});
|
|
5479
|
+
const { fetch, Request, Response, Blob } = env;
|
|
5480
|
+
const seeds = [Request, Response, fetch, Blob];
|
|
4875
5481
|
|
|
4876
5482
|
let len = seeds.length,
|
|
4877
5483
|
i = len,
|
|
@@ -5037,6 +5643,21 @@ function throwIfCancellationRequested(config) {
|
|
|
5037
5643
|
}
|
|
5038
5644
|
}
|
|
5039
5645
|
|
|
5646
|
+
/**
|
|
5647
|
+
* Milliseconds elapsed since `start`, floored at zero.
|
|
5648
|
+
*
|
|
5649
|
+
* Wall-clock, to match the rest of the codebase (speedometer, throttle,
|
|
5650
|
+
* AxiosTransformStream). A backwards clock adjustment mid-request would
|
|
5651
|
+
* otherwise produce a negative duration, so the result is clamped.
|
|
5652
|
+
*
|
|
5653
|
+
* @param {number} start Timestamp from `Date.now()`
|
|
5654
|
+
*
|
|
5655
|
+
* @returns {number} Non-negative elapsed milliseconds
|
|
5656
|
+
*/
|
|
5657
|
+
function elapsedSince(start) {
|
|
5658
|
+
return Math.max(0, Date.now() - start);
|
|
5659
|
+
}
|
|
5660
|
+
|
|
5040
5661
|
/**
|
|
5041
5662
|
* Dispatch a request to the server using the configured adapter.
|
|
5042
5663
|
*
|
|
@@ -5063,10 +5684,14 @@ function dispatchRequest(_config) {
|
|
|
5063
5684
|
|
|
5064
5685
|
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
5065
5686
|
|
|
5687
|
+
const start = Date.now();
|
|
5688
|
+
|
|
5066
5689
|
return adapter(config).then(
|
|
5067
5690
|
function onAdapterResolution(response) {
|
|
5068
5691
|
throwIfCancellationRequested(config);
|
|
5069
5692
|
|
|
5693
|
+
response.duration = elapsedSince(start);
|
|
5694
|
+
|
|
5070
5695
|
// Expose the current response on config so that transformResponse can
|
|
5071
5696
|
// attach it to any AxiosError it throws (e.g. on JSON parse failure).
|
|
5072
5697
|
// We clean it up afterwards to avoid polluting the config object.
|
|
@@ -5087,6 +5712,7 @@ function dispatchRequest(_config) {
|
|
|
5087
5712
|
|
|
5088
5713
|
// Transform response data
|
|
5089
5714
|
if (reason && reason.response) {
|
|
5715
|
+
reason.response.duration = elapsedSince(start);
|
|
5090
5716
|
config.response = reason.response;
|
|
5091
5717
|
try {
|
|
5092
5718
|
reason.response.data = transformData.call(
|
|
@@ -5216,6 +5842,37 @@ var validator = {
|
|
|
5216
5842
|
|
|
5217
5843
|
const validators = validator.validators;
|
|
5218
5844
|
|
|
5845
|
+
// Recognize header maps without consuming objects intended as literal values.
|
|
5846
|
+
// AxiosHeaders from other builds share a brand and header-container interface,
|
|
5847
|
+
// but not constructor identity. A tag and toJSON alone can describe a literal.
|
|
5848
|
+
const isHeadersBucket = (value) => {
|
|
5849
|
+
if (value == null || utils$1.isPlainObject(value) || value instanceof AxiosHeaders) {
|
|
5850
|
+
return true;
|
|
5851
|
+
}
|
|
5852
|
+
|
|
5853
|
+
try {
|
|
5854
|
+
return (
|
|
5855
|
+
utils$1.isObject(value) &&
|
|
5856
|
+
utils$1.getSafeProp(value, Symbol.toStringTag) === 'AxiosHeaders' &&
|
|
5857
|
+
[
|
|
5858
|
+
'toJSON',
|
|
5859
|
+
'set',
|
|
5860
|
+
'get',
|
|
5861
|
+
'has',
|
|
5862
|
+
'delete',
|
|
5863
|
+
'clear',
|
|
5864
|
+
'normalize',
|
|
5865
|
+
'concat',
|
|
5866
|
+
'toString',
|
|
5867
|
+
Symbol.iterator,
|
|
5868
|
+
].every((method) => utils$1.isFunction(utils$1.getSafeProp(value, method)))
|
|
5869
|
+
);
|
|
5870
|
+
} catch (e) {
|
|
5871
|
+
// A failed optional brand probe must not prevent literal header serialization.
|
|
5872
|
+
return false;
|
|
5873
|
+
}
|
|
5874
|
+
};
|
|
5875
|
+
|
|
5219
5876
|
/**
|
|
5220
5877
|
* Create a new instance of Axios
|
|
5221
5878
|
*
|
|
@@ -5262,16 +5919,26 @@ class Axios {
|
|
|
5262
5919
|
|
|
5263
5920
|
if (!err.stack) {
|
|
5264
5921
|
err.stack = stack;
|
|
5265
|
-
// match without the 2 top stack lines
|
|
5266
5922
|
} else if (stack) {
|
|
5923
|
+
// Match a common suffix after the 2 top frames when available,
|
|
5924
|
+
// otherwise compare the full reconstructed stack.
|
|
5267
5925
|
const firstNewlineIndex = stack.indexOf('\n');
|
|
5268
5926
|
const secondNewlineIndex =
|
|
5269
5927
|
firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
|
|
5270
|
-
const
|
|
5271
|
-
secondNewlineIndex === -1 ?
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5928
|
+
const duplicateCheckSuffix =
|
|
5929
|
+
secondNewlineIndex === -1 ? stack : stack.slice(secondNewlineIndex + 1);
|
|
5930
|
+
|
|
5931
|
+
// `AxiosError.from()` may have already inlined the wrapped error's
|
|
5932
|
+
// stack under a `Caused by:` marker. Keep the reconstructed caller
|
|
5933
|
+
// frames ahead of that marker so stack-only reporters do not read
|
|
5934
|
+
// them as part of the low-level cause.
|
|
5935
|
+
const currentStack = String(err.stack);
|
|
5936
|
+
const causeIndex = getCauseStackIndex(err, currentStack);
|
|
5937
|
+
const stackHead = causeIndex === -1 ? currentStack : currentStack.slice(0, causeIndex);
|
|
5938
|
+
const causeSection = causeIndex === -1 ? '' : currentStack.slice(causeIndex);
|
|
5939
|
+
|
|
5940
|
+
if (!stackHead.endsWith(duplicateCheckSuffix)) {
|
|
5941
|
+
err.stack = stackHead + '\n' + stack + causeSection;
|
|
5275
5942
|
}
|
|
5276
5943
|
}
|
|
5277
5944
|
} catch (e) {
|
|
@@ -5307,6 +5974,7 @@ class Axios {
|
|
|
5307
5974
|
legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
|
|
5308
5975
|
advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),
|
|
5309
5976
|
validateStatusUndefinedResolves: validators.transitional(validators.boolean),
|
|
5977
|
+
encodeBasicAuthUsername: validators.transitional(validators.boolean),
|
|
5310
5978
|
},
|
|
5311
5979
|
false
|
|
5312
5980
|
);
|
|
@@ -5330,7 +5998,10 @@ class Axios {
|
|
|
5330
5998
|
}
|
|
5331
5999
|
|
|
5332
6000
|
// Set config.allowAbsoluteUrls
|
|
5333
|
-
if (config.allowAbsoluteUrls !== undefined) ; else if (
|
|
6001
|
+
if (config.allowAbsoluteUrls !== undefined) ; else if (
|
|
6002
|
+
utils$1.hasOwnProp(this.defaults, 'allowAbsoluteUrls') &&
|
|
6003
|
+
this.defaults.allowAbsoluteUrls !== undefined
|
|
6004
|
+
) {
|
|
5334
6005
|
config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
|
|
5335
6006
|
} else {
|
|
5336
6007
|
config.allowAbsoluteUrls = true;
|
|
@@ -5352,12 +6023,21 @@ class Axios {
|
|
|
5352
6023
|
'get'
|
|
5353
6024
|
).toLowerCase();
|
|
5354
6025
|
|
|
5355
|
-
// Flatten headers
|
|
5356
|
-
|
|
6026
|
+
// Flatten header defaults without consuming literal method-named headers.
|
|
6027
|
+
const commonHeaders = utils$1.getSafeProp(headers, 'common');
|
|
6028
|
+
const methodHeaders = utils$1.getSafeProp(headers, config.method);
|
|
6029
|
+
const contextHeaders =
|
|
6030
|
+
headers &&
|
|
6031
|
+
utils$1.merge(
|
|
6032
|
+
isHeadersBucket(commonHeaders) ? commonHeaders : undefined,
|
|
6033
|
+
isHeadersBucket(methodHeaders) ? methodHeaders : undefined
|
|
6034
|
+
);
|
|
5357
6035
|
|
|
5358
6036
|
headers &&
|
|
5359
6037
|
utils$1.forEach(methodList.concat('common'), (method) => {
|
|
5360
|
-
|
|
6038
|
+
if (isHeadersBucket(utils$1.getSafeProp(headers, method))) {
|
|
6039
|
+
delete headers[method];
|
|
6040
|
+
}
|
|
5361
6041
|
});
|
|
5362
6042
|
|
|
5363
6043
|
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
@@ -5466,7 +6146,7 @@ class Axios {
|
|
|
5466
6146
|
// Provide aliases for supported request methods
|
|
5467
6147
|
utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
5468
6148
|
/*eslint func-names:0*/
|
|
5469
|
-
Axios.prototype[method] = function (url, config) {
|
|
6149
|
+
Axios.prototype[method] = async function (url, config) {
|
|
5470
6150
|
return this.request(
|
|
5471
6151
|
mergeConfig(config || {}, {
|
|
5472
6152
|
method,
|
|
@@ -5479,7 +6159,7 @@ utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoDa
|
|
|
5479
6159
|
|
|
5480
6160
|
utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
|
|
5481
6161
|
function generateHTTPMethod(isForm) {
|
|
5482
|
-
return function httpMethod(url, data, config) {
|
|
6162
|
+
return async function httpMethod(url, data, config) {
|
|
5483
6163
|
return this.request(
|
|
5484
6164
|
mergeConfig(config || {}, {
|
|
5485
6165
|
method,
|