@mtkruto/node 0.62.1 → 0.63.0
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/2_tl.d.ts +6 -6
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +6 -6
- package/esm/3_errors.d.ts +1 -2
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +2 -1
- package/esm/4_constants.d.ts +0 -1
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_constants.js +0 -1
- package/esm/4_errors.d.ts +2 -2
- package/esm/4_errors.d.ts.map +1 -1
- package/esm/4_session.d.ts +24 -0
- package/esm/4_session.d.ts.map +1 -0
- package/esm/4_session.js +23 -0
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_client_abstract.d.ts +28 -26
- package/esm/client/0_client_abstract.d.ts.map +1 -1
- package/esm/client/0_client_abstract.js +16 -88
- package/esm/client/0_params.d.ts +5 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.d.ts.map +1 -1
- package/esm/client/0_password.js +2 -2
- package/esm/client/0_storage_operations.d.ts +4 -4
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +14 -14
- package/esm/client/0_update_processor.d.ts +19 -0
- package/esm/client/0_update_processor.d.ts.map +1 -1
- package/esm/client/0_update_processor.js +19 -0
- package/esm/client/0_utilities.d.ts +6 -2
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/0_utilities.js +21 -23
- package/esm/client/1_client_plain.d.ts +9 -6
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +26 -41
- package/esm/client/1_types.d.ts +4 -23
- package/esm/client/1_types.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +10 -10
- package/esm/client/2_business_connection_manager.d.ts.map +1 -1
- package/esm/client/2_business_connection_manager.js +4 -4
- package/esm/client/2_client_encrypted.d.ts +58 -0
- package/esm/client/2_client_encrypted.d.ts.map +1 -0
- package/esm/client/2_client_encrypted.js +265 -0
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +54 -74
- package/esm/client/2_network_statistics_manager.d.ts +1 -1
- package/esm/client/2_network_statistics_manager.d.ts.map +1 -1
- package/esm/client/2_network_statistics_manager.js +3 -3
- package/esm/client/2_payment_manager.d.ts.map +1 -1
- package/esm/client/2_payment_manager.js +3 -3
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +10 -10
- package/esm/client/2_translations_manager.d.ts +19 -0
- package/esm/client/2_translations_manager.d.ts.map +1 -1
- package/esm/client/2_translations_manager.js +24 -5
- package/esm/client/2_update_manager.d.ts +4 -4
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +69 -79
- package/esm/client/3_client_encrypted_pool.d.ts +30 -0
- package/esm/client/3_client_encrypted_pool.d.ts.map +1 -0
- package/esm/client/3_client_encrypted_pool.js +70 -0
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +96 -70
- package/esm/client/3_video_chat_manager.d.ts.map +1 -1
- package/esm/client/3_video_chat_manager.js +15 -20
- package/esm/client/4_callback_query_manager.d.ts.map +1 -1
- package/esm/client/4_callback_query_manager.js +2 -2
- package/esm/client/4_chat_list_manager.d.ts.map +1 -1
- package/esm/client/4_chat_list_manager.js +33 -33
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +25 -25
- package/esm/client/4_gift_manager.js +2 -2
- package/esm/client/4_inline_query_manager.d.ts.map +1 -1
- package/esm/client/4_inline_query_manager.js +4 -4
- package/esm/client/4_poll_manager.d.ts.map +1 -1
- package/esm/client/4_poll_manager.js +5 -5
- package/esm/client/4_story_manager.d.ts.map +1 -1
- package/esm/client/4_story_manager.js +10 -10
- package/esm/client/5_client.d.ts +3 -9
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +290 -306
- package/esm/connection/0_connection.d.ts +5 -4
- package/esm/connection/0_connection.d.ts.map +1 -1
- package/esm/connection/1_connection_web_socket.js +2 -2
- package/esm/mod.d.ts +1 -1
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +1 -1
- package/{script/tl/2_tl_reader.d.ts → esm/session/0_session_error.d.ts} +4 -7
- package/esm/session/0_session_error.d.ts.map +1 -0
- package/esm/{tl/2_tl_reader.d.ts → session/0_session_error.js} +5 -7
- package/esm/{tl/2_tl_writer.d.ts → session/0_session_state.d.ts} +7 -5
- package/esm/session/0_session_state.d.ts.map +1 -0
- package/esm/session/0_session_state.js +77 -0
- package/esm/session/1_session.d.ts +31 -0
- package/esm/session/1_session.d.ts.map +1 -0
- package/esm/session/1_session.js +149 -0
- package/esm/session/2_session_encrypted.d.ts +40 -0
- package/esm/session/2_session_encrypted.d.ts.map +1 -0
- package/esm/session/2_session_encrypted.js +416 -0
- package/esm/session/2_session_plain.d.ts +25 -0
- package/esm/session/2_session_plain.d.ts.map +1 -0
- package/esm/session/2_session_plain.js +56 -0
- package/esm/tl/0_tl_error.d.ts +22 -0
- package/esm/tl/0_tl_error.d.ts.map +1 -0
- package/esm/tl/0_tl_error.js +21 -0
- package/esm/tl/0_types.d.ts +25 -0
- package/esm/tl/0_types.d.ts.map +1 -0
- package/esm/tl/0_types.js +20 -0
- package/esm/tl/0_utilities.d.ts +32 -0
- package/esm/tl/0_utilities.d.ts.map +1 -0
- package/esm/tl/0_utilities.js +51 -0
- package/esm/tl/0_utilities_test.d.ts.map +1 -0
- package/esm/tl/1_mtproto_api.d.ts +371 -0
- package/esm/tl/1_mtproto_api.d.ts.map +1 -0
- package/esm/tl/1_mtproto_api.js +416 -0
- package/esm/tl/{0_api.d.ts → 1_telegram_api.d.ts} +23 -340
- package/esm/tl/1_telegram_api.d.ts.map +1 -0
- package/esm/tl/{0_api.js → 1_telegram_api.js} +4945 -11109
- package/{script/tl/0_tl_raw_reader.d.ts → esm/tl/1_tl_reader.d.ts} +5 -2
- package/esm/tl/1_tl_reader.d.ts.map +1 -0
- package/esm/tl/{2_tl_reader.js → 1_tl_reader.js} +107 -40
- package/esm/tl/1_tl_reader_test.d.ts.map +1 -0
- package/esm/tl/{0_tl_raw_writer.d.ts → 1_tl_writer.d.ts} +5 -2
- package/esm/tl/1_tl_writer.d.ts.map +1 -0
- package/esm/tl/{2_tl_writer.js → 1_tl_writer.js} +80 -23
- package/esm/tl/1_tl_writer_test.d.ts.map +1 -0
- package/esm/tl/1_utilities.d.ts +9 -24
- package/esm/tl/1_utilities.d.ts.map +1 -1
- package/esm/tl/1_utilities.js +18 -64
- package/esm/tl/2_message.d.ts +2 -2
- package/esm/tl/2_message.d.ts.map +1 -1
- package/esm/tl/2_message.js +7 -7
- package/esm/tl/2_mtproto.d.ts +33 -0
- package/esm/tl/2_mtproto.d.ts.map +1 -0
- package/esm/tl/2_mtproto.js +53 -0
- package/{script/tl/2_utilities.d.ts → esm/tl/2_telegram.d.ts} +16 -2
- package/esm/tl/2_telegram.d.ts.map +1 -0
- package/esm/tl/{2_utilities.js → 2_telegram.js} +46 -1
- package/esm/transport/0_transport.d.ts +1 -1
- package/esm/transport/0_transport.d.ts.map +1 -1
- package/esm/types/0_chat_photo.d.ts.map +1 -1
- package/esm/types/0_chat_photo.js +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_location.d.ts.map +1 -1
- package/esm/types/0_location.js +5 -5
- package/esm/types/0_message_entity.d.ts.map +1 -1
- package/esm/types/0_message_entity.js +20 -20
- package/esm/types/0_reaction.d.ts.map +1 -1
- package/esm/types/0_reaction.js +4 -4
- package/esm/types/0_slow_mode_duration.d.ts +19 -0
- package/esm/types/0_slow_mode_duration.d.ts.map +1 -1
- package/esm/types/0_slow_mode_duration.js +19 -0
- package/esm/types/0_thumbnail.d.ts.map +1 -1
- package/esm/types/0_thumbnail.js +3 -3
- package/esm/types/0_translation.d.ts +19 -0
- package/esm/types/0_translation.d.ts.map +1 -1
- package/esm/types/0_translation.js +22 -3
- package/esm/types/0_video_chat.d.ts.map +1 -1
- package/esm/types/0_video_chat.js +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.map +1 -1
- package/esm/types/1_audio.js +2 -2
- package/esm/types/1_bot_command_scope.d.ts.map +1 -1
- package/esm/types/1_bot_command_scope.js +2 -2
- 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.map +1 -1
- package/esm/types/1_document.js +2 -2
- package/esm/types/1_keyboard_button.d.ts.map +1 -1
- package/esm/types/1_keyboard_button.js +10 -10
- package/esm/types/1_message_reaction.d.ts.map +1 -1
- package/esm/types/1_message_reaction.js +6 -6
- package/esm/types/1_photo.d.ts.map +1 -1
- package/esm/types/1_photo.js +3 -3
- package/esm/types/1_sticker.d.ts.map +1 -1
- package/esm/types/1_sticker.js +8 -8
- package/esm/types/1_story_privacy.d.ts.map +1 -1
- package/esm/types/1_story_privacy.js +7 -7
- 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.map +1 -1
- package/esm/types/1_venue.js +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.map +1 -1
- package/esm/types/1_video_note.js +2 -2
- package/esm/types/2_chat.d.ts.map +1 -1
- package/esm/types/2_chat.js +8 -8
- package/esm/types/2_chat_member.d.ts.map +1 -1
- package/esm/types/2_chat_member.js +10 -10
- package/esm/types/2_chat_settings.d.ts +19 -0
- package/esm/types/2_chat_settings.d.ts.map +1 -1
- package/esm/types/2_chat_settings.js +21 -2
- package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
- package/esm/types/2_chosen_inline_result.js +4 -4
- package/esm/types/2_game.d.ts.map +1 -1
- package/esm/types/2_game.js +4 -4
- package/esm/types/2_gift_upgraded_component.d.ts.map +1 -1
- package/esm/types/2_gift_upgraded_component.js +3 -3
- 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.map +1 -1
- package/esm/types/2_inline_keyboard_button.js +10 -10
- package/esm/types/2_inline_query.d.ts.map +1 -1
- package/esm/types/2_inline_query.js +7 -7
- 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.map +1 -1
- package/esm/types/2_story_content.js +6 -6
- package/esm/types/2_story_interactive_area.d.ts.map +1 -1
- package/esm/types/2_story_interactive_area.js +9 -9
- package/esm/types/3_chat_member_updated.d.ts.map +1 -1
- package/esm/types/3_chat_member_updated.js +2 -2
- package/esm/types/3_gift.d.ts.map +1 -1
- package/esm/types/3_gift.js +3 -3
- package/esm/types/3_join_request.d.ts.map +1 -1
- package/esm/types/3_join_request.js +2 -2
- package/esm/types/3_reply_markup.d.ts.map +1 -1
- package/esm/types/3_reply_markup.js +5 -5
- package/esm/types/4_claimed_gift.d.ts.map +1 -1
- package/esm/types/4_claimed_gift.js +2 -2
- package/esm/types/4_inline_query_result.d.ts.map +1 -1
- package/esm/types/4_inline_query_result.js +14 -14
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +57 -57
- package/esm/types/5_callback_query.d.ts.map +1 -1
- package/esm/types/5_callback_query.js +6 -7
- package/esm/types/5_chat_list_item.d.ts.map +1 -1
- package/esm/types/5_chat_list_item.js +5 -5
- package/esm/types/5_claimed_gifts.d.ts.map +1 -1
- package/esm/types/5_claimed_gifts.js +6 -6
- package/esm/types/_file_id.d.ts.map +1 -1
- package/esm/types/_file_id.js +3 -3
- package/package.json +1 -1
- package/script/2_tl.d.ts +6 -6
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +11 -11
- package/script/3_errors.d.ts +1 -2
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +2 -1
- package/script/4_constants.d.ts +0 -1
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +1 -2
- package/script/4_errors.d.ts +2 -2
- package/script/4_errors.d.ts.map +1 -1
- package/script/4_session.d.ts +24 -0
- package/script/4_session.d.ts.map +1 -0
- package/script/4_session.js +39 -0
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_client_abstract.d.ts +28 -26
- package/script/client/0_client_abstract.d.ts.map +1 -1
- package/script/client/0_client_abstract.js +18 -113
- package/script/client/0_params.d.ts +5 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.d.ts.map +1 -1
- package/script/client/0_password.js +1 -1
- package/script/client/0_storage_operations.d.ts +4 -4
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +13 -13
- package/script/client/0_update_processor.d.ts +19 -0
- package/script/client/0_update_processor.d.ts.map +1 -1
- package/script/client/0_update_processor.js +19 -0
- package/script/client/0_utilities.d.ts +6 -2
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/0_utilities.js +22 -24
- package/script/client/1_client_plain.d.ts +9 -6
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +25 -40
- package/script/client/1_types.d.ts +4 -23
- package/script/client/1_types.d.ts.map +1 -1
- package/script/client/2_account_manager.js +9 -9
- package/script/client/2_business_connection_manager.d.ts.map +1 -1
- package/script/client/2_business_connection_manager.js +3 -3
- package/script/client/2_client_encrypted.d.ts +58 -0
- package/script/client/2_client_encrypted.d.ts.map +1 -0
- package/script/client/2_client_encrypted.js +269 -0
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +52 -72
- package/script/client/2_network_statistics_manager.d.ts +1 -1
- package/script/client/2_network_statistics_manager.d.ts.map +1 -1
- package/script/client/2_network_statistics_manager.js +3 -3
- package/script/client/2_payment_manager.d.ts.map +1 -1
- package/script/client/2_payment_manager.js +2 -2
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +9 -9
- package/script/client/2_translations_manager.d.ts +19 -0
- package/script/client/2_translations_manager.d.ts.map +1 -1
- package/script/client/2_translations_manager.js +23 -4
- package/script/client/2_update_manager.d.ts +4 -4
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +68 -78
- package/script/client/3_client_encrypted_pool.d.ts +30 -0
- package/script/client/3_client_encrypted_pool.d.ts.map +1 -0
- package/script/client/3_client_encrypted_pool.js +74 -0
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +95 -69
- package/script/client/3_video_chat_manager.d.ts.map +1 -1
- package/script/client/3_video_chat_manager.js +14 -19
- package/script/client/4_callback_query_manager.d.ts.map +1 -1
- package/script/client/4_callback_query_manager.js +1 -1
- package/script/client/4_chat_list_manager.d.ts.map +1 -1
- package/script/client/4_chat_list_manager.js +32 -32
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +24 -24
- package/script/client/4_gift_manager.js +1 -1
- package/script/client/4_inline_query_manager.d.ts.map +1 -1
- package/script/client/4_inline_query_manager.js +3 -3
- package/script/client/4_poll_manager.d.ts.map +1 -1
- package/script/client/4_poll_manager.js +4 -4
- package/script/client/4_story_manager.d.ts.map +1 -1
- package/script/client/4_story_manager.js +9 -9
- package/script/client/5_client.d.ts +3 -9
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +284 -300
- package/script/connection/0_connection.d.ts +5 -4
- package/script/connection/0_connection.d.ts.map +1 -1
- package/script/connection/1_connection_web_socket.js +2 -2
- package/script/mod.d.ts +1 -1
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +1 -2
- package/script/session/0_session_error.d.ts +24 -0
- package/script/session/0_session_error.d.ts.map +1 -0
- package/script/session/0_session_error.js +29 -0
- package/script/{tl/2_tl_writer.d.ts → session/0_session_state.d.ts} +7 -5
- package/script/session/0_session_state.d.ts.map +1 -0
- package/script/session/0_session_state.js +81 -0
- package/script/session/1_session.d.ts +31 -0
- package/script/session/1_session.d.ts.map +1 -0
- package/script/session/1_session.js +176 -0
- package/script/session/2_session_encrypted.d.ts +40 -0
- package/script/session/2_session_encrypted.d.ts.map +1 -0
- package/script/session/2_session_encrypted.js +420 -0
- package/script/session/2_session_plain.d.ts +25 -0
- package/script/session/2_session_plain.d.ts.map +1 -0
- package/script/session/2_session_plain.js +60 -0
- package/script/tl/0_tl_error.d.ts +22 -0
- package/script/tl/0_tl_error.d.ts.map +1 -0
- package/script/tl/0_tl_error.js +25 -0
- package/script/tl/0_types.d.ts +25 -0
- package/script/tl/0_types.d.ts.map +1 -0
- package/script/tl/0_types.js +21 -0
- package/script/tl/0_utilities.d.ts +32 -0
- package/script/tl/0_utilities.d.ts.map +1 -0
- package/script/tl/0_utilities.js +59 -0
- package/script/tl/0_utilities_test.d.ts.map +1 -0
- package/script/tl/1_mtproto_api.d.ts +371 -0
- package/script/tl/1_mtproto_api.d.ts.map +1 -0
- package/script/tl/1_mtproto_api.js +419 -0
- package/script/tl/{0_api.d.ts → 1_telegram_api.d.ts} +23 -340
- package/script/tl/1_telegram_api.d.ts.map +1 -0
- package/script/tl/{0_api.js → 1_telegram_api.js} +4947 -11134
- package/{esm/tl/0_tl_raw_reader.d.ts → script/tl/1_tl_reader.d.ts} +5 -2
- package/script/tl/1_tl_reader.d.ts.map +1 -0
- package/script/tl/1_tl_reader.js +218 -0
- package/script/tl/1_tl_reader_test.d.ts.map +1 -0
- package/script/tl/{0_tl_raw_writer.d.ts → 1_tl_writer.d.ts} +5 -2
- package/script/tl/1_tl_writer.d.ts.map +1 -0
- package/script/tl/{2_tl_writer.js → 1_tl_writer.js} +102 -45
- package/script/tl/1_tl_writer_test.d.ts.map +1 -0
- package/script/tl/1_utilities.d.ts +9 -24
- package/script/tl/1_utilities.d.ts.map +1 -1
- package/script/tl/1_utilities.js +19 -72
- package/script/tl/2_message.d.ts +2 -2
- package/script/tl/2_message.d.ts.map +1 -1
- package/script/tl/2_message.js +7 -7
- package/script/tl/2_mtproto.d.ts +33 -0
- package/script/tl/2_mtproto.d.ts.map +1 -0
- package/script/tl/2_mtproto.js +78 -0
- package/{esm/tl/2_utilities.d.ts → script/tl/2_telegram.d.ts} +16 -2
- package/script/tl/2_telegram.d.ts.map +1 -0
- package/script/tl/2_telegram.js +167 -0
- package/script/transport/0_transport.d.ts +1 -1
- package/script/transport/0_transport.d.ts.map +1 -1
- package/script/types/0_chat_photo.d.ts.map +1 -1
- package/script/types/0_chat_photo.js +1 -1
- package/script/types/0_giveaway_parameters.d.ts.map +1 -1
- package/script/types/0_giveaway_parameters.js +2 -2
- package/script/types/0_location.d.ts.map +1 -1
- package/script/types/0_location.js +4 -4
- package/script/types/0_message_entity.d.ts.map +1 -1
- package/script/types/0_message_entity.js +19 -19
- package/script/types/0_reaction.d.ts.map +1 -1
- package/script/types/0_reaction.js +3 -3
- package/script/types/0_slow_mode_duration.d.ts +19 -0
- package/script/types/0_slow_mode_duration.d.ts.map +1 -1
- package/script/types/0_slow_mode_duration.js +19 -0
- package/script/types/0_thumbnail.d.ts.map +1 -1
- package/script/types/0_thumbnail.js +2 -2
- package/script/types/0_translation.d.ts +19 -0
- package/script/types/0_translation.d.ts.map +1 -1
- package/script/types/0_translation.js +21 -2
- package/script/types/0_video_chat.d.ts.map +1 -1
- package/script/types/0_video_chat.js +1 -1
- 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.map +1 -1
- package/script/types/1_audio.js +1 -1
- package/script/types/1_bot_command_scope.d.ts.map +1 -1
- package/script/types/1_bot_command_scope.js +1 -1
- 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.map +1 -1
- package/script/types/1_document.js +1 -1
- package/script/types/1_keyboard_button.d.ts.map +1 -1
- package/script/types/1_keyboard_button.js +9 -9
- package/script/types/1_message_reaction.d.ts.map +1 -1
- package/script/types/1_message_reaction.js +5 -5
- package/script/types/1_photo.d.ts.map +1 -1
- package/script/types/1_photo.js +2 -2
- package/script/types/1_sticker.d.ts.map +1 -1
- package/script/types/1_sticker.js +7 -7
- package/script/types/1_story_privacy.d.ts.map +1 -1
- package/script/types/1_story_privacy.js +6 -6
- 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.map +1 -1
- package/script/types/1_venue.js +1 -1
- 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.map +1 -1
- package/script/types/1_video_note.js +1 -1
- package/script/types/2_chat.d.ts.map +1 -1
- package/script/types/2_chat.js +7 -7
- package/script/types/2_chat_member.d.ts.map +1 -1
- package/script/types/2_chat_member.js +9 -9
- package/script/types/2_chat_settings.d.ts +19 -0
- package/script/types/2_chat_settings.d.ts.map +1 -1
- package/script/types/2_chat_settings.js +20 -1
- package/script/types/2_chosen_inline_result.d.ts.map +1 -1
- package/script/types/2_chosen_inline_result.js +3 -3
- package/script/types/2_game.d.ts.map +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_gift_upgraded_component.d.ts.map +1 -1
- package/script/types/2_gift_upgraded_component.js +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.map +1 -1
- package/script/types/2_inline_keyboard_button.js +9 -9
- package/script/types/2_inline_query.d.ts.map +1 -1
- package/script/types/2_inline_query.js +6 -6
- 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.map +1 -1
- package/script/types/2_story_content.js +5 -5
- package/script/types/2_story_interactive_area.d.ts.map +1 -1
- package/script/types/2_story_interactive_area.js +8 -8
- package/script/types/3_chat_member_updated.d.ts.map +1 -1
- package/script/types/3_chat_member_updated.js +1 -1
- package/script/types/3_gift.d.ts.map +1 -1
- package/script/types/3_gift.js +2 -2
- package/script/types/3_join_request.d.ts.map +1 -1
- package/script/types/3_join_request.js +1 -1
- package/script/types/3_reply_markup.d.ts.map +1 -1
- package/script/types/3_reply_markup.js +4 -4
- package/script/types/4_claimed_gift.d.ts.map +1 -1
- package/script/types/4_claimed_gift.js +1 -1
- package/script/types/4_inline_query_result.d.ts.map +1 -1
- package/script/types/4_inline_query_result.js +13 -13
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +56 -56
- package/script/types/5_callback_query.d.ts.map +1 -1
- package/script/types/5_callback_query.js +5 -6
- package/script/types/5_chat_list_item.d.ts.map +1 -1
- package/script/types/5_chat_list_item.js +4 -4
- package/script/types/5_claimed_gifts.d.ts.map +1 -1
- package/script/types/5_claimed_gifts.js +5 -5
- package/script/types/_file_id.d.ts.map +1 -1
- package/script/types/_file_id.js +2 -2
- package/esm/client/0_message.d.ts +0 -29
- package/esm/client/0_message.d.ts.map +0 -1
- package/esm/client/0_message.js +0 -83
- package/esm/client/1_client_encrypted.d.ts +0 -52
- package/esm/client/1_client_encrypted.d.ts.map +0 -1
- package/esm/client/1_client_encrypted.js +0 -381
- package/esm/tl/0_api.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_reader.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_reader.js +0 -97
- package/esm/tl/0_tl_raw_reader_test.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_writer.d.ts.map +0 -1
- package/esm/tl/0_tl_raw_writer.js +0 -86
- package/esm/tl/0_tl_raw_writer_test.d.ts.map +0 -1
- package/esm/tl/1_utilities_test.d.ts.map +0 -1
- package/esm/tl/2_tl_reader.d.ts.map +0 -1
- package/esm/tl/2_tl_reader_test.d.ts.map +0 -1
- package/esm/tl/2_tl_writer.d.ts.map +0 -1
- package/esm/tl/2_tl_writer_test.d.ts.map +0 -1
- package/esm/tl/2_utilities.d.ts.map +0 -1
- package/script/client/0_message.d.ts +0 -29
- package/script/client/0_message.d.ts.map +0 -1
- package/script/client/0_message.js +0 -90
- package/script/client/1_client_encrypted.d.ts +0 -52
- package/script/client/1_client_encrypted.d.ts.map +0 -1
- package/script/client/1_client_encrypted.js +0 -385
- package/script/tl/0_api.d.ts.map +0 -1
- package/script/tl/0_tl_raw_reader.d.ts.map +0 -1
- package/script/tl/0_tl_raw_reader.js +0 -102
- package/script/tl/0_tl_raw_reader_test.d.ts.map +0 -1
- package/script/tl/0_tl_raw_writer.d.ts.map +0 -1
- package/script/tl/0_tl_raw_writer.js +0 -90
- package/script/tl/0_tl_raw_writer_test.d.ts.map +0 -1
- package/script/tl/1_utilities_test.d.ts.map +0 -1
- package/script/tl/2_tl_reader.d.ts.map +0 -1
- package/script/tl/2_tl_reader.js +0 -150
- package/script/tl/2_tl_reader_test.d.ts.map +0 -1
- package/script/tl/2_tl_writer.d.ts.map +0 -1
- package/script/tl/2_tl_writer_test.d.ts.map +0 -1
- package/script/tl/2_utilities.d.ts.map +0 -1
- package/script/tl/2_utilities.js +0 -98
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"0_tl_raw_reader.d.ts","sourceRoot":"","sources":["../../src/tl/0_tl_raw_reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,qBAAa,OAAQ,SAAQ,KAAK;CAEjC;AAED,qBAAa,WAAW;IACV,SAAS,CAAC,OAAO,EAAE,UAAU;gBAAnB,OAAO,EAAE,UAAU;IAGzC,IAAI,MAAM,IAAI,UAAU,CAEvB;IAED,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAS/B,MAAM,CAAC,KAAK,EAAE,MAAM;IAQpB,SAAS,CAAC,MAAM,UAAO,GAAG,MAAM;IAKhC,SAAS,CAAC,MAAM,UAAO,GAAG,MAAM;IAKhC,WAAW;IAIX,SAAS,CAAC,MAAM,UAAO,GAAG,MAAM;IAKhC,UAAU,IAAI,MAAM;IAKpB,UAAU,CAAC,MAAM,UAAO,GAAG,MAAM;IAKjC,UAAU,CAAC,MAAM,UAAO,GAAG,MAAM;IAKjC,SAAS,IAAI,UAAU;IAiBvB,UAAU,IAAI,MAAM;CAGrB"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
|
-
*
|
|
6
|
-
* This file is part of MTKruto.
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Lesser General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.TLRawReader = exports.TLError = void 0;
|
|
23
|
-
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
24
|
-
class TLError extends Error {
|
|
25
|
-
}
|
|
26
|
-
exports.TLError = TLError;
|
|
27
|
-
class TLRawReader {
|
|
28
|
-
constructor(_buffer) {
|
|
29
|
-
Object.defineProperty(this, "_buffer", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: _buffer
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
get buffer() {
|
|
37
|
-
return this._buffer;
|
|
38
|
-
}
|
|
39
|
-
read(count) {
|
|
40
|
-
if (this._buffer.length < count) {
|
|
41
|
-
throw new TLError("No data remaining");
|
|
42
|
-
}
|
|
43
|
-
const buffer = this._buffer.slice(0, count);
|
|
44
|
-
this._buffer = this._buffer.subarray(count);
|
|
45
|
-
return buffer;
|
|
46
|
-
}
|
|
47
|
-
unread(count) {
|
|
48
|
-
const newOffest = this._buffer.byteOffset - count;
|
|
49
|
-
if (newOffest < 0) {
|
|
50
|
-
throw new TLError("No data has been read");
|
|
51
|
-
}
|
|
52
|
-
this._buffer = new Uint8Array(this._buffer.buffer, newOffest);
|
|
53
|
-
}
|
|
54
|
-
readInt24(signed = true) {
|
|
55
|
-
const buffer = this.read(24 / 8);
|
|
56
|
-
return Number((0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed));
|
|
57
|
-
}
|
|
58
|
-
readInt32(signed = true) {
|
|
59
|
-
const buffer = this.read(32 / 8);
|
|
60
|
-
return Number((0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed));
|
|
61
|
-
}
|
|
62
|
-
unreadInt32() {
|
|
63
|
-
this.unread(32 / 8);
|
|
64
|
-
}
|
|
65
|
-
readInt64(signed = true) {
|
|
66
|
-
const buffer = this.read(64 / 8);
|
|
67
|
-
return (0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed);
|
|
68
|
-
}
|
|
69
|
-
readDouble() {
|
|
70
|
-
const buffer = this.read(8);
|
|
71
|
-
return new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength).getFloat64(0, true);
|
|
72
|
-
}
|
|
73
|
-
readInt128(signed = true) {
|
|
74
|
-
const buffer = this.read(128 / 8);
|
|
75
|
-
return (0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed);
|
|
76
|
-
}
|
|
77
|
-
readInt256(signed = true) {
|
|
78
|
-
const buffer = this.read(256 / 8);
|
|
79
|
-
return (0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed);
|
|
80
|
-
}
|
|
81
|
-
readBytes() {
|
|
82
|
-
let L = this.read(1)[0];
|
|
83
|
-
let padding;
|
|
84
|
-
if (L > 253) {
|
|
85
|
-
L = this.readInt24();
|
|
86
|
-
padding = L % 4;
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
padding = (L + 1) % 4;
|
|
90
|
-
}
|
|
91
|
-
const bytes = this.read(L);
|
|
92
|
-
if (padding > 0) {
|
|
93
|
-
padding = 4 - padding;
|
|
94
|
-
this.read(padding);
|
|
95
|
-
}
|
|
96
|
-
return bytes;
|
|
97
|
-
}
|
|
98
|
-
readString() {
|
|
99
|
-
return new TextDecoder().decode(this.readBytes());
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
exports.TLRawReader = TLRawReader;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"0_tl_raw_reader_test.d.ts","sourceRoot":"","sources":["../../src/tl/0_tl_raw_reader_test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"0_tl_raw_writer.d.ts","sourceRoot":"","sources":["../../src/tl/0_tl_raw_writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,qBAAa,WAAW;IACtB,SAAS,CAAC,OAAO,EAAE,UAAU,CAAoB;;IAKjD,IAAI,MAAM,IAAI,UAAU,CAEvB;IAED,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,IAAI;IAKtC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,OAAO,IAAI;IAKnD,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,OAAO,IAAI;IAKnD,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,OAAO,IAAI;IAKnD,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,IAAI;IAOxC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,OAAO,IAAI;IAKpD,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,OAAO,IAAI;IAKpD,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,IAAI;IAkB1C,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,IAAI;CAIzC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
|
-
*
|
|
6
|
-
* This file is part of MTKruto.
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Lesser General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.TLRawWriter = void 0;
|
|
23
|
-
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
|
-
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
25
|
-
class TLRawWriter {
|
|
26
|
-
constructor() {
|
|
27
|
-
Object.defineProperty(this, "_buffer", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
configurable: true,
|
|
30
|
-
writable: true,
|
|
31
|
-
value: new Uint8Array()
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
get buffer() {
|
|
35
|
-
return this._buffer;
|
|
36
|
-
}
|
|
37
|
-
write(buffer) {
|
|
38
|
-
this._buffer = (0, _0_deps_js_1.concat)([this._buffer, buffer]);
|
|
39
|
-
return this;
|
|
40
|
-
}
|
|
41
|
-
writeInt24(int, signed = true) {
|
|
42
|
-
this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 24 / 8, true, signed));
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
writeInt32(int, signed = true) {
|
|
46
|
-
this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 32 / 8, true, signed));
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
writeInt64(int, signed = true) {
|
|
50
|
-
this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 64 / 8, true, signed));
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
writeDouble(double) {
|
|
54
|
-
const buffer = new Uint8Array(8);
|
|
55
|
-
new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength).setFloat64(0, double, true);
|
|
56
|
-
this.write(buffer);
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
writeInt128(int, signed = true) {
|
|
60
|
-
this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 128 / 8, true, signed));
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
writeInt256(int, signed = true) {
|
|
64
|
-
this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 256 / 8, true, signed));
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
writeBytes(bytes) {
|
|
68
|
-
let padding;
|
|
69
|
-
if (bytes.length > 253) {
|
|
70
|
-
this.write(new Uint8Array([254]));
|
|
71
|
-
this.writeInt24(bytes.length);
|
|
72
|
-
padding = bytes.length % 4;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
this.write(new Uint8Array([bytes.length]));
|
|
76
|
-
padding = (bytes.length + 1) % 4;
|
|
77
|
-
}
|
|
78
|
-
this.write(bytes);
|
|
79
|
-
if (padding > 0) {
|
|
80
|
-
padding = 4 - padding;
|
|
81
|
-
this.write(new Uint8Array(padding));
|
|
82
|
-
}
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
writeString(string) {
|
|
86
|
-
this.writeBytes(new TextEncoder().encode(string));
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.TLRawWriter = TLRawWriter;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"0_tl_raw_writer_test.d.ts","sourceRoot":"","sources":["../../src/tl/0_tl_raw_writer_test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"1_utilities_test.d.ts","sourceRoot":"","sources":["../../src/tl/1_utilities_test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"2_tl_reader.d.ts","sourceRoot":"","sources":["../../src/tl/2_tl_reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAoD,MAAM,YAAY,CAAC;AAKzF,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAEzG,qBAAa,QAAS,SAAQ,WAAW;;IACjC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAqHrD"}
|
package/script/tl/2_tl_reader.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
|
-
*
|
|
6
|
-
* This file is part of MTKruto.
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Lesser General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
// deno-lint-ignore-file no-explicit-any
|
|
22
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
23
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
24
|
-
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");
|
|
25
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
26
|
-
};
|
|
27
|
-
var _TLReader_instances, _TLReader_deserializeEnum, _TLReader_deserializeType, _TLReader_deserializeVector, _TLReader_deserializePrimitive;
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.TLReader = void 0;
|
|
30
|
-
const _0_tl_raw_reader_js_1 = require("./0_tl_raw_reader.js");
|
|
31
|
-
const _0_api_js_1 = require("./0_api.js");
|
|
32
|
-
const _0_deps_js_1 = require("../0_deps.js");
|
|
33
|
-
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
34
|
-
const _1_utilities_js_2 = require("./1_utilities.js");
|
|
35
|
-
class TLReader extends _0_tl_raw_reader_js_1.TLRawReader {
|
|
36
|
-
constructor() {
|
|
37
|
-
super(...arguments);
|
|
38
|
-
_TLReader_instances.add(this);
|
|
39
|
-
}
|
|
40
|
-
async deserialize(type) {
|
|
41
|
-
if ((0, _1_utilities_js_2.isOptionalParam)(type)) {
|
|
42
|
-
type = (0, _1_utilities_js_2.getOptionalParamInnerType)(type);
|
|
43
|
-
}
|
|
44
|
-
const primitive = __classPrivateFieldGet(this, _TLReader_instances, "m", _TLReader_deserializePrimitive).call(this, type);
|
|
45
|
-
if (primitive !== undefined) {
|
|
46
|
-
return primitive;
|
|
47
|
-
}
|
|
48
|
-
const id = this.readInt32(false);
|
|
49
|
-
if (id == _1_utilities_js_2.GZIP_PACKED) {
|
|
50
|
-
const buffer = await (0, _1_utilities_js_1.gunzip)(this.readBytes());
|
|
51
|
-
return await new TLReader(buffer).deserialize(type);
|
|
52
|
-
}
|
|
53
|
-
if (type == _1_utilities_js_2.X) {
|
|
54
|
-
const typeName = (0, _0_api_js_1.getTypeName)(id);
|
|
55
|
-
if (!typeName) {
|
|
56
|
-
throw new _0_tl_raw_reader_js_1.TLError(`Unknown constructor: ${id.toString(16)}`);
|
|
57
|
-
}
|
|
58
|
-
this.unreadInt32();
|
|
59
|
-
return await this.deserialize(typeName);
|
|
60
|
-
}
|
|
61
|
-
if (id == _1_utilities_js_2.VECTOR) {
|
|
62
|
-
return await __classPrivateFieldGet(this, _TLReader_instances, "m", _TLReader_deserializeVector).call(this, type);
|
|
63
|
-
}
|
|
64
|
-
const enum_ = (0, _0_api_js_1.getEnum)(type);
|
|
65
|
-
if (enum_) {
|
|
66
|
-
return await __classPrivateFieldGet(this, _TLReader_instances, "m", _TLReader_deserializeEnum).call(this, enum_, id);
|
|
67
|
-
}
|
|
68
|
-
const type_ = (0, _0_api_js_1.getType)(type);
|
|
69
|
-
if (type_) {
|
|
70
|
-
return await __classPrivateFieldGet(this, _TLReader_instances, "m", _TLReader_deserializeType).call(this, type, type_, id);
|
|
71
|
-
}
|
|
72
|
-
(0, _0_deps_js_1.unreachable)(`unknown type: ${type} id ${id}`);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.TLReader = TLReader;
|
|
76
|
-
_TLReader_instances = new WeakSet(), _TLReader_deserializeEnum = async function _TLReader_deserializeEnum(enum_, id) {
|
|
77
|
-
const validTypes = enum_.map((v) => [v, (0, _0_api_js_1.getType)(v)]);
|
|
78
|
-
const type = validTypes.find((v) => v[1] && v[1][0] == id);
|
|
79
|
-
if (!type || !type[1]) {
|
|
80
|
-
throw new _0_tl_raw_reader_js_1.TLError(`Constructor not in enum: ${id.toString(16)}`);
|
|
81
|
-
}
|
|
82
|
-
return await __classPrivateFieldGet(this, _TLReader_instances, "m", _TLReader_deserializeType).call(this, type[0], type[1], id);
|
|
83
|
-
}, _TLReader_deserializeType = async function _TLReader_deserializeType(type, desc, id) {
|
|
84
|
-
if (desc[0] != id) {
|
|
85
|
-
throw new _0_tl_raw_reader_js_1.TLError(`Expected constructor ${desc[0].toString(16)} but got ${id}`);
|
|
86
|
-
}
|
|
87
|
-
const type_ = { _: type };
|
|
88
|
-
const flagFields = {};
|
|
89
|
-
for (const [name, type] of desc[1]) {
|
|
90
|
-
if ((0, _1_utilities_js_2.isOptionalParam)(type)) {
|
|
91
|
-
const { flagField, bitIndex } = (0, _1_utilities_js_2.analyzeOptionalParam)(type);
|
|
92
|
-
const bits = flagFields[flagField];
|
|
93
|
-
if ((bits & (1 << bitIndex)) == 0) {
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (type == "#") {
|
|
98
|
-
flagFields[name] = this.readInt32();
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
const value = await this.deserialize(type);
|
|
102
|
-
if (typeof value !== "boolean" || value) {
|
|
103
|
-
type_[name] = value;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return type_;
|
|
107
|
-
}, _TLReader_deserializeVector = async function _TLReader_deserializeVector(type) {
|
|
108
|
-
const itemType = (0, _1_utilities_js_2.getVectorItemType)(type);
|
|
109
|
-
if (!itemType) {
|
|
110
|
-
throw new _0_tl_raw_reader_js_1.TLError(`Expected Vector but received ${type}`);
|
|
111
|
-
}
|
|
112
|
-
const size = this.readInt32();
|
|
113
|
-
const array = new Array();
|
|
114
|
-
for (let i = 0; i < size; ++i) {
|
|
115
|
-
array.push(await this.deserialize(itemType));
|
|
116
|
-
}
|
|
117
|
-
return array;
|
|
118
|
-
}, _TLReader_deserializePrimitive = function _TLReader_deserializePrimitive(type) {
|
|
119
|
-
switch (type) {
|
|
120
|
-
case "bytes":
|
|
121
|
-
return this.readBytes();
|
|
122
|
-
case "int128":
|
|
123
|
-
return this.readInt128();
|
|
124
|
-
case "int256":
|
|
125
|
-
return this.readInt256();
|
|
126
|
-
case "double":
|
|
127
|
-
return this.readDouble();
|
|
128
|
-
case "long":
|
|
129
|
-
return this.readInt64();
|
|
130
|
-
case "true":
|
|
131
|
-
return true;
|
|
132
|
-
case "int":
|
|
133
|
-
return this.readInt32();
|
|
134
|
-
case "Bool": {
|
|
135
|
-
const id = this.readInt32(false);
|
|
136
|
-
if (id == _1_utilities_js_2.BOOL_TRUE) {
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
else if (id == _1_utilities_js_2.BOOL_FALSE) {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
(0, _0_deps_js_1.unreachable)(`expected boolTrue or boolFalse but got ${id}`);
|
|
144
|
-
}
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
case "string":
|
|
148
|
-
return this.readString();
|
|
149
|
-
}
|
|
150
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"2_tl_reader_test.d.ts","sourceRoot":"","sources":["../../src/tl/2_tl_reader_test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"2_tl_writer.d.ts","sourceRoot":"","sources":["../../src/tl/2_tl_writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,SAAS,EAAoB,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD,qBAAa,QAAS,SAAQ,WAAW;;IACvC,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,IAAI;CAqLzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"2_tl_writer_test.d.ts","sourceRoot":"","sources":["../../src/tl/2_tl_writer_test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"2_utilities.d.ts","sourceRoot":"","sources":["../../src/tl/2_utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAGlC,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1D;AAGD,MAAM,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,gBAAgB,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,aAAa,CAAC;AAErG,MAAM,MAAM,uBAAuB,GAAG,GAAG,CAAC,aAAa,GAAG,GAAG,CAAC,aAAa,GAAG,GAAG,CAAC,gBAAgB,GAAG,GAAG,CAAC,wBAAwB,GAAG,GAAG,CAAC,2BAA2B,CAAC;AAEpK,MAAM,MAAM,mBAAmB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAErG,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,uBAAuB,GAAG,GAAG,CAAC,IAAI,GAAG,mBAAmB,GAAG,MAAM,CAU/G;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,IAAI,CAQrD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAWrD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAQ7E;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,IAAI,CAUlE"}
|
package/script/tl/2_utilities.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-2025 Roj <https://roj.im/>
|
|
5
|
-
*
|
|
6
|
-
* This file is part of MTKruto.
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
-
* (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Lesser General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
-
*/
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.getChannelChatId = getChannelChatId;
|
|
23
|
-
exports.peerToChatId = peerToChatId;
|
|
24
|
-
exports.chatIdToPeer = chatIdToPeer;
|
|
25
|
-
exports.chatIdToPeerId = chatIdToPeerId;
|
|
26
|
-
exports.getChatIdPeerType = getChatIdPeerType;
|
|
27
|
-
exports.inputPeerToPeer = inputPeerToPeer;
|
|
28
|
-
const _0_deps_js_1 = require("../0_deps.js");
|
|
29
|
-
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
30
|
-
const _1_utilities_js_2 = require("./1_utilities.js");
|
|
31
|
-
function getChannelChatId(channelId) {
|
|
32
|
-
return _1_utilities_js_1.ZERO_CHANNEL_ID + -Number(channelId);
|
|
33
|
-
}
|
|
34
|
-
function peerToChatId(peer) {
|
|
35
|
-
if ((0, _1_utilities_js_2.isOneOf)(["peerUser", "inputPeerUser", "inputPeerUserFromMessage", "user", "userFull"], peer) || "user_id" in peer) {
|
|
36
|
-
return Number("user_id" in peer ? peer.user_id : peer.id);
|
|
37
|
-
}
|
|
38
|
-
else if ("chat_id" in peer || (0, _1_utilities_js_2.isOneOf)(["peerChat", "inputPeerChat", "chat", "chatForbidden", "chatFull"], peer)) {
|
|
39
|
-
return -Number("chat_id" in peer ? peer.chat_id : peer.id);
|
|
40
|
-
}
|
|
41
|
-
else if ("channel_id" in peer || (0, _1_utilities_js_2.isOneOf)(["peerChannel", "inputPeerChannel", "inputPeerChannelFromMessage", "channel", "channelForbidden", "channelFull"], peer)) {
|
|
42
|
-
return getChannelChatId("channel_id" in peer ? peer.channel_id : peer.id);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
(0, _0_deps_js_1.unreachable)();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
function chatIdToPeer(chatId) {
|
|
49
|
-
if (chatId > 0) {
|
|
50
|
-
return { _: "peerUser", user_id: BigInt(chatId) };
|
|
51
|
-
}
|
|
52
|
-
else if (chatId > _1_utilities_js_1.ZERO_CHANNEL_ID) {
|
|
53
|
-
return { _: "peerChat", chat_id: BigInt(Math.abs(chatId)) };
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
return { _: "peerChannel", channel_id: BigInt(_1_utilities_js_1.ZERO_CHANNEL_ID - chatId) };
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function chatIdToPeerId(chatId) {
|
|
60
|
-
const peer = chatIdToPeer(chatId);
|
|
61
|
-
if ("user_id" in peer) {
|
|
62
|
-
return peer.user_id;
|
|
63
|
-
}
|
|
64
|
-
else if ("chat_id" in peer) {
|
|
65
|
-
return peer.chat_id;
|
|
66
|
-
}
|
|
67
|
-
else if ("channel_id" in peer) {
|
|
68
|
-
return peer.channel_id;
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
(0, _0_deps_js_1.unreachable)();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function getChatIdPeerType(chatId) {
|
|
75
|
-
if (chatId > 0) {
|
|
76
|
-
return "user";
|
|
77
|
-
}
|
|
78
|
-
else if (chatId > _1_utilities_js_1.ZERO_CHANNEL_ID) {
|
|
79
|
-
return "chat";
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
return "channel";
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function inputPeerToPeer(inputPeer) {
|
|
86
|
-
if ("user_id" in inputPeer) {
|
|
87
|
-
return { ...inputPeer, _: "peerUser" };
|
|
88
|
-
}
|
|
89
|
-
else if ("chat_id" in inputPeer) {
|
|
90
|
-
return { ...inputPeer, _: "peerChat" };
|
|
91
|
-
}
|
|
92
|
-
else if ("channel_id" in inputPeer) {
|
|
93
|
-
return { ...inputPeer, _: "peerChannel" };
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
(0, _0_deps_js_1.unreachable)();
|
|
97
|
-
}
|
|
98
|
-
}
|