@mtkruto/node 0.1.302 → 0.1.400

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 (583) hide show
  1. package/esm/0_deps.d.ts +6 -5
  2. package/esm/0_deps.js +7 -6
  3. package/esm/1_utilities.d.ts +2 -0
  4. package/esm/1_utilities.js +2 -0
  5. package/esm/3_types.d.ts +2 -0
  6. package/esm/3_types.js +2 -0
  7. package/esm/client/0_message.js +11 -11
  8. package/esm/client/0_params.d.ts +8 -1
  9. package/esm/client/0_password.js +14 -6
  10. package/esm/client/0_types.d.ts +18 -7
  11. package/esm/client/0_utilities.d.ts +19 -2
  12. package/esm/client/0_utilities.js +1 -44
  13. package/esm/client/1_client_plain.js +6 -6
  14. package/esm/client/1_file_manager.d.ts +3 -21
  15. package/esm/client/1_file_manager.js +244 -104
  16. package/esm/client/2_message_manager.d.ts +4 -1
  17. package/esm/client/2_message_manager.js +166 -23
  18. package/esm/client/3_story_manager.js +4 -6
  19. package/esm/client/4_client.d.ts +20 -2
  20. package/esm/client/4_client.js +97 -49
  21. package/esm/connection/1_connection_web_socket.js +3 -3
  22. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert.js +1 -0
  23. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_almost_equals.js +1 -0
  24. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_array_includes.js +1 -0
  25. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_equals.js +1 -0
  26. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_exists.js +1 -0
  27. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_false.js +1 -0
  28. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_greater.js +1 -0
  29. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_greater_or_equal.js +1 -0
  30. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_instance_of.js +1 -0
  31. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_is_error.js +1 -0
  32. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_less.js +1 -0
  33. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_less_or_equal.js +1 -0
  34. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_match.js +1 -0
  35. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_equals.js +1 -0
  36. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_instance_of.js +1 -0
  37. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_match.js +1 -0
  38. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_strict_equals.js +1 -0
  39. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_object_match.js +1 -0
  40. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_rejects.js +1 -0
  41. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_strict_equals.js +1 -0
  42. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_string_includes.js +1 -0
  43. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_throws.js +1 -0
  44. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assertion_error.js +1 -0
  45. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/equal.js +1 -0
  46. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/fail.js +1 -0
  47. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/mod.js +1 -0
  48. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/unimplemented.js +1 -0
  49. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/unreachable.js +1 -0
  50. package/esm/deps/deno.land/std@0.222.1/bytes/concat.d.ts +13 -0
  51. package/esm/deps/deno.land/std@0.222.1/bytes/concat.js +27 -0
  52. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/encoding/base64.d.ts +8 -2
  53. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/encoding/base64.js +19 -2
  54. package/{script/deps/deno.land/std@0.221.0 → esm/deps/deno.land/std@0.222.1}/media_types/_util.d.ts +1 -0
  55. package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/_util.js +1 -1
  56. package/{script/deps/deno.land/x/tgcrypto@0.4.0 → esm/deps/deno.land/x/tgcrypto@0.4.1}/mod.d.ts +14 -2
  57. package/esm/deps/deno.land/x/{tgcrypto@0.4.0 → tgcrypto@0.4.1}/mod.js +56 -42
  58. package/esm/tl/0_tl_raw_writer.js +3 -2
  59. package/esm/transport/0_obfuscation.js +4 -3
  60. package/esm/transport/0_transport.d.ts +1 -1
  61. package/esm/transport/0_transport.js +7 -0
  62. package/esm/transport/1_transport_abridged.js +4 -2
  63. package/esm/transport/1_transport_intermediate.js +4 -2
  64. package/esm/types/0_file_source.d.ts +2 -2
  65. package/esm/types/0_self_destruct_option.d.ts +25 -0
  66. package/esm/types/0_self_destruct_option.js +39 -0
  67. package/esm/types/1_input_media.d.ts +108 -0
  68. package/esm/types/1_input_media.js +20 -0
  69. package/esm/utilities/0_buffer.d.ts +0 -1
  70. package/esm/utilities/0_buffer.js +0 -13
  71. package/esm/utilities/0_crypto.d.ts +3 -3
  72. package/esm/utilities/0_crypto.js +23 -20
  73. package/esm/utilities/0_part_stream.d.ts +29 -0
  74. package/esm/utilities/0_part_stream.js +65 -0
  75. package/esm/utilities/0_units.d.ts +25 -0
  76. package/esm/utilities/0_units.js +25 -0
  77. package/esm/utilities/1_auth.js +5 -5
  78. package/esm/utilities/1_misc.d.ts +1 -0
  79. package/esm/utilities/1_misc.js +17 -2
  80. package/package.json +3 -3
  81. package/script/0_deps.d.ts +6 -5
  82. package/script/0_deps.js +11 -7
  83. package/script/1_utilities.d.ts +2 -0
  84. package/script/1_utilities.js +2 -0
  85. package/script/3_types.d.ts +2 -0
  86. package/script/3_types.js +2 -0
  87. package/script/client/0_message.js +9 -9
  88. package/script/client/0_params.d.ts +8 -1
  89. package/script/client/0_password.js +13 -5
  90. package/script/client/0_types.d.ts +18 -7
  91. package/script/client/0_utilities.d.ts +19 -2
  92. package/script/client/0_utilities.js +2 -69
  93. package/script/client/1_client_plain.js +4 -4
  94. package/script/client/1_file_manager.d.ts +3 -21
  95. package/script/client/1_file_manager.js +266 -103
  96. package/script/client/2_message_manager.d.ts +4 -1
  97. package/script/client/2_message_manager.js +164 -21
  98. package/script/client/3_story_manager.js +3 -5
  99. package/script/client/4_client.d.ts +20 -2
  100. package/script/client/4_client.js +96 -48
  101. package/script/connection/1_connection_web_socket.js +1 -1
  102. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert.js +1 -0
  103. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_almost_equals.js +1 -0
  104. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_array_includes.js +1 -0
  105. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_equals.js +1 -0
  106. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_exists.js +1 -0
  107. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_false.js +1 -0
  108. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_greater.js +1 -0
  109. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_greater_or_equal.js +1 -0
  110. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_instance_of.js +1 -0
  111. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_is_error.js +1 -0
  112. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_less.js +1 -0
  113. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_less_or_equal.js +1 -0
  114. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_match.js +1 -0
  115. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_equals.js +1 -0
  116. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_instance_of.js +1 -0
  117. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_match.js +1 -0
  118. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_strict_equals.js +1 -0
  119. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_object_match.js +1 -0
  120. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_rejects.js +1 -0
  121. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_strict_equals.js +1 -0
  122. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_string_includes.js +1 -0
  123. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_throws.js +1 -0
  124. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assertion_error.js +1 -0
  125. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/equal.js +1 -0
  126. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/fail.js +1 -0
  127. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/mod.js +1 -0
  128. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/unimplemented.js +1 -0
  129. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/unreachable.js +1 -0
  130. package/script/deps/deno.land/std@0.222.1/bytes/concat.d.ts +13 -0
  131. package/script/deps/deno.land/std@0.222.1/bytes/concat.js +31 -0
  132. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/encoding/base64.d.ts +8 -2
  133. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/encoding/base64.js +19 -2
  134. package/{esm/deps/deno.land/std@0.221.0 → script/deps/deno.land/std@0.222.1}/media_types/_util.d.ts +1 -0
  135. package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/_util.js +2 -1
  136. package/{esm/deps/deno.land/x/tgcrypto@0.4.0 → script/deps/deno.land/x/tgcrypto@0.4.1}/mod.d.ts +14 -2
  137. package/script/deps/deno.land/x/{tgcrypto@0.4.0 → tgcrypto@0.4.1}/mod.js +61 -43
  138. package/script/tl/0_tl_raw_writer.js +2 -1
  139. package/script/transport/0_obfuscation.js +3 -2
  140. package/script/transport/0_transport.d.ts +1 -1
  141. package/script/transport/0_transport.js +7 -0
  142. package/script/transport/1_transport_abridged.js +3 -1
  143. package/script/transport/1_transport_intermediate.js +3 -1
  144. package/script/types/0_file_source.d.ts +2 -2
  145. package/script/types/0_self_destruct_option.d.ts +25 -0
  146. package/script/types/0_self_destruct_option.js +43 -0
  147. package/script/types/1_input_media.d.ts +108 -0
  148. package/script/types/1_input_media.js +21 -0
  149. package/script/utilities/0_buffer.d.ts +0 -1
  150. package/script/utilities/0_buffer.js +1 -15
  151. package/script/utilities/0_crypto.d.ts +3 -3
  152. package/script/utilities/0_crypto.js +22 -19
  153. package/script/utilities/0_part_stream.d.ts +29 -0
  154. package/script/utilities/0_part_stream.js +69 -0
  155. package/script/utilities/0_units.d.ts +25 -0
  156. package/script/utilities/0_units.js +28 -0
  157. package/script/utilities/1_auth.js +3 -3
  158. package/script/utilities/1_misc.d.ts +1 -0
  159. package/script/utilities/1_misc.js +19 -3
  160. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_constants.d.ts +0 -0
  161. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_constants.js +0 -0
  162. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_diff.d.ts +0 -0
  163. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_diff.js +0 -0
  164. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_format.d.ts +0 -0
  165. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_format.js +0 -0
  166. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert.d.ts +0 -0
  167. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_almost_equals.d.ts +0 -0
  168. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_array_includes.d.ts +0 -0
  169. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_equals.d.ts +0 -0
  170. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_exists.d.ts +0 -0
  171. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_false.d.ts +0 -0
  172. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_greater.d.ts +0 -0
  173. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_greater_or_equal.d.ts +0 -0
  174. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_instance_of.d.ts +0 -0
  175. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_is_error.d.ts +0 -0
  176. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_less.d.ts +0 -0
  177. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_less_or_equal.d.ts +0 -0
  178. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_match.d.ts +0 -0
  179. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_equals.d.ts +0 -0
  180. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_instance_of.d.ts +0 -0
  181. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_match.d.ts +0 -0
  182. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_strict_equals.d.ts +0 -0
  183. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_object_match.d.ts +0 -0
  184. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_rejects.d.ts +0 -0
  185. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_strict_equals.d.ts +0 -0
  186. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_string_includes.d.ts +0 -0
  187. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_throws.d.ts +0 -0
  188. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assertion_error.d.ts +0 -0
  189. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/equal.d.ts +0 -0
  190. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/fail.d.ts +0 -0
  191. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/mod.d.ts +0 -0
  192. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/unimplemented.d.ts +0 -0
  193. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/unreachable.d.ts +0 -0
  194. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/encoding/_util.d.ts +0 -0
  195. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/encoding/_util.js +0 -0
  196. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/fmt/colors.d.ts +0 -0
  197. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/fmt/colors.js +0 -0
  198. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/_db.d.ts +0 -0
  199. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/_db.js +0 -0
  200. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/content_type.d.ts +0 -0
  201. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/content_type.js +0 -0
  202. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/extension.d.ts +0 -0
  203. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/extension.js +0 -0
  204. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/extensions_by_type.d.ts +0 -0
  205. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/extensions_by_type.js +0 -0
  206. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/format_media_type.d.ts +0 -0
  207. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/format_media_type.js +0 -0
  208. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/get_charset.d.ts +0 -0
  209. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/get_charset.js +0 -0
  210. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/parse_media_type.d.ts +0 -0
  211. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/parse_media_type.js +0 -0
  212. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/type_by_extension.d.ts +0 -0
  213. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/type_by_extension.js +0 -0
  214. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/vendor/mime-db.v1.52.0.d.ts +0 -0
  215. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/vendor/mime-db.v1.52.0.js +0 -0
  216. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/assert_path.d.ts +0 -0
  217. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/assert_path.js +0 -0
  218. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/basename.d.ts +0 -0
  219. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/basename.js +0 -0
  220. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/common.d.ts +0 -0
  221. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/common.js +0 -0
  222. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/constants.d.ts +0 -0
  223. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/constants.js +0 -0
  224. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/dirname.d.ts +0 -0
  225. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/dirname.js +0 -0
  226. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/format.d.ts +0 -0
  227. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/format.js +0 -0
  228. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/from_file_url.d.ts +0 -0
  229. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/from_file_url.js +0 -0
  230. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/glob_to_reg_exp.d.ts +0 -0
  231. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/glob_to_reg_exp.js +0 -0
  232. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/normalize.d.ts +0 -0
  233. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/normalize.js +0 -0
  234. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/normalize_string.d.ts +0 -0
  235. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/normalize_string.js +0 -0
  236. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/relative.d.ts +0 -0
  237. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/relative.js +0 -0
  238. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/strip_trailing_separators.d.ts +0 -0
  239. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/strip_trailing_separators.js +0 -0
  240. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/to_file_url.d.ts +0 -0
  241. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/to_file_url.js +0 -0
  242. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_interface.d.ts +0 -0
  243. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_interface.js +0 -0
  244. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_os.d.ts +0 -0
  245. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_os.js +0 -0
  246. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/basename.d.ts +0 -0
  247. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/basename.js +0 -0
  248. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/common.d.ts +0 -0
  249. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/common.js +0 -0
  250. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/constants.d.ts +0 -0
  251. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/constants.js +0 -0
  252. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/dirname.d.ts +0 -0
  253. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/dirname.js +0 -0
  254. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/extname.d.ts +0 -0
  255. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/extname.js +0 -0
  256. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/format.d.ts +0 -0
  257. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/format.js +0 -0
  258. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/from_file_url.d.ts +0 -0
  259. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/from_file_url.js +0 -0
  260. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/glob_to_regexp.d.ts +0 -0
  261. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/glob_to_regexp.js +0 -0
  262. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/is_absolute.d.ts +0 -0
  263. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/is_absolute.js +0 -0
  264. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/is_glob.d.ts +0 -0
  265. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/is_glob.js +0 -0
  266. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/join.d.ts +0 -0
  267. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/join.js +0 -0
  268. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/join_globs.d.ts +0 -0
  269. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/join_globs.js +0 -0
  270. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/mod.d.ts +0 -0
  271. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/mod.js +0 -0
  272. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/normalize.d.ts +0 -0
  273. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/normalize.js +0 -0
  274. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/normalize_glob.d.ts +0 -0
  275. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/normalize_glob.js +0 -0
  276. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/parse.d.ts +0 -0
  277. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/parse.js +0 -0
  278. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/_util.d.ts +0 -0
  279. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/_util.js +0 -0
  280. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/basename.d.ts +0 -0
  281. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/basename.js +0 -0
  282. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/common.d.ts +0 -0
  283. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/common.js +0 -0
  284. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/constants.d.ts +0 -0
  285. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/constants.js +0 -0
  286. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/dirname.d.ts +0 -0
  287. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/dirname.js +0 -0
  288. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/extname.d.ts +0 -0
  289. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/extname.js +0 -0
  290. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/format.d.ts +0 -0
  291. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/format.js +0 -0
  292. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/from_file_url.d.ts +0 -0
  293. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/from_file_url.js +0 -0
  294. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/glob_to_regexp.d.ts +0 -0
  295. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/glob_to_regexp.js +0 -0
  296. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/is_absolute.d.ts +0 -0
  297. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/is_absolute.js +0 -0
  298. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/is_glob.d.ts +0 -0
  299. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/is_glob.js +0 -0
  300. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/join.d.ts +0 -0
  301. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/join.js +0 -0
  302. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/join_globs.d.ts +0 -0
  303. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/join_globs.js +0 -0
  304. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/mod.d.ts +0 -0
  305. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/mod.js +0 -0
  306. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/normalize.d.ts +0 -0
  307. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/normalize.js +0 -0
  308. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/normalize_glob.d.ts +0 -0
  309. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/normalize_glob.js +0 -0
  310. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/parse.d.ts +0 -0
  311. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/parse.js +0 -0
  312. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/relative.d.ts +0 -0
  313. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/relative.js +0 -0
  314. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/resolve.d.ts +0 -0
  315. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/resolve.js +0 -0
  316. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/to_file_url.d.ts +0 -0
  317. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/to_file_url.js +0 -0
  318. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/to_namespaced_path.d.ts +0 -0
  319. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/to_namespaced_path.js +0 -0
  320. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/relative.d.ts +0 -0
  321. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/relative.js +0 -0
  322. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/resolve.d.ts +0 -0
  323. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/resolve.js +0 -0
  324. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/to_file_url.d.ts +0 -0
  325. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/to_file_url.js +0 -0
  326. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/to_namespaced_path.d.ts +0 -0
  327. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/to_namespaced_path.js +0 -0
  328. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/_util.d.ts +0 -0
  329. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/_util.js +0 -0
  330. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/basename.d.ts +0 -0
  331. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/basename.js +0 -0
  332. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/common.d.ts +0 -0
  333. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/common.js +0 -0
  334. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/constants.d.ts +0 -0
  335. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/constants.js +0 -0
  336. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/dirname.d.ts +0 -0
  337. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/dirname.js +0 -0
  338. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/extname.d.ts +0 -0
  339. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/extname.js +0 -0
  340. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/format.d.ts +0 -0
  341. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/format.js +0 -0
  342. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/from_file_url.d.ts +0 -0
  343. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/from_file_url.js +0 -0
  344. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/glob_to_regexp.d.ts +0 -0
  345. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/glob_to_regexp.js +0 -0
  346. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/is_absolute.d.ts +0 -0
  347. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/is_absolute.js +0 -0
  348. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/is_glob.d.ts +0 -0
  349. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/is_glob.js +0 -0
  350. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/join.d.ts +0 -0
  351. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/join.js +0 -0
  352. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/join_globs.d.ts +0 -0
  353. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/join_globs.js +0 -0
  354. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/mod.d.ts +0 -0
  355. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/mod.js +0 -0
  356. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/normalize.d.ts +0 -0
  357. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/normalize.js +0 -0
  358. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/normalize_glob.d.ts +0 -0
  359. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/normalize_glob.js +0 -0
  360. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/parse.d.ts +0 -0
  361. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/parse.js +0 -0
  362. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/relative.d.ts +0 -0
  363. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/relative.js +0 -0
  364. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/resolve.d.ts +0 -0
  365. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/resolve.js +0 -0
  366. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/to_file_url.d.ts +0 -0
  367. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/to_file_url.js +0 -0
  368. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/to_namespaced_path.d.ts +0 -0
  369. /package/esm/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/to_namespaced_path.js +0 -0
  370. /package/esm/deps/deno.land/x/{tgcrypto@0.4.0 → tgcrypto@0.4.1}/tgcrypto.d.ts +0 -0
  371. /package/esm/deps/deno.land/x/{tgcrypto@0.4.0 → tgcrypto@0.4.1}/tgcrypto.js +0 -0
  372. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_constants.d.ts +0 -0
  373. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_constants.js +0 -0
  374. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_diff.d.ts +0 -0
  375. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_diff.js +0 -0
  376. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_format.d.ts +0 -0
  377. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/_format.js +0 -0
  378. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert.d.ts +0 -0
  379. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_almost_equals.d.ts +0 -0
  380. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_array_includes.d.ts +0 -0
  381. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_equals.d.ts +0 -0
  382. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_exists.d.ts +0 -0
  383. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_false.d.ts +0 -0
  384. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_greater.d.ts +0 -0
  385. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_greater_or_equal.d.ts +0 -0
  386. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_instance_of.d.ts +0 -0
  387. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_is_error.d.ts +0 -0
  388. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_less.d.ts +0 -0
  389. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_less_or_equal.d.ts +0 -0
  390. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_match.d.ts +0 -0
  391. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_equals.d.ts +0 -0
  392. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_instance_of.d.ts +0 -0
  393. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_match.d.ts +0 -0
  394. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_not_strict_equals.d.ts +0 -0
  395. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_object_match.d.ts +0 -0
  396. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_rejects.d.ts +0 -0
  397. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_strict_equals.d.ts +0 -0
  398. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_string_includes.d.ts +0 -0
  399. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assert_throws.d.ts +0 -0
  400. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/assertion_error.d.ts +0 -0
  401. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/equal.d.ts +0 -0
  402. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/fail.d.ts +0 -0
  403. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/mod.d.ts +0 -0
  404. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/unimplemented.d.ts +0 -0
  405. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/assert/unreachable.d.ts +0 -0
  406. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/encoding/_util.d.ts +0 -0
  407. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/encoding/_util.js +0 -0
  408. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/fmt/colors.d.ts +0 -0
  409. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/fmt/colors.js +0 -0
  410. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/_db.d.ts +0 -0
  411. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/_db.js +0 -0
  412. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/content_type.d.ts +0 -0
  413. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/content_type.js +0 -0
  414. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/extension.d.ts +0 -0
  415. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/extension.js +0 -0
  416. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/extensions_by_type.d.ts +0 -0
  417. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/extensions_by_type.js +0 -0
  418. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/format_media_type.d.ts +0 -0
  419. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/format_media_type.js +0 -0
  420. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/get_charset.d.ts +0 -0
  421. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/get_charset.js +0 -0
  422. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/parse_media_type.d.ts +0 -0
  423. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/parse_media_type.js +0 -0
  424. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/type_by_extension.d.ts +0 -0
  425. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/type_by_extension.js +0 -0
  426. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/vendor/mime-db.v1.52.0.d.ts +0 -0
  427. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/media_types/vendor/mime-db.v1.52.0.js +0 -0
  428. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/assert_path.d.ts +0 -0
  429. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/assert_path.js +0 -0
  430. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/basename.d.ts +0 -0
  431. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/basename.js +0 -0
  432. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/common.d.ts +0 -0
  433. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/common.js +0 -0
  434. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/constants.d.ts +0 -0
  435. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/constants.js +0 -0
  436. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/dirname.d.ts +0 -0
  437. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/dirname.js +0 -0
  438. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/format.d.ts +0 -0
  439. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/format.js +0 -0
  440. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/from_file_url.d.ts +0 -0
  441. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/from_file_url.js +0 -0
  442. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/glob_to_reg_exp.d.ts +0 -0
  443. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/glob_to_reg_exp.js +0 -0
  444. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/normalize.d.ts +0 -0
  445. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/normalize.js +0 -0
  446. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/normalize_string.d.ts +0 -0
  447. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/normalize_string.js +0 -0
  448. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/relative.d.ts +0 -0
  449. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/relative.js +0 -0
  450. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/strip_trailing_separators.d.ts +0 -0
  451. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/strip_trailing_separators.js +0 -0
  452. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/to_file_url.d.ts +0 -0
  453. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_common/to_file_url.js +0 -0
  454. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_interface.d.ts +0 -0
  455. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_interface.js +0 -0
  456. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_os.d.ts +0 -0
  457. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/_os.js +0 -0
  458. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/basename.d.ts +0 -0
  459. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/basename.js +0 -0
  460. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/common.d.ts +0 -0
  461. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/common.js +0 -0
  462. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/constants.d.ts +0 -0
  463. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/constants.js +0 -0
  464. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/dirname.d.ts +0 -0
  465. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/dirname.js +0 -0
  466. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/extname.d.ts +0 -0
  467. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/extname.js +0 -0
  468. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/format.d.ts +0 -0
  469. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/format.js +0 -0
  470. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/from_file_url.d.ts +0 -0
  471. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/from_file_url.js +0 -0
  472. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/glob_to_regexp.d.ts +0 -0
  473. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/glob_to_regexp.js +0 -0
  474. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/is_absolute.d.ts +0 -0
  475. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/is_absolute.js +0 -0
  476. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/is_glob.d.ts +0 -0
  477. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/is_glob.js +0 -0
  478. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/join.d.ts +0 -0
  479. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/join.js +0 -0
  480. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/join_globs.d.ts +0 -0
  481. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/join_globs.js +0 -0
  482. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/mod.d.ts +0 -0
  483. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/mod.js +0 -0
  484. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/normalize.d.ts +0 -0
  485. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/normalize.js +0 -0
  486. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/normalize_glob.d.ts +0 -0
  487. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/normalize_glob.js +0 -0
  488. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/parse.d.ts +0 -0
  489. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/parse.js +0 -0
  490. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/_util.d.ts +0 -0
  491. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/_util.js +0 -0
  492. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/basename.d.ts +0 -0
  493. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/basename.js +0 -0
  494. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/common.d.ts +0 -0
  495. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/common.js +0 -0
  496. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/constants.d.ts +0 -0
  497. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/constants.js +0 -0
  498. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/dirname.d.ts +0 -0
  499. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/dirname.js +0 -0
  500. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/extname.d.ts +0 -0
  501. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/extname.js +0 -0
  502. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/format.d.ts +0 -0
  503. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/format.js +0 -0
  504. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/from_file_url.d.ts +0 -0
  505. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/from_file_url.js +0 -0
  506. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/glob_to_regexp.d.ts +0 -0
  507. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/glob_to_regexp.js +0 -0
  508. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/is_absolute.d.ts +0 -0
  509. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/is_absolute.js +0 -0
  510. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/is_glob.d.ts +0 -0
  511. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/is_glob.js +0 -0
  512. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/join.d.ts +0 -0
  513. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/join.js +0 -0
  514. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/join_globs.d.ts +0 -0
  515. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/join_globs.js +0 -0
  516. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/mod.d.ts +0 -0
  517. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/mod.js +0 -0
  518. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/normalize.d.ts +0 -0
  519. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/normalize.js +0 -0
  520. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/normalize_glob.d.ts +0 -0
  521. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/normalize_glob.js +0 -0
  522. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/parse.d.ts +0 -0
  523. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/parse.js +0 -0
  524. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/relative.d.ts +0 -0
  525. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/relative.js +0 -0
  526. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/resolve.d.ts +0 -0
  527. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/resolve.js +0 -0
  528. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/to_file_url.d.ts +0 -0
  529. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/to_file_url.js +0 -0
  530. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/to_namespaced_path.d.ts +0 -0
  531. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/posix/to_namespaced_path.js +0 -0
  532. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/relative.d.ts +0 -0
  533. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/relative.js +0 -0
  534. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/resolve.d.ts +0 -0
  535. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/resolve.js +0 -0
  536. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/to_file_url.d.ts +0 -0
  537. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/to_file_url.js +0 -0
  538. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/to_namespaced_path.d.ts +0 -0
  539. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/to_namespaced_path.js +0 -0
  540. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/_util.d.ts +0 -0
  541. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/_util.js +0 -0
  542. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/basename.d.ts +0 -0
  543. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/basename.js +0 -0
  544. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/common.d.ts +0 -0
  545. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/common.js +0 -0
  546. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/constants.d.ts +0 -0
  547. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/constants.js +0 -0
  548. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/dirname.d.ts +0 -0
  549. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/dirname.js +0 -0
  550. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/extname.d.ts +0 -0
  551. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/extname.js +0 -0
  552. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/format.d.ts +0 -0
  553. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/format.js +0 -0
  554. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/from_file_url.d.ts +0 -0
  555. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/from_file_url.js +0 -0
  556. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/glob_to_regexp.d.ts +0 -0
  557. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/glob_to_regexp.js +0 -0
  558. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/is_absolute.d.ts +0 -0
  559. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/is_absolute.js +0 -0
  560. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/is_glob.d.ts +0 -0
  561. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/is_glob.js +0 -0
  562. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/join.d.ts +0 -0
  563. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/join.js +0 -0
  564. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/join_globs.d.ts +0 -0
  565. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/join_globs.js +0 -0
  566. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/mod.d.ts +0 -0
  567. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/mod.js +0 -0
  568. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/normalize.d.ts +0 -0
  569. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/normalize.js +0 -0
  570. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/normalize_glob.d.ts +0 -0
  571. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/normalize_glob.js +0 -0
  572. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/parse.d.ts +0 -0
  573. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/parse.js +0 -0
  574. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/relative.d.ts +0 -0
  575. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/relative.js +0 -0
  576. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/resolve.d.ts +0 -0
  577. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/resolve.js +0 -0
  578. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/to_file_url.d.ts +0 -0
  579. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/to_file_url.js +0 -0
  580. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/to_namespaced_path.d.ts +0 -0
  581. /package/script/deps/deno.land/{std@0.221.0 → std@0.222.1}/path/windows/to_namespaced_path.js +0 -0
  582. /package/script/deps/deno.land/x/{tgcrypto@0.4.0 → tgcrypto@0.4.1}/tgcrypto.d.ts +0 -0
  583. /package/script/deps/deno.land/x/{tgcrypto@0.4.0 → tgcrypto@0.4.1}/tgcrypto.js +0 -0
@@ -1,3 +1,15 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ 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");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ 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");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _FileManager_instances, _a, _FileManager_c, _FileManager_Lupload, _FileManager_UPLOAD_MAX_CHUNK_SIZE, _FileManager_DOWNLOAD_MAX_CHUNK_SIZE, _FileManager_BIG_FILE_THRESHOLD, _FileManager_UPLOAD_REQUEST_PER_CONNECTION, _FileManager_uploadStream, _FileManager_uploadBuffer, _FileManager_handleUploadError, _FileManager_getFileContents, _FileManager_downloadInner, _FileManager_CUSTOM_EMOJI_TTL;
1
13
  /**
2
14
  * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
15
  * Copyright (C) 2023-2024 Roj <https://roj.im/>
@@ -17,21 +29,10 @@
17
29
  * You should have received a copy of the GNU Lesser General Public License
18
30
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
31
  */
20
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
21
- if (kind === "m") throw new TypeError("Private method is not writable");
22
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
23
- 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");
24
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
25
- };
26
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
27
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
28
- 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");
29
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
30
- };
31
- var _FileManager_instances, _FileManager_c, _FileManager_Lupload, _FileManager_downloadInner;
32
- import { unreachable } from "../0_deps.js";
33
- import { ConnectionError, InputError } from "../0_errors.js";
34
- import { drop, getLogger, getRandomId, mod } from "../1_utilities.js";
32
+ import * as dntShim from "../_dnt.shims.js";
33
+ import { assert, extension, path, unreachable } from "../0_deps.js";
34
+ import { InputError } from "../0_errors.js";
35
+ import { drop, getLogger, getRandomId, iterateReadableStream, kilobyte, megabyte, minute, mod, PartStream } from "../1_utilities.js";
35
36
  import { as, types } from "../2_tl.js";
36
37
  import { constructSticker, deserializeFileId, FileType, PhotoSourceType, serializeFileId, toUniqueFileId } from "../3_types.js";
37
38
  import { STICKER_SET_NAME_TTL } from "../4_constants.js";
@@ -45,77 +46,56 @@ export class FileManager {
45
46
  const L = getLogger("FileManager").client(c.id);
46
47
  __classPrivateFieldSet(this, _FileManager_Lupload, L.branch("upload"), "f");
47
48
  }
48
- async upload(contents, params) {
49
- const isBig = contents.length > 1048576; // 10 MB
50
- const chunkSize = params?.chunkSize ?? 512 * 1024;
51
- if (mod(chunkSize, 1024) != 0) {
52
- throw new InputError("chunkSize must be divisible by 1024.");
49
+ async upload(file, params, checkName, allowStream = true) {
50
+ let { size, name, contents } = await __classPrivateFieldGet(_a, _a, "m", _FileManager_getFileContents).call(_a, file, params, allowStream);
51
+ if (checkName) {
52
+ name = checkName(name);
53
+ }
54
+ if (size == 0 || size < -1) {
55
+ throw new InputError("Invalid file size.");
53
56
  }
54
- const signal = params?.signal;
55
- __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug("uploading " + (isBig ? "big " : "") + "file of size " + contents.length + " with chunk size of " + chunkSize);
57
+ const chunkSize = params?.chunkSize ?? __classPrivateFieldGet(_a, _a, "f", _FileManager_UPLOAD_MAX_CHUNK_SIZE);
58
+ _a.validateChunkSize(chunkSize, __classPrivateFieldGet(_a, _a, "f", _FileManager_UPLOAD_MAX_CHUNK_SIZE));
56
59
  const fileId = getRandomId();
57
- const name = params?.fileName ?? fileId.toString();
58
- const { api, disconnect, connect } = __classPrivateFieldGet(this, _FileManager_c, "f").apiFactory();
59
- signal?.addEventListener("abort", () => drop(disconnect()));
60
- await connect();
61
- let part = 0;
62
- const partCount = Math.ceil(contents.length / chunkSize);
60
+ const isBig = contents instanceof Uint8Array ? contents.length > __classPrivateFieldGet(_a, _a, "f", _FileManager_BIG_FILE_THRESHOLD) : true;
61
+ const poolSize = contents instanceof Uint8Array ? isBig ? 3 : 1 : 3;
62
+ const pool = __classPrivateFieldGet(this, _FileManager_c, "f").getCdnConnectionPool(poolSize);
63
+ const whatIsUploaded = contents instanceof Uint8Array ? (isBig ? "big file" : "file") + " of size " + size : "stream";
64
+ __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug("uploading " + whatIsUploaded + " with chunk size of " + chunkSize + " and pool size of " + poolSize + " and file ID of " + fileId);
65
+ params?.signal?.addEventListener("abort", () => drop(pool.disconnect()));
66
+ await pool.connect();
67
+ let result;
63
68
  try {
64
- main: for (; part < partCount; part++) {
65
- chunk: while (true) {
66
- try {
67
- const start = part * chunkSize;
68
- const end = start + chunkSize;
69
- const bytes = contents.subarray(start, end);
70
- if (bytes.length == 0) {
71
- continue main;
72
- }
73
- if (isBig) {
74
- await api.upload.saveBigFilePart({ file_id: fileId, file_part: part, bytes, file_total_parts: partCount });
75
- }
76
- else {
77
- await api.upload.saveFilePart({ file_id: fileId, bytes, file_part: part });
78
- }
79
- __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug((part + 1) + " out of " + partCount + " chunks have been uploaded so far");
80
- break chunk;
81
- }
82
- catch (err) {
83
- if (signal?.aborted) {
84
- break main;
85
- }
86
- if (err instanceof FloodWait) { // TODO: should this be removed?
87
- __classPrivateFieldGet(this, _FileManager_Lupload, "f").warning("got a flood wait of " + err.seconds + " seconds");
88
- await new Promise((r) => setTimeout(r, err.seconds * 1000));
89
- }
90
- else if (err instanceof ConnectionError) {
91
- while (true) {
92
- try {
93
- await new Promise((r) => setTimeout(r, 3000));
94
- await connect();
95
- }
96
- catch {
97
- if (signal?.aborted) {
98
- break main;
99
- }
100
- }
101
- }
102
- }
103
- else {
104
- throw err;
105
- }
106
- }
107
- }
69
+ if (contents instanceof Uint8Array) {
70
+ result = await __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_uploadBuffer).call(this, contents, fileId, chunkSize, params?.signal, pool);
71
+ }
72
+ else {
73
+ result = await __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_uploadStream).call(this, contents, fileId, chunkSize, params?.signal, pool);
108
74
  }
109
75
  }
110
76
  finally {
111
- drop(disconnect());
77
+ drop(pool.disconnect());
112
78
  }
113
- __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug("uploaded all " + partCount + " chunk(s)");
114
- if (isBig) {
115
- return new types.InputFileBig({ id: fileId, parts: contents.length / chunkSize, name });
79
+ __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug(`[${fileId}] uploaded ` + result.parts + " part(s)");
80
+ if (result.small) {
81
+ return new types.InputFile({ id: fileId, name, parts: result.parts, md5_checksum: "" });
116
82
  }
117
83
  else {
118
- return new types.InputFile({ id: fileId, name, parts: part, md5_checksum: "" });
84
+ return new types.InputFileBig({ id: fileId, parts: result.parts, name });
85
+ }
86
+ }
87
+ static validateChunkSize(chunkSize, max) {
88
+ if (chunkSize <= 0) {
89
+ throw new InputError("chunkSize must be bigger than zero.");
90
+ }
91
+ if (chunkSize % 1 != 0) {
92
+ throw new InputError("chunkSize must be a whole number.");
93
+ }
94
+ if (chunkSize > max) {
95
+ throw new InputError("chunkSize is too big.");
96
+ }
97
+ if (mod(chunkSize, 1024) != 0) {
98
+ throw new InputError("chunkSize must be divisible by 1024.");
119
99
  }
120
100
  }
121
101
  async *download(fileId, params) {
@@ -129,9 +109,7 @@ export class FileManager {
129
109
  const big = fileId_.location.source.type == PhotoSourceType.ChatPhotoBig;
130
110
  const peer = await __classPrivateFieldGet(this, _FileManager_c, "f").getInputPeer(Number(fileId_.location.source.chatId)); // TODO: use access hash from source?
131
111
  const location = new types.InputPeerPhotoFileLocation({ big: big ? true : undefined, peer, photo_id: fileId_.location.id });
132
- for await (const chunk of __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_downloadInner).call(this, location, fileId_.dcId, params)) {
133
- yield chunk;
134
- }
112
+ yield* __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_downloadInner).call(this, location, fileId_.dcId, params);
135
113
  break;
136
114
  }
137
115
  case FileType.Photo: {
@@ -141,9 +119,7 @@ export class FileManager {
141
119
  file_reference: fileId_.fileReference ?? new Uint8Array(),
142
120
  thumb_size: "thumbnailType" in fileId_.location.source ? String.fromCharCode(fileId_.location.source.thumbnailType) : "",
143
121
  });
144
- for await (const chunk of __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_downloadInner).call(this, location, fileId_.dcId, params)) {
145
- yield chunk;
146
- }
122
+ yield* __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_downloadInner).call(this, location, fileId_.dcId, params);
147
123
  break;
148
124
  }
149
125
  case FileType.Thumbnail: {
@@ -153,9 +129,7 @@ export class FileManager {
153
129
  file_reference: fileId_.fileReference ?? new Uint8Array(),
154
130
  thumb_size: "thumbnailType" in fileId_.location.source ? String.fromCharCode(fileId_.location.source.thumbnailType) : unreachable(),
155
131
  });
156
- for await (const chunk of __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_downloadInner).call(this, location, fileId_.dcId, params)) {
157
- yield chunk;
158
- }
132
+ yield* __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_downloadInner).call(this, location, fileId_.dcId, params);
159
133
  break;
160
134
  }
161
135
  }
@@ -165,11 +139,9 @@ export class FileManager {
165
139
  id: fileId_.location.id,
166
140
  access_hash: fileId_.location.accessHash,
167
141
  file_reference: fileId_.fileReference ?? new Uint8Array(),
168
- thumb_size: "", // TODO?
142
+ thumb_size: "",
169
143
  });
170
- for await (const chunk of __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_downloadInner).call(this, location, fileId_.dcId, params)) {
171
- yield chunk;
172
- }
144
+ yield* __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_downloadInner).call(this, location, fileId_.dcId, params);
173
145
  }
174
146
  else {
175
147
  unreachable();
@@ -196,7 +168,7 @@ export class FileManager {
196
168
  let shouldFetch = false;
197
169
  for (const id_ of id) {
198
170
  const maybeDocument = await __classPrivateFieldGet(this, _FileManager_c, "f").messageStorage.getCustomEmojiDocument(BigInt(id_));
199
- if (maybeDocument != null && Date.now() - maybeDocument[1].getTime() <= 30 * 60 * 1000) {
171
+ if (maybeDocument != null && Date.now() - maybeDocument[1].getTime() <= __classPrivateFieldGet(_a, _a, "f", _FileManager_CUSTOM_EMOJI_TTL)) {
200
172
  const document_ = maybeDocument[0];
201
173
  const fileId_ = {
202
174
  type: FileType.Document,
@@ -234,30 +206,193 @@ export class FileManager {
234
206
  return stickers;
235
207
  }
236
208
  }
237
- _FileManager_c = new WeakMap(), _FileManager_Lupload = new WeakMap(), _FileManager_instances = new WeakSet(), _FileManager_downloadInner = async function* _FileManager_downloadInner(location, dcId, params) {
209
+ _a = FileManager, _FileManager_c = new WeakMap(), _FileManager_Lupload = new WeakMap(), _FileManager_instances = new WeakSet(), _FileManager_uploadStream = async function _FileManager_uploadStream(stream, fileId, chunkSize, signal, pool) {
210
+ let part;
211
+ let promises = new Array();
212
+ let api = pool.api();
213
+ let apiPromiseCount = 0;
214
+ for await (part of iterateReadableStream(stream.pipeThrough(new PartStream(chunkSize)))) {
215
+ promises.push(Promise.resolve().then(async () => {
216
+ while (true) {
217
+ try {
218
+ if (part.small) {
219
+ await api.upload.saveFilePart({ file_id: fileId, bytes: part.bytes, file_part: part.part });
220
+ }
221
+ else {
222
+ await api.upload.saveBigFilePart({ file_id: fileId, file_part: part.part, bytes: part.bytes, file_total_parts: part.totalParts });
223
+ }
224
+ __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug(`[${fileId}] uploaded part ` + (part.part + 1));
225
+ break;
226
+ }
227
+ catch (err) {
228
+ signal?.throwIfAborted();
229
+ __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug(`[${fileId}] failed to upload part ` + (part.part + 1));
230
+ await __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_handleUploadError).call(this, err);
231
+ }
232
+ }
233
+ }));
234
+ if (++apiPromiseCount >= __classPrivateFieldGet(_a, _a, "f", _FileManager_UPLOAD_REQUEST_PER_CONNECTION)) {
235
+ api = pool.api();
236
+ apiPromiseCount = 0;
237
+ }
238
+ if (promises.length == pool.size * __classPrivateFieldGet(_a, _a, "f", _FileManager_UPLOAD_REQUEST_PER_CONNECTION)) {
239
+ await Promise.all(promises);
240
+ promises = [];
241
+ }
242
+ }
243
+ await Promise.all(promises);
244
+ return { small: part.small, parts: part.totalParts };
245
+ }, _FileManager_uploadBuffer = async function _FileManager_uploadBuffer(buffer, fileId, chunkSize, signal, pool) {
246
+ const isBig = buffer.byteLength > __classPrivateFieldGet(_a, _a, "f", _FileManager_BIG_FILE_THRESHOLD);
247
+ const partCount = Math.ceil(buffer.byteLength / chunkSize);
248
+ let promises = new Array();
249
+ for (let part = 0; part < partCount;) {
250
+ for (let i = 0; i < pool.size; ++i) {
251
+ const api = pool.api();
252
+ for (let i = 0; i < __classPrivateFieldGet(_a, _a, "f", _FileManager_UPLOAD_REQUEST_PER_CONNECTION); ++i) {
253
+ const start = part * chunkSize;
254
+ const end = start + chunkSize;
255
+ const bytes = buffer.subarray(start, end);
256
+ assert(bytes.length != 0);
257
+ const thisPart = part++; // `thisPart` must be used instead of `part` in the promise body
258
+ promises.push(Promise.resolve().then(async () => {
259
+ while (true) {
260
+ try {
261
+ signal?.throwIfAborted();
262
+ if (isBig) {
263
+ await api.upload.saveBigFilePart({ file_id: fileId, file_part: thisPart, bytes, file_total_parts: partCount });
264
+ }
265
+ else {
266
+ await api.upload.saveFilePart({ file_id: fileId, bytes, file_part: thisPart });
267
+ }
268
+ __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug(`[${fileId}] uploaded part ` + (thisPart + 1) + " / " + partCount);
269
+ break;
270
+ }
271
+ catch (err) {
272
+ signal?.throwIfAborted();
273
+ __classPrivateFieldGet(this, _FileManager_Lupload, "f").debug(`[${fileId}] failed to upload part ` + (thisPart + 1) + " / " + partCount);
274
+ await __classPrivateFieldGet(this, _FileManager_instances, "m", _FileManager_handleUploadError).call(this, err);
275
+ }
276
+ }
277
+ }));
278
+ }
279
+ }
280
+ await Promise.all(promises);
281
+ promises = [];
282
+ }
283
+ await Promise.all(promises);
284
+ return { small: !isBig, parts: partCount };
285
+ }, _FileManager_handleUploadError = async function _FileManager_handleUploadError(err) {
286
+ if (err instanceof FloodWait) {
287
+ __classPrivateFieldGet(this, _FileManager_Lupload, "f").warning("got a flood wait of " + err.seconds + " seconds");
288
+ await new Promise((r) => setTimeout(r, err.seconds * 1000));
289
+ }
290
+ else {
291
+ throw err;
292
+ }
293
+ }, _FileManager_getFileContents = async function _FileManager_getFileContents(source, params, allowStream) {
294
+ let name = params?.fileName?.trim() || "file";
295
+ let contents;
296
+ let size = -1;
297
+ if (source instanceof Uint8Array) {
298
+ contents = source;
299
+ size = source.byteLength;
300
+ }
301
+ else if (source instanceof ReadableStream) {
302
+ if (!allowStream) {
303
+ throw new InputError("Streamed upload not allowed.");
304
+ }
305
+ contents = source;
306
+ }
307
+ else if (typeof source === "object" && source != null && (Symbol.iterator in source || Symbol.asyncIterator in source)) {
308
+ if (!allowStream) {
309
+ throw new InputError("Streamed upload not allowed.");
310
+ }
311
+ contents = new ReadableStream({
312
+ pull: Symbol.asyncIterator in source
313
+ ? async (controller) => {
314
+ const { value, done } = await source.next();
315
+ done ? controller.close() : controller.enqueue(value);
316
+ }
317
+ : (controller) => {
318
+ const { value, done } = source.next();
319
+ done ? controller.close() : controller.enqueue(value);
320
+ },
321
+ });
322
+ }
323
+ else {
324
+ let url;
325
+ try {
326
+ url = new URL(source).toString();
327
+ }
328
+ catch {
329
+ let path_;
330
+ if (typeof source === "string") {
331
+ if (path.isAbsolute(source)) {
332
+ path_ = source;
333
+ }
334
+ else {
335
+ // @ts-ignore: lib
336
+ path_ = path.join(dntShim.Deno.cwd(), source);
337
+ }
338
+ url = path.toFileUrl(path_).toString();
339
+ name = path.basename(path_);
340
+ }
341
+ else {
342
+ unreachable();
343
+ }
344
+ }
345
+ const response = await fetch(url);
346
+ if (response.body == null) {
347
+ throw new InputError("Invalid response");
348
+ }
349
+ if (name == "file") {
350
+ const contentType = response.headers.get("content-type")?.split(";")[0].trim();
351
+ if (contentType) {
352
+ name += extension(contentType);
353
+ }
354
+ else {
355
+ const maybeFileName = new URL(response.url).pathname.split("/")
356
+ .filter((v) => v)
357
+ .slice(-1)[0]
358
+ .trim();
359
+ if (maybeFileName) {
360
+ name += extension(path.extname(maybeFileName));
361
+ }
362
+ }
363
+ }
364
+ const contentLength = Number(response.headers.get("content-length"));
365
+ if (!isNaN(contentLength)) {
366
+ size = contentLength;
367
+ }
368
+ if (allowStream) {
369
+ contents = response.body;
370
+ }
371
+ else {
372
+ contents = new Uint8Array(await response.arrayBuffer());
373
+ }
374
+ }
375
+ return { size: params?.fileSize ? params.fileSize : size, name, contents };
376
+ }, _FileManager_downloadInner = async function* _FileManager_downloadInner(location, dcId, params) {
238
377
  const id = "id" in location ? location.id : "photo_id" in location ? location.photo_id : null;
239
- if (id != null) {
378
+ if (id != null && __classPrivateFieldGet(this, _FileManager_c, "f").storage.supportsFiles) {
240
379
  const file = await __classPrivateFieldGet(this, _FileManager_c, "f").storage.getFile(id);
241
380
  const partOffset = file == null ? 0 : params?.offset ? Math.ceil(10 / file[1]) - 1 : 0;
242
381
  if (file != null && file[0] > 0) {
243
- for await (const part of __classPrivateFieldGet(this, _FileManager_c, "f").storage.iterFileParts(id, file[0], partOffset)) {
244
- yield part;
245
- }
382
+ yield* __classPrivateFieldGet(this, _FileManager_c, "f").storage.iterFileParts(id, file[0], partOffset);
246
383
  return;
247
384
  }
248
385
  }
249
- const chunkSize = params?.chunkSize ?? 1024 * 1024;
250
- if (mod(chunkSize, 1024) != 0) {
251
- throw new InputError("chunkSize must be divisible by 1024.");
252
- }
253
- const { api, connect, disconnect } = __classPrivateFieldGet(this, _FileManager_c, "f").apiFactory(dcId);
254
- await connect();
386
+ const chunkSize = params?.chunkSize ?? __classPrivateFieldGet(_a, _a, "f", _FileManager_DOWNLOAD_MAX_CHUNK_SIZE);
387
+ _a.validateChunkSize(chunkSize, __classPrivateFieldGet(_a, _a, "f", _FileManager_DOWNLOAD_MAX_CHUNK_SIZE));
388
+ const connection = __classPrivateFieldGet(this, _FileManager_c, "f").getCdnConnection(dcId);
389
+ await connection.connect();
255
390
  const limit = chunkSize;
256
391
  let offset = params?.offset ? BigInt(params.offset) : 0n;
257
392
  let part = 0;
258
393
  try {
259
394
  while (true) {
260
- const file = await api.upload.getFile({ location, offset, limit });
395
+ const file = await connection.api.upload.getFile({ location, offset, limit });
261
396
  if (file instanceof types.upload.File) {
262
397
  yield file.bytes;
263
398
  if (id != null) {
@@ -280,6 +415,11 @@ _FileManager_c = new WeakMap(), _FileManager_Lupload = new WeakMap(), _FileManag
280
415
  }
281
416
  }
282
417
  finally {
283
- drop(disconnect());
418
+ drop(connection.disconnect());
284
419
  }
285
420
  };
421
+ _FileManager_UPLOAD_MAX_CHUNK_SIZE = { value: 512 * kilobyte };
422
+ _FileManager_DOWNLOAD_MAX_CHUNK_SIZE = { value: 1 * megabyte };
423
+ _FileManager_BIG_FILE_THRESHOLD = { value: 10 * megabyte };
424
+ _FileManager_UPLOAD_REQUEST_PER_CONNECTION = { value: 2 };
425
+ _FileManager_CUSTOM_EMOJI_TTL = { value: 30 * minute };
@@ -18,8 +18,9 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { enums, types } from "../2_tl.js";
21
+ import { InputMedia } from "../3_types.js";
21
22
  import { ChatAction, ChatMember, FileSource, FileType, ID, Message, MessageEntity, ParseMode, Reaction, Update, UsernameResolver } from "../3_types.js";
22
- import { AddReactionParams, BanChatMemberParams, CreateInviteLinkParams, DeleteMessagesParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetCreatedInviteLinksParams, GetHistoryParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetReactionsParams, StopPollParams } from "./0_params.js";
23
+ import { AddReactionParams, BanChatMemberParams, CreateInviteLinkParams, DeleteMessagesParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetCreatedInviteLinksParams, GetHistoryParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetReactionsParams, StopPollParams } from "./0_params.js";
23
24
  import { C as C_ } from "./0_types.js";
24
25
  import { FileManager } from "./1_file_manager.js";
25
26
  interface C extends C_ {
@@ -67,6 +68,8 @@ export declare class MessageManager {
67
68
  editInlineMessageReplyMarkup(inlineMessageId: string, params?: EditMessageReplyMarkupParams): Promise<void>;
68
69
  editMessageText(chatId: ID, messageId: number, text: string, params?: EditMessageParams): Promise<import("../3_types.js").MessageText>;
69
70
  editInlineMessageText(inlineMessageId: string, text: string, params?: EditMessageParams): Promise<void>;
71
+ editMessageMedia(chatId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise<import("../3_types.js").MessageText | import("../3_types.js").MessageLink | import("../3_types.js").MessagePhoto | import("../3_types.js").MessageDocument | import("../3_types.js").MessageVideo | import("../3_types.js").MessageSticker | import("../3_types.js").MessageAnimation | import("../3_types.js").MessageVoice | import("../3_types.js").MessageAudio | import("../3_types.js").MessageDice | import("../3_types.js").MessageVideoNote | import("../3_types.js").MessageContact | import("../3_types.js").MessageGame | import("../3_types.js").MessagePoll | import("../3_types.js").MessageVenue | import("../3_types.js").MessageLocation | import("../3_types.js").MessageNewChatMembers | import("../3_types.js").MessageLeftChatMember | import("../3_types.js").MessageNewChatTitle | import("../3_types.js").MessageNewChatPhoto | import("../3_types.js").MessageDeletedChatPhoto | import("../3_types.js").MessageGroupCreated | import("../3_types.js").MessageSupergroupCreated | import("../3_types.js").MessageChannelCreated | import("../3_types.js").MessageAutoDeleteTimerChanged | import("../3_types.js").MessageChatMigratedTo | import("../3_types.js").MessageChatMigratedFrom | import("../3_types.js").MessagePinnedMessage | import("../3_types.js").MessageUserShared | import("../3_types.js").MessageWriteAccessAllowed | import("../3_types.js").MessageForumTopicCreated | import("../3_types.js").MessageForumTopicEdited | import("../3_types.js").MessageForumTopicClosed | import("../3_types.js").MessageForumTopicReopened | import("../3_types.js").MessageVideoChatScheduled | import("../3_types.js").MessageVideoChatStarted | import("../3_types.js").MessageVideoChatEnded | import("../3_types.js").MessageGiveaway | import("../3_types.js").MessageUnsupported>;
72
+ editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params?: EditMessageMediaParams): Promise<void>;
70
73
  deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
71
74
  deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
72
75
  pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;