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