@mtkruto/node 0.1.101 → 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 (231) hide show
  1. package/esm/0_deps.d.ts +2 -3
  2. package/esm/0_deps.js +2 -3
  3. package/esm/4_constants.d.ts +1 -1
  4. package/esm/4_constants.js +1 -1
  5. package/esm/client/4_client.d.ts +36 -1
  6. package/esm/client/4_client.js +57 -10
  7. package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.js +10 -3
  8. package/esm/tl/6_message.d.ts +1 -0
  9. package/esm/tl/6_message.js +1 -2
  10. package/esm/tl/6_message_test.d.ts +1 -0
  11. package/esm/transport/0_obfuscation.js +3 -3
  12. package/esm/transport/0_transport.d.ts +2 -2
  13. package/esm/transport/0_transport.js +2 -8
  14. package/esm/transport/1_transport_abridged.js +9 -7
  15. package/esm/transport/1_transport_intermediate.js +7 -3
  16. package/esm/types/3_message.d.ts +4 -0
  17. package/esm/types/3_message.js +3 -0
  18. package/esm/utilities/0_bigint.js +2 -1
  19. package/esm/utilities/0_crypto.d.ts +1 -1
  20. package/esm/utilities/0_crypto.js +1 -3
  21. package/package.json +1 -1
  22. package/script/0_deps.d.ts +2 -3
  23. package/script/0_deps.js +3 -5
  24. package/script/4_constants.d.ts +1 -1
  25. package/script/4_constants.js +1 -1
  26. package/script/client/4_client.d.ts +36 -1
  27. package/script/client/4_client.js +56 -9
  28. package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.js +10 -3
  29. package/script/tl/6_message.d.ts +1 -0
  30. package/script/tl/6_message.js +2 -2
  31. package/script/tl/6_message_test.d.ts +1 -0
  32. package/script/transport/0_obfuscation.js +3 -3
  33. package/script/transport/0_transport.d.ts +2 -2
  34. package/script/transport/0_transport.js +2 -8
  35. package/script/transport/1_transport_abridged.js +9 -7
  36. package/script/transport/1_transport_intermediate.js +7 -3
  37. package/script/types/3_message.d.ts +4 -0
  38. package/script/types/3_message.js +3 -0
  39. package/script/utilities/0_bigint.js +2 -1
  40. package/script/utilities/0_crypto.d.ts +1 -1
  41. package/script/utilities/0_crypto.js +1 -3
  42. package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/fnv32.d.ts +0 -2
  43. package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/fnv32.js +0 -24
  44. package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/fnv64.d.ts +0 -2
  45. package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/fnv64.js +0 -27
  46. package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/mod.d.ts +0 -1
  47. package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/mod.js +0 -21
  48. package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/util.d.ts +0 -13
  49. package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/util.js +0 -48
  50. package/esm/deps/deno.land/std@0.203.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.d.ts +0 -125
  51. package/esm/deps/deno.land/std@0.203.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.js +0 -3337
  52. package/esm/deps/deno.land/std@0.203.0/crypto/_wasm/mod.d.ts +0 -12
  53. package/esm/deps/deno.land/std@0.203.0/crypto/_wasm/mod.js +0 -39
  54. package/esm/deps/deno.land/std@0.203.0/crypto/crypto.d.ts +0 -157
  55. package/esm/deps/deno.land/std@0.203.0/crypto/crypto.js +0 -266
  56. package/esm/deps/deno.land/std@0.203.0/crypto/keystack.d.ts +0 -4
  57. package/esm/deps/deno.land/std@0.203.0/crypto/keystack.js +0 -6
  58. package/esm/deps/deno.land/std@0.203.0/crypto/mod.d.ts +0 -12
  59. package/esm/deps/deno.land/std@0.203.0/crypto/mod.js +0 -14
  60. package/esm/deps/deno.land/std@0.203.0/crypto/timing_safe_equal.d.ts +0 -28
  61. package/esm/deps/deno.land/std@0.203.0/crypto/timing_safe_equal.js +0 -54
  62. package/esm/deps/deno.land/std@0.203.0/crypto/to_hash_string.d.ts +0 -19
  63. package/esm/deps/deno.land/std@0.203.0/crypto/to_hash_string.js +0 -31
  64. package/esm/deps/deno.land/std@0.203.0/crypto/unstable/keystack.d.ts +0 -46
  65. package/esm/deps/deno.land/std@0.203.0/crypto/unstable/keystack.js +0 -149
  66. package/esm/deps/deno.land/std@0.203.0/encoding/base64url.d.ts +0 -24
  67. package/esm/deps/deno.land/std@0.203.0/encoding/base64url.js +0 -80
  68. package/esm/deps/deno.land/std@0.203.0/encoding/hex.d.ts +0 -18
  69. package/esm/deps/deno.land/std@0.203.0/encoding/hex.js +0 -115
  70. package/script/deps/deno.land/std@0.203.0/crypto/_fnv/fnv32.d.ts +0 -2
  71. package/script/deps/deno.land/std@0.203.0/crypto/_fnv/fnv32.js +0 -29
  72. package/script/deps/deno.land/std@0.203.0/crypto/_fnv/fnv64.d.ts +0 -2
  73. package/script/deps/deno.land/std@0.203.0/crypto/_fnv/fnv64.js +0 -32
  74. package/script/deps/deno.land/std@0.203.0/crypto/_fnv/mod.d.ts +0 -1
  75. package/script/deps/deno.land/std@0.203.0/crypto/_fnv/mod.js +0 -25
  76. package/script/deps/deno.land/std@0.203.0/crypto/_fnv/util.d.ts +0 -13
  77. package/script/deps/deno.land/std@0.203.0/crypto/_fnv/util.js +0 -54
  78. package/script/deps/deno.land/std@0.203.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.d.ts +0 -125
  79. package/script/deps/deno.land/std@0.203.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.js +0 -3345
  80. package/script/deps/deno.land/std@0.203.0/crypto/_wasm/mod.d.ts +0 -12
  81. package/script/deps/deno.land/std@0.203.0/crypto/_wasm/mod.js +0 -44
  82. package/script/deps/deno.land/std@0.203.0/crypto/crypto.d.ts +0 -157
  83. package/script/deps/deno.land/std@0.203.0/crypto/crypto.js +0 -292
  84. package/script/deps/deno.land/std@0.203.0/crypto/keystack.d.ts +0 -4
  85. package/script/deps/deno.land/std@0.203.0/crypto/keystack.js +0 -22
  86. package/script/deps/deno.land/std@0.203.0/crypto/mod.d.ts +0 -12
  87. package/script/deps/deno.land/std@0.203.0/crypto/mod.js +0 -30
  88. package/script/deps/deno.land/std@0.203.0/crypto/timing_safe_equal.d.ts +0 -28
  89. package/script/deps/deno.land/std@0.203.0/crypto/timing_safe_equal.js +0 -58
  90. package/script/deps/deno.land/std@0.203.0/crypto/to_hash_string.d.ts +0 -19
  91. package/script/deps/deno.land/std@0.203.0/crypto/to_hash_string.js +0 -35
  92. package/script/deps/deno.land/std@0.203.0/crypto/unstable/keystack.d.ts +0 -46
  93. package/script/deps/deno.land/std@0.203.0/crypto/unstable/keystack.js +0 -176
  94. package/script/deps/deno.land/std@0.203.0/encoding/base64url.d.ts +0 -24
  95. package/script/deps/deno.land/std@0.203.0/encoding/base64url.js +0 -108
  96. package/script/deps/deno.land/std@0.203.0/encoding/hex.d.ts +0 -18
  97. package/script/deps/deno.land/std@0.203.0/encoding/hex.js +0 -122
  98. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_constants.d.ts +0 -0
  99. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_constants.js +0 -0
  100. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.d.ts +0 -0
  101. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_format.d.ts +0 -0
  102. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_format.js +0 -0
  103. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert.d.ts +0 -0
  104. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert.js +0 -0
  105. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_almost_equals.d.ts +0 -0
  106. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_almost_equals.js +0 -0
  107. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_array_includes.d.ts +0 -0
  108. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_array_includes.js +0 -0
  109. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_equals.d.ts +0 -0
  110. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_equals.js +0 -0
  111. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_exists.d.ts +0 -0
  112. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_exists.js +0 -0
  113. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_false.d.ts +0 -0
  114. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_false.js +0 -0
  115. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater.d.ts +0 -0
  116. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater.js +0 -0
  117. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater_or_equal.d.ts +0 -0
  118. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater_or_equal.js +0 -0
  119. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_instance_of.d.ts +0 -0
  120. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_instance_of.js +0 -0
  121. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_is_error.d.ts +0 -0
  122. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_is_error.js +0 -0
  123. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less.d.ts +0 -0
  124. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less.js +0 -0
  125. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less_or_equal.d.ts +0 -0
  126. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less_or_equal.js +0 -0
  127. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_match.d.ts +0 -0
  128. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_match.js +0 -0
  129. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_equals.d.ts +0 -0
  130. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_equals.js +0 -0
  131. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_instance_of.d.ts +0 -0
  132. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_instance_of.js +0 -0
  133. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_match.d.ts +0 -0
  134. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_match.js +0 -0
  135. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_strict_equals.d.ts +0 -0
  136. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_strict_equals.js +0 -0
  137. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_object_match.d.ts +0 -0
  138. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_object_match.js +0 -0
  139. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_rejects.d.ts +0 -0
  140. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_rejects.js +0 -0
  141. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_strict_equals.d.ts +0 -0
  142. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_strict_equals.js +0 -0
  143. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_string_includes.d.ts +0 -0
  144. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_string_includes.js +0 -0
  145. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_throws.d.ts +0 -0
  146. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_throws.js +0 -0
  147. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assertion_error.d.ts +0 -0
  148. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assertion_error.js +0 -0
  149. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/equal.d.ts +0 -0
  150. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/equal.js +0 -0
  151. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/fail.d.ts +0 -0
  152. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/fail.js +0 -0
  153. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/mod.d.ts +0 -0
  154. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/mod.js +0 -0
  155. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unimplemented.d.ts +0 -0
  156. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unimplemented.js +0 -0
  157. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unreachable.d.ts +0 -0
  158. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unreachable.js +0 -0
  159. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/_util.d.ts +0 -0
  160. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/_util.js +0 -0
  161. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/base64.d.ts +0 -0
  162. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/base64.js +0 -0
  163. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/fmt/colors.d.ts +0 -0
  164. /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/fmt/colors.js +0 -0
  165. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_constants.d.ts +0 -0
  166. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_constants.js +0 -0
  167. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.d.ts +0 -0
  168. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_format.d.ts +0 -0
  169. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_format.js +0 -0
  170. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert.d.ts +0 -0
  171. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert.js +0 -0
  172. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_almost_equals.d.ts +0 -0
  173. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_almost_equals.js +0 -0
  174. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_array_includes.d.ts +0 -0
  175. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_array_includes.js +0 -0
  176. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_equals.d.ts +0 -0
  177. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_equals.js +0 -0
  178. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_exists.d.ts +0 -0
  179. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_exists.js +0 -0
  180. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_false.d.ts +0 -0
  181. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_false.js +0 -0
  182. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater.d.ts +0 -0
  183. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater.js +0 -0
  184. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater_or_equal.d.ts +0 -0
  185. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater_or_equal.js +0 -0
  186. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_instance_of.d.ts +0 -0
  187. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_instance_of.js +0 -0
  188. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_is_error.d.ts +0 -0
  189. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_is_error.js +0 -0
  190. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less.d.ts +0 -0
  191. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less.js +0 -0
  192. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less_or_equal.d.ts +0 -0
  193. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less_or_equal.js +0 -0
  194. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_match.d.ts +0 -0
  195. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_match.js +0 -0
  196. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_equals.d.ts +0 -0
  197. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_equals.js +0 -0
  198. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_instance_of.d.ts +0 -0
  199. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_instance_of.js +0 -0
  200. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_match.d.ts +0 -0
  201. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_match.js +0 -0
  202. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_strict_equals.d.ts +0 -0
  203. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_strict_equals.js +0 -0
  204. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_object_match.d.ts +0 -0
  205. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_object_match.js +0 -0
  206. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_rejects.d.ts +0 -0
  207. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_rejects.js +0 -0
  208. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_strict_equals.d.ts +0 -0
  209. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_strict_equals.js +0 -0
  210. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_string_includes.d.ts +0 -0
  211. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_string_includes.js +0 -0
  212. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_throws.d.ts +0 -0
  213. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_throws.js +0 -0
  214. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assertion_error.d.ts +0 -0
  215. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assertion_error.js +0 -0
  216. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/equal.d.ts +0 -0
  217. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/equal.js +0 -0
  218. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/fail.d.ts +0 -0
  219. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/fail.js +0 -0
  220. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/mod.d.ts +0 -0
  221. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/mod.js +0 -0
  222. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unimplemented.d.ts +0 -0
  223. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unimplemented.js +0 -0
  224. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unreachable.d.ts +0 -0
  225. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unreachable.js +0 -0
  226. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/_util.d.ts +0 -0
  227. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/_util.js +0 -0
  228. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/base64.d.ts +0 -0
  229. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/base64.js +0 -0
  230. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/fmt/colors.d.ts +0 -0
  231. /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/fmt/colors.js +0 -0
package/esm/0_deps.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- export * from "./deps/deno.land/std@0.203.0/assert/mod.js";
1
+ export * from "./deps/deno.land/std@0.204.0/assert/mod.js";
2
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.203.0/encoding/base64.js";
9
- export { crypto } from "./deps/deno.land/std@0.203.0/crypto/mod.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,9 +1,8 @@
1
- export * from "./deps/deno.land/std@0.203.0/assert/mod.js";
1
+ export * from "./deps/deno.land/std@0.204.0/assert/mod.js";
2
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.203.0/encoding/base64.js";
9
- export { crypto } from "./deps/deno.land/std@0.203.0/crypto/mod.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.101";
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.101";
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];
@@ -145,7 +145,7 @@ export declare class Client extends ClientAbstract {
145
145
  * @param messageId The ID of the message.
146
146
  * @param text The new text of the message.
147
147
  */
148
- 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">>;
149
149
  private getMessagesInner;
150
150
  /**
151
151
  * Retrieve multiple messages.
@@ -249,4 +249,39 @@ export declare class Client extends ClientAbstract {
249
249
  filter<D extends Update>(predicate: (update: Update) => update is D, handler: Handler<D>): void;
250
250
  filter(predicate: (update: Update) => MaybePromise<boolean>, handler: Handler): void;
251
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>;
252
287
  }
@@ -1,4 +1,4 @@
1
- import { crypto, debug, gunzip, Mutex } from "../0_deps.js";
1
+ import { debug, gunzip, Mutex } from "../0_deps.js";
2
2
  import { bigIntFromBuffer, drop, getRandomBigInt, getRandomId, mod, mustPrompt, mustPromptOneOf, Queue, sha1, UNREACHABLE } from "../1_utilities.js";
3
3
  import { as, functions, getChannelChatId, Message_, MessageContainer, peerToChatId, RPCResult, TLError, TLReader, types } from "../2_tl.js";
4
4
  import { StorageMemory } from "../3_storage.js";
@@ -1199,10 +1199,10 @@ export class Client extends ClientAbstract {
1199
1199
  const messages = new Array();
1200
1200
  if (updates instanceof types.Updates) {
1201
1201
  for (const update of updates.updates) {
1202
- if (update instanceof types.UpdateNewMessage) {
1202
+ if (update instanceof types.UpdateNewMessage || update instanceof types.UpdateEditMessage) {
1203
1203
  messages.push(await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
1204
1204
  }
1205
- else if (update instanceof types.UpdateNewChannelMessage) {
1205
+ else if (update instanceof types.UpdateNewChannelMessage || update instanceof types.UpdateEditChannelMessage) {
1206
1206
  messages.push(await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
1207
1207
  }
1208
1208
  }
@@ -1283,7 +1283,7 @@ export class Client extends ClientAbstract {
1283
1283
  */
1284
1284
  async editMessageText(chatId, messageId, text, params) {
1285
1285
  const [message, entities] = this.parseText(text, params);
1286
- await this.invoke(new functions.MessagesEditMessage({
1286
+ const result = await this.invoke(new functions.MessagesEditMessage({
1287
1287
  id: messageId,
1288
1288
  peer: await this.getInputPeer(chatId),
1289
1289
  entities,
@@ -1291,6 +1291,8 @@ export class Client extends ClientAbstract {
1291
1291
  noWebpage: params?.disableWebPagePreview ? true : undefined,
1292
1292
  replyMarkup: await this.constructReplyMarkup(params),
1293
1293
  }));
1294
+ const message_ = await this.updatesToMessages(chatId, result).then((v) => v[0]);
1295
+ return Client.assertMsgHas(message_, "text");
1294
1296
  }
1295
1297
  async getMessagesInner(chatId_, messageIds) {
1296
1298
  const peer = await this.getInputPeer(chatId_);
@@ -1686,9 +1688,6 @@ export class Client extends ClientAbstract {
1686
1688
  client.state.salt = this.state.salt;
1687
1689
  await client.connect();
1688
1690
  let part = 0;
1689
- const md5sum = await crypto.subtle.digest("MD5", contents).then((v) => [...new Uint8Array(v)]
1690
- .map((b) => b.toString(16).padStart(2, "0"))
1691
- .join(""));
1692
1691
  const partCount = Math.ceil(contents.length / chunkSize);
1693
1692
  try {
1694
1693
  main: for (; part < partCount; part++) {
@@ -1745,20 +1744,20 @@ export class Client extends ClientAbstract {
1745
1744
  return new types.InputFileBig({ id: fileId, parts: contents.length / chunkSize, name });
1746
1745
  }
1747
1746
  else {
1748
- return new types.InputFile({ id: fileId, name, parts: part, md5Checksum: md5sum });
1747
+ return new types.InputFile({ id: fileId, name, parts: part, md5Checksum: "" });
1749
1748
  }
1750
1749
  }
1751
1750
  async setMyCommands(commands, params) {
1752
1751
  await this.invoke(new functions.BotsSetBotCommands({
1753
1752
  commands: commands.map((v) => new types.BotCommand(v)),
1754
1753
  langCode: params?.languageCode ?? "",
1755
- scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)), // TODO: use params.scope
1754
+ scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)),
1756
1755
  }));
1757
1756
  }
1758
1757
  async getMyCommands(params) {
1759
1758
  const commands_ = await this.invoke(new functions.BotsGetBotCommands({
1760
1759
  langCode: params?.languageCode ?? "",
1761
- scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)), // TODO: use params.scope
1760
+ scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)),
1762
1761
  }));
1763
1762
  return commands_.map((v) => ({ command: v.command, description: v.description }));
1764
1763
  }
@@ -1820,4 +1819,52 @@ export class Client extends ClientAbstract {
1820
1819
  }
1821
1820
  }, handler);
1822
1821
  }
1822
+ async setMyInfo(info) {
1823
+ await this.invoke(new functions.BotsSetBotInfo({ bot: new types.InputUserSelf(), ...info }));
1824
+ }
1825
+ /**
1826
+ * Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
1827
+ */
1828
+ async setMyDescription({ description, languageCode }) {
1829
+ await this.assertBot("setMyDescription");
1830
+ await this.setMyInfo({ description, langCode: languageCode ?? "" });
1831
+ }
1832
+ /**
1833
+ * Use this method to change the bot's name.
1834
+ */
1835
+ async setMyName({ name, languageCode }) {
1836
+ await this.assertBot("setMyName");
1837
+ await this.setMyInfo({ name, langCode: languageCode ?? "" });
1838
+ }
1839
+ /**
1840
+ * 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.
1841
+ */
1842
+ async setMyShortDescription({ shortDescription: about, languageCode }) {
1843
+ await this.assertBot("setMyShortDescription");
1844
+ await this.setMyInfo({ about, langCode: languageCode ?? "" });
1845
+ }
1846
+ getMyInfo(languageCode) {
1847
+ return this.invoke(new functions.BotsGetBotInfo({ bot: new types.InputUserSelf(), langCode: languageCode ?? "" }));
1848
+ }
1849
+ /**
1850
+ * Use this method to get the current bot description for the given user language.
1851
+ */
1852
+ async getMyDescription(languageCode) {
1853
+ await this.assertBot("getMyDescription");
1854
+ return await this.getMyInfo(languageCode).then((v) => v.description);
1855
+ }
1856
+ /**
1857
+ * Use this method to get the current bot name for the given user language.
1858
+ */
1859
+ async getMyName(languageCode) {
1860
+ await this.assertBot("getMyName");
1861
+ return await this.getMyInfo(languageCode).then((v) => v.description);
1862
+ }
1863
+ /**
1864
+ * Use this method to get the current bot short description for the given user language.
1865
+ */
1866
+ async getMyShortDescription(languageCode) {
1867
+ await this.assertBot("getMyShortDescription");
1868
+ return await this.getMyInfo(languageCode).then((v) => v.about);
1869
+ }
1823
1870
  }
@@ -239,14 +239,21 @@ export function diffstr(A, B) {
239
239
  }
240
240
  }
241
241
  // Compute word-diff
242
- const aLines = added.length < removed.length ? added : removed;
243
- const bLines = aLines === removed ? added : removed;
242
+ const hasMoreRemovedLines = added.length < removed.length;
243
+ const aLines = hasMoreRemovedLines ? added : removed;
244
+ const bLines = hasMoreRemovedLines ? removed : added;
244
245
  for (const a of aLines) {
245
246
  let tokens = [], b;
246
247
  // Search another diff line with at least one common token
247
248
  while (bLines.length) {
248
249
  b = bLines.shift();
249
- tokens = diff(tokenize(a.value, { wordDiff: true }), tokenize(b?.value ?? "", { wordDiff: true }));
250
+ const tokenized = [
251
+ tokenize(a.value, { wordDiff: true }),
252
+ tokenize(b?.value ?? "", { wordDiff: true }),
253
+ ];
254
+ if (hasMoreRemovedLines)
255
+ tokenized.reverse();
256
+ tokens = diff(tokenized[0], tokenized[1]);
250
257
  if (tokens.some(({ type, value }) => type === DiffType.common && value.trim().length)) {
251
258
  break;
252
259
  }
@@ -1,5 +1,6 @@
1
1
  import { ReadObject, TLReader } from "./3_tl_reader.js";
2
2
  import { RPCResult } from "./5_rpc_result.js";
3
+ export declare function calculateLength(object: ReadObject): number;
3
4
  export declare class Message_ {
4
5
  readonly id: bigint;
5
6
  readonly seqNo: number;
@@ -2,8 +2,7 @@ import { id, serialize } from "./1_tl_object.js";
2
2
  import { TLReader } from "./3_tl_reader.js";
3
3
  import { TLWriter } from "./4_tl_writer.js";
4
4
  import { RPCResult } from "./5_rpc_result.js";
5
- // TODO: test
6
- function calculateLength(object) {
5
+ export function calculateLength(object) {
7
6
  let length = 0;
8
7
  if (Array.isArray(object)) {
9
8
  length += 32 / 8; // vector constructor
@@ -0,0 +1 @@
1
+ export {};
@@ -1,10 +1,9 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { bufferFromBigInt, concat, CTR } from "../1_utilities.js";
3
3
  export async function getObfuscationParameters(protocol, connection) {
4
- const dc = 0xFCFF;
5
4
  let init;
6
5
  while (true) {
7
- init = concat(dntShim.crypto.getRandomValues(new Uint8Array(56)), bufferFromBigInt(protocol, 4, false), bufferFromBigInt(dc, 2, false), dntShim.crypto.getRandomValues(new Uint8Array(2)));
6
+ init = concat(dntShim.crypto.getRandomValues(new Uint8Array(56)), bufferFromBigInt(protocol, 4, false), dntShim.crypto.getRandomValues(new Uint8Array(4)));
8
7
  if (init[0] == 0xEF) {
9
8
  continue;
10
9
  }
@@ -22,7 +21,8 @@ export async function getObfuscationParameters(protocol, connection) {
22
21
  const encryptKey = init.slice(8, 8 + 32);
23
22
  const encryptIv = init.slice(40, 40 + 16);
24
23
  const encryptionCTR = new CTR(encryptKey, encryptIv);
25
- const encryptedInit = encryptionCTR.call(init);
24
+ const encryptedInit = new Uint8Array(init);
25
+ encryptionCTR.call(encryptedInit);
26
26
  const initRev = new Uint8Array(init).reverse();
27
27
  const decryptKey = initRev.slice(8, 8 + 32);
28
28
  const decryptIv = initRev.slice(40, 40 + 16);
@@ -5,8 +5,8 @@ export declare abstract class Transport {
5
5
  encryptionCTR: CTR;
6
6
  decryptionCTR: CTR;
7
7
  } | null;
8
- protected encrypt(buffer: Uint8Array): Uint8Array;
9
- protected decrypt(buffer: Uint8Array): Uint8Array;
8
+ protected encrypt(buffer: Uint8Array): void;
9
+ protected decrypt(buffer: Uint8Array): void;
10
10
  abstract initialize(): MaybePromise<void>;
11
11
  abstract receive(): MaybePromise<Uint8Array>;
12
12
  abstract send(buffer: Uint8Array): MaybePromise<void>;
@@ -15,18 +15,12 @@ export class Transport {
15
15
  }
16
16
  encrypt(buffer) {
17
17
  if (this.obfuscationParameters) {
18
- return this.obfuscationParameters.encryptionCTR.call(buffer);
19
- }
20
- else {
21
- return buffer;
18
+ this.obfuscationParameters.encryptionCTR.call(buffer);
22
19
  }
23
20
  }
24
21
  decrypt(buffer) {
25
22
  if (this.obfuscationParameters) {
26
- return this.obfuscationParameters.decryptionCTR.call(buffer);
27
- }
28
- else {
29
- return buffer;
23
+ this.obfuscationParameters.decryptionCTR.call(buffer);
30
24
  }
31
25
  }
32
26
  }
@@ -34,24 +34,24 @@ export class TransportAbridged extends Transport {
34
34
  async receive() {
35
35
  let length;
36
36
  {
37
- let buffer = new Uint8Array(1);
37
+ const buffer = new Uint8Array(1);
38
38
  await this.connection.read(buffer);
39
- buffer = this.decrypt(buffer);
39
+ this.decrypt(buffer);
40
40
  if (buffer[0] < 0x7F) {
41
41
  length = buffer[0];
42
42
  }
43
43
  else {
44
- let buffer = new Uint8Array(3);
44
+ const buffer = new Uint8Array(3);
45
45
  await this.connection.read(buffer);
46
- buffer = this.decrypt(buffer);
46
+ this.decrypt(buffer);
47
47
  const dataView = new DataView(buffer.buffer);
48
48
  length = dataView.getUint16(0, true);
49
49
  }
50
50
  }
51
51
  length *= 4;
52
- let buffer = new Uint8Array(length);
52
+ const buffer = new Uint8Array(length);
53
53
  await this.connection.read(buffer);
54
- buffer = this.decrypt(buffer);
54
+ this.decrypt(buffer);
55
55
  return buffer;
56
56
  }
57
57
  async send(buffer) {
@@ -61,7 +61,9 @@ export class TransportAbridged extends Transport {
61
61
  const bufferLength = buffer.length / 4;
62
62
  const header = new Uint8Array([bufferLength >= 0x7F ? 0x7F : bufferLength]);
63
63
  const length = bufferLength >= 0x7F ? bufferFromBigInt(bufferLength, 3) : new Uint8Array();
64
- await this.connection.write(this.encrypt(concat(header, length, buffer)));
64
+ const data = concat(header, length, buffer);
65
+ this.encrypt(data);
66
+ await this.connection.write(data);
65
67
  }
66
68
  deinitialize() {
67
69
  this.initialized = false;
@@ -36,19 +36,23 @@ export class TransportIntermediate extends Transport {
36
36
  {
37
37
  const buffer = new Uint8Array(4);
38
38
  await this.connection.read(buffer);
39
- const dataView = new DataView(this.decrypt(buffer).buffer);
39
+ this.decrypt(buffer);
40
+ const dataView = new DataView(buffer.buffer);
40
41
  length = dataView.getUint32(0, true);
41
42
  }
42
43
  const buffer = new Uint8Array(length);
43
44
  await this.connection.read(buffer);
44
- return this.decrypt(buffer);
45
+ this.decrypt(buffer);
46
+ return buffer;
45
47
  }
46
48
  async send(buffer) {
47
49
  if (!this.initialized) {
48
50
  throw new Error("Transport not initialized");
49
51
  }
50
52
  const length = bufferFromBigInt(buffer.length, 4);
51
- await this.connection.write(this.encrypt(concat(length, buffer)));
53
+ const data = concat(length, buffer);
54
+ this.encrypt(data);
55
+ await this.connection.write(data);
52
56
  }
53
57
  deinitialize() {
54
58
  this.initialized = false;
@@ -126,6 +126,10 @@ export interface Message {
126
126
  supergroupCreated?: true;
127
127
  /** Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */
128
128
  channelCreated?: true;
129
+ /** Service message: auto-delete timer settings changed in the chat */
130
+ messageAutoDeleteTimerChanged?: {
131
+ messageAutoDeleteTime: number;
132
+ };
129
133
  /** The group has been migrated to a supergroup with the specified identifier */
130
134
  chatMigratedTo?: number;
131
135
  /** The supergroup has been migrated from a group with the specified identifier */
@@ -177,6 +177,9 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
177
177
  message.videoChatStarted = {};
178
178
  }
179
179
  }
180
+ else if (message_.action instanceof types.MessageActionSetMessagesTTL) {
181
+ message.messageAutoDeleteTimerChanged = { messageAutoDeleteTime: message_.action.period || 0 };
182
+ }
180
183
  return cleanObject(message);
181
184
  }
182
185
  export async function constructMessage(message_, getEntity, getMessage, getStickerSetName) {
@@ -16,7 +16,8 @@ export function modExp(a, b, n) {
16
16
  return result;
17
17
  }
18
18
  export function mod(n, m) {
19
- // @ts-ignore: TODO: do sth
19
+ // deno-lint-ignore ban-ts-comment
20
+ // @ts-ignore
20
21
  return ((n % m) + m) % m;
21
22
  }
22
23
  export function bigIntFromBuffer(buffer, little = true, signed = false) {
@@ -3,5 +3,5 @@ export declare class CTR {
3
3
  iv: Uint8Array;
4
4
  state: Uint8Array;
5
5
  constructor(key: Uint8Array, iv: Uint8Array);
6
- call(data: Uint8Array): Uint8Array;
6
+ call(data: Uint8Array): void;
7
7
  }
@@ -21,8 +21,6 @@ export class CTR {
21
21
  });
22
22
  }
23
23
  call(data) {
24
- const v = new Uint8Array(data); // TODO: don't copy
25
- ctr256(v, this.key, this.iv, this.state);
26
- return v;
24
+ ctr256(data, this.key, this.iv, this.state);
27
25
  }
28
26
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "module": "./esm/mod.js",
3
3
  "main": "./script/mod.js",
4
4
  "name": "@mtkruto/node",
5
- "version": "0.1.101",
5
+ "version": "0.1.102",
6
6
  "description": "MTKruto for Node.js",
7
7
  "author": "Roj <rojvv@icloud.com>",
8
8
  "license": "LGPL-3.0-or-later",
@@ -1,9 +1,8 @@
1
- export * from "./deps/deno.land/std@0.203.0/assert/mod.js";
1
+ export * from "./deps/deno.land/std@0.204.0/assert/mod.js";
2
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.203.0/encoding/base64.js";
9
- export { crypto } from "./deps/deno.land/std@0.203.0/crypto/mod.js";
8
+ export { decode as base64Decode, encode as base64Encode } from "./deps/deno.land/std@0.204.0/encoding/base64.js";
package/script/0_deps.js CHANGED
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.crypto = exports.base64Encode = exports.base64Decode = exports.debug = exports.Parser = exports.Mutex = exports.gzip = exports.gunzip = exports.initTgCrypto = exports.ige256Encrypt = exports.ige256Decrypt = exports.factorize = exports.ctr256 = void 0;
18
- __exportStar(require("./deps/deno.land/std@0.203.0/assert/mod.js"), exports);
17
+ exports.base64Encode = exports.base64Decode = exports.debug = exports.Parser = exports.Mutex = exports.gzip = exports.gunzip = exports.initTgCrypto = exports.ige256Encrypt = exports.ige256Decrypt = exports.factorize = exports.ctr256 = void 0;
18
+ __exportStar(require("./deps/deno.land/std@0.204.0/assert/mod.js"), exports);
19
19
  var mod_js_1 = require("./deps/deno.land/x/tgcrypto@0.3.3/mod.js");
20
20
  Object.defineProperty(exports, "ctr256", { enumerable: true, get: function () { return mod_js_1.ctr256; } });
21
21
  Object.defineProperty(exports, "factorize", { enumerable: true, get: function () { return mod_js_1.factorize; } });
@@ -32,8 +32,6 @@ Object.defineProperty(exports, "Parser", { enumerable: true, get: function () {
32
32
  const mod_js_3 = require("./deps/raw.githubusercontent.com/MTKruto/debug/main/mod.js");
33
33
  const debug = (v) => (0, mod_js_3.debug)(v);
34
34
  exports.debug = debug;
35
- var base64_js_1 = require("./deps/deno.land/std@0.203.0/encoding/base64.js");
35
+ var base64_js_1 = require("./deps/deno.land/std@0.204.0/encoding/base64.js");
36
36
  Object.defineProperty(exports, "base64Decode", { enumerable: true, get: function () { return base64_js_1.decode; } });
37
37
  Object.defineProperty(exports, "base64Encode", { enumerable: true, get: function () { return base64_js_1.encode; } });
38
- var mod_js_4 = require("./deps/deno.land/std@0.203.0/crypto/mod.js");
39
- Object.defineProperty(exports, "crypto", { enumerable: true, get: function () { return mod_js_4.crypto; } });
@@ -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.101";
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 = "";
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
80
80
  exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
81
81
  exports.INITIAL_DC = "2-test";
82
82
  exports.LAYER = 161;
83
- exports.APP_VERSION = "MTKruto 0.1.101";
83
+ exports.APP_VERSION = "MTKruto 0.1.102";
84
84
  // @ts-ignore: lib
85
85
  exports.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;
86
86
  exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -145,7 +145,7 @@ export declare class Client extends ClientAbstract {
145
145
  * @param messageId The ID of the message.
146
146
  * @param text The new text of the message.
147
147
  */
148
- 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">>;
149
149
  private getMessagesInner;
150
150
  /**
151
151
  * Retrieve multiple messages.
@@ -249,4 +249,39 @@ export declare class Client extends ClientAbstract {
249
249
  filter<D extends Update>(predicate: (update: Update) => update is D, handler: Handler<D>): void;
250
250
  filter(predicate: (update: Update) => MaybePromise<boolean>, handler: Handler): void;
251
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>;
252
287
  }