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
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {createWriteStream} from 'node:fs';
|
|
2
1
|
import path from 'node:path';
|
|
3
2
|
import stream from 'node:stream';
|
|
4
3
|
import {text} from 'node:stream/consumers';
|
|
@@ -23,6 +22,8 @@ const ZIP_MAGIC = 'PK';
|
|
|
23
22
|
const IFMT = 0b1111000000000000;
|
|
24
23
|
const IFDIR = 0b0100000000000000;
|
|
25
24
|
const IFLNK = 0b1010000000000000;
|
|
25
|
+
// Limit traversal to stop symlink cycles.
|
|
26
|
+
const MAX_SYMLINK_TRAVERSALS = 40;
|
|
26
27
|
|
|
27
28
|
export interface ExtractAllOptions {
|
|
28
29
|
/**
|
|
@@ -94,7 +95,14 @@ interface ZipExtractorOptions {
|
|
|
94
95
|
defaultFileMode?: string;
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
type OpenReadStreamFn = (entry: yauzl.Entry) => Promise<
|
|
98
|
+
type OpenReadStreamFn = (entry: yauzl.Entry) => Promise<stream.Readable>;
|
|
99
|
+
|
|
100
|
+
interface SymlinkTarget {
|
|
101
|
+
linkTarget: string;
|
|
102
|
+
linkParentDir: string;
|
|
103
|
+
fileName: string;
|
|
104
|
+
missingPaths: Set<string>;
|
|
105
|
+
}
|
|
98
106
|
|
|
99
107
|
// This class is mostly copied from https://github.com/maxogden/extract-zip/blob/master/index.js
|
|
100
108
|
class ZipExtractor {
|
|
@@ -103,6 +111,8 @@ class ZipExtractor {
|
|
|
103
111
|
private readonly zipPath: string;
|
|
104
112
|
private readonly opts: ZipExtractorOptions;
|
|
105
113
|
private canceled = false;
|
|
114
|
+
// Normalized missing-path keys -> links to recheck when those paths become symlinks.
|
|
115
|
+
private readonly symlinkDependents = new Map<string, Set<SymlinkTarget>>();
|
|
106
116
|
|
|
107
117
|
constructor(sourcePath: string, opts: ZipExtractorOptions) {
|
|
108
118
|
this.zipPath = sourcePath;
|
|
@@ -154,8 +164,6 @@ class ZipExtractor {
|
|
|
154
164
|
return;
|
|
155
165
|
}
|
|
156
166
|
|
|
157
|
-
const {dir} = this.opts;
|
|
158
|
-
|
|
159
167
|
// convert external file attr int into a fs stat mode int
|
|
160
168
|
const mode = (entry.externalFileAttributes >> 16) & 0xffff;
|
|
161
169
|
// check if it's a symlink or dir (using stat mode constants)
|
|
@@ -170,77 +178,25 @@ class ZipExtractor {
|
|
|
170
178
|
const procMode = this.getExtractedMode(mode, isDir) & 0o777;
|
|
171
179
|
// always ensure folders are created
|
|
172
180
|
const destDir = isDir ? dest : path.dirname(dest);
|
|
173
|
-
const
|
|
181
|
+
const {dir} = this.opts;
|
|
182
|
+
const realDestDir = await ensureDirWithinRoot(dir, destDir, fileName, isDir ? procMode : undefined);
|
|
174
183
|
if (isDir) {
|
|
175
184
|
return;
|
|
176
185
|
}
|
|
177
186
|
|
|
178
|
-
const readStream = await this.openReadStream(entry);
|
|
179
187
|
if (isSymlink) {
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
if (!isContainedPath(resolvedLink, dir)) {
|
|
183
|
-
throw new Error(`Out of bound symlink target "${link}" found while processing file ${fileName}`);
|
|
184
|
-
}
|
|
185
|
-
await fs.symlink(link, dest);
|
|
188
|
+
const linkTarget = await text(await this.openReadStream(entry));
|
|
189
|
+
await this.createValidatedSymlink(linkTarget, dest, realDestDir, fileName);
|
|
186
190
|
} else {
|
|
187
|
-
await
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
private async ensureDirWithinRoot(dirPath: string, fileName: string, mode?: number): Promise<string> {
|
|
193
|
-
const {dir} = this.opts;
|
|
194
|
-
if (!isContainedPath(dirPath, dir)) {
|
|
195
|
-
throw new Error(`Out of bound path "${dirPath}" found while processing file ${fileName}`);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const relativePath = path.relative(dir, dirPath);
|
|
199
|
-
if (!relativePath) {
|
|
200
|
-
return dir;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
let currentPath = dir;
|
|
204
|
-
for (const segment of relativePath.split(path.sep)) {
|
|
205
|
-
currentPath = path.join(currentPath, segment);
|
|
191
|
+
await assertFileDestinationWithinRoot(dir, dest, realDestDir, fileName);
|
|
192
|
+
const readStream = await this.openReadStream(entry);
|
|
206
193
|
try {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (!stats.isDirectory() && !stats.isSymbolicLink()) {
|
|
212
|
-
throw new Error(`Cannot create a directory over existing file "${currentPath}"`);
|
|
213
|
-
}
|
|
214
|
-
} catch (err: any) {
|
|
215
|
-
if (err.code !== 'ENOENT') {
|
|
216
|
-
throw err;
|
|
217
|
-
}
|
|
218
|
-
await fs.mkdir(currentPath, {mode});
|
|
194
|
+
await writeFileNoFollow(readStream, dest, procMode);
|
|
195
|
+
} finally {
|
|
196
|
+
// Opening the output may fail before pipeline takes ownership of the input.
|
|
197
|
+
readStream.destroy();
|
|
219
198
|
}
|
|
220
199
|
}
|
|
221
|
-
|
|
222
|
-
const realPath = await fs.realpath(dirPath);
|
|
223
|
-
if (!isContainedPath(realPath, dir)) {
|
|
224
|
-
throw new Error(`Out of bound path "${dirPath}" found while processing file ${fileName}`);
|
|
225
|
-
}
|
|
226
|
-
return realPath;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
private async assertFileDestinationWithinRoot(dest: string, realDestDir: string, fileName: string): Promise<void> {
|
|
230
|
-
const {dir} = this.opts;
|
|
231
|
-
let realDest: string | null = null;
|
|
232
|
-
try {
|
|
233
|
-
realDest = await fs.realpath(dest);
|
|
234
|
-
} catch (err: any) {
|
|
235
|
-
if (err.code !== 'ENOENT') {
|
|
236
|
-
throw err;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
realDest = realDest ?? path.resolve(realDestDir, path.basename(dest));
|
|
241
|
-
if (!isContainedPath(realDest, dir)) {
|
|
242
|
-
throw new Error(`Out of bound path "${dest}" found while processing file ${fileName}`);
|
|
243
|
-
}
|
|
244
200
|
}
|
|
245
201
|
|
|
246
202
|
private getExtractedMode(entryMode: number, isDir: boolean): number {
|
|
@@ -270,6 +226,207 @@ class ZipExtractor {
|
|
|
270
226
|
|
|
271
227
|
return mode;
|
|
272
228
|
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Reject escaping targets or excessive traversal; return missing-path keys for later rechecks.
|
|
232
|
+
*/
|
|
233
|
+
private async validateSymlinkTarget(
|
|
234
|
+
linkTarget: string,
|
|
235
|
+
linkParentDir: string,
|
|
236
|
+
fileName: string,
|
|
237
|
+
): Promise<Set<string>> {
|
|
238
|
+
// Windows resolves drive-relative targets (`C:foo`) against the drive's CWD, not the link's parent
|
|
239
|
+
if (isWindows() && /^[A-Za-z]:/.test(linkTarget) && !path.win32.isAbsolute(linkTarget)) {
|
|
240
|
+
throw new Error(`Out of bound symlink target "${linkTarget}" found while processing file ${fileName}`);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Resolve links before '..'; realpath alone cannot handle missing targets.
|
|
244
|
+
const separator = isWindows() ? /[\\/]+/ : /\/+/;
|
|
245
|
+
const targetRoot = path.isAbsolute(linkTarget) ? path.parse(linkTarget).root : '';
|
|
246
|
+
let resolvedPath = targetRoot || linkParentDir;
|
|
247
|
+
const remainingSegments = linkTarget.slice(targetRoot.length).split(separator);
|
|
248
|
+
const missingPaths = new Set<string>();
|
|
249
|
+
let followedLinks = 0;
|
|
250
|
+
|
|
251
|
+
while (remainingSegments.length) {
|
|
252
|
+
const segment = remainingSegments.shift();
|
|
253
|
+
if (!segment || segment === '.') {
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
if (segment === '..') {
|
|
257
|
+
resolvedPath = path.dirname(resolvedPath);
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const candidatePath = path.join(resolvedPath, segment);
|
|
262
|
+
let nestedLinkTarget: string | null = null;
|
|
263
|
+
try {
|
|
264
|
+
const stats = await fs.lstat(candidatePath);
|
|
265
|
+
if (stats.isSymbolicLink()) {
|
|
266
|
+
nestedLinkTarget = await fs.readlink(candidatePath);
|
|
267
|
+
}
|
|
268
|
+
} catch (err: any) {
|
|
269
|
+
if (err.code !== 'ENOENT') {
|
|
270
|
+
throw err;
|
|
271
|
+
}
|
|
272
|
+
// An absent component may become a symlink in a later ZIP entry.
|
|
273
|
+
missingPaths.add(this.getSymlinkDependencyKey(candidatePath));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Advance past ordinary or missing components.
|
|
277
|
+
if (nestedLinkTarget === null) {
|
|
278
|
+
resolvedPath = candidatePath;
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
followedLinks += 1;
|
|
283
|
+
if (followedLinks > MAX_SYMLINK_TRAVERSALS) {
|
|
284
|
+
throw new Error(`Too many symlinks while processing file ${fileName}`);
|
|
285
|
+
}
|
|
286
|
+
// Resolve relative targets from the link's parent, absolute targets from their root.
|
|
287
|
+
if (path.isAbsolute(nestedLinkTarget)) {
|
|
288
|
+
resolvedPath = path.parse(nestedLinkTarget).root;
|
|
289
|
+
nestedLinkTarget = nestedLinkTarget.slice(resolvedPath.length);
|
|
290
|
+
}
|
|
291
|
+
remainingSegments.unshift(...nestedLinkTarget.split(separator));
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (!isContainedPath(resolvedPath, this.opts.dir)) {
|
|
295
|
+
throw new Error(`Out of bound symlink target "${linkTarget}" found while processing file ${fileName}`);
|
|
296
|
+
}
|
|
297
|
+
return missingPaths;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
private updateSymlinkDependencies(target: SymlinkTarget, missingPaths: Set<string>): void {
|
|
301
|
+
for (const missingPath of target.missingPaths) {
|
|
302
|
+
const dependents = this.symlinkDependents.get(missingPath);
|
|
303
|
+
dependents?.delete(target);
|
|
304
|
+
if (!dependents?.size) {
|
|
305
|
+
this.symlinkDependents.delete(missingPath);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
target.missingPaths = missingPaths;
|
|
309
|
+
for (const missingPath of missingPaths) {
|
|
310
|
+
let dependents = this.symlinkDependents.get(missingPath);
|
|
311
|
+
if (!dependents) {
|
|
312
|
+
dependents = new Set();
|
|
313
|
+
this.symlinkDependents.set(missingPath, dependents);
|
|
314
|
+
}
|
|
315
|
+
dependents.add(target);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
private async createValidatedSymlink(
|
|
320
|
+
linkTarget: string,
|
|
321
|
+
dest: string,
|
|
322
|
+
linkParentDir: string,
|
|
323
|
+
fileName: string,
|
|
324
|
+
): Promise<void> {
|
|
325
|
+
// Reject an escaping target before creating the link on disk.
|
|
326
|
+
await this.validateSymlinkTarget(linkTarget, linkParentDir, fileName);
|
|
327
|
+
await fs.symlink(linkTarget, dest);
|
|
328
|
+
try {
|
|
329
|
+
const target: SymlinkTarget = {linkTarget, linkParentDir, fileName, missingPaths: new Set()};
|
|
330
|
+
// Recheck for cycles and redirected forward references after creating the link.
|
|
331
|
+
const key = this.getSymlinkDependencyKey(path.join(linkParentDir, path.basename(dest)));
|
|
332
|
+
const affectedTargets = [target, ...(this.symlinkDependents.get(key) ?? [])];
|
|
333
|
+
for (const affectedTarget of affectedTargets) {
|
|
334
|
+
const missingPaths = await this.validateSymlinkTarget(
|
|
335
|
+
affectedTarget.linkTarget,
|
|
336
|
+
affectedTarget.linkParentDir,
|
|
337
|
+
affectedTarget.fileName,
|
|
338
|
+
);
|
|
339
|
+
this.updateSymlinkDependencies(affectedTarget, missingPaths);
|
|
340
|
+
}
|
|
341
|
+
} catch (err) {
|
|
342
|
+
// Roll back the link that invalidated a target.
|
|
343
|
+
await fs.unlink(dest);
|
|
344
|
+
throw err;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
private getSymlinkDependencyKey(absolutePath: string): string {
|
|
349
|
+
// Normalize keys, not filesystem paths. Collisions only cause extra checks.
|
|
350
|
+
return absolutePath.normalize('NFD').toLowerCase();
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
async function ensureDirWithinRoot(dir: string, dirPath: string, fileName: string, mode?: number): Promise<string> {
|
|
355
|
+
if (!isContainedPath(dirPath, dir)) {
|
|
356
|
+
throw new Error(`Out of bound path "${dirPath}" found while processing file ${fileName}`);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
const relativePath = path.relative(dir, dirPath);
|
|
360
|
+
if (!relativePath) {
|
|
361
|
+
return dir;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
let currentPath = dir;
|
|
365
|
+
for (const segment of relativePath.split(path.sep)) {
|
|
366
|
+
currentPath = path.join(currentPath, segment);
|
|
367
|
+
try {
|
|
368
|
+
const [stats, realPath] = await Promise.all([fs.lstat(currentPath), fs.realpath(currentPath)]);
|
|
369
|
+
if (!isContainedPath(realPath, dir)) {
|
|
370
|
+
throw new Error(`Out of bound path "${currentPath}" found while processing file ${fileName}`);
|
|
371
|
+
}
|
|
372
|
+
if (!stats.isDirectory() && !stats.isSymbolicLink()) {
|
|
373
|
+
throw new Error(`Cannot create a directory over existing file "${currentPath}"`);
|
|
374
|
+
}
|
|
375
|
+
} catch (err: any) {
|
|
376
|
+
if (err.code !== 'ENOENT') {
|
|
377
|
+
throw err;
|
|
378
|
+
}
|
|
379
|
+
await fs.mkdir(currentPath, {mode});
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const realPath = await fs.realpath(dirPath);
|
|
384
|
+
if (!isContainedPath(realPath, dir)) {
|
|
385
|
+
throw new Error(`Out of bound path "${dirPath}" found while processing file ${fileName}`);
|
|
386
|
+
}
|
|
387
|
+
return realPath;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
async function assertFileDestinationWithinRoot(
|
|
391
|
+
dir: string,
|
|
392
|
+
dest: string,
|
|
393
|
+
realDestDir: string,
|
|
394
|
+
fileName: string,
|
|
395
|
+
): Promise<void> {
|
|
396
|
+
let realDest: string | null = null;
|
|
397
|
+
try {
|
|
398
|
+
if ((await fs.lstat(dest)).isSymbolicLink()) {
|
|
399
|
+
throw new Error(`Cannot write a file over existing symlink "${dest}"`);
|
|
400
|
+
}
|
|
401
|
+
realDest = await fs.realpath(dest);
|
|
402
|
+
} catch (err: any) {
|
|
403
|
+
if (err.code !== 'ENOENT') {
|
|
404
|
+
throw err;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
realDest = realDest ?? path.resolve(realDestDir, path.basename(dest));
|
|
409
|
+
if (!isContainedPath(realDest, dir)) {
|
|
410
|
+
throw new Error(`Out of bound path "${dest}" found while processing file ${fileName}`);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
async function writeFileNoFollow(readStream: stream.Readable, dest: string, mode: number): Promise<void> {
|
|
415
|
+
const flags =
|
|
416
|
+
fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_TRUNC | (isWindows() ? 0 : fs.constants.O_NOFOLLOW);
|
|
417
|
+
let file;
|
|
418
|
+
try {
|
|
419
|
+
file = await fs.openFile(dest, flags, mode);
|
|
420
|
+
} catch (err) {
|
|
421
|
+
// pipeline has not taken ownership of the input yet
|
|
422
|
+
readStream.destroy();
|
|
423
|
+
throw err;
|
|
424
|
+
}
|
|
425
|
+
try {
|
|
426
|
+
await pipeline(readStream, file.createWriteStream());
|
|
427
|
+
} finally {
|
|
428
|
+
await file.close();
|
|
429
|
+
}
|
|
273
430
|
}
|
|
274
431
|
|
|
275
432
|
/**
|
|
@@ -322,16 +479,19 @@ export async function _extractEntryTo(
|
|
|
322
479
|
throw new Error(`Out of bound path "${dstPath}" found while processing file ${fileName}`);
|
|
323
480
|
}
|
|
324
481
|
|
|
482
|
+
// Same symlink-safe directory/file handling as in ZipExtractor
|
|
483
|
+
await fs.mkdirp(destDir);
|
|
484
|
+
const dir = await fs.realpath(destDir);
|
|
485
|
+
const dest = path.resolve(dir, path.relative(destDir, dstPath));
|
|
325
486
|
if (fileName.endsWith('/')) {
|
|
326
|
-
|
|
327
|
-
await fs.mkdirp(dstPath);
|
|
328
|
-
}
|
|
487
|
+
await ensureDirWithinRoot(dir, dest, fileName);
|
|
329
488
|
return;
|
|
330
489
|
}
|
|
331
|
-
await
|
|
490
|
+
const realDestDir = await ensureDirWithinRoot(dir, path.dirname(dest), fileName);
|
|
491
|
+
await assertFileDestinationWithinRoot(dir, dest, realDestDir, fileName);
|
|
332
492
|
|
|
333
493
|
const readStream = await openReadStream(entry);
|
|
334
|
-
await
|
|
494
|
+
await writeFileNoFollow(readStream, dest, 0o666);
|
|
335
495
|
}
|
|
336
496
|
|
|
337
497
|
/**
|