@mtkruto/node 0.0.999 → 0.1.100
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/esm/0_deps.d.ts +1 -1
- package/esm/0_deps.js +1 -1
- package/esm/3_errors.d.ts +1531 -0
- package/esm/3_errors.js +1531 -0
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/4_errors.d.ts +25 -0
- package/esm/4_errors.js +64 -0
- package/esm/client/2_client_plain.js +1 -1
- package/esm/client/4_client.d.ts +2 -1
- package/esm/client/4_client.js +24 -41
- package/esm/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.3.2}/mod.d.ts +2 -6
- package/esm/deps/deno.land/x/tgcrypto@0.3.2/mod.js +158 -0
- package/esm/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.d.ts +2 -0
- package/esm/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.js +308 -0
- package/esm/mod.d.ts +3 -2
- package/esm/mod.js +3 -2
- package/esm/tl/2_types.d.ts +1 -1
- package/esm/tl/2_types.js +1 -2
- package/esm/tl/3_functions.d.ts +1 -1
- package/esm/tl/3_functions.js +1 -2
- package/esm/transport/0_obfuscation.js +1 -1
- package/esm/transport/0_transport.js +2 -2
- package/esm/types/0__file_id.js +0 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_bot_command_scope.js +1 -1
- package/esm/types/1_chat.d.ts +1 -1
- package/esm/types/1_chat.js +1 -1
- package/esm/types/1_sticker.d.ts +1 -1
- package/esm/types/1_sticker.js +1 -1
- package/esm/types/1_user.d.ts +1 -1
- package/esm/types/1_user.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/3_message.d.ts +12 -12
- package/esm/types/3_message.js +12 -12
- package/esm/types/5_inline_query_result.d.ts +1 -1
- package/esm/types/5_inline_query_result.js +1 -1
- package/esm/utilities/0_crypto.d.ts +1 -2
- package/esm/utilities/0_crypto.js +5 -12
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -1
- package/script/0_deps.js +3 -4
- package/script/3_errors.d.ts +1531 -0
- package/script/3_errors.js +2053 -0
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/4_errors.d.ts +25 -0
- package/script/4_errors.js +88 -0
- package/script/client/2_client_plain.js +1 -1
- package/script/client/4_client.d.ts +2 -1
- package/script/client/4_client.js +24 -41
- package/script/deps/deno.land/x/{tgcrypto@0.1.3 → tgcrypto@0.3.2}/mod.d.ts +2 -6
- package/script/deps/deno.land/x/tgcrypto@0.3.2/mod.js +171 -0
- package/script/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.d.ts +2 -0
- package/script/deps/deno.land/x/tgcrypto@0.3.2/tgcrypto.js +310 -0
- package/script/mod.d.ts +3 -2
- package/script/mod.js +16 -3
- package/script/tl/2_types.d.ts +1 -1
- package/script/tl/2_types.js +0 -1
- package/script/tl/3_functions.d.ts +1 -1
- package/script/tl/3_functions.js +0 -1
- package/script/transport/0_obfuscation.js +1 -1
- package/script/transport/0_transport.js +2 -2
- package/script/types/0__file_id.js +0 -1
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_bot_command_scope.js +1 -1
- package/script/types/1_chat.d.ts +1 -1
- package/script/types/1_chat.js +1 -1
- package/script/types/1_sticker.d.ts +1 -1
- package/script/types/1_sticker.js +1 -1
- package/script/types/1_user.d.ts +1 -1
- package/script/types/1_user.js +1 -1
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/3_message.d.ts +12 -12
- package/script/types/3_message.js +12 -12
- package/script/types/5_inline_query_result.d.ts +1 -1
- package/script/types/5_inline_query_result.js +1 -1
- package/script/utilities/0_crypto.d.ts +1 -2
- package/script/utilities/0_crypto.js +4 -11
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/mod.js +0 -68
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
- package/esm/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1078
- package/script/deps/deno.land/x/tgcrypto@0.1.3/mod.js +0 -82
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -2
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.js +0 -1080
package/esm/types/3_message.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { MaybePromise } from "../1_utilities.js";
|
|
2
2
|
import { types } from "../2_tl.js";
|
|
3
|
-
import { ForceReply } from "./0_force_reply.js";
|
|
4
|
-
import { MessageEntity } from "./0_message_entity.js";
|
|
5
3
|
import { Audio } from "./0_audio.js";
|
|
6
4
|
import { Contact } from "./0_contact.js";
|
|
7
|
-
import { Voice } from "./0_voice.js";
|
|
8
|
-
import { Venue } from "./0_venue.js";
|
|
9
|
-
import { Location } from "./0_location.js";
|
|
10
5
|
import { Dice } from "./0_dice.js";
|
|
6
|
+
import { ForceReply } from "./0_force_reply.js";
|
|
7
|
+
import { Location } from "./0_location.js";
|
|
8
|
+
import { MessageEntity } from "./0_message_entity.js";
|
|
11
9
|
import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
10
|
+
import { Venue } from "./0_venue.js";
|
|
11
|
+
import { Voice } from "./0_voice.js";
|
|
12
12
|
import { EntityGetter } from "./1__getters.js";
|
|
13
|
+
import { Animation } from "./1_animation.js";
|
|
13
14
|
import { Chat } from "./1_chat.js";
|
|
14
|
-
import { Photo } from "./1_photo.js";
|
|
15
15
|
import { Document } from "./1_document.js";
|
|
16
|
-
import {
|
|
17
|
-
import { VideoNote } from "./1_video_note.js";
|
|
18
|
-
import { Animation } from "./1_animation.js";
|
|
19
|
-
import { User } from "./1_user.js";
|
|
16
|
+
import { Photo } from "./1_photo.js";
|
|
20
17
|
import { Poll } from "./1_poll.js";
|
|
21
18
|
import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
19
|
+
import { User } from "./1_user.js";
|
|
20
|
+
import { VideoNote } from "./1_video_note.js";
|
|
21
|
+
import { Video } from "./1_video.js";
|
|
24
22
|
import { Game } from "./2_game.js";
|
|
23
|
+
import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
24
|
+
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
25
25
|
/** This object represents a message. */
|
|
26
26
|
export interface Message {
|
|
27
27
|
/** Whether the message is outgoing */
|
package/esm/types/3_message.js
CHANGED
|
@@ -3,27 +3,27 @@ import { cleanObject, UNREACHABLE } from "../1_utilities.js";
|
|
|
3
3
|
import { as, types } from "../2_tl.js";
|
|
4
4
|
import { ZERO_CHANNEL_ID } from "../4_constants.js";
|
|
5
5
|
import { FileID, FileType, FileUniqueID, FileUniqueType } from "./0__file_id.js";
|
|
6
|
-
import { constructForceReply } from "./0_force_reply.js";
|
|
7
|
-
import { constructMessageEntity } from "./0_message_entity.js";
|
|
8
6
|
import { constructAudio } from "./0_audio.js";
|
|
9
7
|
import { constructContact } from "./0_contact.js";
|
|
10
|
-
import { constructVoice } from "./0_voice.js";
|
|
11
|
-
import { constructVenue } from "./0_venue.js";
|
|
12
|
-
import { constructLocation } from "./0_location.js";
|
|
13
8
|
import { constructDice } from "./0_dice.js";
|
|
9
|
+
import { constructForceReply } from "./0_force_reply.js";
|
|
10
|
+
import { constructLocation } from "./0_location.js";
|
|
11
|
+
import { constructMessageEntity } from "./0_message_entity.js";
|
|
14
12
|
import { constructReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
|
|
13
|
+
import { constructVenue } from "./0_venue.js";
|
|
14
|
+
import { constructVoice } from "./0_voice.js";
|
|
15
|
+
import { constructAnimation } from "./1_animation.js";
|
|
15
16
|
import { constructChat } from "./1_chat.js";
|
|
16
|
-
import { constructPhoto } from "./1_photo.js";
|
|
17
17
|
import { constructDocument } from "./1_document.js";
|
|
18
|
-
import {
|
|
19
|
-
import { constructVideoNote } from "./1_video_note.js";
|
|
20
|
-
import { constructAnimation } from "./1_animation.js";
|
|
21
|
-
import { constructUser } from "./1_user.js";
|
|
18
|
+
import { constructPhoto } from "./1_photo.js";
|
|
22
19
|
import { constructPoll } from "./1_poll.js";
|
|
23
20
|
import { constructSticker } from "./1_sticker.js";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
21
|
+
import { constructUser } from "./1_user.js";
|
|
22
|
+
import { constructVideoNote } from "./1_video_note.js";
|
|
23
|
+
import { constructVideo } from "./1_video.js";
|
|
26
24
|
import { constructGame } from "./2_game.js";
|
|
25
|
+
import { constructReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
26
|
+
import { constructInlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
27
27
|
const d = debug("types/Message");
|
|
28
28
|
async function getSender(message_, getEntity) {
|
|
29
29
|
if (message_.fromId instanceof types.PeerUser) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
2
|
import { MessageEntity } from "./0_message_entity.js";
|
|
3
3
|
import { ParseMode } from "./0_parse_mode.js";
|
|
4
|
+
import { UsernameResolver } from "./1__getters.js";
|
|
4
5
|
import { InlineQueryResultArticle } from "./4_inline_query_result_article.js";
|
|
5
6
|
import { InlineQueryResultAudio } from "./4_inline_query_result_audio.js";
|
|
6
7
|
import { InlineQueryResultCachedAudio } from "./4_inline_query_result_cached_audio.js";
|
|
@@ -21,7 +22,6 @@ import { InlineQueryResultPhoto } from "./4_inline_query_result_photo.js";
|
|
|
21
22
|
import { InlineQueryResultVenue } from "./4_inline_query_result_venue.js";
|
|
22
23
|
import { InlineQueryResultVideo } from "./4_inline_query_result_video.js";
|
|
23
24
|
import { InlineQueryResultVoice } from "./4_inline_query_result_voice.js";
|
|
24
|
-
import { UsernameResolver } from "./1__getters.js";
|
|
25
25
|
export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice;
|
|
26
26
|
export declare function inlineQueryResultToTlObject(result_: InlineQueryResult, parseText: (text: string, params?: {
|
|
27
27
|
parseMode?: ParseMode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { UNREACHABLE } from "../1_utilities.js";
|
|
1
2
|
import { types } from "../2_tl.js";
|
|
2
3
|
import { FileID } from "./0__file_id.js";
|
|
3
|
-
import { UNREACHABLE } from "../1_utilities.js";
|
|
4
4
|
import { replyMarkupToTlObject } from "./4_reply_markup.js";
|
|
5
5
|
// deno-lint-ignore no-explicit-any
|
|
6
6
|
export async function inlineQueryResultToTlObject(result_, parseText, usernameResolver) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ctr256 } from "../0_deps.js";
|
|
2
2
|
export class CTR {
|
|
3
3
|
constructor(key, iv) {
|
|
4
4
|
Object.defineProperty(this, "key", {
|
|
@@ -20,16 +20,9 @@ export class CTR {
|
|
|
20
20
|
value: new Uint8Array(1)
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
this.iv
|
|
26
|
-
|
|
27
|
-
return new Uint8Array(encrypted);
|
|
28
|
-
}
|
|
29
|
-
decrypt(data) {
|
|
30
|
-
const [decrypted, iv, state] = ctr256Decrypt(data, this.key, this.iv, this.state);
|
|
31
|
-
this.iv = iv;
|
|
32
|
-
this.state = state;
|
|
33
|
-
return new Uint8Array(decrypted);
|
|
23
|
+
call(data) {
|
|
24
|
+
const v = new Uint8Array(data); // TODO: don't copy
|
|
25
|
+
ctr256(v, this.key, this.iv, this.state);
|
|
26
|
+
return v;
|
|
34
27
|
}
|
|
35
28
|
}
|
package/package.json
CHANGED
package/script/0_deps.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./deps/deno.land/std@0.201.0/assert/mod.js";
|
|
2
|
-
export {
|
|
2
|
+
export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.2/mod.js";
|
|
3
3
|
export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
|
|
4
4
|
export { Mutex, type MutexInterface } from "async-mutex";
|
|
5
5
|
export { Parser } from "./deps/deno.land/x/html_parser@v0.1.3/src/mod.js";
|
package/script/0_deps.js
CHANGED
|
@@ -14,11 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.base64Encode = exports.base64Decode = exports.debug = exports.Parser = exports.Mutex = exports.gzip = exports.gunzip = exports.initTgCrypto = exports.ige256Encrypt = exports.ige256Decrypt = exports.factorize = exports.
|
|
17
|
+
exports.base64Encode = exports.base64Decode = exports.debug = exports.Parser = exports.Mutex = exports.gzip = exports.gunzip = exports.initTgCrypto = exports.ige256Encrypt = exports.ige256Decrypt = exports.factorize = exports.ctr256 = void 0;
|
|
18
18
|
__exportStar(require("./deps/deno.land/std@0.201.0/assert/mod.js"), exports);
|
|
19
|
-
var mod_js_1 = require("./deps/deno.land/x/tgcrypto@0.
|
|
20
|
-
Object.defineProperty(exports, "
|
|
21
|
-
Object.defineProperty(exports, "ctr256Encrypt", { enumerable: true, get: function () { return mod_js_1.ctr256Encrypt; } });
|
|
19
|
+
var mod_js_1 = require("./deps/deno.land/x/tgcrypto@0.3.2/mod.js");
|
|
20
|
+
Object.defineProperty(exports, "ctr256", { enumerable: true, get: function () { return mod_js_1.ctr256; } });
|
|
22
21
|
Object.defineProperty(exports, "factorize", { enumerable: true, get: function () { return mod_js_1.factorize; } });
|
|
23
22
|
Object.defineProperty(exports, "ige256Decrypt", { enumerable: true, get: function () { return mod_js_1.ige256Decrypt; } });
|
|
24
23
|
Object.defineProperty(exports, "ige256Encrypt", { enumerable: true, get: function () { return mod_js_1.ige256Encrypt; } });
|