@mtcute/core 0.29.7 → 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/highlevel/client.d.cts +4 -6
- package/highlevel/client.d.ts +4 -6
- 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.d.cts +2 -0
- package/highlevel/methods.d.ts +2 -0
- package/highlevel/storage/service/peers.cjs +1 -0
- package/highlevel/storage/service/peers.js +1 -0
- package/highlevel/types/files/utils.d.cts +1 -1
- package/highlevel/types/files/utils.d.ts +1 -1
- package/highlevel/types/messages/index.d.cts +1 -0
- package/highlevel/types/messages/index.d.ts +1 -0
- package/highlevel/types/messages/message.cjs +5 -0
- package/highlevel/types/messages/message.d.cts +3 -0
- package/highlevel/types/messages/message.d.ts +3 -0
- package/highlevel/types/messages/message.js +5 -0
- 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/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 +4 -0
- package/highlevel/types/peers/user.d.cts +2 -0
- package/highlevel/types/peers/user.d.ts +2 -0
- package/highlevel/types/peers/user.js +4 -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 +191 -0
- package/highlevel/updates/manager.js +191 -0
- 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 +2 -0
- package/index.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 +176 -26
- package/tl/binary/reader.js +176 -26
- package/tl/binary/writer.cjs +439 -20
- package/tl/binary/writer.js +439 -20
- package/tl/compat/reader.cjs +23 -0
- package/tl/compat/reader.js +23 -0
- package/tl/index.d.cts +414 -14
- package/tl/index.d.ts +414 -14
- package/tl/inner-tl.cjs +20 -8
- package/tl/inner-tl.js +20 -8
- package/utils/binary/compat.cjs +79 -0
- package/utils/binary/compat.js +79 -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/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,
|