@mtkruto/node 0.192.0 → 0.194.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/esm/0_errors.d.ts +6 -0
- package/esm/0_errors.d.ts.map +1 -1
- package/esm/0_errors.js +12 -0
- package/esm/3_types.d.ts +8 -2
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +8 -2
- package/esm/client/0_html.d.ts +2 -1
- package/esm/client/0_html.d.ts.map +1 -1
- package/esm/client/0_html.js +18 -16
- package/esm/client/0_markdown.d.ts +3 -2
- package/esm/client/0_markdown.d.ts.map +1 -1
- package/esm/client/0_markdown.js +9 -7
- package/esm/client/0_params.d.ts +51 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_password.js +5 -5
- package/esm/client/0_storage_operations.d.ts +9 -0
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +40 -51
- package/esm/client/1_client_generic.d.ts +161 -13
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +2 -1
- package/esm/client/2_client_encrypted.d.ts.map +1 -1
- package/esm/client/2_client_encrypted.js +2 -4
- package/esm/client/2_reaction_manager.d.ts +2 -1
- package/esm/client/2_reaction_manager.d.ts.map +1 -1
- package/esm/client/2_reaction_manager.js +7 -0
- package/esm/client/2_update_manager.d.ts +1 -1
- package/esm/client/2_update_manager.d.ts.map +1 -1
- package/esm/client/2_update_manager.js +13 -12
- package/esm/client/3_account_manager.d.ts +8 -2
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +54 -2
- package/esm/client/3_message_manager.js +6 -6
- package/esm/client/3_secret_chat_manager.d.ts +7 -2
- package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
- package/esm/client/3_secret_chat_manager.js +65 -16
- package/esm/client/3_sticker_set_manager.d.ts +5 -0
- package/esm/client/3_sticker_set_manager.d.ts.map +1 -1
- package/esm/client/3_sticker_set_manager.js +40 -9
- package/esm/client/4_chat_manager.d.ts +9 -3
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +102 -3
- package/esm/client/4_checklist_manager.js +1 -1
- package/esm/client/4_context.d.ts +17 -3
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +38 -0
- package/esm/client/4_forum_manager.d.ts +1 -0
- package/esm/client/4_forum_manager.d.ts.map +1 -1
- package/esm/client/4_forum_manager.js +5 -0
- package/esm/client/6_client.d.ts +159 -11
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +223 -25
- package/esm/client/6_client_dispatcher.d.ts +160 -12
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +198 -8
- package/esm/storage/2_storage_indexed_db.js +5 -5
- package/esm/storage/2_storage_session_storage.js +2 -2
- package/esm/tl/0_utilities.d.ts +1 -1
- package/esm/tl/0_utilities.d.ts.map +1 -1
- package/esm/tl/0_utilities.js +3 -2
- package/esm/tl/1_tl_reader.js +1 -1
- package/esm/tl/1_tl_writer.js +1 -1
- package/esm/types/1_available_reactions.d.ts +3 -2
- package/esm/types/1_available_reactions.d.ts.map +1 -1
- package/esm/types/1_available_reactions.js +18 -1
- package/esm/types/1_channel_location.d.ts +27 -0
- package/esm/types/1_channel_location.d.ts.map +1 -0
- package/esm/types/1_channel_location.js +30 -0
- package/esm/types/1_sticker_set_p.d.ts +48 -0
- package/esm/types/1_sticker_set_p.d.ts.map +1 -0
- package/esm/types/1_sticker_set_p.js +73 -0
- package/esm/types/2_poll_voter.d.ts +19 -0
- package/esm/types/2_poll_voter.d.ts.map +1 -1
- package/esm/types/2_poll_voter.js +19 -0
- package/esm/types/3_chat_join_result.d.ts +40 -0
- package/esm/types/3_chat_join_result.d.ts.map +1 -0
- package/esm/types/3_chat_join_result.js +45 -0
- package/esm/types/3_resolved_invite_link.d.ts +63 -0
- package/esm/types/3_resolved_invite_link.d.ts.map +1 -0
- package/esm/types/3_resolved_invite_link.js +45 -0
- package/esm/types/3_rich_text_component.d.ts +24 -0
- package/esm/types/3_rich_text_component.d.ts.map +1 -1
- package/esm/types/4_page_block.d.ts +45 -1
- package/esm/types/4_page_block.d.ts.map +1 -1
- package/esm/types/B_recent_action.d.ts +244 -0
- package/esm/types/B_recent_action.d.ts.map +1 -0
- package/esm/types/B_recent_action.js +322 -0
- package/esm/types/B_topic_list_item.d.ts +22 -0
- package/esm/types/B_topic_list_item.d.ts.map +1 -1
- package/esm/types/B_topic_list_item.js +19 -0
- package/esm/types/C_recent_actions_entry.d.ts +32 -0
- package/esm/types/C_recent_actions_entry.d.ts.map +1 -0
- package/esm/types/C_recent_actions_entry.js +32 -0
- package/esm/types/C_topic_list.d.ts +20 -0
- package/esm/types/C_topic_list.d.ts.map +1 -1
- package/esm/types/C_topic_list.js +19 -0
- package/esm/utilities/1_auth.d.ts.map +1 -1
- package/esm/utilities/1_auth.js +2 -1
- package/package.json +1 -1
- package/script/0_errors.d.ts +6 -0
- package/script/0_errors.d.ts.map +1 -1
- package/script/0_errors.js +15 -1
- package/script/3_types.d.ts +8 -2
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +8 -2
- package/script/client/0_html.d.ts +2 -1
- package/script/client/0_html.d.ts.map +1 -1
- package/script/client/0_html.js +17 -15
- package/script/client/0_markdown.d.ts +3 -2
- package/script/client/0_markdown.d.ts.map +1 -1
- package/script/client/0_markdown.js +8 -6
- package/script/client/0_params.d.ts +51 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_password.js +5 -5
- package/script/client/0_storage_operations.d.ts +9 -0
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +42 -53
- package/script/client/1_client_generic.d.ts +161 -13
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +2 -1
- package/script/client/2_client_encrypted.d.ts.map +1 -1
- package/script/client/2_client_encrypted.js +4 -6
- package/script/client/2_reaction_manager.d.ts +2 -1
- package/script/client/2_reaction_manager.d.ts.map +1 -1
- package/script/client/2_reaction_manager.js +7 -0
- package/script/client/2_update_manager.d.ts +1 -1
- package/script/client/2_update_manager.d.ts.map +1 -1
- package/script/client/2_update_manager.js +13 -12
- package/script/client/3_account_manager.d.ts +8 -2
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +54 -2
- package/script/client/3_message_manager.js +6 -6
- package/script/client/3_secret_chat_manager.d.ts +7 -2
- package/script/client/3_secret_chat_manager.d.ts.map +1 -1
- package/script/client/3_secret_chat_manager.js +65 -16
- package/script/client/3_sticker_set_manager.d.ts +5 -0
- package/script/client/3_sticker_set_manager.d.ts.map +1 -1
- package/script/client/3_sticker_set_manager.js +39 -8
- package/script/client/4_chat_manager.d.ts +9 -3
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +101 -2
- package/script/client/4_checklist_manager.js +1 -1
- package/script/client/4_context.d.ts +17 -3
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +38 -0
- package/script/client/4_forum_manager.d.ts +1 -0
- package/script/client/4_forum_manager.d.ts.map +1 -1
- package/script/client/4_forum_manager.js +5 -0
- package/script/client/6_client.d.ts +159 -11
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +223 -25
- package/script/client/6_client_dispatcher.d.ts +160 -12
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +198 -8
- package/script/storage/2_storage_indexed_db.js +5 -5
- package/script/storage/2_storage_session_storage.js +2 -2
- package/script/tl/0_utilities.d.ts +1 -1
- package/script/tl/0_utilities.d.ts.map +1 -1
- package/script/tl/0_utilities.js +3 -2
- package/script/tl/1_tl_reader.js +1 -1
- package/script/tl/1_tl_writer.js +1 -1
- package/script/types/1_available_reactions.d.ts +3 -2
- package/script/types/1_available_reactions.d.ts.map +1 -1
- package/script/types/1_available_reactions.js +18 -0
- package/script/types/1_channel_location.d.ts +27 -0
- package/script/types/1_channel_location.d.ts.map +1 -0
- package/script/types/1_channel_location.js +33 -0
- package/script/types/1_sticker_set_p.d.ts +48 -0
- package/script/types/1_sticker_set_p.d.ts.map +1 -0
- package/script/types/1_sticker_set_p.js +76 -0
- package/script/types/2_poll_voter.d.ts +19 -0
- package/script/types/2_poll_voter.d.ts.map +1 -1
- package/script/types/2_poll_voter.js +19 -0
- package/script/types/3_chat_join_result.d.ts +40 -0
- package/script/types/3_chat_join_result.d.ts.map +1 -0
- package/script/types/3_chat_join_result.js +48 -0
- package/script/types/3_resolved_invite_link.d.ts +63 -0
- package/script/types/3_resolved_invite_link.d.ts.map +1 -0
- package/script/types/3_resolved_invite_link.js +48 -0
- package/script/types/3_rich_text_component.d.ts +24 -0
- package/script/types/3_rich_text_component.d.ts.map +1 -1
- package/script/types/4_page_block.d.ts +45 -1
- package/script/types/4_page_block.d.ts.map +1 -1
- package/script/types/B_recent_action.d.ts +244 -0
- package/script/types/B_recent_action.d.ts.map +1 -0
- package/script/types/B_recent_action.js +325 -0
- package/script/types/B_topic_list_item.d.ts +22 -0
- package/script/types/B_topic_list_item.d.ts.map +1 -1
- package/script/types/B_topic_list_item.js +19 -0
- package/script/types/C_recent_actions_entry.d.ts +32 -0
- package/script/types/C_recent_actions_entry.d.ts.map +1 -0
- package/script/types/C_recent_actions_entry.js +35 -0
- package/script/types/C_topic_list.d.ts +20 -0
- package/script/types/C_topic_list.d.ts.map +1 -1
- package/script/types/C_topic_list.js +19 -0
- package/script/utilities/1_auth.d.ts.map +1 -1
- package/script/utilities/1_auth.js +2 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { unreachable } from "../0_deps.js";
|
|
21
|
+
import { cleanObject } from "../1_utilities.js";
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
23
|
+
import { peerToChatId } from "../tl/2_telegram.js";
|
|
24
|
+
import { constructChatMemberRights } from "./0_chat_member_rights.js";
|
|
25
|
+
import { constructAvailableReactions } from "./1_available_reactions.js";
|
|
26
|
+
import { constructChannelLocation } from "./1_channel_location.js";
|
|
27
|
+
import { constructPhoto } from "./1_photo.js";
|
|
28
|
+
import { constructChatMember } from "./2_chat_member.js";
|
|
29
|
+
import { constructInviteLink } from "./3_invite_link.js";
|
|
30
|
+
import { constructMessage } from "./9_message.js";
|
|
31
|
+
import { constructTopic2 } from "./A_topic.js";
|
|
32
|
+
function getChannelParticipantPeer(participant) {
|
|
33
|
+
switch (participant._) {
|
|
34
|
+
case "channelParticipant":
|
|
35
|
+
case "channelParticipantSelf":
|
|
36
|
+
case "channelParticipantCreator":
|
|
37
|
+
case "channelParticipantAdmin":
|
|
38
|
+
return { _: "peerUser", user_id: participant.user_id };
|
|
39
|
+
case "channelParticipantBanned":
|
|
40
|
+
case "channelParticipantLeft":
|
|
41
|
+
return participant.peer;
|
|
42
|
+
default:
|
|
43
|
+
unreachable();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export async function constructRecentAction(a, getPeer, getMessage, getStickerSetName) {
|
|
47
|
+
switch (a._) {
|
|
48
|
+
case "channelAdminLogEventActionChangeTitle":
|
|
49
|
+
return {
|
|
50
|
+
type: "changeTitle",
|
|
51
|
+
previous: a.prev_value,
|
|
52
|
+
new: a.new_value,
|
|
53
|
+
};
|
|
54
|
+
case "channelAdminLogEventActionChangeAbout":
|
|
55
|
+
return {
|
|
56
|
+
type: "changeDescription",
|
|
57
|
+
previous: a.prev_value,
|
|
58
|
+
new: a.new_value,
|
|
59
|
+
};
|
|
60
|
+
case "channelAdminLogEventActionChangeUsername":
|
|
61
|
+
return {
|
|
62
|
+
type: "changeUsername",
|
|
63
|
+
previous: a.prev_value,
|
|
64
|
+
new: a.prev_value,
|
|
65
|
+
};
|
|
66
|
+
case "channelAdminLogEventActionChangePhoto":
|
|
67
|
+
return {
|
|
68
|
+
type: "changePhoto",
|
|
69
|
+
previous: constructPhoto(Api.as("photo", a.prev_photo)),
|
|
70
|
+
new: constructPhoto(Api.as("photo", a.new_photo)),
|
|
71
|
+
};
|
|
72
|
+
case "channelAdminLogEventActionToggleInvites":
|
|
73
|
+
return {
|
|
74
|
+
type: "toggleInvites",
|
|
75
|
+
isEnabled: a.new_value,
|
|
76
|
+
};
|
|
77
|
+
case "channelAdminLogEventActionToggleSignatures":
|
|
78
|
+
return {
|
|
79
|
+
type: "toggleSignatures",
|
|
80
|
+
isEnabled: a.new_value,
|
|
81
|
+
};
|
|
82
|
+
case "channelAdminLogEventActionUpdatePinned":
|
|
83
|
+
return {
|
|
84
|
+
type: "pinMessage",
|
|
85
|
+
message: await constructMessage(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
86
|
+
};
|
|
87
|
+
case "channelAdminLogEventActionEditMessage":
|
|
88
|
+
return {
|
|
89
|
+
type: "editMessage",
|
|
90
|
+
previous: await constructMessage(a.prev_message, getPeer, getMessage, getStickerSetName, false),
|
|
91
|
+
new: await constructMessage(a.new_message, getPeer, getMessage, getStickerSetName, false),
|
|
92
|
+
};
|
|
93
|
+
case "channelAdminLogEventActionDeleteMessage":
|
|
94
|
+
return {
|
|
95
|
+
type: "deleteMessage",
|
|
96
|
+
message: await constructMessage(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
97
|
+
};
|
|
98
|
+
case "channelAdminLogEventActionParticipantJoin":
|
|
99
|
+
return {
|
|
100
|
+
type: "join",
|
|
101
|
+
};
|
|
102
|
+
case "channelAdminLogEventActionParticipantLeave":
|
|
103
|
+
return {
|
|
104
|
+
type: "leave",
|
|
105
|
+
};
|
|
106
|
+
case "channelAdminLogEventActionParticipantInvite": {
|
|
107
|
+
const peer = getPeer(getChannelParticipantPeer(a.participant));
|
|
108
|
+
if (peer === null) {
|
|
109
|
+
unreachable();
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
type: "invite",
|
|
113
|
+
chatMember: constructChatMember(peer[0], a.participant, getPeer),
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
case "channelAdminLogEventActionParticipantToggleBan": {
|
|
117
|
+
const peer = getPeer(getChannelParticipantPeer(a.new_participant));
|
|
118
|
+
if (peer === null) {
|
|
119
|
+
unreachable();
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
type: "toggleRestriction",
|
|
123
|
+
previous: constructChatMember(peer[0], a.prev_participant, getPeer),
|
|
124
|
+
new: constructChatMember(peer[0], a.new_participant, getPeer),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
case "channelAdminLogEventActionParticipantToggleAdmin": {
|
|
128
|
+
const peer = getPeer(getChannelParticipantPeer(a.new_participant));
|
|
129
|
+
if (peer === null) {
|
|
130
|
+
unreachable();
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
type: "togglePromotion",
|
|
134
|
+
previous: constructChatMember(peer[0], a.prev_participant, getPeer),
|
|
135
|
+
new: constructChatMember(peer[0], a.new_participant, getPeer),
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
case "channelAdminLogEventActionChangeStickerSet":
|
|
139
|
+
return cleanObject({
|
|
140
|
+
type: "changeStickerSet",
|
|
141
|
+
previous: Api.is("inputStickerSetShortName", a.prev_stickerset) ? a.prev_stickerset.short_name : undefined,
|
|
142
|
+
new: Api.is("inputStickerSetShortName", a.new_stickerset) ? a.new_stickerset.short_name : undefined,
|
|
143
|
+
});
|
|
144
|
+
case "channelAdminLogEventActionTogglePreHistoryHidden":
|
|
145
|
+
return {
|
|
146
|
+
type: "toggleChatHistoryForNewMembers",
|
|
147
|
+
isEnabled: a.new_value,
|
|
148
|
+
};
|
|
149
|
+
case "channelAdminLogEventActionDefaultBannedRights":
|
|
150
|
+
return {
|
|
151
|
+
type: "setDefaultPermissions",
|
|
152
|
+
previous: constructChatMemberRights(a.prev_banned_rights),
|
|
153
|
+
new: constructChatMemberRights(a.new_banned_rights),
|
|
154
|
+
};
|
|
155
|
+
case "channelAdminLogEventActionStopPoll":
|
|
156
|
+
return {
|
|
157
|
+
type: "stopPoll",
|
|
158
|
+
message: await constructMessage(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
159
|
+
};
|
|
160
|
+
case "channelAdminLogEventActionChangeLinkedChat":
|
|
161
|
+
return {
|
|
162
|
+
type: "changeDiscussionChat",
|
|
163
|
+
previous: peerToChatId({ _: "peerChannel", channel_id: a.prev_value }),
|
|
164
|
+
new: peerToChatId({ _: "peerChannel", channel_id: a.new_value }),
|
|
165
|
+
};
|
|
166
|
+
case "channelAdminLogEventActionChangeLocation":
|
|
167
|
+
return cleanObject({
|
|
168
|
+
type: "changeLocation",
|
|
169
|
+
previous: Api.is("channelLocation", a.prev_value) ? constructChannelLocation(a.prev_value) : undefined,
|
|
170
|
+
new: Api.is("channelLocation", a.new_value) ? constructChannelLocation(a.new_value) : undefined,
|
|
171
|
+
});
|
|
172
|
+
case "channelAdminLogEventActionToggleSlowMode":
|
|
173
|
+
return {
|
|
174
|
+
type: "setSlowMode",
|
|
175
|
+
previous: a.prev_value,
|
|
176
|
+
new: a.new_value,
|
|
177
|
+
};
|
|
178
|
+
case "channelAdminLogEventActionStartGroupCall":
|
|
179
|
+
return {
|
|
180
|
+
type: "startVideoChat",
|
|
181
|
+
};
|
|
182
|
+
case "channelAdminLogEventActionDiscardGroupCall":
|
|
183
|
+
return {
|
|
184
|
+
type: "endVideoChat",
|
|
185
|
+
};
|
|
186
|
+
case "channelAdminLogEventActionParticipantMute":
|
|
187
|
+
return {
|
|
188
|
+
type: "muteVideoChatParticipant",
|
|
189
|
+
participant: peerToChatId(a.participant.peer),
|
|
190
|
+
};
|
|
191
|
+
case "channelAdminLogEventActionParticipantUnmute":
|
|
192
|
+
return {
|
|
193
|
+
type: "unmuteVideoChatParticipant",
|
|
194
|
+
participant: peerToChatId(a.participant.peer),
|
|
195
|
+
};
|
|
196
|
+
case "channelAdminLogEventActionToggleGroupCallSetting":
|
|
197
|
+
return {
|
|
198
|
+
type: "toggleVideoChatDefaultMuted",
|
|
199
|
+
defaultMuted: a.join_muted,
|
|
200
|
+
};
|
|
201
|
+
case "channelAdminLogEventActionParticipantJoinByInvite":
|
|
202
|
+
return cleanObject({
|
|
203
|
+
type: "joinByInvite",
|
|
204
|
+
inviteLink: Api.is("chatInviteExported", a.invite) ? constructInviteLink(a.invite, getPeer) : undefined,
|
|
205
|
+
isViaList: !!a.via_chatlist,
|
|
206
|
+
});
|
|
207
|
+
case "channelAdminLogEventActionExportedInviteDelete":
|
|
208
|
+
return cleanObject({
|
|
209
|
+
type: "deleteInviteLink",
|
|
210
|
+
inviteLink: Api.is("chatInviteExported", a.invite) ? constructInviteLink(a.invite, getPeer) : undefined,
|
|
211
|
+
});
|
|
212
|
+
case "channelAdminLogEventActionExportedInviteRevoke":
|
|
213
|
+
return cleanObject({
|
|
214
|
+
type: "revokeInviteLink",
|
|
215
|
+
inviteLink: Api.is("chatInviteExported", a.invite) ? constructInviteLink(a.invite, getPeer) : undefined,
|
|
216
|
+
});
|
|
217
|
+
case "channelAdminLogEventActionExportedInviteEdit":
|
|
218
|
+
return cleanObject({
|
|
219
|
+
type: "editInviteLink",
|
|
220
|
+
previous: Api.is("chatInviteExported", a.prev_invite) ? constructInviteLink(a.prev_invite, getPeer) : undefined,
|
|
221
|
+
new: Api.is("chatInviteExported", a.new_invite) ? constructInviteLink(a.new_invite, getPeer) : undefined,
|
|
222
|
+
});
|
|
223
|
+
case "channelAdminLogEventActionParticipantVolume":
|
|
224
|
+
return {
|
|
225
|
+
type: "setVideoChatParticipantVolume",
|
|
226
|
+
participant: peerToChatId(a.participant.peer),
|
|
227
|
+
};
|
|
228
|
+
case "channelAdminLogEventActionChangeHistoryTTL":
|
|
229
|
+
return {
|
|
230
|
+
type: "setHistoryTtl",
|
|
231
|
+
previous: a.prev_value,
|
|
232
|
+
new: a.new_value,
|
|
233
|
+
};
|
|
234
|
+
case "channelAdminLogEventActionParticipantJoinByRequest":
|
|
235
|
+
return cleanObject({
|
|
236
|
+
type: "joinByRequest",
|
|
237
|
+
inviteLink: Api.is("chatInviteExported", a.invite) ? constructInviteLink(a.invite, getPeer) : undefined,
|
|
238
|
+
approvedBy: Number(a.approved_by),
|
|
239
|
+
});
|
|
240
|
+
case "channelAdminLogEventActionToggleNoForwards":
|
|
241
|
+
return {
|
|
242
|
+
type: "toggleContentProtection",
|
|
243
|
+
isEnabled: a.new_value,
|
|
244
|
+
};
|
|
245
|
+
case "channelAdminLogEventActionSendMessage":
|
|
246
|
+
return {
|
|
247
|
+
type: "sendMessage",
|
|
248
|
+
message: await constructMessage(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
249
|
+
};
|
|
250
|
+
case "channelAdminLogEventActionChangeAvailableReactions":
|
|
251
|
+
return {
|
|
252
|
+
type: "setAvailableReactions",
|
|
253
|
+
previous: constructAvailableReactions(a.prev_value),
|
|
254
|
+
new: constructAvailableReactions(a.new_value),
|
|
255
|
+
};
|
|
256
|
+
case "channelAdminLogEventActionChangeUsernames":
|
|
257
|
+
return {
|
|
258
|
+
type: "setUsernames",
|
|
259
|
+
previous: a.prev_value,
|
|
260
|
+
new: a.new_value,
|
|
261
|
+
};
|
|
262
|
+
case "channelAdminLogEventActionToggleForum":
|
|
263
|
+
return {
|
|
264
|
+
type: "toggleAntispam",
|
|
265
|
+
isEnabled: a.new_value,
|
|
266
|
+
};
|
|
267
|
+
case "channelAdminLogEventActionCreateTopic":
|
|
268
|
+
return {
|
|
269
|
+
type: "createTopic",
|
|
270
|
+
topic: constructTopic2(a.topic, getPeer),
|
|
271
|
+
};
|
|
272
|
+
case "channelAdminLogEventActionEditTopic":
|
|
273
|
+
return {
|
|
274
|
+
type: "editTopic",
|
|
275
|
+
previous: constructTopic2(a.prev_topic, getPeer),
|
|
276
|
+
new: constructTopic2(a.new_topic, getPeer),
|
|
277
|
+
};
|
|
278
|
+
case "channelAdminLogEventActionDeleteTopic":
|
|
279
|
+
return {
|
|
280
|
+
type: "deleteTopic",
|
|
281
|
+
topic: constructTopic2(a.topic, getPeer),
|
|
282
|
+
};
|
|
283
|
+
case "channelAdminLogEventActionPinTopic":
|
|
284
|
+
return cleanObject({
|
|
285
|
+
type: "pinTopic",
|
|
286
|
+
previous: a.prev_topic ? constructTopic2(a.prev_topic, getPeer) : undefined,
|
|
287
|
+
new: a.new_topic ? constructTopic2(a.new_topic, getPeer) : undefined,
|
|
288
|
+
});
|
|
289
|
+
case "channelAdminLogEventActionToggleAntiSpam":
|
|
290
|
+
return {
|
|
291
|
+
type: "toggleAntispam",
|
|
292
|
+
isEnabled: a.new_value,
|
|
293
|
+
};
|
|
294
|
+
case "channelAdminLogEventActionChangeEmojiStickerSet":
|
|
295
|
+
return cleanObject({
|
|
296
|
+
type: "setEmojiStickerSet",
|
|
297
|
+
previous: Api.is("inputStickerSetShortName", a.prev_stickerset) ? a.prev_stickerset.short_name : undefined,
|
|
298
|
+
new: Api.is("inputStickerSetShortName", a.new_stickerset) ? a.new_stickerset.short_name : undefined,
|
|
299
|
+
});
|
|
300
|
+
case "channelAdminLogEventActionToggleSignatureProfiles":
|
|
301
|
+
return {
|
|
302
|
+
type: "toggleSignatures",
|
|
303
|
+
isEnabled: a.new_value,
|
|
304
|
+
};
|
|
305
|
+
case "channelAdminLogEventActionToggleAutotranslation":
|
|
306
|
+
return {
|
|
307
|
+
type: "toggleAutomaticTranslation",
|
|
308
|
+
isEnabled: a.new_value,
|
|
309
|
+
};
|
|
310
|
+
case "channelAdminLogEventActionParticipantEditRank":
|
|
311
|
+
return cleanObject({
|
|
312
|
+
type: "editChatMemberTag",
|
|
313
|
+
userId: Number(a.user_id),
|
|
314
|
+
previous: a.prev_rank || undefined,
|
|
315
|
+
newTag: a.new_rank || undefined,
|
|
316
|
+
});
|
|
317
|
+
default:
|
|
318
|
+
return {
|
|
319
|
+
type: "unsupported",
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
}
|
|
@@ -1,7 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
1
20
|
import type { Message } from "./9_message.js";
|
|
2
21
|
import type { Topic } from "./A_topic.js";
|
|
22
|
+
/** An item of a topic list. */
|
|
3
23
|
export interface TopicListItem {
|
|
24
|
+
/** The topic. */
|
|
4
25
|
topic: Topic;
|
|
26
|
+
/** The topic's last message. */
|
|
5
27
|
lastMessage?: Message;
|
|
6
28
|
}
|
|
7
29
|
//# sourceMappingURL=B_topic_list_item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"B_topic_list_item.d.ts","sourceRoot":"","sources":["../../src/types/B_topic_list_item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
1
|
+
{"version":3,"file":"B_topic_list_item.d.ts","sourceRoot":"","sources":["../../src/types/B_topic_list_item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,+BAA+B;AAC/B,MAAM,WAAW,aAAa;IAC5B,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
1
20
|
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import type { Api } from "../2_tl.js";
|
|
21
|
+
import type { PeerGetter } from "./1_chat_p.js";
|
|
22
|
+
import type { StickerSetNameGetter } from "./1_sticker.js";
|
|
23
|
+
import type { MessageGetter } from "./9_message.js";
|
|
24
|
+
import { type RecentAction } from "./B_recent_action.js";
|
|
25
|
+
export interface RecentActionsEntry {
|
|
26
|
+
id: string;
|
|
27
|
+
date: number;
|
|
28
|
+
userId: number;
|
|
29
|
+
action: RecentAction;
|
|
30
|
+
}
|
|
31
|
+
export declare function constructRecentActionsEntry(cale: Api.ChannelAdminLogEvent, getPeer: PeerGetter, getMessage: MessageGetter, getStickerSetName: StickerSetNameGetter): Promise<RecentActionsEntry>;
|
|
32
|
+
//# sourceMappingURL=C_recent_actions_entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"C_recent_actions_entry.d.ts","sourceRoot":"","sources":["../../src/types/C_recent_actions_entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEhF,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAsB,2BAA2B,CAAC,IAAI,EAAE,GAAG,CAAC,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAWtM"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { constructRecentAction } from "./B_recent_action.js";
|
|
21
|
+
export async function constructRecentActionsEntry(cale, getPeer, getMessage, getStickerSetName) {
|
|
22
|
+
const id = String(cale.id);
|
|
23
|
+
const userId = Number(cale.user_id);
|
|
24
|
+
const date = cale.date;
|
|
25
|
+
const action = await constructRecentAction(cale.action, getPeer, getMessage, getStickerSetName);
|
|
26
|
+
return {
|
|
27
|
+
id,
|
|
28
|
+
date,
|
|
29
|
+
userId,
|
|
30
|
+
action,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,7 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
1
20
|
import { Api } from "../2_tl.js";
|
|
2
21
|
import type { PeerGetter } from "./1_chat_p.js";
|
|
3
22
|
import type { Message } from "./9_message.js";
|
|
4
23
|
import type { TopicListItem } from "./B_topic_list_item.js";
|
|
24
|
+
/** A list of topics. */
|
|
5
25
|
export interface TopicList {
|
|
6
26
|
/** The items in this list. */
|
|
7
27
|
items: TopicListItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"C_topic_list.d.ts","sourceRoot":"","sources":["../../src/types/C_topic_list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"C_topic_list.d.ts","sourceRoot":"","sources":["../../src/types/C_topic_list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,wBAAwB;AACxB,MAAM,WAAW,SAAS;IACxB,8BAA8B;IAC9B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,4DAA4D;IAC5D,uBAAuB,EAAE,OAAO,CAAC;IACjC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,oBAAoB,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,CAKxH"}
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
1
20
|
import { cleanObject } from "../1_utilities.js";
|
|
2
21
|
import { Api } from "../2_tl.js";
|
|
3
22
|
import { constructTopic2 } from "./A_topic.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_auth.d.ts","sourceRoot":"","sources":["../../src/utilities/1_auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"1_auth.d.ts","sourceRoot":"","sources":["../../src/utilities/1_auth.ts"],"names":[],"mappings":"AA2BA,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,oCAiCrF"}
|
package/esm/utilities/1_auth.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import * as dntShim from "../_dnt.shims.js";
|
|
21
21
|
import { assert, assertEquals, concat, ige256Encrypt } from "../0_deps.js";
|
|
22
|
+
import { RetryError } from "../0_errors.js";
|
|
22
23
|
import { sha256 } from "./0_hash.js";
|
|
23
24
|
import { intFromBytes, intToBytes, modExp } from "./0_int.js";
|
|
24
25
|
export async function rsaPad(data, [serverKey, exponent]) {
|
|
@@ -27,7 +28,7 @@ export async function rsaPad(data, [serverKey, exponent]) {
|
|
|
27
28
|
let tries = 0;
|
|
28
29
|
do {
|
|
29
30
|
if (++tries === 10) {
|
|
30
|
-
throw new
|
|
31
|
+
throw new RetryError("Out of tries.");
|
|
31
32
|
}
|
|
32
33
|
const dataWithPadding = concat([data, new Uint8Array(192 - data.byteLength)]);
|
|
33
34
|
const dataPadReversed = new Uint8Array(dataWithPadding).reverse();
|
package/package.json
CHANGED
package/script/0_errors.d.ts
CHANGED
|
@@ -39,4 +39,10 @@ export declare class TLError extends MtkrutoError {
|
|
|
39
39
|
get originalMessage(): string;
|
|
40
40
|
get path(): string[];
|
|
41
41
|
}
|
|
42
|
+
export declare class RetryError extends MtkrutoError {
|
|
43
|
+
constructor(...args: ConstructorParameters<typeof Error>);
|
|
44
|
+
}
|
|
45
|
+
export declare class PublicKeyError extends MtkrutoError {
|
|
46
|
+
constructor(...args: ConstructorParameters<typeof Error>);
|
|
47
|
+
}
|
|
42
48
|
//# sourceMappingURL=0_errors.d.ts.map
|
package/script/0_errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_errors.d.ts","sourceRoot":"","sources":["../src/0_errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8BAAsB,YAAa,SAAQ,KAAK;CAC/C;AAED,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,UAAW,SAAQ,YAAY;gBAC9B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,cAAe,SAAQ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ANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.TLError = exports.TransportError = exports.InputError = exports.AccessError = exports.ConnectionError = exports.MtkrutoError = void 0;
|
|
22
|
+
exports.PublicKeyError = exports.RetryError = exports.TLError = exports.TransportError = exports.InputError = exports.AccessError = exports.ConnectionError = exports.MtkrutoError = void 0;
|
|
23
23
|
class MtkrutoError extends Error {
|
|
24
24
|
}
|
|
25
25
|
exports.MtkrutoError = MtkrutoError;
|
|
@@ -70,3 +70,17 @@ class TLError extends MtkrutoError {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
exports.TLError = TLError;
|
|
73
|
+
class RetryError extends MtkrutoError {
|
|
74
|
+
constructor(...args) {
|
|
75
|
+
super(...args);
|
|
76
|
+
this.name = "RetryError";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.RetryError = RetryError;
|
|
80
|
+
class PublicKeyError extends MtkrutoError {
|
|
81
|
+
constructor(...args) {
|
|
82
|
+
super(...args);
|
|
83
|
+
this.name = "PublicKeyError";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.PublicKeyError = PublicKeyError;
|
package/script/3_types.d.ts
CHANGED
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
export * from "./types/_file_id.js";
|
|
21
21
|
export * from "./types/_getters.js";
|
|
22
|
-
export * from "./types/C_topic_list.js";
|
|
23
22
|
export * from "./types/0_authorization_session.js";
|
|
24
23
|
export * from "./types/0_authorization_state.js";
|
|
25
24
|
export * from "./types/0_birthday.js";
|
|
@@ -92,6 +91,7 @@ export * from "./types/1_audio.js";
|
|
|
92
91
|
export * from "./types/1_available_reactions.js";
|
|
93
92
|
export * from "./types/1_bot_command_scope.js";
|
|
94
93
|
export * from "./types/1_bot_commands.js";
|
|
94
|
+
export * from "./types/1_channel_location.js";
|
|
95
95
|
export * from "./types/1_chat_action.js";
|
|
96
96
|
export * from "./types/1_chat_p.js";
|
|
97
97
|
export * from "./types/1_country.js";
|
|
@@ -109,6 +109,7 @@ export * from "./types/1_network_statistics.js";
|
|
|
109
109
|
export * from "./types/1_order_info.js";
|
|
110
110
|
export * from "./types/1_photo.js";
|
|
111
111
|
export * from "./types/1_reaction_count.js";
|
|
112
|
+
export * from "./types/1_sticker_set_p.js";
|
|
112
113
|
export * from "./types/1_sticker.js";
|
|
113
114
|
export * from "./types/1_story_reaction.js";
|
|
114
115
|
export * from "./types/1_story_report_result.js";
|
|
@@ -143,6 +144,7 @@ export * from "./types/3_app_support.js";
|
|
|
143
144
|
export * from "./types/3_blocked_user.js";
|
|
144
145
|
export * from "./types/3_bot_access_settings.js";
|
|
145
146
|
export * from "./types/3_business_connection.js";
|
|
147
|
+
export * from "./types/3_chat_join_result.js";
|
|
146
148
|
export * from "./types/3_chat_settings.js";
|
|
147
149
|
export * from "./types/3_checklist_item.js";
|
|
148
150
|
export * from "./types/3_chosen_inline_result.js";
|
|
@@ -161,6 +163,7 @@ export * from "./types/3_message_reactions.js";
|
|
|
161
163
|
export * from "./types/3_poll_voter_list.js";
|
|
162
164
|
export * from "./types/3_pre_checkout_query.js";
|
|
163
165
|
export * from "./types/3_reply_quote.js";
|
|
166
|
+
export * from "./types/3_resolved_invite_link.js";
|
|
164
167
|
export * from "./types/3_rich_text_component.js";
|
|
165
168
|
export * from "./types/3_story_album.js";
|
|
166
169
|
export * from "./types/3_story.js";
|
|
@@ -197,7 +200,10 @@ export * from "./types/A_guest_query.js";
|
|
|
197
200
|
export * from "./types/A_message_list.js";
|
|
198
201
|
export * from "./types/A_saved_chat.js";
|
|
199
202
|
export * from "./types/A_topic.js";
|
|
203
|
+
export * from "./types/B_recent_action.js";
|
|
200
204
|
export * from "./types/B_saved_chats.js";
|
|
201
|
-
export * from "./types/B_update.js";
|
|
202
205
|
export * from "./types/B_topic_list_item.js";
|
|
206
|
+
export * from "./types/B_update.js";
|
|
207
|
+
export * from "./types/C_recent_actions_entry.js";
|
|
208
|
+
export * from "./types/C_topic_list.js";
|
|
203
209
|
//# sourceMappingURL=3_types.d.ts.map
|
package/script/3_types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_types.d.ts","sourceRoot":"","sources":["../src/3_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"3_types.d.ts","sourceRoot":"","sources":["../src/3_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,yBAAyB,CAAC;AACxC,cAAc,kCAAkC,CAAC;AACjD,cAAc,iBAAiB,CAAC;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