@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,325 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.constructRecentAction = constructRecentAction;
|
|
23
|
+
const _0_deps_js_1 = require("../0_deps.js");
|
|
24
|
+
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
25
|
+
const _2_tl_js_1 = require("../2_tl.js");
|
|
26
|
+
const _2_telegram_js_1 = require("../tl/2_telegram.js");
|
|
27
|
+
const _0_chat_member_rights_js_1 = require("./0_chat_member_rights.js");
|
|
28
|
+
const _1_available_reactions_js_1 = require("./1_available_reactions.js");
|
|
29
|
+
const _1_channel_location_js_1 = require("./1_channel_location.js");
|
|
30
|
+
const _1_photo_js_1 = require("./1_photo.js");
|
|
31
|
+
const _2_chat_member_js_1 = require("./2_chat_member.js");
|
|
32
|
+
const _3_invite_link_js_1 = require("./3_invite_link.js");
|
|
33
|
+
const _9_message_js_1 = require("./9_message.js");
|
|
34
|
+
const A_topic_js_1 = require("./A_topic.js");
|
|
35
|
+
function getChannelParticipantPeer(participant) {
|
|
36
|
+
switch (participant._) {
|
|
37
|
+
case "channelParticipant":
|
|
38
|
+
case "channelParticipantSelf":
|
|
39
|
+
case "channelParticipantCreator":
|
|
40
|
+
case "channelParticipantAdmin":
|
|
41
|
+
return { _: "peerUser", user_id: participant.user_id };
|
|
42
|
+
case "channelParticipantBanned":
|
|
43
|
+
case "channelParticipantLeft":
|
|
44
|
+
return participant.peer;
|
|
45
|
+
default:
|
|
46
|
+
(0, _0_deps_js_1.unreachable)();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async function constructRecentAction(a, getPeer, getMessage, getStickerSetName) {
|
|
50
|
+
switch (a._) {
|
|
51
|
+
case "channelAdminLogEventActionChangeTitle":
|
|
52
|
+
return {
|
|
53
|
+
type: "changeTitle",
|
|
54
|
+
previous: a.prev_value,
|
|
55
|
+
new: a.new_value,
|
|
56
|
+
};
|
|
57
|
+
case "channelAdminLogEventActionChangeAbout":
|
|
58
|
+
return {
|
|
59
|
+
type: "changeDescription",
|
|
60
|
+
previous: a.prev_value,
|
|
61
|
+
new: a.new_value,
|
|
62
|
+
};
|
|
63
|
+
case "channelAdminLogEventActionChangeUsername":
|
|
64
|
+
return {
|
|
65
|
+
type: "changeUsername",
|
|
66
|
+
previous: a.prev_value,
|
|
67
|
+
new: a.prev_value,
|
|
68
|
+
};
|
|
69
|
+
case "channelAdminLogEventActionChangePhoto":
|
|
70
|
+
return {
|
|
71
|
+
type: "changePhoto",
|
|
72
|
+
previous: (0, _1_photo_js_1.constructPhoto)(_2_tl_js_1.Api.as("photo", a.prev_photo)),
|
|
73
|
+
new: (0, _1_photo_js_1.constructPhoto)(_2_tl_js_1.Api.as("photo", a.new_photo)),
|
|
74
|
+
};
|
|
75
|
+
case "channelAdminLogEventActionToggleInvites":
|
|
76
|
+
return {
|
|
77
|
+
type: "toggleInvites",
|
|
78
|
+
isEnabled: a.new_value,
|
|
79
|
+
};
|
|
80
|
+
case "channelAdminLogEventActionToggleSignatures":
|
|
81
|
+
return {
|
|
82
|
+
type: "toggleSignatures",
|
|
83
|
+
isEnabled: a.new_value,
|
|
84
|
+
};
|
|
85
|
+
case "channelAdminLogEventActionUpdatePinned":
|
|
86
|
+
return {
|
|
87
|
+
type: "pinMessage",
|
|
88
|
+
message: await (0, _9_message_js_1.constructMessage)(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
89
|
+
};
|
|
90
|
+
case "channelAdminLogEventActionEditMessage":
|
|
91
|
+
return {
|
|
92
|
+
type: "editMessage",
|
|
93
|
+
previous: await (0, _9_message_js_1.constructMessage)(a.prev_message, getPeer, getMessage, getStickerSetName, false),
|
|
94
|
+
new: await (0, _9_message_js_1.constructMessage)(a.new_message, getPeer, getMessage, getStickerSetName, false),
|
|
95
|
+
};
|
|
96
|
+
case "channelAdminLogEventActionDeleteMessage":
|
|
97
|
+
return {
|
|
98
|
+
type: "deleteMessage",
|
|
99
|
+
message: await (0, _9_message_js_1.constructMessage)(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
100
|
+
};
|
|
101
|
+
case "channelAdminLogEventActionParticipantJoin":
|
|
102
|
+
return {
|
|
103
|
+
type: "join",
|
|
104
|
+
};
|
|
105
|
+
case "channelAdminLogEventActionParticipantLeave":
|
|
106
|
+
return {
|
|
107
|
+
type: "leave",
|
|
108
|
+
};
|
|
109
|
+
case "channelAdminLogEventActionParticipantInvite": {
|
|
110
|
+
const peer = getPeer(getChannelParticipantPeer(a.participant));
|
|
111
|
+
if (peer === null) {
|
|
112
|
+
(0, _0_deps_js_1.unreachable)();
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
type: "invite",
|
|
116
|
+
chatMember: (0, _2_chat_member_js_1.constructChatMember)(peer[0], a.participant, getPeer),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
case "channelAdminLogEventActionParticipantToggleBan": {
|
|
120
|
+
const peer = getPeer(getChannelParticipantPeer(a.new_participant));
|
|
121
|
+
if (peer === null) {
|
|
122
|
+
(0, _0_deps_js_1.unreachable)();
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
type: "toggleRestriction",
|
|
126
|
+
previous: (0, _2_chat_member_js_1.constructChatMember)(peer[0], a.prev_participant, getPeer),
|
|
127
|
+
new: (0, _2_chat_member_js_1.constructChatMember)(peer[0], a.new_participant, getPeer),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
case "channelAdminLogEventActionParticipantToggleAdmin": {
|
|
131
|
+
const peer = getPeer(getChannelParticipantPeer(a.new_participant));
|
|
132
|
+
if (peer === null) {
|
|
133
|
+
(0, _0_deps_js_1.unreachable)();
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
type: "togglePromotion",
|
|
137
|
+
previous: (0, _2_chat_member_js_1.constructChatMember)(peer[0], a.prev_participant, getPeer),
|
|
138
|
+
new: (0, _2_chat_member_js_1.constructChatMember)(peer[0], a.new_participant, getPeer),
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
case "channelAdminLogEventActionChangeStickerSet":
|
|
142
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
143
|
+
type: "changeStickerSet",
|
|
144
|
+
previous: _2_tl_js_1.Api.is("inputStickerSetShortName", a.prev_stickerset) ? a.prev_stickerset.short_name : undefined,
|
|
145
|
+
new: _2_tl_js_1.Api.is("inputStickerSetShortName", a.new_stickerset) ? a.new_stickerset.short_name : undefined,
|
|
146
|
+
});
|
|
147
|
+
case "channelAdminLogEventActionTogglePreHistoryHidden":
|
|
148
|
+
return {
|
|
149
|
+
type: "toggleChatHistoryForNewMembers",
|
|
150
|
+
isEnabled: a.new_value,
|
|
151
|
+
};
|
|
152
|
+
case "channelAdminLogEventActionDefaultBannedRights":
|
|
153
|
+
return {
|
|
154
|
+
type: "setDefaultPermissions",
|
|
155
|
+
previous: (0, _0_chat_member_rights_js_1.constructChatMemberRights)(a.prev_banned_rights),
|
|
156
|
+
new: (0, _0_chat_member_rights_js_1.constructChatMemberRights)(a.new_banned_rights),
|
|
157
|
+
};
|
|
158
|
+
case "channelAdminLogEventActionStopPoll":
|
|
159
|
+
return {
|
|
160
|
+
type: "stopPoll",
|
|
161
|
+
message: await (0, _9_message_js_1.constructMessage)(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
162
|
+
};
|
|
163
|
+
case "channelAdminLogEventActionChangeLinkedChat":
|
|
164
|
+
return {
|
|
165
|
+
type: "changeDiscussionChat",
|
|
166
|
+
previous: (0, _2_telegram_js_1.peerToChatId)({ _: "peerChannel", channel_id: a.prev_value }),
|
|
167
|
+
new: (0, _2_telegram_js_1.peerToChatId)({ _: "peerChannel", channel_id: a.new_value }),
|
|
168
|
+
};
|
|
169
|
+
case "channelAdminLogEventActionChangeLocation":
|
|
170
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
171
|
+
type: "changeLocation",
|
|
172
|
+
previous: _2_tl_js_1.Api.is("channelLocation", a.prev_value) ? (0, _1_channel_location_js_1.constructChannelLocation)(a.prev_value) : undefined,
|
|
173
|
+
new: _2_tl_js_1.Api.is("channelLocation", a.new_value) ? (0, _1_channel_location_js_1.constructChannelLocation)(a.new_value) : undefined,
|
|
174
|
+
});
|
|
175
|
+
case "channelAdminLogEventActionToggleSlowMode":
|
|
176
|
+
return {
|
|
177
|
+
type: "setSlowMode",
|
|
178
|
+
previous: a.prev_value,
|
|
179
|
+
new: a.new_value,
|
|
180
|
+
};
|
|
181
|
+
case "channelAdminLogEventActionStartGroupCall":
|
|
182
|
+
return {
|
|
183
|
+
type: "startVideoChat",
|
|
184
|
+
};
|
|
185
|
+
case "channelAdminLogEventActionDiscardGroupCall":
|
|
186
|
+
return {
|
|
187
|
+
type: "endVideoChat",
|
|
188
|
+
};
|
|
189
|
+
case "channelAdminLogEventActionParticipantMute":
|
|
190
|
+
return {
|
|
191
|
+
type: "muteVideoChatParticipant",
|
|
192
|
+
participant: (0, _2_telegram_js_1.peerToChatId)(a.participant.peer),
|
|
193
|
+
};
|
|
194
|
+
case "channelAdminLogEventActionParticipantUnmute":
|
|
195
|
+
return {
|
|
196
|
+
type: "unmuteVideoChatParticipant",
|
|
197
|
+
participant: (0, _2_telegram_js_1.peerToChatId)(a.participant.peer),
|
|
198
|
+
};
|
|
199
|
+
case "channelAdminLogEventActionToggleGroupCallSetting":
|
|
200
|
+
return {
|
|
201
|
+
type: "toggleVideoChatDefaultMuted",
|
|
202
|
+
defaultMuted: a.join_muted,
|
|
203
|
+
};
|
|
204
|
+
case "channelAdminLogEventActionParticipantJoinByInvite":
|
|
205
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
206
|
+
type: "joinByInvite",
|
|
207
|
+
inviteLink: _2_tl_js_1.Api.is("chatInviteExported", a.invite) ? (0, _3_invite_link_js_1.constructInviteLink)(a.invite, getPeer) : undefined,
|
|
208
|
+
isViaList: !!a.via_chatlist,
|
|
209
|
+
});
|
|
210
|
+
case "channelAdminLogEventActionExportedInviteDelete":
|
|
211
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
212
|
+
type: "deleteInviteLink",
|
|
213
|
+
inviteLink: _2_tl_js_1.Api.is("chatInviteExported", a.invite) ? (0, _3_invite_link_js_1.constructInviteLink)(a.invite, getPeer) : undefined,
|
|
214
|
+
});
|
|
215
|
+
case "channelAdminLogEventActionExportedInviteRevoke":
|
|
216
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
217
|
+
type: "revokeInviteLink",
|
|
218
|
+
inviteLink: _2_tl_js_1.Api.is("chatInviteExported", a.invite) ? (0, _3_invite_link_js_1.constructInviteLink)(a.invite, getPeer) : undefined,
|
|
219
|
+
});
|
|
220
|
+
case "channelAdminLogEventActionExportedInviteEdit":
|
|
221
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
222
|
+
type: "editInviteLink",
|
|
223
|
+
previous: _2_tl_js_1.Api.is("chatInviteExported", a.prev_invite) ? (0, _3_invite_link_js_1.constructInviteLink)(a.prev_invite, getPeer) : undefined,
|
|
224
|
+
new: _2_tl_js_1.Api.is("chatInviteExported", a.new_invite) ? (0, _3_invite_link_js_1.constructInviteLink)(a.new_invite, getPeer) : undefined,
|
|
225
|
+
});
|
|
226
|
+
case "channelAdminLogEventActionParticipantVolume":
|
|
227
|
+
return {
|
|
228
|
+
type: "setVideoChatParticipantVolume",
|
|
229
|
+
participant: (0, _2_telegram_js_1.peerToChatId)(a.participant.peer),
|
|
230
|
+
};
|
|
231
|
+
case "channelAdminLogEventActionChangeHistoryTTL":
|
|
232
|
+
return {
|
|
233
|
+
type: "setHistoryTtl",
|
|
234
|
+
previous: a.prev_value,
|
|
235
|
+
new: a.new_value,
|
|
236
|
+
};
|
|
237
|
+
case "channelAdminLogEventActionParticipantJoinByRequest":
|
|
238
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
239
|
+
type: "joinByRequest",
|
|
240
|
+
inviteLink: _2_tl_js_1.Api.is("chatInviteExported", a.invite) ? (0, _3_invite_link_js_1.constructInviteLink)(a.invite, getPeer) : undefined,
|
|
241
|
+
approvedBy: Number(a.approved_by),
|
|
242
|
+
});
|
|
243
|
+
case "channelAdminLogEventActionToggleNoForwards":
|
|
244
|
+
return {
|
|
245
|
+
type: "toggleContentProtection",
|
|
246
|
+
isEnabled: a.new_value,
|
|
247
|
+
};
|
|
248
|
+
case "channelAdminLogEventActionSendMessage":
|
|
249
|
+
return {
|
|
250
|
+
type: "sendMessage",
|
|
251
|
+
message: await (0, _9_message_js_1.constructMessage)(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
252
|
+
};
|
|
253
|
+
case "channelAdminLogEventActionChangeAvailableReactions":
|
|
254
|
+
return {
|
|
255
|
+
type: "setAvailableReactions",
|
|
256
|
+
previous: (0, _1_available_reactions_js_1.constructAvailableReactions)(a.prev_value),
|
|
257
|
+
new: (0, _1_available_reactions_js_1.constructAvailableReactions)(a.new_value),
|
|
258
|
+
};
|
|
259
|
+
case "channelAdminLogEventActionChangeUsernames":
|
|
260
|
+
return {
|
|
261
|
+
type: "setUsernames",
|
|
262
|
+
previous: a.prev_value,
|
|
263
|
+
new: a.new_value,
|
|
264
|
+
};
|
|
265
|
+
case "channelAdminLogEventActionToggleForum":
|
|
266
|
+
return {
|
|
267
|
+
type: "toggleAntispam",
|
|
268
|
+
isEnabled: a.new_value,
|
|
269
|
+
};
|
|
270
|
+
case "channelAdminLogEventActionCreateTopic":
|
|
271
|
+
return {
|
|
272
|
+
type: "createTopic",
|
|
273
|
+
topic: (0, A_topic_js_1.constructTopic2)(a.topic, getPeer),
|
|
274
|
+
};
|
|
275
|
+
case "channelAdminLogEventActionEditTopic":
|
|
276
|
+
return {
|
|
277
|
+
type: "editTopic",
|
|
278
|
+
previous: (0, A_topic_js_1.constructTopic2)(a.prev_topic, getPeer),
|
|
279
|
+
new: (0, A_topic_js_1.constructTopic2)(a.new_topic, getPeer),
|
|
280
|
+
};
|
|
281
|
+
case "channelAdminLogEventActionDeleteTopic":
|
|
282
|
+
return {
|
|
283
|
+
type: "deleteTopic",
|
|
284
|
+
topic: (0, A_topic_js_1.constructTopic2)(a.topic, getPeer),
|
|
285
|
+
};
|
|
286
|
+
case "channelAdminLogEventActionPinTopic":
|
|
287
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
288
|
+
type: "pinTopic",
|
|
289
|
+
previous: a.prev_topic ? (0, A_topic_js_1.constructTopic2)(a.prev_topic, getPeer) : undefined,
|
|
290
|
+
new: a.new_topic ? (0, A_topic_js_1.constructTopic2)(a.new_topic, getPeer) : undefined,
|
|
291
|
+
});
|
|
292
|
+
case "channelAdminLogEventActionToggleAntiSpam":
|
|
293
|
+
return {
|
|
294
|
+
type: "toggleAntispam",
|
|
295
|
+
isEnabled: a.new_value,
|
|
296
|
+
};
|
|
297
|
+
case "channelAdminLogEventActionChangeEmojiStickerSet":
|
|
298
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
299
|
+
type: "setEmojiStickerSet",
|
|
300
|
+
previous: _2_tl_js_1.Api.is("inputStickerSetShortName", a.prev_stickerset) ? a.prev_stickerset.short_name : undefined,
|
|
301
|
+
new: _2_tl_js_1.Api.is("inputStickerSetShortName", a.new_stickerset) ? a.new_stickerset.short_name : undefined,
|
|
302
|
+
});
|
|
303
|
+
case "channelAdminLogEventActionToggleSignatureProfiles":
|
|
304
|
+
return {
|
|
305
|
+
type: "toggleSignatures",
|
|
306
|
+
isEnabled: a.new_value,
|
|
307
|
+
};
|
|
308
|
+
case "channelAdminLogEventActionToggleAutotranslation":
|
|
309
|
+
return {
|
|
310
|
+
type: "toggleAutomaticTranslation",
|
|
311
|
+
isEnabled: a.new_value,
|
|
312
|
+
};
|
|
313
|
+
case "channelAdminLogEventActionParticipantEditRank":
|
|
314
|
+
return (0, _1_utilities_js_1.cleanObject)({
|
|
315
|
+
type: "editChatMemberTag",
|
|
316
|
+
userId: Number(a.user_id),
|
|
317
|
+
previous: a.prev_rank || undefined,
|
|
318
|
+
newTag: a.new_rank || undefined,
|
|
319
|
+
});
|
|
320
|
+
default:
|
|
321
|
+
return {
|
|
322
|
+
type: "unsupported",
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
}
|
|
@@ -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,2 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
2
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -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,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.constructRecentActionsEntry = constructRecentActionsEntry;
|
|
23
|
+
const B_recent_action_js_1 = require("./B_recent_action.js");
|
|
24
|
+
async function constructRecentActionsEntry(cale, getPeer, getMessage, getStickerSetName) {
|
|
25
|
+
const id = String(cale.id);
|
|
26
|
+
const userId = Number(cale.user_id);
|
|
27
|
+
const date = cale.date;
|
|
28
|
+
const action = await (0, B_recent_action_js_1.constructRecentAction)(cale.action, getPeer, getMessage, getStickerSetName);
|
|
29
|
+
return {
|
|
30
|
+
id,
|
|
31
|
+
date,
|
|
32
|
+
userId,
|
|
33
|
+
action,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -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,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
2
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
22
|
exports.constructTopicList = constructTopicList;
|
|
4
23
|
const _1_utilities_js_1 = require("../1_utilities.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"}
|
|
@@ -55,6 +55,7 @@ exports.rsaPad = rsaPad;
|
|
|
55
55
|
*/
|
|
56
56
|
const dntShim = __importStar(require("../_dnt.shims.js"));
|
|
57
57
|
const _0_deps_js_1 = require("../0_deps.js");
|
|
58
|
+
const _0_errors_js_1 = require("../0_errors.js");
|
|
58
59
|
const _0_hash_js_1 = require("./0_hash.js");
|
|
59
60
|
const _0_int_js_1 = require("./0_int.js");
|
|
60
61
|
async function rsaPad(data, [serverKey, exponent]) {
|
|
@@ -63,7 +64,7 @@ async function rsaPad(data, [serverKey, exponent]) {
|
|
|
63
64
|
let tries = 0;
|
|
64
65
|
do {
|
|
65
66
|
if (++tries === 10) {
|
|
66
|
-
throw new
|
|
67
|
+
throw new _0_errors_js_1.RetryError("Out of tries.");
|
|
67
68
|
}
|
|
68
69
|
const dataWithPadding = (0, _0_deps_js_1.concat)([data, new Uint8Array(192 - data.byteLength)]);
|
|
69
70
|
const dataPadReversed = new Uint8Array(dataWithPadding).reverse();
|