@mtkruto/node 0.1.100 → 0.1.102

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 (197) hide show
  1. package/esm/0_deps.d.ts +3 -3
  2. package/esm/0_deps.js +3 -3
  3. package/esm/4_constants.d.ts +1 -1
  4. package/esm/4_constants.js +1 -1
  5. package/esm/client/0_message.js +3 -9
  6. package/esm/client/3_types.d.ts +2 -0
  7. package/esm/client/4_client.d.ts +55 -4
  8. package/esm/client/4_client.js +260 -72
  9. package/esm/connection/1_connection_web_socket.js +5 -2
  10. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_diff.js +10 -3
  11. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_false.js +1 -0
  12. package/esm/deps/deno.land/std@0.204.0/encoding/_util.d.ts +1 -0
  13. package/esm/deps/deno.land/std@0.204.0/encoding/_util.js +26 -0
  14. package/esm/deps/deno.land/std@0.204.0/encoding/base64.d.ts +23 -0
  15. package/{script/deps/deno.land/std@0.201.0 → esm/deps/deno.land/std@0.204.0}/encoding/base64.js +23 -18
  16. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/fmt/colors.js +1 -1
  17. package/esm/deps/deno.land/x/{tgcrypto@0.3.2 → tgcrypto@0.3.3}/mod.js +10 -4
  18. package/esm/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +324 -0
  19. package/esm/tl/6_message.d.ts +1 -0
  20. package/esm/tl/6_message.js +1 -2
  21. package/esm/tl/6_message_test.d.ts +1 -0
  22. package/esm/transport/0_obfuscation.js +3 -3
  23. package/esm/transport/0_transport.d.ts +2 -2
  24. package/esm/transport/0_transport.js +2 -8
  25. package/esm/transport/1_transport_abridged.js +9 -7
  26. package/esm/transport/1_transport_intermediate.js +7 -3
  27. package/esm/types/3_message.d.ts +4 -0
  28. package/esm/types/3_message.js +4 -1
  29. package/esm/utilities/0_bigint.d.ts +1 -0
  30. package/esm/utilities/0_bigint.js +2 -0
  31. package/esm/utilities/0_crypto.d.ts +1 -1
  32. package/esm/utilities/0_crypto.js +1 -3
  33. package/esm/utilities/0_queue.js +1 -1
  34. package/package.json +1 -1
  35. package/script/0_deps.d.ts +3 -3
  36. package/script/0_deps.js +3 -3
  37. package/script/4_constants.d.ts +1 -1
  38. package/script/4_constants.js +1 -1
  39. package/script/client/0_message.js +2 -8
  40. package/script/client/3_types.d.ts +2 -0
  41. package/script/client/4_client.d.ts +55 -4
  42. package/script/client/4_client.js +260 -71
  43. package/script/connection/1_connection_web_socket.js +5 -2
  44. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_diff.js +10 -3
  45. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_false.js +1 -0
  46. package/script/deps/deno.land/std@0.204.0/encoding/_util.d.ts +1 -0
  47. package/script/deps/deno.land/std@0.204.0/encoding/_util.js +30 -0
  48. package/script/deps/deno.land/std@0.204.0/encoding/base64.d.ts +23 -0
  49. package/{esm/deps/deno.land/std@0.201.0 → script/deps/deno.land/std@0.204.0}/encoding/base64.js +28 -13
  50. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/fmt/colors.js +1 -1
  51. package/script/deps/deno.land/x/{tgcrypto@0.3.2 → tgcrypto@0.3.3}/mod.js +10 -4
  52. package/script/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +326 -0
  53. package/script/tl/6_message.d.ts +1 -0
  54. package/script/tl/6_message.js +2 -2
  55. package/script/tl/6_message_test.d.ts +1 -0
  56. package/script/transport/0_obfuscation.js +3 -3
  57. package/script/transport/0_transport.d.ts +2 -2
  58. package/script/transport/0_transport.js +2 -8
  59. package/script/transport/1_transport_abridged.js +9 -7
  60. package/script/transport/1_transport_intermediate.js +7 -3
  61. package/script/types/3_message.d.ts +4 -0
  62. package/script/types/3_message.js +4 -1
  63. package/script/utilities/0_bigint.d.ts +1 -0
  64. package/script/utilities/0_bigint.js +2 -0
  65. package/script/utilities/0_crypto.d.ts +1 -1
  66. package/script/utilities/0_crypto.js +1 -3
  67. package/script/utilities/0_queue.js +1 -1
  68. package/esm/deps/deno.land/std@0.201.0/encoding/base64.d.ts +0 -11
  69. package/esm/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.js +0 -308
  70. package/script/deps/deno.land/std@0.201.0/encoding/base64.d.ts +0 -11
  71. package/script/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.js +0 -310
  72. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_constants.d.ts +0 -0
  73. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_constants.js +0 -0
  74. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_diff.d.ts +0 -0
  75. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_format.d.ts +0 -0
  76. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_format.js +0 -0
  77. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert.d.ts +0 -0
  78. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert.js +0 -0
  79. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_almost_equals.d.ts +0 -0
  80. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_almost_equals.js +0 -0
  81. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_array_includes.d.ts +0 -0
  82. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_array_includes.js +0 -0
  83. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_equals.d.ts +0 -0
  84. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_equals.js +0 -0
  85. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_exists.d.ts +0 -0
  86. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_exists.js +0 -0
  87. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_false.d.ts +1 -1
  88. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_greater.d.ts +0 -0
  89. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_greater.js +0 -0
  90. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_greater_or_equal.d.ts +0 -0
  91. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_greater_or_equal.js +0 -0
  92. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_instance_of.d.ts +0 -0
  93. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_instance_of.js +0 -0
  94. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_is_error.d.ts +0 -0
  95. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_is_error.js +0 -0
  96. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_less.d.ts +0 -0
  97. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_less.js +0 -0
  98. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_less_or_equal.d.ts +0 -0
  99. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_less_or_equal.js +0 -0
  100. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_match.d.ts +0 -0
  101. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_match.js +0 -0
  102. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_equals.d.ts +0 -0
  103. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_equals.js +0 -0
  104. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_instance_of.d.ts +0 -0
  105. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_instance_of.js +0 -0
  106. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_match.d.ts +0 -0
  107. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_match.js +0 -0
  108. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_strict_equals.d.ts +0 -0
  109. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_strict_equals.js +0 -0
  110. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_object_match.d.ts +0 -0
  111. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_object_match.js +0 -0
  112. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_rejects.d.ts +0 -0
  113. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_rejects.js +0 -0
  114. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_strict_equals.d.ts +0 -0
  115. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_strict_equals.js +0 -0
  116. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_string_includes.d.ts +0 -0
  117. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_string_includes.js +0 -0
  118. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_throws.d.ts +0 -0
  119. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_throws.js +0 -0
  120. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assertion_error.d.ts +0 -0
  121. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assertion_error.js +0 -0
  122. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/equal.d.ts +0 -0
  123. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/equal.js +0 -0
  124. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/fail.d.ts +0 -0
  125. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/fail.js +0 -0
  126. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/mod.d.ts +0 -0
  127. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/mod.js +0 -0
  128. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/unimplemented.d.ts +0 -0
  129. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/unimplemented.js +0 -0
  130. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/unreachable.d.ts +0 -0
  131. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/unreachable.js +0 -0
  132. package/esm/deps/deno.land/{std@0.201.0 → std@0.204.0}/fmt/colors.d.ts +0 -0
  133. package/esm/deps/deno.land/x/{tgcrypto@0.3.2 → tgcrypto@0.3.3}/mod.d.ts +0 -0
  134. package/esm/deps/deno.land/x/{tgcrypto@0.3.2 → tgcrypto@0.3.3}/tgcrypto.d.ts +0 -0
  135. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_constants.d.ts +0 -0
  136. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_constants.js +0 -0
  137. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_diff.d.ts +0 -0
  138. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_format.d.ts +0 -0
  139. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/_format.js +0 -0
  140. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert.d.ts +0 -0
  141. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert.js +0 -0
  142. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_almost_equals.d.ts +0 -0
  143. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_almost_equals.js +0 -0
  144. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_array_includes.d.ts +0 -0
  145. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_array_includes.js +0 -0
  146. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_equals.d.ts +0 -0
  147. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_equals.js +0 -0
  148. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_exists.d.ts +0 -0
  149. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_exists.js +0 -0
  150. package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_false.d.ts +1 -1
  151. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_greater.d.ts +0 -0
  152. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_greater.js +0 -0
  153. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_greater_or_equal.d.ts +0 -0
  154. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_greater_or_equal.js +0 -0
  155. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_instance_of.d.ts +0 -0
  156. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_instance_of.js +0 -0
  157. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_is_error.d.ts +0 -0
  158. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_is_error.js +0 -0
  159. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_less.d.ts +0 -0
  160. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_less.js +0 -0
  161. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_less_or_equal.d.ts +0 -0
  162. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_less_or_equal.js +0 -0
  163. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_match.d.ts +0 -0
  164. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_match.js +0 -0
  165. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_equals.d.ts +0 -0
  166. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_equals.js +0 -0
  167. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_instance_of.d.ts +0 -0
  168. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_instance_of.js +0 -0
  169. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_match.d.ts +0 -0
  170. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_match.js +0 -0
  171. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_strict_equals.d.ts +0 -0
  172. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_not_strict_equals.js +0 -0
  173. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_object_match.d.ts +0 -0
  174. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_object_match.js +0 -0
  175. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_rejects.d.ts +0 -0
  176. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_rejects.js +0 -0
  177. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_strict_equals.d.ts +0 -0
  178. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_strict_equals.js +0 -0
  179. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_string_includes.d.ts +0 -0
  180. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_string_includes.js +0 -0
  181. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_throws.d.ts +0 -0
  182. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assert_throws.js +0 -0
  183. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assertion_error.d.ts +0 -0
  184. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/assertion_error.js +0 -0
  185. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/equal.d.ts +0 -0
  186. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/equal.js +0 -0
  187. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/fail.d.ts +0 -0
  188. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/fail.js +0 -0
  189. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/mod.d.ts +0 -0
  190. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/mod.js +0 -0
  191. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/unimplemented.d.ts +0 -0
  192. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/unimplemented.js +0 -0
  193. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/unreachable.d.ts +0 -0
  194. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/assert/unreachable.js +0 -0
  195. /package/script/deps/deno.land/{std@0.201.0 → std@0.204.0}/fmt/colors.d.ts +0 -0
  196. /package/script/deps/deno.land/x/{tgcrypto@0.3.2 → tgcrypto@0.3.3}/mod.d.ts +0 -0
  197. /package/script/deps/deno.land/x/{tgcrypto@0.3.2 → tgcrypto@0.3.3}/tgcrypto.d.ts +0 -0
package/esm/0_deps.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./deps/deno.land/std@0.201.0/assert/mod.js";
2
- export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.2/mod.js";
1
+ export * from "./deps/deno.land/std@0.204.0/assert/mod.js";
2
+ export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.3/mod.js";
3
3
  export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
4
4
  export { Mutex, type MutexInterface } from "async-mutex";
5
5
  export { Parser } from "./deps/deno.land/x/html_parser@v0.1.3/src/mod.js";
6
6
  import { debug as debug_ } from "./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js";
7
7
  export declare const debug: typeof debug_;
8
- export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.201.0/encoding/base64.js";
8
+ export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.204.0/encoding/base64.js";
package/esm/0_deps.js CHANGED
@@ -1,8 +1,8 @@
1
- export * from "./deps/deno.land/std@0.201.0/assert/mod.js";
2
- export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.2/mod.js";
1
+ export * from "./deps/deno.land/std@0.204.0/assert/mod.js";
2
+ export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.3/mod.js";
3
3
  export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
4
4
  export { Mutex } from "async-mutex";
5
5
  export { Parser } from "./deps/deno.land/x/html_parser@v0.1.3/src/mod.js";
6
6
  import { debug as debug_ } from "./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js";
7
7
  export const debug = (v) => debug_(v);
8
- export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.201.0/encoding/base64.js";
8
+ export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.204.0/encoding/base64.js";
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
5
5
  export declare const VECTOR_CONSTRUCTOR = 481674261;
6
6
  export declare const INITIAL_DC: DC;
7
7
  export declare const LAYER = 161;
8
- export declare const APP_VERSION = "MTKruto 0.1.100";
8
+ export declare const APP_VERSION = "MTKruto 0.1.102";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
54
54
  export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
55
55
  export const INITIAL_DC = "2-test";
56
56
  export const LAYER = 161;
57
- export const APP_VERSION = "MTKruto 0.1.100";
57
+ export const APP_VERSION = "MTKruto 0.1.102";
58
58
  // @ts-ignore: lib
59
59
  export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
60
60
  export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -1,5 +1,5 @@
1
1
  import { assertEquals, ige256Decrypt, ige256Encrypt } from "../0_deps.js";
2
- import { bufferFromBigInt, concat, sha256 } from "../1_utilities.js";
2
+ import { bufferFromBigInt, concat, mod, sha256 } from "../1_utilities.js";
3
3
  import { id, Message_, MessageContainer, RPCResult, serialize, TLReader, TLWriter } from "../2_tl.js";
4
4
  export function getMessageId(lastMsgId) {
5
5
  const now = new Date().getTime() / 1000 + 0;
@@ -37,14 +37,8 @@ export async function encryptMessage(message, authKey, authKeyId, salt, sessionI
37
37
  payloadWriter.writeInt32(message.seqNo);
38
38
  payloadWriter.writeInt32(encoded.length);
39
39
  payloadWriter.write(encoded);
40
- payloadWriter.write(new Uint8Array(payloadWriter.buffer.length + 12 % 16 + 12));
41
- let payload = payloadWriter.buffer;
42
- while (true) {
43
- if (payload.length % 16 == 0 && (payload.length) % 4 == 0) {
44
- break;
45
- }
46
- payload = concat(payload, new Uint8Array(1));
47
- }
40
+ payloadWriter.write(new Uint8Array(mod(-(payloadWriter.buffer.length + 12), 16) + 12));
41
+ const payload = payloadWriter.buffer;
48
42
  const messageKey = (await sha256(concat(authKey.slice(88, 120), payload))).slice(8, 24);
49
43
  const a = await sha256(concat(messageKey, authKey.slice(0, 36)));
50
44
  const b = await sha256(concat(authKey.slice(40, 76), messageKey));
@@ -1,4 +1,5 @@
1
1
  import { MaybePromise } from "../1_utilities.js";
2
+ import { functions, types } from "../2_tl.js";
2
3
  import { CallbackQuery, ChatID, ForceReply, InlineKeyboardMarkup, InlineQuery, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
3
4
  import { With } from "./0_utilities.js";
4
5
  import { ClientPlainParams } from "./2_client_plain.js";
@@ -36,6 +37,7 @@ export interface ClientParams extends ClientPlainParams {
36
37
  * Whether to automatically call `start` with no parameters in the first `invoke` call. Defaults to `true`.
37
38
  */
38
39
  autoStart?: boolean;
40
+ errorHandler?: (err: unknown, function_: types.Type | functions.Function<unknown>, n: number) => MaybePromise<boolean>;
39
41
  }
40
42
  export interface AnswerCallbackQueryParams {
41
43
  /** Text of the answer */
@@ -12,8 +12,9 @@ export declare const getStickerSetName: unique symbol;
12
12
  export declare const handleMigrationError: unique symbol;
13
13
  export declare const getMessageWithReply: unique symbol;
14
14
  export declare const restartAuth: unique symbol;
15
+ export declare class ConnectionError extends Error {
16
+ }
15
17
  export declare class Client extends ClientAbstract {
16
- readonly storage: Storage;
17
18
  readonly apiId: number | null;
18
19
  readonly apiHash: string | null;
19
20
  private auth;
@@ -22,6 +23,8 @@ export declare class Client extends ClientAbstract {
22
23
  private promises;
23
24
  private toAcknowledge;
24
25
  private updateState?;
26
+ private readonly errorHandler?;
27
+ readonly storage: Storage;
25
28
  readonly parseMode: ParseMode;
26
29
  readonly appVersion: string;
27
30
  readonly deviceModel: string;
@@ -38,7 +41,7 @@ export declare class Client extends ClientAbstract {
38
41
  * @param apiId App's API ID from [my.telegram.org](https://my.telegram.org/apps). Defaults to 0 (unset).
39
42
  * @param apiHash App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Defaults to empty string (unset).
40
43
  */
41
- constructor(storage?: Storage, apiId?: number | null, apiHash?: string | null, params?: ClientParams);
44
+ constructor(storage: Storage | null, apiId?: number | null, apiHash?: string | null, params?: ClientParams);
42
45
  private propagateConnectionState;
43
46
  private lastPropagatedConnectionState;
44
47
  protected stateChangeHandler: (connected: boolean) => void;
@@ -91,6 +94,7 @@ export declare class Client extends ClientAbstract {
91
94
  start(params?: string | types.AuthExportedAuthorization | AuthorizeUserParams): Promise<void>;
92
95
  private receiveLoop;
93
96
  private pingLoop;
97
+ private pingLoopStarted;
94
98
  private autoStarted;
95
99
  private lastMsgId;
96
100
  /**
@@ -141,7 +145,7 @@ export declare class Client extends ClientAbstract {
141
145
  * @param messageId The ID of the message.
142
146
  * @param text The new text of the message.
143
147
  */
144
- editMessageText(chatId: ChatID, messageId: number, text: string, params?: EditMessageParams): Promise<void>;
148
+ editMessageText(chatId: ChatID, messageId: number, text: string, params?: EditMessageParams): Promise<With<Message, "text">>;
145
149
  private getMessagesInner;
146
150
  /**
147
151
  * Retrieve multiple messages.
@@ -164,7 +168,9 @@ export declare class Client extends ClientAbstract {
164
168
  *
165
169
  * @param fileId The identifier of the file to download.
166
170
  */
167
- download(fileId: string): Promise<AsyncGenerator<Uint8Array, void, unknown>>;
171
+ download(fileId: string, params?: {
172
+ chunkSize?: number;
173
+ }): Promise<AsyncGenerator<Uint8Array, void, unknown>>;
168
174
  [getStickerSetName](inputStickerSet: types.InputStickerSetID, hash?: number): Promise<string>;
169
175
  /**
170
176
  * Forward multiple messages.
@@ -212,6 +218,16 @@ export declare class Client extends ClientAbstract {
212
218
  * @param messageThreadId The thread to send the chat action to.
213
219
  */
214
220
  sendChatAction(chatId: ChatID, action_: ChatAction, messageThreadId?: number): Promise<void>;
221
+ /**
222
+ * Upload a file.
223
+ *
224
+ * @param contents The contents of the file.
225
+ */
226
+ upload(contents: Uint8Array, params?: {
227
+ fileName?: string;
228
+ chunkSize?: number;
229
+ signal?: AbortSignal | null;
230
+ }): Promise<types.InputFile | types.InputFileBig>;
215
231
  setMyCommands(commands: BotCommand[], params?: {
216
232
  languageCode?: string;
217
233
  scope?: BotCommandScope;
@@ -233,4 +249,39 @@ export declare class Client extends ClientAbstract {
233
249
  filter<D extends Update>(predicate: (update: Update) => update is D, handler: Handler<D>): void;
234
250
  filter(predicate: (update: Update) => MaybePromise<boolean>, handler: Handler): void;
235
251
  on<T extends keyof Update, F extends keyof NonNullable<Update[T]>>(filter: T extends FilterableUpdates ? T | [T, F, ...F[]] : T, handler: Handler<FilterUpdate<Update, T, F>>): void;
252
+ setMyInfo(info: Omit<ConstructorParameters<typeof functions["BotsSetBotInfo"]>[0], "bot">): Promise<void>;
253
+ /**
254
+ * Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
255
+ */
256
+ setMyDescription({ description, languageCode }: {
257
+ description?: string;
258
+ languageCode?: string;
259
+ }): Promise<void>;
260
+ /**
261
+ * Use this method to change the bot's name.
262
+ */
263
+ setMyName({ name, languageCode }: {
264
+ name?: string;
265
+ languageCode?: string;
266
+ }): Promise<void>;
267
+ /**
268
+ * Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot.
269
+ */
270
+ setMyShortDescription({ shortDescription: about, languageCode }: {
271
+ shortDescription?: string;
272
+ languageCode?: string;
273
+ }): Promise<void>;
274
+ private getMyInfo;
275
+ /**
276
+ * Use this method to get the current bot description for the given user language.
277
+ */
278
+ getMyDescription(languageCode?: string): Promise<string>;
279
+ /**
280
+ * Use this method to get the current bot name for the given user language.
281
+ */
282
+ getMyName(languageCode?: string): Promise<string>;
283
+ /**
284
+ * Use this method to get the current bot short description for the given user language.
285
+ */
286
+ getMyShortDescription(languageCode?: string): Promise<string>;
236
287
  }