appium-mac2-driver 4.3.5 → 4.4.0
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 +12 -0
- package/WebDriverAgentMac/IntegrationTests/AMSessionTests.m +14 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Commands/FBSessionCommands.m +17 -5
- package/WebDriverAgentMac/WebDriverAgentLib/Routing/FBSession.m +5 -1
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/FBXPath.m +48 -2
- package/WebDriverAgentMac/WebDriverAgentMac.xcodeproj/project.pbxproj +4 -0
- package/build/lib/driver.d.ts +3 -0
- package/build/lib/driver.d.ts.map +1 -1
- package/build/lib/driver.js +52 -32
- package/build/lib/driver.js.map +1 -1
- package/build/lib/session-claim-handler.d.ts +41 -0
- package/build/lib/session-claim-handler.d.ts.map +1 -0
- package/build/lib/session-claim-handler.js +236 -0
- package/build/lib/session-claim-handler.js.map +1 -0
- package/build/lib/wda-mac.d.ts +6 -2
- package/build/lib/wda-mac.d.ts.map +1 -1
- package/build/lib/wda-mac.js +43 -14
- package/build/lib/wda-mac.js.map +1 -1
- package/lib/driver.ts +55 -31
- package/lib/session-claim-handler.ts +306 -0
- package/lib/wda-mac.ts +45 -15
- package/node_modules/@appium/logger/CHANGELOG.md +8 -0
- package/node_modules/@appium/logger/package.json +3 -3
- package/node_modules/@appium/strongbox/build/lib/index.d.ts.map +1 -1
- package/node_modules/@appium/strongbox/build/lib/index.js +6 -1
- package/node_modules/@appium/strongbox/build/lib/index.js.map +1 -1
- package/node_modules/@appium/strongbox/lib/index.ts +6 -1
- package/node_modules/@appium/strongbox/package.json +2 -2
- package/node_modules/@appium/support/build/lib/fs.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/fs.js +7 -0
- package/node_modules/@appium/support/build/lib/fs.js.map +1 -1
- package/node_modules/@appium/support/build/lib/index.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/net.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/net.js +6 -2
- package/node_modules/@appium/support/build/lib/net.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 +10 -4
- package/node_modules/@appium/support/build/lib/util.js.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.js +2 -7
- package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
- package/node_modules/@appium/support/lib/fs.ts +8 -1
- package/node_modules/@appium/support/lib/net.ts +7 -2
- package/node_modules/@appium/support/lib/util.ts +9 -3
- package/node_modules/@appium/support/lib/zip.ts +3 -9
- package/node_modules/@appium/support/package.json +9 -9
- package/node_modules/@appium/types/package.json +4 -4
- package/node_modules/@img/sharp-darwin-arm64/index.cjs +1 -1
- package/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.5.node +0 -0
- package/node_modules/@img/sharp-darwin-arm64/package.json +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/README.md +1 -1
- package/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/lib/{libvips-cpp.8.18.6.dylib → libvips-cpp.8.18.7.dylib} +0 -0
- package/node_modules/@img/sharp-libvips-darwin-arm64/package.json +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +11 -11
- package/node_modules/appium-xcode/CHANGELOG.md +35 -0
- package/node_modules/appium-xcode/README.md +1 -1
- package/node_modules/appium-xcode/package.json +14 -18
- package/node_modules/async-lock/AUTHORS +21 -0
- package/node_modules/async-lock/History.md +132 -0
- package/node_modules/async-lock/LICENSE +22 -0
- package/node_modules/async-lock/README.md +177 -0
- package/node_modules/async-lock/index.js +2 -0
- package/node_modules/async-lock/lib/index.js +312 -0
- package/node_modules/async-lock/package.json +48 -0
- package/node_modules/b4a/browser.js +5 -0
- package/node_modules/b4a/index.d.ts +144 -0
- package/node_modules/b4a/index.js +5 -0
- package/node_modules/b4a/package.json +4 -1
- package/node_modules/b4a/runtime.d.ts +14 -0
- package/node_modules/bare-fs/binding.c +52 -23
- package/node_modules/bare-fs/index.d.ts +12 -10
- package/node_modules/bare-fs/index.js +43 -10
- package/node_modules/bare-fs/package.json +2 -1
- package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
- package/node_modules/bplist-creator/README.md +26 -6
- package/node_modules/bplist-creator/dist/index.cjs +508 -0
- package/node_modules/bplist-creator/dist/index.cjs.map +7 -0
- package/node_modules/bplist-creator/dist/index.d.cts +12 -0
- package/node_modules/bplist-creator/dist/index.d.ts +12 -0
- package/node_modules/bplist-creator/dist/index.mjs +472 -0
- package/node_modules/bplist-creator/dist/index.mjs.map +7 -0
- package/node_modules/bplist-creator/package.json +43 -9
- package/node_modules/bplist-parser/README.md +37 -3
- package/node_modules/bplist-parser/dist/index.cjs +385 -0
- package/node_modules/bplist-parser/dist/index.cjs.map +7 -0
- package/node_modules/bplist-parser/dist/index.d.cts +13 -0
- package/node_modules/bplist-parser/dist/index.d.ts +13 -0
- package/node_modules/bplist-parser/{bplistParser.js → dist/index.mjs} +141 -171
- package/node_modules/bplist-parser/dist/index.mjs.map +7 -0
- package/node_modules/bplist-parser/package.json +39 -12
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts +4 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js +69 -25
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.d.ts +4 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +68 -24
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +2 -1
- package/node_modules/follow-redirects/index.js +10 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.js.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.d.ts +5 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.js +7 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts +1400 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.js +1733 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.js.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts +12 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.js +10 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.d.ts +5 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.js +4 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.d.ts +1400 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.js +1729 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.d.ts +12 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.js +7 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.js.map +1 -0
- package/node_modules/lru-cache/package.json +27 -1
- package/node_modules/p-limit/index.d.ts +2 -0
- package/node_modules/p-limit/index.js +17 -1
- package/node_modules/p-limit/package.json +1 -1
- package/node_modules/p-limit/readme.md +2 -0
- package/node_modules/readable-stream/lib/internal/shims/process.js +19 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/duplexify.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/from.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/legacy.js +6 -1
- package/node_modules/readable-stream/lib/internal/streams/pipeline.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/readable.js +1 -1
- package/node_modules/readable-stream/lib/internal/streams/writable.js +1 -1
- package/node_modules/readable-stream/package.json +3 -2
- package/node_modules/sharp/dist/index.d.cts +2 -2
- package/node_modules/sharp/dist/index.d.mts +3 -3
- package/node_modules/sharp/dist/is.cjs +8 -2
- package/node_modules/sharp/dist/is.mjs +8 -2
- package/node_modules/sharp/dist/operation.cjs +2 -2
- package/node_modules/sharp/dist/operation.mjs +2 -2
- package/node_modules/sharp/dist/output.cjs +1 -0
- package/node_modules/sharp/dist/output.mjs +1 -0
- package/node_modules/sharp/dist/resize.cjs +14 -14
- package/node_modules/sharp/dist/resize.mjs +14 -14
- package/node_modules/sharp/dist/sharp.cjs +3 -3
- package/node_modules/sharp/dist/sharp.mjs +3 -3
- package/node_modules/sharp/lib/index.d.ts +2 -2
- package/node_modules/sharp/package.json +35 -35
- package/node_modules/sharp/src/binding.gyp +1 -1
- package/node_modules/sharp/src/common.cc +4 -4
- package/node_modules/sharp/src/common.h +2 -2
- package/node_modules/sharp/src/pipeline.cc +31 -6
- package/node_modules/sharp/src/utilities.cc +1 -1
- package/node_modules/spdx-license-ids/index.json +13 -0
- package/node_modules/spdx-license-ids/package.json +1 -1
- package/node_modules/stream-buffers/.codeclimate.yml +12 -0
- package/node_modules/stream-buffers/.eslintignore +1 -0
- package/node_modules/stream-buffers/.eslintrc +25 -0
- package/node_modules/stream-buffers/.github/workflows/codeql-analysis.yml +71 -0
- package/node_modules/stream-buffers/.github/workflows/node.js.yml +31 -0
- package/node_modules/stream-buffers/.mailmap +1 -0
- package/node_modules/stream-buffers/.nvmrc +1 -0
- package/node_modules/stream-buffers/README.md +65 -65
- package/node_modules/stream-buffers/lib/constants.js +8 -6
- package/node_modules/stream-buffers/lib/readable_streambuffer.js +114 -136
- package/node_modules/stream-buffers/lib/streambuffer.js +5 -3
- package/node_modules/stream-buffers/lib/writable_streambuffer.js +72 -97
- package/node_modules/stream-buffers/package.json +7 -5
- package/node_modules/tar-stream/package.json +7 -7
- package/node_modules/type-fest/index.d.ts +7 -7
- package/node_modules/type-fest/package.json +2 -1
- package/node_modules/type-fest/readme.md +7 -16
- package/node_modules/type-fest/source/all-extend.d.ts +9 -7
- package/node_modules/type-fest/source/array-reverse.d.ts +13 -12
- package/node_modules/type-fest/source/array-tail.d.ts +3 -3
- package/node_modules/type-fest/source/delimiter-case.d.ts +1 -1
- package/node_modules/type-fest/source/get.d.ts +1 -1
- package/node_modules/type-fest/source/int-closed-range.d.ts +4 -1
- package/node_modules/type-fest/source/int-range.d.ts +56 -9
- package/node_modules/type-fest/source/internal/array.d.ts +14 -13
- package/node_modules/type-fest/source/internal/numeric.d.ts +0 -38
- package/node_modules/type-fest/source/internal/object.d.ts +30 -1
- package/node_modules/type-fest/source/is-boolean-literal.d.ts +39 -0
- package/node_modules/type-fest/source/is-literal.d.ts +43 -269
- package/node_modules/type-fest/source/is-numeric-literal.d.ts +50 -0
- package/node_modules/type-fest/source/is-string-literal.d.ts +72 -0
- package/node_modules/type-fest/source/is-symbol-literal.d.ts +39 -0
- package/node_modules/type-fest/source/is-tuple.d.ts +3 -3
- package/node_modules/type-fest/source/jsonify.d.ts +1 -5
- package/node_modules/type-fest/source/merge-deep.d.ts +3 -3
- package/node_modules/type-fest/source/remove-prefix.d.ts +1 -1
- package/node_modules/type-fest/source/remove-suffix.d.ts +1 -1
- package/node_modules/type-fest/source/rename-keys.d.ts +163 -0
- package/node_modules/type-fest/source/set-required.d.ts +10 -9
- package/node_modules/type-fest/source/shared-union-fields-deep.d.ts +6 -4
- package/node_modules/type-fest/source/some-extend.d.ts +9 -7
- package/node_modules/type-fest/source/split-on-rest-element.d.ts +14 -13
- package/node_modules/type-fest/source/split.d.ts +22 -11
- package/node_modules/type-fest/source/string-repeat.d.ts +1 -1
- package/node_modules/type-fest/source/string-to-array.d.ts +1 -1
- package/node_modules/type-fest/source/tsconfig-json.d.ts +1 -1
- package/node_modules/type-fest/source/typed-array.d.ts +6 -0
- package/node_modules/type-fest/source/union-max.d.ts +56 -0
- package/node_modules/type-fest/source/writable.d.ts +2 -2
- package/package.json +5 -3
- package/node_modules/@appium/support/node_modules/asyncbox/LICENSE +0 -203
- package/node_modules/@appium/support/node_modules/asyncbox/README.md +0 -215
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -301
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts +0 -84
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/package.json +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -288
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts +0 -84
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js +0 -2
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/package.json +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/lib/asyncbox.ts +0 -365
- package/node_modules/@appium/support/node_modules/asyncbox/lib/types.ts +0 -88
- package/node_modules/@appium/support/node_modules/asyncbox/package.json +0 -74
- package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +0 -1872
- package/node_modules/@appium/support/node_modules/axios/LICENSE +0 -7
- package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +0 -877
- package/node_modules/@appium/support/node_modules/axios/README.md +0 -2623
- package/node_modules/@appium/support/node_modules/axios/dist/axios.js +0 -5509
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +0 -5
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +0 -1
- package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +0 -5469
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +0 -5490
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +0 -1
- package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +0 -6356
- package/node_modules/@appium/support/node_modules/axios/index.d.cts +0 -762
- package/node_modules/@appium/support/node_modules/axios/index.d.ts +0 -783
- package/node_modules/@appium/support/node_modules/axios/index.js +0 -45
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +0 -36
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +0 -132
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +0 -643
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +0 -1406
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +0 -228
- package/node_modules/@appium/support/node_modules/axios/lib/axios.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +0 -135
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +0 -22
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +0 -5
- package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +0 -301
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +0 -219
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +0 -474
- package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +0 -72
- package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +0 -8
- package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +0 -88
- package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +0 -174
- package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +0 -27
- package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +0 -27
- package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +0 -28
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +0 -177
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +0 -10
- package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +0 -2
- package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +0 -1
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -156
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -59
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +0 -119
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -78
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +0 -7
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -29
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +0 -14
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +0 -69
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +0 -18
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +0 -23
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +0 -68
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +0 -64
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -31
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +0 -166
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +0 -125
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +0 -119
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +0 -68
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -19
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +0 -2
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +0 -71
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +0 -54
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +0 -15
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +0 -105
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +0 -60
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +0 -329
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +0 -55
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +0 -28
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +0 -44
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +0 -286
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +0 -112
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -4
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +0 -13
- package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +0 -52
- package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +0 -7
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +0 -11
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -4
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +0 -37
- package/node_modules/@appium/support/node_modules/axios/lib/utils.js +0 -1029
- package/node_modules/@appium/support/node_modules/axios/package.json +0 -203
- package/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.4.node +0 -0
- package/node_modules/big-integer/BigInteger.d.ts +0 -2393
- package/node_modules/big-integer/BigInteger.js +0 -1453
- package/node_modules/big-integer/BigInteger.min.js +0 -1
- package/node_modules/big-integer/LICENSE +0 -24
- package/node_modules/big-integer/README.md +0 -589
- package/node_modules/big-integer/bower.json +0 -29
- package/node_modules/big-integer/package.json +0 -48
- package/node_modules/big-integer/tsconfig.json +0 -24
- package/node_modules/bplist-creator/bplistCreator.d.ts +0 -8
- package/node_modules/bplist-creator/bplistCreator.js +0 -460
- package/node_modules/bplist-creator/test/airplay.bplist +0 -0
- package/node_modules/bplist-creator/test/binaryData.bplist +0 -0
- package/node_modules/bplist-creator/test/creatorTest.js +0 -211
- package/node_modules/bplist-creator/test/iTunes-small.bplist +0 -0
- package/node_modules/bplist-creator/test/integers.bplist +0 -0
- package/node_modules/bplist-creator/test/sample1.bplist +0 -0
- package/node_modules/bplist-creator/test/sample2.bplist +0 -0
- package/node_modules/bplist-creator/test/uid.bplist +0 -0
- package/node_modules/bplist-creator/test/utf16.bplist +0 -0
- package/node_modules/bplist-parser/.editorconfig +0 -12
- package/node_modules/bplist-parser/.eslintignore +0 -1
- package/node_modules/bplist-parser/.eslintrc.js +0 -296
- package/node_modules/bplist-parser/bplistParser.d.ts +0 -8
- package/node_modules/stream-buffers/.travis.yml +0 -28
- package/node_modules/stream-buffers/coverage/coverage.json +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/base.css +0 -182
- package/node_modules/stream-buffers/coverage/lcov-report/index.html +0 -73
- package/node_modules/stream-buffers/coverage/lcov-report/lib/constants.js.html +0 -63
- package/node_modules/stream-buffers/coverage/lcov-report/lib/index.html +0 -112
- package/node_modules/stream-buffers/coverage/lcov-report/lib/readable_streambuffer.js.html +0 -453
- package/node_modules/stream-buffers/coverage/lcov-report/lib/streambuffer.js.html +0 -54
- package/node_modules/stream-buffers/coverage/lcov-report/lib/writable_streambuffer.js.html +0 -336
- package/node_modules/stream-buffers/coverage/lcov-report/prettify.css +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/prettify.js +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/node_modules/stream-buffers/coverage/lcov-report/sorter.js +0 -156
- package/node_modules/stream-buffers/coverage/lcov.info +0 -305
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import utils from '../utils.js';
|
|
2
|
-
import settle from '../core/settle.js';
|
|
3
|
-
import transitionalDefaults from '../defaults/transitional.js';
|
|
4
|
-
import AxiosError from '../core/AxiosError.js';
|
|
5
|
-
import CanceledError from '../cancel/CanceledError.js';
|
|
6
|
-
import parseProtocol from '../helpers/parseProtocol.js';
|
|
7
|
-
import platform from '../platform/index.js';
|
|
8
|
-
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
9
|
-
import { progressEventReducer } from '../helpers/progressEventReducer.js';
|
|
10
|
-
import resolveConfig from '../helpers/resolveConfig.js';
|
|
11
|
-
import { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';
|
|
12
|
-
|
|
13
|
-
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
14
|
-
|
|
15
|
-
export default isXHRAdapterSupported &&
|
|
16
|
-
function (config) {
|
|
17
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
18
|
-
const _config = resolveConfig(config);
|
|
19
|
-
let requestData = _config.data;
|
|
20
|
-
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
|
21
|
-
let { responseType, onUploadProgress, onDownloadProgress } = _config;
|
|
22
|
-
let onCanceled;
|
|
23
|
-
let uploadThrottled, downloadThrottled;
|
|
24
|
-
let flushUpload, flushDownload;
|
|
25
|
-
|
|
26
|
-
function done() {
|
|
27
|
-
flushUpload && flushUpload(); // flush events
|
|
28
|
-
flushDownload && flushDownload(); // flush events
|
|
29
|
-
|
|
30
|
-
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
31
|
-
|
|
32
|
-
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
let request = new XMLHttpRequest();
|
|
36
|
-
|
|
37
|
-
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
38
|
-
|
|
39
|
-
// Set the request timeout in MS
|
|
40
|
-
request.timeout = _config.timeout;
|
|
41
|
-
|
|
42
|
-
function onloadend() {
|
|
43
|
-
if (!request) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
// Prepare the response
|
|
47
|
-
const responseHeaders = AxiosHeaders.from(
|
|
48
|
-
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
|
|
49
|
-
);
|
|
50
|
-
const responseData =
|
|
51
|
-
!responseType || responseType === 'text' || responseType === 'json'
|
|
52
|
-
? request.responseText
|
|
53
|
-
: request.response;
|
|
54
|
-
const response = {
|
|
55
|
-
data: responseData,
|
|
56
|
-
status: request.status,
|
|
57
|
-
statusText: request.statusText,
|
|
58
|
-
headers: responseHeaders,
|
|
59
|
-
config,
|
|
60
|
-
request,
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
settle(
|
|
64
|
-
function _resolve(value) {
|
|
65
|
-
resolve(value);
|
|
66
|
-
done();
|
|
67
|
-
},
|
|
68
|
-
function _reject(err) {
|
|
69
|
-
reject(err);
|
|
70
|
-
done();
|
|
71
|
-
},
|
|
72
|
-
response
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
// Clean up request
|
|
76
|
-
request = null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if ('onloadend' in request) {
|
|
80
|
-
// Use onloadend if available
|
|
81
|
-
request.onloadend = onloadend;
|
|
82
|
-
} else {
|
|
83
|
-
// Listen for ready state to emulate onloadend
|
|
84
|
-
request.onreadystatechange = function handleLoad() {
|
|
85
|
-
if (!request || request.readyState !== 4) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// The request errored out and we didn't get a response, this will be
|
|
90
|
-
// handled by onerror instead
|
|
91
|
-
// With one exception: request that using file: protocol, most browsers
|
|
92
|
-
// will return status as 0 even though it's a successful request
|
|
93
|
-
if (
|
|
94
|
-
request.status === 0 &&
|
|
95
|
-
!(request.responseURL && request.responseURL.startsWith('file:'))
|
|
96
|
-
) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
// readystate handler is calling before onerror or ontimeout handlers,
|
|
100
|
-
// so we should call onloadend on the next 'tick'
|
|
101
|
-
setTimeout(onloadend);
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// Handle browser request cancellation (as opposed to a manual cancellation)
|
|
106
|
-
request.onabort = function handleAbort() {
|
|
107
|
-
if (!request) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
|
112
|
-
done();
|
|
113
|
-
|
|
114
|
-
// Clean up request
|
|
115
|
-
request = null;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
// Handle low level network errors
|
|
119
|
-
request.onerror = function handleError(event) {
|
|
120
|
-
// Browsers deliver a ProgressEvent in XHR onerror
|
|
121
|
-
// (message may be empty; when present, surface it)
|
|
122
|
-
// See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
|
|
123
|
-
const msg = event && event.message ? event.message : 'Network Error';
|
|
124
|
-
const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
|
|
125
|
-
// attach the underlying event for consumers who want details
|
|
126
|
-
err.event = event || null;
|
|
127
|
-
reject(err);
|
|
128
|
-
done();
|
|
129
|
-
request = null;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
// Handle timeout
|
|
133
|
-
request.ontimeout = function handleTimeout() {
|
|
134
|
-
let timeoutErrorMessage = _config.timeout
|
|
135
|
-
? 'timeout of ' + _config.timeout + 'ms exceeded'
|
|
136
|
-
: 'timeout exceeded';
|
|
137
|
-
const transitional = _config.transitional || transitionalDefaults;
|
|
138
|
-
if (_config.timeoutErrorMessage) {
|
|
139
|
-
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
140
|
-
}
|
|
141
|
-
reject(
|
|
142
|
-
new AxiosError(
|
|
143
|
-
timeoutErrorMessage,
|
|
144
|
-
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
|
145
|
-
config,
|
|
146
|
-
request
|
|
147
|
-
)
|
|
148
|
-
);
|
|
149
|
-
done();
|
|
150
|
-
|
|
151
|
-
// Clean up request
|
|
152
|
-
request = null;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
// Remove Content-Type if data is undefined
|
|
156
|
-
requestData === undefined && requestHeaders.setContentType(null);
|
|
157
|
-
|
|
158
|
-
// Add headers to the request
|
|
159
|
-
if ('setRequestHeader' in request) {
|
|
160
|
-
utils.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
|
|
161
|
-
request.setRequestHeader(key, val);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Add withCredentials to request if needed
|
|
166
|
-
if (!utils.isUndefined(_config.withCredentials)) {
|
|
167
|
-
request.withCredentials = !!_config.withCredentials;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// Add responseType to request if needed
|
|
171
|
-
if (responseType && responseType !== 'json') {
|
|
172
|
-
request.responseType = _config.responseType;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// Handle progress if needed
|
|
176
|
-
if (onDownloadProgress) {
|
|
177
|
-
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
178
|
-
request.addEventListener('progress', downloadThrottled);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// Not all browsers support upload events
|
|
182
|
-
if (onUploadProgress && request.upload) {
|
|
183
|
-
[uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
|
|
184
|
-
|
|
185
|
-
request.upload.addEventListener('progress', uploadThrottled);
|
|
186
|
-
|
|
187
|
-
request.upload.addEventListener('loadend', flushUpload);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (_config.cancelToken || _config.signal) {
|
|
191
|
-
// Handle cancellation
|
|
192
|
-
// eslint-disable-next-line func-names
|
|
193
|
-
onCanceled = (cancel) => {
|
|
194
|
-
if (!request) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
|
|
198
|
-
request.abort();
|
|
199
|
-
done();
|
|
200
|
-
request = null;
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
204
|
-
if (_config.signal) {
|
|
205
|
-
_config.signal.aborted
|
|
206
|
-
? onCanceled()
|
|
207
|
-
: _config.signal.addEventListener('abort', onCanceled);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const protocol = parseProtocol(_config.url);
|
|
212
|
-
|
|
213
|
-
if (protocol && !platform.protocols.includes(protocol)) {
|
|
214
|
-
reject(
|
|
215
|
-
new AxiosError(
|
|
216
|
-
'Unsupported protocol ' + protocol + ':',
|
|
217
|
-
AxiosError.ERR_BAD_REQUEST,
|
|
218
|
-
config
|
|
219
|
-
)
|
|
220
|
-
);
|
|
221
|
-
done();
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Send the request
|
|
226
|
-
request.send(requestData || null);
|
|
227
|
-
});
|
|
228
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import utils from './utils.js';
|
|
4
|
-
import bind from './helpers/bind.js';
|
|
5
|
-
import Axios from './core/Axios.js';
|
|
6
|
-
import mergeConfig from './core/mergeConfig.js';
|
|
7
|
-
import defaults from './defaults/index.js';
|
|
8
|
-
import formDataToJSON from './helpers/formDataToJSON.js';
|
|
9
|
-
import CanceledError from './cancel/CanceledError.js';
|
|
10
|
-
import CancelToken from './cancel/CancelToken.js';
|
|
11
|
-
import isCancel from './cancel/isCancel.js';
|
|
12
|
-
import { VERSION } from './env/data.js';
|
|
13
|
-
import toFormData from './helpers/toFormData.js';
|
|
14
|
-
import AxiosError from './core/AxiosError.js';
|
|
15
|
-
import spread from './helpers/spread.js';
|
|
16
|
-
import isAxiosError from './helpers/isAxiosError.js';
|
|
17
|
-
import AxiosHeaders from './core/AxiosHeaders.js';
|
|
18
|
-
import adapters from './adapters/adapters.js';
|
|
19
|
-
import HttpStatusCode from './helpers/HttpStatusCode.js';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Create an instance of Axios
|
|
23
|
-
*
|
|
24
|
-
* @param {Object} defaultConfig The default config for the instance
|
|
25
|
-
*
|
|
26
|
-
* @returns {Axios} A new instance of Axios
|
|
27
|
-
*/
|
|
28
|
-
function createInstance(defaultConfig) {
|
|
29
|
-
const context = new Axios(defaultConfig);
|
|
30
|
-
const instance = bind(Axios.prototype.request, context);
|
|
31
|
-
|
|
32
|
-
// Copy axios.prototype to instance
|
|
33
|
-
utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });
|
|
34
|
-
|
|
35
|
-
// Copy context to instance
|
|
36
|
-
utils.extend(instance, context, null, { allOwnKeys: true });
|
|
37
|
-
|
|
38
|
-
// Factory for creating new instances
|
|
39
|
-
instance.create = function create(instanceConfig) {
|
|
40
|
-
return createInstance(mergeConfig(defaultConfig, instanceConfig));
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return instance;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Create the default instance to be exported
|
|
47
|
-
const axios = createInstance(defaults);
|
|
48
|
-
|
|
49
|
-
// Expose Axios class to allow class inheritance
|
|
50
|
-
axios.Axios = Axios;
|
|
51
|
-
|
|
52
|
-
// Expose Cancel & CancelToken
|
|
53
|
-
axios.CanceledError = CanceledError;
|
|
54
|
-
axios.CancelToken = CancelToken;
|
|
55
|
-
axios.isCancel = isCancel;
|
|
56
|
-
axios.VERSION = VERSION;
|
|
57
|
-
axios.toFormData = toFormData;
|
|
58
|
-
|
|
59
|
-
// Expose AxiosError class
|
|
60
|
-
axios.AxiosError = AxiosError;
|
|
61
|
-
|
|
62
|
-
// alias for CanceledError for backward compatibility
|
|
63
|
-
axios.Cancel = axios.CanceledError;
|
|
64
|
-
|
|
65
|
-
// Expose all/spread
|
|
66
|
-
axios.all = function all(promises) {
|
|
67
|
-
return Promise.all(promises);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
axios.spread = spread;
|
|
71
|
-
|
|
72
|
-
// Expose isAxiosError
|
|
73
|
-
axios.isAxiosError = isAxiosError;
|
|
74
|
-
|
|
75
|
-
// Expose mergeConfig
|
|
76
|
-
axios.mergeConfig = mergeConfig;
|
|
77
|
-
|
|
78
|
-
axios.AxiosHeaders = AxiosHeaders;
|
|
79
|
-
|
|
80
|
-
axios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
|
|
81
|
-
|
|
82
|
-
axios.getAdapter = adapters.getAdapter;
|
|
83
|
-
|
|
84
|
-
axios.HttpStatusCode = HttpStatusCode;
|
|
85
|
-
|
|
86
|
-
axios.default = axios;
|
|
87
|
-
|
|
88
|
-
// this module should only have a default export
|
|
89
|
-
export default axios;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import CanceledError from './CanceledError.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A `CancelToken` is an object that can be used to request cancellation of an operation.
|
|
7
|
-
*
|
|
8
|
-
* @param {Function} executor The executor function.
|
|
9
|
-
*
|
|
10
|
-
* @returns {CancelToken}
|
|
11
|
-
*/
|
|
12
|
-
class CancelToken {
|
|
13
|
-
constructor(executor) {
|
|
14
|
-
if (typeof executor !== 'function') {
|
|
15
|
-
throw new TypeError('executor must be a function.');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
let resolvePromise;
|
|
19
|
-
|
|
20
|
-
this.promise = new Promise(function promiseExecutor(resolve) {
|
|
21
|
-
resolvePromise = resolve;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const token = this;
|
|
25
|
-
|
|
26
|
-
// eslint-disable-next-line func-names
|
|
27
|
-
this.promise.then((cancel) => {
|
|
28
|
-
if (!token._listeners) return;
|
|
29
|
-
|
|
30
|
-
let i = token._listeners.length;
|
|
31
|
-
|
|
32
|
-
while (i-- > 0) {
|
|
33
|
-
token._listeners[i](cancel);
|
|
34
|
-
}
|
|
35
|
-
token._listeners = null;
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// eslint-disable-next-line func-names
|
|
39
|
-
this.promise.then = (onfulfilled) => {
|
|
40
|
-
let _resolve;
|
|
41
|
-
// eslint-disable-next-line func-names
|
|
42
|
-
const promise = new Promise((resolve) => {
|
|
43
|
-
token.subscribe(resolve);
|
|
44
|
-
_resolve = resolve;
|
|
45
|
-
}).then(onfulfilled);
|
|
46
|
-
|
|
47
|
-
promise.cancel = function reject() {
|
|
48
|
-
token.unsubscribe(_resolve);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return promise;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
executor(function cancel(message, config, request) {
|
|
55
|
-
if (token.reason) {
|
|
56
|
-
// Cancellation has already been requested
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
token.reason = new CanceledError(message, config, request);
|
|
61
|
-
resolvePromise(token.reason);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Throws a `CanceledError` if cancellation has been requested.
|
|
67
|
-
*/
|
|
68
|
-
throwIfRequested() {
|
|
69
|
-
if (this.reason) {
|
|
70
|
-
throw this.reason;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Subscribe to the cancel signal
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
subscribe(listener) {
|
|
79
|
-
if (this.reason) {
|
|
80
|
-
listener(this.reason);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (this._listeners) {
|
|
85
|
-
this._listeners.push(listener);
|
|
86
|
-
} else {
|
|
87
|
-
this._listeners = [listener];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Unsubscribe from the cancel signal
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
unsubscribe(listener) {
|
|
96
|
-
if (!this._listeners) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const index = this._listeners.indexOf(listener);
|
|
100
|
-
if (index !== -1) {
|
|
101
|
-
this._listeners.splice(index, 1);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
toAbortSignal() {
|
|
106
|
-
const controller = new AbortController();
|
|
107
|
-
|
|
108
|
-
const abort = (err) => {
|
|
109
|
-
controller.abort(err);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
this.subscribe(abort);
|
|
113
|
-
|
|
114
|
-
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
115
|
-
|
|
116
|
-
return controller.signal;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
121
|
-
* cancels the `CancelToken`.
|
|
122
|
-
*/
|
|
123
|
-
static source() {
|
|
124
|
-
let cancel;
|
|
125
|
-
const token = new CancelToken(function executor(c) {
|
|
126
|
-
cancel = c;
|
|
127
|
-
});
|
|
128
|
-
return {
|
|
129
|
-
token,
|
|
130
|
-
cancel,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export default CancelToken;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import AxiosError from '../core/AxiosError.js';
|
|
4
|
-
|
|
5
|
-
class CanceledError extends AxiosError {
|
|
6
|
-
/**
|
|
7
|
-
* A `CanceledError` is an object that is thrown when an operation is canceled.
|
|
8
|
-
*
|
|
9
|
-
* @param {string=} message The message.
|
|
10
|
-
* @param {Object=} config The config.
|
|
11
|
-
* @param {Object=} request The request.
|
|
12
|
-
*
|
|
13
|
-
* @returns {CanceledError} The created error.
|
|
14
|
-
*/
|
|
15
|
-
constructor(message, config, request) {
|
|
16
|
-
super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
|
|
17
|
-
this.name = 'CanceledError';
|
|
18
|
-
this.__CANCEL__ = true;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default CanceledError;
|