@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.
Files changed (150) hide show
  1. package/esm/2_tl.d.ts +4 -6
  2. package/esm/2_tl.d.ts.map +1 -1
  3. package/esm/2_tl.js +4 -6
  4. package/esm/3_types.d.ts +1 -0
  5. package/esm/3_types.d.ts.map +1 -1
  6. package/esm/3_types.js +1 -0
  7. package/esm/client/0_params.d.ts +12 -0
  8. package/esm/client/0_params.d.ts.map +1 -1
  9. package/esm/client/0_storage_operations.d.ts.map +1 -1
  10. package/esm/client/0_storage_operations.js +9 -9
  11. package/esm/client/1_client_encrypted.d.ts.map +1 -1
  12. package/esm/client/1_client_encrypted.js +173 -126
  13. package/esm/client/1_client_plain.d.ts.map +1 -1
  14. package/esm/client/1_client_plain.js +12 -8
  15. package/esm/client/3_message_manager.d.ts +1 -0
  16. package/esm/client/3_message_manager.d.ts.map +1 -1
  17. package/esm/client/3_message_manager.js +51 -50
  18. package/esm/client/4_forum_manager.d.ts +40 -0
  19. package/esm/client/4_forum_manager.d.ts.map +1 -0
  20. package/esm/client/4_forum_manager.js +134 -0
  21. package/esm/client/5_client.d.ts +67 -2
  22. package/esm/client/5_client.d.ts.map +1 -1
  23. package/esm/client/5_client.js +87 -2
  24. package/esm/tl/0_api.d.ts +1 -2
  25. package/esm/tl/0_api.d.ts.map +1 -1
  26. package/esm/tl/0_api.js +7345 -6639
  27. package/esm/tl/0_tl_raw_reader.d.ts +2 -0
  28. package/esm/tl/0_tl_raw_reader.d.ts.map +1 -1
  29. package/esm/tl/0_tl_raw_reader.js +10 -0
  30. package/esm/tl/1_utilities.d.ts +10 -1
  31. package/esm/tl/1_utilities.d.ts.map +1 -1
  32. package/esm/tl/1_utilities.js +25 -1
  33. package/esm/tl/{5_message.d.ts → 2_message.d.ts} +5 -8
  34. package/esm/tl/2_message.d.ts.map +1 -0
  35. package/esm/tl/{5_message.js → 2_message.js} +16 -33
  36. package/esm/tl/{3_tl_reader.d.ts → 2_tl_reader.d.ts} +4 -3
  37. package/esm/tl/2_tl_reader.d.ts.map +1 -0
  38. package/esm/tl/2_tl_reader.js +146 -0
  39. package/esm/tl/2_tl_reader_test.d.ts.map +1 -0
  40. package/{script/tl/4_tl_writer.d.ts → esm/tl/2_tl_writer.d.ts} +4 -3
  41. package/esm/tl/2_tl_writer.d.ts.map +1 -0
  42. package/esm/tl/2_tl_writer.js +209 -0
  43. package/esm/tl/2_tl_writer_test.d.ts.map +1 -0
  44. package/{script/tl/3_utilities.d.ts → esm/tl/2_utilities.d.ts} +1 -1
  45. package/esm/tl/{3_utilities.d.ts.map → 2_utilities.d.ts.map} +1 -1
  46. package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
  47. package/esm/types/2_chosen_inline_result.js +2 -2
  48. package/esm/types/4_message.d.ts +3 -3
  49. package/esm/types/4_message.d.ts.map +1 -1
  50. package/esm/types/4_message.js +16 -8
  51. package/esm/types/5_callback_query.d.ts.map +1 -1
  52. package/esm/types/5_callback_query.js +3 -3
  53. package/esm/{tl/4_rpc_result.d.ts → types/5_topic.d.ts} +14 -7
  54. package/esm/types/5_topic.d.ts.map +1 -0
  55. package/esm/types/5_topic.js +76 -0
  56. package/esm/utilities/0_misc.d.ts +0 -1
  57. package/esm/utilities/0_misc.d.ts.map +1 -1
  58. package/esm/utilities/0_misc.js +0 -1
  59. package/package.json +1 -1
  60. package/script/2_tl.d.ts +4 -6
  61. package/script/2_tl.d.ts.map +1 -1
  62. package/script/2_tl.js +4 -6
  63. package/script/3_types.d.ts +1 -0
  64. package/script/3_types.d.ts.map +1 -1
  65. package/script/3_types.js +1 -0
  66. package/script/client/0_params.d.ts +12 -0
  67. package/script/client/0_params.d.ts.map +1 -1
  68. package/script/client/0_storage_operations.d.ts.map +1 -1
  69. package/script/client/0_storage_operations.js +8 -8
  70. package/script/client/1_client_encrypted.d.ts.map +1 -1
  71. package/script/client/1_client_encrypted.js +171 -124
  72. package/script/client/1_client_plain.d.ts.map +1 -1
  73. package/script/client/1_client_plain.js +11 -7
  74. package/script/client/3_message_manager.d.ts +1 -0
  75. package/script/client/3_message_manager.d.ts.map +1 -1
  76. package/script/client/3_message_manager.js +51 -50
  77. package/script/client/4_forum_manager.d.ts +40 -0
  78. package/script/client/4_forum_manager.d.ts.map +1 -0
  79. package/script/client/4_forum_manager.js +138 -0
  80. package/script/client/5_client.d.ts +67 -2
  81. package/script/client/5_client.d.ts.map +1 -1
  82. package/script/client/5_client.js +87 -2
  83. package/script/tl/0_api.d.ts +1 -2
  84. package/script/tl/0_api.d.ts.map +1 -1
  85. package/script/tl/0_api.js +7346 -6640
  86. package/script/tl/0_tl_raw_reader.d.ts +2 -0
  87. package/script/tl/0_tl_raw_reader.d.ts.map +1 -1
  88. package/script/tl/0_tl_raw_reader.js +10 -0
  89. package/script/tl/1_utilities.d.ts +10 -1
  90. package/script/tl/1_utilities.d.ts.map +1 -1
  91. package/script/tl/1_utilities.js +29 -1
  92. package/script/tl/{5_message.d.ts → 2_message.d.ts} +5 -8
  93. package/script/tl/2_message.d.ts.map +1 -0
  94. package/script/tl/{5_message.js → 2_message.js} +17 -34
  95. package/script/tl/{3_tl_reader.d.ts → 2_tl_reader.d.ts} +4 -3
  96. package/script/tl/2_tl_reader.d.ts.map +1 -0
  97. package/script/tl/2_tl_reader.js +150 -0
  98. package/script/tl/2_tl_reader_test.d.ts.map +1 -0
  99. package/{esm/tl/4_tl_writer.d.ts → script/tl/2_tl_writer.d.ts} +4 -3
  100. package/script/tl/2_tl_writer.d.ts.map +1 -0
  101. package/script/tl/2_tl_writer.js +213 -0
  102. package/script/tl/2_tl_writer_test.d.ts.map +1 -0
  103. package/{esm/tl/3_utilities.d.ts → script/tl/2_utilities.d.ts} +1 -1
  104. package/script/tl/{3_utilities.d.ts.map → 2_utilities.d.ts.map} +1 -1
  105. package/script/types/2_chosen_inline_result.d.ts.map +1 -1
  106. package/script/types/2_chosen_inline_result.js +1 -1
  107. package/script/types/4_message.d.ts +3 -3
  108. package/script/types/4_message.d.ts.map +1 -1
  109. package/script/types/4_message.js +16 -8
  110. package/script/types/5_callback_query.d.ts.map +1 -1
  111. package/script/types/5_callback_query.js +2 -2
  112. package/script/types/5_topic.d.ts +34 -0
  113. package/script/types/5_topic.d.ts.map +1 -0
  114. package/script/types/5_topic.js +79 -0
  115. package/script/utilities/0_misc.d.ts +0 -1
  116. package/script/utilities/0_misc.d.ts.map +1 -1
  117. package/script/utilities/0_misc.js +1 -2
  118. package/esm/tl/2_deserialize.d.ts +0 -23
  119. package/esm/tl/2_deserialize.d.ts.map +0 -1
  120. package/esm/tl/2_deserialize.js +0 -98
  121. package/esm/tl/2_serialize.d.ts +0 -22
  122. package/esm/tl/2_serialize.d.ts.map +0 -1
  123. package/esm/tl/2_serialize.js +0 -163
  124. package/esm/tl/2_serialize_test.d.ts.map +0 -1
  125. package/esm/tl/3_deserialize_test.d.ts.map +0 -1
  126. package/esm/tl/3_tl_reader.d.ts.map +0 -1
  127. package/esm/tl/3_tl_reader.js +0 -49
  128. package/esm/tl/4_rpc_result.d.ts.map +0 -1
  129. package/esm/tl/4_rpc_result.js +0 -33
  130. package/esm/tl/4_tl_writer.d.ts.map +0 -1
  131. package/esm/tl/4_tl_writer.js +0 -45
  132. package/esm/tl/5_message.d.ts.map +0 -1
  133. package/script/tl/2_deserialize.d.ts +0 -23
  134. package/script/tl/2_deserialize.d.ts.map +0 -1
  135. package/script/tl/2_deserialize.js +0 -101
  136. package/script/tl/2_serialize.d.ts +0 -22
  137. package/script/tl/2_serialize.d.ts.map +0 -1
  138. package/script/tl/2_serialize.js +0 -166
  139. package/script/tl/2_serialize_test.d.ts.map +0 -1
  140. package/script/tl/3_deserialize_test.d.ts.map +0 -1
  141. package/script/tl/3_tl_reader.d.ts.map +0 -1
  142. package/script/tl/3_tl_reader.js +0 -53
  143. package/script/tl/4_rpc_result.d.ts +0 -27
  144. package/script/tl/4_rpc_result.d.ts.map +0 -1
  145. package/script/tl/4_rpc_result.js +0 -37
  146. package/script/tl/4_tl_writer.d.ts.map +0 -1
  147. package/script/tl/4_tl_writer.js +0 -49
  148. package/script/tl/5_message.d.ts.map +0 -1
  149. /package/esm/tl/{3_utilities.js → 2_utilities.js} +0 -0
  150. /package/script/tl/{3_utilities.js → 2_utilities.js} +0 -0
@@ -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"}
@@ -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