@mtkruto/node 0.1.800 → 0.2.1
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 -0
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +2 -1
- package/esm/2_tl.d.ts +7 -8
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +7 -8
- package/esm/3_errors.d.ts +519 -515
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +527 -512
- package/esm/3_transport.d.ts +1 -0
- package/esm/3_transport.d.ts.map +1 -1
- package/esm/3_transport.js +1 -0
- package/esm/4_errors.d.ts +7 -7
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_errors.js +5 -5
- package/esm/client/0_client_abstract.d.ts +1 -21
- package/esm/client/0_client_abstract.d.ts.map +1 -1
- package/esm/client/0_client_abstract.js +17 -15
- package/esm/client/0_message.d.ts +3 -3
- package/esm/client/0_message.d.ts.map +1 -1
- package/esm/client/0_message.js +4 -20
- package/esm/client/0_params.d.ts +1 -1
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.d.ts +2 -2
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +3 -8
- package/esm/client/0_storage_operations.d.ts +23 -23
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +13 -12
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +13 -10
- package/esm/client/1_client_encrypted.d.ts +3 -5
- package/esm/client/1_client_encrypted.d.ts.map +1 -1
- package/esm/client/1_client_encrypted.js +44 -28
- package/esm/client/1_client_plain.d.ts +2 -2
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +27 -19
- package/esm/client/1_types.d.ts +9 -22
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts +2 -2
- package/esm/client/2_account_manager.js +16 -16
- package/esm/client/2_bot_info_manager.d.ts.map +1 -1
- package/esm/client/2_bot_info_manager.js +7 -6
- package/esm/client/2_business_connection_manager.d.ts +3 -3
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +6 -5
- package/esm/client/2_file_manager.d.ts +4 -4
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +26 -23
- package/esm/client/2_reaction_manager.d.ts +3 -3
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +16 -10
- package/esm/client/2_update_manager.d.ts +11 -11
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +185 -164
- package/esm/client/3_message_manager.d.ts +8 -9
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +205 -474
- package/esm/client/3_video_chat_manager.d.ts +3 -3
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +26 -36
- package/esm/client/4_callback_query_manager.d.ts +3 -3
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +5 -16
- package/esm/client/4_chat_list_manager.d.ts +5 -4
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +56 -34
- package/esm/client/4_inline_query_manager.d.ts +3 -3
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +6 -15
- package/esm/client/4_story_manager.d.ts +3 -3
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +15 -32
- package/esm/client/5_client.d.ts +10 -12
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +60 -114
- package/esm/{tl/7_message.d.ts → connection/1_connection_tcp.d.ts} +14 -12
- package/esm/connection/1_connection_tcp.d.ts.map +1 -0
- package/esm/connection/1_connection_tcp.js +169 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.d.ts +3 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/_constants.js +4 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts +70 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/iterate_reader.js +86 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.d.ts +95 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/types.js +3 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.d.ts +39 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.d.ts.map +1 -0
- package/esm/deps/deno.land/std@0.224.0/io/write_all.js +49 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts +45 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.js +253 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts +3 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.js +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts +3 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts.map +1 -0
- package/esm/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +13 -0
- package/esm/mod.d.ts +0 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +0 -1
- package/esm/tl/0_api.d.ts +14813 -0
- package/esm/tl/0_api.d.ts.map +1 -0
- package/esm/tl/0_api.js +23222 -0
- package/esm/tl/1_utilities.d.ts +32 -0
- package/esm/tl/1_utilities.d.ts.map +1 -0
- package/esm/tl/1_utilities.js +65 -0
- package/esm/tl/1_utilities_test.d.ts.map +1 -0
- package/esm/tl/2_deserialize.d.ts +23 -0
- package/esm/tl/2_deserialize.d.ts.map +1 -0
- package/esm/tl/{3_deserialize.js → 2_deserialize.js} +16 -17
- package/esm/tl/2_serialize.d.ts +22 -0
- package/esm/tl/2_serialize.d.ts.map +1 -0
- package/esm/tl/2_serialize.js +160 -0
- package/esm/tl/2_serialize_test.d.ts.map +1 -0
- package/esm/tl/{4_tl_reader.d.ts → 3_tl_reader.d.ts} +3 -3
- package/esm/tl/3_tl_reader.d.ts.map +1 -0
- package/esm/tl/{4_tl_reader.js → 3_tl_reader.js} +5 -5
- package/esm/tl/3_utilities.d.ts +5 -5
- package/esm/tl/3_utilities.d.ts.map +1 -1
- package/esm/tl/3_utilities.js +9 -10
- package/esm/tl/4_rpc_result.d.ts +27 -0
- package/esm/tl/4_rpc_result.d.ts.map +1 -0
- package/esm/tl/4_rpc_result.js +28 -0
- package/{script/tl/5_tl_writer.d.ts → esm/tl/4_tl_writer.d.ts} +2 -2
- package/esm/tl/4_tl_writer.d.ts.map +1 -0
- package/esm/tl/{5_tl_writer.js → 4_tl_writer.js} +4 -4
- package/esm/tl/5_message.d.ts +39 -0
- package/esm/tl/5_message.d.ts.map +1 -0
- package/esm/tl/5_message.js +98 -0
- package/esm/tl/5_message_test.d.ts.map +1 -0
- package/esm/transport/3_transport_provider_tcp.d.ts +14 -0
- package/esm/transport/3_transport_provider_tcp.d.ts.map +1 -0
- package/esm/transport/3_transport_provider_tcp.js +15 -0
- package/esm/types/0_birthday.d.ts +2 -2
- package/esm/types/0_birthday.d.ts.map +1 -1
- package/esm/types/0_callback_query_answer.d.ts +2 -2
- package/esm/types/0_callback_query_answer.d.ts.map +1 -1
- package/esm/types/0_chat_administrator_rights.d.ts +3 -3
- package/esm/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/esm/types/0_chat_administrator_rights.js +1 -11
- package/esm/types/0_chat_member_rights.d.ts +3 -3
- package/esm/types/0_chat_member_rights.d.ts.map +1 -1
- package/esm/types/0_chat_member_rights.js +3 -3
- package/esm/types/0_chat_photo.d.ts +2 -2
- package/esm/types/0_chat_photo.d.ts.map +1 -1
- package/esm/types/0_chat_photo.js +2 -2
- package/esm/types/0_contact.d.ts +2 -2
- package/esm/types/0_contact.d.ts.map +1 -1
- package/esm/types/0_dice.d.ts +2 -2
- package/esm/types/0_dice.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.d.ts +2 -2
- package/esm/types/0_giveaway_parameters.d.ts.map +1 -1
- package/esm/types/0_giveaway_parameters.js +3 -3
- package/esm/types/0_link_preview.d.ts +2 -2
- package/esm/types/0_link_preview.d.ts.map +1 -1
- package/esm/types/0_live_stream_channel.d.ts +2 -2
- package/esm/types/0_live_stream_channel.d.ts.map +1 -1
- package/esm/types/0_location.d.ts +2 -2
- package/esm/types/0_location.d.ts.map +1 -1
- package/esm/types/0_location.js +5 -5
- package/esm/types/0_mask_position.d.ts +2 -2
- package/esm/types/0_mask_position.d.ts.map +1 -1
- package/esm/types/0_message_entity.d.ts +3 -3
- package/esm/types/0_message_entity.d.ts.map +1 -1
- package/esm/types/0_message_entity.js +42 -42
- package/esm/types/0_message_search_filter.d.ts +2 -2
- package/esm/types/0_message_search_filter.d.ts.map +1 -1
- package/esm/types/0_message_search_filter.js +14 -15
- package/esm/types/0_opening_hours.d.ts +2 -2
- package/esm/types/0_opening_hours.d.ts.map +1 -1
- package/esm/types/0_poll_option.d.ts +2 -2
- package/esm/types/0_poll_option.d.ts.map +1 -1
- package/esm/types/0_reaction.d.ts +3 -3
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +4 -4
- package/esm/types/0_restriction_reason.d.ts +2 -2
- package/esm/types/0_restriction_reason.d.ts.map +1 -1
- package/esm/types/0_thumbnail.d.ts +2 -2
- package/esm/types/0_thumbnail.d.ts.map +1 -1
- package/esm/types/0_thumbnail.js +3 -3
- package/esm/types/0_video_chat.d.ts +2 -2
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/0_video_chat.js +2 -2
- package/esm/types/0_voice.d.ts +2 -2
- package/esm/types/0_voice.d.ts.map +1 -1
- package/esm/types/1_animation.d.ts +2 -2
- package/esm/types/1_animation.d.ts.map +1 -1
- package/esm/types/1_animation.js +2 -2
- package/esm/types/1_audio.d.ts +2 -2
- package/esm/types/1_audio.d.ts.map +1 -1
- package/esm/types/1_audio.js +2 -2
- package/esm/types/1_bot_command_scope.d.ts +9 -2
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.js +9 -9
- package/esm/types/1_chat_p.d.ts +5 -5
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +6 -6
- package/esm/types/1_document.d.ts +2 -2
- package/esm/types/1_document.d.ts.map +1 -1
- package/esm/types/1_document.js +2 -2
- package/esm/types/1_giveaway.d.ts +2 -2
- package/esm/types/1_giveaway.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.d.ts +3 -3
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +18 -45
- package/esm/types/1_message_reaction.d.ts +2 -2
- package/esm/types/1_message_reaction.d.ts.map +1 -1
- package/esm/types/1_message_reaction.js +5 -5
- package/esm/types/1_photo.d.ts +5 -5
- package/esm/types/1_photo.d.ts.map +1 -1
- package/esm/types/1_photo.js +4 -4
- package/esm/types/1_poll.d.ts +2 -2
- package/esm/types/1_poll.d.ts.map +1 -1
- package/esm/types/1_reaction_count.d.ts +2 -2
- package/esm/types/1_reaction_count.d.ts.map +1 -1
- package/esm/types/1_reply_quote.d.ts +2 -2
- package/esm/types/1_reply_quote.d.ts.map +1 -1
- package/esm/types/1_sticker.d.ts +3 -3
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +9 -9
- package/esm/types/1_story_privacy.d.ts +3 -3
- package/esm/types/1_story_privacy.d.ts.map +1 -1
- package/esm/types/1_story_privacy.js +14 -14
- package/esm/types/1_story_reaction.d.ts +2 -2
- package/esm/types/1_story_reaction.d.ts.map +1 -1
- package/esm/types/1_user.d.ts +2 -2
- package/esm/types/1_user.d.ts.map +1 -1
- package/esm/types/1_user.js +2 -2
- package/esm/types/1_venue.d.ts +2 -2
- package/esm/types/1_venue.d.ts.map +1 -1
- package/esm/types/1_venue.js +2 -2
- package/esm/types/1_video.d.ts +2 -2
- package/esm/types/1_video.d.ts.map +1 -1
- package/esm/types/1_video.js +2 -2
- package/esm/types/1_video_note.d.ts +2 -2
- package/esm/types/1_video_note.d.ts.map +1 -1
- package/esm/types/1_video_note.js +2 -2
- package/esm/types/2_business_connection.d.ts +2 -2
- package/esm/types/2_business_connection.d.ts.map +1 -1
- package/esm/types/2_business_connection.js +1 -2
- package/esm/types/2_chat.d.ts +2 -2
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat.js +11 -11
- package/esm/types/2_chat_member.d.ts +2 -2
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_chat_member.js +10 -10
- package/esm/types/2_chosen_inline_result.d.ts +2 -2
- package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
- package/esm/types/2_chosen_inline_result.js +5 -5
- package/esm/types/2_game.d.ts +2 -2
- package/esm/types/2_game.d.ts.map +1 -1
- package/esm/types/2_game.js +4 -4
- package/esm/types/2_inactive_chat.d.ts +2 -2
- package/esm/types/2_inactive_chat.d.ts.map +1 -1
- package/esm/types/2_inactive_chat.js +2 -2
- package/esm/types/2_inline_keyboard_button.d.ts +3 -3
- package/esm/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/esm/types/2_inline_keyboard_button.js +15 -21
- package/esm/types/2_inline_query.d.ts +2 -2
- package/esm/types/2_inline_query.d.ts.map +1 -1
- package/esm/types/2_inline_query.js +8 -8
- package/esm/types/2_invite_link.d.ts +2 -2
- package/esm/types/2_invite_link.d.ts.map +1 -1
- package/esm/types/2_invite_link.js +1 -2
- package/esm/types/2_message_reaction_count.d.ts +2 -2
- package/esm/types/2_message_reaction_count.d.ts.map +1 -1
- package/esm/types/2_message_reactions.d.ts +2 -2
- package/esm/types/2_message_reactions.d.ts.map +1 -1
- package/esm/types/2_message_reactions.js +2 -2
- package/esm/types/2_story_content.d.ts +2 -2
- package/esm/types/2_story_content.d.ts.map +1 -1
- package/esm/types/2_story_content.js +6 -6
- package/esm/types/2_story_interactions.d.ts +2 -2
- package/esm/types/2_story_interactions.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.d.ts +3 -3
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.js +19 -29
- package/esm/types/3_chat_member_updated.d.ts +2 -2
- package/esm/types/3_chat_member_updated.d.ts.map +1 -1
- package/esm/types/3_chat_member_updated.js +7 -7
- package/esm/types/3_reply_markup.d.ts +3 -3
- package/esm/types/3_reply_markup.d.ts.map +1 -1
- package/esm/types/3_reply_markup.js +12 -22
- package/esm/types/3_story.d.ts +2 -2
- package/esm/types/3_story.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.d.ts +3 -3
- package/esm/types/4_inline_query_result.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.js +53 -161
- package/esm/types/4_message.d.ts +3 -3
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +68 -59
- package/esm/types/5_callback_query.d.ts +3 -3
- package/esm/types/5_callback_query.d.ts.map +1 -1
- package/esm/types/5_callback_query.js +5 -5
- package/esm/types/5_chat_list_item.d.ts +3 -3
- package/esm/types/5_chat_list_item.d.ts.map +1 -1
- package/esm/types/5_chat_list_item.js +2 -2
- package/esm/types/5_inline_query_answer.d.ts +2 -2
- package/esm/types/5_inline_query_answer.d.ts.map +1 -1
- package/esm/types/_file_id.d.ts +2 -2
- package/esm/types/_file_id.d.ts.map +1 -1
- package/esm/types/_file_id.js +4 -4
- package/esm/types/_getters.d.ts +7 -7
- package/esm/types/_getters.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/0_deps.d.ts +2 -0
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +5 -2
- package/script/2_tl.d.ts +7 -8
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +20 -11
- package/script/3_errors.d.ts +519 -515
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +543 -514
- package/script/3_transport.d.ts +1 -0
- package/script/3_transport.d.ts.map +1 -1
- package/script/3_transport.js +1 -0
- package/script/4_errors.d.ts +7 -7
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_errors.js +6 -6
- package/script/client/0_client_abstract.d.ts +1 -21
- package/script/client/0_client_abstract.d.ts.map +1 -1
- package/script/client/0_client_abstract.js +41 -16
- package/script/client/0_message.d.ts +3 -3
- package/script/client/0_message.d.ts.map +1 -1
- package/script/client/0_message.js +3 -19
- package/script/client/0_params.d.ts +1 -1
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.d.ts +2 -2
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +2 -7
- package/script/client/0_storage_operations.d.ts +23 -23
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +12 -11
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +12 -9
- package/script/client/1_client_encrypted.d.ts +3 -5
- package/script/client/1_client_encrypted.d.ts.map +1 -1
- package/script/client/1_client_encrypted.js +42 -26
- package/script/client/1_client_plain.d.ts +2 -2
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +25 -17
- package/script/client/1_types.d.ts +9 -22
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts +2 -2
- package/script/client/2_account_manager.js +15 -15
- package/script/client/2_bot_info_manager.d.ts.map +1 -1
- package/script/client/2_bot_info_manager.js +7 -6
- package/script/client/2_business_connection_manager.d.ts +3 -3
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +5 -4
- package/script/client/2_file_manager.d.ts +4 -4
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +25 -22
- package/script/client/2_reaction_manager.d.ts +3 -3
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +15 -9
- package/script/client/2_update_manager.d.ts +11 -11
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +183 -162
- package/script/client/3_message_manager.d.ts +8 -9
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +204 -473
- package/script/client/3_video_chat_manager.d.ts +3 -3
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +25 -35
- package/script/client/4_callback_query_manager.d.ts +3 -3
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +4 -15
- package/script/client/4_chat_list_manager.d.ts +5 -4
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +54 -32
- package/script/client/4_inline_query_manager.d.ts +3 -3
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +5 -14
- package/script/client/4_story_manager.d.ts +3 -3
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +14 -31
- package/script/client/5_client.d.ts +10 -12
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +59 -113
- package/{esm/tl/6_rpc_result.d.ts → script/connection/1_connection_tcp.d.ts} +14 -10
- package/script/connection/1_connection_tcp.d.ts.map +1 -0
- package/script/connection/1_connection_tcp.js +196 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.d.ts +3 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/_constants.js +7 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts +70 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/iterate_reader.js +91 -0
- package/script/deps/deno.land/std@0.224.0/io/types.d.ts +95 -0
- package/script/deps/deno.land/std@0.224.0/io/types.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/types.js +4 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.d.ts +39 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.d.ts.map +1 -0
- package/script/deps/deno.land/std@0.224.0/io/write_all.js +54 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts +45 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/client.js +280 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts +3 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/deps.js +5 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts +3 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.d.ts.map +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/socks5/main/utils.js +40 -0
- package/script/mod.d.ts +0 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +0 -1
- package/script/tl/0_api.d.ts +14813 -0
- package/script/tl/0_api.d.ts.map +1 -0
- package/script/tl/0_api.js +23248 -0
- package/script/tl/1_utilities.d.ts +32 -0
- package/script/tl/1_utilities.d.ts.map +1 -0
- package/script/tl/1_utilities.js +76 -0
- package/script/tl/1_utilities_test.d.ts.map +1 -0
- package/script/tl/2_deserialize.d.ts +23 -0
- package/script/tl/2_deserialize.d.ts.map +1 -0
- package/script/tl/{3_deserialize.js → 2_deserialize.js} +19 -20
- package/script/tl/2_serialize.d.ts +22 -0
- package/script/tl/2_serialize.d.ts.map +1 -0
- package/script/tl/2_serialize.js +164 -0
- package/script/tl/2_serialize_test.d.ts.map +1 -0
- package/script/tl/{4_tl_reader.d.ts → 3_tl_reader.d.ts} +3 -3
- package/script/tl/3_tl_reader.d.ts.map +1 -0
- package/script/tl/{4_tl_reader.js → 3_tl_reader.js} +5 -5
- package/script/tl/3_utilities.d.ts +5 -5
- package/script/tl/3_utilities.d.ts.map +1 -1
- package/script/tl/3_utilities.js +9 -10
- package/script/tl/4_rpc_result.d.ts +27 -0
- package/script/tl/4_rpc_result.d.ts.map +1 -0
- package/{esm/tl/8_message_container.d.ts → script/tl/4_rpc_result.js} +12 -12
- package/{esm/tl/5_tl_writer.d.ts → script/tl/4_tl_writer.d.ts} +2 -2
- package/script/tl/4_tl_writer.d.ts.map +1 -0
- package/script/tl/{5_tl_writer.js → 4_tl_writer.js} +4 -4
- package/script/tl/5_message.d.ts +39 -0
- package/script/tl/5_message.d.ts.map +1 -0
- package/script/tl/5_message.js +106 -0
- package/script/tl/5_message_test.d.ts.map +1 -0
- package/script/transport/3_transport_provider_tcp.d.ts +14 -0
- package/script/transport/3_transport_provider_tcp.d.ts.map +1 -0
- package/script/transport/3_transport_provider_tcp.js +19 -0
- package/script/types/0_birthday.d.ts +2 -2
- package/script/types/0_birthday.d.ts.map +1 -1
- package/script/types/0_callback_query_answer.d.ts +2 -2
- package/script/types/0_callback_query_answer.d.ts.map +1 -1
- package/script/types/0_chat_administrator_rights.d.ts +3 -3
- package/script/types/0_chat_administrator_rights.d.ts.map +1 -1
- package/script/types/0_chat_administrator_rights.js +1 -11
- package/script/types/0_chat_member_rights.d.ts +3 -3
- package/script/types/0_chat_member_rights.d.ts.map +1 -1
- package/script/types/0_chat_member_rights.js +3 -3
- package/script/types/0_chat_photo.d.ts +2 -2
- package/script/types/0_chat_photo.d.ts.map +1 -1
- package/script/types/0_chat_photo.js +1 -1
- package/script/types/0_contact.d.ts +2 -2
- package/script/types/0_contact.d.ts.map +1 -1
- package/script/types/0_dice.d.ts +2 -2
- package/script/types/0_dice.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.d.ts +2 -2
- package/script/types/0_giveaway_parameters.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.js +2 -2
- package/script/types/0_link_preview.d.ts +2 -2
- package/script/types/0_link_preview.d.ts.map +1 -1
- package/script/types/0_live_stream_channel.d.ts +2 -2
- package/script/types/0_live_stream_channel.d.ts.map +1 -1
- package/script/types/0_location.d.ts +2 -2
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_location.js +4 -4
- package/script/types/0_mask_position.d.ts +2 -2
- package/script/types/0_mask_position.d.ts.map +1 -1
- package/script/types/0_message_entity.d.ts +3 -3
- package/script/types/0_message_entity.d.ts.map +1 -1
- package/script/types/0_message_entity.js +41 -41
- package/script/types/0_message_search_filter.d.ts +2 -2
- package/script/types/0_message_search_filter.d.ts.map +1 -1
- package/script/types/0_message_search_filter.js +14 -15
- package/script/types/0_opening_hours.d.ts +2 -2
- package/script/types/0_opening_hours.d.ts.map +1 -1
- package/script/types/0_poll_option.d.ts +2 -2
- package/script/types/0_poll_option.d.ts.map +1 -1
- package/script/types/0_reaction.d.ts +3 -3
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +3 -3
- package/script/types/0_restriction_reason.d.ts +2 -2
- package/script/types/0_restriction_reason.d.ts.map +1 -1
- package/script/types/0_thumbnail.d.ts +2 -2
- package/script/types/0_thumbnail.d.ts.map +1 -1
- package/script/types/0_thumbnail.js +2 -2
- package/script/types/0_video_chat.d.ts +2 -2
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/0_video_chat.js +1 -1
- package/script/types/0_voice.d.ts +2 -2
- package/script/types/0_voice.d.ts.map +1 -1
- package/script/types/1_animation.d.ts +2 -2
- package/script/types/1_animation.d.ts.map +1 -1
- package/script/types/1_animation.js +1 -1
- package/script/types/1_audio.d.ts +2 -2
- package/script/types/1_audio.d.ts.map +1 -1
- package/script/types/1_audio.js +1 -1
- package/script/types/1_bot_command_scope.d.ts +9 -2
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.js +8 -8
- package/script/types/1_chat_p.d.ts +5 -5
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +5 -5
- package/script/types/1_document.d.ts +2 -2
- package/script/types/1_document.d.ts.map +1 -1
- package/script/types/1_document.js +1 -1
- package/script/types/1_giveaway.d.ts +2 -2
- package/script/types/1_giveaway.d.ts.map +1 -1
- package/script/types/1_keyboard_button.d.ts +3 -3
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +17 -44
- package/script/types/1_message_reaction.d.ts +2 -2
- package/script/types/1_message_reaction.d.ts.map +1 -1
- package/script/types/1_message_reaction.js +4 -4
- package/script/types/1_photo.d.ts +5 -5
- package/script/types/1_photo.d.ts.map +1 -1
- package/script/types/1_photo.js +3 -3
- package/script/types/1_poll.d.ts +2 -2
- package/script/types/1_poll.d.ts.map +1 -1
- package/script/types/1_reaction_count.d.ts +2 -2
- package/script/types/1_reaction_count.d.ts.map +1 -1
- package/script/types/1_reply_quote.d.ts +2 -2
- package/script/types/1_reply_quote.d.ts.map +1 -1
- package/script/types/1_sticker.d.ts +3 -3
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +8 -8
- package/script/types/1_story_privacy.d.ts +3 -3
- package/script/types/1_story_privacy.d.ts.map +1 -1
- package/script/types/1_story_privacy.js +13 -13
- package/script/types/1_story_reaction.d.ts +2 -2
- package/script/types/1_story_reaction.d.ts.map +1 -1
- package/script/types/1_user.d.ts +2 -2
- package/script/types/1_user.d.ts.map +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/1_venue.d.ts +2 -2
- package/script/types/1_venue.d.ts.map +1 -1
- package/script/types/1_venue.js +1 -1
- package/script/types/1_video.d.ts +2 -2
- package/script/types/1_video.d.ts.map +1 -1
- package/script/types/1_video.js +1 -1
- package/script/types/1_video_note.d.ts +2 -2
- package/script/types/1_video_note.d.ts.map +1 -1
- package/script/types/1_video_note.js +1 -1
- package/script/types/2_business_connection.d.ts +2 -2
- package/script/types/2_business_connection.d.ts.map +1 -1
- package/script/types/2_business_connection.js +1 -2
- package/script/types/2_chat.d.ts +2 -2
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat.js +10 -10
- package/script/types/2_chat_member.d.ts +2 -2
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_chat_member.js +9 -9
- package/script/types/2_chosen_inline_result.d.ts +2 -2
- package/script/types/2_chosen_inline_result.d.ts.map +1 -1
- package/script/types/2_chosen_inline_result.js +4 -4
- package/script/types/2_game.d.ts +2 -2
- package/script/types/2_game.d.ts.map +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inactive_chat.d.ts +2 -2
- package/script/types/2_inactive_chat.d.ts.map +1 -1
- package/script/types/2_inactive_chat.js +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +3 -3
- package/script/types/2_inline_keyboard_button.d.ts.map +1 -1
- package/script/types/2_inline_keyboard_button.js +14 -20
- package/script/types/2_inline_query.d.ts +2 -2
- package/script/types/2_inline_query.d.ts.map +1 -1
- package/script/types/2_inline_query.js +7 -7
- package/script/types/2_invite_link.d.ts +2 -2
- package/script/types/2_invite_link.d.ts.map +1 -1
- package/script/types/2_invite_link.js +1 -2
- package/script/types/2_message_reaction_count.d.ts +2 -2
- package/script/types/2_message_reaction_count.d.ts.map +1 -1
- package/script/types/2_message_reactions.d.ts +2 -2
- package/script/types/2_message_reactions.d.ts.map +1 -1
- package/script/types/2_message_reactions.js +1 -1
- package/script/types/2_story_content.d.ts +2 -2
- package/script/types/2_story_content.d.ts.map +1 -1
- package/script/types/2_story_content.js +5 -5
- package/script/types/2_story_interactions.d.ts +2 -2
- package/script/types/2_story_interactions.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.d.ts +3 -3
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.js +18 -28
- package/script/types/3_chat_member_updated.d.ts +2 -2
- package/script/types/3_chat_member_updated.d.ts.map +1 -1
- package/script/types/3_chat_member_updated.js +6 -6
- package/script/types/3_reply_markup.d.ts +3 -3
- package/script/types/3_reply_markup.d.ts.map +1 -1
- package/script/types/3_reply_markup.js +11 -21
- package/script/types/3_story.d.ts +2 -2
- package/script/types/3_story.d.ts.map +1 -1
- package/script/types/4_inline_query_result.d.ts +3 -3
- package/script/types/4_inline_query_result.d.ts.map +1 -1
- package/script/types/4_inline_query_result.js +52 -160
- package/script/types/4_message.d.ts +3 -3
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +67 -58
- package/script/types/5_callback_query.d.ts +3 -3
- package/script/types/5_callback_query.d.ts.map +1 -1
- package/script/types/5_callback_query.js +4 -4
- package/script/types/5_chat_list_item.d.ts +3 -3
- package/script/types/5_chat_list_item.d.ts.map +1 -1
- package/script/types/5_chat_list_item.js +1 -1
- package/script/types/5_inline_query_answer.d.ts +2 -2
- package/script/types/5_inline_query_answer.d.ts.map +1 -1
- package/script/types/_file_id.d.ts +2 -2
- package/script/types/_file_id.d.ts.map +1 -1
- package/script/types/_file_id.js +3 -3
- package/script/types/_getters.d.ts +7 -7
- package/script/types/_getters.d.ts.map +1 -1
- package/esm/tl/1_tl_object.d.ts +0 -64
- package/esm/tl/1_tl_object.d.ts.map +0 -1
- package/esm/tl/1_tl_object.js +0 -221
- package/esm/tl/1_tl_object_test.d.ts.map +0 -1
- package/esm/tl/2_types.d.ts +0 -28060
- package/esm/tl/2_types.d.ts.map +0 -1
- package/esm/tl/2_types.js +0 -68685
- package/esm/tl/2_types_test.d.ts.map +0 -1
- package/esm/tl/3_deserialize.d.ts +0 -23
- package/esm/tl/3_deserialize.d.ts.map +0 -1
- package/esm/tl/3_functions.d.ts +0 -14094
- package/esm/tl/3_functions.d.ts.map +0 -1
- package/esm/tl/3_functions.js +0 -28475
- package/esm/tl/3_functions_test.d.ts.map +0 -1
- package/esm/tl/4_tl_reader.d.ts.map +0 -1
- package/esm/tl/5_tl_writer.d.ts.map +0 -1
- package/esm/tl/6_rpc_result.d.ts.map +0 -1
- package/esm/tl/6_rpc_result.js +0 -49
- package/esm/tl/7_message.d.ts.map +0 -1
- package/esm/tl/7_message.js +0 -90
- package/esm/tl/7_message_test.d.ts.map +0 -1
- package/esm/tl/8_message_container.d.ts.map +0 -1
- package/esm/tl/8_message_container.js +0 -72
- package/script/tl/1_tl_object.d.ts +0 -64
- package/script/tl/1_tl_object.d.ts.map +0 -1
- package/script/tl/1_tl_object.js +0 -228
- package/script/tl/1_tl_object_test.d.ts.map +0 -1
- package/script/tl/2_types.d.ts +0 -28060
- package/script/tl/2_types.d.ts.map +0 -1
- package/script/tl/2_types.js +0 -70558
- package/script/tl/2_types_test.d.ts.map +0 -1
- package/script/tl/3_deserialize.d.ts +0 -23
- package/script/tl/3_deserialize.d.ts.map +0 -1
- package/script/tl/3_functions.d.ts +0 -14094
- package/script/tl/3_functions.d.ts.map +0 -1
- package/script/tl/3_functions.js +0 -29121
- package/script/tl/3_functions_test.d.ts.map +0 -1
- package/script/tl/4_tl_reader.d.ts.map +0 -1
- package/script/tl/5_tl_writer.d.ts.map +0 -1
- package/script/tl/6_rpc_result.d.ts +0 -30
- package/script/tl/6_rpc_result.d.ts.map +0 -1
- package/script/tl/6_rpc_result.js +0 -53
- package/script/tl/7_message.d.ts +0 -32
- package/script/tl/7_message.d.ts.map +0 -1
- package/script/tl/7_message.js +0 -95
- package/script/tl/7_message_test.d.ts.map +0 -1
- package/script/tl/8_message_container.d.ts +0 -32
- package/script/tl/8_message_container.d.ts.map +0 -1
- package/script/tl/8_message_container.js +0 -76
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { InputError } from "../0_errors.js";
|
|
22
|
-
import {
|
|
22
|
+
import { isOneOf } from "../2_tl.js";
|
|
23
23
|
export const resolve = () => Promise.resolve();
|
|
24
24
|
export function isHttpUrl(string) {
|
|
25
25
|
try {
|
|
@@ -134,14 +134,17 @@ export function checkInlineQueryId(id) {
|
|
|
134
134
|
throw new InputError("Invalid inline query ID.");
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
+
const MTPROTO_FUNCTIONS = [
|
|
138
|
+
"ping",
|
|
139
|
+
"ping_delay_disconnect",
|
|
140
|
+
"req_pq_multi",
|
|
141
|
+
"rpc_drop_answer",
|
|
142
|
+
"get_future_salts",
|
|
143
|
+
"destroy_session",
|
|
144
|
+
"destroy_auth_key",
|
|
145
|
+
"req_DH_params",
|
|
146
|
+
"set_client_DH_params",
|
|
147
|
+
];
|
|
137
148
|
export function isMtprotoFunction(value) {
|
|
138
|
-
return value
|
|
139
|
-
value instanceof functions.ping_delay_disconnect ||
|
|
140
|
-
value instanceof functions.req_pq_multi ||
|
|
141
|
-
value instanceof functions.rpc_drop_answer ||
|
|
142
|
-
value instanceof functions.get_future_salts ||
|
|
143
|
-
value instanceof functions.destroy_session ||
|
|
144
|
-
value instanceof functions.destroy_auth_key ||
|
|
145
|
-
value instanceof functions.req_DH_params ||
|
|
146
|
-
value instanceof functions.set_client_DH_params;
|
|
149
|
+
return isOneOf(MTPROTO_FUNCTIONS, value);
|
|
147
150
|
}
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api, ReadObject } from "../2_tl.js";
|
|
21
21
|
import { ClientAbstract } from "./0_client_abstract.js";
|
|
22
22
|
import { ClientAbstractParams } from "./0_client_abstract.js";
|
|
23
23
|
export type ErrorSource = "deserialization" | "decryption" | "unknown";
|
|
24
24
|
export interface Handlers {
|
|
25
25
|
serverSaltReassigned?: (newServerSalt: bigint) => void;
|
|
26
|
-
updates?: (updates:
|
|
26
|
+
updates?: (updates: Api.Updates | Api.Update, call: Api.AnyType | null, callback?: () => void) => void;
|
|
27
27
|
result?: (result: ReadObject, callback: () => void) => void;
|
|
28
28
|
error?: (err: unknown, source: ErrorSource) => void;
|
|
29
29
|
}
|
|
@@ -47,8 +47,6 @@ export declare class ClientEncrypted extends ClientAbstract {
|
|
|
47
47
|
get authKey(): Uint8Array;
|
|
48
48
|
set serverSalt(serverSalt: bigint);
|
|
49
49
|
get serverSalt(): bigint;
|
|
50
|
-
invoke<T extends
|
|
51
|
-
invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, noWait: true): Promise<void>;
|
|
52
|
-
invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, noWait?: boolean): Promise<T | void>;
|
|
50
|
+
invoke<T extends Api.AnyObject<P>, P extends Api.Function, R extends unknown = Promise<T["_"] extends keyof Api.Functions ? Api.ReturnType<Api.Functions[T["_"]]> : never>>(function_: T, noWait?: boolean): Promise<R | void>;
|
|
53
51
|
}
|
|
54
52
|
//# sourceMappingURL=1_client_encrypted.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_client_encrypted.d.ts","sourceRoot":"","sources":["../../src/client/1_client_encrypted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"1_client_encrypted.d.ts","sourceRoot":"","sources":["../../src/client/1_client_encrypted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAAyB,UAAU,EAAqB,MAAM,YAAY,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAM9D,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,YAAY,GAAG,SAAS,CAAC;AAEvE,MAAM,WAAW,QAAQ;IACvB,oBAAoB,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IACvG,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC5D,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CACrD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,eAAgB,SAAQ,cAAc;;IAejD,QAAQ,EAAE,QAAQ,CAAM;gBAEZ,MAAM,CAAC,EAAE,oBAAoB;IAQnC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,UAAU,CAAC,GAAG,EAAE,UAAU;IAMhC,IAAI,OAAO,IAAI,UAAU,CAExB;IAED,IAAI,UAAU,CAAC,UAAU,EAAE,MAAM,EAEhC;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IA4BK,MAAM,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,CAAC,QAAQ,EAAE,CAAC,SAAS,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CAoKrO"}
|
|
@@ -32,8 +32,8 @@ var _ClientEncrypted_instances, _ClientEncrypted_authKey, _ClientEncrypted_authK
|
|
|
32
32
|
import { gunzip, unreachable } from "../0_deps.js";
|
|
33
33
|
import { ConnectionError } from "../0_errors.js";
|
|
34
34
|
import { bigIntFromBuffer, CacheMap, drop, getLogger, getRandomBigInt, sha1 } from "../1_utilities.js";
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
35
|
+
import { is, isOfEnum, TLError, TLReader } from "../2_tl.js";
|
|
36
|
+
import { constructTelegramError } from "../4_errors.js";
|
|
37
37
|
import { ClientAbstract } from "./0_client_abstract.js";
|
|
38
38
|
import { decryptMessage, encryptMessage, getMessageId } from "./0_message.js";
|
|
39
39
|
// global ClientEncrypted ID counter for logs
|
|
@@ -95,23 +95,38 @@ export class ClientEncrypted extends ClientAbstract {
|
|
|
95
95
|
}
|
|
96
96
|
async invoke(function_, noWait) {
|
|
97
97
|
const messageId = __classPrivateFieldGet(this, _ClientEncrypted_instances, "m", _ClientEncrypted_nextMessageId).call(this);
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
let message_ = {
|
|
99
|
+
_: "message",
|
|
100
|
+
msg_id: messageId,
|
|
101
|
+
seqno: __classPrivateFieldGet(this, _ClientEncrypted_instances, "m", _ClientEncrypted_nextSeqNo).call(this, true),
|
|
102
|
+
body: function_,
|
|
103
|
+
};
|
|
104
|
+
const message__ = message_;
|
|
100
105
|
let container = undefined;
|
|
101
106
|
if (__classPrivateFieldGet(this, _ClientEncrypted_toAcknowledge, "f").size) {
|
|
102
|
-
const ack =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
const ack = {
|
|
108
|
+
_: "message",
|
|
109
|
+
msg_id: __classPrivateFieldGet(this, _ClientEncrypted_instances, "m", _ClientEncrypted_nextMessageId).call(this),
|
|
110
|
+
seqno: __classPrivateFieldGet(this, _ClientEncrypted_instances, "m", _ClientEncrypted_nextSeqNo).call(this, false),
|
|
111
|
+
body: { _: "msgs_ack", msg_ids: [...__classPrivateFieldGet(this, _ClientEncrypted_toAcknowledge, "f")] },
|
|
112
|
+
};
|
|
113
|
+
__classPrivateFieldGet(this, _ClientEncrypted_recentAcks, "f").set(ack.msg_id, { container, message: ack });
|
|
114
|
+
message_ = {
|
|
115
|
+
_: "message",
|
|
116
|
+
msg_id: container = __classPrivateFieldGet(this, _ClientEncrypted_instances, "m", _ClientEncrypted_nextMessageId).call(this),
|
|
117
|
+
seqno: __classPrivateFieldGet(this, _ClientEncrypted_instances, "m", _ClientEncrypted_nextSeqNo).call(this, false),
|
|
118
|
+
body: {
|
|
119
|
+
_: "msg_container",
|
|
120
|
+
messages: [message_, ack],
|
|
121
|
+
},
|
|
122
|
+
};
|
|
108
123
|
}
|
|
109
124
|
await __classPrivateFieldGet(this, _ClientEncrypted_instances, "m", _ClientEncrypted_sendMessage).call(this, message_);
|
|
110
|
-
__classPrivateFieldGet(this, _ClientEncrypted_Linvoke, "f").debug("invoked", function_
|
|
125
|
+
__classPrivateFieldGet(this, _ClientEncrypted_Linvoke, "f").debug("invoked", function_._);
|
|
111
126
|
if (noWait) {
|
|
112
127
|
__classPrivateFieldGet(this, _ClientEncrypted_promises, "f").set(messageId, {
|
|
113
128
|
container,
|
|
114
|
-
message:
|
|
129
|
+
message: message_,
|
|
115
130
|
call: function_,
|
|
116
131
|
});
|
|
117
132
|
return;
|
|
@@ -153,37 +168,37 @@ _ClientEncrypted_authKey = new WeakMap(), _ClientEncrypted_authKeyId = new WeakM
|
|
|
153
168
|
drop(this.handlers.error?.(err, "decryption"));
|
|
154
169
|
continue;
|
|
155
170
|
}
|
|
156
|
-
const messages = decrypted
|
|
171
|
+
const messages = decrypted.body._ == "msg_container" ? decrypted.body.messages : [decrypted];
|
|
157
172
|
for (const message of messages) {
|
|
158
173
|
let body = message.body;
|
|
159
|
-
if (body
|
|
174
|
+
if (is("gzip_packed", body)) {
|
|
160
175
|
body = new TLReader(gunzip(body.packed_data)).readObject();
|
|
161
176
|
}
|
|
162
|
-
__classPrivateFieldGet(this, _ClientEncrypted_LreceiveLoop, "f").debug("received",
|
|
163
|
-
if (body
|
|
177
|
+
__classPrivateFieldGet(this, _ClientEncrypted_LreceiveLoop, "f").debug("received", body._);
|
|
178
|
+
if (isOfEnum("Updates", body) || isOfEnum("Update", body)) {
|
|
164
179
|
drop(this.handlers.updates?.(body, null));
|
|
165
180
|
}
|
|
166
|
-
else if (body
|
|
181
|
+
else if (is("new_session_created", body)) {
|
|
167
182
|
this.serverSalt = body.server_salt;
|
|
168
183
|
drop(this.handlers.serverSaltReassigned?.(this.serverSalt));
|
|
169
184
|
}
|
|
170
|
-
else if (message.body
|
|
185
|
+
else if (message.body._ == "rpc_result") {
|
|
171
186
|
let result = message.body.result;
|
|
172
|
-
if (result
|
|
187
|
+
if (is("gzip_packed", result)) {
|
|
173
188
|
result = new TLReader(gunzip(result.packed_data)).readObject();
|
|
174
189
|
}
|
|
175
|
-
if (result
|
|
190
|
+
if (is("rpc_error", result)) {
|
|
176
191
|
__classPrivateFieldGet(this, _ClientEncrypted_LreceiveLoop, "f").debug("RPCResult:", result.error_code, result.error_message);
|
|
177
192
|
}
|
|
178
193
|
else {
|
|
179
|
-
__classPrivateFieldGet(this, _ClientEncrypted_LreceiveLoop, "f").debug("RPCResult:",
|
|
194
|
+
__classPrivateFieldGet(this, _ClientEncrypted_LreceiveLoop, "f").debug("RPCResult:", result._);
|
|
180
195
|
}
|
|
181
|
-
const messageId = message.body.
|
|
196
|
+
const messageId = message.body.req_msg_id;
|
|
182
197
|
const promise = __classPrivateFieldGet(this, _ClientEncrypted_promises, "f").get(messageId);
|
|
183
198
|
const resolvePromise = () => {
|
|
184
199
|
if (promise) {
|
|
185
|
-
if (result
|
|
186
|
-
promise.reject?.(
|
|
200
|
+
if (is("rpc_error", result)) {
|
|
201
|
+
promise.reject?.(constructTelegramError(result, promise.call));
|
|
187
202
|
}
|
|
188
203
|
else {
|
|
189
204
|
promise.resolve?.(result);
|
|
@@ -191,21 +206,22 @@ _ClientEncrypted_authKey = new WeakMap(), _ClientEncrypted_authKeyId = new WeakM
|
|
|
191
206
|
__classPrivateFieldGet(this, _ClientEncrypted_promises, "f").delete(messageId);
|
|
192
207
|
}
|
|
193
208
|
};
|
|
194
|
-
if (result
|
|
209
|
+
if (isOfEnum("Updates", result) || isOfEnum("Update", result)) {
|
|
210
|
+
// @ts-ignore tbd
|
|
195
211
|
drop(this.handlers.updates?.(result, promise?.call ?? null, resolvePromise));
|
|
196
212
|
}
|
|
197
213
|
else {
|
|
198
214
|
drop(this.handlers.result?.(result, resolvePromise));
|
|
199
215
|
}
|
|
200
216
|
}
|
|
201
|
-
else if (message.body
|
|
217
|
+
else if (is("pong", message.body)) {
|
|
202
218
|
const promise = __classPrivateFieldGet(this, _ClientEncrypted_promises, "f").get(message.body.msg_id);
|
|
203
219
|
if (promise) {
|
|
204
220
|
promise.resolve?.(message.body);
|
|
205
221
|
__classPrivateFieldGet(this, _ClientEncrypted_promises, "f").delete(message.body.msg_id);
|
|
206
222
|
}
|
|
207
223
|
}
|
|
208
|
-
else if (message.body
|
|
224
|
+
else if (is("bad_server_salt", message.body)) {
|
|
209
225
|
__classPrivateFieldGet(this, _ClientEncrypted_LreceiveLoop, "f").debug("server salt reassigned");
|
|
210
226
|
this.serverSalt = message.body.new_server_salt;
|
|
211
227
|
drop(this.handlers.serverSaltReassigned?.(this.serverSalt));
|
|
@@ -230,7 +246,7 @@ _ClientEncrypted_authKey = new WeakMap(), _ClientEncrypted_authKeyId = new WeakM
|
|
|
230
246
|
}
|
|
231
247
|
}
|
|
232
248
|
}
|
|
233
|
-
__classPrivateFieldGet(this, _ClientEncrypted_toAcknowledge, "f").add(message.
|
|
249
|
+
__classPrivateFieldGet(this, _ClientEncrypted_toAcknowledge, "f").add(message.msg_id);
|
|
234
250
|
}
|
|
235
251
|
}
|
|
236
252
|
catch (err) {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
import { PublicKeys } from "../4_constants.js";
|
|
22
22
|
import { ClientAbstract, ClientAbstractParams } from "./0_client_abstract.js";
|
|
23
23
|
export interface ClientPlainParams extends ClientAbstractParams {
|
|
@@ -32,7 +32,7 @@ export interface ClientPlainParams extends ClientAbstractParams {
|
|
|
32
32
|
export declare class ClientPlain extends ClientAbstract {
|
|
33
33
|
#private;
|
|
34
34
|
constructor(params?: ClientPlainParams);
|
|
35
|
-
invoke<T extends
|
|
35
|
+
invoke<T extends Api.AnyObject<P>, P extends Api.Function>(function_: T): Promise<T["_"] extends keyof Api.Functions ? Api.ReturnType<Api.Functions[T["_"]]> : never>;
|
|
36
36
|
createAuthKey(): Promise<[Uint8Array, bigint]>;
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=1_client_plain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_client_plain.d.ts","sourceRoot":"","sources":["../../src/client/1_client_plain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"1_client_plain.d.ts","sourceRoot":"","sources":["../../src/client/1_client_plain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,GAAG,EAA2B,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAM9E,MAAM,WAAW,iBAAkB,SAAQ,oBAAoB;IAC7D;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,cAAc;;gBAIjC,MAAM,CAAC,EAAE,iBAAiB;IAKhC,MAAM,CAAC,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAwBrK,aAAa,IAAI,OAAO,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;CA+HrD"}
|
|
@@ -28,11 +28,11 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
28
28
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
29
29
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
30
|
};
|
|
31
|
-
var _ClientPlain_publicKeys,
|
|
32
|
-
import {
|
|
31
|
+
var _ClientPlain_publicKeys, _ClientPlain_lastMessageId;
|
|
32
|
+
import { assert, assertEquals, concat, ige256Decrypt, ige256Encrypt, unreachable } from "../0_deps.js";
|
|
33
33
|
import { ConnectionError, TransportError } from "../0_errors.js";
|
|
34
34
|
import { bigIntFromBuffer, bufferFromBigInt, factorize, getLogger, getRandomBigInt, modExp, rsaPad, sha1 } from "../1_utilities.js";
|
|
35
|
-
import {
|
|
35
|
+
import { is, serialize, TLReader } from "../2_tl.js";
|
|
36
36
|
import { PUBLIC_KEYS } from "../4_constants.js";
|
|
37
37
|
import { ClientAbstract } from "./0_client_abstract.js";
|
|
38
38
|
import { getMessageId, packUnencryptedMessage, unpackUnencryptedMessage } from "./0_message.js";
|
|
@@ -45,15 +45,15 @@ export class ClientPlain extends ClientAbstract {
|
|
|
45
45
|
constructor(params) {
|
|
46
46
|
super(params);
|
|
47
47
|
_ClientPlain_publicKeys.set(this, void 0);
|
|
48
|
-
|
|
48
|
+
_ClientPlain_lastMessageId.set(this, 0n);
|
|
49
49
|
__classPrivateFieldSet(this, _ClientPlain_publicKeys, params?.publicKeys ?? PUBLIC_KEYS, "f");
|
|
50
50
|
}
|
|
51
51
|
async invoke(function_) {
|
|
52
52
|
if (!this.transport) {
|
|
53
53
|
throw new ConnectionError("Not connected.");
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
const payload = packUnencryptedMessage(
|
|
55
|
+
const messageId = __classPrivateFieldSet(this, _ClientPlain_lastMessageId, getMessageId(__classPrivateFieldGet(this, _ClientPlain_lastMessageId, "f")), "f");
|
|
56
|
+
const payload = packUnencryptedMessage(serialize(function_), messageId);
|
|
57
57
|
await this.transport.transport.send(payload);
|
|
58
58
|
L.out(function_);
|
|
59
59
|
L.outBin(payload);
|
|
@@ -76,8 +76,8 @@ export class ClientPlain extends ClientAbstract {
|
|
|
76
76
|
for (let i = 0; i < 10; i++) {
|
|
77
77
|
try {
|
|
78
78
|
LcreateAuthKey.debug(`req_pq_multi [${i + 1}]`);
|
|
79
|
-
resPq = await this.invoke(
|
|
80
|
-
|
|
79
|
+
resPq = await this.invoke({ _: "req_pq_multi", nonce });
|
|
80
|
+
assert(is("resPQ", resPq));
|
|
81
81
|
assertEquals(resPq.nonce, nonce);
|
|
82
82
|
LcreateAuthKey.debug("got res_pq");
|
|
83
83
|
break;
|
|
@@ -113,7 +113,8 @@ export class ClientPlain extends ClientAbstract {
|
|
|
113
113
|
const pq = resPq.pq;
|
|
114
114
|
const serverNonce = resPq.server_nonce;
|
|
115
115
|
const newNonce = getRandomBigInt(32, false, true);
|
|
116
|
-
let encryptedData = await rsaPad(
|
|
116
|
+
let encryptedData = await rsaPad(serialize({
|
|
117
|
+
_: "p_q_inner_data_dc",
|
|
117
118
|
pq,
|
|
118
119
|
p,
|
|
119
120
|
q,
|
|
@@ -121,16 +122,17 @@ export class ClientPlain extends ClientAbstract {
|
|
|
121
122
|
new_nonce: newNonce,
|
|
122
123
|
nonce,
|
|
123
124
|
server_nonce: serverNonce,
|
|
124
|
-
})
|
|
125
|
-
const dhParams = await this.invoke(
|
|
125
|
+
}), publicKey);
|
|
126
|
+
const dhParams = await this.invoke({
|
|
127
|
+
_: "req_DH_params",
|
|
126
128
|
nonce,
|
|
127
129
|
server_nonce: serverNonce,
|
|
128
130
|
p,
|
|
129
131
|
q,
|
|
130
132
|
public_key_fingerprint: publicKeyFingerprint,
|
|
131
133
|
encrypted_data: encryptedData,
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
+
});
|
|
135
|
+
assert(is("server_DH_params_ok", dhParams));
|
|
134
136
|
LcreateAuthKey.debug("got server_DH_params_ok");
|
|
135
137
|
const newNonce_ = bufferFromBigInt(newNonce, 32, true, true);
|
|
136
138
|
const serverNonce_ = bufferFromBigInt(serverNonce, 16, true, true);
|
|
@@ -138,25 +140,31 @@ export class ClientPlain extends ClientAbstract {
|
|
|
138
140
|
const tmpAesIv = concat([(await sha1(concat([serverNonce_, newNonce_]))).subarray(12, 12 + 8), await sha1(concat([newNonce_, newNonce_])), newNonce_.subarray(0, 0 + 4)]);
|
|
139
141
|
const answerWithHash = ige256Decrypt(dhParams.encrypted_answer, tmpAesKey, tmpAesIv);
|
|
140
142
|
const dhInnerData = new TLReader(answerWithHash.slice(20)).readObject();
|
|
141
|
-
|
|
143
|
+
assert(is("server_DH_inner_data", dhInnerData));
|
|
142
144
|
const { g, g_a: gA_, dh_prime: dhPrime_ } = dhInnerData;
|
|
143
145
|
const gA = bigIntFromBuffer(gA_, false, false);
|
|
144
146
|
const dhPrime = bigIntFromBuffer(dhPrime_, false, false);
|
|
145
147
|
const b = getRandomBigInt(256, false, false);
|
|
146
148
|
const gB = modExp(BigInt(g), b, dhPrime);
|
|
147
|
-
const data =
|
|
149
|
+
const data = serialize({
|
|
150
|
+
_: "client_DH_inner_data",
|
|
148
151
|
nonce,
|
|
149
152
|
server_nonce: serverNonce,
|
|
150
153
|
retry_id: 0n,
|
|
151
154
|
g_b: bufferFromBigInt(gB, 256, false, false),
|
|
152
|
-
})
|
|
155
|
+
});
|
|
153
156
|
let dataWithHash = concat([await sha1(data), data]);
|
|
154
157
|
while (dataWithHash.length % 16 != 0) {
|
|
155
158
|
dataWithHash = concat([dataWithHash, new Uint8Array(1)]);
|
|
156
159
|
}
|
|
157
160
|
encryptedData = ige256Encrypt(dataWithHash, tmpAesKey, tmpAesIv);
|
|
158
|
-
const dhGenOk = await this.invoke(
|
|
159
|
-
|
|
161
|
+
const dhGenOk = await this.invoke({
|
|
162
|
+
_: "set_client_DH_params",
|
|
163
|
+
nonce,
|
|
164
|
+
server_nonce: serverNonce,
|
|
165
|
+
encrypted_data: encryptedData,
|
|
166
|
+
});
|
|
167
|
+
assert(is("dh_gen_ok", dhGenOk));
|
|
160
168
|
LcreateAuthKey.debug("got dh_gen_ok");
|
|
161
169
|
const serverNonceSlice = serverNonce_.subarray(0, 8);
|
|
162
170
|
const salt = newNonce_.subarray(0, 0 + 8).map((v, i) => v ^ serverNonceSlice[i]);
|
|
@@ -166,4 +174,4 @@ export class ClientPlain extends ClientAbstract {
|
|
|
166
174
|
return [authKey, bigIntFromBuffer(salt, true, false)];
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
|
-
_ClientPlain_publicKeys = new WeakMap(),
|
|
177
|
+
_ClientPlain_publicKeys = new WeakMap(), _ClientPlain_lastMessageId = new WeakMap();
|
package/esm/client/1_types.d.ts
CHANGED
|
@@ -17,30 +17,18 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
import { StorageOperations } from "./0_storage_operations.js";
|
|
22
22
|
import { ConnectionState, EntityGetter, ID, ParseMode, Update } from "../3_types.js";
|
|
23
|
-
type
|
|
24
|
-
type Keys = keyof Functions;
|
|
25
|
-
type AnyFunc = (...args: any) => any;
|
|
26
|
-
type Promisify<T extends AnyFunc> = (...args: Parameters<T>) => Promise<ReturnType<T>>;
|
|
27
|
-
export type Api = {
|
|
28
|
-
[K in Keys]: Functions[K] extends {
|
|
29
|
-
__F: AnyFunc;
|
|
30
|
-
} ? Promisify<Functions[K]["__F"]> : {
|
|
31
|
-
[K_ in keyof Functions[K]]: Functions[K][K_] extends {
|
|
32
|
-
__F: AnyFunc;
|
|
33
|
-
} ? Promisify<Functions[K][K_]["__F"]> : Functions[K][K_];
|
|
34
|
-
};
|
|
35
|
-
};
|
|
23
|
+
export type Invoke = <T extends Api.AnyFunction<P>, P extends Api.Function, R extends unknown = Api.ReturnType<Api.Functions[T["_"]]>>(function_: T, businessConnectionId?: string) => Promise<R>;
|
|
36
24
|
interface Connection {
|
|
37
|
-
|
|
25
|
+
invoke: Invoke;
|
|
38
26
|
connect: () => Promise<void>;
|
|
39
27
|
disconnect: () => Promise<void>;
|
|
40
28
|
}
|
|
41
|
-
export interface ConnectionPool extends Omit<Connection, "
|
|
29
|
+
export interface ConnectionPool extends Omit<Connection, "invoke"> {
|
|
42
30
|
size: number;
|
|
43
|
-
|
|
31
|
+
invoke: () => Invoke;
|
|
44
32
|
connect: () => Promise<void>;
|
|
45
33
|
disconnect: () => Promise<void>;
|
|
46
34
|
}
|
|
@@ -52,16 +40,15 @@ interface GetCdnConnectionPool {
|
|
|
52
40
|
}
|
|
53
41
|
export interface C {
|
|
54
42
|
id: number;
|
|
55
|
-
api: Api;
|
|
56
43
|
storage: StorageOperations;
|
|
57
44
|
messageStorage: StorageOperations;
|
|
58
45
|
guaranteeUpdateDelivery: boolean;
|
|
59
46
|
setConnectionState: (connectionState: ConnectionState) => void;
|
|
60
47
|
resetConnectionState: () => void;
|
|
61
48
|
getSelfId: () => Promise<number>;
|
|
62
|
-
getInputPeer: (id: ID) => Promise<
|
|
63
|
-
getInputChannel: (id: ID) => Promise<
|
|
64
|
-
getInputUser: (id: ID) => Promise<
|
|
49
|
+
getInputPeer: (id: ID) => Promise<Api.InputPeer>;
|
|
50
|
+
getInputChannel: (id: ID) => Promise<Api.inputChannel>;
|
|
51
|
+
getInputUser: (id: ID) => Promise<Api.inputUser>;
|
|
65
52
|
getEntity: EntityGetter;
|
|
66
53
|
handleUpdate: (update: Update) => void;
|
|
67
54
|
parseMode: ParseMode;
|
|
@@ -70,7 +57,7 @@ export interface C {
|
|
|
70
57
|
ignoreOutgoing: boolean | null;
|
|
71
58
|
cdn: boolean;
|
|
72
59
|
dropPendingUpdates?: boolean;
|
|
73
|
-
invoke
|
|
60
|
+
invoke: Invoke;
|
|
74
61
|
}
|
|
75
62
|
export {};
|
|
76
63
|
//# sourceMappingURL=1_types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_types.d.ts","sourceRoot":"","sources":["../../src/client/1_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"1_types.d.ts","sourceRoot":"","sources":["../../src/client/1_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAErF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,GAAG,CAAC,QAAQ,EAAE,CAAC,SAAS,OAAO,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,oBAAoB,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAElM,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AACD,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAED,UAAU,gBAAgB;IACxB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CAC7B;AACD,UAAU,oBAAoB;IAC5B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;CAC/C;AAED,MAAM,WAAW,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,iBAAiB,CAAC;IAC3B,cAAc,EAAE,iBAAiB,CAAC;IAClC,uBAAuB,EAAE,OAAO,CAAC;IACjC,kBAAkB,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/D,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACjD,eAAe,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACvD,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACjD,SAAS,EAAE,YAAY,CAAC;IACxB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,GAAG,EAAE,OAAO,CAAC;IACb,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -24,8 +24,8 @@ export declare class AccountManager {
|
|
|
24
24
|
constructor(c: C);
|
|
25
25
|
showUsername(id: ID, username: string): Promise<void>;
|
|
26
26
|
hideUsername(id: ID, username: string): Promise<void>;
|
|
27
|
-
reorderUsernames(id: ID, order: string[]): Promise<boolean
|
|
28
|
-
hideUsernames(id: ID): Promise<boolean
|
|
27
|
+
reorderUsernames(id: ID, order: string[]): Promise<NonNullable<boolean | undefined>>;
|
|
28
|
+
hideUsernames(id: ID): Promise<NonNullable<boolean | undefined>>;
|
|
29
29
|
getInactiveChats(): Promise<import("../3_types.js").InactiveChat[]>;
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=2_account_manager.d.ts.map
|
|
@@ -30,7 +30,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
30
30
|
};
|
|
31
31
|
var _AccountManager_instances, _AccountManager_c, _AccountManager_toggleUsername;
|
|
32
32
|
import { unreachable } from "../0_deps.js";
|
|
33
|
-
import {
|
|
33
|
+
import { is } from "../2_tl.js";
|
|
34
34
|
import { constructInactiveChat } from "../3_types.js";
|
|
35
35
|
export class AccountManager {
|
|
36
36
|
constructor(c) {
|
|
@@ -49,14 +49,14 @@ export class AccountManager {
|
|
|
49
49
|
async reorderUsernames(id, order) {
|
|
50
50
|
await __classPrivateFieldGet(this, _AccountManager_c, "f").storage.assertUser("reorderUsernames");
|
|
51
51
|
const peer = await __classPrivateFieldGet(this, _AccountManager_c, "f").getInputPeer(id);
|
|
52
|
-
if (peer
|
|
53
|
-
return await __classPrivateFieldGet(this, _AccountManager_c, "f").
|
|
52
|
+
if (is("inputPeerSelf", peer)) {
|
|
53
|
+
return await __classPrivateFieldGet(this, _AccountManager_c, "f").invoke({ _: "account.reorderUsernames", order });
|
|
54
54
|
}
|
|
55
|
-
else if (peer
|
|
56
|
-
return await __classPrivateFieldGet(this, _AccountManager_c, "f").
|
|
55
|
+
else if (is("inputPeerUser", peer)) {
|
|
56
|
+
return await __classPrivateFieldGet(this, _AccountManager_c, "f").invoke({ _: "bots.reorderUsernames", bot: { ...peer, _: "inputUser" }, order });
|
|
57
57
|
}
|
|
58
|
-
else if (peer
|
|
59
|
-
return await __classPrivateFieldGet(this, _AccountManager_c, "f").
|
|
58
|
+
else if (is("inputPeerChannel", peer)) {
|
|
59
|
+
return await __classPrivateFieldGet(this, _AccountManager_c, "f").invoke({ _: "channels.reorderUsernames", channel: { ...peer, _: "inputChannel" }, order });
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
62
|
unreachable();
|
|
@@ -65,8 +65,8 @@ export class AccountManager {
|
|
|
65
65
|
async hideUsernames(id) {
|
|
66
66
|
await __classPrivateFieldGet(this, _AccountManager_c, "f").storage.assertUser("hideUsernames");
|
|
67
67
|
const peer = await __classPrivateFieldGet(this, _AccountManager_c, "f").getInputPeer(id);
|
|
68
|
-
if (peer
|
|
69
|
-
return await __classPrivateFieldGet(this, _AccountManager_c, "f").
|
|
68
|
+
if (is("inputPeerChannel", peer)) {
|
|
69
|
+
return await __classPrivateFieldGet(this, _AccountManager_c, "f").invoke({ _: "channels.deactivateAllUsernames", channel: { ...peer, _: "inputChannel" } });
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
72
|
unreachable();
|
|
@@ -74,20 +74,20 @@ export class AccountManager {
|
|
|
74
74
|
}
|
|
75
75
|
async getInactiveChats() {
|
|
76
76
|
await __classPrivateFieldGet(this, _AccountManager_c, "f").storage.assertUser("getInactiveChats");
|
|
77
|
-
const { chats, dates } = await __classPrivateFieldGet(this, _AccountManager_c, "f").
|
|
77
|
+
const { chats, dates } = await __classPrivateFieldGet(this, _AccountManager_c, "f").invoke({ _: "channels.getInactiveChannels" });
|
|
78
78
|
return chats.map((v, i) => constructInactiveChat(v, dates[i]));
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
_AccountManager_c = new WeakMap(), _AccountManager_instances = new WeakSet(), _AccountManager_toggleUsername = async function _AccountManager_toggleUsername(id, username, active) {
|
|
82
82
|
const peer = await __classPrivateFieldGet(this, _AccountManager_c, "f").getInputPeer(id);
|
|
83
|
-
if (peer
|
|
84
|
-
await __classPrivateFieldGet(this, _AccountManager_c, "f").
|
|
83
|
+
if (is("inputPeerSelf", peer)) {
|
|
84
|
+
await __classPrivateFieldGet(this, _AccountManager_c, "f").invoke({ _: "account.toggleUsername", username, active });
|
|
85
85
|
}
|
|
86
|
-
else if (peer
|
|
87
|
-
await __classPrivateFieldGet(this, _AccountManager_c, "f").
|
|
86
|
+
else if (is("inputPeerUser", peer)) {
|
|
87
|
+
await __classPrivateFieldGet(this, _AccountManager_c, "f").invoke({ _: "bots.toggleUsername", bot: { ...peer, _: "inputUser" }, username, active });
|
|
88
88
|
}
|
|
89
|
-
else if (peer
|
|
90
|
-
await __classPrivateFieldGet(this, _AccountManager_c, "f").
|
|
89
|
+
else if (is("inputPeerChannel", peer)) {
|
|
90
|
+
await __classPrivateFieldGet(this, _AccountManager_c, "f").invoke({ _: "channels.toggleUsername", channel: { ...peer, _: "inputChannel" }, username, active });
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
93
93
|
unreachable();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_bot_info_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_bot_info_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,UAAU,EAA6B,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,qBAAa,cAAc;;gBAGb,CAAC,EAAE,CAAC;IAQV,gBAAgB,CAAC,MAAM,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;IAKzE,SAAS,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;IAK3D,qBAAqB,CAAC,MAAM,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;IASnF,gBAAgB,CAAC,MAAM,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrE,SAAS,CAAC,MAAM,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9D,qBAAqB,CAAC,MAAM,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAK1E,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"2_bot_info_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_bot_info_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,UAAU,EAA6B,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,qBAAa,cAAc;;gBAGb,CAAC,EAAE,CAAC;IAQV,gBAAgB,CAAC,MAAM,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;IAKzE,SAAS,CAAC,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;IAK3D,qBAAqB,CAAC,MAAM,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE;IASnF,gBAAgB,CAAC,MAAM,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrE,SAAS,CAAC,MAAM,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9D,qBAAqB,CAAC,MAAM,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAK1E,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAUlE,aAAa,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,MAAM,CAAC,EAAE,mBAAmB;CASzE"}
|
|
@@ -29,7 +29,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
29
29
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
30
30
|
};
|
|
31
31
|
var _BotInfoManager_instances, _BotInfoManager_c, _BotInfoManager_setMyInfo, _BotInfoManager_getMyInfo;
|
|
32
|
-
import { types } from "../2_tl.js";
|
|
33
32
|
import { botCommandScopeToTlObject } from "../3_types.js";
|
|
34
33
|
export class BotInfoManager {
|
|
35
34
|
constructor(c) {
|
|
@@ -63,7 +62,8 @@ export class BotInfoManager {
|
|
|
63
62
|
}
|
|
64
63
|
async getMyCommands(params) {
|
|
65
64
|
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").storage.assertBot("getMyCommands");
|
|
66
|
-
const commands_ = await __classPrivateFieldGet(this, _BotInfoManager_c, "f").
|
|
65
|
+
const commands_ = await __classPrivateFieldGet(this, _BotInfoManager_c, "f").invoke({
|
|
66
|
+
_: "bots.getBotCommands",
|
|
67
67
|
lang_code: params?.languageCode ?? "",
|
|
68
68
|
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, __classPrivateFieldGet(this, _BotInfoManager_c, "f").getInputPeer),
|
|
69
69
|
});
|
|
@@ -71,15 +71,16 @@ export class BotInfoManager {
|
|
|
71
71
|
}
|
|
72
72
|
async setMyCommands(commands, params) {
|
|
73
73
|
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").storage.assertBot("setMyCommands");
|
|
74
|
-
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").
|
|
75
|
-
|
|
74
|
+
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").invoke({
|
|
75
|
+
_: "bots.setBotCommands",
|
|
76
|
+
commands: commands.map((v) => ({ ...v, _: "botCommand" })),
|
|
76
77
|
lang_code: params?.languageCode ?? "",
|
|
77
78
|
scope: await botCommandScopeToTlObject(params?.scope ?? { type: "default" }, __classPrivateFieldGet(this, _BotInfoManager_c, "f").getInputPeer),
|
|
78
79
|
});
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
_BotInfoManager_c = new WeakMap(), _BotInfoManager_instances = new WeakSet(), _BotInfoManager_setMyInfo = async function _BotInfoManager_setMyInfo(info) {
|
|
82
|
-
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").
|
|
83
|
+
await __classPrivateFieldGet(this, _BotInfoManager_c, "f").invoke({ _: "bots.setBotInfo", bot: { _: "inputUserSelf" }, ...info });
|
|
83
84
|
}, _BotInfoManager_getMyInfo = function _BotInfoManager_getMyInfo(languageCode) {
|
|
84
|
-
return __classPrivateFieldGet(this, _BotInfoManager_c, "f").
|
|
85
|
+
return __classPrivateFieldGet(this, _BotInfoManager_c, "f").invoke({ _: "bots.getBotInfo", bot: { _: "inputUserSelf" }, lang_code: languageCode ?? "" });
|
|
85
86
|
};
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
21
|
import { Update } from "../3_types.js";
|
|
22
22
|
import { C } from "./1_types.js";
|
|
23
|
-
export type BusinessConnectionManagerUpdate =
|
|
23
|
+
export type BusinessConnectionManagerUpdate = Api.updateBotBusinessConnect;
|
|
24
24
|
export declare class BusinessConnectionManager {
|
|
25
25
|
#private;
|
|
26
26
|
constructor(c: C);
|
|
27
27
|
getBusinessConnection(id: string): Promise<import("../3_types.js").BusinessConnection>;
|
|
28
|
-
static canHandleUpdate(update:
|
|
28
|
+
static canHandleUpdate(update: Api.Update): update is BusinessConnectionManagerUpdate;
|
|
29
29
|
handleUpdate(update: BusinessConnectionManagerUpdate): Promise<Update>;
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=2_business_connection_manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2_business_connection_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_business_connection_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"2_business_connection_manager.d.ts","sourceRoot":"","sources":["../../src/client/2_business_connection_manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAA+B,MAAM,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEjC,MAAM,MAAM,+BAA+B,GAAG,GAAG,CAAC,wBAAwB,CAAC;AAE3E,qBAAa,yBAAyB;;gBAGxB,CAAC,EAAE,CAAC;IAIV,qBAAqB,CAAC,EAAE,EAAE,MAAM;IAatC,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,IAAI,+BAA+B;IAI/E,YAAY,CAAC,MAAM,EAAE,+BAA+B,GAAG,OAAO,CAAC,MAAM,CAAC;CAS7E"}
|