@mtkruto/node 0.1.190 → 0.1.200
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_errors.d.ts +12 -0
- package/esm/0_errors.js +19 -0
- 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_client_abstract.js +3 -2
- package/esm/client/0_html.js +4 -3
- package/esm/client/0_markdown.js +6 -5
- package/esm/client/0_params.d.ts +7 -1
- package/esm/client/0_types.d.ts +1 -2
- package/esm/client/0_types.js +1 -2
- package/esm/client/0_utilities.d.ts +0 -3
- package/esm/client/0_utilities.js +2 -21
- 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_client_encrypted.js +1 -1
- package/esm/client/1_client_plain.js +3 -4
- package/esm/client/1_composer.js +3 -2
- package/esm/client/1_file_manager.js +4 -4
- 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 +89 -74
- package/esm/client/3_chat_list_manager.js +3 -2
- package/esm/client/3_story_manager.js +2 -1
- package/esm/client/4_client.d.ts +422 -421
- package/esm/client/4_client.js +578 -520
- package/esm/mod.d.ts +1 -0
- package/esm/mod.js +1 -0
- 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.d.ts +1 -0
- package/esm/types/0_chat_photo.js +8 -5
- 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/{script/types/1_story_interactive_area.d.ts → esm/types/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_callback_query.js +2 -1
- package/esm/types/5_chat.d.ts +1 -1
- package/esm/types/6_update.d.ts +12 -2
- package/esm/types/{0__file_id.js → _file_id.js} +2 -1
- package/package.json +1 -1
- package/script/0_errors.d.ts +12 -0
- package/script/0_errors.js +27 -0
- 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_client_abstract.js +3 -2
- package/script/client/0_html.js +4 -3
- package/script/client/0_markdown.js +6 -5
- package/script/client/0_params.d.ts +7 -1
- package/script/client/0_types.d.ts +1 -2
- package/script/client/0_types.js +0 -4
- package/script/client/0_utilities.d.ts +0 -3
- package/script/client/0_utilities.js +3 -24
- 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_client_encrypted.js +2 -2
- package/script/client/1_client_plain.js +3 -4
- package/script/client/1_composer.js +3 -2
- package/script/client/1_file_manager.js +5 -5
- 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 +88 -73
- package/script/client/3_chat_list_manager.js +3 -2
- package/script/client/3_story_manager.js +2 -1
- package/script/client/4_client.d.ts +422 -421
- package/script/client/4_client.js +578 -520
- package/script/mod.d.ts +1 -0
- package/script/mod.js +1 -0
- 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.d.ts +1 -0
- package/script/types/0_chat_photo.js +16 -13
- 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/{esm/types/1_story_interactive_area.d.ts → script/types/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_callback_query.js +2 -1
- package/script/types/5_chat.d.ts +1 -1
- package/script/types/6_update.d.ts +12 -2
- package/script/types/{0__file_id.js → _file_id.js} +2 -1
- /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/{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/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/script/types/{1__getters.js → _getters.js} +0 -0
package/script/1_utilities.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./utilities/1_base64.js"), exports);
|
|
18
17
|
__exportStar(require("./utilities/0_bigint.js"), exports);
|
|
19
18
|
__exportStar(require("./utilities/0_buffer.js"), exports);
|
|
20
19
|
__exportStar(require("./utilities/0_cache_map.js"), exports);
|
|
@@ -28,5 +27,6 @@ __exportStar(require("./utilities/0_object.js"), exports);
|
|
|
28
27
|
__exportStar(require("./utilities/0_rle.js"), exports);
|
|
29
28
|
__exportStar(require("./utilities/0_types.js"), exports);
|
|
30
29
|
__exportStar(require("./utilities/1_auth.js"), exports);
|
|
30
|
+
__exportStar(require("./utilities/1_base64.js"), exports);
|
|
31
31
|
__exportStar(require("./utilities/1_misc.js"), exports);
|
|
32
32
|
__exportStar(require("./utilities/1_queue.js"), exports);
|
package/script/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/script/2_tl.js
CHANGED
|
@@ -20,11 +20,11 @@ Object.defineProperty(exports, "TLError", { enumerable: true, get: function () {
|
|
|
20
20
|
__exportStar(require("./tl/1_tl_object.js"), exports);
|
|
21
21
|
var _2_types_js_1 = require("./tl/2_types.js");
|
|
22
22
|
Object.defineProperty(exports, "types", { enumerable: true, get: function () { return _2_types_js_1.types; } });
|
|
23
|
+
__exportStar(require("./tl/3_utilities.js"), exports);
|
|
23
24
|
var _3_functions_js_1 = require("./tl/3_functions.js");
|
|
24
25
|
Object.defineProperty(exports, "functions", { enumerable: true, get: function () { return _3_functions_js_1.functions; } });
|
|
25
|
-
__exportStar(require("./tl/
|
|
26
|
-
__exportStar(require("./tl/
|
|
27
|
-
__exportStar(require("./tl/
|
|
28
|
-
__exportStar(require("./tl/
|
|
29
|
-
__exportStar(require("./tl/
|
|
30
|
-
__exportStar(require("./tl/7_message_container.js"), exports);
|
|
26
|
+
__exportStar(require("./tl/4_tl_reader.js"), exports);
|
|
27
|
+
__exportStar(require("./tl/5_tl_writer.js"), exports);
|
|
28
|
+
__exportStar(require("./tl/6_rpc_result.js"), exports);
|
|
29
|
+
__exportStar(require("./tl/7_message.js"), exports);
|
|
30
|
+
__exportStar(require("./tl/8_message_container.js"), exports);
|
package/script/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/script/3_storage.js
CHANGED
|
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./storage/0_storage.js"), exports);
|
|
18
|
-
__exportStar(require("./storage/
|
|
19
|
-
__exportStar(require("./storage/
|
|
20
|
-
__exportStar(require("./storage/
|
|
21
|
-
__exportStar(require("./storage/
|
|
22
|
-
__exportStar(require("./storage/
|
|
18
|
+
__exportStar(require("./storage/1_utilities.js"), exports);
|
|
19
|
+
__exportStar(require("./storage/2_storage_indexed_db.js"), exports);
|
|
20
|
+
__exportStar(require("./storage/2_storage_local_storage.js"), exports);
|
|
21
|
+
__exportStar(require("./storage/2_storage_memory.js"), exports);
|
|
22
|
+
__exportStar(require("./storage/2_storage_session_storage.js"), exports);
|
package/script/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/script/3_types.js
CHANGED
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types/_file_id.js"), exports);
|
|
18
|
+
__exportStar(require("./types/_getters.js"), exports);
|
|
17
19
|
__exportStar(require("./types/0_authorization_state.js"), exports);
|
|
18
20
|
__exportStar(require("./types/0_bot_command.js"), exports);
|
|
19
21
|
__exportStar(require("./types/0_chat_action.js"), exports);
|
|
@@ -23,7 +25,6 @@ __exportStar(require("./types/0_chat_photo.js"), exports);
|
|
|
23
25
|
__exportStar(require("./types/0_connection_state.js"), exports);
|
|
24
26
|
__exportStar(require("./types/0_contact.js"), exports);
|
|
25
27
|
__exportStar(require("./types/0_dice.js"), exports);
|
|
26
|
-
__exportStar(require("./types/0__file_id.js"), exports);
|
|
27
28
|
__exportStar(require("./types/0_file_source.js"), exports);
|
|
28
29
|
__exportStar(require("./types/0_giveaway_parameters.js"), exports);
|
|
29
30
|
__exportStar(require("./types/0_id.js"), exports);
|
|
@@ -44,14 +45,12 @@ __exportStar(require("./types/0_reaction.js"), exports);
|
|
|
44
45
|
__exportStar(require("./types/0_restriction_reason.js"), exports);
|
|
45
46
|
__exportStar(require("./types/0_story_reference.js"), exports);
|
|
46
47
|
__exportStar(require("./types/0_thumbnail.js"), exports);
|
|
47
|
-
__exportStar(require("./types/0_venue.js"), exports);
|
|
48
48
|
__exportStar(require("./types/0_voice.js"), exports);
|
|
49
49
|
__exportStar(require("./types/1_animation.js"), exports);
|
|
50
50
|
__exportStar(require("./types/1_audio.js"), exports);
|
|
51
51
|
__exportStar(require("./types/1_bot_command_scope.js"), exports);
|
|
52
52
|
__exportStar(require("./types/1_chat_p.js"), exports);
|
|
53
53
|
__exportStar(require("./types/1_document.js"), exports);
|
|
54
|
-
__exportStar(require("./types/1__getters.js"), exports);
|
|
55
54
|
__exportStar(require("./types/1_giveaway.js"), exports);
|
|
56
55
|
__exportStar(require("./types/1_inline_query_result_button.js"), exports);
|
|
57
56
|
__exportStar(require("./types/1_input_message_content.js"), exports);
|
|
@@ -64,12 +63,13 @@ __exportStar(require("./types/1_poll.js"), exports);
|
|
|
64
63
|
__exportStar(require("./types/1_reaction_count.js"), exports);
|
|
65
64
|
__exportStar(require("./types/1_reply_quote.js"), exports);
|
|
66
65
|
__exportStar(require("./types/1_sticker.js"), exports);
|
|
67
|
-
__exportStar(require("./types/1_story_interactive_area.js"), exports);
|
|
68
66
|
__exportStar(require("./types/1_story_privacy.js"), exports);
|
|
69
67
|
__exportStar(require("./types/1_story_reaction.js"), exports);
|
|
70
68
|
__exportStar(require("./types/1_user.js"), exports);
|
|
71
|
-
__exportStar(require("./types/
|
|
69
|
+
__exportStar(require("./types/1_venue.js"), exports);
|
|
72
70
|
__exportStar(require("./types/1_video.js"), exports);
|
|
71
|
+
__exportStar(require("./types/1_video_note.js"), exports);
|
|
72
|
+
__exportStar(require("./types/2_business_connection.js"), exports);
|
|
73
73
|
__exportStar(require("./types/2_chat_member.js"), exports);
|
|
74
74
|
__exportStar(require("./types/2_chosen_inline_result.js"), exports);
|
|
75
75
|
__exportStar(require("./types/2_game.js"), exports);
|
|
@@ -82,6 +82,7 @@ __exportStar(require("./types/2_message_reaction_count.js"), exports);
|
|
|
82
82
|
__exportStar(require("./types/2_message_reactions.js"), exports);
|
|
83
83
|
__exportStar(require("./types/2_story_content.js"), exports);
|
|
84
84
|
__exportStar(require("./types/2_story_interactions.js"), exports);
|
|
85
|
+
__exportStar(require("./types/2_story_interactive_area.js"), exports);
|
|
85
86
|
__exportStar(require("./types/3_chat_member_updated.js"), exports);
|
|
86
87
|
__exportStar(require("./types/3_reply_markup.js"), exports);
|
|
87
88
|
__exportStar(require("./types/3_story.js"), exports);
|
package/script/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/script/4_constants.js
CHANGED
|
@@ -77,8 +77,8 @@ exports.PUBLIC_KEYS = Object.freeze([
|
|
|
77
77
|
],
|
|
78
78
|
]);
|
|
79
79
|
exports.INITIAL_DC = "2";
|
|
80
|
-
exports.LAYER =
|
|
81
|
-
exports.APP_VERSION = "MTKruto
|
|
80
|
+
exports.LAYER = 177;
|
|
81
|
+
exports.APP_VERSION = "MTKruto";
|
|
82
82
|
// @ts-ignore: lib
|
|
83
83
|
exports.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;
|
|
84
84
|
exports.LANG_CODE = typeof navigator === "undefined" || typeof navigator.language !== "string" ? "en" : navigator.language.split("-")[0];
|
package/script/5_client.d.ts
CHANGED
package/script/5_client.js
CHANGED
|
@@ -15,6 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./client/0_params.js"), exports);
|
|
18
|
-
__exportStar(require("./client/1_client_plain.js"), exports);
|
|
19
18
|
__exportStar(require("./client/1_client_encrypted.js"), exports);
|
|
19
|
+
__exportStar(require("./client/1_client_plain.js"), exports);
|
|
20
20
|
__exportStar(require("./client/4_client.js"), exports);
|
|
@@ -14,6 +14,7 @@ var _ClientAbstract_dc;
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ClientAbstract = void 0;
|
|
16
16
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
17
|
+
const _0_errors_js_1 = require("../0_errors.js");
|
|
17
18
|
const _3_transport_js_1 = require("../3_transport.js");
|
|
18
19
|
const _4_constants_js_1 = require("../4_constants.js");
|
|
19
20
|
class ClientAbstract {
|
|
@@ -58,7 +59,7 @@ class ClientAbstract {
|
|
|
58
59
|
}
|
|
59
60
|
get dcId() {
|
|
60
61
|
if (!this.transport) {
|
|
61
|
-
throw new
|
|
62
|
+
throw new _0_errors_js_1.ConnectionError("Not connected.");
|
|
62
63
|
}
|
|
63
64
|
return this.transport.dcId;
|
|
64
65
|
}
|
|
@@ -85,7 +86,7 @@ class ClientAbstract {
|
|
|
85
86
|
}
|
|
86
87
|
async disconnect() {
|
|
87
88
|
if (!this.transport) {
|
|
88
|
-
throw new
|
|
89
|
+
throw new _0_errors_js_1.ConnectionError("Not connected.");
|
|
89
90
|
}
|
|
90
91
|
await this.transport.transport.deinitialize();
|
|
91
92
|
await this.transport.connection.close();
|
package/script/client/0_html.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseHtml = void 0;
|
|
4
4
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
5
|
+
const _0_errors_js_1 = require("../0_errors.js");
|
|
5
6
|
function parseHtml(html) {
|
|
6
7
|
html = html.trim();
|
|
7
8
|
let text = "";
|
|
@@ -29,7 +30,7 @@ function parseHtml(html) {
|
|
|
29
30
|
case "a": {
|
|
30
31
|
const url = attribs.href;
|
|
31
32
|
if (!url) {
|
|
32
|
-
throw new
|
|
33
|
+
throw new _0_errors_js_1.InputError("Missing attribute: href");
|
|
33
34
|
}
|
|
34
35
|
stack.push({ type: "textLink", offset: text.length, length: 0, url });
|
|
35
36
|
break;
|
|
@@ -44,7 +45,7 @@ function parseHtml(html) {
|
|
|
44
45
|
break;
|
|
45
46
|
case "span":
|
|
46
47
|
if (attribs.class != "tg-spoiler") {
|
|
47
|
-
throw new
|
|
48
|
+
throw new _0_errors_js_1.InputError('The class attribute must be "tg-spoiler."');
|
|
48
49
|
}
|
|
49
50
|
// falls through
|
|
50
51
|
case "tg-spoiler":
|
|
@@ -52,7 +53,7 @@ function parseHtml(html) {
|
|
|
52
53
|
break;
|
|
53
54
|
case "tg-emoji":
|
|
54
55
|
if (!attribs["emoji-id"]) {
|
|
55
|
-
throw new
|
|
56
|
+
throw new _0_errors_js_1.InputError("Missing attribute: emoji-id");
|
|
56
57
|
}
|
|
57
58
|
stack.push({ type: "spoiler", offset: text.length, length: 0 });
|
|
58
59
|
break;
|
|
@@ -7,6 +7,7 @@ exports.parseMarkdown = exports.CODEPOINTS = void 0;
|
|
|
7
7
|
*/
|
|
8
8
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
9
9
|
const _3_types_js_1 = require("../3_types.js");
|
|
10
|
+
const _0_errors_js_1 = require("../0_errors.js");
|
|
10
11
|
const enc = new TextEncoder();
|
|
11
12
|
const dec = new TextDecoder();
|
|
12
13
|
exports.CODEPOINTS = {
|
|
@@ -168,7 +169,7 @@ function parseMarkdown(text_) {
|
|
|
168
169
|
type = "spoiler";
|
|
169
170
|
}
|
|
170
171
|
else {
|
|
171
|
-
throw new
|
|
172
|
+
throw new _0_errors_js_1.InputError(`The character "${String.fromCharCode(c)}" is reserved and must be escaped with a preceding backslash.`);
|
|
172
173
|
}
|
|
173
174
|
break;
|
|
174
175
|
case exports.CODEPOINTS["["]:
|
|
@@ -253,7 +254,7 @@ function parseMarkdown(text_) {
|
|
|
253
254
|
}
|
|
254
255
|
url = Uint8Array.from(url_);
|
|
255
256
|
if (text[i] !== exports.CODEPOINTS[")"]) {
|
|
256
|
-
throw new Error(
|
|
257
|
+
throw new Error(`Can't find the end of the URL that starts at offset ${urlBeginPos}.`);
|
|
257
258
|
}
|
|
258
259
|
}
|
|
259
260
|
userId = getLinkUserId(dec.decode(url));
|
|
@@ -270,7 +271,7 @@ function parseMarkdown(text_) {
|
|
|
270
271
|
}
|
|
271
272
|
case "customEmoji": {
|
|
272
273
|
if (text[i + 1] !== exports.CODEPOINTS["("]) {
|
|
273
|
-
throw new
|
|
274
|
+
throw new _0_errors_js_1.InputError("Custom emoji entities must contain a tg://emoji URL.");
|
|
274
275
|
}
|
|
275
276
|
i += 2;
|
|
276
277
|
const url_ = [];
|
|
@@ -285,7 +286,7 @@ function parseMarkdown(text_) {
|
|
|
285
286
|
}
|
|
286
287
|
const url = Uint8Array.from(url_);
|
|
287
288
|
if (text[i] !== exports.CODEPOINTS[")"]) {
|
|
288
|
-
throw new
|
|
289
|
+
throw new _0_errors_js_1.InputError(`Can't find the end of the custom emoji URL that starts at offset ${urlBeginPos}.`);
|
|
289
290
|
}
|
|
290
291
|
customEmojiId = getLinkCustomEmojiId(dec.decode(url));
|
|
291
292
|
break;
|
|
@@ -317,7 +318,7 @@ function parseMarkdown(text_) {
|
|
|
317
318
|
}
|
|
318
319
|
if (nestedEntities.length !== 0) {
|
|
319
320
|
const last = nestedEntities[nestedEntities.length - 1];
|
|
320
|
-
throw new
|
|
321
|
+
throw new _0_errors_js_1.InputError(`Can't find the end of the ${last.type} entity that starts at offset ${last.entityByteOffset}.`);
|
|
321
322
|
}
|
|
322
323
|
entities = (0, _3_types_js_1.sortMessageEntities)(entities);
|
|
323
324
|
return [dec.decode(text.slice(0, resultSize)), entities];
|
|
@@ -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;
|
|
@@ -40,7 +40,6 @@ export interface C {
|
|
|
40
40
|
ignoreOutgoing: boolean | null;
|
|
41
41
|
cdn: boolean;
|
|
42
42
|
dropPendingUpdates?: boolean;
|
|
43
|
-
|
|
44
|
-
export declare class ConnectionError extends Error {
|
|
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>;
|
|
45
44
|
}
|
|
46
45
|
export {};
|
package/script/client/0_types.js
CHANGED
|
@@ -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;
|
|
@@ -23,34 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getChatListId = exports.getUsername = exports.isHttpUrl = exports.getFileContents = exports.
|
|
26
|
+
exports.getChatListId = exports.getUsername = exports.isHttpUrl = exports.getFileContents = exports.resolve = void 0;
|
|
27
27
|
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
28
28
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
29
|
+
const _0_errors_js_1 = require("../0_errors.js");
|
|
29
30
|
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
30
|
-
const _2_tl_js_1 = require("../2_tl.js");
|
|
31
31
|
const resolve = () => Promise.resolve();
|
|
32
32
|
exports.resolve = resolve;
|
|
33
|
-
function isPtsUpdate(v) {
|
|
34
|
-
return v instanceof _2_tl_js_1.types.UpdateNewMessage ||
|
|
35
|
-
v instanceof _2_tl_js_1.types.UpdateDeleteMessages ||
|
|
36
|
-
v instanceof _2_tl_js_1.types.UpdateReadHistoryInbox ||
|
|
37
|
-
v instanceof _2_tl_js_1.types.UpdateReadHistoryOutbox ||
|
|
38
|
-
v instanceof _2_tl_js_1.types.UpdatePinnedChannelMessages ||
|
|
39
|
-
v instanceof _2_tl_js_1.types.UpdatePinnedMessages ||
|
|
40
|
-
v instanceof _2_tl_js_1.types.UpdateFolderPeers ||
|
|
41
|
-
v instanceof _2_tl_js_1.types.UpdateChannelWebPage ||
|
|
42
|
-
v instanceof _2_tl_js_1.types.UpdateEditMessage ||
|
|
43
|
-
v instanceof _2_tl_js_1.types.UpdateReadMessagesContents ||
|
|
44
|
-
v instanceof _2_tl_js_1.types.UpdateWebPage;
|
|
45
|
-
}
|
|
46
|
-
exports.isPtsUpdate = isPtsUpdate;
|
|
47
|
-
function isChannelPtsUpdate(v) {
|
|
48
|
-
return v instanceof _2_tl_js_1.types.UpdateNewChannelMessage ||
|
|
49
|
-
v instanceof _2_tl_js_1.types.UpdateEditChannelMessage ||
|
|
50
|
-
v instanceof _2_tl_js_1.types.UpdateDeleteChannelMessages ||
|
|
51
|
-
v instanceof _2_tl_js_1.types.UpdateChannelTooLong;
|
|
52
|
-
}
|
|
53
|
-
exports.isChannelPtsUpdate = isChannelPtsUpdate;
|
|
54
33
|
async function getFileContents(source, fileName = "") {
|
|
55
34
|
fileName = fileName.trim() || "file";
|
|
56
35
|
let contents;
|
|
@@ -111,7 +90,7 @@ function isDigit(string) {
|
|
|
111
90
|
const c = string.charCodeAt(0);
|
|
112
91
|
return "0".charCodeAt(0) <= c && c <= "9".charCodeAt(0);
|
|
113
92
|
}
|
|
114
|
-
const errInvalidUsername = (u) => new
|
|
93
|
+
const errInvalidUsername = (u) => new _0_errors_js_1.InputError(`Invalid username: ${u}`);
|
|
115
94
|
function validateUsername(string, ignoreAt = false) {
|
|
116
95
|
string = string.trim();
|
|
117
96
|
if (ignoreAt && string.startsWith("@")) {
|
|
@@ -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,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
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");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
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");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _BusinessConnectionManager_c;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.BusinessConnectionManager = void 0;
|
|
16
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
17
|
+
const _3_types_js_1 = require("../3_types.js");
|
|
18
|
+
class BusinessConnectionManager {
|
|
19
|
+
constructor(c) {
|
|
20
|
+
_BusinessConnectionManager_c.set(this, void 0);
|
|
21
|
+
__classPrivateFieldSet(this, _BusinessConnectionManager_c, c, "f");
|
|
22
|
+
}
|
|
23
|
+
async getBusinessConnection(id) {
|
|
24
|
+
const connection_ = await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.getBusinessConnection(id);
|
|
25
|
+
if (!connection_) {
|
|
26
|
+
const connection_ = await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").api.account.getBotBusinessConnection({ connection_id: id })
|
|
27
|
+
.then((v) => v[_2_tl_js_1.as](_2_tl_js_1.types.Updates))
|
|
28
|
+
.then((v) => v.updates[0][_2_tl_js_1.as](_2_tl_js_1.types.UpdateBotBusinessConnect).connection);
|
|
29
|
+
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(id, connection_);
|
|
30
|
+
return await (0, _3_types_js_1.constructBusinessConnection)(connection_, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return await (0, _3_types_js_1.constructBusinessConnection)(connection_, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
static canHandleUpdate(update) {
|
|
37
|
+
return update instanceof _2_tl_js_1.types.UpdateBotBusinessConnect;
|
|
38
|
+
}
|
|
39
|
+
async handleUpdate(update) {
|
|
40
|
+
if (update.connection.disabled) {
|
|
41
|
+
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(update.connection.connection_id, null);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
await __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").messageStorage.setBusinessConnection(update.connection.connection_id, update.connection);
|
|
45
|
+
}
|
|
46
|
+
const businessConnection = await (0, _3_types_js_1.constructBusinessConnection)(update.connection, __classPrivateFieldGet(this, _BusinessConnectionManager_c, "f").getEntity);
|
|
47
|
+
return { businessConnection };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.BusinessConnectionManager = BusinessConnectionManager;
|
|
51
|
+
_BusinessConnectionManager_c = new WeakMap();
|
|
@@ -14,12 +14,12 @@ var _ClientEncrypted_instances, _ClientEncrypted_authKey, _ClientEncrypted_authK
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ClientEncrypted = void 0;
|
|
16
16
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
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");
|
|
19
20
|
const _4_errors_js_1 = require("../4_errors.js");
|
|
20
21
|
const _0_client_abstract_js_1 = require("./0_client_abstract.js");
|
|
21
22
|
const _0_message_js_1 = require("./0_message.js");
|
|
22
|
-
const _0_types_js_1 = require("./0_types.js");
|
|
23
23
|
// global ClientEncrypted ID counter for logs
|
|
24
24
|
let id = 0;
|
|
25
25
|
/**
|
|
@@ -233,7 +233,7 @@ _ClientEncrypted_authKey = new WeakMap(), _ClientEncrypted_authKeyId = new WeakM
|
|
|
233
233
|
}
|
|
234
234
|
if (!this.connected) {
|
|
235
235
|
for (const [key, { reject }] of __classPrivateFieldGet(this, _ClientEncrypted_promises, "f").entries()) {
|
|
236
|
-
reject?.(new
|
|
236
|
+
reject?.(new _0_errors_js_1.ConnectionError("Connection was closed"));
|
|
237
237
|
__classPrivateFieldGet(this, _ClientEncrypted_promises, "f").delete(key);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -14,6 +14,7 @@ var _ClientPlain_publicKeys, _ClientPlain_lastMsgId;
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ClientPlain = void 0;
|
|
16
16
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
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");
|
|
19
20
|
const _4_constants_js_1 = require("../4_constants.js");
|
|
@@ -33,7 +34,7 @@ class ClientPlain extends _0_client_abstract_js_1.ClientAbstract {
|
|
|
33
34
|
}
|
|
34
35
|
async invoke(function_) {
|
|
35
36
|
if (!this.transport) {
|
|
36
|
-
throw new
|
|
37
|
+
throw new _0_errors_js_1.ConnectionError("Not connected.");
|
|
37
38
|
}
|
|
38
39
|
const msgId = __classPrivateFieldSet(this, _ClientPlain_lastMsgId, (0, _0_message_js_1.getMessageId)(__classPrivateFieldGet(this, _ClientPlain_lastMsgId, "f")), "f");
|
|
39
40
|
const payload = (0, _0_message_js_1.packUnencryptedMessage)(function_[_2_tl_js_1.serialize](), msgId);
|
|
@@ -44,9 +45,7 @@ class ClientPlain extends _0_client_abstract_js_1.ClientAbstract {
|
|
|
44
45
|
L.inBin(payload);
|
|
45
46
|
if (buffer.length == 4) {
|
|
46
47
|
const int = (0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, true);
|
|
47
|
-
|
|
48
|
-
throw new Error("-404");
|
|
49
|
-
}
|
|
48
|
+
throw new _0_errors_js_1.TransportError(Number(int));
|
|
50
49
|
}
|
|
51
50
|
const { message } = (0, _0_message_js_1.unpackUnencryptedMessage)(buffer);
|
|
52
51
|
const reader = new _2_tl_js_1.TLReader(message);
|
|
@@ -13,6 +13,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
13
13
|
var _Composer_handle, _Composer_prefixes;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.Composer = exports.skip = exports.concat = exports.flatten = void 0;
|
|
16
|
+
const _0_errors_js_1 = require("../0_errors.js");
|
|
16
17
|
const _0_filters_js_1 = require("./0_filters.js");
|
|
17
18
|
function flatten(mw) {
|
|
18
19
|
return typeof mw === "function" ? mw : (ctx, next) => mw.middleware()(ctx, next);
|
|
@@ -40,7 +41,7 @@ exports.skip = skip;
|
|
|
40
41
|
class Composer {
|
|
41
42
|
set prefixes(value) {
|
|
42
43
|
if (__classPrivateFieldGet(this, _Composer_prefixes, "f") !== undefined) {
|
|
43
|
-
throw new
|
|
44
|
+
throw new _0_errors_js_1.InputError("Prefixes already set");
|
|
44
45
|
}
|
|
45
46
|
__classPrivateFieldSet(this, _Composer_prefixes, value, "f");
|
|
46
47
|
}
|
|
@@ -90,7 +91,7 @@ class Composer {
|
|
|
90
91
|
continue;
|
|
91
92
|
}
|
|
92
93
|
if (left.startsWith(right) || right.startsWith(left)) {
|
|
93
|
-
throw new
|
|
94
|
+
throw new _0_errors_js_1.InputError("Intersecting prefixes");
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
97
|
}
|