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
@@ -6,7 +6,7 @@ import type {EspressoDriver} from '../driver.js';
6
6
  /**
7
7
  * Flash the element with given id.
8
8
  * durationMillis and repeatCount are optional
9
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-flashelement
9
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-flashelement
10
10
  * @param elementId - The ID of the element to flash
11
11
  * @param durationMillis - Optional duration in milliseconds for each flash
12
12
  * @param repeatCount - Optional number of times to repeat the flash
@@ -26,7 +26,7 @@ export async function mobileFlashElement(
26
26
 
27
27
  /**
28
28
  * Dismisses the autofill UI for the given element.
29
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-dismissautofill
29
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-dismissautofill
30
30
  * @param elementId - The ID of the element for which to dismiss autofill
31
31
  * @returns Promise that resolves when the autofill is dismissed
32
32
  */
@@ -40,7 +40,7 @@ export async function mobileDismissAutofill(this: EspressoDriver, elementId: str
40
40
 
41
41
  /**
42
42
  * Performs a swipe gesture on the given element.
43
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-swipe
43
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-swipe
44
44
  * @param elementId - The ID of the element to swipe
45
45
  * @param direction - Optional swipe direction (e.g., 'up', 'down', 'left', 'right')
46
46
  * @param swiper - Optional swiper configuration
@@ -70,7 +70,7 @@ export async function mobileSwipe(
70
70
 
71
71
  /**
72
72
  * Opens a drawer element (e.g., Navigation Drawer) with the specified gravity.
73
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-opendrawer
73
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-opendrawer
74
74
  * @param elementId - The ID of the drawer element to open
75
75
  * @param gravity - Optional gravity value for drawer positioning (e.g., Gravity.START, Gravity.END)
76
76
  * @returns Promise that resolves when the drawer is opened
@@ -81,7 +81,7 @@ export async function mobileOpenDrawer(this: EspressoDriver, elementId: string,
81
81
 
82
82
  /**
83
83
  * Closes a drawer element (e.g., Navigation Drawer) with the specified gravity.
84
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-closedrawer
84
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-closedrawer
85
85
  * @param elementId - The ID of the drawer element to close
86
86
  * @param gravity - Optional gravity value for drawer positioning (e.g., Gravity.START, Gravity.END)
87
87
  * @returns Promise that resolves when the drawer is closed
@@ -92,7 +92,7 @@ export async function mobileCloseDrawer(this: EspressoDriver, elementId: string,
92
92
 
93
93
  /**
94
94
  * Sets the date on a date picker element.
95
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-setdate
95
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-setdate
96
96
  * @param elementId - The ID of the date picker element
97
97
  * @param year - The year to set (e.g., 2024)
98
98
  * @param monthOfYear - The month to set (0-11, where 0 is January)
@@ -115,7 +115,7 @@ export async function mobileSetDate(
115
115
 
116
116
  /**
117
117
  * Sets the time on a time picker element.
118
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-settime
118
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-settime
119
119
  * @param elementId - The ID of the time picker element
120
120
  * @param hours - The hour to set (0-23)
121
121
  * @param minutes - The minute to set (0-59)
@@ -135,7 +135,7 @@ export async function mobileSetTime(
135
135
 
136
136
  /**
137
137
  * Navigates to a menu item in a navigation element (e.g., BottomNavigationView).
138
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-navigateto
138
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-navigateto
139
139
  * @param elementId - The ID of the navigation element
140
140
  * @param menuItemId - The ID of the menu item to navigate to (must be a non-negative number)
141
141
  * @returns Promise that resolves when navigation is completed
@@ -156,7 +156,7 @@ export async function mobileNavigateTo(
156
156
  /**
157
157
  * Perform a 'GeneralClickAction' (https://developer.android.com/reference/androidx/test/espresso/action/GeneralClickAction)
158
158
  *
159
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-clickaction
159
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-clickaction
160
160
  * @param elementId - The ID of the element to perform the click action on
161
161
  * @param tapper - Optional tapper configuration for the click action
162
162
  * @param coordinatesProvider - Optional coordinates provider for the click position
@@ -185,7 +185,7 @@ export async function mobileClickAction(
185
185
 
186
186
  /**
187
187
  * Scrolls to a specific page in a ViewPager or similar scrollable element.
188
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-scrolltopage
188
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-scrolltopage
189
189
  * @param elementId - The ID of the scrollable element (e.g., ViewPager)
190
190
  * @param scrollTo - Optional direction to scroll: 'first', 'last', 'left', or 'right'
191
191
  * @param scrollToPage - Optional page index to scroll to (must be non-negative)
@@ -3,7 +3,7 @@ import type {EspressoDriver} from '../driver.js';
3
3
  /**
4
4
  * Registers one or more idling resources
5
5
  *
6
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-registeridlingresources
6
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-registeridlingresources
7
7
  * @param classNames - The comma-separated list of idling resources class names.
8
8
  * Each name must be a full-qualified java class name, like `io.appium.espressoserver.lib.MyIdlingResource`.
9
9
  * Each class in the app source must implement a singleton pattern and have a static `getInstance()`
@@ -7,7 +7,8 @@ import type {DeviceInfo} from '../types.js';
7
7
 
8
8
  /**
9
9
  * Settings parameters that are available in
10
- * https://github.com/appium/appium-espresso-driver#settings-api or enabled plugins.
10
+ * https://appium.github.io/appium-espresso-driver/latest/reference/settings/
11
+ * or enabled plugins.
11
12
  */
12
13
  export interface SettingsOptions {
13
14
  [key: string]: string | number | boolean;
@@ -49,7 +50,7 @@ export async function mobileGetDeviceInfo(this: EspressoDriver): Promise<DeviceI
49
50
 
50
51
  /**
51
52
  * Checks if a toast message with the given text is currently visible on the screen.
52
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-istoastvisible
53
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-istoastvisible
53
54
  * @param text - The text to search for in the toast message
54
55
  * @param isRegexp - Optional flag indicating if the text should be treated as a regular expression
55
56
  * @returns Promise that resolves to true if the toast is visible, false otherwise
@@ -110,7 +111,7 @@ export async function getDisplayDensity(this: EspressoDriver): Promise<number> {
110
111
  *
111
112
  * @throws {Error} if target is not 'activity' or 'application'
112
113
  * @throws {Error} if a method is not found with given argument types
113
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-backdoor
114
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-backdoor
114
115
  * @param target - The target object to invoke methods on: 'activity', 'application', or 'element'
115
116
  * @param methods - Array of method definitions to invoke in sequence. Each method can have a name and optional args array
116
117
  * @param elementId - Required if target is 'element', the ID of the element to invoke methods on
@@ -145,7 +146,7 @@ export async function mobileBackdoor(
145
146
  * "getResourceName", "getVisibleBounds", "getVisibleCenter", "getApplicationPackage",
146
147
  * "getChildCount", "clear", "isCheckable", "isChecked", "isClickable", "isEnabled",
147
148
  * "isFocusable", "isFocused", "isLongClickable", "isScrollable", "isSelected"
148
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-uiautomator
149
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-uiautomator
149
150
  * @param strategy - The locator strategy to use (e.g., "clazz", "res", "text", "desc", "pkg", etc.)
150
151
  * @param locator - The locator value to match elements
151
152
  * @param action - The action to perform on the matched element
@@ -1,3 +1,4 @@
1
+ import {promises as nodeFs} from 'node:fs';
1
2
  import path from 'node:path';
2
3
  import {fileURLToPath} from 'node:url';
3
4
 
@@ -249,7 +250,8 @@ export class EspressoRunner {
249
250
  const serverPath = path.resolve(this.tmpDir, dirName);
250
251
  this.log.info(`Building espresso server in '${serverPath}'`);
251
252
  this.log.debug(`The build folder root could be customized by changing the 'tmpDir' capability`);
252
- await fs.rimraf(serverPath);
253
+ // Allow transient file locks to clear, but do not build on top of a partially removed project.
254
+ await nodeFs.rm(serverPath, {recursive: true, force: true, maxRetries: 3, retryDelay: 100});
253
255
  await fs.mkdirp(serverPath);
254
256
  this.log.debug(`Copying espresso server template from ('${getTestServerRoot()}' to '${serverPath}')`);
255
257
  await copyGradleProjectRecursively(getTestServerRoot(), serverPath);
@@ -3,7 +3,7 @@ import type {EspressoDriver} from '../driver.js';
3
3
  /**
4
4
  * Starts the given service intent.
5
5
  *
6
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-startservice
6
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-startservice
7
7
  * @param intent - The name of the service intent to start, for example
8
8
  * `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
9
9
  * !!! Only services in the app's under test scope could be started.
@@ -30,7 +30,7 @@ export async function mobileStartService(
30
30
  /**
31
31
  * Stops the given service intent.
32
32
  *
33
- * @see https://github.com/appium/appium-espresso-driver?tab=readme-ov-file#mobile-stopservice
33
+ * @see https://appium.github.io/appium-espresso-driver/latest/reference/execute-methods/#mobile-stopservice
34
34
  * @param intent - The name of the service intent to stop, for example
35
35
  * `com.some.package.name/.YourServiceSubClassName`. This option is mandatory.
36
36
  * !!! Only services in the app's under test scope could be stopped.
package/lib/driver.ts CHANGED
@@ -339,7 +339,7 @@ export class EspressoDriver
339
339
  const cause = e instanceof Error ? e : new Error(String(e));
340
340
  cause.message +=
341
341
  `${cause.message.endsWith('.') ? '' : '.'} Check ` +
342
- 'https://github.com/appium/appium-espresso-driver#troubleshooting ' +
342
+ 'https://appium.github.io/appium-espresso-driver/latest/troubleshooting/startup/ ' +
343
343
  'regarding advanced session startup troubleshooting.';
344
344
  if (isErrorType(e, errors.SessionNotCreatedError)) {
345
345
  throw e;
@@ -0,0 +1,12 @@
1
+ type BidiSubscriptionDriver = {
2
+ bidiEventSubs: Record<string, string[]>;
3
+ };
4
+ type Subscriptions = Map<string, Map<string, string[]>>;
5
+ /** Get (or lazily create) the subscription registry of the given driver */
6
+ export declare function getSubscriptions(driver: object): Subscriptions;
7
+ /** Recompute `bidiEventSubs` as the union of all registered subscriptions */
8
+ export declare function refreshEventSubscriptions(driver: BidiSubscriptionDriver): void;
9
+ /** Forget all subscriptions, e.g. when the session ends */
10
+ export declare function clearBidiSubscriptions(driver: BidiSubscriptionDriver): void;
11
+ export {};
12
+ //# sourceMappingURL=bidi-subscriptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bidi-subscriptions.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/bidi-subscriptions.ts"],"names":[],"mappings":"AAEA,KAAK,sBAAsB,GAAG;IAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAAC,CAAC;AAGxE,KAAK,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;AAIxD,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAO9D;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAS9E;AAED,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAG3E"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSubscriptions = getSubscriptions;
4
+ exports.refreshEventSubscriptions = refreshEventSubscriptions;
5
+ exports.clearBidiSubscriptions = clearBidiSubscriptions;
6
+ const support_1 = require("@appium/support");
7
+ const subscriptionsByDriver = new WeakMap();
8
+ /** Get (or lazily create) the subscription registry of the given driver */
9
+ function getSubscriptions(driver) {
10
+ let subscriptions = subscriptionsByDriver.get(driver);
11
+ if (!subscriptions) {
12
+ subscriptions = new Map();
13
+ subscriptionsByDriver.set(driver, subscriptions);
14
+ }
15
+ return subscriptions;
16
+ }
17
+ /** Recompute `bidiEventSubs` as the union of all registered subscriptions */
18
+ function refreshEventSubscriptions(driver) {
19
+ const events = new Map();
20
+ for (const subscription of getSubscriptions(driver).values()) {
21
+ for (const [event, contexts] of subscription) {
22
+ events.set(event, support_1.util.uniq([...(events.get(event) ?? []), ...contexts]));
23
+ }
24
+ }
25
+ // Object.fromEntries defines own properties, so names like '__proto__' stay safe
26
+ driver.bidiEventSubs = Object.fromEntries(events);
27
+ }
28
+ /** Forget all subscriptions, e.g. when the session ends */
29
+ function clearBidiSubscriptions(driver) {
30
+ subscriptionsByDriver.delete(driver);
31
+ driver.bidiEventSubs = {};
32
+ }
33
+ //# sourceMappingURL=bidi-subscriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bidi-subscriptions.js","sourceRo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.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/bidi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAgB,aAAa,EAAC,MAAM,eAAe,CAAC;AAK5E,OAAO,QAAQ,WAAW,CAAC;IAEzB,UAAU,UAAU,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,aAAa;KAAG;CACrE"}
1
+ {"version":3,"file":"bidi.d.ts","sourceRoot":"","sources":["../../../../lib/basedriver/commands/bidi.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAgB,aAAa,EAAC,MAAM,eAAe,CAAC;AAO5E,OAAO,QAAQ,WAAW,CAAC;IAEzB,UAAU,UAAU,CAAC,CAAC,SAAS,WAAW,CAAE,SAAQ,aAAa;KAAG;CACrE"}
@@ -1,25 +1,62 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const support_1 = require("@appium/support");
4
+ const errors_1 = require("../../protocol/errors");
5
+ const bidi_subscriptions_1 = require("./bidi-subscriptions");
4
6
  const mixin_1 = require("./mixin");
7
+ function assertStringList(value, name) {
8
+ if (!Array.isArray(value) || !value.length || value.some((item) => typeof item !== 'string' || !item.length)) {
9
+ throw new errors_1.errors.InvalidArgumentError(`${name} must be a non-empty array of non-empty strings`);
10
+ }
11
+ }
12
+ function assertContexts(value) {
13
+ if (!Array.isArray(value) || value.some((context) => typeof context !== 'string')) {
14
+ throw new errors_1.errors.InvalidArgumentError('contexts must be an array of strings');
15
+ }
16
+ }
5
17
  const BidiCommands = {
6
18
  async bidiSubscribe(events, contexts = ['']) {
7
- for (const event of events) {
8
- // a later subscribe for the same event must keep existing contexts; the spec appends subscriptions
9
- const existing = this.bidiEventSubs[event] ?? [];
10
- this.bidiEventSubs[event] = support_1.util.uniq([...existing, ...contexts]);
11
- }
19
+ assertStringList(events, 'events');
20
+ assertContexts(contexts);
21
+ const subscription = support_1.util.uuidV4();
22
+ (0, bidi_subscriptions_1.getSubscriptions)(this).set(subscription, new Map(events.map((event) => [event, [...contexts]])));
23
+ (0, bidi_subscriptions_1.refreshEventSubscriptions)(this);
24
+ return { subscription };
12
25
  },
13
- async bidiUnsubscribe(events, contexts = ['']) {
14
- for (const event of events) {
15
- if (!this.bidiEventSubs[event]) {
16
- continue;
26
+ async bidiUnsubscribe(events, contexts, subscriptions) {
27
+ const registered = (0, bidi_subscriptions_1.getSubscriptions)(this);
28
+ if (subscriptions === undefined) {
29
+ const contextsToRemove = contexts ?? [''];
30
+ assertStringList(events, 'events');
31
+ assertContexts(contextsToRemove);
32
+ for (const subscription of registered.values()) {
33
+ for (const event of events) {
34
+ const remaining = subscription.get(event)?.filter((c) => !contextsToRemove.includes(c));
35
+ if (remaining?.length) {
36
+ subscription.set(event, remaining);
37
+ }
38
+ else {
39
+ subscription.delete(event);
40
+ }
41
+ }
17
42
  }
18
- this.bidiEventSubs[event] = this.bidiEventSubs[event].filter((c) => !contexts.includes(c));
19
- if (this.bidiEventSubs[event].length === 0) {
20
- delete this.bidiEventSubs[event];
43
+ (0, bidi_subscriptions_1.refreshEventSubscriptions)(this);
44
+ return;
45
+ }
46
+ assertStringList(subscriptions, 'subscriptions');
47
+ if (events !== undefined || contexts !== undefined) {
48
+ throw new errors_1.errors.InvalidArgumentError('subscriptions cannot be combined with events or contexts');
49
+ }
50
+ // validate everything before removing anything
51
+ for (const id of subscriptions) {
52
+ if (!registered.has(id)) {
53
+ throw new errors_1.errors.InvalidArgumentError(`Unknown subscription id: ${id}`);
21
54
  }
22
55
  }
56
+ for (const id of subscriptions) {
57
+ registered.delete(id);
58
+ }
59
+ (0, bidi_subscriptions_1.refreshEventSubscriptions)(this);
23
60
  },
24
61
  async bidiStatus() {
25
62
  const result = await this.getStatus();
@@ -1 +1 @@
1
- {"version":3,"file":"bidi.js","sourceRoot":"","sources":["../../../../lib/basedriver/commands/bidi.ts"],"names":[],"mappings":";;AAAA,6CAAqC;AAIrC,mCAA8B;AAO9B,MAAM,YAAY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OAAO,CAAC,CAAC,CAAC;IAuG1E,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM;IAWjD,uBAAuB,CAAC,GAAG,GAAE,KAA8E;IAY3G,sBAAsB;IAkB5B,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAWrE,KAAK;IAyBX;;;;OAIG;IACG,aAAa,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAC7E;;;;;;OAMG;IACG,aAAa,CAAC,GAAG,UAAU,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC;IAkFrF;;;;OAIG;IACG,UAAU;IAOhB;;OAEG;IACG,4BAA4B,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAIrE;;OAEG;IAEG,aAAa,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAc7C,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IAalC,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,UAAU,CAAC,CAAC,CAAC;IAsB/C,cAAc,CAAC,WAAW,EAAE,QAAQ;IAOpC,WAAW;CAMlB;AAED,cAAc,YAAY,CAAC;AAE3B,eAAe,UAAU,CAAC"}
@@ -46,6 +46,7 @@ const session_1 = require("../helpers/session");
46
46
  const protocol_1 = require("../protocol");
47
47
  const utils_1 = require("../utils");
48
48
  const capabilities_2 = require("./capabilities");
49
+ const bidi_subscriptions_1 = require("./commands/bidi-subscriptions");
49
50
  const core_1 = require("./core");
50
51
  const helpers = __importStar(require("./helpers"));
51
52
  const EVENT_SESSION_INIT = 'newSessionRequested';
@@ -330,6 +331,7 @@ class BaseDriver extends core_1.DriverCore {
330
331
  }
331
332
  }
332
333
  this.sessionId = null;
334
+ (0, bidi_subscriptions_1.clearBidiSubscriptions)(this);
333
335
  }
334
336
  logExtraCaps(caps) {
335
337
  const knownCaps = Object.keys(this._desiredCapConstraints);
@@ -1 +1 @@
1
- {"version":3,"file":"driver.js","sourceRoot":"","sources":["../../../lib/basedriver/driver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,yCAiBuB;AAGvB,0DAA2D;AAC3D,8EAA8E;AAC9E,oEAAsE;AACtE,gDAAiD;AACjD,0CAA8E;AAC9E,oCAA2C;AAC3C,iDAAiE;AACjE,iCAAkC;AAClC,mDAAqC;AAIrC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AACjD,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AACxD,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AACtD,MAAM,4BAA4B,GAAG,sBAAsB,CAAC;AAE5D,MAAa,UAQX,SAAQ,iBAAuB;IAG/B,OAAO,CAAqB;IAC5B,IAAI,CAAgB;IACpB,YAAY,CAAoB;IAChC,qBAAqB,CAAK;IAC1B,MAAM,CAAgB;IACtB,UAAU,CAAU;IACpB,UAAU,CAAU;IACpB,UAAU,CAAU;IAEpB,YAAY,IAAiB,EAAE,kBAAkB,GAAG,IAAI;QACtD,KAAK,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAI,GAAG,EAAmB,CAAC;QAChC,IAAI,CAAC,OAAO,GAAG,EAAwB,CAAC;IAC1C,CAAC;IAED;;;;;;OAMG;IACH,IAAc,sBAAsB;QAClC,OAAO,MAAM,CAAC,MAAM,CAClB,IAAA,yBAAiB,EAAC,EAAE,EAAE,oCAA4B,EAAE,IAAI,CAAC,qBAAqB,CAAiC,CAChH,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAAc,GAA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,CAAC,WAAW;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,gDAAgD,CAAC,CAAC;QACtF,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC;CACF;AAtZD,gCAsZC;AAED,6CAA2B;AAE3B,kBAAe,UAAU,CAAC"}
@@ -25,24 +25,35 @@ export declare function handleLogContext(req: Request, _res: Response, next: Nex
25
25
  * Ensures requests default to JSON content-type when none is provided.
26
26
  */
27
27
  export declare function defaultToJSONContentType(req: Request, _res: Response, next: NextFunction): void;
28
+ /** Options for {@linkcode tryHandleWebSocketUpgrade} */
29
+ export interface WebSocketUpgradeOpts {
30
+ /** Incoming HTTP request */
31
+ req: IncomingMessage;
32
+ /** Network socket */
33
+ socket: Duplex;
34
+ /** First packet of the upgraded stream */
35
+ head: Buffer;
36
+ /** Path-to-WebSocket-server mapping */
37
+ webSocketsMapping: StringRecord<WSServer>;
38
+ /** Whether upgrades carrying an `Origin` header are accepted */
39
+ allowCors?: boolean;
40
+ }
28
41
  /**
29
42
  * Attempts to handle a WebSocket upgrade by matching the request path against registered handlers.
30
43
  *
31
- * @param req - Incoming HTTP request
32
- * @param socket - Network socket
33
- * @param head - First packet of the upgraded stream
34
- * @param webSocketsMapping - Path-to-WebSocket-server mapping
44
+ * @param opts - Upgrade options
35
45
  * @returns `true` if the upgrade was handled; `false` otherwise
36
46
  */
37
- export declare function tryHandleWebSocketUpgrade(req: IncomingMessage, socket: Duplex, head: Buffer, webSocketsMapping: StringRecord<WSServer>): boolean;
47
+ export declare function tryHandleWebSocketUpgrade({ req, socket, head, webSocketsMapping, allowCors, }: WebSocketUpgradeOpts): boolean;
38
48
  /**
39
49
  * Express middleware wrapper around {@link tryHandleWebSocketUpgrade}.
40
50
  * Delegates WebSocket upgrades to the mapping and falls through to `next()` otherwise.
41
51
  *
42
52
  * @param webSocketsMapping - Path-to-WebSocket-server mapping
53
+ * @param allowCors - Whether upgrades carrying an `Origin` header are accepted
43
54
  * @returns Express request handler
44
55
  */
45
- export declare function handleUpgrade(webSocketsMapping: StringRecord<WSServer>): RequestHandler;
56
+ export declare function handleUpgrade(webSocketsMapping: StringRecord<WSServer>, allowCors?: boolean): RequestHandler;
46
57
  /**
47
58
  * Final error-handling middleware.
48
59
  * Logs uncaught errors and returns a W3C-formatted error response unless headers were already sent.
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../lib/express/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAGxC,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAC,MAAM,SAAS,CAAC;AAI7E,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AAQ1D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAatF;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAe7E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAiBvF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAK/F;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,eAAe,EACp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B,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAK/F;AAED,wDAAwD;AACxD,MAAM,WAAW,oBAAoB;IACnC,4BAA4B;IAC5B,GAAG,EAAE,eAAe,CAAC;IACrB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,iBAAiB,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC1C,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,GAAG,EACH,MAAM,EACN,IAAI,EACJ,iBAAiB,EACjB,SAAiB,GAClB,EAAE,oBAAoB,GAAG,OAAO,CA4BhC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,iBAAiB,EAAE,YAAY,CAAC,QAAQ,CAAC,EAAE,SAAS,UAAQ,GAAG,cAAc,CAS1G;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAWlG;AAUD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAIjE"}
@@ -80,16 +80,19 @@ function defaultToJSONContentType(req, _res, next) {
80
80
  /**
81
81
  * Attempts to handle a WebSocket upgrade by matching the request path against registered handlers.
82
82
  *
83
- * @param req - Incoming HTTP request
84
- * @param socket - Network socket
85
- * @param head - First packet of the upgraded stream
86
- * @param webSocketsMapping - Path-to-WebSocket-server mapping
83
+ * @param opts - Upgrade options
87
84
  * @returns `true` if the upgrade was handled; `false` otherwise
88
85
  */
89
- function tryHandleWebSocketUpgrade(req, socket, head, webSocketsMapping) {
86
+ function tryHandleWebSocketUpgrade({ req, socket, head, webSocketsMapping, allowCors = false, }) {
90
87
  if (String(req.headers?.upgrade ?? '').toLowerCase() !== 'websocket') {
91
88
  return false;
92
89
  }
90
+ // WebSocket handshakes are not subject to the Same-Origin Policy; browsers always send Origin
91
+ if (!allowCors && req.headers.origin !== undefined) {
92
+ logger_1.log.warn(`Rejecting the WebSocket upgrade from the browser origin '${req.headers.origin}'`);
93
+ socket.end('HTTP/1.1 403 Forbidden\r\nConnection: close\r\nContent-Length: 0\r\n\r\n');
94
+ return true;
95
+ }
93
96
  let currentPathname;
94
97
  try {
95
98
  currentPathname = new URL(req.url ?? '', 'http://localhost').pathname;
@@ -113,11 +116,12 @@ function tryHandleWebSocketUpgrade(req, socket, head, webSocketsMapping) {
113
116
  * Delegates WebSocket upgrades to the mapping and falls through to `next()` otherwise.
114
117
  *
115
118
  * @param webSocketsMapping - Path-to-WebSocket-server mapping
119
+ * @param allowCors - Whether upgrades carrying an `Origin` header are accepted
116
120
  * @returns Express request handler
117
121
  */
118
- function handleUpgrade(webSocketsMapping) {
122
+ function handleUpgrade(webSocketsMapping, allowCors = false) {
119
123
  function handleUpgradeMiddleware(req, res, next) {
120
- if (tryHandleWebSocketUpgrade(req, req.socket, Buffer.from(''), webSocketsMapping)) {
124
+ if (tryHandleWebSocketUpgrade({ req, socket: req.socket, head: Buffer.from(''), webSocketsMapping, allowCors })) {
121
125
  return;
122
126
  }
123
127
  next();
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../lib/express/middleware.ts"],"names":[],"mappings":";;;AAqBA,4CAaC;AASD,oEAeC;AAMD,4CAiBC;AAKD,4DAKC;AAWD,8DA0BC;AASD,sCASC;AAMD,0CAWC;AAcD,0CAIC;AAlLD,6CAAqC;AAGrC,0CAAmC;AACnC,qCAA6B;AAC7B,6CAAgD;AAAxC,gHAAA,iBAAiB,OAAA;AAEzB,mDAAqC;AAErC,gDAAiD;AACjD,+CAA0D;AAE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  httpServer: HttpServer;
39
39
  reject: (error?: unknown) => void;
40
+ allowCors?: boolean;
40
41
  keepAliveTimeout: number;
41
42
  gracefulShutdownTimeout?: number;
42
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../lib/express/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,MAAM,IAAI,UAAU,EAAC,MAAM,WAAW,CAAC;AAMpD,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,SAAS,EACT,UAAU,EACV,YAAY,EACZ,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAC,OAAO,EAAkB,MAAM,EAAC,MAAM,SAAS,CAAC;AA2B7D,uDAAuD;AACvD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CAC5C;AAED,yCAAyC;AACzC,MAAM,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,4BAA4B,KAAK,IAAI,CAAC;AAEnG,qCAAqC;AACrC,MAAM,WAAW,UAAU;IACzB,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAC3C,cAAc,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,OAAO,CAAC;I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AK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,0CAA0C;AAC1C,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAuEpE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAmD/D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAe1D"}
@@ -38,6 +38,7 @@ async function server(opts) {
38
38
  const appiumServer = configureHttp({
39
39
  httpServer,
40
40
  reject,
41
+ allowCors,
41
42
  keepAliveTimeout,
42
43
  gracefulShutdownTimeout: cliArgs.shutdownTimeout,
43
44
  });
@@ -99,7 +100,7 @@ function configureServer(opts) {
99
100
  // When shouldUpgradeCallback is available, upgrades are handled directly on the HTTP server
100
101
  // to avoid Express middleware timeout issues with long-lived connections
101
102
  if (useLegacyUpgradeHandler) {
102
- app.use((0, middleware_1.handleUpgrade)(webSocketsMapping));
103
+ app.use((0, middleware_1.handleUpgrade)(webSocketsMapping, allowCors));
103
104
  }
104
105
  if (allowCors) {
105
106
  app.use(middleware_1.allowCrossDomain);
@@ -178,7 +179,7 @@ async function createServer(app, cliArgs) {
178
179
  * @param opts - Configuration options
179
180
  * @returns The same server instance typed as AppiumServer
180
181
  */
181
- function configureHttp({ httpServer, reject, keepAliveTimeout, gracefulShutdownTimeout, }) {
182
+ function configureHttp({ httpServer, reject, allowCors, keepAliveTimeout, gracefulShutdownTimeout, }) {
182
183
  const appiumServer = httpServer;
183
184
  appiumServer.webSocketsMapping = {};
184
185
  appiumServer.frontRouter = express_1.default.Router();
@@ -196,7 +197,7 @@ function configureHttp({ httpServer, reject, keepAliveTimeout, gracefulShutdownT
196
197
  // shouldUpgradeCallback only returns a boolean to indicate if the upgrade should proceed
197
198
  appiumServer.shouldUpgradeCallback = (req) => String(req.headers?.upgrade ?? '').toLowerCase() === 'websocket';
198
199
  appiumServer.on('upgrade', (req, socket, head) => {
199
- if (!(0, middleware_1.tryHandleWebSocketUpgrade)(req, socket, head, appiumServer.webSocketsMapping)) {
200
+ if (!(0, middleware_1.tryHandleWebSocketUpgrade)({ req, socket, head, webSocketsMapping: appiumServer.webSocketsMapping, allowCors })) {
200
201
  socket.destroy();
201
202
  }
202
203
  });