@mtkruto/node 0.1.200 → 0.1.300
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/0_deps.d.ts +1 -1
- package/esm/0_deps.js +2 -1
- package/esm/1_utilities.d.ts +1 -1
- package/esm/1_utilities.js +1 -1
- package/esm/4_errors.js +3 -3
- package/esm/client/0_markdown.js +5 -5
- package/esm/client/0_utilities.d.ts +6 -0
- package/esm/client/0_utilities.js +35 -4
- package/esm/client/1_account_manager.js +4 -4
- package/esm/client/1_client_encrypted.js +4 -4
- package/esm/client/1_client_plain.js +3 -3
- package/esm/client/1_file_manager.js +6 -5
- package/esm/client/1_reaction_manager.js +2 -2
- package/esm/client/1_update_manager.js +9 -8
- package/esm/client/2_message_manager.js +47 -24
- package/esm/client/3_callback_query_manager.js +2 -0
- package/esm/client/3_chat_list_manager.js +13 -12
- package/esm/client/3_inline_query_manager.js +4 -2
- package/esm/client/3_story_manager.js +7 -5
- package/esm/client/4_client.d.ts +5 -8
- package/esm/client/4_client.js +19 -27
- package/esm/connection/1_connection_web_socket.js +3 -2
- package/{script/deps/deno.land/x/tgcrypto@0.3.3 → esm/deps/deno.land/x/tgcrypto@0.4.0}/mod.d.ts +0 -1
- package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.js +0 -11
- package/esm/deps/deno.land/x/tgcrypto@0.4.0/tgcrypto.js +308 -0
- package/esm/mod.d.ts +1 -1
- package/esm/mod.js +1 -1
- package/esm/storage/0_storage.js +6 -5
- package/esm/storage/1_utilities.d.ts +0 -1
- package/esm/storage/1_utilities.js +2 -3
- package/esm/storage/2_storage_local_storage.js +1 -4
- package/esm/storage/2_storage_session_storage.js +1 -4
- package/esm/tl/3_utilities.js +5 -4
- package/esm/transport/2_transport_provider.js +4 -4
- package/esm/types/0_message_entity.js +3 -3
- package/esm/types/0_message_search_filter.js +2 -2
- package/esm/types/0_reaction.js +2 -2
- package/esm/types/1_bot_command_scope.js +3 -3
- package/esm/types/1_chat_p.js +3 -2
- package/esm/types/1_keyboard_button.js +3 -3
- package/esm/types/1_message_reaction.js +2 -2
- package/esm/types/1_story_privacy.js +3 -3
- package/esm/types/2_chat_member.js +6 -5
- package/esm/types/2_chosen_inline_result.js +3 -2
- package/esm/types/2_inactive_chat.js +3 -2
- package/esm/types/2_inline_keyboard_button.js +3 -3
- package/esm/types/2_inline_query.js +3 -3
- package/esm/types/2_invite_link.js +3 -2
- package/esm/types/2_story_content.js +5 -5
- package/esm/types/2_story_interactive_area.js +5 -5
- package/esm/types/3_chat_member_updated.js +4 -3
- package/esm/types/3_reply_markup.js +4 -3
- package/esm/types/3_story.js +3 -2
- package/esm/types/4_inline_query_result.js +5 -5
- package/esm/types/4_message.js +17 -16
- package/esm/types/5_callback_query.js +4 -3
- package/esm/types/5_chat.js +8 -7
- package/esm/types/_file_id.js +9 -8
- package/esm/utilities/0_bigint.d.ts +1 -0
- package/esm/utilities/0_bigint.js +25 -0
- package/esm/utilities/0_logger.d.ts +8 -0
- package/esm/utilities/0_logger.js +9 -5
- package/esm/utilities/1_math.d.ts +1 -0
- package/esm/utilities/1_math.js +51 -0
- package/esm/utilities/1_misc.js +2 -2
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -1
- package/script/0_deps.js +3 -3
- package/script/1_utilities.d.ts +1 -1
- package/script/1_utilities.js +1 -1
- package/script/4_errors.js +3 -3
- package/script/client/0_markdown.js +5 -5
- package/script/client/0_utilities.d.ts +6 -0
- package/script/client/0_utilities.js +41 -4
- package/script/client/1_account_manager.js +4 -4
- package/script/client/1_client_encrypted.js +2 -2
- package/script/client/1_client_plain.js +2 -2
- package/script/client/1_file_manager.js +5 -4
- package/script/client/1_reaction_manager.js +2 -2
- package/script/client/1_update_manager.js +8 -7
- package/script/client/2_message_manager.js +51 -28
- package/script/client/3_callback_query_manager.js +2 -0
- package/script/client/3_chat_list_manager.js +12 -11
- package/script/client/3_inline_query_manager.js +4 -2
- package/script/client/3_story_manager.js +4 -2
- package/script/client/4_client.d.ts +5 -8
- package/script/client/4_client.js +18 -26
- package/script/connection/1_connection_web_socket.js +2 -1
- package/{esm/deps/deno.land/x/tgcrypto@0.3.3 → script/deps/deno.land/x/tgcrypto@0.4.0}/mod.d.ts +0 -1
- package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/mod.js +1 -13
- package/script/deps/deno.land/x/tgcrypto@0.4.0/tgcrypto.js +310 -0
- package/script/mod.d.ts +1 -1
- package/script/mod.js +2 -1
- package/script/storage/0_storage.js +5 -4
- package/script/storage/1_utilities.d.ts +0 -1
- package/script/storage/1_utilities.js +3 -4
- package/script/storage/2_storage_local_storage.js +0 -3
- package/script/storage/2_storage_session_storage.js +0 -3
- package/script/tl/3_utilities.js +4 -3
- package/script/transport/2_transport_provider.js +4 -4
- package/script/types/0_message_entity.js +3 -3
- package/script/types/0_message_search_filter.js +2 -2
- package/script/types/0_reaction.js +2 -2
- package/script/types/1_bot_command_scope.js +3 -3
- package/script/types/1_chat_p.js +2 -1
- package/script/types/1_keyboard_button.js +3 -3
- package/script/types/1_message_reaction.js +2 -2
- package/script/types/1_story_privacy.js +3 -3
- package/script/types/2_chat_member.js +5 -4
- package/script/types/2_chosen_inline_result.js +2 -1
- package/script/types/2_inactive_chat.js +2 -1
- package/script/types/2_inline_keyboard_button.js +3 -3
- package/script/types/2_inline_query.js +3 -3
- package/script/types/2_invite_link.js +2 -1
- package/script/types/2_story_content.js +5 -5
- package/script/types/2_story_interactive_area.js +5 -5
- package/script/types/3_chat_member_updated.js +3 -2
- package/script/types/3_reply_markup.js +3 -2
- package/script/types/3_story.js +2 -1
- package/script/types/4_inline_query_result.js +5 -5
- package/script/types/4_message.js +16 -15
- package/script/types/5_callback_query.js +3 -2
- package/script/types/5_chat.js +7 -6
- package/script/types/_file_id.js +8 -7
- package/script/utilities/0_bigint.d.ts +1 -0
- package/script/utilities/0_bigint.js +27 -1
- package/script/utilities/0_logger.d.ts +8 -0
- package/script/utilities/0_logger.js +11 -6
- package/script/utilities/1_math.d.ts +1 -0
- package/script/utilities/1_math.js +55 -0
- package/script/utilities/1_misc.js +2 -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/esm/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +0 -324
- package/esm/utilities/0_control.d.ts +0 -1
- package/esm/utilities/0_control.js +0 -3
- 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/script/deps/deno.land/x/tgcrypto@0.3.3/tgcrypto.js +0 -326
- package/script/utilities/0_control.d.ts +0 -1
- package/script/utilities/0_control.js +0 -7
- /package/esm/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/tgcrypto.d.ts +0 -0
- /package/script/deps/deno.land/x/{tgcrypto@0.3.3 → tgcrypto@0.4.0}/tgcrypto.d.ts +0 -0
|
@@ -28,7 +28,7 @@ class StoryManager {
|
|
|
28
28
|
async createStory(chatId, content, params) {
|
|
29
29
|
await __classPrivateFieldGet(this, _StoryManager_c, "f").storage.assertUser("createStory");
|
|
30
30
|
let media = null;
|
|
31
|
-
const source = "video" in content ? content.video : "photo" in content ? content.photo : (0,
|
|
31
|
+
const source = "video" in content ? content.video : "photo" in content ? content.photo : (0, _0_deps_js_1.unreachable)();
|
|
32
32
|
if (typeof source === "string") {
|
|
33
33
|
const fileId = __classPrivateFieldGet(this, _StoryManager_c, "f").messageManager.resolveFileId(source, _3_types_js_1.FileType.Photo);
|
|
34
34
|
if (fileId != null) {
|
|
@@ -87,6 +87,7 @@ class StoryManager {
|
|
|
87
87
|
}
|
|
88
88
|
async getStories(chatId, storyIds) {
|
|
89
89
|
await __classPrivateFieldGet(this, _StoryManager_c, "f").storage.assertUser("getStories");
|
|
90
|
+
(0, _0_utilities_js_1.checkArray)(storyIds, _0_utilities_js_1.checkStoryId);
|
|
90
91
|
const peer = await __classPrivateFieldGet(this, _StoryManager_c, "f").getInputPeer(chatId);
|
|
91
92
|
const stories_ = await __classPrivateFieldGet(this, _StoryManager_c, "f").api.stories.getStoriesByID({ peer, id: storyIds });
|
|
92
93
|
const stories = new Array();
|
|
@@ -150,8 +151,9 @@ _StoryManager_c = new WeakMap(), _StoryManager_instances = new WeakSet(), _Story
|
|
|
150
151
|
return await (0, _3_types_js_1.constructStory)(updateStory.story, updateStory.peer, __classPrivateFieldGet(this, _StoryManager_c, "f").getEntity);
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
|
-
(0,
|
|
154
|
+
(0, _0_deps_js_1.unreachable)();
|
|
154
155
|
}, _StoryManager_togglePinned = async function _StoryManager_togglePinned(chatId, storyIds, pinned) {
|
|
156
|
+
(0, _0_utilities_js_1.checkArray)(storyIds, _0_utilities_js_1.checkStoryId);
|
|
155
157
|
const peer = await __classPrivateFieldGet(this, _StoryManager_c, "f").getInputPeer(chatId);
|
|
156
158
|
await __classPrivateFieldGet(this, _StoryManager_c, "f").api.stories.togglePinned({ peer, id: storyIds, pinned });
|
|
157
159
|
};
|
|
@@ -235,27 +235,24 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
235
235
|
[handleMigrationError](err: Migrate): Promise<void>;
|
|
236
236
|
disconnect(): Promise<void>;
|
|
237
237
|
/**
|
|
238
|
-
*
|
|
238
|
+
* Authorizes the client with one of the following:
|
|
239
239
|
*
|
|
240
240
|
* - Bot token (`string`)
|
|
241
|
-
* - Exported authorization (`types.AuthExportedAuthorization`)
|
|
242
241
|
* - User authorization handlers (`AuthorizeUserParams`)
|
|
243
242
|
*
|
|
244
|
-
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](
|
|
243
|
+
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](1).
|
|
245
244
|
*
|
|
246
245
|
* Notes:
|
|
247
246
|
* 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
|
|
248
247
|
* 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
|
|
249
|
-
* 3. The parameters passed to the [initConnection][1] call can be configured with the last parameter of the constructor.
|
|
250
248
|
*
|
|
251
|
-
* [1]: https://core.telegram.org/method/
|
|
252
|
-
* [2]: https://core.telegram.org/method/updates.getState
|
|
249
|
+
* [1]: https://core.telegram.org/method/updates.getState
|
|
253
250
|
*/
|
|
254
|
-
authorize(params?: string |
|
|
251
|
+
authorize(params?: string | AuthorizeUserParams): Promise<void>;
|
|
255
252
|
/**
|
|
256
253
|
* Same as calling `.connect()` followed by `.authorize(params)`.
|
|
257
254
|
*/
|
|
258
|
-
start(params?: string |
|
|
255
|
+
start(params?: string | AuthorizeUserParams): Promise<void>;
|
|
259
256
|
/**
|
|
260
257
|
* Invokes a function waiting and returning its reply if the second parameter is not `true`. Requires the client
|
|
261
258
|
* to be connected.
|
|
@@ -13,6 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
var _Client_instances, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_businessConnectionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_parseMode, _Client_publicKeys, _Client_ignoreOutgoing, _Client_storeMessages, _Client_Lauthorize, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_namespaceProxies, _Client_getApiId, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_pingLoopStarted, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.Client = exports.handleMigrationError = exports.restartAuth = exports.Composer = void 0;
|
|
16
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
16
17
|
const _0_errors_js_1 = require("../0_errors.js");
|
|
17
18
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
18
19
|
const _2_tl_js_1 = require("../2_tl.js");
|
|
@@ -164,7 +165,7 @@ class Client extends Composer {
|
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
167
|
else {
|
|
167
|
-
(0,
|
|
168
|
+
(0, _0_deps_js_1.unreachable)();
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
},
|
|
@@ -212,7 +213,7 @@ class Client extends Composer {
|
|
|
212
213
|
return { chatId: reactions.chatId, messageId: reactions.messageId };
|
|
213
214
|
}
|
|
214
215
|
else {
|
|
215
|
-
(0,
|
|
216
|
+
(0, _0_deps_js_1.unreachable)();
|
|
216
217
|
}
|
|
217
218
|
};
|
|
218
219
|
const mustGetUserId = () => {
|
|
@@ -226,7 +227,7 @@ class Client extends Composer {
|
|
|
226
227
|
return update.chosenInlineResult.from.id;
|
|
227
228
|
}
|
|
228
229
|
else {
|
|
229
|
-
(0,
|
|
230
|
+
(0, _0_deps_js_1.unreachable)();
|
|
230
231
|
}
|
|
231
232
|
};
|
|
232
233
|
const mustGetInlineMsgId = () => {
|
|
@@ -240,7 +241,7 @@ class Client extends Composer {
|
|
|
240
241
|
return update.callbackQuery.inlineMessageId;
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
|
-
(0,
|
|
244
|
+
(0, _0_deps_js_1.unreachable)();
|
|
244
245
|
};
|
|
245
246
|
const chat_ = "messageReactions" in update ? update.messageReactions.chat : "messageReactionCount" in update ? update.messageReactionCount.chat : undefined;
|
|
246
247
|
const chat = chat_ ?? msg?.chat;
|
|
@@ -353,21 +354,21 @@ class Client extends Composer {
|
|
|
353
354
|
banSender: (params) => {
|
|
354
355
|
const { chatId, senderId } = mustGetMsg();
|
|
355
356
|
if (!senderId) {
|
|
356
|
-
(0,
|
|
357
|
+
(0, _0_deps_js_1.unreachable)();
|
|
357
358
|
}
|
|
358
359
|
return this.banChatMember(chatId, senderId, params);
|
|
359
360
|
},
|
|
360
361
|
kickSender: () => {
|
|
361
362
|
const { chatId, senderId } = mustGetMsg();
|
|
362
363
|
if (!senderId) {
|
|
363
|
-
(0,
|
|
364
|
+
(0, _0_deps_js_1.unreachable)();
|
|
364
365
|
}
|
|
365
366
|
return this.kickChatMember(chatId, senderId);
|
|
366
367
|
},
|
|
367
368
|
setSenderRights: (params) => {
|
|
368
369
|
const { chatId, senderId } = mustGetMsg();
|
|
369
370
|
if (!senderId) {
|
|
370
|
-
(0,
|
|
371
|
+
(0, _0_deps_js_1.unreachable)();
|
|
371
372
|
}
|
|
372
373
|
return this.setChatMemberRights(chatId, senderId, params);
|
|
373
374
|
},
|
|
@@ -381,13 +382,13 @@ class Client extends Composer {
|
|
|
381
382
|
},
|
|
382
383
|
answerCallbackQuery: (params) => {
|
|
383
384
|
if (!("callbackQuery" in update)) {
|
|
384
|
-
(0,
|
|
385
|
+
(0, _0_deps_js_1.unreachable)();
|
|
385
386
|
}
|
|
386
387
|
return this.answerCallbackQuery(update.callbackQuery.id, params);
|
|
387
388
|
},
|
|
388
389
|
answerInlineQuery: (results, params) => {
|
|
389
390
|
if (!("inlineQuery" in update)) {
|
|
390
|
-
(0,
|
|
391
|
+
(0, _0_deps_js_1.unreachable)();
|
|
391
392
|
}
|
|
392
393
|
return this.answerInlineQuery(update.inlineQuery.id, results, params);
|
|
393
394
|
},
|
|
@@ -540,7 +541,7 @@ class Client extends Composer {
|
|
|
540
541
|
getBusinessConnection: () => {
|
|
541
542
|
const { businessConnectionId } = mustGetMsg();
|
|
542
543
|
if (!businessConnectionId) {
|
|
543
|
-
(0,
|
|
544
|
+
(0, _0_deps_js_1.unreachable)();
|
|
544
545
|
}
|
|
545
546
|
return this.getBusinessConnection(businessConnectionId);
|
|
546
547
|
},
|
|
@@ -685,8 +686,7 @@ class Client extends Composer {
|
|
|
685
686
|
if (ctx.error instanceof _4_errors_js_1.AuthKeyUnregistered && dcId) {
|
|
686
687
|
try {
|
|
687
688
|
const exportedAuth = await this.api.auth.exportAuthorization({ dc_id: dcId });
|
|
688
|
-
await client.
|
|
689
|
-
// throw 1;
|
|
689
|
+
await client.api.auth.importAuthorization(exportedAuth);
|
|
690
690
|
return true;
|
|
691
691
|
}
|
|
692
692
|
catch (err) {
|
|
@@ -867,21 +867,18 @@ class Client extends Composer {
|
|
|
867
867
|
__classPrivateFieldGet(this, _Client_pingLoopAbortController, "f")?.abort();
|
|
868
868
|
}
|
|
869
869
|
/**
|
|
870
|
-
*
|
|
870
|
+
* Authorizes the client with one of the following:
|
|
871
871
|
*
|
|
872
872
|
* - Bot token (`string`)
|
|
873
|
-
* - Exported authorization (`types.AuthExportedAuthorization`)
|
|
874
873
|
* - User authorization handlers (`AuthorizeUserParams`)
|
|
875
874
|
*
|
|
876
|
-
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](
|
|
875
|
+
* if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](1).
|
|
877
876
|
*
|
|
878
877
|
* Notes:
|
|
879
878
|
* 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
|
|
880
879
|
* 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
|
|
881
|
-
* 3. The parameters passed to the [initConnection][1] call can be configured with the last parameter of the constructor.
|
|
882
880
|
*
|
|
883
|
-
* [1]: https://core.telegram.org/method/
|
|
884
|
-
* [2]: https://core.telegram.org/method/updates.getState
|
|
881
|
+
* [1]: https://core.telegram.org/method/updates.getState
|
|
885
882
|
*/
|
|
886
883
|
async authorize(params) {
|
|
887
884
|
try {
|
|
@@ -933,11 +930,6 @@ class Client extends Composer {
|
|
|
933
930
|
await __classPrivateFieldGet(this, _Client_updateManager, "f").fetchState("authorize");
|
|
934
931
|
return;
|
|
935
932
|
}
|
|
936
|
-
if (params instanceof _2_tl_js_1.types.auth.ExportedAuthorization) {
|
|
937
|
-
await this.api.auth.importAuthorization({ id: params.id, bytes: params.bytes });
|
|
938
|
-
__classPrivateFieldGet(this, _Client_Lauthorize, "f").debug("authorization imported");
|
|
939
|
-
return;
|
|
940
|
-
}
|
|
941
933
|
auth: while (true) {
|
|
942
934
|
try {
|
|
943
935
|
let phone;
|
|
@@ -1078,7 +1070,7 @@ class Client extends Composer {
|
|
|
1078
1070
|
inputPeer.access_hash = await __classPrivateFieldGet(this, _Client_instances, "m", _Client_getUserAccessHash).call(this, inputPeer.user_id);
|
|
1079
1071
|
}
|
|
1080
1072
|
}
|
|
1081
|
-
|
|
1073
|
+
if ((inputPeer instanceof _2_tl_js_1.types.InputPeerUser || inputPeer instanceof _2_tl_js_1.types.InputPeerChannel && inputPeer.access_hash == 0n) && await this.storage.getAccountType() == "user") {
|
|
1082
1074
|
throw new _0_errors_js_1.AccessError(`Cannot access the chat ${id} because there is no access hash for it.`);
|
|
1083
1075
|
}
|
|
1084
1076
|
return inputPeer;
|
|
@@ -1230,7 +1222,7 @@ class Client extends Composer {
|
|
|
1230
1222
|
resolvedId = (0, _2_tl_js_1.peerToChatId)(resolved.peer);
|
|
1231
1223
|
}
|
|
1232
1224
|
else {
|
|
1233
|
-
(0,
|
|
1225
|
+
(0, _0_deps_js_1.unreachable)();
|
|
1234
1226
|
}
|
|
1235
1227
|
}
|
|
1236
1228
|
const resolvedIdType = (0, _2_tl_js_1.getChatIdPeerType)(resolvedId);
|
|
@@ -1243,7 +1235,7 @@ class Client extends Composer {
|
|
|
1243
1235
|
return new _2_tl_js_1.types.InputPeerChannel({ channel_id: (0, _2_tl_js_1.chatIdToPeerId)(resolvedId), access_hash: accessHash ?? 0n });
|
|
1244
1236
|
}
|
|
1245
1237
|
else {
|
|
1246
|
-
(0,
|
|
1238
|
+
(0, _0_deps_js_1.unreachable)();
|
|
1247
1239
|
}
|
|
1248
1240
|
}
|
|
1249
1241
|
else if (id > 0) {
|
|
@@ -37,6 +37,7 @@ var _ConnectionWebSocket_instances, _ConnectionWebSocket_webSocket, _ConnectionW
|
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.ConnectionWebSocket = void 0;
|
|
39
39
|
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
40
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
40
41
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
41
42
|
const _0_connection_js_1 = require("./0_connection.js");
|
|
42
43
|
const L = (0, _1_utilities_js_1.getLogger)("ConnectionWebSocket");
|
|
@@ -142,7 +143,7 @@ _ConnectionWebSocket_webSocket = new WeakMap(), _ConnectionWebSocket_rMutex = ne
|
|
|
142
143
|
return;
|
|
143
144
|
}
|
|
144
145
|
const unlock = await mutex.lock();
|
|
145
|
-
const data = new Uint8Array(await new Blob([e.data].map((v) => v instanceof Blob || v instanceof Uint8Array ? v : v instanceof ArrayBuffer ? v : (0,
|
|
146
|
+
const data = new Uint8Array(await new Blob([e.data].map((v) => v instanceof Blob || v instanceof Uint8Array ? v : v instanceof ArrayBuffer ? v : (0, _0_deps_js_1.unreachable)())).arrayBuffer());
|
|
146
147
|
__classPrivateFieldSet(this, _ConnectionWebSocket_buffer, (0, _1_utilities_js_1.concat)(__classPrivateFieldGet(this, _ConnectionWebSocket_buffer, "f"), data), "f");
|
|
147
148
|
if (__classPrivateFieldGet(this, _ConnectionWebSocket_nextResolve, "f") != null && __classPrivateFieldGet(this, _ConnectionWebSocket_buffer, "f").length >= __classPrivateFieldGet(this, _ConnectionWebSocket_nextResolve, "f")[0]) {
|
|
148
149
|
__classPrivateFieldGet(this, _ConnectionWebSocket_nextResolve, "f")[1].resolve();
|
package/{esm/deps/deno.land/x/tgcrypto@0.3.3 → script/deps/deno.land/x/tgcrypto@0.4.0}/mod.d.ts
RENAMED
|
@@ -40,4 +40,3 @@ export declare function cbc256Encrypt(data: Uint8Array, key: Uint8Array, iv: Uin
|
|
|
40
40
|
* @param iv 16-byte initialization vector
|
|
41
41
|
*/
|
|
42
42
|
export declare function cbc256Decrypt(data: Uint8Array, key: Uint8Array, iv: Uint8Array): Uint8Array;
|
|
43
|
-
export declare function factorize(pq: bigint): [bigint, bigint];
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.cbc256Decrypt = exports.cbc256Encrypt = exports.ctr256 = exports.ige256Decrypt = exports.ige256Encrypt = exports.init = void 0;
|
|
7
7
|
const tgcrypto_js_1 = __importDefault(require("./tgcrypto.js"));
|
|
8
8
|
// deno-lint-ignore no-explicit-any
|
|
9
9
|
let module_;
|
|
@@ -163,15 +163,3 @@ function cbc256Decrypt(data, key, iv) {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
exports.cbc256Decrypt = cbc256Decrypt;
|
|
166
|
-
function factorize(pq) {
|
|
167
|
-
const pqp = module_._malloc(16);
|
|
168
|
-
module_.ccall("factorize", "void", ["number", "pointer"], [pq, pqp]);
|
|
169
|
-
try {
|
|
170
|
-
const pqp_ = module_.HEAP64.slice(pqp / 8, pqp / 8 + 2);
|
|
171
|
-
return [pqp_[0], pqp_[1]];
|
|
172
|
-
}
|
|
173
|
-
finally {
|
|
174
|
-
module_._free(pqp);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
exports.factorize = factorize;
|