appium-mac2-driver 4.6.0 → 4.6.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 (265) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/WebDriverAgentMac/WebDriverAgentRunner/WebDriverAgentRunner.m +3 -0
  3. package/node_modules/@appium/base-driver/node_modules/asyncbox/LICENSE +203 -0
  4. package/node_modules/@appium/base-driver/node_modules/asyncbox/README.md +258 -0
  5. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts +9 -0
  6. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -0
  7. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +35 -0
  8. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -0
  9. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts +9 -0
  10. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -0
  11. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncmap.js +23 -0
  12. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -0
  13. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/errors.d.ts +9 -0
  14. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -0
  15. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/errors.js +20 -0
  16. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -0
  17. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/index.d.ts +12 -0
  18. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -0
  19. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/index.js +24 -0
  20. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -0
  21. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts +3 -0
  22. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts.map +1 -0
  23. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/limit-function.js +15 -0
  24. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/limit-function.js.map +1 -0
  25. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/lock.d.ts +74 -0
  26. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -0
  27. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/lock.js +295 -0
  28. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -0
  29. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts +15 -0
  30. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts.map +1 -0
  31. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/long-sleep.js +36 -0
  32. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/long-sleep.js.map +1 -0
  33. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/retry.d.ts +17 -0
  34. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/retry.d.ts.map +1 -0
  35. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/retry.js +57 -0
  36. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/retry.js.map +1 -0
  37. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/sleep.d.ts +20 -0
  38. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/sleep.d.ts.map +1 -0
  39. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/sleep.js +61 -0
  40. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/sleep.js.map +1 -0
  41. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.d.ts +84 -0
  42. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +1 -0
  43. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.js +3 -0
  44. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/types.js.map +1 -0
  45. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +18 -0
  46. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -0
  47. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +51 -0
  48. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -0
  49. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts +16 -0
  50. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts.map +1 -0
  51. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/with-timeout.js +45 -0
  52. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/lib/with-timeout.js.map +1 -0
  53. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/cjs/package.json +3 -0
  54. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts +9 -0
  55. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -0
  56. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncfilter.js +32 -0
  57. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -0
  58. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts +9 -0
  59. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -0
  60. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncmap.js +20 -0
  61. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -0
  62. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/errors.d.ts +9 -0
  63. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -0
  64. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/errors.js +15 -0
  65. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -0
  66. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/index.d.ts +12 -0
  67. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -0
  68. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/index.js +10 -0
  69. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/index.js.map +1 -0
  70. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/limit-function.d.ts +3 -0
  71. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/limit-function.d.ts.map +1 -0
  72. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/limit-function.js +12 -0
  73. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/limit-function.js.map +1 -0
  74. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/lock.d.ts +74 -0
  75. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -0
  76. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/lock.js +291 -0
  77. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -0
  78. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts +15 -0
  79. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts.map +1 -0
  80. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/long-sleep.js +33 -0
  81. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/long-sleep.js.map +1 -0
  82. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/retry.d.ts +17 -0
  83. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/retry.d.ts.map +1 -0
  84. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/retry.js +53 -0
  85. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/retry.js.map +1 -0
  86. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/sleep.d.ts +20 -0
  87. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/sleep.d.ts.map +1 -0
  88. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/sleep.js +58 -0
  89. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/sleep.js.map +1 -0
  90. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.d.ts +84 -0
  91. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.d.ts.map +1 -0
  92. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.js +2 -0
  93. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/types.js.map +1 -0
  94. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +18 -0
  95. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -0
  96. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +48 -0
  97. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -0
  98. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts +16 -0
  99. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts.map +1 -0
  100. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/with-timeout.js +42 -0
  101. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/lib/with-timeout.js.map +1 -0
  102. package/node_modules/@appium/base-driver/node_modules/asyncbox/build/esm/package.json +3 -0
  103. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/asyncfilter.ts +38 -0
  104. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/asyncmap.ts +29 -0
  105. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/errors.ts +15 -0
  106. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/index.ts +21 -0
  107. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/limit-function.ts +18 -0
  108. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/lock.ts +360 -0
  109. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/long-sleep.ts +38 -0
  110. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/retry.ts +61 -0
  111. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/sleep.ts +79 -0
  112. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/types.ts +88 -0
  113. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/wait-for-condition.ts +52 -0
  114. package/node_modules/@appium/base-driver/node_modules/asyncbox/lib/with-timeout.ts +43 -0
  115. package/node_modules/@appium/base-driver/node_modules/asyncbox/package.json +74 -0
  116. package/node_modules/@appium/support/node_modules/asyncbox/LICENSE +203 -0
  117. package/node_modules/@appium/support/node_modules/asyncbox/README.md +258 -0
  118. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts +9 -0
  119. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncfilter.d.ts.map +1 -0
  120. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncfilter.js +35 -0
  121. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncfilter.js.map +1 -0
  122. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts +9 -0
  123. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncmap.d.ts.map +1 -0
  124. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncmap.js +23 -0
  125. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncmap.js.map +1 -0
  126. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/errors.d.ts +9 -0
  127. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -0
  128. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/errors.js +20 -0
  129. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -0
  130. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/index.d.ts +12 -0
  131. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -0
  132. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/index.js +24 -0
  133. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -0
  134. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts +3 -0
  135. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/limit-function.d.ts.map +1 -0
  136. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/limit-function.js +15 -0
  137. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/limit-function.js.map +1 -0
  138. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/lock.d.ts +74 -0
  139. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -0
  140. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/lock.js +295 -0
  141. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -0
  142. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts +15 -0
  143. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/long-sleep.d.ts.map +1 -0
  144. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/long-sleep.js +36 -0
  145. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/long-sleep.js.map +1 -0
  146. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/retry.d.ts +17 -0
  147. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/retry.d.ts.map +1 -0
  148. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/retry.js +57 -0
  149. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/retry.js.map +1 -0
  150. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/sleep.d.ts +20 -0
  151. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/sleep.d.ts.map +1 -0
  152. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/sleep.js +61 -0
  153. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/sleep.js.map +1 -0
  154. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts +84 -0
  155. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +1 -0
  156. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js +3 -0
  157. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js.map +1 -0
  158. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +18 -0
  159. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -0
  160. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +51 -0
  161. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -0
  162. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts +16 -0
  163. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/with-timeout.d.ts.map +1 -0
  164. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/with-timeout.js +45 -0
  165. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/with-timeout.js.map +1 -0
  166. package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/package.json +3 -0
  167. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts +9 -0
  168. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncfilter.d.ts.map +1 -0
  169. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncfilter.js +32 -0
  170. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncfilter.js.map +1 -0
  171. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts +9 -0
  172. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncmap.d.ts.map +1 -0
  173. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncmap.js +20 -0
  174. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncmap.js.map +1 -0
  175. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/errors.d.ts +9 -0
  176. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -0
  177. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/errors.js +15 -0
  178. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -0
  179. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/index.d.ts +12 -0
  180. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -0
  181. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/index.js +10 -0
  182. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/index.js.map +1 -0
  183. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/limit-function.d.ts +3 -0
  184. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/limit-function.d.ts.map +1 -0
  185. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/limit-function.js +12 -0
  186. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/limit-function.js.map +1 -0
  187. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/lock.d.ts +74 -0
  188. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -0
  189. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/lock.js +291 -0
  190. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -0
  191. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts +15 -0
  192. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/long-sleep.d.ts.map +1 -0
  193. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/long-sleep.js +33 -0
  194. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/long-sleep.js.map +1 -0
  195. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/retry.d.ts +17 -0
  196. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/retry.d.ts.map +1 -0
  197. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/retry.js +53 -0
  198. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/retry.js.map +1 -0
  199. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/sleep.d.ts +20 -0
  200. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/sleep.d.ts.map +1 -0
  201. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/sleep.js +58 -0
  202. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/sleep.js.map +1 -0
  203. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts +84 -0
  204. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts.map +1 -0
  205. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js +2 -0
  206. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js.map +1 -0
  207. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +18 -0
  208. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -0
  209. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +48 -0
  210. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -0
  211. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts +16 -0
  212. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/with-timeout.d.ts.map +1 -0
  213. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/with-timeout.js +42 -0
  214. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/with-timeout.js.map +1 -0
  215. package/node_modules/@appium/support/node_modules/asyncbox/build/esm/package.json +3 -0
  216. package/node_modules/@appium/support/node_modules/asyncbox/lib/asyncfilter.ts +38 -0
  217. package/node_modules/@appium/support/node_modules/asyncbox/lib/asyncmap.ts +29 -0
  218. package/node_modules/@appium/support/node_modules/asyncbox/lib/errors.ts +15 -0
  219. package/node_modules/@appium/support/node_modules/asyncbox/lib/index.ts +21 -0
  220. package/node_modules/@appium/support/node_modules/asyncbox/lib/limit-function.ts +18 -0
  221. package/node_modules/@appium/support/node_modules/asyncbox/lib/lock.ts +360 -0
  222. package/node_modules/@appium/support/node_modules/asyncbox/lib/long-sleep.ts +38 -0
  223. package/node_modules/@appium/support/node_modules/asyncbox/lib/retry.ts +61 -0
  224. package/node_modules/@appium/support/node_modules/asyncbox/lib/sleep.ts +79 -0
  225. package/node_modules/@appium/support/node_modules/asyncbox/lib/types.ts +88 -0
  226. package/node_modules/@appium/support/node_modules/asyncbox/lib/wait-for-condition.ts +52 -0
  227. package/node_modules/@appium/support/node_modules/asyncbox/lib/with-timeout.ts +43 -0
  228. package/node_modules/@appium/support/node_modules/asyncbox/package.json +74 -0
  229. package/node_modules/asyncbox/README.md +18 -4
  230. package/node_modules/asyncbox/build/cjs/lib/errors.d.ts +20 -2
  231. package/node_modules/asyncbox/build/cjs/lib/errors.d.ts.map +1 -1
  232. package/node_modules/asyncbox/build/cjs/lib/errors.js +41 -6
  233. package/node_modules/asyncbox/build/cjs/lib/errors.js.map +1 -1
  234. package/node_modules/asyncbox/build/cjs/lib/index.d.ts +1 -1
  235. package/node_modules/asyncbox/build/cjs/lib/index.d.ts.map +1 -1
  236. package/node_modules/asyncbox/build/cjs/lib/index.js +5 -1
  237. package/node_modules/asyncbox/build/cjs/lib/index.js.map +1 -1
  238. package/node_modules/asyncbox/build/cjs/lib/lock.d.ts.map +1 -1
  239. package/node_modules/asyncbox/build/cjs/lib/lock.js +6 -5
  240. package/node_modules/asyncbox/build/cjs/lib/lock.js.map +1 -1
  241. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts +1 -1
  242. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.d.ts.map +1 -1
  243. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js +4 -3
  244. package/node_modules/asyncbox/build/cjs/lib/wait-for-condition.js.map +1 -1
  245. package/node_modules/asyncbox/build/esm/lib/errors.d.ts +20 -2
  246. package/node_modules/asyncbox/build/esm/lib/errors.d.ts.map +1 -1
  247. package/node_modules/asyncbox/build/esm/lib/errors.js +36 -5
  248. package/node_modules/asyncbox/build/esm/lib/errors.js.map +1 -1
  249. package/node_modules/asyncbox/build/esm/lib/index.d.ts +1 -1
  250. package/node_modules/asyncbox/build/esm/lib/index.d.ts.map +1 -1
  251. package/node_modules/asyncbox/build/esm/lib/index.js +1 -1
  252. package/node_modules/asyncbox/build/esm/lib/index.js.map +1 -1
  253. package/node_modules/asyncbox/build/esm/lib/lock.d.ts.map +1 -1
  254. package/node_modules/asyncbox/build/esm/lib/lock.js +6 -5
  255. package/node_modules/asyncbox/build/esm/lib/lock.js.map +1 -1
  256. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts +1 -1
  257. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.d.ts.map +1 -1
  258. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js +4 -3
  259. package/node_modules/asyncbox/build/esm/lib/wait-for-condition.js.map +1 -1
  260. package/node_modules/asyncbox/lib/errors.ts +41 -5
  261. package/node_modules/asyncbox/lib/index.ts +8 -1
  262. package/node_modules/asyncbox/lib/lock.ts +7 -5
  263. package/node_modules/asyncbox/lib/wait-for-condition.ts +4 -3
  264. package/node_modules/asyncbox/package.json +1 -1
  265. package/package.json +2 -2
@@ -0,0 +1,258 @@
1
+ asyncbox
2
+ ========
3
+
4
+ A collection of ES7 async/await utilities. Install via NPM:
5
+
6
+ ```
7
+ npm install asyncbox
8
+ ```
9
+
10
+ Published as both ESM and CommonJS, so `import {sleep} from 'asyncbox'` and `const {sleep} = require('asyncbox')` both work.
11
+
12
+ Then, behold!
13
+
14
+ ### Sleep
15
+
16
+ An async/await version of setTimeout
17
+
18
+ ```js
19
+ import { sleep } from 'asyncbox';
20
+
21
+ async function myFn () {
22
+ // do some stuff
23
+ await sleep(1000); // wait one second
24
+ // do some other stuff
25
+ };
26
+ ```
27
+
28
+ ### withTimeout
29
+
30
+ Race a promise against a deadline. If the promise settles first, its result is returned; if the deadline passes first, the call rejects. By default that rejection is a `TimeoutError` whose message includes how long you waited; you can pass a non-empty string for a custom `TimeoutError` message, or an `Error` instance to reject with that exact value. Omitted or other falsy third arguments (except a real `Error`) use the default timeout message.
31
+
32
+ `withTimeout` only stops *waiting* on the promise: the underlying async work keeps running (there is no built-in cancellation). Aborting a `fetch`, clearing timers, or tearing down other resources is the caller’s responsibility if you need that behavior.
33
+
34
+ ```js
35
+ import { withTimeout, TimeoutError } from 'asyncbox';
36
+
37
+ // default: TimeoutError, message includes timeoutMs
38
+ await withTimeout(fetch('/slow').then((r) => r.json()), 5000);
39
+
40
+ // custom TimeoutError message
41
+ await withTimeout(slowWork(), 10_000, 'slowWork exceeded 10s');
42
+
43
+ // reject with a specific error you constructed (same object on timeout)
44
+ const err = new MyAppError('upstream did not respond');
45
+ await withTimeout(slowWork(), 5000, err);
46
+ ```
47
+
48
+ Cancelling an in-flight `fetch` when the timeout wins:
49
+
50
+ ```js
51
+ import { withTimeout, TimeoutError } from 'asyncbox';
52
+
53
+ async function fetchJsonWithTimeout(url, timeoutMs) {
54
+ const controller = new AbortController();
55
+ const body = fetch(url, { signal: controller.signal }).then((r) => r.json());
56
+ try {
57
+ return await withTimeout(body, timeoutMs);
58
+ } catch (err) {
59
+ if (err instanceof TimeoutError) {
60
+ controller.abort();
61
+ }
62
+ throw err;
63
+ }
64
+ }
65
+ ```
66
+
67
+ ### Long Sleep
68
+
69
+ Sometimes `Promise.delay` or `setTimeout` are inaccurate for large wait times. To safely wait for these long times (e.g. in the 5+ minute range), you can use `longSleep`:
70
+
71
+ ```js
72
+ import { longSleep } from 'asyncbox';
73
+
74
+ async function myFn () {
75
+ await longSleep(10 * 60 * 1000); // wait for 10 mins
76
+ await longSleep(5000, {thresholdMs: 10000}); // wait for 5s. Anything below the thresholdMs will use a single sleep
77
+ await longSleep(5000, {intervalMs: 500}); // check the clock every 500ms to see if waiting should stop
78
+ }
79
+ ```
80
+
81
+ You can also pass a `progressCb` option which is a callback function that receives an object with the properties `elapsedMs`, `timeLeft`, and `progress`. This will be called on every wait interval so you can do your wait logging or whatever.
82
+
83
+ ```js
84
+ function progressCb({elapsedMs, timeLeft, progress}) {
85
+ console.log(`We are {progress * 100}% complete waiting`);
86
+ }
87
+ await longSleep(10 * 60 * 1000, {progressCb});
88
+ ```
89
+
90
+ ### Retry
91
+
92
+ An async/await way of running a method until it doesn't throw an error
93
+
94
+ ```js
95
+ import { sleep, retry } from 'asyncbox';
96
+
97
+ async function flakeyFunction (val1, val2) {
98
+ if (val1 < 10) {
99
+ throw new Error("this is a flakey value");
100
+ }
101
+ await sleep(1000);
102
+ return val1 + val2;
103
+ }
104
+
105
+ async function myFn () {
106
+ let randVals = [Math.random() * 100, Math.random() * 100];
107
+
108
+ // run flakeyFunction up to 3 times until it succeeds.
109
+ // if it doesn't, we'll get the error thrown in this context
110
+ let randSum = await retry(3, flakeyFunction, ...randVals);
111
+ }
112
+ ```
113
+
114
+ You can also use `retryInterval` to add a sleep in between retries. This can be
115
+ useful if you want to throttle how fast we retry:
116
+
117
+ ```js
118
+ await retryInterval(3, 1500, expensiveFunction, ...args);
119
+ ```
120
+
121
+ ### Filter/Map
122
+
123
+ Filter and map are pretty handy concepts, and now you can write filter and map
124
+ functions that execute asynchronously!
125
+
126
+ ```js
127
+ import { asyncmap, asyncfilter } from 'asyncbox';
128
+ ```
129
+
130
+ Then in your async functions, you can do:
131
+
132
+ ```js
133
+ const items = [1, 2, 3, 4];
134
+ const slowSquare = async (n) => { await sleep(5); return n * n; };
135
+ let newItems = await asyncmap(items, slowSquare);
136
+ console.log(newItems); // [1, 4, 9, 16];
137
+
138
+ const slowEven = async (n) => { await sleep(5); return n % 2 === 0; };
139
+ newItems = await asyncfilter(items, slowEven);
140
+ console.log(newItems); // [2, 4];
141
+ ```
142
+
143
+ By default, `asyncmap` and `asyncfilter` run their operations in parallel, but you
144
+ can set the third argument to `false` to enforce sequential execution, or set a custom
145
+ concurrency pool limit using `{concurrency: <number>}`:
146
+
147
+ ```js
148
+ const items = [1, 2, 3, 4];
149
+ const slowSquare = async (n) => { await sleep(5); return n * n; };
150
+ // this will run sequentially (~20ms)
151
+ const newItemsSeq = await asyncmap(items, slowSquare, false);
152
+ // this will handle 2 items at a time (~10ms)
153
+ const newItemsMaxTwo = await asyncmap(items, slowSquare, {concurrency: 2});
154
+ ```
155
+
156
+ ### waitForCondition
157
+
158
+ Takes a condition (a function returning a boolean or boolean promise),
159
+ and waits until the condition is true.
160
+
161
+ Throws a `/Condition unmet/` error if the condition has not been
162
+ satisfied within the allocated time, unless an error is provided in
163
+ the options, as the `error` property, which is either thrown itself, or
164
+ used as the message.
165
+
166
+ The condition result is returned if it is not falsy. If the condition
167
+ throws an error then this exception will be immediately passed through.
168
+
169
+ The default options are: `{ waitMs: 5000, intervalMs: 500 }`
170
+
171
+ ```js
172
+ // define your own condition
173
+ function condFn () { return Math.random()*1000 > 995; }
174
+
175
+ // with default params
176
+ await waitForCondition(condFn);
177
+
178
+ // with options
179
+ await waitForCondition(condFn, {
180
+ waitMs: 300000,
181
+ intervalMs: 10000
182
+ });
183
+
184
+ // pass a logger to get extra debug info
185
+ await waitForCondition(condFn, {
186
+ waitMs: 300000,
187
+ intervalMs: 10000
188
+ logger: myLogger // expects a debug method
189
+ });
190
+
191
+ // pass an error string to get that message in the resulting exception
192
+ try {
193
+ await waitForCondition(condFn, {
194
+ error: 'Unable to satisfy condition'
195
+ });
196
+ } catch (err) {
197
+ // err.message === 'Unable to satisfy condition'
198
+ }
199
+
200
+ // pass an error instance to be thrown
201
+ const error = new Error('Unable to satisfy condition');
202
+ try {
203
+ await waitForCondition(condFn, {
204
+ error: error
205
+ });
206
+ } catch (err) {
207
+ // err === error
208
+ }
209
+ ```
210
+
211
+ ### AsyncLock
212
+
213
+ A promise-based mutex keyed by string, derived from the unmaintained
214
+ [async-lock](https://github.com/rogierschouten/async-lock) (MIT). Tasks with the
215
+ same key run one at a time in FIFO order; different keys run concurrently.
216
+
217
+ Differences from `async-lock`: promises only (no callbacks, custom `Promise`
218
+ or domain support), and each task runs in the `AsyncLocalStorage` context of
219
+ its own `acquire` caller instead of the previous lock holder's one, so no
220
+ `AsyncResource.bind` is needed. A task that outlives `maxExecutionTime` can no
221
+ longer release the lock a second time, and queued tasks that time out are
222
+ removed from the queue.
223
+
224
+ ```js
225
+ import {AsyncLock} from 'asyncbox';
226
+
227
+ const lock = new AsyncLock({maxPending: 10});
228
+
229
+ const result = await lock.acquire('key', async () => {
230
+ // runs exclusively for 'key'
231
+ return 42;
232
+ });
233
+
234
+ // several keys are held together; they are acquired in sorted order, so overlapping calls cannot deadlock
235
+ await lock.acquire(['key1', 'key2'], () => {});
236
+
237
+ // per-call options: timeout, maxOccupationTime, maxExecutionTime, maxPending, skipQueue
238
+ await lock.acquire('key', () => {}, {timeout: 5000, skipQueue: true});
239
+
240
+ lock.getQueueLength('key'); // tasks waiting for the key (the running one is not counted)
241
+ lock.isBusy('key'); // running or pending tasks for the key
242
+ lock.isBusy(); // any key
243
+ ```
244
+
245
+ Options can be passed to the constructor and overridden per `acquire` call.
246
+ Times are in ms, up to 2147483647, and `0` means no limit.
247
+
248
+ - `timeout` (default `0`) - max wait in the queue (for all the keys of a multi-key call together) before the task is rejected and dropped
249
+ - `maxOccupationTime` (default `0`) - max time from `acquire` to completion, queue wait included; one budget is shared by all keys of a multi-key call
250
+ - `maxExecutionTime` (default `0`) - max time the task may run while holding the lock; the lock is released when exceeded (for a multi-key call, it counts from when all keys are held and releases all of them)
251
+ - `maxPending` (default `1000`) - max tasks waiting per key; further ones are rejected right away, so `0` rejects every task that would have to wait
252
+ - `skipQueue` (default `false`, per call only) - put the task at the front of the queue
253
+
254
+ ### Run the tests
255
+
256
+ ```
257
+ npm test
258
+ ```
@@ -0,0 +1,9 @@
1
+ import type { MapFilterOptions } from './types.js';
2
+ /**
3
+ * Similar to `Array.prototype.filter`; runs in parallel, serial, or with custom concurrency pool
4
+ * @param coll - The collection to filter
5
+ * @param filter - The function to test each element
6
+ * @param options - Options for controlling parallelism (default: true - fully parallel)
7
+ */
8
+ export declare function asyncfilter<T>(coll: T[], filter: (value: T) => boolean | Promise<boolean>, options?: MapFilterOptions): Promise<T[]>;
9
+ //# sourceMappingURL=asyncfilter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncfilter.d.ts","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAChD,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,CAwBd"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asyncfilter = asyncfilter;
4
+ const limit_function_js_1 = require("./limit-function.js");
5
+ /**
6
+ * Similar to `Array.prototype.filter`; runs in parallel, serial, or with custom concurrency pool
7
+ * @param coll - The collection to filter
8
+ * @param filter - The function to test each element
9
+ * @param options - Options for controlling parallelism (default: true - fully parallel)
10
+ */
11
+ async function asyncfilter(coll, filter, options = true) {
12
+ if (options === null) {
13
+ throw new Error('Options cannot be null');
14
+ }
15
+ // limitFunction requires the filter to always return a promise
16
+ const filterAsync = async (value) => filter(value);
17
+ if (options === false) {
18
+ return coll.reduce(async (accP, item) => {
19
+ const acc = await accP;
20
+ if (await filterAsync(item)) {
21
+ acc.push(item);
22
+ }
23
+ return acc;
24
+ }, Promise.resolve([]));
25
+ }
26
+ const adjustedFilter = options === true ? filterAsync : (await (0, limit_function_js_1.getLimitFunction)())(filterAsync, { concurrency: options.concurrency });
27
+ const bools = await Promise.all(coll.map(adjustedFilter));
28
+ return coll.reduce((acc, item, i) => {
29
+ if (bools[i]) {
30
+ acc.push(item);
31
+ }
32
+ return acc;
33
+ }, []);
34
+ }
35
+ //# sourceMappingURL=asyncfilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncfilter.js","sourceRoot":"","sources":["../../../lib/asyncfilter.ts"],"names":[],"mappings":";;AASA,kCA4BC;AArCD,2DAAqD;AAGrD;;;;;GAKG;AACI,KAAK,UAAU,WAAW,CAC/B,IAAS,EACT,MAAgD,EAChD,UAA4B,IAAI;IAEhC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,+DAA+D;IAC/D,MAAM,WAAW,GAAG,KAAK,EAAE,KAAQ,EAAoB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACxE,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,MAAM,CAAe,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;YACpD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC;YACvB,IAAI,MAAM,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;IACD,MAAM,cAAc,GAClB,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,oCAAgB,GAAE,CAAC,CAAC,WAAW,EAAE,EAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAC,CAAC,CAAC;IAC/G,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC,MAAM,CAAM,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { MapFilterOptions } from './types.js';
2
+ /**
3
+ * Similar to `Array.prototype.map`; runs in parallel, serial, or with custom concurrency pool
4
+ * @param coll - The collection to map over
5
+ * @param mapper - The function to apply to each element
6
+ * @param options - Options for controlling parallelism (default: true - fully parallel)
7
+ */
8
+ export declare function asyncmap<T, R>(coll: T[], mapper: (value: T) => R | Promise<R>, options?: MapFilterOptions): Promise<R[]>;
9
+ //# sourceMappingURL=asyncmap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncmap.d.ts","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,CAAC,EACjC,IAAI,EAAE,CAAC,EAAE,EACT,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EACpC,OAAO,GAAE,gBAAuB,GAC/B,OAAO,CAAC,CAAC,EAAE,CAAC,CAed"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.asyncmap = asyncmap;
4
+ const limit_function_js_1 = require("./limit-function.js");
5
+ /**
6
+ * Similar to `Array.prototype.map`; runs in parallel, serial, or with custom concurrency pool
7
+ * @param coll - The collection to map over
8
+ * @param mapper - The function to apply to each element
9
+ * @param options - Options for controlling parallelism (default: true - fully parallel)
10
+ */
11
+ async function asyncmap(coll, mapper, options = true) {
12
+ if (options === null) {
13
+ throw new Error('Options cannot be null');
14
+ }
15
+ // limitFunction requires the mapper to always return a promise
16
+ const mapperAsync = async (value) => mapper(value);
17
+ if (options === false) {
18
+ return coll.reduce(async (acc, item) => [...(await acc), await mapperAsync(item)], Promise.resolve([]));
19
+ }
20
+ const adjustedMapper = options === true ? mapperAsync : (await (0, limit_function_js_1.getLimitFunction)())(mapperAsync, { concurrency: options.concurrency });
21
+ return Promise.all(coll.map(adjustedMapper));
22
+ }
23
+ //# sourceMappingURL=asyncmap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncmap.js","sourceRoot":"","sources":["../../../lib/asyncmap.ts"],"names":[],"mappings":";;AASA,4BAmBC;AA5BD,2DAAqD;AAGrD;;;;;GAKG;AACI,KAAK,UAAU,QAAQ,CAC5B,IAAS,EACT,MAAoC,EACpC,UAA4B,IAAI;IAEhC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;IACD,+DAA+D;IAC/D,MAAM,WAAW,GAAG,KAAK,EAAE,KAAQ,EAAc,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAClE,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,MAAM,CAChB,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC,EAC9D,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CACpB,CAAC;IACJ,CAAC;IACD,MAAM,cAAc,GAClB,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,IAAA,oCAAgB,GAAE,CAAC,CAAC,WAAW,EAAE,EAAC,WAAW,EAAE,OAAO,CAAC,WAAW,EAAC,CAAC,CAAC;IAC/G,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
2
+ export declare class TimeoutError extends Error {
3
+ constructor(message?: string);
4
+ }
5
+ /** Thrown when a promise is cancelled via `cancel`. */
6
+ export declare class PromiseCancellationError extends Error {
7
+ constructor(message?: string);
8
+ }
9
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../lib/errors.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,uDAAuD;AACvD,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,GAAE,MAA4B;CAIlD"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PromiseCancellationError = exports.TimeoutError = void 0;
4
+ /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
5
+ class TimeoutError extends Error {
6
+ constructor(message) {
7
+ super(message ?? 'Operation timed out');
8
+ this.name = 'TimeoutError';
9
+ }
10
+ }
11
+ exports.TimeoutError = TimeoutError;
12
+ /** Thrown when a promise is cancelled via `cancel`. */
13
+ class PromiseCancellationError extends Error {
14
+ constructor(message = 'Promise cancelled') {
15
+ super(message);
16
+ this.name = 'PromiseCancellationError';
17
+ }
18
+ }
19
+ exports.PromiseCancellationError = PromiseCancellationError;
20
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../lib/errors.ts"],"names":[],"mappings":";;;AAAA,yEAAyE;AACzE,MAAa,YAAa,SAAQ,KAAK;IACrC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,IAAI,qBAAqB,CAAC,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AALD,oCAKC;AAED,uDAAuD;AACvD,MAAa,wBAAyB,SAAQ,KAAK;IACjD,YAAY,UAAkB,mBAAmB;QAC/C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AALD,4DAKC"}
@@ -0,0 +1,12 @@
1
+ export { TimeoutError, PromiseCancellationError } from './errors.js';
2
+ export { sleep } from './sleep.js';
3
+ export { withTimeout } from './with-timeout.js';
4
+ export { longSleep } from './long-sleep.js';
5
+ export { retry, retryInterval } from './retry.js';
6
+ export { asyncmap } from './asyncmap.js';
7
+ export { asyncfilter } from './asyncfilter.js';
8
+ export { waitForCondition } from './wait-for-condition.js';
9
+ export { AsyncLock } from './lock.js';
10
+ export type { AsyncLockOptions, AcquireOptions } from './lock.js';
11
+ export type { CancellablePromise, Progress, ProgressCallback, LongSleepOptions, MapFilterOptions, SleepArg, SleepOptions, WaitForConditionOptions, } from './types.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,aAAa,CAAC;AACnE,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAC;AACjC,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAChD,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAEpC,YAAY,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AAChE,YAAY,EACV,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsyncLock = exports.waitForCondition = exports.asyncfilter = exports.asyncmap = exports.retryInterval = exports.retry = exports.longSleep = exports.withTimeout = exports.sleep = exports.PromiseCancellationError = exports.TimeoutError = void 0;
4
+ var errors_js_1 = require("./errors.js");
5
+ Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return errors_js_1.TimeoutError; } });
6
+ Object.defineProperty(exports, "PromiseCancellationError", { enumerable: true, get: function () { return errors_js_1.PromiseCancellationError; } });
7
+ var sleep_js_1 = require("./sleep.js");
8
+ Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return sleep_js_1.sleep; } });
9
+ var with_timeout_js_1 = require("./with-timeout.js");
10
+ Object.defineProperty(exports, "withTimeout", { enumerable: true, get: function () { return with_timeout_js_1.withTimeout; } });
11
+ var long_sleep_js_1 = require("./long-sleep.js");
12
+ Object.defineProperty(exports, "longSleep", { enumerable: true, get: function () { return long_sleep_js_1.longSleep; } });
13
+ var retry_js_1 = require("./retry.js");
14
+ Object.defineProperty(exports, "retry", { enumerable: true, get: function () { return retry_js_1.retry; } });
15
+ Object.defineProperty(exports, "retryInterval", { enumerable: true, get: function () { return retry_js_1.retryInterval; } });
16
+ var asyncmap_js_1 = require("./asyncmap.js");
17
+ Object.defineProperty(exports, "asyncmap", { enumerable: true, get: function () { return asyncmap_js_1.asyncmap; } });
18
+ var asyncfilter_js_1 = require("./asyncfilter.js");
19
+ Object.defineProperty(exports, "asyncfilter", { enumerable: true, get: function () { return asyncfilter_js_1.asyncfilter; } });
20
+ var wait_for_condition_js_1 = require("./wait-for-condition.js");
21
+ Object.defineProperty(exports, "waitForCondition", { enumerable: true, get: function () { return wait_for_condition_js_1.waitForCondition; } });
22
+ var lock_js_1 = require("./lock.js");
23
+ Object.defineProperty(exports, "AsyncLock", { enumerable: true, get: function () { return lock_js_1.AsyncLock; } });
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/index.ts"],"names":[],"mappings":";;;AAAA,yCAAmE;AAA3D,yGAAA,YAAY,OAAA;AAAE,qHAAA,wBAAwB,OAAA;AAC9C,uCAAiC;AAAzB,iGAAA,KAAK,OAAA;AACb,qDAA8C;AAAtC,8GAAA,WAAW,OAAA;AACnB,iDAA0C;AAAlC,0GAAA,SAAS,OAAA;AACjB,uCAAgD;AAAxC,iGAAA,KAAK,OAAA;AAAE,yGAAA,aAAa,OAAA;AAC5B,6CAAuC;AAA/B,uGAAA,QAAQ,OAAA;AAChB,mDAA6C;AAArC,6GAAA,WAAW,OAAA;AACnB,iEAAyD;AAAjD,yHAAA,gBAAgB,OAAA;AACxB,qCAAoC;AAA5B,oGAAA,SAAS,OAAA"}
@@ -0,0 +1,3 @@
1
+ import type { limitFunction } from 'p-limit';
2
+ export declare function getLimitFunction(): Promise<typeof limitFunction>;
3
+ //# sourceMappingURL=limit-function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limit-function.d.ts","sourceRoot":"","sources":["../../../lib/limit-function.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAc3C,wBAAsB,gBAAgB,kCAGrC"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLimitFunction = getLimitFunction;
4
+ // p-limit is ESM-only. tsc downlevels a plain `import()` in CommonJS output into a
5
+ // require()-in-a-microtask, which still hits Node's require(esm) interop and can race with a
6
+ // concurrent dynamic import() of the same module elsewhere in the process
7
+ // (ERR_REQUIRE_ESM_RACE_CONDITION). Route through `new Function` so tsc can't see or rewrite the
8
+ // import() call, keeping it a genuine native dynamic import in both the ESM and CJS builds.
9
+ const dynamicImport = new Function('specifier', 'return import(specifier)');
10
+ let limitFunctionPromise;
11
+ async function getLimitFunction() {
12
+ limitFunctionPromise ??= dynamicImport('p-limit');
13
+ return (await limitFunctionPromise).limitFunction;
14
+ }
15
+ //# sourceMappingURL=limit-function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limit-function.js","sourceRoot":"","sources":["../../../lib/limit-function.ts"],"names":[],"mappings":";;AAcA,4CAGC;AAbD,mFAAmF;AACnF,6FAA6F;AAC7F,0EAA0E;AAC1E,iGAAiG;AACjG,4FAA4F;AAC5F,MAAM,aAAa,GAAG,IAAI,QAAQ,CAAC,WAAW,EAAE,0BAA0B,CAEhD,CAAC;AAE3B,IAAI,oBAAuD,CAAC;AACrD,KAAK,UAAU,gBAAgB;IACpC,oBAAoB,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC;IAClD,OAAO,CAAC,MAAM,oBAAoB,CAAC,CAAC,aAAa,CAAC;AACpD,CAAC"}
@@ -0,0 +1,74 @@
1
+ /** Options shared by the {@link AsyncLock} constructor and {@link AsyncLock.acquire}. */
2
+ export interface AsyncLockOptions {
3
+ /**
4
+ * Max ms a task may wait in the queue before failing. `0` means never.
5
+ * @default 0
6
+ */
7
+ timeout?: number;
8
+ /**
9
+ * Max ms between calling `acquire` and the task finishing (queue wait included). `0` means never.
10
+ * @default 0
11
+ */
12
+ maxOccupationTime?: number;
13
+ /**
14
+ * Max ms the task may run once it holds the lock; the lock is then released. `0` means never.
15
+ * @default 0
16
+ */
17
+ maxExecutionTime?: number;
18
+ /**
19
+ * Max number of tasks waiting per key; further ones are rejected right away. `0` rejects every
20
+ * task that would have to wait.
21
+ * @default 1000
22
+ */
23
+ maxPending?: number;
24
+ }
25
+ /** Per-call options of {@link AsyncLock.acquire}; override the constructor ones. */
26
+ export interface AcquireOptions extends AsyncLockOptions {
27
+ /**
28
+ * Put the task at the front of the queue instead of the back.
29
+ * @default false
30
+ */
31
+ skipQueue?: boolean;
32
+ }
33
+ type Task<T> = () => T | PromiseLike<T>;
34
+ /**
35
+ * Promise-based mutex keyed by string. Tasks with the same key run one at a time, in FIFO order.
36
+ *
37
+ * Each task runs in the async context (`AsyncLocalStorage`) of the code that called
38
+ * {@link AsyncLock.acquire}, not in the context of the task that held the lock before it.
39
+ */
40
+ export declare class AsyncLock {
41
+ private readonly queues;
42
+ private readonly defaults;
43
+ constructor(opts?: AsyncLockOptions);
44
+ /**
45
+ * Run `fn` once the lock for `key` is free and release the lock when it settles.
46
+ *
47
+ * Multiple keys are held together. They are acquired one by one in sorted order, whatever order
48
+ * they are given in, so that overlapping calls cannot deadlock; duplicates are ignored. Keys that
49
+ * are already held stay held while a later one is awaited. `timeout` and `maxOccupationTime` are
50
+ * budgets for the whole call, while `maxExecutionTime` counts from the moment all the keys are
51
+ * held and releases all of them.
52
+ *
53
+ * @param key - Resource key, or a non-empty array of keys
54
+ * @param fn - Task to run while holding the lock; may be sync or async
55
+ * @param opts - Per-call options
56
+ * @returns The result of `fn`
57
+ * @throws {TypeError} Synchronously, if an argument is invalid
58
+ */
59
+ acquire<T>(key: string | readonly string[], fn: Task<T>, opts?: AcquireOptions): Promise<T>;
60
+ /**
61
+ * Number of tasks waiting for `key`, not counting the running one.
62
+ *
63
+ * @param key - Resource key
64
+ */
65
+ getQueueLength(key: string): number;
66
+ /**
67
+ * Whether `key` has a running or pending task. Without a key, whether any key does.
68
+ *
69
+ * @param key - Resource key
70
+ */
71
+ isBusy(key?: string): boolean;
72
+ }
73
+ export {};
74
+ //# sourceMappingURL=lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../lib/lock.ts"],"names":[],"mappings":"AAMA,yFAAyF;AACzF,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,oFAAoF;AACpF,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,KAAK,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAMxC;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;gBAE1C,IAAI,GAAE,gBAAqB;IAWvC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,CAAC,CAAC;IAkB/F;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAInC;;;;OAIG;IACH,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO;CAG9B"}