@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.
- package/esm/0_deps.d.ts +2 -3
- package/esm/0_deps.js +2 -3
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/4_client.d.ts +36 -1
- package/esm/client/4_client.js +57 -10
- package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.js +10 -3
- package/esm/tl/6_message.d.ts +1 -0
- package/esm/tl/6_message.js +1 -2
- package/esm/tl/6_message_test.d.ts +1 -0
- package/esm/transport/0_obfuscation.js +3 -3
- package/esm/transport/0_transport.d.ts +2 -2
- package/esm/transport/0_transport.js +2 -8
- package/esm/transport/1_transport_abridged.js +9 -7
- package/esm/transport/1_transport_intermediate.js +7 -3
- package/esm/types/3_message.d.ts +4 -0
- package/esm/types/3_message.js +3 -0
- package/esm/utilities/0_bigint.js +2 -1
- package/esm/utilities/0_crypto.d.ts +1 -1
- package/esm/utilities/0_crypto.js +1 -3
- package/package.json +1 -1
- package/script/0_deps.d.ts +2 -3
- package/script/0_deps.js +3 -5
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/4_client.d.ts +36 -1
- package/script/client/4_client.js +56 -9
- package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.js +10 -3
- package/script/tl/6_message.d.ts +1 -0
- package/script/tl/6_message.js +2 -2
- package/script/tl/6_message_test.d.ts +1 -0
- package/script/transport/0_obfuscation.js +3 -3
- package/script/transport/0_transport.d.ts +2 -2
- package/script/transport/0_transport.js +2 -8
- package/script/transport/1_transport_abridged.js +9 -7
- package/script/transport/1_transport_intermediate.js +7 -3
- package/script/types/3_message.d.ts +4 -0
- package/script/types/3_message.js +3 -0
- package/script/utilities/0_bigint.js +2 -1
- package/script/utilities/0_crypto.d.ts +1 -1
- package/script/utilities/0_crypto.js +1 -3
- package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/fnv32.d.ts +0 -2
- package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/fnv32.js +0 -24
- package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/fnv64.d.ts +0 -2
- package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/fnv64.js +0 -27
- package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/mod.d.ts +0 -1
- package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/mod.js +0 -21
- package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/util.d.ts +0 -13
- package/esm/deps/deno.land/std@0.203.0/crypto/_fnv/util.js +0 -48
- package/esm/deps/deno.land/std@0.203.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.d.ts +0 -125
- package/esm/deps/deno.land/std@0.203.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.js +0 -3337
- package/esm/deps/deno.land/std@0.203.0/crypto/_wasm/mod.d.ts +0 -12
- package/esm/deps/deno.land/std@0.203.0/crypto/_wasm/mod.js +0 -39
- package/esm/deps/deno.land/std@0.203.0/crypto/crypto.d.ts +0 -157
- package/esm/deps/deno.land/std@0.203.0/crypto/crypto.js +0 -266
- package/esm/deps/deno.land/std@0.203.0/crypto/keystack.d.ts +0 -4
- package/esm/deps/deno.land/std@0.203.0/crypto/keystack.js +0 -6
- package/esm/deps/deno.land/std@0.203.0/crypto/mod.d.ts +0 -12
- package/esm/deps/deno.land/std@0.203.0/crypto/mod.js +0 -14
- package/esm/deps/deno.land/std@0.203.0/crypto/timing_safe_equal.d.ts +0 -28
- package/esm/deps/deno.land/std@0.203.0/crypto/timing_safe_equal.js +0 -54
- package/esm/deps/deno.land/std@0.203.0/crypto/to_hash_string.d.ts +0 -19
- package/esm/deps/deno.land/std@0.203.0/crypto/to_hash_string.js +0 -31
- package/esm/deps/deno.land/std@0.203.0/crypto/unstable/keystack.d.ts +0 -46
- package/esm/deps/deno.land/std@0.203.0/crypto/unstable/keystack.js +0 -149
- package/esm/deps/deno.land/std@0.203.0/encoding/base64url.d.ts +0 -24
- package/esm/deps/deno.land/std@0.203.0/encoding/base64url.js +0 -80
- package/esm/deps/deno.land/std@0.203.0/encoding/hex.d.ts +0 -18
- package/esm/deps/deno.land/std@0.203.0/encoding/hex.js +0 -115
- package/script/deps/deno.land/std@0.203.0/crypto/_fnv/fnv32.d.ts +0 -2
- package/script/deps/deno.land/std@0.203.0/crypto/_fnv/fnv32.js +0 -29
- package/script/deps/deno.land/std@0.203.0/crypto/_fnv/fnv64.d.ts +0 -2
- package/script/deps/deno.land/std@0.203.0/crypto/_fnv/fnv64.js +0 -32
- package/script/deps/deno.land/std@0.203.0/crypto/_fnv/mod.d.ts +0 -1
- package/script/deps/deno.land/std@0.203.0/crypto/_fnv/mod.js +0 -25
- package/script/deps/deno.land/std@0.203.0/crypto/_fnv/util.d.ts +0 -13
- package/script/deps/deno.land/std@0.203.0/crypto/_fnv/util.js +0 -54
- package/script/deps/deno.land/std@0.203.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.d.ts +0 -125
- package/script/deps/deno.land/std@0.203.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.js +0 -3345
- package/script/deps/deno.land/std@0.203.0/crypto/_wasm/mod.d.ts +0 -12
- package/script/deps/deno.land/std@0.203.0/crypto/_wasm/mod.js +0 -44
- package/script/deps/deno.land/std@0.203.0/crypto/crypto.d.ts +0 -157
- package/script/deps/deno.land/std@0.203.0/crypto/crypto.js +0 -292
- package/script/deps/deno.land/std@0.203.0/crypto/keystack.d.ts +0 -4
- package/script/deps/deno.land/std@0.203.0/crypto/keystack.js +0 -22
- package/script/deps/deno.land/std@0.203.0/crypto/mod.d.ts +0 -12
- package/script/deps/deno.land/std@0.203.0/crypto/mod.js +0 -30
- package/script/deps/deno.land/std@0.203.0/crypto/timing_safe_equal.d.ts +0 -28
- package/script/deps/deno.land/std@0.203.0/crypto/timing_safe_equal.js +0 -58
- package/script/deps/deno.land/std@0.203.0/crypto/to_hash_string.d.ts +0 -19
- package/script/deps/deno.land/std@0.203.0/crypto/to_hash_string.js +0 -35
- package/script/deps/deno.land/std@0.203.0/crypto/unstable/keystack.d.ts +0 -46
- package/script/deps/deno.land/std@0.203.0/crypto/unstable/keystack.js +0 -176
- package/script/deps/deno.land/std@0.203.0/encoding/base64url.d.ts +0 -24
- package/script/deps/deno.land/std@0.203.0/encoding/base64url.js +0 -108
- package/script/deps/deno.land/std@0.203.0/encoding/hex.d.ts +0 -18
- package/script/deps/deno.land/std@0.203.0/encoding/hex.js +0 -122
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_constants.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_constants.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_format.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_almost_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_array_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_array_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_exists.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_exists.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_false.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_false.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater_or_equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater_or_equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_is_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_is_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less_or_equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less_or_equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_instance_of.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_object_match.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_object_match.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_rejects.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_rejects.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_strict_equals.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_string_includes.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_string_includes.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_throws.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_throws.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assertion_error.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assertion_error.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/equal.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/equal.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/fail.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/fail.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/mod.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/mod.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unimplemented.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unimplemented.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unreachable.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unreachable.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/_util.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/_util.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/base64.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/base64.js +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/fmt/colors.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/fmt/colors.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_constants.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_constants.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_format.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_almost_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_almost_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_array_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_array_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_exists.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_exists.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_false.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_false.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater_or_equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_greater_or_equal.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_is_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_is_error.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less_or_equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_less_or_equal.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_match.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_instance_of.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_instance_of.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_match.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_not_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_object_match.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_object_match.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_rejects.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_rejects.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_strict_equals.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_strict_equals.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_string_includes.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_string_includes.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_throws.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assert_throws.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assertion_error.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/assertion_error.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/equal.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/equal.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/fail.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/fail.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/mod.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/mod.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unimplemented.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unimplemented.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unreachable.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/unreachable.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/_util.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/_util.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/base64.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/encoding/base64.js +0 -0
- /package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/fmt/colors.d.ts +0 -0
- /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.
|
|
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.
|
|
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.
|
|
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.
|
|
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/4_constants.d.ts
CHANGED
|
@@ -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.
|
|
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 = "";
|
package/esm/4_constants.js
CHANGED
|
@@ -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.
|
|
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];
|
package/esm/client/4_client.d.ts
CHANGED
|
@@ -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<
|
|
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
|
}
|
package/esm/client/4_client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
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)),
|
|
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)),
|
|
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
|
|
243
|
-
const
|
|
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
|
-
|
|
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
|
}
|
package/esm/tl/6_message.d.ts
CHANGED
package/esm/tl/6_message.js
CHANGED
|
@@ -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
|
-
|
|
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),
|
|
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 =
|
|
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):
|
|
9
|
-
protected decrypt(buffer: 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
37
|
+
const buffer = new Uint8Array(1);
|
|
38
38
|
await this.connection.read(buffer);
|
|
39
|
-
|
|
39
|
+
this.decrypt(buffer);
|
|
40
40
|
if (buffer[0] < 0x7F) {
|
|
41
41
|
length = buffer[0];
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
|
-
|
|
44
|
+
const buffer = new Uint8Array(3);
|
|
45
45
|
await this.connection.read(buffer);
|
|
46
|
-
|
|
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
|
-
|
|
52
|
+
const buffer = new Uint8Array(length);
|
|
53
53
|
await this.connection.read(buffer);
|
|
54
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
package/esm/types/3_message.d.ts
CHANGED
|
@@ -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 */
|
package/esm/types/3_message.js
CHANGED
|
@@ -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
|
-
//
|
|
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) {
|
package/package.json
CHANGED
package/script/0_deps.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export * from "./deps/deno.land/std@0.
|
|
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.
|
|
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.
|
|
18
|
-
__exportStar(require("./deps/deno.land/std@0.
|
|
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.
|
|
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; } });
|
package/script/4_constants.d.ts
CHANGED
|
@@ -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.
|
|
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 = "";
|
package/script/4_constants.js
CHANGED
|
@@ -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.
|
|
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<
|
|
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
|
}
|