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
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import AxiosError, { REDACTED } from './AxiosError.js';
|
|
4
|
+
import isAbsoluteURL from '../helpers/isAbsoluteURL.js';
|
|
5
|
+
import combineURLs from '../helpers/combineURLs.js';
|
|
6
|
+
import normalizeURLForProtocolCheck from '../helpers/normalizeURLForProtocolCheck.js';
|
|
7
|
+
|
|
8
|
+
const malformedHttpProtocol = /^https?:(?!\/\/)/i;
|
|
9
|
+
|
|
10
|
+
// Redact the parts of a URL that can carry secrets before it is embedded in an
|
|
11
|
+
// error message. AxiosError.toJSON() serializes `message` verbatim and errors
|
|
12
|
+
// are commonly logged, while the opt-in `config.redact` model only cleans
|
|
13
|
+
// config keys — it cannot reach the message. Redact only the genuinely
|
|
14
|
+
// sensitive substrings — userinfo (credentials), query parameter values and
|
|
15
|
+
// fragment contents — with the same REDACTED marker the config redaction uses,
|
|
16
|
+
// while keeping the scheme, host, path and parameter names so the offending
|
|
17
|
+
// request stays accurately identifiable.
|
|
18
|
+
function redactFragment(fragment) {
|
|
19
|
+
if (!fragment) {
|
|
20
|
+
return fragment;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => {
|
|
24
|
+
return `${separator}${parameterName}${REDACTED}`;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function redactSensitiveURLParts(url) {
|
|
29
|
+
const redactedURL = url.replace(/^(https?:\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);
|
|
30
|
+
const fragmentIndex = redactedURL.indexOf('#');
|
|
31
|
+
const urlWithoutFragment =
|
|
32
|
+
fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);
|
|
33
|
+
const redactedURLWithoutFragment = urlWithoutFragment.replace(
|
|
34
|
+
/([?&][^=&#]*=)[^&#]*/g,
|
|
35
|
+
`$1${REDACTED}`
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
if (fragmentIndex === -1) {
|
|
39
|
+
return redactedURLWithoutFragment;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function assertValidHttpProtocolURL(url, config) {
|
|
46
|
+
if (typeof url === 'string') {
|
|
47
|
+
const normalizedURL = normalizeURLForProtocolCheck(url);
|
|
48
|
+
if (malformedHttpProtocol.test(normalizedURL)) {
|
|
49
|
+
throw new AxiosError(
|
|
50
|
+
`Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing "//" after protocol`,
|
|
51
|
+
AxiosError.ERR_INVALID_URL,
|
|
52
|
+
config
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new URL by combining the baseURL with the requestedURL,
|
|
60
|
+
* only when the requestedURL is not already an absolute URL.
|
|
61
|
+
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
|
62
|
+
*
|
|
63
|
+
* @param {string} baseURL The base URL
|
|
64
|
+
* @param {string} requestedURL Absolute or relative URL to combine
|
|
65
|
+
*
|
|
66
|
+
* @returns {string} The combined full path
|
|
67
|
+
*/
|
|
68
|
+
export default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {
|
|
69
|
+
assertValidHttpProtocolURL(requestedURL, config);
|
|
70
|
+
let isRelativeUrl = !isAbsoluteURL(requestedURL);
|
|
71
|
+
if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
|
|
72
|
+
assertValidHttpProtocolURL(baseURL, config);
|
|
73
|
+
return combineURLs(baseURL, requestedURL);
|
|
74
|
+
}
|
|
75
|
+
return requestedURL;
|
|
76
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import transformData from './transformData.js';
|
|
4
|
+
import isCancel from '../cancel/isCancel.js';
|
|
5
|
+
import defaults from '../defaults/index.js';
|
|
6
|
+
import CanceledError from '../cancel/CanceledError.js';
|
|
7
|
+
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
8
|
+
import adapters from '../adapters/adapters.js';
|
|
9
|
+
import utils from '../utils.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
13
|
+
*
|
|
14
|
+
* @param {Object} config The config that is to be used for the request
|
|
15
|
+
*
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
function throwIfCancellationRequested(config) {
|
|
19
|
+
if (config.cancelToken) {
|
|
20
|
+
config.cancelToken.throwIfRequested();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (config.signal && config.signal.aborted) {
|
|
24
|
+
throw new CanceledError(null, config);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Dispatch a request to the server using the configured adapter.
|
|
30
|
+
*
|
|
31
|
+
* @param {object} config The config that is to be used for the request
|
|
32
|
+
*
|
|
33
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
34
|
+
*/
|
|
35
|
+
export default function dispatchRequest(_config) {
|
|
36
|
+
// Interceptors may replace the merged config with an ordinary object. Flatten
|
|
37
|
+
// it at the dispatch boundary so shared prototype members cannot become
|
|
38
|
+
// request behavior, while preserving intentional template/class members.
|
|
39
|
+
const config = utils.toSafeFlatObject(_config);
|
|
40
|
+
|
|
41
|
+
throwIfCancellationRequested(config);
|
|
42
|
+
|
|
43
|
+
config.headers = AxiosHeaders.from(utils.getSafeProp(config, 'headers'));
|
|
44
|
+
|
|
45
|
+
// Transform request data
|
|
46
|
+
config.data = transformData.call(config, config.transformRequest);
|
|
47
|
+
|
|
48
|
+
if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
|
|
49
|
+
config.headers.setContentType('application/x-www-form-urlencoded', false);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
|
|
53
|
+
|
|
54
|
+
return adapter(config).then(
|
|
55
|
+
function onAdapterResolution(response) {
|
|
56
|
+
throwIfCancellationRequested(config);
|
|
57
|
+
|
|
58
|
+
// Expose the current response on config so that transformResponse can
|
|
59
|
+
// attach it to any AxiosError it throws (e.g. on JSON parse failure).
|
|
60
|
+
// We clean it up afterwards to avoid polluting the config object.
|
|
61
|
+
config.response = response;
|
|
62
|
+
try {
|
|
63
|
+
response.data = transformData.call(config, config.transformResponse, response);
|
|
64
|
+
} finally {
|
|
65
|
+
delete config.response;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
response.headers = AxiosHeaders.from(response.headers);
|
|
69
|
+
|
|
70
|
+
return response;
|
|
71
|
+
},
|
|
72
|
+
function onAdapterRejection(reason) {
|
|
73
|
+
if (!isCancel(reason)) {
|
|
74
|
+
throwIfCancellationRequested(config);
|
|
75
|
+
|
|
76
|
+
// Transform response data
|
|
77
|
+
if (reason && reason.response) {
|
|
78
|
+
config.response = reason.response;
|
|
79
|
+
try {
|
|
80
|
+
reason.response.data = transformData.call(
|
|
81
|
+
config,
|
|
82
|
+
config.transformResponse,
|
|
83
|
+
reason.response
|
|
84
|
+
);
|
|
85
|
+
} finally {
|
|
86
|
+
delete config.response;
|
|
87
|
+
}
|
|
88
|
+
reason.response.headers = AxiosHeaders.from(reason.response.headers);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return Promise.reject(reason);
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
import AxiosHeaders from './AxiosHeaders.js';
|
|
5
|
+
|
|
6
|
+
const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);
|
|
7
|
+
|
|
8
|
+
const ownEnumerableKeys = (thing) => {
|
|
9
|
+
if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
|
|
10
|
+
return Object.keys(thing).concat(
|
|
11
|
+
Object.getOwnPropertySymbols(thing).filter(
|
|
12
|
+
(symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable
|
|
13
|
+
)
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
return Object.keys(thing);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Config-specific merge-function which creates a new config-object
|
|
21
|
+
* by merging two configuration objects together.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} config1
|
|
24
|
+
* @param {Object} config2
|
|
25
|
+
*
|
|
26
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
27
|
+
*/
|
|
28
|
+
export default function mergeConfig(config1, config2) {
|
|
29
|
+
// eslint-disable-next-line no-param-reassign
|
|
30
|
+
config1 = config1 || {};
|
|
31
|
+
config2 = config2 || {};
|
|
32
|
+
|
|
33
|
+
// Use a null-prototype object so that downstream reads such as `config.auth`
|
|
34
|
+
// or `config.baseURL` cannot inherit polluted values from Object.prototype.
|
|
35
|
+
// `hasOwnProperty` is restored as a non-enumerable own slot to preserve
|
|
36
|
+
// ergonomics for user code that relies on it.
|
|
37
|
+
const config = Object.create(null);
|
|
38
|
+
Object.defineProperty(config, 'hasOwnProperty', {
|
|
39
|
+
// Null-proto descriptor so a polluted Object.prototype.get cannot turn
|
|
40
|
+
// this data descriptor into an accessor descriptor on the way in.
|
|
41
|
+
__proto__: null,
|
|
42
|
+
value: Object.prototype.hasOwnProperty,
|
|
43
|
+
enumerable: false,
|
|
44
|
+
writable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
function getMergedValue(target, source, prop, caseless) {
|
|
49
|
+
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
50
|
+
return utils.merge.call({ caseless }, target, source);
|
|
51
|
+
} else if (utils.isPlainObject(source)) {
|
|
52
|
+
return utils.merge({}, source);
|
|
53
|
+
} else if (utils.isArray(source)) {
|
|
54
|
+
return source.slice();
|
|
55
|
+
}
|
|
56
|
+
return source;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function mergeDeepProperties(a, b, prop, caseless) {
|
|
60
|
+
if (!utils.isUndefined(b)) {
|
|
61
|
+
return getMergedValue(a, b, prop, caseless);
|
|
62
|
+
} else if (!utils.isUndefined(a)) {
|
|
63
|
+
return getMergedValue(undefined, a, prop, caseless);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// eslint-disable-next-line consistent-return
|
|
68
|
+
function valueFromConfig2(a, b) {
|
|
69
|
+
if (!utils.isUndefined(b)) {
|
|
70
|
+
return getMergedValue(undefined, b);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// eslint-disable-next-line consistent-return
|
|
75
|
+
function defaultToConfig2(a, b) {
|
|
76
|
+
if (!utils.isUndefined(b)) {
|
|
77
|
+
return getMergedValue(undefined, b);
|
|
78
|
+
} else if (!utils.isUndefined(a)) {
|
|
79
|
+
return getMergedValue(undefined, a);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function getMergedTransitionalOption(prop) {
|
|
84
|
+
const transitional2 = utils.hasOwnProp(config2, 'transitional')
|
|
85
|
+
? config2.transitional
|
|
86
|
+
: undefined;
|
|
87
|
+
|
|
88
|
+
if (!utils.isUndefined(transitional2)) {
|
|
89
|
+
if (utils.isPlainObject(transitional2)) {
|
|
90
|
+
if (utils.hasOwnProp(transitional2, prop)) {
|
|
91
|
+
return transitional2[prop];
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const transitional1 = utils.hasOwnProp(config1, 'transitional')
|
|
99
|
+
? config1.transitional
|
|
100
|
+
: undefined;
|
|
101
|
+
|
|
102
|
+
if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) {
|
|
103
|
+
return transitional1[prop];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// eslint-disable-next-line consistent-return
|
|
110
|
+
function mergeDirectKeys(a, b, prop) {
|
|
111
|
+
if (utils.hasOwnProp(config2, prop)) {
|
|
112
|
+
return getMergedValue(a, b);
|
|
113
|
+
} else if (utils.hasOwnProp(config1, prop)) {
|
|
114
|
+
return getMergedValue(undefined, a);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const mergeMap = {
|
|
119
|
+
url: valueFromConfig2,
|
|
120
|
+
method: valueFromConfig2,
|
|
121
|
+
data: valueFromConfig2,
|
|
122
|
+
baseURL: defaultToConfig2,
|
|
123
|
+
transformRequest: defaultToConfig2,
|
|
124
|
+
transformResponse: defaultToConfig2,
|
|
125
|
+
paramsSerializer: defaultToConfig2,
|
|
126
|
+
timeout: defaultToConfig2,
|
|
127
|
+
timeoutErrorMessage: defaultToConfig2,
|
|
128
|
+
withCredentials: defaultToConfig2,
|
|
129
|
+
withXSRFToken: defaultToConfig2,
|
|
130
|
+
adapter: defaultToConfig2,
|
|
131
|
+
responseType: defaultToConfig2,
|
|
132
|
+
xsrfCookieName: defaultToConfig2,
|
|
133
|
+
xsrfHeaderName: defaultToConfig2,
|
|
134
|
+
onUploadProgress: defaultToConfig2,
|
|
135
|
+
onDownloadProgress: defaultToConfig2,
|
|
136
|
+
decompress: defaultToConfig2,
|
|
137
|
+
maxContentLength: defaultToConfig2,
|
|
138
|
+
maxBodyLength: defaultToConfig2,
|
|
139
|
+
beforeRedirect: defaultToConfig2,
|
|
140
|
+
transport: defaultToConfig2,
|
|
141
|
+
httpAgent: defaultToConfig2,
|
|
142
|
+
httpsAgent: defaultToConfig2,
|
|
143
|
+
cancelToken: defaultToConfig2,
|
|
144
|
+
socketPath: defaultToConfig2,
|
|
145
|
+
allowedSocketPaths: defaultToConfig2,
|
|
146
|
+
responseEncoding: defaultToConfig2,
|
|
147
|
+
validateStatus: mergeDirectKeys,
|
|
148
|
+
headers: (a, b, prop) =>
|
|
149
|
+
mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
utils.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {
|
|
153
|
+
if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
|
|
154
|
+
const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
|
|
155
|
+
const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined;
|
|
156
|
+
const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined;
|
|
157
|
+
const configValue = merge(a, b, prop);
|
|
158
|
+
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
if (
|
|
162
|
+
utils.hasOwnProp(config2, 'validateStatus') &&
|
|
163
|
+
utils.isUndefined(config2.validateStatus) &&
|
|
164
|
+
getMergedTransitionalOption('validateStatusUndefinedResolves') === false
|
|
165
|
+
) {
|
|
166
|
+
if (utils.hasOwnProp(config1, 'validateStatus')) {
|
|
167
|
+
config.validateStatus = getMergedValue(undefined, config1.validateStatus);
|
|
168
|
+
} else {
|
|
169
|
+
delete config.validateStatus;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return config;
|
|
174
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Apply the headers generated by a FormData implementation to the request headers,
|
|
7
|
+
* honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the
|
|
8
|
+
* content-* headers; otherwise merge all of them.
|
|
9
|
+
*
|
|
10
|
+
* @param {AxiosHeaders} headers - the request headers to mutate
|
|
11
|
+
* @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation
|
|
12
|
+
* @param {String} [policy] - the resolved `formDataHeaderPolicy` config value
|
|
13
|
+
*
|
|
14
|
+
* @returns {void}
|
|
15
|
+
*/
|
|
16
|
+
export default function setFormDataHeaders(headers, formHeaders, policy) {
|
|
17
|
+
if (policy !== 'content-only') {
|
|
18
|
+
headers.set(formHeaders);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Object.entries(formHeaders || {}).forEach(([key, val]) => {
|
|
23
|
+
if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
|
|
24
|
+
headers.set(key, val);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import AxiosError from './AxiosError.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Resolve or reject a Promise based on response status.
|
|
7
|
+
*
|
|
8
|
+
* @param {Function} resolve A function that resolves the promise.
|
|
9
|
+
* @param {Function} reject A function that rejects the promise.
|
|
10
|
+
* @param {object} response The response.
|
|
11
|
+
*
|
|
12
|
+
* @returns {object} The response.
|
|
13
|
+
*/
|
|
14
|
+
export default function settle(resolve, reject, response) {
|
|
15
|
+
const validateStatus = response.config.validateStatus;
|
|
16
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
17
|
+
resolve(response);
|
|
18
|
+
} else {
|
|
19
|
+
reject(new AxiosError(
|
|
20
|
+
'Request failed with status code ' + response.status,
|
|
21
|
+
response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE,
|
|
22
|
+
response.config,
|
|
23
|
+
response.request,
|
|
24
|
+
response
|
|
25
|
+
));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
import defaults from '../defaults/index.js';
|
|
5
|
+
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Transform the data for a request or a response
|
|
9
|
+
*
|
|
10
|
+
* @param {Array|Function} fns A single function or Array of functions
|
|
11
|
+
* @param {?Object} response The response object
|
|
12
|
+
*
|
|
13
|
+
* @returns {*} The resulting transformed data
|
|
14
|
+
*/
|
|
15
|
+
export default function transformData(fns, response) {
|
|
16
|
+
const config = this || defaults;
|
|
17
|
+
const context = response || config;
|
|
18
|
+
const headers = AxiosHeaders.from(context.headers);
|
|
19
|
+
let data = context.data;
|
|
20
|
+
|
|
21
|
+
utils.forEach(fns, function transform(fn) {
|
|
22
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
headers.normalize();
|
|
26
|
+
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
import AxiosError from '../core/AxiosError.js';
|
|
5
|
+
import transitionalDefaults from './transitional.js';
|
|
6
|
+
import toFormData from '../helpers/toFormData.js';
|
|
7
|
+
import toURLEncodedForm from '../helpers/toURLEncodedForm.js';
|
|
8
|
+
import platform from '../platform/index.js';
|
|
9
|
+
import formDataToJSON from '../helpers/formDataToJSON.js';
|
|
10
|
+
import methodList from '../core/methodList.js';
|
|
11
|
+
|
|
12
|
+
const own = (obj, key) => (obj != null && utils.hasOwnProp(obj, key) ? obj[key] : undefined);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
16
|
+
* of the input
|
|
17
|
+
*
|
|
18
|
+
* @param {any} rawValue - The value to be stringified.
|
|
19
|
+
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
20
|
+
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
21
|
+
*
|
|
22
|
+
* @returns {string} A stringified version of the rawValue.
|
|
23
|
+
*/
|
|
24
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
25
|
+
if (utils.isString(rawValue)) {
|
|
26
|
+
try {
|
|
27
|
+
(parser || JSON.parse)(rawValue);
|
|
28
|
+
return utils.trim(rawValue);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
if (e.name !== 'SyntaxError') {
|
|
31
|
+
throw e;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const defaults = {
|
|
40
|
+
transitional: transitionalDefaults,
|
|
41
|
+
|
|
42
|
+
adapter: ['xhr', 'http', 'fetch'],
|
|
43
|
+
|
|
44
|
+
transformRequest: [
|
|
45
|
+
function transformRequest(data, headers) {
|
|
46
|
+
const contentType = headers.getContentType() || '';
|
|
47
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
48
|
+
const isObjectPayload = utils.isObject(data);
|
|
49
|
+
|
|
50
|
+
if (isObjectPayload && utils.isHTMLForm(data)) {
|
|
51
|
+
data = new FormData(data);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const isFormData = utils.isFormData(data);
|
|
55
|
+
|
|
56
|
+
if (isFormData) {
|
|
57
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (
|
|
61
|
+
utils.isArrayBuffer(data) ||
|
|
62
|
+
utils.isBuffer(data) ||
|
|
63
|
+
utils.isStream(data) ||
|
|
64
|
+
utils.isFile(data) ||
|
|
65
|
+
utils.isBlob(data) ||
|
|
66
|
+
utils.isReadableStream(data)
|
|
67
|
+
) {
|
|
68
|
+
return data;
|
|
69
|
+
}
|
|
70
|
+
if (utils.isArrayBufferView(data)) {
|
|
71
|
+
return data.buffer;
|
|
72
|
+
}
|
|
73
|
+
if (utils.isURLSearchParams(data)) {
|
|
74
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
75
|
+
return data.toString();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
let isFileList;
|
|
79
|
+
|
|
80
|
+
if (isObjectPayload) {
|
|
81
|
+
const formSerializer = own(this, 'formSerializer');
|
|
82
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
83
|
+
return toURLEncodedForm(data, formSerializer).toString();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (
|
|
87
|
+
(isFileList = utils.isFileList(data)) ||
|
|
88
|
+
contentType.indexOf('multipart/form-data') > -1
|
|
89
|
+
) {
|
|
90
|
+
const env = own(this, 'env');
|
|
91
|
+
const _FormData = env && env.FormData;
|
|
92
|
+
|
|
93
|
+
return toFormData(
|
|
94
|
+
isFileList ? { 'files[]': data } : data,
|
|
95
|
+
_FormData && new _FormData(),
|
|
96
|
+
formSerializer
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (isObjectPayload || hasJSONContentType) {
|
|
102
|
+
headers.setContentType('application/json', false);
|
|
103
|
+
return stringifySafely(data);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return data;
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
|
|
110
|
+
transformResponse: [
|
|
111
|
+
function transformResponse(data) {
|
|
112
|
+
const transitional = own(this, 'transitional') || defaults.transitional;
|
|
113
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
114
|
+
const responseType = own(this, 'responseType');
|
|
115
|
+
const JSONRequested = responseType === 'json';
|
|
116
|
+
|
|
117
|
+
if (utils.isResponse(data) || utils.isReadableStream(data)) {
|
|
118
|
+
return data;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (
|
|
122
|
+
data &&
|
|
123
|
+
utils.isString(data) &&
|
|
124
|
+
((forcedJSONParsing && !responseType) || JSONRequested)
|
|
125
|
+
) {
|
|
126
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
127
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
128
|
+
|
|
129
|
+
try {
|
|
130
|
+
return JSON.parse(data, own(this, 'parseReviver'));
|
|
131
|
+
} catch (e) {
|
|
132
|
+
if (strictJSONParsing) {
|
|
133
|
+
if (e.name === 'SyntaxError') {
|
|
134
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
|
|
135
|
+
}
|
|
136
|
+
throw e;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return data;
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
147
|
+
* timeout is not created.
|
|
148
|
+
*/
|
|
149
|
+
timeout: 0,
|
|
150
|
+
|
|
151
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
|
152
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
|
153
|
+
|
|
154
|
+
maxContentLength: -1,
|
|
155
|
+
maxBodyLength: -1,
|
|
156
|
+
|
|
157
|
+
env: {
|
|
158
|
+
FormData: platform.classes.FormData,
|
|
159
|
+
Blob: platform.classes.Blob,
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
validateStatus: function validateStatus(status) {
|
|
163
|
+
return status >= 200 && status < 300;
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
headers: {
|
|
167
|
+
common: {
|
|
168
|
+
Accept: 'application/json, text/plain, */*',
|
|
169
|
+
'Content-Type': undefined,
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
utils.forEach(methodList, (method) => {
|
|
175
|
+
defaults.headers[method] = {};
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
export default defaults;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = "1.20.0";
|