@mtkruto/node 0.50.1 → 0.61.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/esm/2_tl.d.ts +4 -6
- package/esm/2_tl.d.ts.map +1 -1
- package/esm/2_tl.js +4 -6
- package/esm/3_types.d.ts +1 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +1 -0
- package/esm/client/0_params.d.ts +12 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_storage_operations.d.ts.map +1 -1
- package/esm/client/0_storage_operations.js +9 -9
- package/esm/client/1_client_encrypted.d.ts.map +1 -1
- package/esm/client/1_client_encrypted.js +173 -126
- package/esm/client/1_client_plain.d.ts.map +1 -1
- package/esm/client/1_client_plain.js +12 -8
- package/esm/client/3_message_manager.d.ts +1 -0
- package/esm/client/3_message_manager.d.ts.map +1 -1
- package/esm/client/3_message_manager.js +51 -50
- package/esm/client/4_forum_manager.d.ts +40 -0
- package/esm/client/4_forum_manager.d.ts.map +1 -0
- package/esm/client/4_forum_manager.js +134 -0
- package/esm/client/5_client.d.ts +67 -2
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +87 -2
- package/esm/tl/0_api.d.ts +1 -2
- package/esm/tl/0_api.d.ts.map +1 -1
- package/esm/tl/0_api.js +7345 -6639
- package/esm/tl/0_tl_raw_reader.d.ts +2 -0
- package/esm/tl/0_tl_raw_reader.d.ts.map +1 -1
- package/esm/tl/0_tl_raw_reader.js +10 -0
- package/esm/tl/1_utilities.d.ts +10 -1
- package/esm/tl/1_utilities.d.ts.map +1 -1
- package/esm/tl/1_utilities.js +25 -1
- package/esm/tl/{5_message.d.ts → 2_message.d.ts} +5 -8
- package/esm/tl/2_message.d.ts.map +1 -0
- package/esm/tl/{5_message.js → 2_message.js} +16 -33
- package/esm/tl/{3_tl_reader.d.ts → 2_tl_reader.d.ts} +4 -3
- package/esm/tl/2_tl_reader.d.ts.map +1 -0
- package/esm/tl/2_tl_reader.js +146 -0
- package/esm/tl/2_tl_reader_test.d.ts.map +1 -0
- package/{script/tl/4_tl_writer.d.ts → esm/tl/2_tl_writer.d.ts} +4 -3
- package/esm/tl/2_tl_writer.d.ts.map +1 -0
- package/esm/tl/2_tl_writer.js +209 -0
- package/esm/tl/2_tl_writer_test.d.ts.map +1 -0
- package/{script/tl/3_utilities.d.ts → esm/tl/2_utilities.d.ts} +1 -1
- package/esm/tl/{3_utilities.d.ts.map → 2_utilities.d.ts.map} +1 -1
- package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
- package/esm/types/2_chosen_inline_result.js +2 -2
- package/esm/types/4_message.d.ts +3 -3
- package/esm/types/4_message.d.ts.map +1 -1
- package/esm/types/4_message.js +16 -8
- package/esm/types/5_callback_query.d.ts.map +1 -1
- package/esm/types/5_callback_query.js +3 -3
- package/esm/{tl/4_rpc_result.d.ts → types/5_topic.d.ts} +14 -7
- package/esm/types/5_topic.d.ts.map +1 -0
- package/esm/types/5_topic.js +76 -0
- package/esm/utilities/0_misc.d.ts +0 -1
- package/esm/utilities/0_misc.d.ts.map +1 -1
- package/esm/utilities/0_misc.js +0 -1
- package/package.json +1 -1
- package/script/2_tl.d.ts +4 -6
- package/script/2_tl.d.ts.map +1 -1
- package/script/2_tl.js +4 -6
- package/script/3_types.d.ts +1 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +1 -0
- package/script/client/0_params.d.ts +12 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_storage_operations.d.ts.map +1 -1
- package/script/client/0_storage_operations.js +8 -8
- package/script/client/1_client_encrypted.d.ts.map +1 -1
- package/script/client/1_client_encrypted.js +171 -124
- package/script/client/1_client_plain.d.ts.map +1 -1
- package/script/client/1_client_plain.js +11 -7
- package/script/client/3_message_manager.d.ts +1 -0
- package/script/client/3_message_manager.d.ts.map +1 -1
- package/script/client/3_message_manager.js +51 -50
- package/script/client/4_forum_manager.d.ts +40 -0
- package/script/client/4_forum_manager.d.ts.map +1 -0
- package/script/client/4_forum_manager.js +138 -0
- package/script/client/5_client.d.ts +67 -2
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +87 -2
- package/script/tl/0_api.d.ts +1 -2
- package/script/tl/0_api.d.ts.map +1 -1
- package/script/tl/0_api.js +7346 -6640
- package/script/tl/0_tl_raw_reader.d.ts +2 -0
- package/script/tl/0_tl_raw_reader.d.ts.map +1 -1
- package/script/tl/0_tl_raw_reader.js +10 -0
- package/script/tl/1_utilities.d.ts +10 -1
- package/script/tl/1_utilities.d.ts.map +1 -1
- package/script/tl/1_utilities.js +29 -1
- package/script/tl/{5_message.d.ts → 2_message.d.ts} +5 -8
- package/script/tl/2_message.d.ts.map +1 -0
- package/script/tl/{5_message.js → 2_message.js} +17 -34
- package/script/tl/{3_tl_reader.d.ts → 2_tl_reader.d.ts} +4 -3
- package/script/tl/2_tl_reader.d.ts.map +1 -0
- package/script/tl/2_tl_reader.js +150 -0
- package/script/tl/2_tl_reader_test.d.ts.map +1 -0
- package/{esm/tl/4_tl_writer.d.ts → script/tl/2_tl_writer.d.ts} +4 -3
- package/script/tl/2_tl_writer.d.ts.map +1 -0
- package/script/tl/2_tl_writer.js +213 -0
- package/script/tl/2_tl_writer_test.d.ts.map +1 -0
- package/{esm/tl/3_utilities.d.ts → script/tl/2_utilities.d.ts} +1 -1
- package/script/tl/{3_utilities.d.ts.map → 2_utilities.d.ts.map} +1 -1
- package/script/types/2_chosen_inline_result.d.ts.map +1 -1
- package/script/types/2_chosen_inline_result.js +1 -1
- package/script/types/4_message.d.ts +3 -3
- package/script/types/4_message.d.ts.map +1 -1
- package/script/types/4_message.js +16 -8
- package/script/types/5_callback_query.d.ts.map +1 -1
- package/script/types/5_callback_query.js +2 -2
- package/script/types/5_topic.d.ts +34 -0
- package/script/types/5_topic.d.ts.map +1 -0
- package/script/types/5_topic.js +79 -0
- package/script/utilities/0_misc.d.ts +0 -1
- package/script/utilities/0_misc.d.ts.map +1 -1
- package/script/utilities/0_misc.js +1 -2
- package/esm/tl/2_deserialize.d.ts +0 -23
- package/esm/tl/2_deserialize.d.ts.map +0 -1
- package/esm/tl/2_deserialize.js +0 -98
- package/esm/tl/2_serialize.d.ts +0 -22
- package/esm/tl/2_serialize.d.ts.map +0 -1
- package/esm/tl/2_serialize.js +0 -163
- package/esm/tl/2_serialize_test.d.ts.map +0 -1
- package/esm/tl/3_deserialize_test.d.ts.map +0 -1
- package/esm/tl/3_tl_reader.d.ts.map +0 -1
- package/esm/tl/3_tl_reader.js +0 -49
- package/esm/tl/4_rpc_result.d.ts.map +0 -1
- package/esm/tl/4_rpc_result.js +0 -33
- package/esm/tl/4_tl_writer.d.ts.map +0 -1
- package/esm/tl/4_tl_writer.js +0 -45
- package/esm/tl/5_message.d.ts.map +0 -1
- package/script/tl/2_deserialize.d.ts +0 -23
- package/script/tl/2_deserialize.d.ts.map +0 -1
- package/script/tl/2_deserialize.js +0 -101
- package/script/tl/2_serialize.d.ts +0 -22
- package/script/tl/2_serialize.d.ts.map +0 -1
- package/script/tl/2_serialize.js +0 -166
- package/script/tl/2_serialize_test.d.ts.map +0 -1
- package/script/tl/3_deserialize_test.d.ts.map +0 -1
- package/script/tl/3_tl_reader.d.ts.map +0 -1
- package/script/tl/3_tl_reader.js +0 -53
- package/script/tl/4_rpc_result.d.ts +0 -27
- package/script/tl/4_rpc_result.d.ts.map +0 -1
- package/script/tl/4_rpc_result.js +0 -37
- package/script/tl/4_tl_writer.d.ts.map +0 -1
- package/script/tl/4_tl_writer.js +0 -49
- package/script/tl/5_message.d.ts.map +0 -1
- /package/esm/tl/{3_utilities.js → 2_utilities.js} +0 -0
- /package/script/tl/{3_utilities.js → 2_utilities.js} +0 -0
package/script/tl/3_tl_reader.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-2025 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
|
-
// deno-lint-ignore-file no-explicit-any
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.TLReader = void 0;
|
|
24
|
-
const _0_tl_raw_reader_js_1 = require("./0_tl_raw_reader.js");
|
|
25
|
-
const _0_api_js_1 = require("./0_api.js");
|
|
26
|
-
const _2_deserialize_js_1 = require("./2_deserialize.js");
|
|
27
|
-
class TLReader extends _0_tl_raw_reader_js_1.TLRawReader {
|
|
28
|
-
readObject(id) {
|
|
29
|
-
if (!id) {
|
|
30
|
-
id = this.readInt32(false);
|
|
31
|
-
}
|
|
32
|
-
if (id == 0x1CB5C415) {
|
|
33
|
-
const count = this.readInt32();
|
|
34
|
-
const items = new Array();
|
|
35
|
-
for (let i = 0; i < count; i++) {
|
|
36
|
-
items.push(this.readObject());
|
|
37
|
-
}
|
|
38
|
-
return items;
|
|
39
|
-
}
|
|
40
|
-
else if (id == 0x997275b5) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
else if (id == 0xbc799737) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
const constructor = (0, _0_api_js_1.getTypeName)(id);
|
|
47
|
-
if (constructor) {
|
|
48
|
-
return (0, _2_deserialize_js_1.deserialize)(this, (0, _0_api_js_1.getType)(constructor)[1], constructor);
|
|
49
|
-
}
|
|
50
|
-
throw new _0_tl_raw_reader_js_1.TLError(`Unknown constructor ${id.toString(16)}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.TLReader = TLReader;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
-
* Copyright (C) 2023-2025 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
|
-
export declare const RPC_RESULT_ID = 4082920705;
|
|
21
|
-
export interface rpc_result {
|
|
22
|
-
_: "rpc_result";
|
|
23
|
-
req_msg_id: bigint;
|
|
24
|
-
result: any;
|
|
25
|
-
}
|
|
26
|
-
export declare function deserializeRpcResult(buffer: Uint8Array): Promise<rpc_result>;
|
|
27
|
-
//# sourceMappingURL=4_rpc_result.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"4_rpc_result.d.ts","sourceRoot":"","sources":["../../src/tl/4_rpc_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,eAAO,MAAM,aAAa,aAAa,CAAC;AAExC,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,YAAY,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAEnB,MAAM,EAAE,GAAG,CAAC;CACb;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAQlF"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-2025 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.RPC_RESULT_ID = void 0;
|
|
23
|
-
exports.deserializeRpcResult = deserializeRpcResult;
|
|
24
|
-
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
25
|
-
const _1_utilities_js_2 = require("./1_utilities.js");
|
|
26
|
-
const _3_tl_reader_js_1 = require("./3_tl_reader.js");
|
|
27
|
-
// rpc_result#f35c6d01 req_msg_id:long result:Object = RpcResult;
|
|
28
|
-
exports.RPC_RESULT_ID = 0xF35C6D01;
|
|
29
|
-
async function deserializeRpcResult(buffer) {
|
|
30
|
-
const reader = new _3_tl_reader_js_1.TLReader(buffer);
|
|
31
|
-
const messageId = reader.readInt64();
|
|
32
|
-
let result = reader.readObject();
|
|
33
|
-
if ((0, _1_utilities_js_2.is)("gzip_packed", result)) {
|
|
34
|
-
result = new _3_tl_reader_js_1.TLReader(await (0, _1_utilities_js_1.gunzip)(result.packed_data)).readObject();
|
|
35
|
-
}
|
|
36
|
-
return { _: "rpc_result", req_msg_id: messageId, result };
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"4_tl_writer.d.ts","sourceRoot":"","sources":["../../src/tl/4_tl_writer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,QAAS,SAAQ,WAAW;IACvC,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,IAAI;CAkB7C"}
|
package/script/tl/4_tl_writer.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
-
* Copyright (C) 2023-2025 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.TLWriter = void 0;
|
|
23
|
-
const _1_utilities_js_1 = require("../1_utilities.js");
|
|
24
|
-
const _0_tl_raw_writer_js_1 = require("./0_tl_raw_writer.js");
|
|
25
|
-
const _2_serialize_js_1 = require("./2_serialize.js");
|
|
26
|
-
class TLWriter extends _0_tl_raw_writer_js_1.TLRawWriter {
|
|
27
|
-
writeObject(object) {
|
|
28
|
-
if (Array.isArray(object)) {
|
|
29
|
-
this.writeInt32(_1_utilities_js_1.VECTOR_CONSTRUCTOR, false);
|
|
30
|
-
this.writeInt32(object.length);
|
|
31
|
-
for (const item of object) {
|
|
32
|
-
this.writeObject(item);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else if (typeof object === "boolean") {
|
|
36
|
-
if (object) {
|
|
37
|
-
this.writeInt32(0x997275B5, false);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
this.writeInt32(0xBC799737, false);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
this.write((0, _2_serialize_js_1.serialize)(object));
|
|
45
|
-
}
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.TLWriter = TLWriter;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"5_message.d.ts","sourceRoot":"","sources":["../../src/tl/5_message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,SAAS,EAAW,MAAM,YAAY,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAwB,UAAU,EAAiB,MAAM,mBAAmB,CAAC;AAKpF,eAAO,MAAM,YAAY,eAA6B,CAAC;AAIvD,MAAM,WAAW,OAAO;IACtB,CAAC,EAAE,SAAS,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;CAC9C;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAoB5E;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAoB3E;AAID,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,eAAe,CAAC;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,wBAAsB,qBAAqB,CAAC,YAAY,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAQ5F;AAED,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAQxF"}
|
|
File without changes
|
|
File without changes
|