@mtcute/core 0.29.6 → 0.30.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/client.cjs +8 -0
- package/client.js +8 -0
- package/highlevel/client.d.cts +23 -7
- package/highlevel/client.d.ts +23 -7
- package/highlevel/methods/bots/answer-bot-guest-chat-query.cjs +26 -0
- package/highlevel/methods/bots/answer-bot-guest-chat-query.d.cts +12 -0
- package/highlevel/methods/bots/answer-bot-guest-chat-query.d.ts +12 -0
- package/highlevel/methods/bots/answer-bot-guest-chat-query.js +21 -0
- package/highlevel/methods/chats/join-chat.cjs +38 -16
- package/highlevel/methods/chats/join-chat.d.cts +20 -6
- package/highlevel/methods/chats/join-chat.d.ts +20 -6
- package/highlevel/methods/chats/join-chat.js +38 -16
- package/highlevel/methods/chats/save-draft.d.cts +4 -1
- package/highlevel/methods/chats/save-draft.d.ts +4 -1
- package/highlevel/methods/messages/send-copy-group.cjs +5 -9
- package/highlevel/methods/messages/send-copy-group.js +5 -9
- package/highlevel/methods.d.cts +3 -0
- package/highlevel/methods.d.ts +3 -0
- package/highlevel/storage/service/peers.cjs +2 -0
- package/highlevel/storage/service/peers.js +2 -0
- package/highlevel/types/files/utils.d.cts +1 -1
- package/highlevel/types/files/utils.d.ts +1 -1
- package/highlevel/types/media/poll.cjs +14 -0
- package/highlevel/types/media/poll.d.cts +6 -0
- package/highlevel/types/media/poll.d.ts +6 -0
- package/highlevel/types/media/poll.js +14 -0
- package/highlevel/types/messages/index.d.cts +1 -0
- package/highlevel/types/messages/index.d.ts +1 -0
- package/highlevel/types/messages/message.cjs +15 -1
- package/highlevel/types/messages/message.d.cts +8 -0
- package/highlevel/types/messages/message.d.ts +8 -0
- package/highlevel/types/messages/message.js +15 -1
- package/highlevel/types/messages/rich-message.cjs +50 -0
- package/highlevel/types/messages/rich-message.d.cts +18 -0
- package/highlevel/types/messages/rich-message.d.ts +18 -0
- package/highlevel/types/messages/rich-message.js +45 -0
- package/highlevel/types/peers/chat-permissions.cjs +6 -0
- package/highlevel/types/peers/chat-permissions.d.cts +4 -0
- package/highlevel/types/peers/chat-permissions.d.ts +4 -0
- package/highlevel/types/peers/chat-permissions.js +6 -0
- package/highlevel/types/peers/full-chat.cjs +6 -0
- package/highlevel/types/peers/full-chat.d.cts +2 -0
- package/highlevel/types/peers/full-chat.d.ts +2 -0
- package/highlevel/types/peers/full-chat.js +6 -0
- package/highlevel/types/peers/user.cjs +8 -0
- package/highlevel/types/peers/user.d.cts +4 -0
- package/highlevel/types/peers/user.d.ts +4 -0
- package/highlevel/types/peers/user.js +8 -0
- package/highlevel/types/updates/bot-guest-chat-query.cjs +39 -0
- package/highlevel/types/updates/bot-guest-chat-query.d.cts +21 -0
- package/highlevel/types/updates/bot-guest-chat-query.d.ts +21 -0
- package/highlevel/types/updates/bot-guest-chat-query.js +34 -0
- package/highlevel/types/updates/index.d.cts +5 -1
- package/highlevel/types/updates/index.d.ts +5 -1
- package/highlevel/types/updates/parse-update.cjs +3 -0
- package/highlevel/types/updates/parse-update.js +3 -0
- package/highlevel/types/updates/user-typing-update.cjs +2 -0
- package/highlevel/types/updates/user-typing-update.js +2 -0
- package/highlevel/updates/manager.cjs +214 -3
- package/highlevel/updates/manager.d.cts +1 -0
- package/highlevel/updates/manager.d.ts +1 -0
- package/highlevel/updates/manager.js +214 -3
- package/highlevel/utils/inspectable.cjs +1 -0
- package/highlevel/utils/inspectable.d.cts +1 -0
- package/highlevel/utils/inspectable.d.ts +1 -0
- package/highlevel/utils/inspectable.js +1 -0
- package/index.cjs +4 -0
- package/index.js +4 -0
- package/methods.cjs +2 -0
- package/methods.js +2 -0
- package/network/flood-control.cjs +149 -0
- package/network/flood-control.d.cts +79 -0
- package/network/flood-control.d.ts +79 -0
- package/network/flood-control.js +144 -0
- package/network/flood-control.test.d.cts +1 -0
- package/network/flood-control.test.d.ts +1 -0
- package/network/mtproto-session.cjs +1 -21
- package/network/mtproto-session.d.cts +1 -5
- package/network/mtproto-session.d.ts +1 -5
- package/network/mtproto-session.js +2 -22
- package/network/multi-session-connection.cjs +26 -16
- package/network/multi-session-connection.d.cts +1 -1
- package/network/multi-session-connection.d.ts +1 -1
- package/network/multi-session-connection.js +26 -16
- package/network/multi-session-connection.test.d.cts +1 -0
- package/network/multi-session-connection.test.d.ts +1 -0
- package/network/network-manager.cjs +3 -2
- package/network/network-manager.d.cts +12 -0
- package/network/network-manager.d.ts +12 -0
- package/network/network-manager.js +3 -2
- package/network/persistent-connection.cjs +25 -1
- package/network/persistent-connection.d.cts +5 -0
- package/network/persistent-connection.d.ts +5 -0
- package/network/persistent-connection.js +25 -1
- package/network/session-connection.cjs +5 -10
- package/network/session-connection.d.cts +0 -2
- package/network/session-connection.d.ts +0 -2
- package/network/session-connection.js +5 -10
- package/package.json +1 -1
- package/tl/api-schema.json +1 -1
- package/tl/binary/reader.cjs +257 -62
- package/tl/binary/reader.js +257 -62
- package/tl/binary/writer.cjs +837 -212
- package/tl/binary/writer.js +837 -212
- package/tl/compat/reader.cjs +31 -0
- package/tl/compat/reader.js +31 -0
- package/tl/index.d.cts +2478 -186
- package/tl/index.d.ts +2478 -186
- package/tl/inner-tl.cjs +34 -10
- package/tl/inner-tl.js +34 -10
- package/utils/binary/compat.cjs +84 -0
- package/utils/binary/compat.js +84 -0
- package/utils/index.d.cts +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/long-utils.cjs +10 -0
- package/utils/long-utils.js +10 -0
- package/utils.cjs +7 -0
- package/utils.js +8 -1
package/utils/binary/compat.cjs
CHANGED
|
@@ -124,6 +124,7 @@ function mapCompatEmojiStatus(obj) {
|
|
|
124
124
|
function mapCompatPoll(obj) {
|
|
125
125
|
switch (obj._) {
|
|
126
126
|
case "poll_layer223":
|
|
127
|
+
case "poll_layer224":
|
|
127
128
|
return {
|
|
128
129
|
...obj,
|
|
129
130
|
_: "poll",
|
|
@@ -135,6 +136,72 @@ function mapCompatPoll(obj) {
|
|
|
135
136
|
return obj;
|
|
136
137
|
}
|
|
137
138
|
}
|
|
139
|
+
function mapCompatPageListOrderedItem(obj) {
|
|
140
|
+
switch (obj._) {
|
|
141
|
+
case "pageListOrderedItemBlocks_layer225":
|
|
142
|
+
return {
|
|
143
|
+
...obj,
|
|
144
|
+
_: "pageListOrderedItemBlocks",
|
|
145
|
+
blocks: obj.blocks.map(mapCompatPageBlock)
|
|
146
|
+
};
|
|
147
|
+
case "pageListOrderedItemText_layer225":
|
|
148
|
+
return replaceType(obj, "pageListOrderedItemText");
|
|
149
|
+
default:
|
|
150
|
+
return obj;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function mapCompatPageListItem(obj) {
|
|
154
|
+
switch (obj._) {
|
|
155
|
+
case "pageListItemBlocks_layer225":
|
|
156
|
+
return {
|
|
157
|
+
...obj,
|
|
158
|
+
_: "pageListItemBlocks",
|
|
159
|
+
blocks: obj.blocks.map(mapCompatPageBlock)
|
|
160
|
+
};
|
|
161
|
+
case "pageListItemText_layer225":
|
|
162
|
+
return replaceType(obj, "pageListItemText");
|
|
163
|
+
default:
|
|
164
|
+
return obj;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function mapCompatPageBlock(obj) {
|
|
168
|
+
switch (obj._) {
|
|
169
|
+
case "pageBlockOrderedList_layer225":
|
|
170
|
+
return {
|
|
171
|
+
...obj,
|
|
172
|
+
_: "pageBlockOrderedList",
|
|
173
|
+
items: obj.items.map(mapCompatPageListOrderedItem)
|
|
174
|
+
};
|
|
175
|
+
case "pageBlockList":
|
|
176
|
+
return {
|
|
177
|
+
...obj,
|
|
178
|
+
items: obj.items.map(mapCompatPageListItem)
|
|
179
|
+
};
|
|
180
|
+
case "pageBlockDetails":
|
|
181
|
+
return {
|
|
182
|
+
...obj,
|
|
183
|
+
blocks: obj.blocks.map(mapCompatPageBlock)
|
|
184
|
+
};
|
|
185
|
+
case "pageBlockEmbedPost":
|
|
186
|
+
return {
|
|
187
|
+
...obj,
|
|
188
|
+
blocks: obj.blocks.map(mapCompatPageBlock)
|
|
189
|
+
};
|
|
190
|
+
case "pageBlockCollage":
|
|
191
|
+
case "pageBlockSlideshow":
|
|
192
|
+
return {
|
|
193
|
+
...obj,
|
|
194
|
+
items: obj.items.map(mapCompatPageBlock)
|
|
195
|
+
};
|
|
196
|
+
case "pageBlockCover":
|
|
197
|
+
return {
|
|
198
|
+
...obj,
|
|
199
|
+
cover: mapCompatPageBlock(obj.cover)
|
|
200
|
+
};
|
|
201
|
+
default:
|
|
202
|
+
return obj;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
138
205
|
function mapCompatMessageMedia(obj) {
|
|
139
206
|
switch (obj._) {
|
|
140
207
|
case "messageMediaDocument_layer197":
|
|
@@ -235,6 +302,8 @@ function mapCompatMessage(obj) {
|
|
|
235
302
|
case "message_layer216":
|
|
236
303
|
case "message_layer220":
|
|
237
304
|
case "message_layer222":
|
|
305
|
+
case "message_layer224":
|
|
306
|
+
case "message_layer225":
|
|
238
307
|
return {
|
|
239
308
|
...obj,
|
|
240
309
|
_: "message",
|
|
@@ -322,6 +391,7 @@ function mapCompatObject(obj) {
|
|
|
322
391
|
return mapCompatMessageMedia(obj);
|
|
323
392
|
case "channelFull_layer197":
|
|
324
393
|
case "channelFull_layer204":
|
|
394
|
+
case "channelFull_layer225":
|
|
325
395
|
return replaceType(obj, "channelFull");
|
|
326
396
|
case "messageActionStarGift_layer197":
|
|
327
397
|
case "messageActionStarGift_layer211":
|
|
@@ -372,6 +442,8 @@ function mapCompatObject(obj) {
|
|
|
372
442
|
case "message_layer216":
|
|
373
443
|
case "message_layer220":
|
|
374
444
|
case "message_layer222":
|
|
445
|
+
case "message_layer224":
|
|
446
|
+
case "message_layer225":
|
|
375
447
|
case "messageService_layer204":
|
|
376
448
|
return mapCompatMessage(obj);
|
|
377
449
|
case "messageReplyHeader_layer206":
|
|
@@ -417,6 +489,8 @@ function mapCompatObject(obj) {
|
|
|
417
489
|
return mapCompatPoll(obj);
|
|
418
490
|
case "pollAnswer_layer223":
|
|
419
491
|
return replaceType(obj, "pollAnswer");
|
|
492
|
+
case "poll_layer224":
|
|
493
|
+
return mapCompatPoll(obj);
|
|
420
494
|
case "keyboardButton_layer221":
|
|
421
495
|
case "keyboardButtonUrl_layer221":
|
|
422
496
|
case "keyboardButtonCallback_layer221":
|
|
@@ -436,6 +510,16 @@ function mapCompatObject(obj) {
|
|
|
436
510
|
case "inputKeyboardButtonRequestPeer_layer221":
|
|
437
511
|
case "keyboardButtonCopy_layer221":
|
|
438
512
|
return mapCompatKeyboardButton(obj);
|
|
513
|
+
case "pageBlockOrderedList_layer225":
|
|
514
|
+
return mapCompatPageBlock(obj);
|
|
515
|
+
case "pageListOrderedItemBlocks_layer225":
|
|
516
|
+
return mapCompatPageListOrderedItem(obj);
|
|
517
|
+
case "pageListItemBlocks_layer225":
|
|
518
|
+
return mapCompatPageListItem(obj);
|
|
519
|
+
case "pageListItemText_layer225":
|
|
520
|
+
return mapCompatPageListItem(obj);
|
|
521
|
+
case "pageListOrderedItemText_layer225":
|
|
522
|
+
return mapCompatPageListOrderedItem(obj);
|
|
439
523
|
default:
|
|
440
524
|
return obj;
|
|
441
525
|
}
|
package/utils/binary/compat.js
CHANGED
|
@@ -117,6 +117,7 @@ function mapCompatEmojiStatus(obj) {
|
|
|
117
117
|
function mapCompatPoll(obj) {
|
|
118
118
|
switch (obj._) {
|
|
119
119
|
case "poll_layer223":
|
|
120
|
+
case "poll_layer224":
|
|
120
121
|
return {
|
|
121
122
|
...obj,
|
|
122
123
|
_: "poll",
|
|
@@ -128,6 +129,72 @@ function mapCompatPoll(obj) {
|
|
|
128
129
|
return obj;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
132
|
+
function mapCompatPageListOrderedItem(obj) {
|
|
133
|
+
switch (obj._) {
|
|
134
|
+
case "pageListOrderedItemBlocks_layer225":
|
|
135
|
+
return {
|
|
136
|
+
...obj,
|
|
137
|
+
_: "pageListOrderedItemBlocks",
|
|
138
|
+
blocks: obj.blocks.map(mapCompatPageBlock)
|
|
139
|
+
};
|
|
140
|
+
case "pageListOrderedItemText_layer225":
|
|
141
|
+
return replaceType(obj, "pageListOrderedItemText");
|
|
142
|
+
default:
|
|
143
|
+
return obj;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function mapCompatPageListItem(obj) {
|
|
147
|
+
switch (obj._) {
|
|
148
|
+
case "pageListItemBlocks_layer225":
|
|
149
|
+
return {
|
|
150
|
+
...obj,
|
|
151
|
+
_: "pageListItemBlocks",
|
|
152
|
+
blocks: obj.blocks.map(mapCompatPageBlock)
|
|
153
|
+
};
|
|
154
|
+
case "pageListItemText_layer225":
|
|
155
|
+
return replaceType(obj, "pageListItemText");
|
|
156
|
+
default:
|
|
157
|
+
return obj;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function mapCompatPageBlock(obj) {
|
|
161
|
+
switch (obj._) {
|
|
162
|
+
case "pageBlockOrderedList_layer225":
|
|
163
|
+
return {
|
|
164
|
+
...obj,
|
|
165
|
+
_: "pageBlockOrderedList",
|
|
166
|
+
items: obj.items.map(mapCompatPageListOrderedItem)
|
|
167
|
+
};
|
|
168
|
+
case "pageBlockList":
|
|
169
|
+
return {
|
|
170
|
+
...obj,
|
|
171
|
+
items: obj.items.map(mapCompatPageListItem)
|
|
172
|
+
};
|
|
173
|
+
case "pageBlockDetails":
|
|
174
|
+
return {
|
|
175
|
+
...obj,
|
|
176
|
+
blocks: obj.blocks.map(mapCompatPageBlock)
|
|
177
|
+
};
|
|
178
|
+
case "pageBlockEmbedPost":
|
|
179
|
+
return {
|
|
180
|
+
...obj,
|
|
181
|
+
blocks: obj.blocks.map(mapCompatPageBlock)
|
|
182
|
+
};
|
|
183
|
+
case "pageBlockCollage":
|
|
184
|
+
case "pageBlockSlideshow":
|
|
185
|
+
return {
|
|
186
|
+
...obj,
|
|
187
|
+
items: obj.items.map(mapCompatPageBlock)
|
|
188
|
+
};
|
|
189
|
+
case "pageBlockCover":
|
|
190
|
+
return {
|
|
191
|
+
...obj,
|
|
192
|
+
cover: mapCompatPageBlock(obj.cover)
|
|
193
|
+
};
|
|
194
|
+
default:
|
|
195
|
+
return obj;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
131
198
|
function mapCompatMessageMedia(obj) {
|
|
132
199
|
switch (obj._) {
|
|
133
200
|
case "messageMediaDocument_layer197":
|
|
@@ -228,6 +295,8 @@ function mapCompatMessage(obj) {
|
|
|
228
295
|
case "message_layer216":
|
|
229
296
|
case "message_layer220":
|
|
230
297
|
case "message_layer222":
|
|
298
|
+
case "message_layer224":
|
|
299
|
+
case "message_layer225":
|
|
231
300
|
return {
|
|
232
301
|
...obj,
|
|
233
302
|
_: "message",
|
|
@@ -315,6 +384,7 @@ function mapCompatObject(obj) {
|
|
|
315
384
|
return mapCompatMessageMedia(obj);
|
|
316
385
|
case "channelFull_layer197":
|
|
317
386
|
case "channelFull_layer204":
|
|
387
|
+
case "channelFull_layer225":
|
|
318
388
|
return replaceType(obj, "channelFull");
|
|
319
389
|
case "messageActionStarGift_layer197":
|
|
320
390
|
case "messageActionStarGift_layer211":
|
|
@@ -365,6 +435,8 @@ function mapCompatObject(obj) {
|
|
|
365
435
|
case "message_layer216":
|
|
366
436
|
case "message_layer220":
|
|
367
437
|
case "message_layer222":
|
|
438
|
+
case "message_layer224":
|
|
439
|
+
case "message_layer225":
|
|
368
440
|
case "messageService_layer204":
|
|
369
441
|
return mapCompatMessage(obj);
|
|
370
442
|
case "messageReplyHeader_layer206":
|
|
@@ -410,6 +482,8 @@ function mapCompatObject(obj) {
|
|
|
410
482
|
return mapCompatPoll(obj);
|
|
411
483
|
case "pollAnswer_layer223":
|
|
412
484
|
return replaceType(obj, "pollAnswer");
|
|
485
|
+
case "poll_layer224":
|
|
486
|
+
return mapCompatPoll(obj);
|
|
413
487
|
case "keyboardButton_layer221":
|
|
414
488
|
case "keyboardButtonUrl_layer221":
|
|
415
489
|
case "keyboardButtonCallback_layer221":
|
|
@@ -429,6 +503,16 @@ function mapCompatObject(obj) {
|
|
|
429
503
|
case "inputKeyboardButtonRequestPeer_layer221":
|
|
430
504
|
case "keyboardButtonCopy_layer221":
|
|
431
505
|
return mapCompatKeyboardButton(obj);
|
|
506
|
+
case "pageBlockOrderedList_layer225":
|
|
507
|
+
return mapCompatPageBlock(obj);
|
|
508
|
+
case "pageListOrderedItemBlocks_layer225":
|
|
509
|
+
return mapCompatPageListOrderedItem(obj);
|
|
510
|
+
case "pageListItemBlocks_layer225":
|
|
511
|
+
return mapCompatPageListItem(obj);
|
|
512
|
+
case "pageListItemText_layer225":
|
|
513
|
+
return mapCompatPageListItem(obj);
|
|
514
|
+
case "pageListOrderedItemText_layer225":
|
|
515
|
+
return mapCompatPageListOrderedItem(obj);
|
|
432
516
|
default:
|
|
433
517
|
return obj;
|
|
434
518
|
}
|
package/utils/index.d.cts
CHANGED
package/utils/index.d.ts
CHANGED
package/utils/long-utils.cjs
CHANGED
|
@@ -7,6 +7,7 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const utils = require("@fuman/utils");
|
|
9
9
|
const Long = require("long");
|
|
10
|
+
const inspectable = require("../highlevel/utils/inspectable.cjs");
|
|
10
11
|
const miscUtils = require("./misc-utils.cjs");
|
|
11
12
|
function randomLong(unsigned = false) {
|
|
12
13
|
const lo = miscUtils.getRandomInt(4294967295);
|
|
@@ -53,6 +54,15 @@ class LongMap extends utils.CustomMap {
|
|
|
53
54
|
super(longToFastString, longFromFastString);
|
|
54
55
|
}
|
|
55
56
|
}
|
|
57
|
+
const proto = class LongMap2 {
|
|
58
|
+
}.prototype;
|
|
59
|
+
LongMap.prototype[inspectable.customInspectSymbol] = function() {
|
|
60
|
+
const res = Object.create(proto);
|
|
61
|
+
this.forEach((v, k) => {
|
|
62
|
+
res[k.toString()] = v;
|
|
63
|
+
});
|
|
64
|
+
return res;
|
|
65
|
+
};
|
|
56
66
|
class LongSet extends utils.CustomSet {
|
|
57
67
|
constructor() {
|
|
58
68
|
super(longToFastString, longFromFastString);
|
package/utils/long-utils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { typed, CustomMap, CustomSet } from "@fuman/utils";
|
|
2
2
|
import Long from "long";
|
|
3
|
+
import { customInspectSymbol } from "../highlevel/utils/inspectable.js";
|
|
3
4
|
import { getRandomInt } from "./misc-utils.js";
|
|
4
5
|
function randomLong(unsigned = false) {
|
|
5
6
|
const lo = getRandomInt(4294967295);
|
|
@@ -46,6 +47,15 @@ class LongMap extends CustomMap {
|
|
|
46
47
|
super(longToFastString, longFromFastString);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
50
|
+
const proto = class LongMap2 {
|
|
51
|
+
}.prototype;
|
|
52
|
+
LongMap.prototype[customInspectSymbol] = function() {
|
|
53
|
+
const res = Object.create(proto);
|
|
54
|
+
this.forEach((v, k) => {
|
|
55
|
+
res[k.toString()] = v;
|
|
56
|
+
});
|
|
57
|
+
return res;
|
|
58
|
+
};
|
|
49
59
|
class LongSet extends CustomSet {
|
|
50
60
|
constructor() {
|
|
51
61
|
super(longToFastString, longFromFastString);
|
package/utils.cjs
CHANGED
|
@@ -5,6 +5,7 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
5
5
|
}
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
+
const floodControl = require("./network/flood-control.cjs");
|
|
8
9
|
const reader = require("./tl/binary/reader.cjs");
|
|
9
10
|
const writer = require("./tl/binary/writer.cjs");
|
|
10
11
|
const bigintUtils = require("./utils/bigint-utils.cjs");
|
|
@@ -40,6 +41,11 @@ const millerRabin = require("./utils/crypto/miller-rabin.cjs");
|
|
|
40
41
|
const mtproto = require("./utils/crypto/mtproto.cjs");
|
|
41
42
|
const password = require("./utils/crypto/password.cjs");
|
|
42
43
|
const bundle = require("./utils/links/bundle.cjs");
|
|
44
|
+
exports.ConnectionFloodController = floodControl.ConnectionFloodController;
|
|
45
|
+
exports.DEFAULT_FLOOD_LIMITS = floodControl.DEFAULT_FLOOD_LIMITS;
|
|
46
|
+
exports.DEFAULT_MTPROTO_ERROR_LIMITS = floodControl.DEFAULT_MTPROTO_ERROR_LIMITS;
|
|
47
|
+
exports.DEFAULT_SANITY_LIMITS = floodControl.DEFAULT_SANITY_LIMITS;
|
|
48
|
+
exports.FloodControl = floodControl.FloodControl;
|
|
43
49
|
exports.__tlReaderMap = reader.__tlReaderMap;
|
|
44
50
|
exports.__tlWriterMap = writer.__tlWriterMap;
|
|
45
51
|
exports.randomBigInt = bigintUtils.randomBigInt;
|
|
@@ -108,6 +114,7 @@ exports.svgPathToFile = fileUtils.svgPathToFile;
|
|
|
108
114
|
exports.encodeInlineMessageId = inlineUtils.encodeInlineMessageId;
|
|
109
115
|
exports.normalizeInlineId = inlineUtils.normalizeInlineId;
|
|
110
116
|
exports.parseInlineMessageId = inlineUtils.parseInlineMessageId;
|
|
117
|
+
exports.customInspectSymbol = inspectable.customInspectSymbol;
|
|
111
118
|
exports.makeInspectable = inspectable.makeInspectable;
|
|
112
119
|
exports.makeArrayPaginated = miscUtils.makeArrayPaginated;
|
|
113
120
|
exports.makeArrayPaginatedWithMeta = miscUtils.makeArrayPaginatedWithMeta;
|
package/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConnectionFloodController, DEFAULT_FLOOD_LIMITS, DEFAULT_MTPROTO_ERROR_LIMITS, DEFAULT_SANITY_LIMITS, FloodControl } from "./network/flood-control.js";
|
|
1
2
|
import { __tlReaderMap } from "./tl/binary/reader.js";
|
|
2
3
|
import { __tlWriterMap } from "./tl/binary/writer.js";
|
|
3
4
|
import { randomBigInt, randomBigIntBits, randomBigIntInRange } from "./utils/bigint-utils.js";
|
|
@@ -19,7 +20,7 @@ import { fileIdToEncryptedFile, fileIdToInputDocument, fileIdToInputFileLocation
|
|
|
19
20
|
import { joinTextWithEntities } from "./highlevel/utils/entities.js";
|
|
20
21
|
import { determinePartSize, extractFileName, inflateSvgPath, isProbablyPlainText, strippedPhotoToJpg, svgPathToFile } from "./highlevel/utils/file-utils.js";
|
|
21
22
|
import { encodeInlineMessageId, normalizeInlineId, parseInlineMessageId } from "./highlevel/utils/inline-utils.js";
|
|
22
|
-
import { makeInspectable } from "./highlevel/utils/inspectable.js";
|
|
23
|
+
import { customInspectSymbol, makeInspectable } from "./highlevel/utils/inspectable.js";
|
|
23
24
|
import { makeArrayPaginated, makeArrayPaginatedWithMeta, makeArrayWithTotal, normalizeDate, normalizeMessageId, normalizePhoneNumber, resolveMaybeDynamic } from "./highlevel/utils/misc-utils.js";
|
|
24
25
|
import { INVITE_LINK_REGEX, extractUsernames, inputPeerToPeer, isInputPeerChannel, isInputPeerChat, isInputPeerUser, toInputChannel, toInputPeer, toInputUser } from "./highlevel/utils/peer-utils.js";
|
|
25
26
|
import { RpsMeter } from "./highlevel/utils/rps-meter.js";
|
|
@@ -35,7 +36,12 @@ import { computeNewPasswordHash, computePasswordHash, computeSrpParams } from ".
|
|
|
35
36
|
import * as bundle from "./utils/links/bundle.js";
|
|
36
37
|
export {
|
|
37
38
|
BaseCryptoProvider,
|
|
39
|
+
ConnectionFloodController,
|
|
40
|
+
DEFAULT_FLOOD_LIMITS,
|
|
41
|
+
DEFAULT_MTPROTO_ERROR_LIMITS,
|
|
42
|
+
DEFAULT_SANITY_LIMITS,
|
|
38
43
|
EarlyTimer,
|
|
44
|
+
FloodControl,
|
|
39
45
|
INVITE_LINK_REGEX,
|
|
40
46
|
LogManager,
|
|
41
47
|
Logger,
|
|
@@ -57,6 +63,7 @@ export {
|
|
|
57
63
|
computeSrpParams,
|
|
58
64
|
createAesIgeForMessage,
|
|
59
65
|
createAesIgeForMessageOld,
|
|
66
|
+
customInspectSymbol,
|
|
60
67
|
dateEntityFormatToString,
|
|
61
68
|
decodeWaveform,
|
|
62
69
|
defaultProductionDc,
|