@mtkruto/node 0.1.191 → 0.1.201
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/1_utilities.d.ts +1 -1
- package/esm/1_utilities.js +1 -1
- package/esm/2_tl.d.ts +6 -6
- package/esm/2_tl.js +6 -6
- package/esm/3_storage.d.ts +5 -5
- package/esm/3_storage.js +5 -5
- package/esm/3_types.d.ts +6 -5
- package/esm/3_types.js +6 -5
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_params.d.ts +7 -1
- package/esm/client/0_types.d.ts +1 -0
- package/esm/client/0_utilities.d.ts +0 -3
- package/esm/client/0_utilities.js +0 -20
- package/esm/client/1_business_connection_manager.d.ts +11 -0
- package/esm/client/1_business_connection_manager.js +47 -0
- package/esm/client/1_update_manager.d.ts +8 -1
- package/esm/client/1_update_manager.js +88 -8
- package/esm/client/2_message_manager.d.ts +7 -6
- package/esm/client/2_message_manager.js +48 -31
- package/esm/client/4_client.d.ts +426 -428
- package/esm/client/4_client.js +570 -530
- package/esm/storage/0_storage.d.ts +5 -0
- package/esm/storage/0_storage.js +20 -0
- package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
- package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
- package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
- package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
- package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
- package/esm/tl/2_types.d.ts +1071 -183
- package/esm/tl/2_types.js +2916 -464
- package/esm/tl/3_functions.d.ts +381 -17
- package/esm/tl/3_functions.js +1002 -120
- package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
- package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
- package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
- package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/esm/tl/{6_message.js → 7_message.js} +3 -3
- package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
- package/esm/types/0_chat_photo.js +1 -1
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_photo.js +2 -2
- package/esm/types/1_story_privacy.d.ts +1 -1
- package/esm/types/2_business_connection.d.ts +11 -0
- package/esm/types/2_business_connection.js +12 -0
- package/esm/types/2_chat_member.d.ts +1 -1
- package/esm/types/2_chosen_inline_result.d.ts +1 -1
- package/esm/types/2_game.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_invite_link.d.ts +1 -1
- package/esm/types/2_message_reaction_count.d.ts +1 -1
- package/esm/types/2_message_reactions.d.ts +1 -1
- package/esm/types/2_story_content.js +1 -1
- package/esm/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
- package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
- package/esm/types/3_chat_member_updated.d.ts +1 -1
- package/esm/types/3_reply_markup.d.ts +1 -1
- package/esm/types/3_story.d.ts +2 -2
- package/esm/types/3_story.js +1 -1
- package/esm/types/4_inline_query_result.d.ts +1 -1
- package/esm/types/4_inline_query_result.js +1 -1
- package/esm/types/4_message.d.ts +9 -3
- package/esm/types/4_message.js +22 -5
- package/esm/types/5_callback_query.d.ts +1 -1
- package/esm/types/5_chat.d.ts +1 -1
- package/esm/types/6_update.d.ts +12 -2
- package/package.json +1 -1
- package/script/1_utilities.d.ts +1 -1
- package/script/1_utilities.js +1 -1
- package/script/2_tl.d.ts +6 -6
- package/script/2_tl.js +6 -6
- package/script/3_storage.d.ts +5 -5
- package/script/3_storage.js +5 -5
- package/script/3_types.d.ts +6 -5
- package/script/3_types.js +6 -5
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_params.d.ts +7 -1
- package/script/client/0_types.d.ts +1 -0
- package/script/client/0_utilities.d.ts +0 -3
- package/script/client/0_utilities.js +1 -23
- package/script/client/1_business_connection_manager.d.ts +11 -0
- package/script/client/1_business_connection_manager.js +51 -0
- package/script/client/1_update_manager.d.ts +8 -1
- package/script/client/1_update_manager.js +88 -8
- package/script/client/2_message_manager.d.ts +7 -6
- package/script/client/2_message_manager.js +47 -30
- package/script/client/4_client.d.ts +426 -428
- package/script/client/4_client.js +570 -530
- package/script/storage/0_storage.d.ts +5 -0
- package/script/storage/0_storage.js +20 -0
- package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
- package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
- package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
- package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
- package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
- package/script/tl/2_types.d.ts +1071 -183
- package/script/tl/2_types.js +3028 -504
- package/script/tl/3_functions.d.ts +381 -17
- package/script/tl/3_functions.js +1047 -143
- package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
- package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
- package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
- package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/script/tl/{6_message.js → 7_message.js} +8 -8
- package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
- package/script/types/0_chat_photo.js +9 -9
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_thumbnail.js +6 -6
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_photo.js +7 -7
- package/script/types/1_story_privacy.d.ts +1 -1
- package/script/types/2_business_connection.d.ts +11 -0
- package/script/types/2_business_connection.js +16 -0
- package/script/types/2_chat_member.d.ts +1 -1
- package/script/types/2_chosen_inline_result.d.ts +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_invite_link.d.ts +1 -1
- package/script/types/2_message_reaction_count.d.ts +1 -1
- package/script/types/2_message_reactions.d.ts +1 -1
- package/script/types/2_story_content.js +4 -4
- package/script/types/{1_story_interactive_area.d.ts → 2_story_interactive_area.d.ts} +2 -2
- package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
- package/script/types/3_chat_member_updated.d.ts +1 -1
- package/script/types/3_reply_markup.d.ts +1 -1
- package/script/types/3_story.d.ts +2 -2
- package/script/types/3_story.js +2 -2
- package/script/types/4_inline_query_result.d.ts +1 -1
- package/script/types/4_inline_query_result.js +2 -2
- package/script/types/4_message.d.ts +9 -3
- package/script/types/4_message.js +37 -20
- package/script/types/5_callback_query.d.ts +1 -1
- package/script/types/5_chat.d.ts +1 -1
- package/script/types/6_update.d.ts +12 -2
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -203
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -274
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -51
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -191
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -385
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -431
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1046
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -52
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -122
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -24
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -121
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -30
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2127
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -108
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -1
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -95
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -128
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -120
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -6
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -110
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -75
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/esm/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -101
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.d.ts +0 -83
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomHandler.js +0 -207
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/DomSerializer.js +0 -301
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.d.ts +0 -47
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/ElementType.js +0 -55
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.d.ts +0 -66
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/FeedHandler.js +0 -222
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.d.ts +0 -168
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Node.js +0 -404
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.d.ts +0 -159
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Parser.js +0 -438
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.d.ts +0 -181
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/Tokenizer.js +0 -1052
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/mod.js +0 -88
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.d.ts +0 -11
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode.js +0 -128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.d.ts +0 -1
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/decode_codepoint.js +0 -30
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/encode.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.d.ts +0 -31
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/decode.js +0 -32
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.d.ts +0 -2128
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/entities.js +0 -2129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.d.ts +0 -109
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/legacy.js +0 -110
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.d.ts +0 -8
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/maps/xml.js +0 -3
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.d.ts +0 -90
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.js +0 -114
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.d.ts +0 -50
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/helpers.js +0 -134
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.d.ts +0 -46
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/legacy.js +0 -118
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.d.ts +0 -42
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/manipulation.js +0 -129
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.d.ts +0 -6
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/mod.js +0 -22
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.d.ts +0 -54
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/querying.js +0 -119
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.d.ts +0 -40
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/stringify.js +0 -86
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.d.ts +0 -58
- package/script/deps/deno.land/x/html_parser@v0.1.3/src/utils/traversal.js +0 -112
- /package/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
- /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/esm/types/{0__file_id.js → _file_id.js} +0 -0
- /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/esm/types/{1__getters.js → _getters.js} +0 -0
- /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/script/types/{0_venue.js → 1_venue.js} +0 -0
- /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/script/types/{0__file_id.js → _file_id.js} +0 -0
- /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/script/types/{1__getters.js → _getters.js} +0 -0
package/esm/1_utilities.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from "./utilities/1_base64.js";
|
|
2
1
|
export * from "./utilities/0_bigint.js";
|
|
3
2
|
export * from "./utilities/0_buffer.js";
|
|
4
3
|
export * from "./utilities/0_cache_map.js";
|
|
@@ -12,5 +11,6 @@ export * from "./utilities/0_object.js";
|
|
|
12
11
|
export * from "./utilities/0_rle.js";
|
|
13
12
|
export * from "./utilities/0_types.js";
|
|
14
13
|
export * from "./utilities/1_auth.js";
|
|
14
|
+
export * from "./utilities/1_base64.js";
|
|
15
15
|
export * from "./utilities/1_misc.js";
|
|
16
16
|
export * from "./utilities/1_queue.js";
|
package/esm/1_utilities.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from "./utilities/1_base64.js";
|
|
2
1
|
export * from "./utilities/0_bigint.js";
|
|
3
2
|
export * from "./utilities/0_buffer.js";
|
|
4
3
|
export * from "./utilities/0_cache_map.js";
|
|
@@ -12,5 +11,6 @@ export * from "./utilities/0_object.js";
|
|
|
12
11
|
export * from "./utilities/0_rle.js";
|
|
13
12
|
export * from "./utilities/0_types.js";
|
|
14
13
|
export * from "./utilities/1_auth.js";
|
|
14
|
+
export * from "./utilities/1_base64.js";
|
|
15
15
|
export * from "./utilities/1_misc.js";
|
|
16
16
|
export * from "./utilities/1_queue.js";
|
package/esm/2_tl.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { TLError } from "./tl/0_tl_raw_reader.js";
|
|
2
2
|
export * from "./tl/1_tl_object.js";
|
|
3
3
|
export { type enums, types } from "./tl/2_types.js";
|
|
4
|
-
export { functions } from "./tl/3_functions.js";
|
|
5
|
-
export * from "./tl/3_tl_reader.js";
|
|
6
4
|
export * from "./tl/3_utilities.js";
|
|
7
|
-
export
|
|
8
|
-
export * from "./tl/
|
|
9
|
-
export * from "./tl/
|
|
10
|
-
export * from "./tl/
|
|
5
|
+
export { functions } from "./tl/3_functions.js";
|
|
6
|
+
export * from "./tl/4_tl_reader.js";
|
|
7
|
+
export * from "./tl/5_tl_writer.js";
|
|
8
|
+
export * from "./tl/6_rpc_result.js";
|
|
9
|
+
export * from "./tl/7_message.js";
|
|
10
|
+
export * from "./tl/8_message_container.js";
|
package/esm/2_tl.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { TLError } from "./tl/0_tl_raw_reader.js";
|
|
2
2
|
export * from "./tl/1_tl_object.js";
|
|
3
3
|
export { types } from "./tl/2_types.js";
|
|
4
|
-
export { functions } from "./tl/3_functions.js";
|
|
5
|
-
export * from "./tl/3_tl_reader.js";
|
|
6
4
|
export * from "./tl/3_utilities.js";
|
|
7
|
-
export
|
|
8
|
-
export * from "./tl/
|
|
9
|
-
export * from "./tl/
|
|
10
|
-
export * from "./tl/
|
|
5
|
+
export { functions } from "./tl/3_functions.js";
|
|
6
|
+
export * from "./tl/4_tl_reader.js";
|
|
7
|
+
export * from "./tl/5_tl_writer.js";
|
|
8
|
+
export * from "./tl/6_rpc_result.js";
|
|
9
|
+
export * from "./tl/7_message.js";
|
|
10
|
+
export * from "./tl/8_message_container.js";
|
package/esm/3_storage.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./storage/0_storage.js";
|
|
2
|
-
export * from "./storage/
|
|
3
|
-
export * from "./storage/
|
|
4
|
-
export * from "./storage/
|
|
5
|
-
export * from "./storage/
|
|
6
|
-
export * from "./storage/
|
|
2
|
+
export * from "./storage/1_utilities.js";
|
|
3
|
+
export * from "./storage/2_storage_indexed_db.js";
|
|
4
|
+
export * from "./storage/2_storage_local_storage.js";
|
|
5
|
+
export * from "./storage/2_storage_memory.js";
|
|
6
|
+
export * from "./storage/2_storage_session_storage.js";
|
package/esm/3_storage.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./storage/0_storage.js";
|
|
2
|
-
export * from "./storage/
|
|
3
|
-
export * from "./storage/
|
|
4
|
-
export * from "./storage/
|
|
5
|
-
export * from "./storage/
|
|
6
|
-
export * from "./storage/
|
|
2
|
+
export * from "./storage/1_utilities.js";
|
|
3
|
+
export * from "./storage/2_storage_indexed_db.js";
|
|
4
|
+
export * from "./storage/2_storage_local_storage.js";
|
|
5
|
+
export * from "./storage/2_storage_memory.js";
|
|
6
|
+
export * from "./storage/2_storage_session_storage.js";
|
package/esm/3_types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from "./types/_file_id.js";
|
|
2
|
+
export * from "./types/_getters.js";
|
|
1
3
|
export * from "./types/0_authorization_state.js";
|
|
2
4
|
export * from "./types/0_bot_command.js";
|
|
3
5
|
export * from "./types/0_chat_action.js";
|
|
@@ -7,7 +9,6 @@ export * from "./types/0_chat_photo.js";
|
|
|
7
9
|
export * from "./types/0_connection_state.js";
|
|
8
10
|
export * from "./types/0_contact.js";
|
|
9
11
|
export * from "./types/0_dice.js";
|
|
10
|
-
export * from "./types/0__file_id.js";
|
|
11
12
|
export * from "./types/0_file_source.js";
|
|
12
13
|
export * from "./types/0_giveaway_parameters.js";
|
|
13
14
|
export * from "./types/0_id.js";
|
|
@@ -28,14 +29,12 @@ export * from "./types/0_reaction.js";
|
|
|
28
29
|
export * from "./types/0_restriction_reason.js";
|
|
29
30
|
export * from "./types/0_story_reference.js";
|
|
30
31
|
export * from "./types/0_thumbnail.js";
|
|
31
|
-
export * from "./types/0_venue.js";
|
|
32
32
|
export * from "./types/0_voice.js";
|
|
33
33
|
export * from "./types/1_animation.js";
|
|
34
34
|
export * from "./types/1_audio.js";
|
|
35
35
|
export * from "./types/1_bot_command_scope.js";
|
|
36
36
|
export * from "./types/1_chat_p.js";
|
|
37
37
|
export * from "./types/1_document.js";
|
|
38
|
-
export * from "./types/1__getters.js";
|
|
39
38
|
export * from "./types/1_giveaway.js";
|
|
40
39
|
export * from "./types/1_inline_query_result_button.js";
|
|
41
40
|
export * from "./types/1_input_message_content.js";
|
|
@@ -48,12 +47,13 @@ export * from "./types/1_poll.js";
|
|
|
48
47
|
export * from "./types/1_reaction_count.js";
|
|
49
48
|
export * from "./types/1_reply_quote.js";
|
|
50
49
|
export * from "./types/1_sticker.js";
|
|
51
|
-
export * from "./types/1_story_interactive_area.js";
|
|
52
50
|
export * from "./types/1_story_privacy.js";
|
|
53
51
|
export * from "./types/1_story_reaction.js";
|
|
54
52
|
export * from "./types/1_user.js";
|
|
55
|
-
export * from "./types/
|
|
53
|
+
export * from "./types/1_venue.js";
|
|
56
54
|
export * from "./types/1_video.js";
|
|
55
|
+
export * from "./types/1_video_note.js";
|
|
56
|
+
export * from "./types/2_business_connection.js";
|
|
57
57
|
export * from "./types/2_chat_member.js";
|
|
58
58
|
export * from "./types/2_chosen_inline_result.js";
|
|
59
59
|
export * from "./types/2_game.js";
|
|
@@ -66,6 +66,7 @@ export * from "./types/2_message_reaction_count.js";
|
|
|
66
66
|
export * from "./types/2_message_reactions.js";
|
|
67
67
|
export * from "./types/2_story_content.js";
|
|
68
68
|
export * from "./types/2_story_interactions.js";
|
|
69
|
+
export * from "./types/2_story_interactive_area.js";
|
|
69
70
|
export * from "./types/3_chat_member_updated.js";
|
|
70
71
|
export * from "./types/3_reply_markup.js";
|
|
71
72
|
export * from "./types/3_story.js";
|
package/esm/3_types.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from "./types/_file_id.js";
|
|
2
|
+
export * from "./types/_getters.js";
|
|
1
3
|
export * from "./types/0_authorization_state.js";
|
|
2
4
|
export * from "./types/0_bot_command.js";
|
|
3
5
|
export * from "./types/0_chat_action.js";
|
|
@@ -7,7 +9,6 @@ export * from "./types/0_chat_photo.js";
|
|
|
7
9
|
export * from "./types/0_connection_state.js";
|
|
8
10
|
export * from "./types/0_contact.js";
|
|
9
11
|
export * from "./types/0_dice.js";
|
|
10
|
-
export * from "./types/0__file_id.js";
|
|
11
12
|
export * from "./types/0_file_source.js";
|
|
12
13
|
export * from "./types/0_giveaway_parameters.js";
|
|
13
14
|
export * from "./types/0_id.js";
|
|
@@ -28,14 +29,12 @@ export * from "./types/0_reaction.js";
|
|
|
28
29
|
export * from "./types/0_restriction_reason.js";
|
|
29
30
|
export * from "./types/0_story_reference.js";
|
|
30
31
|
export * from "./types/0_thumbnail.js";
|
|
31
|
-
export * from "./types/0_venue.js";
|
|
32
32
|
export * from "./types/0_voice.js";
|
|
33
33
|
export * from "./types/1_animation.js";
|
|
34
34
|
export * from "./types/1_audio.js";
|
|
35
35
|
export * from "./types/1_bot_command_scope.js";
|
|
36
36
|
export * from "./types/1_chat_p.js";
|
|
37
37
|
export * from "./types/1_document.js";
|
|
38
|
-
export * from "./types/1__getters.js";
|
|
39
38
|
export * from "./types/1_giveaway.js";
|
|
40
39
|
export * from "./types/1_inline_query_result_button.js";
|
|
41
40
|
export * from "./types/1_input_message_content.js";
|
|
@@ -48,12 +47,13 @@ export * from "./types/1_poll.js";
|
|
|
48
47
|
export * from "./types/1_reaction_count.js";
|
|
49
48
|
export * from "./types/1_reply_quote.js";
|
|
50
49
|
export * from "./types/1_sticker.js";
|
|
51
|
-
export * from "./types/1_story_interactive_area.js";
|
|
52
50
|
export * from "./types/1_story_privacy.js";
|
|
53
51
|
export * from "./types/1_story_reaction.js";
|
|
54
52
|
export * from "./types/1_user.js";
|
|
55
|
-
export * from "./types/
|
|
53
|
+
export * from "./types/1_venue.js";
|
|
56
54
|
export * from "./types/1_video.js";
|
|
55
|
+
export * from "./types/1_video_note.js";
|
|
56
|
+
export * from "./types/2_business_connection.js";
|
|
57
57
|
export * from "./types/2_chat_member.js";
|
|
58
58
|
export * from "./types/2_chosen_inline_result.js";
|
|
59
59
|
export * from "./types/2_game.js";
|
|
@@ -66,6 +66,7 @@ export * from "./types/2_message_reaction_count.js";
|
|
|
66
66
|
export * from "./types/2_message_reactions.js";
|
|
67
67
|
export * from "./types/2_story_content.js";
|
|
68
68
|
export * from "./types/2_story_interactions.js";
|
|
69
|
+
export * from "./types/2_story_interactive_area.js";
|
|
69
70
|
export * from "./types/3_chat_member_updated.js";
|
|
70
71
|
export * from "./types/3_reply_markup.js";
|
|
71
72
|
export * from "./types/3_story.js";
|
package/esm/4_constants.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { DC } from "./3_transport.js";
|
|
|
2
2
|
export type PublicKeys = readonly [bigint, [bigint, bigint]][];
|
|
3
3
|
export declare const PUBLIC_KEYS: PublicKeys;
|
|
4
4
|
export declare const INITIAL_DC: DC;
|
|
5
|
-
export declare const LAYER =
|
|
6
|
-
export declare const APP_VERSION = "MTKruto
|
|
5
|
+
export declare const LAYER = 177;
|
|
6
|
+
export declare const APP_VERSION = "MTKruto";
|
|
7
7
|
export declare const DEVICE_MODEL: string;
|
|
8
8
|
export declare const LANG_CODE: string;
|
|
9
9
|
export declare const LANG_PACK = "";
|
package/esm/4_constants.js
CHANGED
|
@@ -51,8 +51,8 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
51
51
|
],
|
|
52
52
|
]);
|
|
53
53
|
export const INITIAL_DC = "2";
|
|
54
|
-
export const LAYER =
|
|
55
|
-
export const APP_VERSION = "MTKruto
|
|
54
|
+
export const LAYER = 177;
|
|
55
|
+
export const APP_VERSION = "MTKruto";
|
|
56
56
|
// @ts-ignore: lib
|
|
57
57
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : (navigator.userAgent.split(" ")[0] || "Unknown") : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
58
58
|
export const LANG_CODE = typeof navigator === "undefined" || typeof navigator.language !== "string" ? "en" : navigator.language.split("-")[0];
|
package/esm/5_client.d.ts
CHANGED
package/esm/5_client.js
CHANGED
package/esm/client/0_params.d.ts
CHANGED
|
@@ -15,7 +15,10 @@ export interface AuthorizeUserParams<S = string> {
|
|
|
15
15
|
code: S | (() => MaybePromise<S>);
|
|
16
16
|
password: S | ((hint: string | null) => MaybePromise<S>);
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface _BusinessConnectionIdCommon {
|
|
19
|
+
businessConnectionId?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface _SendCommon extends _BusinessConnectionIdCommon {
|
|
19
22
|
/** Whether to send the message in a silent way without making a sound on the recipients' clients. */
|
|
20
23
|
disableNotification?: boolean;
|
|
21
24
|
/** Whether to protect the contents of the message from copying and forwarding. */
|
|
@@ -39,6 +42,9 @@ export interface SendMessageParams extends _SendCommon {
|
|
|
39
42
|
/** The message's link preview. */
|
|
40
43
|
linkPreview?: LinkPreview;
|
|
41
44
|
}
|
|
45
|
+
export interface SendChatActionParams extends _BusinessConnectionIdCommon {
|
|
46
|
+
messageThreadId?: number;
|
|
47
|
+
}
|
|
42
48
|
export interface EditMessageParams {
|
|
43
49
|
/** The parse mode to use. If not provided, the default parse mode will be used. */
|
|
44
50
|
parseMode?: ParseMode;
|
package/esm/client/0_types.d.ts
CHANGED
|
@@ -40,5 +40,6 @@ export interface C {
|
|
|
40
40
|
ignoreOutgoing: boolean | null;
|
|
41
41
|
cdn: boolean;
|
|
42
42
|
dropPendingUpdates?: boolean;
|
|
43
|
+
invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, businessConnectionId: string | undefined): Promise<T extends functions.Function<unknown> ? T["__R"] : void>;
|
|
43
44
|
}
|
|
44
45
|
export {};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { enums, types } from "../2_tl.js";
|
|
2
1
|
import { FileSource } from "../3_types.js";
|
|
3
2
|
export declare const resolve: () => Promise<void>;
|
|
4
|
-
export declare function isPtsUpdate(v: enums.Update): v is types.UpdateNewMessage | types.UpdateDeleteMessages | types.UpdateReadHistoryInbox | types.UpdateReadHistoryOutbox | types.UpdatePinnedChannelMessages | types.UpdatePinnedMessages | types.UpdateFolderPeers | types.UpdateChannelWebPage | types.UpdateEditMessage | types.UpdateReadMessagesContents | types.UpdateWebPage;
|
|
5
|
-
export declare function isChannelPtsUpdate(v: enums.Update | enums.Updates): v is types.UpdateNewChannelMessage | types.UpdateEditChannelMessage | types.UpdateDeleteChannelMessages | types.UpdateChannelTooLong;
|
|
6
3
|
export declare function getFileContents(source: FileSource, fileName?: string): Promise<readonly [Uint8Array, string]>;
|
|
7
4
|
export declare function isHttpUrl(string: string): boolean;
|
|
8
5
|
export declare function getUsername(string: string): string;
|
|
@@ -2,27 +2,7 @@ import * as dntShim from "../_dnt.shims.js";
|
|
|
2
2
|
import { path } from "../0_deps.js";
|
|
3
3
|
import { InputError } from "../0_errors.js";
|
|
4
4
|
import { UNREACHABLE } from "../1_utilities.js";
|
|
5
|
-
import { types } from "../2_tl.js";
|
|
6
5
|
export const resolve = () => Promise.resolve();
|
|
7
|
-
export function isPtsUpdate(v) {
|
|
8
|
-
return v instanceof types.UpdateNewMessage ||
|
|
9
|
-
v instanceof types.UpdateDeleteMessages ||
|
|
10
|
-
v instanceof types.UpdateReadHistoryInbox ||
|
|
11
|
-
v instanceof types.UpdateReadHistoryOutbox ||
|
|
12
|
-
v instanceof types.UpdatePinnedChannelMessages ||
|
|
13
|
-
v instanceof types.UpdatePinnedMessages ||
|
|
14
|
-
v instanceof types.UpdateFolderPeers ||
|
|
15
|
-
v instanceof types.UpdateChannelWebPage ||
|
|
16
|
-
v instanceof types.UpdateEditMessage ||
|
|
17
|
-
v instanceof types.UpdateReadMessagesContents ||
|
|
18
|
-
v instanceof types.UpdateWebPage;
|
|
19
|
-
}
|
|
20
|
-
export function isChannelPtsUpdate(v) {
|
|
21
|
-
return v instanceof types.UpdateNewChannelMessage ||
|
|
22
|
-
v instanceof types.UpdateEditChannelMessage ||
|
|
23
|
-
v instanceof types.UpdateDeleteChannelMessages ||
|
|
24
|
-
v instanceof types.UpdateChannelTooLong;
|
|
25
|
-
}
|
|
26
6
|
export async function getFileContents(source, fileName = "") {
|
|
27
7
|
fileName = fileName.trim() || "file";
|
|
28
8
|
let contents;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { enums, types } from "../2_tl.js";
|
|
2
|
+
import { Update } from "../3_types.js";
|
|
3
|
+
import { C } from "./0_types.js";
|
|
4
|
+
export type BusinessConnectionManagerUpdate = types.UpdateBotBusinessConnect;
|
|
5
|
+
export declare class BusinessConnectionManager {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(c: C);
|
|
8
|
+
getBusinessConnection(id: string): Promise<import("../3_types.js").BusinessConnection>;
|
|
9
|
+
static canHandleUpdate(update: enums.Update): update is BusinessConnectionManagerUpdate;
|
|
10
|
+
handleUpdate(update: BusinessConnectionManagerUpdate): Promise<Update>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
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");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _BusinessConnectionManager_c;
|
|
13
|
+
import { as, types } from "../2_tl.js";
|
|
14
|
+
import { constructBusinessConnection } from "../3_types.js";
|
|
15
|
+
export class BusinessConnectionManager {
|
|
16
|
+
constructor(c) {
|
|
17
|
+
_BusinessConnectionManager_c.set(this, void 0);
|
|
18
|
+
__classPrivateFieldSet(this, _BusinessConnectionManager_c, c, "f");
|
|
19
|
+
}
|
|
20
|
+
async getBusinessConnection(id) {
|
|
21
|
+
const connection_ = await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.getBusinessConnection(id);
|
|
22
|
+
if (!connection_) {
|
|
23
|
+
const connection_ = await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").api.account.getBotBusinessConnection({ connection_id: id })
|
|
24
|
+
.then((v) => v[as](types.Updates))
|
|
25
|
+
.then((v) => v.updates[0][as](types.UpdateBotBusinessConnect).connection);
|
|
26
|
+
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(id, connection_);
|
|
27
|
+
return await constructBusinessConnection(connection_, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return await constructBusinessConnection(connection_, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
static canHandleUpdate(update) {
|
|
34
|
+
return update instanceof types.UpdateBotBusinessConnect;
|
|
35
|
+
}
|
|
36
|
+
async handleUpdate(update) {
|
|
37
|
+
if (update.connection.disabled) {
|
|
38
|
+
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(update.connection.connection_id, null);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(update.connection.connection_id, update.connection);
|
|
42
|
+
}
|
|
43
|
+
const businessConnection = await constructBusinessConnection(update.connection, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
|
|
44
|
+
return { businessConnection };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
_BusinessConnectionManager_c = new WeakMap();
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { Queue } from "../1_utilities.js";
|
|
2
|
-
import { enums, ReadObject, TLObject } from "../2_tl.js";
|
|
2
|
+
import { enums, ReadObject, TLObject, types } from "../2_tl.js";
|
|
3
3
|
import { C } from "./0_types.js";
|
|
4
4
|
type UpdateHandler = (update: enums.Update) => Promise<(() => Promise<unknown>)>;
|
|
5
|
+
export type PtsUpdate = types.UpdateNewMessage | types.UpdateDeleteMessages | types.UpdateReadHistoryInbox | types.UpdateReadHistoryOutbox | types.UpdatePinnedChannelMessages | types.UpdatePinnedMessages | types.UpdateFolderPeers | types.UpdateChannelWebPage | types.UpdateEditMessage | types.UpdateReadMessagesContents | types.UpdateWebPage;
|
|
6
|
+
export type ChannelPtsUpdate = types.UpdateNewChannelMessage | types.UpdateEditChannelMessage | types.UpdateDeleteChannelMessages | types.UpdateChannelTooLong;
|
|
7
|
+
export type QtsUpdate = types.UpdateNewEncryptedMessage | types.UpdateMessagePollVote | types.UpdateBotStopped | types.UpdateChatParticipant | types.UpdateChannelParticipant | types.UpdateBotChatInviteRequester | types.UpdateBotChatBoost | types.UpdateBotMessageReaction | types.UpdateBotMessageReactions | types.UpdateBotBusinessConnect | types.UpdateBotNewBusinessMessage | types.UpdateBotEditBusinessMessage | types.UpdateBotDeleteBusinessMessage;
|
|
5
8
|
export declare class UpdateManager {
|
|
6
9
|
#private;
|
|
10
|
+
static readonly QTS_COUNT = 1;
|
|
7
11
|
static readonly MAIN_BOX_ID = 0n;
|
|
8
12
|
constructor(c: C);
|
|
13
|
+
static isPtsUpdate(v: enums.Update): v is PtsUpdate;
|
|
14
|
+
static isQtsUpdate(v: enums.Update): v is QtsUpdate;
|
|
15
|
+
static isChannelPtsUpdate(v: enums.Update | enums.Updates): v is ChannelPtsUpdate;
|
|
9
16
|
fetchState(source: string): Promise<void>;
|
|
10
17
|
processChats(chats: enums.Chat[]): Promise<void>;
|
|
11
18
|
processResult(result: ReadObject): Promise<void>;
|
|
@@ -9,11 +9,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
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");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _UpdateManager_instances, _a, _UpdateManager_c, _UpdateManager_updateState, _UpdateManager_updateHandler, _UpdateManager_LrecoverUpdateGap, _UpdateManager_LrecoverChannelUpdateGap, _UpdateManager_L$handleUpdate, _UpdateManager_L$processUpdates, _UpdateManager_LfetchState, _UpdateManager_defaultDropPendingUpdates, _UpdateManager_mustDropPendingUpdates, _UpdateManager_state, _UpdateManager_getState, _UpdateManager_setState, _UpdateManager_handleUpdateQueues, _UpdateManager_nonFirst, _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck, _UpdateManager_checkGap, _UpdateManager_checkChannelGap, _UpdateManager_channelUpdateQueues, _UpdateManager_processChannelPtsUpdateInner, _UpdateManager_queueUpdate, _UpdateManager_processChannelPtsUpdate, _UpdateManager_processPtsUpdateInner, _UpdateManager_ptsUpdateQueue, _UpdateManager_processPtsUpdate, _UpdateManager_processUpdatesQueue, _UpdateManager_processUpdates, _UpdateManager_setUpdateStateDate, _UpdateManager_setUpdatePts, _UpdateManager_getLocalState, _UpdateManager_recoverChannelUpdateGap, _UpdateManager_handleUpdatesSet, _UpdateManager_handleStoredUpdates, _UpdateManager_handleUpdate;
|
|
12
|
+
var _UpdateManager_instances, _a, _UpdateManager_c, _UpdateManager_updateState, _UpdateManager_updateHandler, _UpdateManager_LrecoverUpdateGap, _UpdateManager_LrecoverChannelUpdateGap, _UpdateManager_L$handleUpdate, _UpdateManager_L$processUpdates, _UpdateManager_LfetchState, _UpdateManager_defaultDropPendingUpdates, _UpdateManager_mustDropPendingUpdates, _UpdateManager_state, _UpdateManager_getState, _UpdateManager_setState, _UpdateManager_handleUpdateQueues, _UpdateManager_nonFirst, _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck, _UpdateManager_checkGap, _UpdateManager_checkGapQts, _UpdateManager_checkChannelGap, _UpdateManager_channelUpdateQueues, _UpdateManager_processChannelPtsUpdateInner, _UpdateManager_queueUpdate, _UpdateManager_processChannelPtsUpdate, _UpdateManager_processPtsUpdateInner, _UpdateManager_ptsUpdateQueue, _UpdateManager_processPtsUpdate, _UpdateManager_processQtsUpdateInner, _UpdateManager_qtsUpdateQueue, _UpdateManager_processQtsUpdate, _UpdateManager_processUpdatesQueue, _UpdateManager_processUpdates, _UpdateManager_setUpdateStateDate, _UpdateManager_setUpdatePts, _UpdateManager_setUpdateQts, _UpdateManager_getLocalState, _UpdateManager_recoverChannelUpdateGap, _UpdateManager_handleUpdatesSet, _UpdateManager_handleStoredUpdates, _UpdateManager_handleUpdate;
|
|
13
13
|
import { getLogger, Queue, UNREACHABLE, ZERO_CHANNEL_ID } from "../1_utilities.js";
|
|
14
14
|
import { as, functions, inputPeerToPeer, peerToChatId, types } from "../2_tl.js";
|
|
15
15
|
import { CHANNEL_DIFFERENCE_LIMIT_BOT, CHANNEL_DIFFERENCE_LIMIT_USER } from "../4_constants.js";
|
|
16
|
-
import { isChannelPtsUpdate, isPtsUpdate } from "./0_utilities.js";
|
|
17
16
|
export class UpdateManager {
|
|
18
17
|
constructor(c) {
|
|
19
18
|
_UpdateManager_instances.add(this);
|
|
@@ -31,6 +30,7 @@ export class UpdateManager {
|
|
|
31
30
|
_UpdateManager_nonFirst.set(this, new Set());
|
|
32
31
|
_UpdateManager_channelUpdateQueues.set(this, new Map());
|
|
33
32
|
_UpdateManager_ptsUpdateQueue.set(this, new Queue("ptsUpdate"));
|
|
33
|
+
_UpdateManager_qtsUpdateQueue.set(this, new Queue("qtsUpdate"));
|
|
34
34
|
_UpdateManager_processUpdatesQueue.set(this, new Queue("UpdateManager/processUpdates"));
|
|
35
35
|
_UpdateManager_handleUpdatesSet.set(this, new Set());
|
|
36
36
|
__classPrivateFieldSet(this, _UpdateManager_c, c, "f");
|
|
@@ -41,8 +41,49 @@ export class UpdateManager {
|
|
|
41
41
|
__classPrivateFieldSet(this, _UpdateManager_L$processUpdates, L.branch("#processUpdates"), "f");
|
|
42
42
|
__classPrivateFieldSet(this, _UpdateManager_LfetchState, L.branch("fetchState"), "f");
|
|
43
43
|
}
|
|
44
|
+
static isPtsUpdate(v) {
|
|
45
|
+
return v instanceof types.UpdateNewMessage ||
|
|
46
|
+
v instanceof types.UpdateDeleteMessages ||
|
|
47
|
+
v instanceof types.UpdateReadHistoryInbox ||
|
|
48
|
+
v instanceof types.UpdateReadHistoryOutbox ||
|
|
49
|
+
v instanceof types.UpdatePinnedChannelMessages ||
|
|
50
|
+
v instanceof types.UpdatePinnedMessages ||
|
|
51
|
+
v instanceof types.UpdateFolderPeers ||
|
|
52
|
+
v instanceof types.UpdateChannelWebPage ||
|
|
53
|
+
v instanceof types.UpdateEditMessage ||
|
|
54
|
+
v instanceof types.UpdateReadMessagesContents ||
|
|
55
|
+
v instanceof types.UpdateWebPage;
|
|
56
|
+
}
|
|
57
|
+
static isQtsUpdate(v) {
|
|
58
|
+
return v instanceof types.UpdateNewEncryptedMessage ||
|
|
59
|
+
v instanceof types.UpdateMessagePollVote ||
|
|
60
|
+
v instanceof types.UpdateBotStopped ||
|
|
61
|
+
v instanceof types.UpdateChatParticipant ||
|
|
62
|
+
v instanceof types.UpdateChannelParticipant ||
|
|
63
|
+
v instanceof types.UpdateBotChatInviteRequester ||
|
|
64
|
+
v instanceof types.UpdateBotChatBoost ||
|
|
65
|
+
v instanceof types.UpdateBotMessageReaction ||
|
|
66
|
+
v instanceof types.UpdateBotMessageReactions ||
|
|
67
|
+
v instanceof types.UpdateBotBusinessConnect ||
|
|
68
|
+
v instanceof types.UpdateBotNewBusinessMessage ||
|
|
69
|
+
v instanceof types.UpdateBotEditBusinessMessage ||
|
|
70
|
+
v instanceof types.UpdateBotDeleteBusinessMessage;
|
|
71
|
+
}
|
|
72
|
+
static isChannelPtsUpdate(v) {
|
|
73
|
+
return v instanceof types.UpdateNewChannelMessage ||
|
|
74
|
+
v instanceof types.UpdateEditChannelMessage ||
|
|
75
|
+
v instanceof types.UpdateDeleteChannelMessages ||
|
|
76
|
+
v instanceof types.UpdateChannelTooLong;
|
|
77
|
+
}
|
|
44
78
|
async fetchState(source) {
|
|
45
|
-
|
|
79
|
+
let state = await __classPrivateFieldGet(this, _UpdateManager_c, "f").api.updates.getState();
|
|
80
|
+
const difference = await __classPrivateFieldGet(this, _UpdateManager_c, "f").api.updates.getDifference(state);
|
|
81
|
+
if (difference instanceof types.updates.Difference) {
|
|
82
|
+
state = difference.state;
|
|
83
|
+
}
|
|
84
|
+
else if (difference instanceof types.updates.DifferenceSlice) {
|
|
85
|
+
state = difference.intermediate_state;
|
|
86
|
+
}
|
|
46
87
|
__classPrivateFieldSet(this, _UpdateManager_updateState, state, "f");
|
|
47
88
|
__classPrivateFieldGet(this, _UpdateManager_LfetchState, "f").debug(`state fetched [${source}]`);
|
|
48
89
|
if (await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_mustDropPendingUpdates).call(this)) {
|
|
@@ -237,7 +278,7 @@ export class UpdateManager {
|
|
|
237
278
|
__classPrivateFieldSet(this, _UpdateManager_updateHandler, handler, "f");
|
|
238
279
|
}
|
|
239
280
|
}
|
|
240
|
-
_a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState = new WeakMap(), _UpdateManager_updateHandler = new WeakMap(), _UpdateManager_LrecoverUpdateGap = new WeakMap(), _UpdateManager_LrecoverChannelUpdateGap = new WeakMap(), _UpdateManager_L$handleUpdate = new WeakMap(), _UpdateManager_L$processUpdates = new WeakMap(), _UpdateManager_LfetchState = new WeakMap(), _UpdateManager_defaultDropPendingUpdates = new WeakMap(), _UpdateManager_state = new WeakMap(), _UpdateManager_handleUpdateQueues = new WeakMap(), _UpdateManager_nonFirst = new WeakMap(), _UpdateManager_channelUpdateQueues = new WeakMap(), _UpdateManager_ptsUpdateQueue = new WeakMap(), _UpdateManager_processUpdatesQueue = new WeakMap(), _UpdateManager_handleUpdatesSet = new WeakMap(), _UpdateManager_instances = new WeakSet(), _UpdateManager_mustDropPendingUpdates = async function _UpdateManager_mustDropPendingUpdates() {
|
|
281
|
+
_a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState = new WeakMap(), _UpdateManager_updateHandler = new WeakMap(), _UpdateManager_LrecoverUpdateGap = new WeakMap(), _UpdateManager_LrecoverChannelUpdateGap = new WeakMap(), _UpdateManager_L$handleUpdate = new WeakMap(), _UpdateManager_L$processUpdates = new WeakMap(), _UpdateManager_LfetchState = new WeakMap(), _UpdateManager_defaultDropPendingUpdates = new WeakMap(), _UpdateManager_state = new WeakMap(), _UpdateManager_handleUpdateQueues = new WeakMap(), _UpdateManager_nonFirst = new WeakMap(), _UpdateManager_channelUpdateQueues = new WeakMap(), _UpdateManager_ptsUpdateQueue = new WeakMap(), _UpdateManager_qtsUpdateQueue = new WeakMap(), _UpdateManager_processUpdatesQueue = new WeakMap(), _UpdateManager_handleUpdatesSet = new WeakMap(), _UpdateManager_instances = new WeakSet(), _UpdateManager_mustDropPendingUpdates = async function _UpdateManager_mustDropPendingUpdates() {
|
|
241
282
|
if (typeof __classPrivateFieldGet(this, _UpdateManager_c, "f").dropPendingUpdates === "boolean") {
|
|
242
283
|
return __classPrivateFieldGet(this, _UpdateManager_c, "f").dropPendingUpdates;
|
|
243
284
|
}
|
|
@@ -274,7 +315,12 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
274
315
|
}, _UpdateManager_checkGap = async function _UpdateManager_checkGap(pts, ptsCount) {
|
|
275
316
|
const localState = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getLocalState).call(this);
|
|
276
317
|
if (localState.pts + ptsCount < pts) {
|
|
277
|
-
await this.recoverUpdateGap("processUpdates");
|
|
318
|
+
await this.recoverUpdateGap("processUpdates[pts]");
|
|
319
|
+
}
|
|
320
|
+
}, _UpdateManager_checkGapQts = async function _UpdateManager_checkGapQts(qts) {
|
|
321
|
+
const localState = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getLocalState).call(this);
|
|
322
|
+
if (localState.qts + _a.QTS_COUNT < qts) {
|
|
323
|
+
await this.recoverUpdateGap("processUpdates[qts]");
|
|
278
324
|
}
|
|
279
325
|
}, _UpdateManager_checkChannelGap = async function _UpdateManager_checkChannelGap(channelId, pts, ptsCount) {
|
|
280
326
|
let localPts = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getChannelPtsWithDropPendingUpdatesCheck).call(this, channelId);
|
|
@@ -346,11 +392,32 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
346
392
|
if (update.pts != 0) {
|
|
347
393
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdatePts).call(this, update.pts);
|
|
348
394
|
}
|
|
349
|
-
__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_queueUpdate).call(this, update,
|
|
395
|
+
__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_queueUpdate).call(this, update, 1n, false);
|
|
350
396
|
}, _UpdateManager_processPtsUpdate = function _UpdateManager_processPtsUpdate(update, checkGap) {
|
|
351
397
|
__classPrivateFieldGet(this, _UpdateManager_ptsUpdateQueue, "f").add(async () => {
|
|
352
398
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processPtsUpdateInner).call(this, update, checkGap);
|
|
353
399
|
});
|
|
400
|
+
}, _UpdateManager_processQtsUpdateInner = async function _UpdateManager_processQtsUpdateInner(update, checkGap) {
|
|
401
|
+
const localState = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getLocalState).call(this);
|
|
402
|
+
if (update.qts != 0) {
|
|
403
|
+
if (checkGap) {
|
|
404
|
+
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_checkGapQts).call(this, update.qts);
|
|
405
|
+
}
|
|
406
|
+
if (localState.qts + _a.QTS_COUNT > update.qts) {
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (__classPrivateFieldGet(this, _UpdateManager_c, "f").guaranteeUpdateDelivery) {
|
|
411
|
+
await __classPrivateFieldGet(this, _UpdateManager_c, "f").storage.setUpdate(_a.MAIN_BOX_ID, update);
|
|
412
|
+
}
|
|
413
|
+
if (update.qts != 0) {
|
|
414
|
+
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setUpdateQts).call(this, update.qts);
|
|
415
|
+
}
|
|
416
|
+
__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_queueUpdate).call(this, update, 0n, true);
|
|
417
|
+
}, _UpdateManager_processQtsUpdate = function _UpdateManager_processQtsUpdate(update, checkGap) {
|
|
418
|
+
__classPrivateFieldGet(this, _UpdateManager_qtsUpdateQueue, "f").add(async () => {
|
|
419
|
+
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processQtsUpdateInner).call(this, update, checkGap);
|
|
420
|
+
});
|
|
354
421
|
}, _UpdateManager_processUpdates = async function _UpdateManager_processUpdates(updates_, checkGap, call = null) {
|
|
355
422
|
/// First, individual updates (Update[1]) are extracted from Updates.[2]
|
|
356
423
|
///
|
|
@@ -498,12 +565,15 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
498
565
|
UNREACHABLE();
|
|
499
566
|
}
|
|
500
567
|
}
|
|
501
|
-
else if (isPtsUpdate(update)) {
|
|
568
|
+
else if (_a.isPtsUpdate(update)) {
|
|
502
569
|
__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processPtsUpdate).call(this, update, checkGap);
|
|
503
570
|
}
|
|
504
|
-
else if (isChannelPtsUpdate(update)) {
|
|
571
|
+
else if (_a.isChannelPtsUpdate(update)) {
|
|
505
572
|
__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processChannelPtsUpdate).call(this, update, checkGap);
|
|
506
573
|
}
|
|
574
|
+
else if (_a.isQtsUpdate(update)) {
|
|
575
|
+
__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_processQtsUpdate).call(this, update, checkGap);
|
|
576
|
+
}
|
|
507
577
|
else {
|
|
508
578
|
__classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_queueUpdate).call(this, update, 0n, false);
|
|
509
579
|
}
|
|
@@ -516,6 +586,10 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
516
586
|
const localState = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getLocalState).call(this);
|
|
517
587
|
localState.pts = pts;
|
|
518
588
|
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setState).call(this, localState);
|
|
589
|
+
}, _UpdateManager_setUpdateQts = async function _UpdateManager_setUpdateQts(qts) {
|
|
590
|
+
const localState = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getLocalState).call(this);
|
|
591
|
+
localState.qts = qts;
|
|
592
|
+
await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_setState).call(this, localState);
|
|
519
593
|
}, _UpdateManager_getLocalState = async function _UpdateManager_getLocalState() {
|
|
520
594
|
let localState = await __classPrivateFieldGet(this, _UpdateManager_instances, "m", _UpdateManager_getState).call(this);
|
|
521
595
|
if (!localState) {
|
|
@@ -623,6 +697,12 @@ _a = UpdateManager, _UpdateManager_c = new WeakMap(), _UpdateManager_updateState
|
|
|
623
697
|
return () => Promise.resolve();
|
|
624
698
|
}
|
|
625
699
|
};
|
|
700
|
+
Object.defineProperty(UpdateManager, "QTS_COUNT", {
|
|
701
|
+
enumerable: true,
|
|
702
|
+
configurable: true,
|
|
703
|
+
writable: true,
|
|
704
|
+
value: 1
|
|
705
|
+
});
|
|
626
706
|
Object.defineProperty(UpdateManager, "MAIN_BOX_ID", {
|
|
627
707
|
enumerable: true,
|
|
628
708
|
configurable: true,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { enums, types } from "../2_tl.js";
|
|
2
2
|
import { ChatAction, ChatMember, FileSource, FileType, ID, Message, MessageEntity, ParseMode, Reaction, Update, UsernameResolver } from "../3_types.js";
|
|
3
|
-
import { AddReactionParams, BanChatMemberParams, CreateInviteLinkParams, DeleteMessagesParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetCreatedInviteLinksParams, GetHistoryParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetReactionsParams, StopPollParams } from "./0_params.js";
|
|
3
|
+
import { AddReactionParams, BanChatMemberParams, CreateInviteLinkParams, DeleteMessagesParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetCreatedInviteLinksParams, GetHistoryParams, PinMessageParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendChatActionParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetReactionsParams, StopPollParams } from "./0_params.js";
|
|
4
4
|
import { C as C_ } from "./0_types.js";
|
|
5
5
|
import { FileManager } from "./1_file_manager.js";
|
|
6
6
|
interface C extends C_ {
|
|
7
7
|
fileManager: FileManager;
|
|
8
8
|
}
|
|
9
|
-
type MessageManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdateEditMessage | types.UpdateEditChannelMessage | types.UpdateDeleteMessages | types.UpdateDeleteChannelMessages | types.UpdateChannelParticipant | types.UpdateChatParticipant;
|
|
9
|
+
type MessageManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdateEditMessage | types.UpdateEditChannelMessage | types.UpdateBotNewBusinessMessage | types.UpdateBotEditBusinessMessage | types.UpdateBotDeleteBusinessMessage | types.UpdateDeleteMessages | types.UpdateDeleteChannelMessages | types.UpdateChannelParticipant | types.UpdateChatParticipant;
|
|
10
10
|
export declare class MessageManager {
|
|
11
11
|
#private;
|
|
12
12
|
constructor(c: C);
|
|
@@ -18,7 +18,10 @@ export declare class MessageManager {
|
|
|
18
18
|
parseMode?: ParseMode;
|
|
19
19
|
entities?: MessageEntity[];
|
|
20
20
|
}): Promise<readonly [string, enums.MessageEntity[] | undefined]>;
|
|
21
|
-
constructMessage(message_: enums.Message, r?: boolean
|
|
21
|
+
constructMessage(message_: enums.Message, r?: boolean, business?: {
|
|
22
|
+
connectionId: string;
|
|
23
|
+
replyToMessage?: enums.Message;
|
|
24
|
+
}): Promise<Message>;
|
|
22
25
|
forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise<Message[]>;
|
|
23
26
|
getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
|
|
24
27
|
usernameResolver: UsernameResolver;
|
|
@@ -56,9 +59,7 @@ export declare class MessageManager {
|
|
|
56
59
|
removeReaction(chatId: number, messageId: number, reaction: Reaction): Promise<void>;
|
|
57
60
|
static canHandleUpdate(update: enums.Update): update is MessageManagerUpdate;
|
|
58
61
|
handleUpdate(update: MessageManagerUpdate): Promise<Update | null>;
|
|
59
|
-
sendChatAction(chatId: ID, action: ChatAction, params?:
|
|
60
|
-
messageThreadId?: number;
|
|
61
|
-
}): Promise<void>;
|
|
62
|
+
sendChatAction(chatId: ID, action: ChatAction, params?: SendChatActionParams): Promise<void>;
|
|
62
63
|
deleteChatPhoto(chatId: number): Promise<void>;
|
|
63
64
|
setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
|
|
64
65
|
banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
|