@mtkruto/node 0.63.3 → 0.63.6

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 (269) hide show
  1. package/esm/0_deps.d.ts +10 -5
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +10 -5
  4. package/esm/0_test_deps.d.ts.map +1 -0
  5. package/esm/_dnt.polyfills.d.ts +13 -0
  6. package/esm/_dnt.polyfills.d.ts.map +1 -1
  7. package/esm/_dnt.polyfills.js +11 -0
  8. package/esm/client/2_file_manager.d.ts.map +1 -1
  9. package/esm/client/2_file_manager.js +52 -72
  10. package/esm/client/2_update_manager.js +11 -11
  11. package/esm/client/3_client_encrypted_pool.d.ts +0 -1
  12. package/esm/client/3_client_encrypted_pool.d.ts.map +1 -1
  13. package/esm/client/3_client_encrypted_pool.js +15 -22
  14. package/esm/client/3_client_encrypted_pool_test.d.ts.map +1 -0
  15. package/esm/client/5_client.d.ts +0 -9
  16. package/esm/client/5_client.d.ts.map +1 -1
  17. package/esm/client/5_client.js +25 -44
  18. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts.map +1 -1
  19. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts.map +1 -1
  20. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts.map +1 -1
  21. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts.map +1 -1
  22. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts.map +1 -1
  23. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/instance_of.d.ts.map +1 -1
  24. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/is_error.d.ts.map +1 -1
  25. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/not_equals.d.ts.map +1 -1
  26. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/throws.d.ts.map +1 -1
  27. package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts.map +1 -1
  28. package/esm/deps/jsr.io/@std/async/1.0.12/_util.d.ts +2 -0
  29. package/esm/deps/jsr.io/@std/async/1.0.12/_util.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/async/1.0.12/_util.js +6 -0
  31. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.d.ts +107 -0
  32. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/async/1.0.12/abortable.js +46 -0
  34. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.d.ts +36 -0
  35. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/async/1.0.12/deadline.js +38 -0
  37. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.d.ts +44 -0
  38. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@std/async/1.0.12/debounce.js +57 -0
  40. package/esm/deps/jsr.io/@std/async/1.0.12/delay.d.ts +42 -0
  41. package/esm/deps/jsr.io/@std/async/1.0.12/delay.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@std/async/1.0.12/delay.js +65 -0
  43. package/esm/deps/jsr.io/@std/async/1.0.12/mod.d.ts +22 -0
  44. package/esm/deps/jsr.io/@std/async/1.0.12/mod.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@std/async/1.0.12/mod.js +23 -0
  46. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts +111 -0
  47. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.js +170 -0
  49. package/esm/deps/jsr.io/@std/async/1.0.12/pool.d.ts +33 -0
  50. package/esm/deps/jsr.io/@std/async/1.0.12/pool.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@std/async/1.0.12/pool.js +99 -0
  52. package/esm/deps/jsr.io/@std/async/1.0.12/retry.d.ts +110 -0
  53. package/esm/deps/jsr.io/@std/async/1.0.12/retry.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@std/async/1.0.12/retry.js +107 -0
  55. package/esm/deps/jsr.io/@std/async/1.0.12/tee.d.ts +43 -0
  56. package/esm/deps/jsr.io/@std/async/1.0.12/tee.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@std/async/1.0.12/tee.js +102 -0
  58. package/esm/session/1_session.js +4 -4
  59. package/esm/session/2_session_encrypted.d.ts.map +1 -1
  60. package/esm/session/2_session_encrypted.js +2 -8
  61. package/package.json +1 -1
  62. package/script/0_deps.d.ts +10 -5
  63. package/script/0_deps.d.ts.map +1 -1
  64. package/script/0_deps.js +25 -28
  65. package/script/0_test_deps.d.ts.map +1 -0
  66. package/script/_dnt.polyfills.d.ts +13 -0
  67. package/script/_dnt.polyfills.d.ts.map +1 -1
  68. package/script/_dnt.polyfills.js +11 -0
  69. package/script/client/2_file_manager.d.ts.map +1 -1
  70. package/script/client/2_file_manager.js +51 -71
  71. package/script/client/2_update_manager.js +10 -10
  72. package/script/client/3_client_encrypted_pool.d.ts +0 -1
  73. package/script/client/3_client_encrypted_pool.d.ts.map +1 -1
  74. package/script/client/3_client_encrypted_pool.js +15 -22
  75. package/script/client/3_client_encrypted_pool_test.d.ts.map +1 -0
  76. package/script/client/5_client.d.ts +0 -9
  77. package/script/client/5_client.d.ts.map +1 -1
  78. package/script/client/5_client.js +23 -42
  79. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts.map +1 -1
  80. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts.map +1 -1
  81. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts.map +1 -1
  82. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts.map +1 -1
  83. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts.map +1 -1
  84. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/instance_of.d.ts.map +1 -1
  85. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/is_error.d.ts.map +1 -1
  86. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/not_equals.d.ts.map +1 -1
  87. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/throws.d.ts.map +1 -1
  88. package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts.map +1 -1
  89. package/script/deps/jsr.io/@std/async/1.0.12/_util.d.ts +2 -0
  90. package/script/deps/jsr.io/@std/async/1.0.12/_util.d.ts.map +1 -0
  91. package/script/deps/jsr.io/@std/async/1.0.12/_util.js +9 -0
  92. package/script/deps/jsr.io/@std/async/1.0.12/abortable.d.ts +107 -0
  93. package/script/deps/jsr.io/@std/async/1.0.12/abortable.d.ts.map +1 -0
  94. package/script/deps/jsr.io/@std/async/1.0.12/abortable.js +49 -0
  95. package/script/deps/jsr.io/@std/async/1.0.12/deadline.d.ts +36 -0
  96. package/script/deps/jsr.io/@std/async/1.0.12/deadline.d.ts.map +1 -0
  97. package/script/deps/jsr.io/@std/async/1.0.12/deadline.js +41 -0
  98. package/script/deps/jsr.io/@std/async/1.0.12/debounce.d.ts +44 -0
  99. package/script/deps/jsr.io/@std/async/1.0.12/debounce.d.ts.map +1 -0
  100. package/script/deps/jsr.io/@std/async/1.0.12/debounce.js +60 -0
  101. package/script/deps/jsr.io/@std/async/1.0.12/delay.d.ts +42 -0
  102. package/script/deps/jsr.io/@std/async/1.0.12/delay.d.ts.map +1 -0
  103. package/script/deps/jsr.io/@std/async/1.0.12/delay.js +91 -0
  104. package/script/deps/jsr.io/@std/async/1.0.12/mod.d.ts +22 -0
  105. package/script/deps/jsr.io/@std/async/1.0.12/mod.d.ts.map +1 -0
  106. package/script/deps/jsr.io/@std/async/1.0.12/mod.js +39 -0
  107. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts +111 -0
  108. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.d.ts.map +1 -0
  109. package/script/deps/jsr.io/@std/async/1.0.12/mux_async_iterator.js +174 -0
  110. package/script/deps/jsr.io/@std/async/1.0.12/pool.d.ts +33 -0
  111. package/script/deps/jsr.io/@std/async/1.0.12/pool.d.ts.map +1 -0
  112. package/script/deps/jsr.io/@std/async/1.0.12/pool.js +102 -0
  113. package/script/deps/jsr.io/@std/async/1.0.12/retry.d.ts +110 -0
  114. package/script/deps/jsr.io/@std/async/1.0.12/retry.d.ts.map +1 -0
  115. package/script/deps/jsr.io/@std/async/1.0.12/retry.js +112 -0
  116. package/script/deps/jsr.io/@std/async/1.0.12/tee.d.ts +43 -0
  117. package/script/deps/jsr.io/@std/async/1.0.12/tee.d.ts.map +1 -0
  118. package/script/deps/jsr.io/@std/async/1.0.12/tee.js +105 -0
  119. package/script/session/1_session.js +3 -3
  120. package/script/session/2_session_encrypted.d.ts.map +1 -1
  121. package/script/session/2_session_encrypted.js +1 -7
  122. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts +0 -29
  123. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts.map +0 -1
  124. package/esm/deps/jsr.io/@std/assert/1.0.11/almost_equals.js +0 -46
  125. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts +0 -24
  126. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts.map +0 -1
  127. package/esm/deps/jsr.io/@std/assert/1.0.11/array_includes.js +0 -46
  128. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.d.ts +0 -18
  129. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.d.ts.map +0 -1
  130. package/esm/deps/jsr.io/@std/assert/1.0.11/exists.js +0 -27
  131. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.d.ts +0 -15
  132. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.d.ts.map +0 -1
  133. package/esm/deps/jsr.io/@std/assert/1.0.11/fail.js +0 -20
  134. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.d.ts +0 -20
  135. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.d.ts.map +0 -1
  136. package/esm/deps/jsr.io/@std/assert/1.0.11/greater.js +0 -29
  137. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts +0 -20
  138. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts.map +0 -1
  139. package/esm/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.js +0 -29
  140. package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
  141. package/esm/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -52
  142. package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +0 -25
  143. package/esm/deps/jsr.io/@std/assert/1.0.11/is_error.js +0 -53
  144. package/esm/deps/jsr.io/@std/assert/1.0.11/less.d.ts +0 -19
  145. package/esm/deps/jsr.io/@std/assert/1.0.11/less.d.ts.map +0 -1
  146. package/esm/deps/jsr.io/@std/assert/1.0.11/less.js +0 -28
  147. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts +0 -20
  148. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts.map +0 -1
  149. package/esm/deps/jsr.io/@std/assert/1.0.11/less_or_equal.js +0 -29
  150. package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
  151. package/esm/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
  152. package/esm/deps/jsr.io/@std/assert/1.0.11/match.js +0 -26
  153. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.d.ts +0 -44
  154. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.d.ts.map +0 -1
  155. package/esm/deps/jsr.io/@std/assert/1.0.11/mod.js +0 -45
  156. package/esm/deps/jsr.io/@std/assert/1.0.11/not_equals.d.ts +0 -21
  157. package/esm/deps/jsr.io/@std/assert/1.0.11/not_equals.js +0 -33
  158. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
  159. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
  160. package/esm/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -29
  161. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
  162. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
  163. package/esm/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -26
  164. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
  165. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
  166. package/esm/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -32
  167. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts +0 -29
  168. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts.map +0 -1
  169. package/esm/deps/jsr.io/@std/assert/1.0.11/object_match.js +0 -167
  170. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +0 -42
  171. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +0 -1
  172. package/esm/deps/jsr.io/@std/assert/1.0.11/rejects.js +0 -53
  173. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
  174. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
  175. package/esm/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -57
  176. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts +0 -18
  177. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts.map +0 -1
  178. package/esm/deps/jsr.io/@std/assert/1.0.11/string_includes.js +0 -26
  179. package/esm/deps/jsr.io/@std/assert/1.0.11/throws.d.ts +0 -45
  180. package/esm/deps/jsr.io/@std/assert/1.0.11/throws.js +0 -44
  181. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts +0 -15
  182. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts.map +0 -1
  183. package/esm/deps/jsr.io/@std/assert/1.0.11/unimplemented.js +0 -20
  184. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts +0 -29
  185. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.d.ts.map +0 -1
  186. package/script/deps/jsr.io/@std/assert/1.0.11/almost_equals.js +0 -49
  187. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts +0 -24
  188. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.d.ts.map +0 -1
  189. package/script/deps/jsr.io/@std/assert/1.0.11/array_includes.js +0 -49
  190. package/script/deps/jsr.io/@std/assert/1.0.11/exists.d.ts +0 -18
  191. package/script/deps/jsr.io/@std/assert/1.0.11/exists.d.ts.map +0 -1
  192. package/script/deps/jsr.io/@std/assert/1.0.11/exists.js +0 -30
  193. package/script/deps/jsr.io/@std/assert/1.0.11/fail.d.ts +0 -15
  194. package/script/deps/jsr.io/@std/assert/1.0.11/fail.d.ts.map +0 -1
  195. package/script/deps/jsr.io/@std/assert/1.0.11/fail.js +0 -23
  196. package/script/deps/jsr.io/@std/assert/1.0.11/greater.d.ts +0 -20
  197. package/script/deps/jsr.io/@std/assert/1.0.11/greater.d.ts.map +0 -1
  198. package/script/deps/jsr.io/@std/assert/1.0.11/greater.js +0 -32
  199. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts +0 -20
  200. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.d.ts.map +0 -1
  201. package/script/deps/jsr.io/@std/assert/1.0.11/greater_or_equal.js +0 -32
  202. package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.d.ts +0 -23
  203. package/script/deps/jsr.io/@std/assert/1.0.11/instance_of.js +0 -55
  204. package/script/deps/jsr.io/@std/assert/1.0.11/is_error.d.ts +0 -25
  205. package/script/deps/jsr.io/@std/assert/1.0.11/is_error.js +0 -56
  206. package/script/deps/jsr.io/@std/assert/1.0.11/less.d.ts +0 -19
  207. package/script/deps/jsr.io/@std/assert/1.0.11/less.d.ts.map +0 -1
  208. package/script/deps/jsr.io/@std/assert/1.0.11/less.js +0 -31
  209. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts +0 -20
  210. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.d.ts.map +0 -1
  211. package/script/deps/jsr.io/@std/assert/1.0.11/less_or_equal.js +0 -32
  212. package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts +0 -18
  213. package/script/deps/jsr.io/@std/assert/1.0.11/match.d.ts.map +0 -1
  214. package/script/deps/jsr.io/@std/assert/1.0.11/match.js +0 -29
  215. package/script/deps/jsr.io/@std/assert/1.0.11/mod.d.ts +0 -44
  216. package/script/deps/jsr.io/@std/assert/1.0.11/mod.d.ts.map +0 -1
  217. package/script/deps/jsr.io/@std/assert/1.0.11/mod.js +0 -61
  218. package/script/deps/jsr.io/@std/assert/1.0.11/not_equals.d.ts +0 -21
  219. package/script/deps/jsr.io/@std/assert/1.0.11/not_equals.js +0 -36
  220. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts +0 -20
  221. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.d.ts.map +0 -1
  222. package/script/deps/jsr.io/@std/assert/1.0.11/not_instance_of.js +0 -32
  223. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts +0 -18
  224. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.d.ts.map +0 -1
  225. package/script/deps/jsr.io/@std/assert/1.0.11/not_match.js +0 -29
  226. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts +0 -23
  227. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.d.ts.map +0 -1
  228. package/script/deps/jsr.io/@std/assert/1.0.11/not_strict_equals.js +0 -35
  229. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts +0 -29
  230. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.d.ts.map +0 -1
  231. package/script/deps/jsr.io/@std/assert/1.0.11/object_match.js +0 -170
  232. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts +0 -42
  233. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.d.ts.map +0 -1
  234. package/script/deps/jsr.io/@std/assert/1.0.11/rejects.js +0 -56
  235. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts +0 -24
  236. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.d.ts.map +0 -1
  237. package/script/deps/jsr.io/@std/assert/1.0.11/strict_equals.js +0 -60
  238. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts +0 -18
  239. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.d.ts.map +0 -1
  240. package/script/deps/jsr.io/@std/assert/1.0.11/string_includes.js +0 -29
  241. package/script/deps/jsr.io/@std/assert/1.0.11/throws.d.ts +0 -45
  242. package/script/deps/jsr.io/@std/assert/1.0.11/throws.js +0 -47
  243. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts +0 -15
  244. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.d.ts.map +0 -1
  245. package/script/deps/jsr.io/@std/assert/1.0.11/unimplemented.js +0 -23
  246. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts +0 -0
  247. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.js +0 -0
  248. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts +0 -0
  249. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.js +0 -0
  250. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts +0 -0
  251. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.js +0 -0
  252. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts +0 -0
  253. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.js +0 -0
  254. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts +0 -0
  255. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.js +0 -0
  256. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts +0 -0
  257. /package/esm/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.js +0 -0
  258. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.d.ts +0 -0
  259. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assert.js +0 -0
  260. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.d.ts +0 -0
  261. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/assertion_error.js +0 -0
  262. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.d.ts +0 -0
  263. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equal.js +0 -0
  264. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.d.ts +0 -0
  265. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/equals.js +0 -0
  266. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.d.ts +0 -0
  267. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/false.js +0 -0
  268. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.d.ts +0 -0
  269. /package/script/deps/jsr.io/@std/assert/{1.0.11 → 1.0.12}/unreachable.js +0 -0
@@ -0,0 +1,99 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ /** Error message emitted from the thrown error while mapping. */
4
+ const ERROR_WHILE_MAPPING_MESSAGE = "Cannot complete the mapping as an error was thrown from an item";
5
+ /**
6
+ * pooledMap transforms values from an (async) iterable into another async
7
+ * iterable. The transforms are done concurrently, with a max concurrency
8
+ * defined by the poolLimit.
9
+ *
10
+ * If an error is thrown from `iterableFn`, no new transformations will begin.
11
+ * All currently executing transformations are allowed to finish and still
12
+ * yielded on success. After that, the rejections among them are gathered and
13
+ * thrown by the iterator in an `AggregateError`.
14
+ *
15
+ * @example Usage
16
+ * ```ts
17
+ * import { pooledMap } from "@std/async/pool";
18
+ * import { assertEquals } from "@std/assert";
19
+ *
20
+ * const results = pooledMap(
21
+ * 2,
22
+ * [1, 2, 3],
23
+ * (i) => new Promise((r) => setTimeout(() => r(i), 1000)),
24
+ * );
25
+ *
26
+ * assertEquals(await Array.fromAsync(results), [1, 2, 3]);
27
+ * ```
28
+ *
29
+ * @typeParam T the input type.
30
+ * @typeParam R the output type.
31
+ * @param poolLimit The maximum count of items being processed concurrently.
32
+ * @param array The input array for mapping.
33
+ * @param iteratorFn The function to call for every item of the array.
34
+ * @returns The async iterator with the transformed values.
35
+ */
36
+ export function pooledMap(poolLimit, array, iteratorFn) {
37
+ // Create the async iterable that is returned from this function.
38
+ const res = new TransformStream({
39
+ async transform(p, controller) {
40
+ try {
41
+ const s = await p;
42
+ controller.enqueue(s);
43
+ }
44
+ catch (e) {
45
+ if (e instanceof AggregateError &&
46
+ e.message === ERROR_WHILE_MAPPING_MESSAGE) {
47
+ controller.error(e);
48
+ }
49
+ }
50
+ },
51
+ });
52
+ // Start processing items from the iterator
53
+ (async () => {
54
+ const writer = res.writable.getWriter();
55
+ const executing = [];
56
+ try {
57
+ for await (const item of array) {
58
+ const p = Promise.resolve().then(() => iteratorFn(item));
59
+ // Only write on success. If we `writer.write()` a rejected promise,
60
+ // that will end the iteration. We don't want that yet. Instead let it
61
+ // fail the race, taking us to the catch block where all currently
62
+ // executing jobs are allowed to finish and all rejections among them
63
+ // can be reported together.
64
+ writer.write(p);
65
+ const e = p.then(() => executing.splice(executing.indexOf(e), 1));
66
+ executing.push(e);
67
+ if (executing.length >= poolLimit) {
68
+ await Promise.race(executing);
69
+ }
70
+ }
71
+ // Wait until all ongoing events have processed, then close the writer.
72
+ await Promise.all(executing);
73
+ writer.close();
74
+ }
75
+ catch {
76
+ const errors = [];
77
+ for (const result of await Promise.allSettled(executing)) {
78
+ if (result.status === "rejected") {
79
+ errors.push(result.reason);
80
+ }
81
+ }
82
+ writer.write(Promise.reject(new AggregateError(errors, ERROR_WHILE_MAPPING_MESSAGE))).catch(() => { });
83
+ }
84
+ })();
85
+ // Feature test until browser coverage is adequate
86
+ return Symbol.asyncIterator in res.readable &&
87
+ typeof res.readable[Symbol.asyncIterator] === "function"
88
+ ? res.readable[Symbol.asyncIterator]()
89
+ : (async function* () {
90
+ const reader = res.readable.getReader();
91
+ while (true) {
92
+ const { done, value } = await reader.read();
93
+ if (done)
94
+ break;
95
+ yield value;
96
+ }
97
+ reader.releaseLock();
98
+ })();
99
+ }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Error thrown in {@linkcode retry} once the maximum number of failed attempts
3
+ * has been reached.
4
+ *
5
+ * @example Usage
6
+ * ```ts no-assert ignore
7
+ * import { RetryError } from "@std/async/retry";
8
+ *
9
+ * throw new RetryError({ foo: "bar" }, 3);
10
+ * ```
11
+ */
12
+ export declare class RetryError extends Error {
13
+ /**
14
+ * Constructs a new {@linkcode RetryError} instance.
15
+ *
16
+ * @param cause the cause for this error.
17
+ * @param attempts the number of retry attempts made.
18
+ */
19
+ constructor(cause: unknown, attempts: number);
20
+ }
21
+ /** Options for {@linkcode retry}. */
22
+ export interface RetryOptions {
23
+ /**
24
+ * How much to backoff after each retry.
25
+ *
26
+ * @default {2}
27
+ */
28
+ multiplier?: number;
29
+ /**
30
+ * The maximum milliseconds between attempts.
31
+ *
32
+ * @default {60000}
33
+ */
34
+ maxTimeout?: number;
35
+ /**
36
+ * The maximum amount of attempts until failure.
37
+ *
38
+ * @default {5}
39
+ */
40
+ maxAttempts?: number;
41
+ /**
42
+ * The initial and minimum amount of milliseconds between attempts.
43
+ *
44
+ * @default {1000}
45
+ */
46
+ minTimeout?: number;
47
+ /**
48
+ * Amount of jitter to introduce to the time between attempts. This is `1`
49
+ * for full jitter by default.
50
+ *
51
+ * @default {1}
52
+ */
53
+ jitter?: number;
54
+ }
55
+ /**
56
+ * Calls the given (possibly asynchronous) function up to `maxAttempts` times.
57
+ * Retries as long as the given function throws. If the attempts are exhausted,
58
+ * throws a {@linkcode RetryError} with `cause` set to the inner exception.
59
+ *
60
+ * The backoff is calculated by multiplying `minTimeout` with `multiplier` to the power of the current attempt counter (starting at 0 up to `maxAttempts - 1`). It is capped at `maxTimeout` however.
61
+ * How long the actual delay is, depends on `jitter`.
62
+ *
63
+ * When `jitter` is the default value of `1`, waits between two attempts for a
64
+ * randomized amount between 0 and the backoff time. With the default options
65
+ * the maximal delay will be `15s = 1s + 2s + 4s + 8s`. If all five attempts
66
+ * are exhausted the mean delay will be `9.5s = ½(4s + 15s)`.
67
+ *
68
+ * When `jitter` is `0`, waits the full backoff time.
69
+ *
70
+ * @example Example configuration 1
71
+ * ```ts no-assert
72
+ * import { retry } from "@std/async/retry";
73
+ * const req = async () => {
74
+ * // some function that throws sometimes
75
+ * };
76
+ *
77
+ * // Below resolves to the first non-error result of `req`
78
+ * const retryPromise = await retry(req, {
79
+ * multiplier: 2,
80
+ * maxTimeout: 60000,
81
+ * maxAttempts: 5,
82
+ * minTimeout: 100,
83
+ * jitter: 1,
84
+ * });
85
+ * ```
86
+ *
87
+ * @example Example configuration 2
88
+ * ```ts no-assert
89
+ * import { retry } from "@std/async/retry";
90
+ * const req = async () => {
91
+ * // some function that throws sometimes
92
+ * };
93
+ *
94
+ * // Make sure we wait at least 1 minute, but at most 2 minutes
95
+ * const retryPromise = await retry(req, {
96
+ * multiplier: 2.34,
97
+ * maxTimeout: 80000,
98
+ * maxAttempts: 7,
99
+ * minTimeout: 1000,
100
+ * jitter: 0.5,
101
+ * });
102
+ * ```
103
+ *
104
+ * @typeParam T The return type of the function to retry and returned promise.
105
+ * @param fn The function to retry.
106
+ * @param options Additional options.
107
+ * @returns The promise that resolves with the value returned by the function to retry.
108
+ */
109
+ export declare function retry<T>(fn: (() => Promise<T>) | (() => T), options?: RetryOptions): Promise<T>;
110
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/retry.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC;;;;;OAKG;gBACS,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;CAK7C;AAED,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAAsB,KAAK,CAAC,CAAC,EAC3B,EAAE,EAAE,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAClC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,CAAC,CAAC,CA6CZ"}
@@ -0,0 +1,107 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ import { exponentialBackoffWithJitter } from "./_util.js";
4
+ /**
5
+ * Error thrown in {@linkcode retry} once the maximum number of failed attempts
6
+ * has been reached.
7
+ *
8
+ * @example Usage
9
+ * ```ts no-assert ignore
10
+ * import { RetryError } from "@std/async/retry";
11
+ *
12
+ * throw new RetryError({ foo: "bar" }, 3);
13
+ * ```
14
+ */
15
+ export class RetryError extends Error {
16
+ /**
17
+ * Constructs a new {@linkcode RetryError} instance.
18
+ *
19
+ * @param cause the cause for this error.
20
+ * @param attempts the number of retry attempts made.
21
+ */
22
+ constructor(cause, attempts) {
23
+ super(`Retrying exceeded the maxAttempts (${attempts}).`);
24
+ this.name = "RetryError";
25
+ this.cause = cause;
26
+ }
27
+ }
28
+ /**
29
+ * Calls the given (possibly asynchronous) function up to `maxAttempts` times.
30
+ * Retries as long as the given function throws. If the attempts are exhausted,
31
+ * throws a {@linkcode RetryError} with `cause` set to the inner exception.
32
+ *
33
+ * The backoff is calculated by multiplying `minTimeout` with `multiplier` to the power of the current attempt counter (starting at 0 up to `maxAttempts - 1`). It is capped at `maxTimeout` however.
34
+ * How long the actual delay is, depends on `jitter`.
35
+ *
36
+ * When `jitter` is the default value of `1`, waits between two attempts for a
37
+ * randomized amount between 0 and the backoff time. With the default options
38
+ * the maximal delay will be `15s = 1s + 2s + 4s + 8s`. If all five attempts
39
+ * are exhausted the mean delay will be `9.5s = ½(4s + 15s)`.
40
+ *
41
+ * When `jitter` is `0`, waits the full backoff time.
42
+ *
43
+ * @example Example configuration 1
44
+ * ```ts no-assert
45
+ * import { retry } from "@std/async/retry";
46
+ * const req = async () => {
47
+ * // some function that throws sometimes
48
+ * };
49
+ *
50
+ * // Below resolves to the first non-error result of `req`
51
+ * const retryPromise = await retry(req, {
52
+ * multiplier: 2,
53
+ * maxTimeout: 60000,
54
+ * maxAttempts: 5,
55
+ * minTimeout: 100,
56
+ * jitter: 1,
57
+ * });
58
+ * ```
59
+ *
60
+ * @example Example configuration 2
61
+ * ```ts no-assert
62
+ * import { retry } from "@std/async/retry";
63
+ * const req = async () => {
64
+ * // some function that throws sometimes
65
+ * };
66
+ *
67
+ * // Make sure we wait at least 1 minute, but at most 2 minutes
68
+ * const retryPromise = await retry(req, {
69
+ * multiplier: 2.34,
70
+ * maxTimeout: 80000,
71
+ * maxAttempts: 7,
72
+ * minTimeout: 1000,
73
+ * jitter: 0.5,
74
+ * });
75
+ * ```
76
+ *
77
+ * @typeParam T The return type of the function to retry and returned promise.
78
+ * @param fn The function to retry.
79
+ * @param options Additional options.
80
+ * @returns The promise that resolves with the value returned by the function to retry.
81
+ */
82
+ export async function retry(fn, options) {
83
+ const { multiplier = 2, maxTimeout = 60000, maxAttempts = 5, minTimeout = 1000, jitter = 1, } = options ?? {};
84
+ if (maxTimeout <= 0) {
85
+ throw new TypeError(`Cannot retry as 'maxTimeout' must be positive: current value is ${maxTimeout}`);
86
+ }
87
+ if (minTimeout > maxTimeout) {
88
+ throw new TypeError(`Cannot retry as 'minTimeout' must be <= 'maxTimeout': current values 'minTimeout=${minTimeout}', 'maxTimeout=${maxTimeout}'`);
89
+ }
90
+ if (jitter > 1) {
91
+ throw new TypeError(`Cannot retry as 'jitter' must be <= 1: current value is ${jitter}`);
92
+ }
93
+ let attempt = 0;
94
+ while (true) {
95
+ try {
96
+ return await fn();
97
+ }
98
+ catch (error) {
99
+ if (attempt + 1 >= maxAttempts) {
100
+ throw new RetryError(error, maxAttempts);
101
+ }
102
+ const timeout = exponentialBackoffWithJitter(maxTimeout, minTimeout, attempt, multiplier, jitter);
103
+ await new Promise((r) => setTimeout(r, timeout));
104
+ }
105
+ attempt++;
106
+ }
107
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Utility for representing n-tuple. Used in {@linkcode tee}.
3
+ *
4
+ * @internal
5
+ */
6
+ export type Tuple<T, N extends number> = N extends N ? number extends N ? T[] : TupleOf<T, N, []> : never;
7
+ /**
8
+ * Utility for representing n-tuple of. Used in {@linkcode Tuple}.
9
+ *
10
+ * @internal
11
+ */
12
+ export type TupleOf<T, N extends number, R extends unknown[]> = R["length"] extends N ? R : TupleOf<T, N, [T, ...R]>;
13
+ /**
14
+ * Branches the given async iterable into the `n` branches.
15
+ *
16
+ * @example Usage
17
+ * ```ts
18
+ * import { tee } from "@std/async/tee";
19
+ * import { assertEquals } from "@std/assert";
20
+ *
21
+ * const gen = async function* gen() {
22
+ * yield 1;
23
+ * yield 2;
24
+ * yield 3;
25
+ * };
26
+ *
27
+ * const [branch1, branch2] = tee(gen());
28
+ *
29
+ * const result1 = await Array.fromAsync(branch1);
30
+ * assertEquals(result1, [1, 2, 3]);
31
+ *
32
+ * const result2 = await Array.fromAsync(branch2);
33
+ * assertEquals(result2, [1, 2, 3]);
34
+ * ```
35
+ *
36
+ * @typeParam T The type of the provided async iterable and the returned async iterables.
37
+ * @typeParam N The amount of branches to tee into.
38
+ * @param iterable The iterable to tee.
39
+ * @param n The amount of branches to tee into.
40
+ * @returns The tuple where each element is an async iterable.
41
+ */
42
+ export declare function tee<T, N extends number = 2>(iterable: AsyncIterable<T>, n?: N): Tuple<AsyncIterable<T>, N>;
43
+ //# sourceMappingURL=tee.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tee.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/async/1.0.12/tee.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,GAChD,MAAM,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAC1C,KAAK,CAAC;AAEV;;;;GAIG;AACH,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,IAC1D,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,GACrB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AAuC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,GAAG,CAAC,EACzC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,EAC1B,CAAC,GAAE,CAAU,GACZ,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAuB5B"}
@@ -0,0 +1,102 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
4
+ if (kind === "m") throw new TypeError("Private method is not writable");
5
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
6
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
7
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
8
+ };
9
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
10
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
11
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
12
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
13
+ };
14
+ var _Queue_source, _Queue_queue;
15
+ class Queue {
16
+ constructor(iterable) {
17
+ _Queue_source.set(this, void 0);
18
+ _Queue_queue.set(this, void 0);
19
+ Object.defineProperty(this, "head", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "done", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: void 0
30
+ });
31
+ __classPrivateFieldSet(this, _Queue_source, iterable[Symbol.asyncIterator](), "f");
32
+ __classPrivateFieldSet(this, _Queue_queue, {
33
+ value: undefined,
34
+ next: undefined,
35
+ }, "f");
36
+ this.head = __classPrivateFieldGet(this, _Queue_queue, "f");
37
+ this.done = false;
38
+ }
39
+ async next() {
40
+ const result = await __classPrivateFieldGet(this, _Queue_source, "f").next();
41
+ if (!result.done) {
42
+ const nextNode = {
43
+ value: result.value,
44
+ next: undefined,
45
+ };
46
+ __classPrivateFieldGet(this, _Queue_queue, "f").next = nextNode;
47
+ __classPrivateFieldSet(this, _Queue_queue, nextNode, "f");
48
+ }
49
+ else {
50
+ this.done = true;
51
+ }
52
+ }
53
+ }
54
+ _Queue_source = new WeakMap(), _Queue_queue = new WeakMap();
55
+ /**
56
+ * Branches the given async iterable into the `n` branches.
57
+ *
58
+ * @example Usage
59
+ * ```ts
60
+ * import { tee } from "@std/async/tee";
61
+ * import { assertEquals } from "@std/assert";
62
+ *
63
+ * const gen = async function* gen() {
64
+ * yield 1;
65
+ * yield 2;
66
+ * yield 3;
67
+ * };
68
+ *
69
+ * const [branch1, branch2] = tee(gen());
70
+ *
71
+ * const result1 = await Array.fromAsync(branch1);
72
+ * assertEquals(result1, [1, 2, 3]);
73
+ *
74
+ * const result2 = await Array.fromAsync(branch2);
75
+ * assertEquals(result2, [1, 2, 3]);
76
+ * ```
77
+ *
78
+ * @typeParam T The type of the provided async iterable and the returned async iterables.
79
+ * @typeParam N The amount of branches to tee into.
80
+ * @param iterable The iterable to tee.
81
+ * @param n The amount of branches to tee into.
82
+ * @returns The tuple where each element is an async iterable.
83
+ */
84
+ export function tee(iterable, n = 2) {
85
+ const queue = new Queue(iterable);
86
+ async function* generator() {
87
+ let buffer = queue.head;
88
+ while (true) {
89
+ if (buffer.next) {
90
+ buffer = buffer.next;
91
+ yield buffer.value;
92
+ }
93
+ else if (queue.done) {
94
+ return;
95
+ }
96
+ else {
97
+ await queue.next();
98
+ }
99
+ }
100
+ }
101
+ return Array.from({ length: n }).map(() => generator());
102
+ }
@@ -30,7 +30,7 @@ var _Session_instances, _Session_dc, _Session_cdn, _Session_lastConnect, _Sessio
30
30
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
31
31
  */
32
32
  import * as dntShim from "../_dnt.shims.js";
33
- import { SECOND } from "../0_deps.js";
33
+ import { delay, SECOND } from "../0_deps.js";
34
34
  import { drop, getLogger, Mutex } from "../1_utilities.js";
35
35
  import { transportProviderTcp, transportProviderWebSocket } from "../3_transport.js";
36
36
  import { SessionState } from "./0_session_state.js";
@@ -91,7 +91,7 @@ export class Session {
91
91
  return this.transport.connection.connected;
92
92
  }
93
93
  async connect() {
94
- const release = await __classPrivateFieldGet(this, _Session_connectMutex, "f").lock();
94
+ const unlock = await __classPrivateFieldGet(this, _Session_connectMutex, "f").lock();
95
95
  try {
96
96
  if (this.connected) {
97
97
  return;
@@ -102,7 +102,7 @@ export class Session {
102
102
  __classPrivateFieldSet(this, _Session_disconnected, false, "f");
103
103
  }
104
104
  finally {
105
- release();
105
+ unlock();
106
106
  }
107
107
  }
108
108
  async waitUntilConnected() {
@@ -140,7 +140,7 @@ _Session_dc = new WeakMap(), _Session_cdn = new WeakMap(), _Session_lastConnect
140
140
  }
141
141
  if (__classPrivateFieldGet(this, _Session_lastConnect, "f") && Date.now() - __classPrivateFieldGet(this, _Session_lastConnect, "f").getTime() <= 10 * SECOND) {
142
142
  __classPrivateFieldGet(this, _Session_L, "f").debug("reconnecting after a delay");
143
- await new Promise((r) => setTimeout(r, 3 * SECOND));
143
+ await delay(3 * SECOND);
144
144
  }
145
145
  else {
146
146
  __classPrivateFieldGet(this, _Session_L, "f").debug("reconnecting");
@@ -1 +1 @@
1
- {"version":3,"file":"2_session_encrypted.d.ts","sourceRoot":"","sources":["../../src/session/2_session_encrypted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAA8C,OAAO,EAAuC,MAAM,YAAY,CAAC;AACtH,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASxD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;IAC5D,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxD;AAQD,qBAAa,gBAAiB,SAAQ,OAAQ,YAAW,OAAO;;IAI9D,QAAQ,EAAE,QAAQ,CAAM;gBAQZ,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,aAAa;IAMpC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC;IAM7C,IAAI,OAAO,IAAI,UAAU,CAExB;IAEc,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAa9B,UAAU,IAAI,IAAI;IAuDrB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;CA4U9C"}
1
+ {"version":3,"file":"2_session_encrypted.d.ts","sourceRoot":"","sources":["../../src/session/2_session_encrypted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAA8C,OAAO,EAAuC,MAAM,YAAY,CAAC;AACtH,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASxD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC;IAC5D,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;CACxD;AAQD,qBAAa,gBAAiB,SAAQ,OAAQ,YAAW,OAAO;;IAI9D,QAAQ,EAAE,QAAQ,CAAM;gBAQZ,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,aAAa;IAMpC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC;IAM7C,IAAI,OAAO,IAAI,UAAU,CAExB;IAEc,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAa9B,UAAU,IAAI,IAAI;IAuDrB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;CAsU9C"}
@@ -29,7 +29,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
29
29
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
30
30
  };
31
31
  var _SessionEncrypted_instances, _a, _SessionEncrypted_id, _SessionEncrypted_authKey, _SessionEncrypted_authKeyId, _SessionEncrypted_toAcknowledge, _SessionEncrypted_pendingMessages, _SessionEncrypted_pendingPings, _SessionEncrypted_L, _SessionEncrypted_TGCRYPTO_INITED, _SessionEncrypted_assertNotDisconnected, _SessionEncrypted_invalidateSession, _SessionEncrypted_rejectAllPending, _SessionEncrypted_onMessageFailed, _SessionEncrypted_setServerSalt, _SessionEncrypted_receive, _SessionEncrypted_encryptMessage, _SessionEncrypted_decryptMessage, _SessionEncrypted_startReceiveLoop, _SessionEncrypted_receiveLoopActive, _SessionEncrypted_receiveLoop, _SessionEncrypted_onMessage, _SessionEncrypted_onRpcResult, _SessionEncrypted_onMsgDetailedInfo, _SessionEncrypted_onMsgNewDetailedInfo, _SessionEncrypted_onBadMsgNotification, _SessionEncrypted_onBadServerSalt, _SessionEncrypted_onPong, _SessionEncrypted_onNewSessionCreated, _SessionEncrypted_onMessageContainer, _SessionEncrypted_pingInterval, _SessionEncrypted_startPingLoop, _SessionEncrypted_pingLoopAbortController, _SessionEncrypted_LpingLoop, _SessionEncrypted_pingLoop, _SessionEncrypted_sendPingDelayDisconnect, _SessionEncrypted_resendPendingPing;
32
- import { assertEquals, concat, ige256Decrypt, ige256Encrypt, initTgCrypto, SECOND } from "../0_deps.js";
32
+ import { assertEquals, concat, delay, ige256Decrypt, ige256Encrypt, initTgCrypto, SECOND } from "../0_deps.js";
33
33
  import { ConnectionError, TransportError } from "../0_errors.js";
34
34
  import { bigIntFromBuffer, bufferFromBigInt, drop, getLogger, getRandomId, gunzip, mod, sha1, sha256, toUnixTimestamp } from "../1_utilities.js";
35
35
  import { deserializeMessage, Mtproto, repr, serializeMessage, TLReader, X } from "../2_tl.js";
@@ -386,13 +386,7 @@ async function _SessionEncrypted_onMessage(msgId, body) {
386
386
  while (this.connected) {
387
387
  const then = Date.now();
388
388
  try {
389
- await new Promise((resolve, reject) => {
390
- const timeout = setTimeout(resolve, __classPrivateFieldGet(this, _SessionEncrypted_pingInterval, "f") - timeElapsed);
391
- __classPrivateFieldGet(this, _SessionEncrypted_pingLoopAbortController, "f").signal.onabort = () => {
392
- reject(__classPrivateFieldGet(this, _SessionEncrypted_pingLoopAbortController, "f")?.signal.reason);
393
- clearTimeout(timeout);
394
- };
395
- });
389
+ await delay(__classPrivateFieldGet(this, _SessionEncrypted_pingInterval, "f") - timeElapsed, { signal: __classPrivateFieldGet(this, _SessionEncrypted_pingLoopAbortController, "f").signal });
396
390
  if (!this.connected) {
397
391
  continue;
398
392
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtkruto/node",
3
- "version": "0.63.3",
3
+ "version": "0.63.6",
4
4
  "description": "MTKruto for Node.js",
5
5
  "author": "Roj <rojvv@icloud.com>",
6
6
  "repository": {
@@ -17,16 +17,21 @@
17
17
  * You should have received a copy of the GNU Lesser General Public License
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
- export * from "./deps/jsr.io/@std/assert/1.0.11/mod.js";
21
- export { basename } from "./deps/jsr.io/@std/path/1.0.8/basename.js";
22
- export { extname } from "./deps/jsr.io/@std/path/1.0.8/extname.js";
23
- export { isAbsolute } from "./deps/jsr.io/@std/path/1.0.8/is_absolute.js";
20
+ export { assert } from "./deps/jsr.io/@std/assert/1.0.12/assert.js";
21
+ export { assertFalse } from "./deps/jsr.io/@std/assert/1.0.12/false.js";
22
+ export { assertEquals } from "./deps/jsr.io/@std/assert/1.0.12/equals.js";
23
+ export { unreachable } from "./deps/jsr.io/@std/assert/1.0.12/unreachable.js";
24
+ export { AssertionError } from "./deps/jsr.io/@std/assert/1.0.12/assertion_error.js";
24
25
  export { join } from "./deps/jsr.io/@std/path/1.0.8/join.js";
26
+ export { extname } from "./deps/jsr.io/@std/path/1.0.8/extname.js";
27
+ export { basename } from "./deps/jsr.io/@std/path/1.0.8/basename.js";
25
28
  export { toFileUrl } from "./deps/jsr.io/@std/path/1.0.8/to_file_url.js";
29
+ export { isAbsolute } from "./deps/jsr.io/@std/path/1.0.8/is_absolute.js";
30
+ export { delay } from "./deps/jsr.io/@std/async/1.0.12/mod.js";
26
31
  export { concat } from "./deps/jsr.io/@std/bytes/1.0.5/concat.js";
32
+ export { iterateReader } from "./deps/jsr.io/@std/io/0.225.2/iterate_reader.js";
27
33
  export { MINUTE, SECOND } from "./deps/jsr.io/@std/datetime/0.225.3/constants.js";
28
34
  export { toArrayBuffer } from "./deps/jsr.io/@std/streams/1.0.9/to_array_buffer.js";
29
- export { iterateReader } from "./deps/jsr.io/@std/io/0.225.2/iterate_reader.js";
30
35
  export { decodeBase64, encodeBase64 } from "./deps/jsr.io/@std/encoding/1.0.7/base64.js";
31
36
  import { contentType as contentType_ } from "./deps/jsr.io/@std/media-types/1.1.0/content_type.js";
32
37
  export declare const contentType: typeof contentType_;
@@ -1 +1 @@
1
- {"version":3,"file":"0_deps.d.ts","sourceRoot":"","sources":["../src/0_deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,yCAAyC,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,0CAA0C,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kDAAkD,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACnG,eAAO,MAAM,WAAW,EAAE,OAAO,YAMhC,CAAC;AAEF,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,UAMzC;AAED,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAEnH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"0_deps.d.ts","sourceRoot":"","sources":["../src/0_deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qDAAqD,CAAC;AAErF,OAAO,EAAE,IAAI,EAAE,MAAM,uCAAuC,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,0CAA0C,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kDAAkD,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAC;AAEpF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC;AAEzF,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACnG,eAAO,MAAM,WAAW,EAAE,OAAO,YAMhC,CAAC;AAEF,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,UAMzC;AAED,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAEnH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}