appium-mac2-driver 4.5.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/lib/session-claim-handler.d.ts.map +1 -1
  3. package/build/lib/session-claim-handler.js +1 -2
  4. package/build/lib/session-claim-handler.js.map +1 -1
  5. package/build/lib/wda-mac.d.ts +0 -1
  6. package/build/lib/wda-mac.d.ts.map +1 -1
  7. package/build/lib/wda-mac.js +1 -1
  8. package/lib/session-claim-handler.ts +1 -2
  9. package/lib/wda-mac.ts +1 -2
  10. package/node_modules/@appium/support/build/lib/npm.d.ts.map +1 -1
  11. package/node_modules/@appium/support/build/lib/npm.js +2 -1
  12. package/node_modules/@appium/support/build/lib/npm.js.map +1 -1
  13. package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
  14. package/node_modules/@appium/support/build/lib/util.js +13 -1
  15. package/node_modules/@appium/support/build/lib/util.js.map +1 -1
  16. package/node_modules/@appium/support/build/lib/zip.d.ts +2 -1
  17. package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
  18. package/node_modules/@appium/support/build/lib/zip.js +193 -64
  19. package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
  20. package/node_modules/@appium/support/lib/npm.ts +2 -1
  21. package/node_modules/@appium/support/lib/util.ts +13 -1
  22. package/node_modules/@appium/support/lib/zip.ts +231 -71
  23. package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +1934 -0
  24. package/node_modules/@appium/support/node_modules/axios/LICENSE +7 -0
  25. package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +877 -0
  26. package/node_modules/@appium/support/node_modules/axios/README.md +2851 -0
  27. package/node_modules/@appium/support/node_modules/axios/dist/axios.js +5807 -0
  28. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +5 -0
  29. package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +1 -0
  30. package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +5829 -0
  31. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +5850 -0
  32. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +3 -0
  33. package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +1 -0
  34. package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +6808 -0
  35. package/node_modules/@appium/support/node_modules/axios/index.d.cts +766 -0
  36. package/node_modules/@appium/support/node_modules/axios/index.d.ts +787 -0
  37. package/node_modules/@appium/support/node_modules/axios/index.js +45 -0
  38. package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +36 -0
  39. package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +132 -0
  40. package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +696 -0
  41. package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +1490 -0
  42. package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +277 -0
  43. package/node_modules/@appium/support/node_modules/axios/lib/axios.js +89 -0
  44. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +135 -0
  45. package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +22 -0
  46. package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +5 -0
  47. package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +306 -0
  48. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +219 -0
  49. package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
  50. package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +171 -0
  51. package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +8 -0
  52. package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +76 -0
  53. package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +95 -0
  54. package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +174 -0
  55. package/node_modules/@appium/support/node_modules/axios/lib/core/methodList.js +17 -0
  56. package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
  57. package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +27 -0
  58. package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +28 -0
  59. package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +178 -0
  60. package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +10 -0
  61. package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +3 -0
  62. package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +2 -0
  63. package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +1 -0
  64. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
  65. package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
  66. package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
  67. package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
  68. package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +7 -0
  69. package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
  70. package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +14 -0
  71. package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +69 -0
  72. package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +18 -0
  73. package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +23 -0
  74. package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +68 -0
  75. package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +64 -0
  76. package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
  77. package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
  78. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
  79. package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
  80. package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
  81. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
  82. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
  83. package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
  84. package/node_modules/@appium/support/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
  85. package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +2 -0
  86. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
  87. package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
  88. package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
  89. package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +15 -0
  90. package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
  91. package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
  92. package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
  93. package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +55 -0
  94. package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +28 -0
  95. package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +45 -0
  96. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +279 -0
  97. package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
  98. package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +89 -0
  99. package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +112 -0
  100. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
  101. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
  102. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
  103. package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +13 -0
  104. package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +52 -0
  105. package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +7 -0
  106. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
  107. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
  108. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
  109. package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +37 -0
  110. package/node_modules/@appium/support/node_modules/axios/lib/utils.js +1150 -0
  111. package/node_modules/@appium/support/node_modules/axios/package.json +203 -0
  112. package/node_modules/@appium/support/package.json +6 -6
  113. package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts +6 -4
  114. package/node_modules/@appium/types/build/lib/commands/basedriver.d.ts.map +1 -1
  115. package/node_modules/@appium/types/lib/commands/basedriver.ts +4 -4
  116. package/node_modules/@appium/types/package.json +2 -2
  117. package/node_modules/appium-xcode/CHANGELOG.md +7 -0
  118. package/node_modules/appium-xcode/package.json +4 -4
  119. package/node_modules/asyncbox/README.md +43 -0
  120. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts +9 -0
  121. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -0
  122. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +35 -0
  123. package/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -0
  124. package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts +9 -0
  125. package/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -0
  126. package/node_modules/asyncbox/build/cjs/lib/asyncmap.js +23 -0
  127. package/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -0
  128. package/node_modules/asyncbox/build/cjs/lib/errors.d.ts +9 -0
  129. package/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -0
  130. package/node_modules/asyncbox/build/cjs/lib/errors.js +20 -0
  131. package/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -0
  132. package/node_modules/asyncbox/build/cjs/lib/index.d.ts +12 -0
  133. package/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -0
  134. package/node_modules/asyncbox/build/cjs/lib/index.js +24 -0
  135. package/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -0
  136. package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts +3 -0
  137. package/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts.map +1 -0
  138. package/node_modules/asyncbox/build/cjs/lib/limit-function.js +15 -0
  139. package/node_modules/asyncbox/build/cjs/lib/limit-function.js.map +1 -0
  140. package/node_modules/asyncbox/build/cjs/lib/lock.d.ts +74 -0
  141. package/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -0
  142. package/node_modules/asyncbox/build/cjs/lib/lock.js +295 -0
  143. package/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -0
  144. package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts +15 -0
  145. package/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts.map +1 -0
  146. package/node_modules/asyncbox/build/cjs/lib/long-sleep.js +36 -0
  147. package/node_modules/asyncbox/build/cjs/lib/long-sleep.js.map +1 -0
  148. package/node_modules/asyncbox/build/cjs/lib/retry.d.ts +17 -0
  149. package/node_modules/asyncbox/build/cjs/lib/retry.d.ts.map +1 -0
  150. package/node_modules/asyncbox/build/cjs/lib/retry.js +57 -0
  151. package/node_modules/asyncbox/build/cjs/lib/retry.js.map +1 -0
  152. package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts +20 -0
  153. package/node_modules/asyncbox/build/cjs/lib/sleep.d.ts.map +1 -0
  154. package/node_modules/asyncbox/build/cjs/lib/sleep.js +61 -0
  155. package/node_modules/asyncbox/build/cjs/lib/sleep.js.map +1 -0
  156. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +18 -0
  157. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -0
  158. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +51 -0
  159. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -0
  160. package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts +16 -0
  161. package/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts.map +1 -0
  162. package/node_modules/asyncbox/build/cjs/lib/with-timeout.js +45 -0
  163. package/node_modules/asyncbox/build/cjs/lib/with-timeout.js.map +1 -0
  164. package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts +9 -0
  165. package/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -0
  166. package/node_modules/asyncbox/build/esm/lib/asyncfilter.js +32 -0
  167. package/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -0
  168. package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts +9 -0
  169. package/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -0
  170. package/node_modules/asyncbox/build/esm/lib/asyncmap.js +20 -0
  171. package/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -0
  172. package/node_modules/asyncbox/build/esm/lib/errors.d.ts +9 -0
  173. package/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -0
  174. package/node_modules/asyncbox/build/esm/lib/errors.js +15 -0
  175. package/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -0
  176. package/node_modules/asyncbox/build/esm/lib/index.d.ts +12 -0
  177. package/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -0
  178. package/node_modules/asyncbox/build/esm/lib/index.js +10 -0
  179. package/node_modules/asyncbox/build/esm/lib/index.js.map +1 -0
  180. package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts +3 -0
  181. package/node_modules/asyncbox/build/esm/lib/limit-function.d.ts.map +1 -0
  182. package/node_modules/asyncbox/build/esm/lib/limit-function.js +12 -0
  183. package/node_modules/asyncbox/build/esm/lib/limit-function.js.map +1 -0
  184. package/node_modules/asyncbox/build/esm/lib/lock.d.ts +74 -0
  185. package/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -0
  186. package/node_modules/asyncbox/build/esm/lib/lock.js +291 -0
  187. package/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -0
  188. package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts +15 -0
  189. package/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts.map +1 -0
  190. package/node_modules/asyncbox/build/esm/lib/long-sleep.js +33 -0
  191. package/node_modules/asyncbox/build/esm/lib/long-sleep.js.map +1 -0
  192. package/node_modules/asyncbox/build/esm/lib/retry.d.ts +17 -0
  193. package/node_modules/asyncbox/build/esm/lib/retry.d.ts.map +1 -0
  194. package/node_modules/asyncbox/build/esm/lib/retry.js +53 -0
  195. package/node_modules/asyncbox/build/esm/lib/retry.js.map +1 -0
  196. package/node_modules/asyncbox/build/esm/lib/sleep.d.ts +20 -0
  197. package/node_modules/asyncbox/build/esm/lib/sleep.d.ts.map +1 -0
  198. package/node_modules/asyncbox/build/esm/lib/sleep.js +58 -0
  199. package/node_modules/asyncbox/build/esm/lib/sleep.js.map +1 -0
  200. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +18 -0
  201. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -0
  202. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +48 -0
  203. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -0
  204. package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts +16 -0
  205. package/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts.map +1 -0
  206. package/node_modules/asyncbox/build/esm/lib/with-timeout.js +42 -0
  207. package/node_modules/asyncbox/build/esm/lib/with-timeout.js.map +1 -0
  208. package/node_modules/asyncbox/lib/asyncfilter.ts +38 -0
  209. package/node_modules/asyncbox/lib/asyncmap.ts +29 -0
  210. package/node_modules/asyncbox/lib/errors.ts +15 -0
  211. package/node_modules/asyncbox/lib/index.ts +21 -0
  212. package/node_modules/asyncbox/lib/limit-function.ts +18 -0
  213. package/node_modules/asyncbox/lib/lock.ts +360 -0
  214. package/node_modules/asyncbox/lib/long-sleep.ts +38 -0
  215. package/node_modules/asyncbox/lib/retry.ts +61 -0
  216. package/node_modules/asyncbox/lib/sleep.ts +79 -0
  217. package/node_modules/asyncbox/lib/wait-for-condition.ts +52 -0
  218. package/node_modules/asyncbox/lib/with-timeout.ts +43 -0
  219. package/node_modules/asyncbox/package.json +8 -8
  220. package/node_modules/axios/README.md +41 -106
  221. package/node_modules/axios/dist/axios.js +931 -278
  222. package/node_modules/axios/dist/axios.min.js +2 -2
  223. package/node_modules/axios/dist/axios.min.js.map +1 -1
  224. package/node_modules/axios/dist/browser/axios.cjs +948 -268
  225. package/node_modules/axios/dist/esm/axios.js +948 -268
  226. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  227. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  228. package/node_modules/axios/dist/node/axios.cjs +925 -242
  229. package/node_modules/axios/index.d.cts +20 -1
  230. package/node_modules/axios/index.d.ts +18 -1
  231. package/node_modules/axios/lib/adapters/fetch.js +73 -20
  232. package/node_modules/axios/lib/adapters/http.js +145 -26
  233. package/node_modules/axios/lib/adapters/xhr.js +120 -13
  234. package/node_modules/axios/lib/core/Axios.js +67 -12
  235. package/node_modules/axios/lib/core/AxiosError.js +59 -0
  236. package/node_modules/axios/lib/core/AxiosHeaders.js +17 -4
  237. package/node_modules/axios/lib/core/InterceptorManager.js +13 -2
  238. package/node_modules/axios/lib/core/assertParamsAcyclic.js +49 -0
  239. package/node_modules/axios/lib/core/createMultipartBody.js +37 -0
  240. package/node_modules/axios/lib/core/dispatchRequest.js +20 -0
  241. package/node_modules/axios/lib/core/mergeConfig.js +183 -120
  242. package/node_modules/axios/lib/defaults/transitional.js +1 -0
  243. package/node_modules/axios/lib/env/data.js +1 -1
  244. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +11 -2
  245. package/node_modules/axios/lib/helpers/Http2Sessions.js +2 -1
  246. package/node_modules/axios/lib/helpers/composeSignals.js +6 -3
  247. package/node_modules/axios/lib/helpers/cookies.js +30 -6
  248. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +34 -7
  249. package/node_modules/axios/lib/helpers/formDataToBlob.js +113 -0
  250. package/node_modules/axios/lib/helpers/formDataToJSON.js +25 -1
  251. package/node_modules/axios/lib/helpers/fromDataURI.js +8 -2
  252. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +4 -9
  253. package/node_modules/axios/lib/helpers/parseHeaders.js +2 -1
  254. package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
  255. package/node_modules/axios/lib/helpers/resolveConfig.js +16 -3
  256. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +16 -1
  257. package/node_modules/axios/lib/utils.js +61 -10
  258. package/node_modules/axios/package.json +1 -2
  259. package/node_modules/follow-redirects/README.md +27 -1
  260. package/node_modules/follow-redirects/index.js +1 -5
  261. package/node_modules/follow-redirects/package.json +1 -1
  262. package/node_modules/shell-quote/README.md +37 -4
  263. package/node_modules/shell-quote/package.json +10 -6
  264. package/node_modules/shell-quote/parse.d.ts +1 -1
  265. package/node_modules/shell-quote/parse.js +63 -11
  266. package/node_modules/shell-quote/quote.d.ts +2 -1
  267. package/node_modules/shell-quote/quote.js +23 -3
  268. package/node_modules/uuid/package.json +17 -17
  269. package/package.json +4 -6
  270. package/node_modules/async-lock/AUTHORS +0 -21
  271. package/node_modules/async-lock/History.md +0 -132
  272. package/node_modules/async-lock/LICENSE +0 -22
  273. package/node_modules/async-lock/README.md +0 -177
  274. package/node_modules/async-lock/index.js +0 -2
  275. package/node_modules/async-lock/lib/index.js +0 -312
  276. package/node_modules/async-lock/package.json +0 -48
  277. package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
  278. package/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
  279. package/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -311
  280. package/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
  281. package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
  282. package/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
  283. package/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -298
  284. package/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
  285. package/node_modules/asyncbox/lib/asyncbox.ts +0 -382
  286. package/node_modules/shell-quote/.nycrc +0 -14
  287. package/node_modules/shell-quote/eslint.config.mjs +0 -29
  288. package/node_modules/shell-quote/security.md +0 -11
  289. package/node_modules/shell-quote/test/comment.js +0 -16
  290. package/node_modules/shell-quote/test/env.js +0 -52
  291. package/node_modules/shell-quote/test/env_fn.js +0 -21
  292. package/node_modules/shell-quote/test/op.js +0 -102
  293. package/node_modules/shell-quote/test/parse.js +0 -149
  294. package/node_modules/shell-quote/test/quote.js +0 -145
  295. package/node_modules/shell-quote/test/set.js +0 -31
@@ -1,311 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PromiseCancellationError = exports.TimeoutError = void 0;
4
- exports.sleep = sleep;
5
- exports.withTimeout = withTimeout;
6
- exports.longSleep = longSleep;
7
- exports.retry = retry;
8
- exports.retryInterval = retryInterval;
9
- exports.asyncmap = asyncmap;
10
- exports.asyncfilter = asyncfilter;
11
- exports.waitForCondition = waitForCondition;
12
- const LONG_SLEEP_THRESHOLD = 5000; // anything over 5000ms will turn into a spin
13
- // p-limit is ESM-only. tsc downlevels a plain `import()` in CommonJS output into a
14
- // require()-in-a-microtask, which still hits Node's require(esm) interop and can race with a
15
- // concurrent dynamic import() of the same module elsewhere in the process
16
- // (ERR_REQUIRE_ESM_RACE_CONDITION). Route through `new Function` so tsc can't see or rewrite the
17
- // import() call, keeping it a genuine native dynamic import in both the ESM and CJS builds.
18
- const dynamicImport = new Function('specifier', 'return import(specifier)');
19
- /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
20
- class TimeoutError extends Error {
21
- constructor(message) {
22
- super(message ?? 'Operation timed out');
23
- this.name = 'TimeoutError';
24
- }
25
- }
26
- exports.TimeoutError = TimeoutError;
27
- /** Thrown when a promise is cancelled via `cancel`. */
28
- class PromiseCancellationError extends Error {
29
- constructor(message = 'Promise cancelled') {
30
- super(message);
31
- this.name = 'PromiseCancellationError';
32
- }
33
- }
34
- exports.PromiseCancellationError = PromiseCancellationError;
35
- function sleep(arg) {
36
- const { ms, cancelError } = parseSleepArg(arg);
37
- let timeoutId;
38
- let resolveFn;
39
- let rejectFn;
40
- const promise = new Promise((resolve, reject) => {
41
- resolveFn = resolve;
42
- rejectFn = reject;
43
- timeoutId = setTimeout(resolve, ms);
44
- });
45
- promise.cancel = () => {
46
- if (timeoutId) {
47
- clearTimeout(timeoutId);
48
- timeoutId = undefined;
49
- }
50
- if (cancelError === null) {
51
- resolveFn?.(undefined);
52
- }
53
- else {
54
- let err;
55
- if (typeof cancelError === 'string' && cancelError) {
56
- err = new PromiseCancellationError(cancelError);
57
- }
58
- else if (cancelError instanceof Error) {
59
- err = cancelError;
60
- }
61
- else {
62
- err = new PromiseCancellationError();
63
- }
64
- rejectFn?.(err);
65
- }
66
- resolveFn = undefined;
67
- rejectFn = undefined;
68
- };
69
- return promise;
70
- }
71
- /**
72
- * Resolves with `promise` or rejects if it does not settle before `timeoutMs`.
73
- *
74
- * If the deadline passes first: with no third argument (or a falsy non-error value), rejects
75
- * with {@link TimeoutError} whose message includes `timeoutMs`; with a non-empty string,
76
- * rejects with {@link TimeoutError} using that message; with an `Error` instance, rejects
77
- * with that same instance.
78
- *
79
- * @param promise - Promise to race against the timeout.
80
- * @param timeoutMs - Maximum time in milliseconds before rejecting if `promise` has not settled.
81
- * @param messageOrError - Optional override for the timeout rejection: custom {@link TimeoutError}
82
- * message when the string is non-empty, or an existing `Error` to reject with verbatim.
83
- * Omitted, `undefined`, or other falsy non-error values use the default timeout message (includes `timeoutMs`).
84
- */
85
- async function withTimeout(promise, timeoutMs, messageOrError) {
86
- let timer = null;
87
- try {
88
- return await Promise.race([
89
- promise,
90
- new Promise((_resolve, reject) => {
91
- timer = setTimeout(() => {
92
- if (typeof messageOrError === 'string' && messageOrError) {
93
- reject(new TimeoutError(messageOrError));
94
- }
95
- else if (!messageOrError) {
96
- reject(new TimeoutError(`Operation timed out after ${timeoutMs}ms`));
97
- }
98
- else {
99
- reject(messageOrError);
100
- }
101
- }, timeoutMs);
102
- }),
103
- ]);
104
- }
105
- finally {
106
- if (timer) {
107
- clearTimeout(timer);
108
- }
109
- }
110
- }
111
- /**
112
- * Sometimes `Promise.delay` or `setTimeout` are inaccurate for large wait
113
- * times. To safely wait for these long times (e.g. in the 5+ minute range), you
114
- * can use `longSleep`.
115
- *
116
- * You can also pass a `progressCb` option which is a callback function that
117
- * receives an object with the properties `elapsedMs`, `timeLeft`, and
118
- * `progress`. This will be called on every wait interval so you can do your
119
- * wait logging or whatever.
120
- * @param ms - The number of milliseconds to wait
121
- * @param options - Options for controlling the long sleep behavior
122
- */
123
- async function longSleep(ms, { thresholdMs = LONG_SLEEP_THRESHOLD, intervalMs = 1000, progressCb = null } = {}) {
124
- if (ms < thresholdMs) {
125
- return await sleep(ms);
126
- }
127
- const endAt = Date.now() + ms;
128
- let timeLeft;
129
- let elapsedMs = 0;
130
- do {
131
- const pre = Date.now();
132
- await sleep(intervalMs);
133
- const post = Date.now();
134
- timeLeft = endAt - post;
135
- elapsedMs = elapsedMs + (post - pre);
136
- if (typeof progressCb === 'function') {
137
- progressCb({ elapsedMs, timeLeft, progress: elapsedMs / ms });
138
- }
139
- } while (timeLeft > 0);
140
- }
141
- /**
142
- * An async/await way of running a method until it doesn't throw an error
143
- * @param times - The maximum number of times to retry the function
144
- * @param fn - The async function to retry
145
- * @param args - Arguments to pass to the function
146
- */
147
- async function retry(times, fn, ...args) {
148
- let tries = 0;
149
- let done = false;
150
- let res = null;
151
- while (!done && tries < times) {
152
- tries++;
153
- try {
154
- res = await fn(...args);
155
- done = true;
156
- }
157
- catch (err) {
158
- if (tries >= times) {
159
- throw err;
160
- }
161
- }
162
- }
163
- return res;
164
- }
165
- /**
166
- * You can also use `retryInterval` to add a sleep in between retries. This can
167
- * be useful if you want to throttle how fast we retry.
168
- * @param times - The maximum number of times to retry the function
169
- * @param sleepMs - The number of milliseconds to wait between retries
170
- * @param fn - The async function to retry
171
- * @param args - Arguments to pass to the function
172
- */
173
- async function retryInterval(times, sleepMs, fn, ...args) {
174
- let count = 0;
175
- const wrapped = async () => {
176
- count++;
177
- let res;
178
- try {
179
- res = await fn(...args);
180
- }
181
- catch (e) {
182
- // do not pause when finished the last retry
183
- if (count !== times) {
184
- await sleep(sleepMs);
185
- }
186
- throw e;
187
- }
188
- return res;
189
- };
190
- return await retry(times, wrapped);
191
- }
192
- /**
193
- * Similar to `Array.prototype.map`; runs in parallel, serial, or with custom concurrency pool
194
- * @param coll - The collection to map over
195
- * @param mapper - The function to apply to each element
196
- * @param options - Options for controlling parallelism (default: true - fully parallel)
197
- */
198
- async function asyncmap(coll, mapper, options = true) {
199
- if (options === null) {
200
- throw new Error('Options cannot be null');
201
- }
202
- // limitFunction requires the mapper to always return a promise
203
- const mapperAsync = async (value) => mapper(value);
204
- if (options === false) {
205
- return coll.reduce(async (acc, item) => [...(await acc), await mapperAsync(item)], Promise.resolve([]));
206
- }
207
- const adjustedMapper = options === true ? mapperAsync : (await getLimitFunction())(mapperAsync, { concurrency: options.concurrency });
208
- return Promise.all(coll.map(adjustedMapper));
209
- }
210
- /**
211
- * Similar to `Array.prototype.filter`; runs in parallel, serial, or with custom concurrency pool
212
- * @param coll - The collection to filter
213
- * @param filter - The function to test each element
214
- * @param options - Options for controlling parallelism (default: true - fully parallel)
215
- */
216
- async function asyncfilter(coll, filter, options = true) {
217
- if (options === null) {
218
- throw new Error('Options cannot be null');
219
- }
220
- // limitFunction requires the filter to always return a promise
221
- const filterAsync = async (value) => filter(value);
222
- if (options === false) {
223
- return coll.reduce(async (accP, item) => {
224
- const acc = await accP;
225
- if (await filterAsync(item)) {
226
- acc.push(item);
227
- }
228
- return acc;
229
- }, Promise.resolve([]));
230
- }
231
- const adjustedFilter = options === true ? filterAsync : (await getLimitFunction())(filterAsync, { concurrency: options.concurrency });
232
- const bools = await Promise.all(coll.map(adjustedFilter));
233
- return coll.reduce((acc, item, i) => {
234
- if (bools[i]) {
235
- acc.push(item);
236
- }
237
- return acc;
238
- }, []);
239
- }
240
- /**
241
- * Takes a condition (a function returning a boolean or boolean promise), and
242
- * waits until the condition is true.
243
- *
244
- * Throws a `/Condition unmet/` error if the condition has not been satisfied
245
- * within the allocated time, unless an error is provided in the options, as the
246
- * `error` property, which is either thrown itself, or used as the message.
247
- *
248
- * The condition result is returned if it is not falsy. If the condition throws an
249
- * error then this exception will be immediately passed through.
250
- *
251
- * The default options are: `{ waitMs: 5000, intervalMs: 500 }`
252
- * @param condFn - The condition function to evaluate
253
- * @param options - Options for controlling the wait behavior
254
- */
255
- async function waitForCondition(condFn, options = {}) {
256
- const opts = {
257
- ...options,
258
- waitMs: typeof options.waitMs === 'number' ? options.waitMs : 5000,
259
- intervalMs: typeof options.intervalMs === 'number' ? options.intervalMs : 500,
260
- };
261
- const debug = opts.logger ? opts.logger.debug.bind(opts.logger) : () => undefined;
262
- const error = opts.error;
263
- const begunAt = Date.now();
264
- const endAt = begunAt + opts.waitMs;
265
- const spin = async function spin() {
266
- const result = await condFn();
267
- if (result) {
268
- return result;
269
- }
270
- const now = Date.now();
271
- const waited = now - begunAt;
272
- const remainingTime = endAt - now;
273
- if (now < endAt) {
274
- debug(`Waited for ${waited} ms so far`);
275
- await sleep(Math.min(opts.intervalMs, remainingTime));
276
- return await spin();
277
- }
278
- // if there is an error option, it is either a string message or an error itself
279
- if (error) {
280
- throw typeof error === 'string' ? new Error(error) : error;
281
- }
282
- throw new Error(`Condition unmet after ${waited} ms. Timing out.`);
283
- };
284
- return await spin();
285
- }
286
- /** Non-array object values (including class instances); excludes `null` and arrays. */
287
- function isSleepArgObject(value) {
288
- return value !== null && typeof value === 'object' && !Array.isArray(value);
289
- }
290
- function parseSleepArg(arg) {
291
- if (typeof arg === 'number') {
292
- if (!Number.isFinite(arg)) {
293
- throw new TypeError('sleep: expected a finite number or an object with ms');
294
- }
295
- return { ms: arg };
296
- }
297
- if (isSleepArgObject(arg)) {
298
- const ms = arg.ms;
299
- if (typeof ms !== 'number' || !Number.isFinite(ms)) {
300
- throw new TypeError('sleep: options.ms must be a finite number');
301
- }
302
- return { ms, cancelError: arg.cancelError };
303
- }
304
- throw new TypeError('sleep: expected a finite number or an object with ms');
305
- }
306
- let limitFunctionPromise;
307
- async function getLimitFunction() {
308
- limitFunctionPromise ??= dynamicImport('p-limit');
309
- return (await limitFunctionPromise).limitFunction;
310
- }
311
- //# sourceMappingURL=asyncbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"asyncbox.js","sourceRoot":"","sources":["../../../lib/asyncbox.ts"],"names":[],"mappings":";;;AA0DA,sBAmCC;AAgBD,kCA0BC;AAcD,8BAoBC;AAQD,sBAoBC;AAUD,sCAsBC;AAQD,4BAmBC;AAQD,kCA4BC;AAiBD,4CAiCC;AA3UD,MAAM,oBAAoB,GAAG,IAAI,CAAC,CAAC,6CAA6C;AAIhF,mFAAmF;AACnF,6FAA6F;AAC7F,0EAA0E;AAC1E,iGAAiG;AACjG,4FAA4F;AAC5F,MAAM,aAAa,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAEhD,CAAC;AAE3B,yEAAyE;AACzE,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,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C;QACD,OAAO,EAAC,EAAE,EAAE,WAAW,EAAE,GAAG,CAAC,WAAgD,EAAC,CAAC;IACjF,CAAC;IACD,MAAM,IAAI,SAAS,CAAC,sDAAsD,CAAC,CAAC;AAC9E,CAAC;AAED,IAAI,oBAAuD,CAAC;AAC5D,KAAK,UAAU,gBAAgB;IAC7B,oBAAoB,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC;IAClD,OAAO,CAAC,MAAM,oBAAoB,CAAC,CAAC,aAAa,CAAC;AACpD,CAAC"}
@@ -1,103 +0,0 @@
1
- import type { CancellablePromise, LongSleepOptions, MapFilterOptions, SleepOptions, WaitForConditionOptions } from './types.js';
2
- /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
3
- export declare class TimeoutError extends Error {
4
- constructor(message?: string);
5
- }
6
- /** Thrown when a promise is cancelled via `cancel`. */
7
- export declare class PromiseCancellationError extends Error {
8
- constructor(message?: string);
9
- }
10
- /**
11
- * An async/await version of `setTimeout`. The returned promise has a `cancel()` method that clears
12
- * the timer and usually rejects with {@link PromiseCancellationError} unless you use the object form with
13
- * `cancelError: null` to resolve on cancel.
14
- *
15
- * @param ms - Milliseconds to wait
16
- * @returns A thenable you can `await`; call `.cancel()` to abort early.
17
- */
18
- export declare function sleep(ms: number): CancellablePromise<void>;
19
- /**
20
- * Object form: `ms` plus optional `cancelError` (non-empty string or `Error`, `null` to resolve on
21
- * cancel, or omitted / `undefined` / `''` for default {@link PromiseCancellationError}). Any non-array
22
- * object with a finite `ms` is accepted at runtime (including class instances), matching structural typing.
23
- *
24
- * @param options - Duration and optional cancellation behavior
25
- * @returns A thenable you can `await`; call `.cancel()` to abort early.
26
- */
27
- export declare function sleep(options: SleepOptions): CancellablePromise<void>;
28
- /**
29
- * Resolves with `promise` or rejects if it does not settle before `timeoutMs`.
30
- *
31
- * If the deadline passes first: with no third argument (or a falsy non-error value), rejects
32
- * with {@link TimeoutError} whose message includes `timeoutMs`; with a non-empty string,
33
- * rejects with {@link TimeoutError} using that message; with an `Error` instance, rejects
34
- * with that same instance.
35
- *
36
- * @param promise - Promise to race against the timeout.
37
- * @param timeoutMs - Maximum time in milliseconds before rejecting if `promise` has not settled.
38
- * @param messageOrError - Optional override for the timeout rejection: custom {@link TimeoutError}
39
- * message when the string is non-empty, or an existing `Error` to reject with verbatim.
40
- * Omitted, `undefined`, or other falsy non-error values use the default timeout message (includes `timeoutMs`).
41
- */
42
- export declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, messageOrError?: string | Error): Promise<T>;
43
- /**
44
- * Sometimes `Promise.delay` or `setTimeout` are inaccurate for large wait
45
- * times. To safely wait for these long times (e.g. in the 5+ minute range), you
46
- * can use `longSleep`.
47
- *
48
- * You can also pass a `progressCb` option which is a callback function that
49
- * receives an object with the properties `elapsedMs`, `timeLeft`, and
50
- * `progress`. This will be called on every wait interval so you can do your
51
- * wait logging or whatever.
52
- * @param ms - The number of milliseconds to wait
53
- * @param options - Options for controlling the long sleep behavior
54
- */
55
- export declare function longSleep(ms: number, { thresholdMs, intervalMs, progressCb }?: LongSleepOptions): Promise<void>;
56
- /**
57
- * An async/await way of running a method until it doesn't throw an error
58
- * @param times - The maximum number of times to retry the function
59
- * @param fn - The async function to retry
60
- * @param args - Arguments to pass to the function
61
- */
62
- export declare function retry<T = any>(times: number, fn: (...args: any[]) => Promise<T>, ...args: any[]): Promise<T | null>;
63
- /**
64
- * You can also use `retryInterval` to add a sleep in between retries. This can
65
- * be useful if you want to throttle how fast we retry.
66
- * @param times - The maximum number of times to retry the function
67
- * @param sleepMs - The number of milliseconds to wait between retries
68
- * @param fn - The async function to retry
69
- * @param args - Arguments to pass to the function
70
- */
71
- export declare function retryInterval<T = any>(times: number, sleepMs: number, fn: (...args: any[]) => Promise<T>, ...args: any[]): Promise<T | null>;
72
- /**
73
- * Similar to `Array.prototype.map`; runs in parallel, serial, or with custom concurrency pool
74
- * @param coll - The collection to map over
75
- * @param mapper - The function to apply to each element
76
- * @param options - Options for controlling parallelism (default: true - fully parallel)
77
- */
78
- export declare function asyncmap<T, R>(coll: T[], mapper: (value: T) => R | Promise<R>, options?: MapFilterOptions): Promise<R[]>;
79
- /**
80
- * Similar to `Array.prototype.filter`; runs in parallel, serial, or with custom concurrency pool
81
- * @param coll - The collection to filter
82
- * @param filter - The function to test each element
83
- * @param options - Options for controlling parallelism (default: true - fully parallel)
84
- */
85
- export declare function asyncfilter<T>(coll: T[], filter: (value: T) => boolean | Promise<boolean>, options?: MapFilterOptions): Promise<T[]>;
86
- /**
87
- * Takes a condition (a function returning a boolean or boolean promise), and
88
- * waits until the condition is true.
89
- *
90
- * Throws a `/Condition unmet/` error if the condition has not been satisfied
91
- * within the allocated time, unless an error is provided in the options, as the
92
- * `error` property, which is either thrown itself, or used as the message.
93
- *
94
- * The condition result is returned if it is not falsy. If the condition throws an
95
- * error then this exception will be immediately passed through.
96
- *
97
- * The default options are: `{ waitMs: 5000, intervalMs: 500 }`
98
- * @param condFn - The condition function to evaluate
99
- * @param options - Options for controlling the wait behavior
100
- */
101
- export declare function waitForCondition<T>(condFn: () => Promise<T> | T, options?: WaitForConditionOptions): Promise<T>;
102
- export type { CancellablePromise, Progress, ProgressCallback, LongSleepOptions, SleepArg, SleepOptions, WaitForConditionOptions, } from './types.js';
103
- //# sourceMappingURL=asyncbox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"asyncbox.d.ts","sourceRoot":"","sources":["../../../lib/asyncbox.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAEhB,YAAY,EACZ,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAepB,yEAAyE;AACzE,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,uDAAuD;AACvD,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,GAAE,MAA4B;CAIlD;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,EAA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