appium-mac2-driver 4.5.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 +10 -0
- 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/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/session-claim-handler.ts +1 -2
- 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/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 +4 -6
- 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,156 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import stream from 'stream';
|
|
4
|
+
import utils from '../utils.js';
|
|
5
|
+
|
|
6
|
+
const kInternals = Symbol('internals');
|
|
7
|
+
|
|
8
|
+
class AxiosTransformStream extends stream.Transform {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
options = utils.toFlatObject(
|
|
11
|
+
options,
|
|
12
|
+
{
|
|
13
|
+
maxRate: 0,
|
|
14
|
+
chunkSize: 64 * 1024,
|
|
15
|
+
minChunkSize: 100,
|
|
16
|
+
timeWindow: 500,
|
|
17
|
+
ticksRate: 2,
|
|
18
|
+
samplesCount: 15,
|
|
19
|
+
},
|
|
20
|
+
null,
|
|
21
|
+
(prop, source) => {
|
|
22
|
+
return !utils.isUndefined(source[prop]);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
super({
|
|
27
|
+
readableHighWaterMark: options.chunkSize,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const internals = (this[kInternals] = {
|
|
31
|
+
timeWindow: options.timeWindow,
|
|
32
|
+
chunkSize: options.chunkSize,
|
|
33
|
+
maxRate: options.maxRate,
|
|
34
|
+
minChunkSize: options.minChunkSize,
|
|
35
|
+
bytesSeen: 0,
|
|
36
|
+
isCaptured: false,
|
|
37
|
+
notifiedBytesLoaded: 0,
|
|
38
|
+
ts: Date.now(),
|
|
39
|
+
bytes: 0,
|
|
40
|
+
onReadCallback: null,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
this.on('newListener', (event) => {
|
|
44
|
+
if (event === 'progress') {
|
|
45
|
+
if (!internals.isCaptured) {
|
|
46
|
+
internals.isCaptured = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
_read(size) {
|
|
53
|
+
const internals = this[kInternals];
|
|
54
|
+
|
|
55
|
+
if (internals.onReadCallback) {
|
|
56
|
+
internals.onReadCallback();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return super._read(size);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
_transform(chunk, encoding, callback) {
|
|
63
|
+
const internals = this[kInternals];
|
|
64
|
+
const maxRate = internals.maxRate;
|
|
65
|
+
|
|
66
|
+
const readableHighWaterMark = this.readableHighWaterMark;
|
|
67
|
+
|
|
68
|
+
const timeWindow = internals.timeWindow;
|
|
69
|
+
|
|
70
|
+
const divider = 1000 / timeWindow;
|
|
71
|
+
const bytesThreshold = maxRate / divider;
|
|
72
|
+
const minChunkSize =
|
|
73
|
+
internals.minChunkSize !== false
|
|
74
|
+
? Math.max(internals.minChunkSize, bytesThreshold * 0.01)
|
|
75
|
+
: 0;
|
|
76
|
+
|
|
77
|
+
const pushChunk = (_chunk, _callback) => {
|
|
78
|
+
const bytes = Buffer.byteLength(_chunk);
|
|
79
|
+
internals.bytesSeen += bytes;
|
|
80
|
+
internals.bytes += bytes;
|
|
81
|
+
|
|
82
|
+
internals.isCaptured && this.emit('progress', internals.bytesSeen);
|
|
83
|
+
|
|
84
|
+
if (this.push(_chunk)) {
|
|
85
|
+
process.nextTick(_callback);
|
|
86
|
+
} else {
|
|
87
|
+
internals.onReadCallback = () => {
|
|
88
|
+
internals.onReadCallback = null;
|
|
89
|
+
process.nextTick(_callback);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const transformChunk = (_chunk, _callback) => {
|
|
95
|
+
const chunkSize = Buffer.byteLength(_chunk);
|
|
96
|
+
let chunkRemainder = null;
|
|
97
|
+
let maxChunkSize = readableHighWaterMark;
|
|
98
|
+
let bytesLeft;
|
|
99
|
+
let passed = 0;
|
|
100
|
+
|
|
101
|
+
if (maxRate) {
|
|
102
|
+
const now = Date.now();
|
|
103
|
+
|
|
104
|
+
if (!internals.ts || (passed = now - internals.ts) >= timeWindow) {
|
|
105
|
+
internals.ts = now;
|
|
106
|
+
bytesLeft = bytesThreshold - internals.bytes;
|
|
107
|
+
internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
|
|
108
|
+
passed = 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
bytesLeft = bytesThreshold - internals.bytes;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (maxRate) {
|
|
115
|
+
if (bytesLeft <= 0) {
|
|
116
|
+
// next time window
|
|
117
|
+
return setTimeout(() => {
|
|
118
|
+
_callback(null, _chunk);
|
|
119
|
+
}, timeWindow - passed);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (bytesLeft < maxChunkSize) {
|
|
123
|
+
maxChunkSize = bytesLeft;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
|
|
128
|
+
chunkRemainder = _chunk.subarray(maxChunkSize);
|
|
129
|
+
_chunk = _chunk.subarray(0, maxChunkSize);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
pushChunk(
|
|
133
|
+
_chunk,
|
|
134
|
+
chunkRemainder
|
|
135
|
+
? () => {
|
|
136
|
+
process.nextTick(_callback, null, chunkRemainder);
|
|
137
|
+
}
|
|
138
|
+
: _callback
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
transformChunk(chunk, function transformNextChunk(err, _chunk) {
|
|
143
|
+
if (err) {
|
|
144
|
+
return callback(err);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (_chunk) {
|
|
148
|
+
transformChunk(_chunk, transformNextChunk);
|
|
149
|
+
} else {
|
|
150
|
+
callback(null);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export default AxiosTransformStream;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import toFormData from './toFormData.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* It encodes a string by replacing all characters that are not in the unreserved set with
|
|
7
|
+
* their percent-encoded equivalents
|
|
8
|
+
*
|
|
9
|
+
* @param {string} str - The string to encode.
|
|
10
|
+
*
|
|
11
|
+
* @returns {string} The encoded string.
|
|
12
|
+
*/
|
|
13
|
+
function encode(str) {
|
|
14
|
+
const charMap = {
|
|
15
|
+
'!': '%21',
|
|
16
|
+
"'": '%27',
|
|
17
|
+
'(': '%28',
|
|
18
|
+
')': '%29',
|
|
19
|
+
'~': '%7E',
|
|
20
|
+
'%20': '+',
|
|
21
|
+
};
|
|
22
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
|
|
23
|
+
return charMap[match];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* It takes a params object and converts it to a FormData object
|
|
29
|
+
*
|
|
30
|
+
* @param {Object<string, any>} params - The parameters to be converted to a FormData object.
|
|
31
|
+
* @param {Object<string, any>} options - The options object passed to the Axios constructor.
|
|
32
|
+
*
|
|
33
|
+
* @returns {void}
|
|
34
|
+
*/
|
|
35
|
+
function AxiosURLSearchParams(params, options) {
|
|
36
|
+
this._pairs = [];
|
|
37
|
+
|
|
38
|
+
params && toFormData(params, this, options);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const prototype = AxiosURLSearchParams.prototype;
|
|
42
|
+
|
|
43
|
+
prototype.append = function append(name, value) {
|
|
44
|
+
this._pairs.push([name, value]);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
prototype.toString = function toString(encoder) {
|
|
48
|
+
const _encode = encoder
|
|
49
|
+
? (value) => encoder.call(this, value, encode)
|
|
50
|
+
: encode;
|
|
51
|
+
|
|
52
|
+
return this._pairs
|
|
53
|
+
.map(function each(pair) {
|
|
54
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
55
|
+
}, '')
|
|
56
|
+
.join('&');
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default AxiosURLSearchParams;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Node-only: relies on the built-in `http2` module. Browser/react-native
|
|
4
|
+
// builds replace `lib/adapters/http.js` (the sole importer) with `lib/helpers/null.js`
|
|
5
|
+
// via the `browser` package.json field, so this module is never reached in
|
|
6
|
+
// those environments. Do not import it from any browser-reachable code path.
|
|
7
|
+
|
|
8
|
+
import http2 from 'http2';
|
|
9
|
+
import util from 'util';
|
|
10
|
+
|
|
11
|
+
class Http2Sessions {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.sessions = Object.create(null);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getSession(authority, options) {
|
|
17
|
+
options = Object.assign(
|
|
18
|
+
Object.create(null),
|
|
19
|
+
{
|
|
20
|
+
sessionTimeout: 1000,
|
|
21
|
+
},
|
|
22
|
+
options
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
let authoritySessions = this.sessions[authority];
|
|
26
|
+
|
|
27
|
+
if (authoritySessions) {
|
|
28
|
+
let len = authoritySessions.length;
|
|
29
|
+
|
|
30
|
+
for (let i = 0; i < len; i++) {
|
|
31
|
+
const [sessionHandle, sessionOptions] = authoritySessions[i];
|
|
32
|
+
if (
|
|
33
|
+
!sessionHandle.destroyed &&
|
|
34
|
+
!sessionHandle.closed &&
|
|
35
|
+
util.isDeepStrictEqual(sessionOptions, options)
|
|
36
|
+
) {
|
|
37
|
+
return sessionHandle;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const session = http2.connect(authority, options);
|
|
43
|
+
|
|
44
|
+
let removed;
|
|
45
|
+
let timer;
|
|
46
|
+
|
|
47
|
+
const removeSession = () => {
|
|
48
|
+
if (removed) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
removed = true;
|
|
53
|
+
|
|
54
|
+
if (timer) {
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
timer = null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let entries = authoritySessions,
|
|
60
|
+
len = entries.length,
|
|
61
|
+
i = len;
|
|
62
|
+
|
|
63
|
+
while (i--) {
|
|
64
|
+
if (entries[i][0] === session) {
|
|
65
|
+
if (len === 1) {
|
|
66
|
+
delete this.sessions[authority];
|
|
67
|
+
} else {
|
|
68
|
+
entries.splice(i, 1);
|
|
69
|
+
}
|
|
70
|
+
if (!session.closed) {
|
|
71
|
+
session.close();
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const originalRequestFn = session.request;
|
|
79
|
+
|
|
80
|
+
const { sessionTimeout } = options;
|
|
81
|
+
|
|
82
|
+
if (sessionTimeout != null) {
|
|
83
|
+
let streamsCount = 0;
|
|
84
|
+
|
|
85
|
+
session.request = function () {
|
|
86
|
+
const stream = originalRequestFn.apply(this, arguments);
|
|
87
|
+
|
|
88
|
+
streamsCount++;
|
|
89
|
+
|
|
90
|
+
if (timer) {
|
|
91
|
+
clearTimeout(timer);
|
|
92
|
+
timer = null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
stream.once('close', () => {
|
|
96
|
+
if (!--streamsCount) {
|
|
97
|
+
timer = setTimeout(() => {
|
|
98
|
+
timer = null;
|
|
99
|
+
removeSession();
|
|
100
|
+
}, sessionTimeout);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return stream;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
session.once('close', removeSession);
|
|
109
|
+
session.once('error', removeSession);
|
|
110
|
+
|
|
111
|
+
let entry = [session, options];
|
|
112
|
+
|
|
113
|
+
authoritySessions
|
|
114
|
+
? authoritySessions.push(entry)
|
|
115
|
+
: (authoritySessions = this.sessions[authority] = [entry]);
|
|
116
|
+
|
|
117
|
+
return session;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export default Http2Sessions;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const HttpStatusCode = {
|
|
2
|
+
Continue: 100,
|
|
3
|
+
SwitchingProtocols: 101,
|
|
4
|
+
Processing: 102,
|
|
5
|
+
EarlyHints: 103,
|
|
6
|
+
Ok: 200,
|
|
7
|
+
Created: 201,
|
|
8
|
+
Accepted: 202,
|
|
9
|
+
NonAuthoritativeInformation: 203,
|
|
10
|
+
NoContent: 204,
|
|
11
|
+
ResetContent: 205,
|
|
12
|
+
PartialContent: 206,
|
|
13
|
+
MultiStatus: 207,
|
|
14
|
+
AlreadyReported: 208,
|
|
15
|
+
ImUsed: 226,
|
|
16
|
+
MultipleChoices: 300,
|
|
17
|
+
MovedPermanently: 301,
|
|
18
|
+
Found: 302,
|
|
19
|
+
SeeOther: 303,
|
|
20
|
+
NotModified: 304,
|
|
21
|
+
UseProxy: 305,
|
|
22
|
+
Unused: 306,
|
|
23
|
+
TemporaryRedirect: 307,
|
|
24
|
+
PermanentRedirect: 308,
|
|
25
|
+
BadRequest: 400,
|
|
26
|
+
Unauthorized: 401,
|
|
27
|
+
PaymentRequired: 402,
|
|
28
|
+
Forbidden: 403,
|
|
29
|
+
NotFound: 404,
|
|
30
|
+
MethodNotAllowed: 405,
|
|
31
|
+
NotAcceptable: 406,
|
|
32
|
+
ProxyAuthenticationRequired: 407,
|
|
33
|
+
RequestTimeout: 408,
|
|
34
|
+
Conflict: 409,
|
|
35
|
+
Gone: 410,
|
|
36
|
+
LengthRequired: 411,
|
|
37
|
+
PreconditionFailed: 412,
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `ContentTooLarge` instead.
|
|
40
|
+
*/
|
|
41
|
+
PayloadTooLarge: 413,
|
|
42
|
+
ContentTooLarge: 413,
|
|
43
|
+
UriTooLong: 414,
|
|
44
|
+
UnsupportedMediaType: 415,
|
|
45
|
+
RangeNotSatisfiable: 416,
|
|
46
|
+
ExpectationFailed: 417,
|
|
47
|
+
ImATeapot: 418,
|
|
48
|
+
MisdirectedRequest: 421,
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use `UnprocessableContent` instead.
|
|
51
|
+
*/
|
|
52
|
+
UnprocessableEntity: 422,
|
|
53
|
+
UnprocessableContent: 422,
|
|
54
|
+
Locked: 423,
|
|
55
|
+
FailedDependency: 424,
|
|
56
|
+
TooEarly: 425,
|
|
57
|
+
UpgradeRequired: 426,
|
|
58
|
+
PreconditionRequired: 428,
|
|
59
|
+
TooManyRequests: 429,
|
|
60
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
61
|
+
UnavailableForLegalReasons: 451,
|
|
62
|
+
InternalServerError: 500,
|
|
63
|
+
NotImplemented: 501,
|
|
64
|
+
BadGateway: 502,
|
|
65
|
+
ServiceUnavailable: 503,
|
|
66
|
+
GatewayTimeout: 504,
|
|
67
|
+
HttpVersionNotSupported: 505,
|
|
68
|
+
VariantAlsoNegotiates: 506,
|
|
69
|
+
InsufficientStorage: 507,
|
|
70
|
+
LoopDetected: 508,
|
|
71
|
+
NotExtended: 510,
|
|
72
|
+
NetworkAuthenticationRequired: 511,
|
|
73
|
+
WebServerReturnsAnUnknownError: 520,
|
|
74
|
+
WebServerIsDown: 521,
|
|
75
|
+
ConnectionTimedOut: 522,
|
|
76
|
+
OriginIsUnreachable: 523,
|
|
77
|
+
TimeoutOccurred: 524,
|
|
78
|
+
SslHandshakeFailed: 525,
|
|
79
|
+
InvalidSslCertificate: 526,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
83
|
+
if (HttpStatusCode[value] === undefined) {
|
|
84
|
+
HttpStatusCode[value] = key;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
export default HttpStatusCode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# axios // helpers
|
|
2
|
+
|
|
3
|
+
The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like:
|
|
4
|
+
|
|
5
|
+
- Browser polyfills
|
|
6
|
+
- Managing cookies
|
|
7
|
+
- Parsing HTTP headers
|
package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import stream from 'stream';
|
|
4
|
+
|
|
5
|
+
class ZlibHeaderTransformStream extends stream.Transform {
|
|
6
|
+
__transform(chunk, encoding, callback) {
|
|
7
|
+
this.push(chunk);
|
|
8
|
+
callback();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
_transform(chunk, encoding, callback) {
|
|
12
|
+
if (chunk.length !== 0) {
|
|
13
|
+
this._transform = this.__transform;
|
|
14
|
+
|
|
15
|
+
// Add Default Compression headers if no zlib headers are present
|
|
16
|
+
if (chunk[0] !== 120) {
|
|
17
|
+
// Hex: 78
|
|
18
|
+
const header = Buffer.alloc(2);
|
|
19
|
+
header[0] = 120; // Hex: 78
|
|
20
|
+
header[1] = 156; // Hex: 9C
|
|
21
|
+
this.push(header, encoding);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
this.__transform(chunk, encoding, callback);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default ZlibHeaderTransformStream;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create a bound version of a function with a specified `this` context
|
|
5
|
+
*
|
|
6
|
+
* @param {Function} fn - The function to bind
|
|
7
|
+
* @param {*} thisArg - The value to be passed as the `this` parameter
|
|
8
|
+
* @returns {Function} A new function that will call the original function with the specified `this` context
|
|
9
|
+
*/
|
|
10
|
+
export default function bind(fn, thisArg) {
|
|
11
|
+
return function wrap() {
|
|
12
|
+
return fn.apply(thisArg, arguments);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
import AxiosURLSearchParams from './AxiosURLSearchParams.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
|
|
8
|
+
* their plain counterparts (`:`, `$`, `,`, `+`).
|
|
9
|
+
*
|
|
10
|
+
* @param {string} val The value to be encoded.
|
|
11
|
+
*
|
|
12
|
+
* @returns {string} The encoded value.
|
|
13
|
+
*/
|
|
14
|
+
export function encode(val) {
|
|
15
|
+
return encodeURIComponent(val)
|
|
16
|
+
.replace(/%3A/gi, ':')
|
|
17
|
+
.replace(/%24/g, '$')
|
|
18
|
+
.replace(/%2C/gi, ',')
|
|
19
|
+
.replace(/%20/g, '+');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Build a URL by appending params to the end
|
|
24
|
+
*
|
|
25
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
26
|
+
* @param {object} [params] The params to be appended
|
|
27
|
+
* @param {?(object|Function)} options
|
|
28
|
+
*
|
|
29
|
+
* @returns {string} The formatted url
|
|
30
|
+
*/
|
|
31
|
+
export default function buildURL(url, params, options) {
|
|
32
|
+
if (!params) {
|
|
33
|
+
return url;
|
|
34
|
+
}
|
|
35
|
+
url = url || '';
|
|
36
|
+
|
|
37
|
+
const _options = utils.isFunction(options)
|
|
38
|
+
? {
|
|
39
|
+
serialize: options,
|
|
40
|
+
}
|
|
41
|
+
: options;
|
|
42
|
+
|
|
43
|
+
// Read serializer options pollution-safely: own properties and methods on a
|
|
44
|
+
// class/template prototype are honored, but values injected onto a polluted
|
|
45
|
+
// Object.prototype are ignored.
|
|
46
|
+
const _encode = utils.getSafeProp(_options, 'encode') || encode;
|
|
47
|
+
const serializeFn = utils.getSafeProp(_options, 'serialize');
|
|
48
|
+
|
|
49
|
+
let serializedParams;
|
|
50
|
+
|
|
51
|
+
if (serializeFn) {
|
|
52
|
+
serializedParams = serializeFn(params, _options);
|
|
53
|
+
} else {
|
|
54
|
+
serializedParams = utils.isURLSearchParams(params)
|
|
55
|
+
? params.toString()
|
|
56
|
+
: new AxiosURLSearchParams(params, _options).toString(_encode);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (serializedParams) {
|
|
60
|
+
const hashmarkIndex = url.indexOf('#');
|
|
61
|
+
|
|
62
|
+
if (hashmarkIndex !== -1) {
|
|
63
|
+
url = url.slice(0, hashmarkIndex);
|
|
64
|
+
}
|
|
65
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return url;
|
|
69
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import utils from '../utils.js';
|
|
2
|
+
|
|
3
|
+
const callbackify = (fn, reducer) => {
|
|
4
|
+
return utils.isAsyncFn(fn)
|
|
5
|
+
? function (...args) {
|
|
6
|
+
const cb = args.pop();
|
|
7
|
+
fn.apply(this, args).then((value) => {
|
|
8
|
+
try {
|
|
9
|
+
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
|
10
|
+
} catch (err) {
|
|
11
|
+
cb(err);
|
|
12
|
+
}
|
|
13
|
+
}, cb);
|
|
14
|
+
}
|
|
15
|
+
: fn;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default callbackify;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new URL by combining the specified URLs
|
|
5
|
+
*
|
|
6
|
+
* @param {string} baseURL The base URL
|
|
7
|
+
* @param {string} relativeURL The relative URL
|
|
8
|
+
*
|
|
9
|
+
* @returns {string} The combined URL
|
|
10
|
+
*/
|
|
11
|
+
export default function combineURLs(baseURL, relativeURL) {
|
|
12
|
+
if (!relativeURL) {
|
|
13
|
+
return baseURL;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let end = baseURL.length;
|
|
17
|
+
|
|
18
|
+
while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {
|
|
19
|
+
end--;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\/+/, '');
|
|
23
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import CanceledError from '../cancel/CanceledError.js';
|
|
2
|
+
import AxiosError from '../core/AxiosError.js';
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
|
|
5
|
+
const composeSignals = (signals, timeout) => {
|
|
6
|
+
signals = signals ? signals.filter(Boolean) : [];
|
|
7
|
+
|
|
8
|
+
if (!timeout && !signals.length) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const controller = new AbortController();
|
|
13
|
+
|
|
14
|
+
let aborted = false;
|
|
15
|
+
|
|
16
|
+
const onabort = function (reason) {
|
|
17
|
+
if (!aborted) {
|
|
18
|
+
aborted = true;
|
|
19
|
+
unsubscribe();
|
|
20
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
21
|
+
controller.abort(
|
|
22
|
+
err instanceof AxiosError
|
|
23
|
+
? err
|
|
24
|
+
: new CanceledError(err instanceof Error ? err.message : err)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
let timer =
|
|
30
|
+
timeout &&
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
timer = null;
|
|
33
|
+
onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
|
|
34
|
+
}, timeout);
|
|
35
|
+
|
|
36
|
+
const unsubscribe = () => {
|
|
37
|
+
if (!signals) { return; }
|
|
38
|
+
timer && clearTimeout(timer);
|
|
39
|
+
timer = null;
|
|
40
|
+
signals.forEach((signal) => {
|
|
41
|
+
signal.unsubscribe
|
|
42
|
+
? signal.unsubscribe(onabort)
|
|
43
|
+
: signal.removeEventListener('abort', onabort);
|
|
44
|
+
});
|
|
45
|
+
signals = null;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
signals.forEach((signal) => {
|
|
49
|
+
if (aborted) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (signal.aborted) {
|
|
54
|
+
onabort.call(signal);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
signal.addEventListener('abort', onabort, { once: true });
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const { signal } = controller;
|
|
62
|
+
|
|
63
|
+
signal.unsubscribe = () => utils.asap(unsubscribe);
|
|
64
|
+
|
|
65
|
+
return signal;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default composeSignals;
|