@mtkruto/node 0.1.101 → 0.1.103
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/3_types.d.ts +25 -1
- package/esm/client/4_client.d.ts +57 -26
- package/esm/client/4_client.js +72 -12
- package/esm/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.js +10 -3
- package/esm/storage/0_storage.d.ts +3 -1
- package/esm/storage/0_storage.js +7 -0
- package/esm/storage/0_utilities.d.ts +2 -1
- package/esm/storage/0_utilities.js +63 -0
- package/esm/storage/1_storage_indexed_db.d.ts +2 -1
- package/esm/storage/1_storage_indexed_db.js +18 -1
- package/esm/storage/1_storage_local_storage.d.ts +1 -0
- package/esm/storage/1_storage_local_storage.js +16 -0
- package/esm/storage/1_storage_memory.d.ts +1 -0
- package/esm/storage/1_storage_memory.js +14 -1
- package/esm/storage/1_storage_session_storage.d.ts +1 -0
- package/esm/storage/1_storage_session_storage.js +16 -0
- 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/3_types.d.ts +25 -1
- package/script/client/4_client.d.ts +57 -26
- package/script/client/4_client.js +71 -11
- package/script/deps/deno.land/{std@0.203.0 → std@0.204.0}/assert/_diff.js +10 -3
- package/script/storage/0_storage.d.ts +3 -1
- package/script/storage/0_storage.js +7 -0
- package/script/storage/0_utilities.d.ts +2 -1
- package/script/storage/0_utilities.js +65 -1
- package/script/storage/1_storage_indexed_db.d.ts +2 -1
- package/script/storage/1_storage_indexed_db.js +17 -0
- package/script/storage/1_storage_local_storage.d.ts +1 -0
- package/script/storage/1_storage_local_storage.js +16 -0
- package/script/storage/1_storage_memory.d.ts +1 -0
- package/script/storage/1_storage_memory.js +13 -0
- package/script/storage/1_storage_session_storage.d.ts +1 -0
- package/script/storage/1_storage_session_storage.js +16 -0
- 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.103";
|
|
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.103";
|
|
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/3_types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { functions, types } from "../2_tl.js";
|
|
3
|
-
import { CallbackQuery, ChatID, ForceReply, InlineKeyboardMarkup, InlineQuery, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
|
|
3
|
+
import { BotCommandScope, CallbackQuery, ChatID, ForceReply, InlineKeyboardMarkup, InlineQuery, InlineQueryResultButton, Message, MessageEntity, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "../3_types.js";
|
|
4
4
|
import { With } from "./0_utilities.js";
|
|
5
5
|
import { ClientPlainParams } from "./2_client_plain.js";
|
|
6
6
|
export type ParseMode = "HTML" | null;
|
|
@@ -194,6 +194,30 @@ export interface SendPollParams {
|
|
|
194
194
|
*/
|
|
195
195
|
protectContent?: boolean;
|
|
196
196
|
}
|
|
197
|
+
export interface DownloadParams {
|
|
198
|
+
/** Size of each download chunk in bytes. */
|
|
199
|
+
chunkSize?: number;
|
|
200
|
+
}
|
|
201
|
+
export interface UploadParams {
|
|
202
|
+
/** The file name to assign. */
|
|
203
|
+
fileName?: string;
|
|
204
|
+
/** Size of each upload chunk in bytes. */
|
|
205
|
+
chunkSize?: number;
|
|
206
|
+
/** Upload abort signal. */
|
|
207
|
+
signal?: AbortSignal | null;
|
|
208
|
+
}
|
|
209
|
+
export interface AnswerInlineQueryParams {
|
|
210
|
+
cacheTime?: number;
|
|
211
|
+
isPersonal?: boolean;
|
|
212
|
+
nextOffset?: string;
|
|
213
|
+
isGallery?: boolean;
|
|
214
|
+
button?: InlineQueryResultButton;
|
|
215
|
+
}
|
|
216
|
+
export interface SetMyCommandsParams {
|
|
217
|
+
languageCode?: string;
|
|
218
|
+
scope?: BotCommandScope;
|
|
219
|
+
}
|
|
220
|
+
export type GetMyCommandsParams = SetMyCommandsParams;
|
|
197
221
|
export type ConnectionState = "notConnected" | "updating" | "ready";
|
|
198
222
|
export type AuthorizationState = {
|
|
199
223
|
authorized: boolean;
|
package/esm/client/4_client.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { MaybePromise } from "../1_utilities.js";
|
|
|
2
2
|
import { functions, ReadObject, types } from "../2_tl.js";
|
|
3
3
|
import { Storage } from "../3_storage.js";
|
|
4
4
|
import { DC } from "../3_transport.js";
|
|
5
|
-
import { BotCommand,
|
|
5
|
+
import { BotCommand, ChatAction, ChatID, InlineQueryResult, Message } from "../3_types.js";
|
|
6
6
|
import { Migrate } from "../4_errors.js";
|
|
7
7
|
import { With } from "./0_utilities.js";
|
|
8
8
|
import { ClientAbstract } from "./1_client_abstract.js";
|
|
9
|
-
import { AnswerCallbackQueryParams, AuthorizeUserParams, ClientParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, Handler, ParseMode, SendMessagesParams, SendPollParams, Update } from "./3_types.js";
|
|
9
|
+
import { AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, ClientParams, DownloadParams, EditMessageParams, FilterableUpdates, FilterUpdate, ForwardMessagesParams, GetMyCommandsParams, Handler, ParseMode, SendMessagesParams, SendPollParams, SetMyCommandsParams, Update, UploadParams } from "./3_types.js";
|
|
10
10
|
export declare const getEntity: unique symbol;
|
|
11
11
|
export declare const getStickerSetName: unique symbol;
|
|
12
12
|
export declare const handleMigrationError: unique symbol;
|
|
@@ -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.
|
|
@@ -168,9 +168,7 @@ export declare class Client extends ClientAbstract {
|
|
|
168
168
|
*
|
|
169
169
|
* @param fileId The identifier of the file to download.
|
|
170
170
|
*/
|
|
171
|
-
download(fileId: string, params?:
|
|
172
|
-
chunkSize?: number;
|
|
173
|
-
}): Promise<AsyncGenerator<Uint8Array, void, unknown>>;
|
|
171
|
+
download(fileId: string, params?: DownloadParams): Promise<AsyncGenerator<Uint8Array, void, unknown>>;
|
|
174
172
|
[getStickerSetName](inputStickerSet: types.InputStickerSetID, hash?: number): Promise<string>;
|
|
175
173
|
/**
|
|
176
174
|
* Forward multiple messages.
|
|
@@ -223,30 +221,63 @@ export declare class Client extends ClientAbstract {
|
|
|
223
221
|
*
|
|
224
222
|
* @param contents The contents of the file.
|
|
225
223
|
*/
|
|
226
|
-
upload(contents: Uint8Array, params?:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
button: InlineQueryResultButton;
|
|
245
|
-
}): Promise<void>;
|
|
224
|
+
upload(contents: Uint8Array, params?: UploadParams): Promise<types.InputFile | types.InputFileBig>;
|
|
225
|
+
/**
|
|
226
|
+
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
227
|
+
*
|
|
228
|
+
* @param commands The commands to set.
|
|
229
|
+
*/
|
|
230
|
+
setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
|
|
231
|
+
/**
|
|
232
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
233
|
+
*/
|
|
234
|
+
getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
|
|
235
|
+
/**
|
|
236
|
+
* Answer an inline query. Bot-only.
|
|
237
|
+
*
|
|
238
|
+
* @param id The ID of the inline query to answer.
|
|
239
|
+
* @param results The results to answer with.
|
|
240
|
+
*/
|
|
241
|
+
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
246
242
|
private handle;
|
|
247
243
|
use(handler: Handler): void;
|
|
248
244
|
branch(predicate: (upd: Update) => MaybePromise<boolean>, trueHandler: Handler, falseHandler: Handler): void;
|
|
249
245
|
filter<D extends Update>(predicate: (update: Update) => update is D, handler: Handler<D>): void;
|
|
250
246
|
filter(predicate: (update: Update) => MaybePromise<boolean>, handler: Handler): void;
|
|
251
247
|
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;
|
|
248
|
+
private setMyInfo;
|
|
249
|
+
/**
|
|
250
|
+
* Set the bot's description in the given language. Bot-only.
|
|
251
|
+
*/
|
|
252
|
+
setMyDescription({ description, languageCode }: {
|
|
253
|
+
description?: string;
|
|
254
|
+
languageCode?: string;
|
|
255
|
+
}): Promise<void>;
|
|
256
|
+
/**
|
|
257
|
+
* Set the bot's name in the given language. Bot-only.
|
|
258
|
+
*/
|
|
259
|
+
setMyName({ name, languageCode }: {
|
|
260
|
+
name?: string;
|
|
261
|
+
languageCode?: string;
|
|
262
|
+
}): Promise<void>;
|
|
263
|
+
/**
|
|
264
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
265
|
+
*/
|
|
266
|
+
setMyShortDescription({ shortDescription: about, languageCode }: {
|
|
267
|
+
shortDescription?: string;
|
|
268
|
+
languageCode?: string;
|
|
269
|
+
}): Promise<void>;
|
|
270
|
+
private getMyInfo;
|
|
271
|
+
/**
|
|
272
|
+
* Get the bot's description in the given language. Bot-only.
|
|
273
|
+
*/
|
|
274
|
+
getMyDescription(languageCode?: string): Promise<string>;
|
|
275
|
+
/**
|
|
276
|
+
* Set the bot's name in the given language. Bot-only.
|
|
277
|
+
*/
|
|
278
|
+
getMyName(languageCode?: string): Promise<string>;
|
|
279
|
+
/**
|
|
280
|
+
* Get the bot's short description in the given language. Bot-only.
|
|
281
|
+
*/
|
|
282
|
+
getMyShortDescription(languageCode?: string): Promise<string>;
|
|
252
283
|
}
|
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";
|
|
@@ -986,8 +986,7 @@ export class Client extends ClientAbstract {
|
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
988
|
else if (difference instanceof types.UpdatesDifferenceTooLong) {
|
|
989
|
-
|
|
990
|
-
// stored messages should be invalidated in case we store messages in the future
|
|
989
|
+
await this.storage.deleteMessages();
|
|
991
990
|
state.pts = difference.pts;
|
|
992
991
|
dGap("received differenceTooLong");
|
|
993
992
|
}
|
|
@@ -1199,10 +1198,10 @@ export class Client extends ClientAbstract {
|
|
|
1199
1198
|
const messages = new Array();
|
|
1200
1199
|
if (updates instanceof types.Updates) {
|
|
1201
1200
|
for (const update of updates.updates) {
|
|
1202
|
-
if (update instanceof types.UpdateNewMessage) {
|
|
1201
|
+
if (update instanceof types.UpdateNewMessage || update instanceof types.UpdateEditMessage) {
|
|
1203
1202
|
messages.push(await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
|
|
1204
1203
|
}
|
|
1205
|
-
else if (update instanceof types.UpdateNewChannelMessage) {
|
|
1204
|
+
else if (update instanceof types.UpdateNewChannelMessage || update instanceof types.UpdateEditChannelMessage) {
|
|
1206
1205
|
messages.push(await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
|
|
1207
1206
|
}
|
|
1208
1207
|
}
|
|
@@ -1283,7 +1282,7 @@ export class Client extends ClientAbstract {
|
|
|
1283
1282
|
*/
|
|
1284
1283
|
async editMessageText(chatId, messageId, text, params) {
|
|
1285
1284
|
const [message, entities] = this.parseText(text, params);
|
|
1286
|
-
await this.invoke(new functions.MessagesEditMessage({
|
|
1285
|
+
const result = await this.invoke(new functions.MessagesEditMessage({
|
|
1287
1286
|
id: messageId,
|
|
1288
1287
|
peer: await this.getInputPeer(chatId),
|
|
1289
1288
|
entities,
|
|
@@ -1291,6 +1290,8 @@ export class Client extends ClientAbstract {
|
|
|
1291
1290
|
noWebpage: params?.disableWebPagePreview ? true : undefined,
|
|
1292
1291
|
replyMarkup: await this.constructReplyMarkup(params),
|
|
1293
1292
|
}));
|
|
1293
|
+
const message_ = await this.updatesToMessages(chatId, result).then((v) => v[0]);
|
|
1294
|
+
return Client.assertMsgHas(message_, "text");
|
|
1294
1295
|
}
|
|
1295
1296
|
async getMessagesInner(chatId_, messageIds) {
|
|
1296
1297
|
const peer = await this.getInputPeer(chatId_);
|
|
@@ -1686,9 +1687,6 @@ export class Client extends ClientAbstract {
|
|
|
1686
1687
|
client.state.salt = this.state.salt;
|
|
1687
1688
|
await client.connect();
|
|
1688
1689
|
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
1690
|
const partCount = Math.ceil(contents.length / chunkSize);
|
|
1693
1691
|
try {
|
|
1694
1692
|
main: for (; part < partCount; part++) {
|
|
@@ -1745,23 +1743,37 @@ export class Client extends ClientAbstract {
|
|
|
1745
1743
|
return new types.InputFileBig({ id: fileId, parts: contents.length / chunkSize, name });
|
|
1746
1744
|
}
|
|
1747
1745
|
else {
|
|
1748
|
-
return new types.InputFile({ id: fileId, name, parts: part, md5Checksum:
|
|
1746
|
+
return new types.InputFile({ id: fileId, name, parts: part, md5Checksum: "" });
|
|
1749
1747
|
}
|
|
1750
1748
|
}
|
|
1749
|
+
/**
|
|
1750
|
+
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
1751
|
+
*
|
|
1752
|
+
* @param commands The commands to set.
|
|
1753
|
+
*/
|
|
1751
1754
|
async setMyCommands(commands, params) {
|
|
1752
1755
|
await this.invoke(new functions.BotsSetBotCommands({
|
|
1753
1756
|
commands: commands.map((v) => new types.BotCommand(v)),
|
|
1754
1757
|
langCode: params?.languageCode ?? "",
|
|
1755
|
-
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)),
|
|
1758
|
+
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)),
|
|
1756
1759
|
}));
|
|
1757
1760
|
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
1763
|
+
*/
|
|
1758
1764
|
async getMyCommands(params) {
|
|
1759
1765
|
const commands_ = await this.invoke(new functions.BotsGetBotCommands({
|
|
1760
1766
|
langCode: params?.languageCode ?? "",
|
|
1761
|
-
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)),
|
|
1767
|
+
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, this.getInputPeer.bind(this)),
|
|
1762
1768
|
}));
|
|
1763
1769
|
return commands_.map((v) => ({ command: v.command, description: v.description }));
|
|
1764
1770
|
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Answer an inline query. Bot-only.
|
|
1773
|
+
*
|
|
1774
|
+
* @param id The ID of the inline query to answer.
|
|
1775
|
+
* @param results The results to answer with.
|
|
1776
|
+
*/
|
|
1765
1777
|
async answerInlineQuery(id, results, params) {
|
|
1766
1778
|
await this.invoke(new functions.MessagesSetInlineBotResults({
|
|
1767
1779
|
queryId: BigInt(id),
|
|
@@ -1820,4 +1832,52 @@ export class Client extends ClientAbstract {
|
|
|
1820
1832
|
}
|
|
1821
1833
|
}, handler);
|
|
1822
1834
|
}
|
|
1835
|
+
async setMyInfo(info) {
|
|
1836
|
+
await this.invoke(new functions.BotsSetBotInfo({ bot: new types.InputUserSelf(), ...info }));
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* Set the bot's description in the given language. Bot-only.
|
|
1840
|
+
*/
|
|
1841
|
+
async setMyDescription({ description, languageCode }) {
|
|
1842
|
+
await this.assertBot("setMyDescription");
|
|
1843
|
+
await this.setMyInfo({ description, langCode: languageCode ?? "" });
|
|
1844
|
+
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Set the bot's name in the given language. Bot-only.
|
|
1847
|
+
*/
|
|
1848
|
+
async setMyName({ name, languageCode }) {
|
|
1849
|
+
await this.assertBot("setMyName");
|
|
1850
|
+
await this.setMyInfo({ name, langCode: languageCode ?? "" });
|
|
1851
|
+
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
1854
|
+
*/
|
|
1855
|
+
async setMyShortDescription({ shortDescription: about, languageCode }) {
|
|
1856
|
+
await this.assertBot("setMyShortDescription");
|
|
1857
|
+
await this.setMyInfo({ about, langCode: languageCode ?? "" });
|
|
1858
|
+
}
|
|
1859
|
+
getMyInfo(languageCode) {
|
|
1860
|
+
return this.invoke(new functions.BotsGetBotInfo({ bot: new types.InputUserSelf(), langCode: languageCode ?? "" }));
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Get the bot's description in the given language. Bot-only.
|
|
1864
|
+
*/
|
|
1865
|
+
async getMyDescription(languageCode) {
|
|
1866
|
+
await this.assertBot("getMyDescription");
|
|
1867
|
+
return await this.getMyInfo(languageCode).then((v) => v.description);
|
|
1868
|
+
}
|
|
1869
|
+
/**
|
|
1870
|
+
* Set the bot's name in the given language. Bot-only.
|
|
1871
|
+
*/
|
|
1872
|
+
async getMyName(languageCode) {
|
|
1873
|
+
await this.assertBot("getMyName");
|
|
1874
|
+
return await this.getMyInfo(languageCode).then((v) => v.description);
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* Get the bot's short description in the given language. Bot-only.
|
|
1878
|
+
*/
|
|
1879
|
+
async getMyShortDescription(languageCode) {
|
|
1880
|
+
await this.assertBot("getMyShortDescription");
|
|
1881
|
+
return await this.getMyInfo(languageCode).then((v) => v.about);
|
|
1882
|
+
}
|
|
1823
1883
|
}
|
|
@@ -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
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { TLObject, types } from "../2_tl.js";
|
|
3
3
|
import { DC } from "../3_transport.js";
|
|
4
|
-
export type StorageKeyPart = string | number | bigint
|
|
4
|
+
export type StorageKeyPart = string | number | bigint;
|
|
5
5
|
export declare abstract class Storage {
|
|
6
6
|
private _authKeyId;
|
|
7
7
|
abstract init(): MaybePromise<void>;
|
|
8
8
|
abstract set(key: readonly StorageKeyPart[], value: unknown): MaybePromise<void>;
|
|
9
9
|
abstract get<T>(key: readonly StorageKeyPart[]): MaybePromise<T | null>;
|
|
10
|
+
abstract getMany<T>(prefix: readonly StorageKeyPart[]): MaybePromise<Generator<[readonly StorageKeyPart[], T]> | AsyncGenerator<[readonly StorageKeyPart[], T]>>;
|
|
10
11
|
setDc(dc: DC | null): MaybePromise<void>;
|
|
11
12
|
getDc(): MaybePromise<DC | null>;
|
|
12
13
|
private resetAuthKeyId;
|
|
@@ -24,6 +25,7 @@ export declare abstract class Storage {
|
|
|
24
25
|
setState(state: types.UpdatesState): Promise<void>;
|
|
25
26
|
getState(): Promise<types.UpdatesState | null>;
|
|
26
27
|
setMessage(chatId: number, messageId: number, message: types.TypeMessage | null): Promise<void>;
|
|
28
|
+
deleteMessages(): Promise<void>;
|
|
27
29
|
getMessageChat(messageId: number): MaybePromise<number | null>;
|
|
28
30
|
getMessage(chatId: number, messageId: number): Promise<types.TypeMessage | null>;
|
|
29
31
|
setChannelPts(channelId: bigint, pts: number): Promise<void>;
|
package/esm/storage/0_storage.js
CHANGED
|
@@ -104,6 +104,13 @@ export class Storage {
|
|
|
104
104
|
}
|
|
105
105
|
await this.setTlObject(KPARTS_MESSAGE(chatId, messageId), message);
|
|
106
106
|
}
|
|
107
|
+
async deleteMessages() {
|
|
108
|
+
const maybePromises = new Array();
|
|
109
|
+
for await (const [k, o] of await this.getMany(["messageRefs"])) {
|
|
110
|
+
maybePromises.push(Promise.all([this.set(k, null), o == null ? Promise.resolve() : this.set(KPARTS_MESSAGE(o, k[1]), null)]).then(() => { }));
|
|
111
|
+
}
|
|
112
|
+
await Promise.all(maybePromises.filter((v) => v instanceof Promise));
|
|
113
|
+
}
|
|
107
114
|
getMessageChat(messageId) {
|
|
108
115
|
return this.get(KPARTS_MESSAGE_REF(messageId));
|
|
109
116
|
}
|
|
@@ -10,4 +10,5 @@ export declare enum ValueType {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function toString(value: unknown): string;
|
|
12
12
|
export declare function fromString<T>(string: string): any;
|
|
13
|
-
export declare function fixKey(key: StorageKeyPart[]): (string | number
|
|
13
|
+
export declare function fixKey(key: readonly StorageKeyPart[]): (string | number)[];
|
|
14
|
+
export declare function getPrefixKeyRange(prefix: any): IDBKeyRange;
|
|
@@ -60,3 +60,66 @@ export function fromString(string) {
|
|
|
60
60
|
export function fixKey(key) {
|
|
61
61
|
return key.map((v) => typeof v === "bigint" ? String(v) : v);
|
|
62
62
|
}
|
|
63
|
+
// Source: https://gist.github.com/inexorabletash/5462871
|
|
64
|
+
// deno-lint-ignore no-explicit-any
|
|
65
|
+
export function getPrefixKeyRange(prefix) {
|
|
66
|
+
// Ensure prefix is a valid key itself:
|
|
67
|
+
if (indexedDB.cmp(prefix, prefix) !== 0)
|
|
68
|
+
throw new TypeError();
|
|
69
|
+
const upperKey = successor(prefix);
|
|
70
|
+
if (upperKey === undefined)
|
|
71
|
+
return IDBKeyRange.lowerBound(prefix);
|
|
72
|
+
return IDBKeyRange.bound(prefix, upperKey, false, true);
|
|
73
|
+
}
|
|
74
|
+
const MAX_DATE_VALUE = 8640000000000000;
|
|
75
|
+
const UPPER_BOUND = {
|
|
76
|
+
NUMBER: new Date(-MAX_DATE_VALUE),
|
|
77
|
+
DATE: "",
|
|
78
|
+
STRING: [],
|
|
79
|
+
ARRAY: undefined,
|
|
80
|
+
};
|
|
81
|
+
// deno-lint-ignore no-explicit-any
|
|
82
|
+
function successor(key) {
|
|
83
|
+
if (typeof key === "number") {
|
|
84
|
+
if (key === Infinity)
|
|
85
|
+
return UPPER_BOUND.NUMBER;
|
|
86
|
+
if (key === -Infinity)
|
|
87
|
+
return -Number.MAX_VALUE;
|
|
88
|
+
if (key === 0)
|
|
89
|
+
return Number.MIN_VALUE;
|
|
90
|
+
let epsilon = Math.abs(key);
|
|
91
|
+
while (key + epsilon / 2 !== key)
|
|
92
|
+
epsilon = epsilon / 2;
|
|
93
|
+
return key + epsilon;
|
|
94
|
+
}
|
|
95
|
+
if (key instanceof Date) {
|
|
96
|
+
if (key.valueOf() + 1 > MAX_DATE_VALUE)
|
|
97
|
+
return UPPER_BOUND.DATE;
|
|
98
|
+
return new Date(key.valueOf() + 1);
|
|
99
|
+
}
|
|
100
|
+
if (typeof key === "string") {
|
|
101
|
+
let len = key.length;
|
|
102
|
+
while (len > 0) {
|
|
103
|
+
const head = key.substring(0, len - 1), tail = key.charCodeAt(len - 1);
|
|
104
|
+
if (tail !== 0xffff)
|
|
105
|
+
return head + String.fromCharCode(tail + 1);
|
|
106
|
+
key = head;
|
|
107
|
+
--len;
|
|
108
|
+
}
|
|
109
|
+
return UPPER_BOUND.STRING;
|
|
110
|
+
}
|
|
111
|
+
if (Array.isArray(key)) {
|
|
112
|
+
key = key.slice(); // Operate on a copy.
|
|
113
|
+
let len = key.length;
|
|
114
|
+
while (len > 0) {
|
|
115
|
+
const tail = successor(key.pop());
|
|
116
|
+
if (tail !== undefined) {
|
|
117
|
+
key.push(tail);
|
|
118
|
+
return key;
|
|
119
|
+
}
|
|
120
|
+
--len;
|
|
121
|
+
}
|
|
122
|
+
return UPPER_BOUND.ARRAY;
|
|
123
|
+
}
|
|
124
|
+
throw new TypeError();
|
|
125
|
+
}
|
|
@@ -5,5 +5,6 @@ export declare class StorageIndexedDB extends Storage {
|
|
|
5
5
|
constructor(name: string);
|
|
6
6
|
init(): Promise<void>;
|
|
7
7
|
set(k: StorageKeyPart[], v: unknown): Promise<void>;
|
|
8
|
-
get<T>(k: StorageKeyPart[]): Promise<T | null>;
|
|
8
|
+
get<T>(k: readonly StorageKeyPart[]): Promise<T | null>;
|
|
9
|
+
getMany<T>(prefix: readonly StorageKeyPart[]): AsyncGenerator<[readonly StorageKeyPart[], T], void, unknown>;
|
|
9
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Storage } from "./0_storage.js";
|
|
2
|
-
import { fixKey } from "./0_utilities.js";
|
|
2
|
+
import { fixKey, getPrefixKeyRange } from "./0_utilities.js";
|
|
3
3
|
const VERSION = 1;
|
|
4
4
|
const KV_OBJECT_STORE = "kv";
|
|
5
5
|
export class StorageIndexedDB extends Storage {
|
|
@@ -72,4 +72,21 @@ export class StorageIndexedDB extends Storage {
|
|
|
72
72
|
};
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
+
async *getMany(prefix) {
|
|
76
|
+
if (!this.database) {
|
|
77
|
+
throw new Error("Not initialized");
|
|
78
|
+
}
|
|
79
|
+
const keys = await new Promise((res, rej) => {
|
|
80
|
+
const tx = this.database.transaction(KV_OBJECT_STORE, "readonly")
|
|
81
|
+
.objectStore(KV_OBJECT_STORE)
|
|
82
|
+
.getAllKeys(getPrefixKeyRange(prefix));
|
|
83
|
+
tx.onerror = rej;
|
|
84
|
+
tx.onsuccess = () => {
|
|
85
|
+
res(tx.result);
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
for (const key of keys) {
|
|
89
|
+
yield [key, await this.get(key)];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
75
92
|
}
|
|
@@ -5,5 +5,6 @@ export declare class StorageLocalStorage extends Storage implements Storage {
|
|
|
5
5
|
constructor(prefix: string);
|
|
6
6
|
init(): void;
|
|
7
7
|
get(key_: readonly StorageKeyPart[]): any;
|
|
8
|
+
getMany<T>(prefix: readonly StorageKeyPart[]): Generator<[readonly StorageKeyPart[], T], void, unknown>;
|
|
8
9
|
set(key_: readonly StorageKeyPart[], value: unknown): MaybePromise<void>;
|
|
9
10
|
}
|
|
@@ -31,6 +31,22 @@ export class StorageLocalStorage extends Storage {
|
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
*getMany(prefix) {
|
|
35
|
+
for (let [key, value] of Object.entries(localStorage)) {
|
|
36
|
+
if (key.startsWith(this.prefix)) {
|
|
37
|
+
key = key.slice(this.prefix.length);
|
|
38
|
+
}
|
|
39
|
+
const parts = fromString(key);
|
|
40
|
+
if (Array.isArray(parts)) {
|
|
41
|
+
for (const [i, p] of prefix.entries()) {
|
|
42
|
+
if (toString(p) != toString(parts[i])) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
yield [parts, fromString(value)];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
34
50
|
set(key_, value) {
|
|
35
51
|
const key = this.prefix + toString(key_);
|
|
36
52
|
if (value != null) {
|
|
@@ -4,5 +4,6 @@ export declare class StorageMemory extends Storage implements Storage {
|
|
|
4
4
|
protected map: Map<string, unknown>;
|
|
5
5
|
init(): void;
|
|
6
6
|
get<T>(key: readonly StorageKeyPart[]): NonNullable<T> | null;
|
|
7
|
+
getMany<T>(prefix: readonly StorageKeyPart[]): Generator<[readonly StorageKeyPart[], T], void, unknown>;
|
|
7
8
|
set(key_: readonly StorageKeyPart[], value: unknown): MaybePromise<void>;
|
|
8
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Storage } from "./0_storage.js";
|
|
2
|
-
import { toString } from "./0_utilities.js";
|
|
2
|
+
import { fromString, toString } from "./0_utilities.js";
|
|
3
3
|
export class StorageMemory extends Storage {
|
|
4
4
|
constructor() {
|
|
5
5
|
super(...arguments);
|
|
@@ -15,6 +15,19 @@ export class StorageMemory extends Storage {
|
|
|
15
15
|
get(key) {
|
|
16
16
|
return this.map.get(toString(key)) ?? null;
|
|
17
17
|
}
|
|
18
|
+
*getMany(prefix) {
|
|
19
|
+
for (const [key, value] of this.map.entries()) {
|
|
20
|
+
const parts = fromString(key);
|
|
21
|
+
if (Array.isArray(parts)) {
|
|
22
|
+
for (const [i, p] of prefix.entries()) {
|
|
23
|
+
if (toString(p) != toString(parts[i])) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
yield [parts, value];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
18
31
|
set(key_, value) {
|
|
19
32
|
const key = toString(key_);
|
|
20
33
|
if (value != null) {
|
|
@@ -5,5 +5,6 @@ export declare class StorageSessionStorage extends Storage implements Storage {
|
|
|
5
5
|
constructor(prefix: string);
|
|
6
6
|
init(): void;
|
|
7
7
|
get(key_: readonly StorageKeyPart[]): any;
|
|
8
|
+
getMany<T>(prefix: readonly StorageKeyPart[]): Generator<[readonly StorageKeyPart[], T], void, unknown>;
|
|
8
9
|
set(key_: readonly StorageKeyPart[], value: unknown): MaybePromise<void>;
|
|
9
10
|
}
|
|
@@ -31,6 +31,22 @@ export class StorageSessionStorage extends Storage {
|
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
+
*getMany(prefix) {
|
|
35
|
+
for (let [key, value] of Object.entries(localStorage)) {
|
|
36
|
+
if (key.startsWith(this.prefix)) {
|
|
37
|
+
key = key.slice(this.prefix.length);
|
|
38
|
+
}
|
|
39
|
+
const parts = fromString(key);
|
|
40
|
+
if (Array.isArray(parts)) {
|
|
41
|
+
for (const [i, p] of prefix.entries()) {
|
|
42
|
+
if (toString(p) != toString(parts[i])) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
yield [parts, fromString(value)];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
34
50
|
set(key_, value) {
|
|
35
51
|
const key = this.prefix + toString(key_);
|
|
36
52
|
if (value != null) {
|
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 {};
|