appium-espresso-driver 9.3.7 → 9.3.9

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.
Files changed (467) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/context.d.ts +1 -1
  3. package/build/lib/commands/context.js +1 -1
  4. package/build/lib/commands/element.d.ts +10 -10
  5. package/build/lib/commands/element.js +10 -10
  6. package/build/lib/commands/idling-resources.d.ts +1 -1
  7. package/build/lib/commands/idling-resources.js +1 -1
  8. package/build/lib/commands/misc.d.ts +5 -4
  9. package/build/lib/commands/misc.d.ts.map +1 -1
  10. package/build/lib/commands/misc.js +3 -3
  11. package/build/lib/commands/misc.js.map +1 -1
  12. package/build/lib/commands/server/runner.d.ts.map +1 -1
  13. package/build/lib/commands/server/runner.js +3 -1
  14. package/build/lib/commands/server/runner.js.map +1 -1
  15. package/build/lib/commands/services.d.ts +2 -2
  16. package/build/lib/commands/services.js +2 -2
  17. package/build/lib/driver.js +1 -1
  18. package/build/lib/driver.js.map +1 -1
  19. package/espresso-server/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk +0 -0
  20. package/espresso-server/buildSrc/.gradle/9.7.1/executionHistory/executionHistory.bin +0 -0
  21. package/espresso-server/buildSrc/.gradle/9.7.1/executionHistory/executionHistory.lock +0 -0
  22. package/espresso-server/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  23. package/espresso-server/buildSrc/.gradle/buildOutputCleanup/cache.properties +1 -1
  24. package/espresso-server/buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin +0 -0
  25. package/espresso-server/library/src/main/java/io/appium/espressoserver/lib/helpers/Version.kt +1 -1
  26. package/lib/commands/context.ts +1 -1
  27. package/lib/commands/element.ts +10 -10
  28. package/lib/commands/idling-resources.ts +1 -1
  29. package/lib/commands/misc.ts +5 -4
  30. package/lib/commands/server/runner.ts +3 -1
  31. package/lib/commands/services.ts +2 -2
  32. package/lib/driver.ts +1 -1
  33. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi-subscriptions.d.ts +12 -0
  34. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi-subscriptions.d.ts.map +1 -0
  35. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi-subscriptions.js +33 -0
  36. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi-subscriptions.js.map +1 -0
  37. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi.d.ts.map +1 -1
  38. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi.js +49 -12
  39. package/node_modules/@appium/base-driver/build/lib/basedriver/commands/bidi.js.map +1 -1
  40. package/node_modules/@appium/base-driver/build/lib/basedriver/driver.d.ts.map +1 -1
  41. package/node_modules/@appium/base-driver/build/lib/basedriver/driver.js +2 -0
  42. package/node_modules/@appium/base-driver/build/lib/basedriver/driver.js.map +1 -1
  43. package/node_modules/@appium/base-driver/build/lib/express/middleware.d.ts +17 -6
  44. package/node_modules/@appium/base-driver/build/lib/express/middleware.d.ts.map +1 -1
  45. package/node_modules/@appium/base-driver/build/lib/express/middleware.js +11 -7
  46. package/node_modules/@appium/base-driver/build/lib/express/middleware.js.map +1 -1
  47. package/node_modules/@appium/base-driver/build/lib/express/server.d.ts +1 -0
  48. package/node_modules/@appium/base-driver/build/lib/express/server.d.ts.map +1 -1
  49. package/node_modules/@appium/base-driver/build/lib/express/server.js +4 -3
  50. package/node_modules/@appium/base-driver/build/lib/express/server.js.map +1 -1
  51. package/node_modules/@appium/base-driver/build/lib/protocol/bidi-commands.d.ts +1 -2
  52. package/node_modules/@appium/base-driver/build/lib/protocol/bidi-commands.d.ts.map +1 -1
  53. package/node_modules/@appium/base-driver/build/lib/protocol/bidi-commands.js +8 -3
  54. package/node_modules/@appium/base-driver/build/lib/protocol/bidi-commands.js.map +1 -1
  55. package/node_modules/@appium/base-driver/lib/basedriver/commands/bidi-subscriptions.ts +36 -0
  56. package/node_modules/@appium/base-driver/lib/basedriver/commands/bidi.ts +56 -12
  57. package/node_modules/@appium/base-driver/lib/basedriver/driver.ts +2 -0
  58. package/node_modules/@appium/base-driver/lib/express/middleware.ts +32 -12
  59. package/node_modules/@appium/base-driver/lib/express/server.ts +7 -2
  60. package/node_modules/@appium/base-driver/lib/protocol/bidi-commands.ts +9 -3
  61. package/node_modules/@appium/base-driver/node_modules/axios/CHANGELOG.md +1934 -0
  62. package/node_modules/@appium/base-driver/node_modules/axios/LICENSE +7 -0
  63. package/node_modules/@appium/base-driver/node_modules/axios/MIGRATION_GUIDE.md +877 -0
  64. package/node_modules/@appium/base-driver/node_modules/axios/README.md +2851 -0
  65. package/node_modules/@appium/base-driver/node_modules/axios/dist/axios.js +5807 -0
  66. package/node_modules/@appium/base-driver/node_modules/axios/dist/axios.min.js +5 -0
  67. package/node_modules/@appium/base-driver/node_modules/axios/dist/axios.min.js.map +1 -0
  68. package/node_modules/@appium/base-driver/node_modules/axios/dist/browser/axios.cjs +5829 -0
  69. package/node_modules/@appium/base-driver/node_modules/axios/dist/esm/axios.js +5850 -0
  70. package/node_modules/@appium/base-driver/node_modules/axios/dist/esm/axios.min.js +3 -0
  71. package/node_modules/@appium/base-driver/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  72. package/node_modules/@appium/base-driver/node_modules/axios/dist/node/axios.cjs +6808 -0
  73. package/node_modules/@appium/base-driver/node_modules/axios/index.d.cts +766 -0
  74. package/node_modules/@appium/base-driver/node_modules/axios/index.d.ts +787 -0
  75. package/node_modules/@appium/base-driver/node_modules/axios/index.js +45 -0
  76. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/README.md +36 -0
  77. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/adapters.js +132 -0
  78. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/fetch.js +696 -0
  79. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/http.js +1490 -0
  80. package/node_modules/@appium/base-driver/node_modules/axios/lib/adapters/xhr.js +277 -0
  81. package/node_modules/@appium/base-driver/node_modules/axios/lib/axios.js +89 -0
  82. package/node_modules/@appium/base-driver/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  83. package/node_modules/@appium/base-driver/node_modules/axios/lib/cancel/CanceledError.js +22 -0
  84. package/node_modules/@appium/base-driver/node_modules/axios/lib/cancel/isCancel.js +5 -0
  85. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/Axios.js +306 -0
  86. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/AxiosError.js +219 -0
  87. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
  88. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/InterceptorManager.js +171 -0
  89. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/README.md +8 -0
  90. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/buildFullPath.js +76 -0
  91. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/dispatchRequest.js +95 -0
  92. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/mergeConfig.js +174 -0
  93. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/methodList.js +17 -0
  94. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  95. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/settle.js +27 -0
  96. package/node_modules/@appium/base-driver/node_modules/axios/lib/core/transformData.js +28 -0
  97. package/node_modules/@appium/base-driver/node_modules/axios/lib/defaults/index.js +178 -0
  98. package/node_modules/@appium/base-driver/node_modules/axios/lib/defaults/transitional.js +10 -0
  99. package/node_modules/@appium/base-driver/node_modules/axios/lib/env/README.md +3 -0
  100. package/node_modules/@appium/base-driver/node_modules/axios/lib/env/classes/FormData.js +2 -0
  101. package/node_modules/@appium/base-driver/node_modules/axios/lib/env/data.js +1 -0
  102. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
  103. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
  104. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
  105. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
  106. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/README.md +7 -0
  107. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
  108. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/bind.js +14 -0
  109. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/buildURL.js +69 -0
  110. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/callbackify.js +18 -0
  111. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/combineURLs.js +23 -0
  112. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/composeSignals.js +68 -0
  113. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/cookies.js +64 -0
  114. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
  115. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
  116. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
  117. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
  118. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
  119. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
  120. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  121. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
  122. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  123. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/null.js +2 -0
  124. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
  125. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  126. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
  127. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/readBlob.js +15 -0
  128. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
  129. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  130. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
  131. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/speedometer.js +55 -0
  132. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/spread.js +28 -0
  133. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/throttle.js +45 -0
  134. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/toFormData.js +279 -0
  135. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  136. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/trackStream.js +89 -0
  137. package/node_modules/@appium/base-driver/node_modules/axios/lib/helpers/validator.js +112 -0
  138. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  139. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  140. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  141. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/browser/index.js +13 -0
  142. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/common/utils.js +52 -0
  143. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/index.js +7 -0
  144. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  145. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  146. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  147. package/node_modules/@appium/base-driver/node_modules/axios/lib/platform/node/index.js +37 -0
  148. package/node_modules/@appium/base-driver/node_modules/axios/lib/utils.js +1150 -0
  149. package/node_modules/@appium/base-driver/node_modules/axios/package.json +203 -0
  150. package/node_modules/@appium/base-driver/package.json +6 -6
  151. package/node_modules/@appium/support/build/lib/npm.d.ts.map +1 -1
  152. package/node_modules/@appium/support/build/lib/npm.js +2 -1
  153. package/node_modules/@appium/support/build/lib/npm.js.map +1 -1
  154. package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
  155. package/node_modules/@appium/support/build/lib/util.js +13 -1
  156. package/node_modules/@appium/support/build/lib/util.js.map +1 -1
  157. package/node_modules/@appium/support/build/lib/zip.d.ts +2 -1
  158. package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
  159. package/node_modules/@appium/support/build/lib/zip.js +193 -64
  160. package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
  161. package/node_modules/@appium/support/lib/npm.ts +2 -1
  162. package/node_modules/@appium/support/lib/util.ts +13 -1
  163. package/node_modules/@appium/support/lib/zip.ts +231 -71
  164. package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +1934 -0
  165. package/node_modules/@appium/support/node_modules/axios/LICENSE +7 -0
  166. package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +877 -0
  167. package/node_modules/@appium/support/node_modules/axios/README.md +2851 -0
  168. package/node_modules/@appium/support/node_modules/axios/dist/axios.js +5807 -0
  169. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +5 -0
  170. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +1 -0
  171. package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +5829 -0
  172. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +5850 -0
  173. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +3 -0
  174. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  175. package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +6808 -0
  176. package/node_modules/@appium/support/node_modules/axios/index.d.cts +766 -0
  177. package/node_modules/@appium/support/node_modules/axios/index.d.ts +787 -0
  178. package/node_modules/@appium/support/node_modules/axios/index.js +45 -0
  179. package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +36 -0
  180. package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +132 -0
  181. package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +696 -0
  182. package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +1490 -0
  183. package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +277 -0
  184. package/node_modules/@appium/support/node_modules/axios/lib/axios.js +89 -0
  185. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  186. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +22 -0
  187. package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +5 -0
  188. package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +306 -0
  189. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +219 -0
  190. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
  191. package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +171 -0
  192. package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +8 -0
  193. package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +76 -0
  194. package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +95 -0
  195. package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +174 -0
  196. package/node_modules/@appium/support/node_modules/axios/lib/core/methodList.js +17 -0
  197. package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  198. package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +27 -0
  199. package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +28 -0
  200. package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +178 -0
  201. package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +10 -0
  202. package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +3 -0
  203. package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +2 -0
  204. package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +1 -0
  205. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
  206. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
  207. package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
  208. package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
  209. package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +7 -0
  210. package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
  211. package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +14 -0
  212. package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +69 -0
  213. package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +18 -0
  214. package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +23 -0
  215. package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +68 -0
  216. package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +64 -0
  217. package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
  218. package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
  219. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
  220. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
  221. package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
  222. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
  223. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  224. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
  225. package/node_modules/@appium/support/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  226. package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +2 -0
  227. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
  228. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  229. package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
  230. package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +15 -0
  231. package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
  232. package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  233. package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
  234. package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +55 -0
  235. package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +28 -0
  236. package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +45 -0
  237. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +279 -0
  238. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  239. package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +89 -0
  240. package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +112 -0
  241. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  242. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  243. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  244. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +13 -0
  245. package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +52 -0
  246. package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +7 -0
  247. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  248. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  249. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  250. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +37 -0
  251. package/node_modules/@appium/support/node_modules/axios/lib/utils.js +1150 -0
  252. package/node_modules/@appium/support/node_modules/axios/package.json +203 -0
  253. package/node_modules/@appium/support/package.json +6 -6
  254. package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts +6 -4
  255. package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts.map +1 -1
  256. package/node_modules/@appium/types/lib/commands/basedriver.ts +4 -4
  257. package/node_modules/@appium/types/package.json +2 -2
  258. package/node_modules/appium-android-driver/CHANGELOG.md +6 -0
  259. package/node_modules/appium-android-driver/build/lib/commands/context/exports.d.ts.map +1 -1
  260. package/node_modules/appium-android-driver/build/lib/commands/context/exports.js +9 -5
  261. package/node_modules/appium-android-driver/build/lib/commands/context/exports.js.map +1 -1
  262. package/node_modules/appium-android-driver/lib/commands/context/exports.ts +9 -5
  263. package/node_modules/appium-android-driver/package.json +1 -1
  264. package/node_modules/appium-chromedriver/CHANGELOG.md +14 -0
  265. package/node_modules/appium-chromedriver/build/lib/commands/version.d.ts.map +1 -1
  266. package/node_modules/appium-chromedriver/build/lib/commands/version.js +9 -0
  267. package/node_modules/appium-chromedriver/build/lib/commands/version.js.map +1 -1
  268. package/node_modules/appium-chromedriver/config/mapping.json +1 -0
  269. package/node_modules/appium-chromedriver/lib/commands/version.ts +10 -0
  270. package/node_modules/appium-chromedriver/package.json +2 -2
  271. package/node_modules/asyncbox/README.md +43 -0
  272. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts +9 -0
  273. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -0
  274. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +35 -0
  275. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -0
  276. package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts +9 -0
  277. package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -0
  278. package/node_modules/asyncbox/build/cjs/lib/asyncmap.js +23 -0
  279. package/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -0
  280. package/node_modules/asyncbox/build/cjs/lib/errors.d.ts +9 -0
  281. package/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -0
  282. package/node_modules/asyncbox/build/cjs/lib/errors.js +20 -0
  283. package/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -0
  284. package/node_modules/asyncbox/build/cjs/lib/index.d.ts +12 -0
  285. package/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -0
  286. package/node_modules/asyncbox/build/cjs/lib/index.js +24 -0
  287. package/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -0
  288. package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts +3 -0
  289. package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts.map +1 -0
  290. package/node_modules/asyncbox/build/cjs/lib/limit-function.js +15 -0
  291. package/node_modules/asyncbox/build/cjs/lib/limit-function.js.map +1 -0
  292. package/node_modules/asyncbox/build/cjs/lib/lock.d.ts +74 -0
  293. package/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -0
  294. package/node_modules/asyncbox/build/cjs/lib/lock.js +295 -0
  295. package/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -0
  296. package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts +15 -0
  297. package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts.map +1 -0
  298. package/node_modules/asyncbox/build/cjs/lib/long-sleep.js +36 -0
  299. package/node_modules/asyncbox/build/cjs/lib/long-sleep.js.map +1 -0
  300. package/node_modules/asyncbox/build/cjs/lib/retry.d.ts +17 -0
  301. package/node_modules/asyncbox/build/cjs/lib/retry.d.ts.map +1 -0
  302. package/node_modules/asyncbox/build/cjs/lib/retry.js +57 -0
  303. package/node_modules/asyncbox/build/cjs/lib/retry.js.map +1 -0
  304. package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts +20 -0
  305. package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts.map +1 -0
  306. package/node_modules/asyncbox/build/cjs/lib/sleep.js +61 -0
  307. package/node_modules/asyncbox/build/cjs/lib/sleep.js.map +1 -0
  308. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +18 -0
  309. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -0
  310. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +51 -0
  311. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -0
  312. package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts +16 -0
  313. package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts.map +1 -0
  314. package/node_modules/asyncbox/build/cjs/lib/with-timeout.js +45 -0
  315. package/node_modules/asyncbox/build/cjs/lib/with-timeout.js.map +1 -0
  316. package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts +9 -0
  317. package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -0
  318. package/node_modules/asyncbox/build/esm/lib/asyncfilter.js +32 -0
  319. package/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -0
  320. package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts +9 -0
  321. package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -0
  322. package/node_modules/asyncbox/build/esm/lib/asyncmap.js +20 -0
  323. package/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -0
  324. package/node_modules/asyncbox/build/esm/lib/errors.d.ts +9 -0
  325. package/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -0
  326. package/node_modules/asyncbox/build/esm/lib/errors.js +15 -0
  327. package/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -0
  328. package/node_modules/asyncbox/build/esm/lib/index.d.ts +12 -0
  329. package/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -0
  330. package/node_modules/asyncbox/build/esm/lib/index.js +10 -0
  331. package/node_modules/asyncbox/build/esm/lib/index.js.map +1 -0
  332. package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts +3 -0
  333. package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts.map +1 -0
  334. package/node_modules/asyncbox/build/esm/lib/limit-function.js +12 -0
  335. package/node_modules/asyncbox/build/esm/lib/limit-function.js.map +1 -0
  336. package/node_modules/asyncbox/build/esm/lib/lock.d.ts +74 -0
  337. package/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -0
  338. package/node_modules/asyncbox/build/esm/lib/lock.js +291 -0
  339. package/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -0
  340. package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts +15 -0
  341. package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts.map +1 -0
  342. package/node_modules/asyncbox/build/esm/lib/long-sleep.js +33 -0
  343. package/node_modules/asyncbox/build/esm/lib/long-sleep.js.map +1 -0
  344. package/node_modules/asyncbox/build/esm/lib/retry.d.ts +17 -0
  345. package/node_modules/asyncbox/build/esm/lib/retry.d.ts.map +1 -0
  346. package/node_modules/asyncbox/build/esm/lib/retry.js +53 -0
  347. package/node_modules/asyncbox/build/esm/lib/retry.js.map +1 -0
  348. package/node_modules/asyncbox/build/esm/lib/sleep.d.ts +20 -0
  349. package/node_modules/asyncbox/build/esm/lib/sleep.d.ts.map +1 -0
  350. package/node_modules/asyncbox/build/esm/lib/sleep.js +58 -0
  351. package/node_modules/asyncbox/build/esm/lib/sleep.js.map +1 -0
  352. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +18 -0
  353. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -0
  354. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +48 -0
  355. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -0
  356. package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts +16 -0
  357. package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts.map +1 -0
  358. package/node_modules/asyncbox/build/esm/lib/with-timeout.js +42 -0
  359. package/node_modules/asyncbox/build/esm/lib/with-timeout.js.map +1 -0
  360. package/node_modules/asyncbox/lib/asyncfilter.ts +38 -0
  361. package/node_modules/asyncbox/lib/asyncmap.ts +29 -0
  362. package/node_modules/asyncbox/lib/errors.ts +15 -0
  363. package/node_modules/asyncbox/lib/index.ts +21 -0
  364. package/node_modules/asyncbox/lib/limit-function.ts +18 -0
  365. package/node_modules/asyncbox/lib/lock.ts +360 -0
  366. package/node_modules/asyncbox/lib/long-sleep.ts +38 -0
  367. package/node_modules/asyncbox/lib/retry.ts +61 -0
  368. package/node_modules/asyncbox/lib/sleep.ts +79 -0
  369. package/node_modules/asyncbox/lib/wait-for-condition.ts +52 -0
  370. package/node_modules/asyncbox/lib/with-timeout.ts +43 -0
  371. package/node_modules/asyncbox/package.json +8 -8
  372. package/node_modules/axios/README.md +41 -106
  373. package/node_modules/axios/dist/axios.js +931 -278
  374. package/node_modules/axios/dist/axios.min.js +2 -2
  375. package/node_modules/axios/dist/axios.min.js.map +1 -1
  376. package/node_modules/axios/dist/browser/axios.cjs +948 -268
  377. package/node_modules/axios/dist/esm/axios.js +948 -268
  378. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  379. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  380. package/node_modules/axios/dist/node/axios.cjs +925 -242
  381. package/node_modules/axios/index.d.cts +20 -1
  382. package/node_modules/axios/index.d.ts +18 -1
  383. package/node_modules/axios/lib/adapters/fetch.js +73 -20
  384. package/node_modules/axios/lib/adapters/http.js +145 -26
  385. package/node_modules/axios/lib/adapters/xhr.js +120 -13
  386. package/node_modules/axios/lib/core/Axios.js +67 -12
  387. package/node_modules/axios/lib/core/AxiosError.js +59 -0
  388. package/node_modules/axios/lib/core/AxiosHeaders.js +17 -4
  389. package/node_modules/axios/lib/core/InterceptorManager.js +13 -2
  390. package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
  391. package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
  392. package/node_modules/axios/lib/core/dispatchRequest.js +20 -0
  393. package/node_modules/axios/lib/core/mergeConfig.js +183 -120
  394. package/node_modules/axios/lib/defaults/transitional.js +1 -0
  395. package/node_modules/axios/lib/env/data.js +1 -1
  396. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +11 -2
  397. package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -1
  398. package/node_modules/axios/lib/helpers/composeSignals.js +6 -3
  399. package/node_modules/axios/lib/helpers/cookies.js +30 -6
  400. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +34 -7
  401. package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
  402. package/node_modules/axios/lib/helpers/formDataToJSON.js +25 -1
  403. package/node_modules/axios/lib/helpers/fromDataURI.js +8 -2
  404. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +4 -9
  405. package/node_modules/axios/lib/helpers/parseHeaders.js +2 -1
  406. package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
  407. package/node_modules/axios/lib/helpers/resolveConfig.js +16 -3
  408. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +16 -1
  409. package/node_modules/axios/lib/utils.js +61 -10
  410. package/node_modules/axios/package.json +1 -2
  411. package/node_modules/body-parser/README.md +17 -13
  412. package/node_modules/body-parser/lib/read.js +74 -57
  413. package/node_modules/body-parser/lib/types/json.js +11 -11
  414. package/node_modules/body-parser/lib/types/urlencoded.js +5 -5
  415. package/node_modules/body-parser/lib/utils.js +0 -15
  416. package/node_modules/body-parser/package.json +7 -12
  417. package/node_modules/follow-redirects/README.md +27 -1
  418. package/node_modules/follow-redirects/index.js +1 -5
  419. package/node_modules/follow-redirects/package.json +1 -1
  420. package/node_modules/io.appium.settings/CHANGELOG.md +7 -0
  421. package/node_modules/io.appium.settings/apks/settings_apk-debug.apk +0 -0
  422. package/node_modules/io.appium.settings/package.json +2 -2
  423. package/node_modules/on-finished/index.js +14 -2
  424. package/node_modules/on-finished/package.json +11 -7
  425. package/node_modules/qs/.editorconfig +1 -1
  426. package/node_modules/qs/CHANGELOG.md +45 -22
  427. package/node_modules/qs/README.md +26 -1
  428. package/node_modules/qs/dist/qs.js +27 -27
  429. package/node_modules/qs/eslint.config.mjs +61 -50
  430. package/node_modules/qs/lib/formats.js +7 -2
  431. package/node_modules/qs/lib/parse.js +13 -6
  432. package/node_modules/qs/lib/stringify.js +5 -3
  433. package/node_modules/qs/lib/utils.js +15 -7
  434. package/node_modules/qs/package.json +6 -6
  435. package/node_modules/qs/test/parse.js +266 -2
  436. package/node_modules/qs/test/stringify.js +222 -0
  437. package/node_modules/qs/test/utils.js +61 -3
  438. package/node_modules/shell-quote/README.md +37 -4
  439. package/node_modules/shell-quote/package.json +10 -6
  440. package/node_modules/shell-quote/parse.d.ts +1 -1
  441. package/node_modules/shell-quote/parse.js +63 -11
  442. package/node_modules/shell-quote/quote.d.ts +2 -1
  443. package/node_modules/shell-quote/quote.js +23 -3
  444. package/node_modules/uuid/package.json +17 -17
  445. package/node_modules/ws/lib/websocket.js +17 -3
  446. package/node_modules/ws/package.json +1 -1
  447. package/package.json +5 -5
  448. package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
  449. package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
  450. package/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -311
  451. package/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
  452. package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
  453. package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
  454. package/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -298
  455. package/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
  456. package/node_modules/asyncbox/lib/asyncbox.ts +0 -382
  457. package/node_modules/on-finished/HISTORY.md +0 -98
  458. package/node_modules/shell-quote/.nycrc +0 -14
  459. package/node_modules/shell-quote/eslint.config.mjs +0 -29
  460. package/node_modules/shell-quote/security.md +0 -11
  461. package/node_modules/shell-quote/test/comment.js +0 -16
  462. package/node_modules/shell-quote/test/env.js +0 -52
  463. package/node_modules/shell-quote/test/env_fn.js +0 -21
  464. package/node_modules/shell-quote/test/op.js +0 -102
  465. package/node_modules/shell-quote/test/parse.js +0 -149
  466. package/node_modules/shell-quote/test/quote.js +0 -145
  467. package/node_modules/shell-quote/test/set.js +0 -31
@@ -65,6 +65,29 @@ function arrayToObject(arr) {
65
65
  return obj;
66
66
  }
67
67
 
68
+ function normalizeArray(value) {
69
+ if (!utils.isArray(value)) return value;
70
+
71
+ const keys = Object.keys(value);
72
+ return keys.length !== value.length || keys.some((key, index) => key !== String(index))
73
+ ? arrayToObject(value)
74
+ : value;
75
+ }
76
+
77
+ function normalizeArrays(obj) {
78
+ const pending = [obj];
79
+ while (pending.length) {
80
+ const target = pending.pop();
81
+ Object.keys(target).forEach((key) => {
82
+ const value = (target[key] = normalizeArray(target[key]));
83
+ if (utils.isArray(value) || utils.isPlainObject(value)) {
84
+ pending.push(value);
85
+ }
86
+ });
87
+ }
88
+ return obj;
89
+ }
90
+
68
91
  /**
69
92
  * It takes a FormData object and returns a JavaScript object
70
93
  *
@@ -86,6 +109,7 @@ function formDataToJSON(formData) {
86
109
 
87
110
  if (isLast) {
88
111
  if (utils.hasOwnProp(target, name)) {
112
+ target[name] = normalizeArray(target[name]);
89
113
  target[name] = utils.isArray(target[name])
90
114
  ? target[name].concat(value)
91
115
  : [target[name], value];
@@ -116,7 +140,7 @@ function formDataToJSON(formData) {
116
140
  buildPath(parsePropPath(name), value, obj, 0);
117
141
  });
118
142
 
119
- return obj;
143
+ return normalizeArrays(obj);
120
144
  }
121
145
 
122
146
  return null;
@@ -6,7 +6,10 @@ import platform from '../platform/index.js';
6
6
 
7
7
  // RFC 2397: data:[<mediatype>][;base64],<data>
8
8
  // mediatype = type/subtype followed by optional ;name=value parameters
9
- const DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
9
+ // The `i` flag makes the `;base64` token case-insensitive, matching the WHATWG
10
+ // URL/Fetch data URL processor (and therefore the fetch adapter and browsers).
11
+ // The remaining character classes do not depend on letter case.
12
+ const DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/i;
10
13
 
11
14
  /**
12
15
  * Parse data uri to a Buffer or Blob
@@ -51,7 +54,10 @@ export default function fromDataURI(uri, asBlob, options) {
51
54
 
52
55
  const buffer =
53
56
  encoding === 'base64'
54
- ? Buffer.from(body, 'base64')
57
+ ? Buffer.from(
58
+ body.replace(/%([\da-f]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))),
59
+ 'base64'
60
+ )
55
61
  : Buffer.from(decodeURIComponent(body), encoding);
56
62
 
57
63
  if (asBlob) {
@@ -1,16 +1,11 @@
1
1
  import platform from '../platform/index.js';
2
2
 
3
3
  export default platform.hasStandardBrowserEnv
4
- ? ((origin, isMSIE) => (url) => {
5
- url = new URL(url, platform.origin);
4
+ ? ((origin) => (url) => {
5
+ url = new URL(url, document.baseURI || platform.origin);
6
6
 
7
7
  return (
8
- origin.protocol === url.protocol &&
9
- origin.host === url.host &&
10
- (isMSIE || origin.port === url.port)
8
+ origin.protocol === url.protocol && origin.host === url.host && origin.port === url.port
11
9
  );
12
- })(
13
- new URL(platform.origin),
14
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
15
- )
10
+ })(new URL(platform.origin))
16
11
  : () => true;
@@ -39,7 +39,8 @@ const ignoreDuplicateOf = utils.toObjectSet([
39
39
  * @returns {Object} Headers parsed into an object
40
40
  */
41
41
  export default (rawHeaders) => {
42
- const parsed = {};
42
+ // Header names are data, including __proto__; avoid inherited setters.
43
+ const parsed = Object.create(null);
43
44
  let key;
44
45
  let val;
45
46
  let i;
@@ -2,5 +2,5 @@
2
2
 
3
3
  export default function parseProtocol(url) {
4
4
  const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
5
- return (match && match[1]) || '';
5
+ return (match && match[1].toLowerCase()) || '';
6
6
  }
@@ -22,7 +22,9 @@ const encodeUTF8 = (str) =>
22
22
  String.fromCharCode(parseInt(hex, 16))
23
23
  );
24
24
 
25
- function resolveConfig(config) {
25
+ const readCookie = (name) => cookies.read(name);
26
+
27
+ function resolveConfig(config, readXsrfCookie = readCookie) {
26
28
  const newConfig = mergeConfig({}, config);
27
29
 
28
30
  // Read only own properties to prevent prototype pollution gadgets
@@ -51,11 +53,22 @@ function resolveConfig(config) {
51
53
  if (auth) {
52
54
  const username = utils.getSafeProp(auth, 'username') || '';
53
55
  const password = utils.getSafeProp(auth, 'password') || '';
56
+ const transitional = own('transitional');
57
+ const encodeUsername =
58
+ transitional &&
59
+ utils.hasOwnProp(transitional, 'encodeBasicAuthUsername') &&
60
+ transitional.encodeBasicAuthUsername === true;
54
61
 
55
62
  try {
56
63
  headers.set(
57
64
  'Authorization',
58
- 'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))
65
+ // Preserve legacy username bytes unless the caller opts in to UTF-8.
66
+ 'Basic ' +
67
+ btoa(
68
+ (encodeUsername ? encodeUTF8(username) : username) +
69
+ ':' +
70
+ (password ? encodeUTF8(password) : '')
71
+ )
59
72
  );
60
73
  } catch (e) {
61
74
  throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);
@@ -93,7 +106,7 @@ function resolveConfig(config) {
93
106
  withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
94
107
 
95
108
  if (shouldSendXSRF) {
96
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
109
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && readXsrfCookie(xsrfCookieName);
97
110
 
98
111
  if (xsrfValue) {
99
112
  headers.set(xsrfHeaderName, xsrfValue);
@@ -1,3 +1,5 @@
1
+ import { domainToASCII } from 'url';
2
+
1
3
  const LOOPBACK_HOSTNAMES = new Set(['localhost', '0.0.0.0']);
2
4
 
3
5
  const trimTrailingDots = (value) => {
@@ -319,7 +321,20 @@ const normalizeNoProxyHost = (hostname) => {
319
321
  hostname = hostname.slice(1, -1);
320
322
  }
321
323
 
322
- const trimmed = trimTrailingDots(hostname);
324
+ let trimmed = trimTrailingDots(hostname);
325
+ if (trimmed.indexOf(':') !== -1) {
326
+ try {
327
+ trimmed = new URL('http://[' + trimmed + ']/').hostname.slice(1, -1);
328
+ } catch (_err) {
329
+ return trimmed;
330
+ }
331
+ } else if (/[\u0080-\uffff]/.test(trimmed)) {
332
+ const prefix = /^[*.]+/.exec(trimmed);
333
+ const start = prefix ? prefix[0] : '';
334
+ const ascii = domainToASCII(trimmed.slice(start.length));
335
+ if (!ascii) return '';
336
+ trimmed = start + trimTrailingDots(ascii);
337
+ }
323
338
 
324
339
  // IPv4 shorthand/octal/hex → dotted-decimal; helper is a no-op for inputs
325
340
  // containing ':' (IPv6 and IPv4-mapped IPv6) so we fall through to unmap.
@@ -313,11 +313,17 @@ const isPlainObject = (val) => {
313
313
  const prototype = getPrototypeOf(val);
314
314
  return (
315
315
  (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&
316
- // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as
317
- // evidence the value is tagged/iterable, while ignoring members reachable
318
- // only through shared or terminal prototype boundaries.
319
- !hasOwnInPrototypeChain(val, toStringTag) &&
320
- !hasOwnInPrototypeChain(val, iterator)
316
+ // Treat own Symbol.toStringTag or Symbol.iterator members as evidence the
317
+ // value is tagged/iterable, ignoring members reachable only through shared
318
+ // or terminal prototype boundaries. This is exactly what
319
+ // hasOwnInPrototypeChain(val, prop) computes here: every prototype admitted
320
+ // above (null, Object.prototype, or a terminal null-prototype template) is
321
+ // a boundary, so the walk never inspects anything but `val`'s own members,
322
+ // and stops before even those when `val` is itself the boundary
323
+ // Object.prototype. Checking that inline avoids allocating the walker's
324
+ // `seen` list twice per call on the mergeConfig / merge hot path.
325
+ (isPrototypeBoundary(val, prototype, true) ||
326
+ (!hasOwnProperty(val, toStringTag) && !hasOwnProperty(val, iterator)))
321
327
  );
322
328
  };
323
329
 
@@ -581,15 +587,30 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
581
587
  function merge(...objs) {
582
588
  const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
583
589
  const result = {};
590
+ // Caseless lookup only applies to string keys — symbol keys are
591
+ // identity-matched. Every string key that reaches `result` passes through
592
+ // this index first, so it can never hold two case variants of one key and a
593
+ // lowercase -> key map is exactly what findKey(result, key) would rescan
594
+ // Object.keys(result) for on each assignment.
595
+ const lowerCaseKeys = caseless ? Object.create(null) : null;
584
596
  const assignValue = (val, key) => {
585
597
  // Skip dangerous property names to prevent prototype pollution
586
598
  if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
587
599
  return;
588
600
  }
589
601
 
590
- // findKey lowercases the key, so caseless lookup only applies to strings —
591
- // symbol keys are identity-matched.
592
- const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key;
602
+ let targetKey = key;
603
+ if (lowerCaseKeys && typeof key === 'string') {
604
+ const lowerKey = key.toLowerCase();
605
+ const knownKey = lowerCaseKeys[lowerKey];
606
+ // A key recorded but absent from `result` was skipped by skipUndefined;
607
+ // the later spelling wins then, as it does for findKey.
608
+ if (knownKey !== undefined && hasOwnProperty(result, knownKey)) {
609
+ targetKey = knownKey;
610
+ } else {
611
+ lowerCaseKeys[lowerKey] = key;
612
+ }
613
+ }
593
614
  // Read via own-prop only — a bare `result[targetKey]` walks the prototype
594
615
  // chain, so a polluted Object.prototype value could surface here and get
595
616
  // copied into the merged result.
@@ -613,7 +634,7 @@ function merge(...objs) {
613
634
 
614
635
  forEach(source, assignValue);
615
636
 
616
- if (typeof source !== 'object' || isArray(source)) {
637
+ if (typeof source !== 'object' || isArray(source) || !Object.getOwnPropertySymbols) {
617
638
  continue;
618
639
  }
619
640
 
@@ -772,7 +793,37 @@ const toArray = (thing) => {
772
793
  if (!thing) return null;
773
794
  if (isArray(thing)) return thing;
774
795
  let i = thing.length;
775
- if (!isNumber(i)) return null;
796
+ if (!Number.isSafeInteger(i) || i < 0 || i > 0xffffffff) return null;
797
+
798
+ // Bound the copy by actual indexed properties, including hidden and inherited
799
+ // members of array-like collections, rather than by the declared length alone.
800
+ const indexes = new Set();
801
+ const seen = new Set();
802
+ let source = thing;
803
+
804
+ while (source != null && indexes.size < i) {
805
+ if (seen.has(source)) return null;
806
+ seen.add(source);
807
+
808
+ const prototype = getPrototypeOf(source);
809
+ if (isPrototypeBoundary(source, prototype, source === thing)) break;
810
+
811
+ Object.getOwnPropertyNames(source).forEach((key) => {
812
+ const index = +key;
813
+ if (
814
+ Number.isInteger(index) &&
815
+ index >= 0 &&
816
+ index < i &&
817
+ String(index) === key &&
818
+ hasOwnProperty(source, key)
819
+ ) {
820
+ indexes.add(index);
821
+ }
822
+ });
823
+ source = prototype;
824
+ }
825
+
826
+ if (indexes.size !== i) return null;
776
827
  const arr = new Array(i);
777
828
  while (i-- > 0) {
778
829
  arr[i] = thing[i];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Promise based HTTP client for the browser and node.js",
5
5
  "main": "./dist/node/axios.cjs",
6
6
  "module": "./index.js",
@@ -161,7 +161,6 @@
161
161
  "abortcontroller-polyfill": "^1.7.8",
162
162
  "acorn": "^8.17.0",
163
163
  "body-parser": "^2.3.0",
164
- "chalk": "^5.6.2",
165
164
  "cross-env": "^10.1.0",
166
165
  "dev-null": "^0.1.1",
167
166
  "eslint": "^10.6.0",
@@ -37,6 +37,10 @@ This module provides the following parsers:
37
37
  * [Text body parser](#bodyparsertextoptions)
38
38
  * [URL-encoded form body parser](#bodyparserurlencodedoptions)
39
39
 
40
+ All parsers support automatic inflation of `gzip`, `br` (brotli), `deflate`
41
+ and `zstd` encodings. `zstd` is available in Node.js `^22.15.0` and
42
+ `>=23.8.0`.
43
+
40
44
  Other body parsers you might be interested in:
41
45
 
42
46
  - [body](https://www.npmjs.com/package/body#readme)
@@ -65,6 +69,12 @@ The `bodyParser` object exposes various factories to create middlewares. All
65
69
  middlewares will populate the `req.body` property with the parsed body when
66
70
  the `Content-Type` request header matches the `type` option.
67
71
 
72
+ **Note** As of v2, `req.body` is left `undefined` when no body is parsed (for
73
+ example when the request has neither `Content-Length` nor `Transfer-Encoding`,
74
+ or when `Content-Type` does not match). In v1, `req.body` was always initialized
75
+ to `{}`. Code that assumes `req.body` is always an object should use optional
76
+ chaining (for example `req.body?.username`) or set a default.
77
+
68
78
  The various errors returned by this module are described in the
69
79
  [errors section](#errors).
70
80
 
@@ -72,8 +82,7 @@ The various errors returned by this module are described in the
72
82
 
73
83
  Returns middleware that only parses `json` and only looks at requests where
74
84
  the `Content-Type` header matches the `type` option. This parser accepts any
75
- Unicode encoding of the body and supports automatic inflation of `gzip`,
76
- `br` (brotli) and `deflate` encodings.
85
+ Unicode encoding of the body.
77
86
 
78
87
  A new `body` object containing the parsed data is populated on the `request`
79
88
  object after the middleware (i.e. `req.body`).
@@ -110,7 +119,7 @@ argument. You can find more information on this argument
110
119
 
111
120
  ##### strict
112
121
 
113
- When set to `true`, will only accept arrays and objects; when `false` will
122
+ When set to `true`, it will only accept arrays and objects; when `false`, it will
114
123
  accept anything `JSON.parse` accepts. Defaults to `true`.
115
124
 
116
125
  ##### type
@@ -133,9 +142,7 @@ encoding of the request. The parsing can be aborted by throwing an error.
133
142
  ### bodyParser.raw([options])
134
143
 
135
144
  Returns middleware that parses all bodies as a `Buffer` and only looks at
136
- requests where the `Content-Type` header matches the `type` option. This
137
- parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate`
138
- encodings.
145
+ requests where the `Content-Type` header matches the `type` option.
139
146
 
140
147
  A new `body` object containing the parsed data is populated on the `request`
141
148
  object after the middleware (i.e. `req.body`). This will be a `Buffer` object
@@ -181,9 +188,7 @@ encoding of the request. The parsing can be aborted by throwing an error.
181
188
  ### bodyParser.text([options])
182
189
 
183
190
  Returns middleware that parses all bodies as a string and only looks at
184
- requests where the `Content-Type` header matches the `type` option. This
185
- parser supports automatic inflation of `gzip`, `br` (brotli) and `deflate`
186
- encodings.
191
+ requests where the `Content-Type` header matches the `type` option.
187
192
 
188
193
  A new `body` string containing the parsed data is populated on the `request`
189
194
  object after the middleware (i.e. `req.body`). This will be a string of the
@@ -234,8 +239,7 @@ encoding of the request. The parsing can be aborted by throwing an error.
234
239
 
235
240
  Returns middleware that only parses `urlencoded` bodies and only looks at
236
241
  requests where the `Content-Type` header matches the `type` option. This
237
- parser accepts only UTF-8 and ISO-8859-1 encodings of the body and supports
238
- automatic inflation of `gzip`, `br` (brotli) and `deflate` encodings.
242
+ parser accepts only UTF-8 and ISO-8859-1 encodings of the body.
239
243
 
240
244
  A new `body` object containing the parsed data is populated on the `request`
241
245
  object after the middleware (i.e. `req.body`). This object will contain
@@ -346,7 +350,7 @@ the entity value that failed parsing.
346
350
  ### entity verify failed
347
351
 
348
352
  This error will occur when the request contained an entity that could not be
349
- failed verification by the defined `verify` option. The `status` property is
353
+ verified by the defined `verify` option. The `status` property is
350
354
  set to `403`, the `type` property is set to `'entity.verify.failed'`, and the
351
355
  `body` property is set to the entity value that failed verification.
352
356
 
@@ -413,7 +417,7 @@ property is set to the encoding that is unsupported.
413
417
 
414
418
  ### The input exceeded the depth
415
419
 
416
- This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. When the `depth` option is set to `32` (default value), the error will not be thrown.
420
+ This error occurs when using `bodyParser.urlencoded` with the `extended` property set to `true` and the input exceeds the configured `depth` option. The `status` property is set to `400`. It is recommended to review the `depth` option and evaluate if it requires a higher value. With the default `depth` of `32`, an input with 33 or more levels of nesting gets this error.
417
421
 
418
422
  ## Examples
419
423
 
@@ -17,7 +17,7 @@ const iconv = require('iconv-lite')
17
17
  const onFinished = require('on-finished')
18
18
  const zlib = require('node:zlib')
19
19
  const hasBody = require('type-is').hasBody
20
- const { getCharset } = require('./utils')
20
+ const contentType = require('content-type')
21
21
 
22
22
  /**
23
23
  * Module exports.
@@ -25,6 +25,12 @@ const { getCharset } = require('./utils')
25
25
 
26
26
  module.exports = read
27
27
 
28
+ /**
29
+ * @const
30
+ * whether current node version has zstandard support
31
+ */
32
+ const hasZstandardSupport = 'createZstdDecompress' in zlib
33
+
28
34
  /**
29
35
  * Read a request into a buffer and parse.
30
36
  *
@@ -79,38 +85,53 @@ function read (req, res, next, parse, debug, options) {
79
85
  }
80
86
 
81
87
  let length
82
- const opts = options
83
88
  let stream
84
89
 
85
- // read options
86
- const verify = opts.verify
90
+ const verify = options.verify
91
+
92
+ // assert charset is supported before creating the decompression stream, so an
93
+ // unsupported charset cannot leave a decoder piped with no error listener
94
+ if (verify && encoding !== null && !iconv.encodingExists(encoding)) {
95
+ return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
96
+ charset: encoding.toLowerCase(),
97
+ type: 'charset.unsupported'
98
+ }))
99
+ }
87
100
 
88
101
  try {
102
+ const contentEncoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
103
+
104
+ debug('content-encoding "%s"', contentEncoding)
105
+
106
+ if (options.inflate === false && contentEncoding !== 'identity') {
107
+ throw createError(415, 'content encoding unsupported', {
108
+ encoding: contentEncoding,
109
+ type: 'encoding.unsupported'
110
+ })
111
+ }
112
+
89
113
  // get the content stream
90
- stream = contentstream(req, debug, opts.inflate)
91
- length = stream.length
92
- stream.length = undefined
114
+ if (contentEncoding === 'identity') {
115
+ length = req.headers['content-length']
116
+ stream = req
117
+ } else {
118
+ stream = createDecompressionStream(contentEncoding, debug)
119
+ req.pipe(stream)
120
+ }
93
121
  } catch (err) {
94
122
  return next(err)
95
123
  }
96
124
 
97
125
  // set raw-body options
98
- opts.length = length
99
- opts.encoding = verify
100
- ? null
101
- : encoding
102
-
103
- // assert charset is supported
104
- if (opts.encoding === null && encoding !== null && !iconv.encodingExists(encoding)) {
105
- return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', {
106
- charset: encoding.toLowerCase(),
107
- type: 'charset.unsupported'
108
- }))
126
+ const rawBodyOptions = {
127
+ length,
128
+ encoding: verify ? null : encoding,
129
+ limit: options.limit
109
130
  }
110
131
 
111
132
  // read body
112
133
  debug('read body')
113
- getBody(stream, opts, function (error, body) {
134
+ getBody(stream, rawBodyOptions, function (error, body) {
114
135
  if (error) {
115
136
  let _error
116
137
 
@@ -138,6 +159,17 @@ function read (req, res, next, parse, debug, options) {
138
159
  return
139
160
  }
140
161
 
162
+ // detach and destroy the decompression stream to
163
+ // avoid decompression errors on the finished stream
164
+ if (stream !== req) {
165
+ req.unpipe(stream)
166
+ stream.on('error', () => {})
167
+ stream.destroy()
168
+
169
+ // consume any remaining bytes so the HTTP request can finish
170
+ req.resume()
171
+ }
172
+
141
173
  // verify
142
174
  if (verify) {
143
175
  try {
@@ -145,7 +177,7 @@ function read (req, res, next, parse, debug, options) {
145
177
  verify(req, res, body, encoding)
146
178
  } catch (err) {
147
179
  next(createError(403, err, {
148
- body: body,
180
+ body,
149
181
  type: err.type || 'entity.verify.failed'
150
182
  }))
151
183
  return
@@ -172,38 +204,6 @@ function read (req, res, next, parse, debug, options) {
172
204
  })
173
205
  }
174
206
 
175
- /**
176
- * Get the content stream of the request.
177
- *
178
- * @param {Object} req
179
- * @param {Function} debug
180
- * @param {boolean} inflate
181
- * @returns {Object}
182
- * @private
183
- */
184
- function contentstream (req, debug, inflate) {
185
- const encoding = (req.headers['content-encoding'] || 'identity').toLowerCase()
186
- const length = req.headers['content-length']
187
-
188
- debug('content-encoding "%s"', encoding)
189
-
190
- if (inflate === false && encoding !== 'identity') {
191
- throw createError(415, 'content encoding unsupported', {
192
- encoding: encoding,
193
- type: 'encoding.unsupported'
194
- })
195
- }
196
-
197
- if (encoding === 'identity') {
198
- req.length = length
199
- return req
200
- }
201
-
202
- const stream = createDecompressionStream(encoding, debug)
203
- req.pipe(stream)
204
- return stream
205
- }
206
-
207
207
  /**
208
208
  * Create a decompression stream for the given encoding.
209
209
  * @param {string} encoding
@@ -222,12 +222,16 @@ function createDecompressionStream (encoding, debug) {
222
222
  case 'br':
223
223
  debug('brotli decompress body')
224
224
  return zlib.createBrotliDecompress()
225
- default:
226
- throw createError(415, 'unsupported content encoding "' + encoding + '"', {
227
- encoding: encoding,
228
- type: 'encoding.unsupported'
229
- })
225
+ case 'zstd':
226
+ if (hasZstandardSupport) {
227
+ debug('zstd decompress body')
228
+ return zlib.createZstdDecompress()
229
+ }
230
230
  }
231
+ throw createError(415, 'unsupported content encoding "' + encoding + '"', {
232
+ encoding,
233
+ type: 'encoding.unsupported'
234
+ })
231
235
  }
232
236
 
233
237
  /**
@@ -245,3 +249,16 @@ function dump (req, callback) {
245
249
  req.resume()
246
250
  }
247
251
  }
252
+
253
+ /**
254
+ * Get the charset of a request.
255
+ *
256
+ * @param {Object} req
257
+ * @returns {string | undefined}
258
+ * @private
259
+ */
260
+ function getCharset (req) {
261
+ const header = req.headers['content-type']
262
+ if (!header) return undefined
263
+ return contentType.parse(header).parameters.charset?.toLowerCase()
264
+ }
@@ -23,7 +23,7 @@ const { normalizeOptions } = require('../utils')
23
23
  module.exports = json
24
24
 
25
25
  /**
26
- * RegExp to match the first non-space in a string.
26
+ * RegExp to match the first non-whitespace character in a string.
27
27
  *
28
28
  * Allowed whitespace is defined in RFC 7159:
29
29
  *
@@ -33,7 +33,7 @@ module.exports = json
33
33
  * %x0A / ; Line feed or New line
34
34
  * %x0D ) ; Carriage return
35
35
  */
36
- const FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex
36
+ const FIRST_NON_WHITESPACE_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d]|$)/ // eslint-disable-line no-control-regex
37
37
 
38
38
  const JSON_SYNTAX_CHAR = '#'
39
39
  const JSON_SYNTAX_REGEXP = /#+/g
@@ -80,10 +80,12 @@ function createJsonParser (options) {
80
80
  return {}
81
81
  }
82
82
 
83
- const first = firstchar(body)
84
- if (first !== '{' && first !== '[') {
85
- debug('strict violation')
86
- throw createStrictSyntaxError(body, first)
83
+ if (body[0] !== '{' && body[0] !== '[') {
84
+ const first = firstNonWhitespaceChar(body)
85
+ if (first !== '{' && first !== '[') {
86
+ debug('strict violation')
87
+ throw createStrictSyntaxError(body, first)
88
+ }
87
89
  }
88
90
 
89
91
  try {
@@ -152,12 +154,10 @@ function createStrictSyntaxError (str, char) {
152
154
  * @returns {string|undefined}
153
155
  * @private
154
156
  */
155
- function firstchar (str) {
156
- const match = FIRST_CHAR_REGEXP.exec(str)
157
+ function firstNonWhitespaceChar (str) {
158
+ const match = FIRST_NON_WHITESPACE_REGEXP.exec(str)
157
159
 
158
- return match
159
- ? match[1]
160
- : undefined
160
+ return match && match[1] ? match[1] : undefined
161
161
  }
162
162
 
163
163
  /**
@@ -98,12 +98,12 @@ function createQueryParser (options) {
98
98
  try {
99
99
  return qs.parse(body, {
100
100
  allowPrototypes: true,
101
- arrayLimit: arrayLimit,
102
- depth: depth,
103
- charsetSentinel: charsetSentinel,
104
- interpretNumericEntities: interpretNumericEntities,
101
+ arrayLimit,
102
+ depth,
103
+ charsetSentinel,
104
+ interpretNumericEntities,
105
105
  charset: encoding,
106
- parameterLimit: parameterLimit,
106
+ parameterLimit,
107
107
  strictDepth: true
108
108
  })
109
109
  } catch (err) {