@mtcute/core 0.30.0 → 0.30.2
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 +63 -1
- package/highlevel/client.d.ts +63 -1
- package/highlevel/methods/files/download-iterable.cjs +80 -45
- package/highlevel/methods/files/download-iterable.js +80 -45
- package/highlevel/methods/files/normalize-input-media.cjs +9 -1
- package/highlevel/methods/files/normalize-input-media.js +10 -2
- package/highlevel/methods/files/upload-file.cjs +6 -1
- package/highlevel/methods/files/upload-file.js +6 -1
- package/highlevel/methods/messages/create-rich-streaming-draft.cjs +39 -0
- package/highlevel/methods/messages/create-rich-streaming-draft.d.cts +42 -0
- package/highlevel/methods/messages/create-rich-streaming-draft.d.ts +42 -0
- package/highlevel/methods/messages/create-rich-streaming-draft.js +34 -0
- package/highlevel/methods/messages/normalize-rich-message.cjs +168 -0
- package/highlevel/methods/messages/normalize-rich-message.d.cts +10 -0
- package/highlevel/methods/messages/normalize-rich-message.d.ts +10 -0
- package/highlevel/methods/messages/normalize-rich-message.js +163 -0
- package/highlevel/methods/messages/send-common.cjs +3 -2
- package/highlevel/methods/messages/send-common.d.cts +4 -1
- package/highlevel/methods/messages/send-common.d.ts +4 -1
- package/highlevel/methods/messages/send-common.js +3 -2
- package/highlevel/methods/messages/send-rich-message.cjs +49 -0
- package/highlevel/methods/messages/send-rich-message.d.cts +38 -0
- package/highlevel/methods/messages/send-rich-message.d.ts +38 -0
- package/highlevel/methods/messages/send-rich-message.js +44 -0
- package/highlevel/methods.d.cts +3 -0
- package/highlevel/methods.d.ts +3 -0
- package/highlevel/types/bots/inline-message/factories.cjs +14 -0
- package/highlevel/types/bots/inline-message/factories.d.cts +9 -1
- package/highlevel/types/bots/inline-message/factories.d.ts +9 -1
- package/highlevel/types/bots/inline-message/factories.js +14 -0
- package/highlevel/types/bots/inline-message/types.d.cts +17 -1
- package/highlevel/types/bots/inline-message/types.d.ts +17 -1
- package/highlevel/types/files/utils.d.cts +9 -0
- package/highlevel/types/files/utils.d.ts +9 -0
- package/highlevel/types/media/input-media/types.d.cts +1 -1
- package/highlevel/types/media/input-media/types.d.ts +1 -1
- package/highlevel/types/messages/index.d.cts +1 -1
- package/highlevel/types/messages/index.d.ts +1 -1
- package/highlevel/types/messages/message.cjs +1 -1
- package/highlevel/types/messages/message.d.cts +1 -1
- package/highlevel/types/messages/message.d.ts +1 -1
- package/highlevel/types/messages/message.js +1 -1
- package/highlevel/types/messages/rich/index.d.cts +4 -0
- package/highlevel/types/messages/rich/index.d.ts +4 -0
- package/highlevel/types/messages/rich/inner.cjs +219 -0
- package/highlevel/types/messages/rich/inner.d.cts +127 -0
- package/highlevel/types/messages/rich/inner.d.ts +127 -0
- package/highlevel/types/messages/rich/inner.js +214 -0
- package/highlevel/types/messages/{rich-message.cjs → rich/rich-message.cjs} +6 -6
- package/highlevel/types/messages/{rich-message.d.cts → rich/rich-message.d.cts} +5 -5
- package/highlevel/types/messages/{rich-message.d.ts → rich/rich-message.d.ts} +5 -5
- package/highlevel/types/messages/{rich-message.js → rich/rich-message.js} +6 -6
- package/highlevel/types/messages/rich/types.d.cts +76 -0
- package/highlevel/types/messages/rich/types.d.ts +76 -0
- package/highlevel/updates/manager.cjs +10 -169
- package/highlevel/updates/manager.js +10 -169
- package/highlevel/utils/entities.cjs +176 -0
- package/highlevel/utils/entities.d.cts +18 -0
- package/highlevel/utils/entities.d.ts +18 -0
- package/highlevel/utils/entities.js +177 -1
- package/highlevel/utils/index.d.cts +1 -0
- package/highlevel/utils/index.d.ts +1 -0
- package/highlevel/utils/walk-page-blocks.cjs +164 -0
- package/highlevel/utils/walk-page-blocks.d.cts +9 -0
- package/highlevel/utils/walk-page-blocks.d.ts +9 -0
- package/highlevel/utils/walk-page-blocks.js +159 -0
- package/index.cjs +3 -1
- package/index.js +3 -1
- package/methods.cjs +4 -0
- package/methods.js +4 -0
- package/network/authorization.cjs +1 -1
- package/network/authorization.js +1 -1
- package/network/delay-gate.cjs +29 -0
- package/network/delay-gate.d.cts +5 -0
- package/network/delay-gate.d.ts +5 -0
- package/network/delay-gate.js +24 -0
- package/network/delay-gate.test.d.cts +1 -0
- package/network/delay-gate.test.d.ts +1 -0
- package/network/message-id-store.cjs +30 -0
- package/network/message-id-store.d.cts +7 -0
- package/network/message-id-store.d.ts +7 -0
- package/network/message-id-store.js +25 -0
- package/network/message-id-store.test.d.cts +1 -0
- package/network/message-id-store.test.d.ts +1 -0
- package/network/middlewares/bundle.cjs +2 -0
- package/network/middlewares/bundle.d.cts +1 -0
- package/network/middlewares/bundle.d.ts +1 -0
- package/network/middlewares/bundle.js +2 -0
- package/network/middlewares/default.cjs +6 -1
- package/network/middlewares/default.js +6 -1
- package/network/middlewares/flood-waiter.test.d.cts +1 -0
- package/network/middlewares/flood-waiter.test.d.ts +1 -0
- package/network/middlewares/internal-errors.test.d.cts +1 -0
- package/network/middlewares/internal-errors.test.d.ts +1 -0
- package/network/middlewares/media-throttle.cjs +65 -0
- package/network/middlewares/media-throttle.d.cts +5 -0
- package/network/middlewares/media-throttle.d.ts +5 -0
- package/network/middlewares/media-throttle.js +60 -0
- package/network/middlewares/media-throttle.test.d.cts +1 -0
- package/network/middlewares/media-throttle.test.d.ts +1 -0
- package/network/middlewares/on-error.test.d.cts +1 -0
- package/network/middlewares/on-error.test.d.ts +1 -0
- package/network/middlewares/on-method.test.d.cts +1 -0
- package/network/middlewares/on-method.test.d.ts +1 -0
- package/network/mtproto-session.cjs +9 -2
- package/network/mtproto-session.d.cts +5 -2
- package/network/mtproto-session.d.ts +5 -2
- package/network/mtproto-session.js +9 -2
- package/network/mtproxy/_fake-tls.cjs +169 -107
- package/network/mtproxy/_fake-tls.js +169 -107
- package/network/mtproxy/_fake-tls.test.d.cts +1 -0
- package/network/mtproxy/_fake-tls.test.d.ts +1 -0
- package/network/multi-session-connection.cjs +7 -0
- package/network/multi-session-connection.d.cts +2 -0
- package/network/multi-session-connection.d.ts +2 -0
- package/network/multi-session-connection.js +7 -0
- package/network/network-manager.cjs +7 -1
- package/network/network-manager.js +7 -1
- package/network/resource-limiter.cjs +60 -0
- package/network/resource-limiter.d.cts +11 -0
- package/network/resource-limiter.d.ts +11 -0
- package/network/resource-limiter.js +55 -0
- package/network/resource-limiter.test.d.cts +1 -0
- package/network/resource-limiter.test.d.ts +1 -0
- package/network/server-salt.cjs +7 -3
- package/network/server-salt.d.cts +2 -0
- package/network/server-salt.d.ts +2 -0
- package/network/server-salt.js +7 -3
- package/network/session-connection.cjs +106 -20
- package/network/session-connection.d.cts +11 -0
- package/network/session-connection.d.ts +11 -0
- package/network/session-connection.js +106 -20
- package/package.json +1 -1
- package/tl/api-schema.json +1 -1
- package/tl/binary/reader.cjs +115 -109
- package/tl/binary/reader.js +115 -109
- package/tl/binary/writer.cjs +243 -245
- package/tl/binary/writer.js +243 -245
- package/tl/index.d.cts +227 -216
- package/tl/index.d.ts +227 -216
- package/tl/inner-tl.cjs +3 -1
- package/tl/inner-tl.js +3 -1
- package/types/utils.d.cts +4 -0
- package/types/utils.d.ts +4 -0
- package/utils.cjs +4 -0
- package/utils.js +5 -1
package/tl/inner-tl.js
CHANGED
|
@@ -464,8 +464,9 @@ const isAnyAiComposeTone = /* @__PURE__ */ _isAny("aiComposeTone", "aiComposeTon
|
|
|
464
464
|
const isAnyAiComposeToneExample = /* @__PURE__ */ _isAny("aiComposeToneExample");
|
|
465
465
|
const isAnyJoinChatBotResult = /* @__PURE__ */ _isAny("joinChatBotResultApproved", "joinChatBotResultDeclined", "joinChatBotResultQueued", "joinChatBotResultWebView");
|
|
466
466
|
const isAnyWebDomainException = /* @__PURE__ */ _isAny("webDomainException");
|
|
467
|
-
const
|
|
467
|
+
const isAnyInputRichFile = /* @__PURE__ */ _isAny("inputRichFilePhoto", "inputRichFileDocument");
|
|
468
468
|
const isAnyInputRichMessage = /* @__PURE__ */ _isAny("inputRichMessage", "inputRichMessageHTML", "inputRichMessageMarkdown");
|
|
469
|
+
const isAnyRichMessage = /* @__PURE__ */ _isAny("richMessage");
|
|
469
470
|
const isAnyStorage_FileType = /* @__PURE__ */ _isAny("storage.fileUnknown", "storage.filePartial", "storage.fileJpeg", "storage.fileGif", "storage.filePng", "storage.filePdf", "storage.fileMp3", "storage.fileMov", "storage.fileMp4", "storage.fileWebp");
|
|
470
471
|
const isAnyAuth_SentCode = /* @__PURE__ */ _isAny("auth.sentCode", "auth.sentCodeSuccess", "auth.sentCodePaymentRequired");
|
|
471
472
|
const isAnyAuth_Authorization = /* @__PURE__ */ _isAny("auth.authorization", "auth.authorizationSignUpRequired");
|
|
@@ -939,6 +940,7 @@ export {
|
|
|
939
940
|
isAnyInputPrivacyRule,
|
|
940
941
|
isAnyInputQuickReplyShortcut,
|
|
941
942
|
isAnyInputReplyTo,
|
|
943
|
+
isAnyInputRichFile,
|
|
942
944
|
isAnyInputRichMessage,
|
|
943
945
|
isAnyInputSavedStarGift,
|
|
944
946
|
isAnyInputSecureFile,
|
package/types/utils.d.cts
CHANGED
|
@@ -6,4 +6,8 @@ export type MustEqual<T, V> = (() => T) extends () => V ? ((() => V) extends ()
|
|
|
6
6
|
export type PublicPart<T> = {
|
|
7
7
|
[K in keyof T]: T[K];
|
|
8
8
|
};
|
|
9
|
+
type ReplaceValue<X, T, V> = X extends T ? T | V : X extends readonly T[] ? X extends T[] ? (T | V)[] : readonly (T | V)[] : X extends object ? ReplaceDeep<X, T, V> : X;
|
|
10
|
+
export type ReplaceDeep<O, T, V> = {
|
|
11
|
+
[K in keyof O]: ReplaceValue<O[K], T, V>;
|
|
12
|
+
};
|
|
9
13
|
export declare function assertNever(_: never): never;
|
package/types/utils.d.ts
CHANGED
|
@@ -6,4 +6,8 @@ export type MustEqual<T, V> = (() => T) extends () => V ? ((() => V) extends ()
|
|
|
6
6
|
export type PublicPart<T> = {
|
|
7
7
|
[K in keyof T]: T[K];
|
|
8
8
|
};
|
|
9
|
+
type ReplaceValue<X, T, V> = X extends T ? T | V : X extends readonly T[] ? X extends T[] ? (T | V)[] : readonly (T | V)[] : X extends object ? ReplaceDeep<X, T, V> : X;
|
|
10
|
+
export type ReplaceDeep<O, T, V> = {
|
|
11
|
+
[K in keyof O]: ReplaceValue<O[K], T, V>;
|
|
12
|
+
};
|
|
9
13
|
export declare function assertNever(_: never): never;
|
package/utils.cjs
CHANGED
|
@@ -34,6 +34,7 @@ const rpsMeter = require("./highlevel/utils/rps-meter.cjs");
|
|
|
34
34
|
const streamUtils = require("./highlevel/utils/stream-utils.cjs");
|
|
35
35
|
const stringSession = require("./highlevel/utils/string-session.cjs");
|
|
36
36
|
const voiceUtils = require("./highlevel/utils/voice-utils.cjs");
|
|
37
|
+
const walkPageBlocks = require("./highlevel/utils/walk-page-blocks.cjs");
|
|
37
38
|
const abstract = require("./utils/crypto/abstract.cjs");
|
|
38
39
|
const factorization = require("./utils/crypto/factorization.cjs");
|
|
39
40
|
const keys = require("./utils/crypto/keys.cjs");
|
|
@@ -105,6 +106,8 @@ exports.fileIdToInputPhoto = convertFileId.fileIdToInputPhoto;
|
|
|
105
106
|
exports.fileIdToInputWebFileLocation = convertFileId.fileIdToInputWebFileLocation;
|
|
106
107
|
exports.fileIdToSecureFile = convertFileId.fileIdToSecureFile;
|
|
107
108
|
exports.joinTextWithEntities = entities.joinTextWithEntities;
|
|
109
|
+
exports.richTextToTextWithEntities = entities.richTextToTextWithEntities;
|
|
110
|
+
exports.textWithEntitiesToRichText = entities.textWithEntitiesToRichText;
|
|
108
111
|
exports.determinePartSize = fileUtils.determinePartSize;
|
|
109
112
|
exports.extractFileName = fileUtils.extractFileName;
|
|
110
113
|
exports.inflateSvgPath = fileUtils.inflateSvgPath;
|
|
@@ -138,6 +141,7 @@ exports.readStringSession = stringSession.readStringSession;
|
|
|
138
141
|
exports.writeStringSession = stringSession.writeStringSession;
|
|
139
142
|
exports.decodeWaveform = voiceUtils.decodeWaveform;
|
|
140
143
|
exports.encodeWaveform = voiceUtils.encodeWaveform;
|
|
144
|
+
exports.walkPageBlocks = walkPageBlocks.walkPageBlocks;
|
|
141
145
|
exports.BaseCryptoProvider = abstract.BaseCryptoProvider;
|
|
142
146
|
exports.factorizePQSync = factorization.factorizePQSync;
|
|
143
147
|
exports.addPublicKey = keys.addPublicKey;
|
package/utils.js
CHANGED
|
@@ -17,7 +17,7 @@ import { jsonToTlJson, tlJsonToJson } from "./utils/tl-json.js";
|
|
|
17
17
|
import { assertTrue, assertTypeIs, assertTypeIsNot, hasValueAtKey, isPresent, isTlRpcError, mtpAssertTypeIs } from "./utils/type-assertions.js";
|
|
18
18
|
export * from "@mtcute/tl-runtime";
|
|
19
19
|
import { fileIdToEncryptedFile, fileIdToInputDocument, fileIdToInputFileLocation, fileIdToInputPhoto, fileIdToInputWebFileLocation, fileIdToSecureFile } from "./highlevel/utils/convert-file-id.js";
|
|
20
|
-
import { joinTextWithEntities } from "./highlevel/utils/entities.js";
|
|
20
|
+
import { joinTextWithEntities, richTextToTextWithEntities, textWithEntitiesToRichText } from "./highlevel/utils/entities.js";
|
|
21
21
|
import { determinePartSize, extractFileName, inflateSvgPath, isProbablyPlainText, strippedPhotoToJpg, svgPathToFile } from "./highlevel/utils/file-utils.js";
|
|
22
22
|
import { encodeInlineMessageId, normalizeInlineId, parseInlineMessageId } from "./highlevel/utils/inline-utils.js";
|
|
23
23
|
import { customInspectSymbol, makeInspectable } from "./highlevel/utils/inspectable.js";
|
|
@@ -27,6 +27,7 @@ import { RpsMeter } from "./highlevel/utils/rps-meter.js";
|
|
|
27
27
|
import { streamToBuffer } from "./highlevel/utils/stream-utils.js";
|
|
28
28
|
import { readStringSession, writeStringSession } from "./highlevel/utils/string-session.js";
|
|
29
29
|
import { decodeWaveform, encodeWaveform } from "./highlevel/utils/voice-utils.js";
|
|
30
|
+
import { walkPageBlocks } from "./highlevel/utils/walk-page-blocks.js";
|
|
30
31
|
import { BaseCryptoProvider } from "./utils/crypto/abstract.js";
|
|
31
32
|
import { factorizePQSync } from "./utils/crypto/factorization.js";
|
|
32
33
|
import { addPublicKey, findKeyByFingerprints, parsePublicKey } from "./utils/crypto/keys.js";
|
|
@@ -131,6 +132,7 @@ export {
|
|
|
131
132
|
readStringSession,
|
|
132
133
|
removeFromLongArray,
|
|
133
134
|
resolveMaybeDynamic,
|
|
135
|
+
richTextToTextWithEntities,
|
|
134
136
|
serializeBasicDcOption,
|
|
135
137
|
serializeObject,
|
|
136
138
|
serializePeersIndex,
|
|
@@ -138,11 +140,13 @@ export {
|
|
|
138
140
|
streamToBuffer,
|
|
139
141
|
strippedPhotoToJpg,
|
|
140
142
|
svgPathToFile,
|
|
143
|
+
textWithEntitiesToRichText,
|
|
141
144
|
throttle,
|
|
142
145
|
tlJsonToJson,
|
|
143
146
|
toInputChannel,
|
|
144
147
|
toInputPeer,
|
|
145
148
|
toInputUser,
|
|
146
149
|
toggleChannelIdMark,
|
|
150
|
+
walkPageBlocks,
|
|
147
151
|
writeStringSession
|
|
148
152
|
};
|