@mtkruto/node 0.60.0 → 0.62.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 (111) 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/client/0_storage_operations.d.ts.map +1 -1
  5. package/esm/client/0_storage_operations.js +9 -9
  6. package/esm/client/1_client_encrypted.d.ts.map +1 -1
  7. package/esm/client/1_client_encrypted.js +173 -126
  8. package/esm/client/1_client_plain.d.ts.map +1 -1
  9. package/esm/client/1_client_plain.js +12 -8
  10. package/esm/tl/0_api.d.ts +1 -2
  11. package/esm/tl/0_api.d.ts.map +1 -1
  12. package/esm/tl/0_api.js +7345 -6639
  13. package/esm/tl/0_tl_raw_reader.d.ts +2 -0
  14. package/esm/tl/0_tl_raw_reader.d.ts.map +1 -1
  15. package/esm/tl/0_tl_raw_reader.js +10 -0
  16. package/esm/tl/1_utilities.d.ts +10 -1
  17. package/esm/tl/1_utilities.d.ts.map +1 -1
  18. package/esm/tl/1_utilities.js +25 -1
  19. package/esm/tl/{5_message.d.ts → 2_message.d.ts} +5 -8
  20. package/esm/tl/2_message.d.ts.map +1 -0
  21. package/esm/tl/{5_message.js → 2_message.js} +16 -33
  22. package/esm/tl/{3_tl_reader.d.ts → 2_tl_reader.d.ts} +4 -3
  23. package/esm/tl/2_tl_reader.d.ts.map +1 -0
  24. package/esm/tl/2_tl_reader.js +146 -0
  25. package/esm/tl/2_tl_reader_test.d.ts.map +1 -0
  26. package/{script/tl/4_tl_writer.d.ts → esm/tl/2_tl_writer.d.ts} +4 -3
  27. package/esm/tl/2_tl_writer.d.ts.map +1 -0
  28. package/esm/tl/2_tl_writer.js +206 -0
  29. package/esm/tl/2_tl_writer_test.d.ts.map +1 -0
  30. package/{script/tl/3_utilities.d.ts → esm/tl/2_utilities.d.ts} +1 -1
  31. package/esm/tl/{3_utilities.d.ts.map → 2_utilities.d.ts.map} +1 -1
  32. package/esm/types/2_chosen_inline_result.d.ts.map +1 -1
  33. package/esm/types/2_chosen_inline_result.js +2 -2
  34. package/esm/types/5_callback_query.d.ts.map +1 -1
  35. package/esm/types/5_callback_query.js +3 -3
  36. package/esm/utilities/0_misc.d.ts +0 -1
  37. package/esm/utilities/0_misc.d.ts.map +1 -1
  38. package/esm/utilities/0_misc.js +0 -1
  39. package/package.json +1 -1
  40. package/script/2_tl.d.ts +4 -6
  41. package/script/2_tl.d.ts.map +1 -1
  42. package/script/2_tl.js +4 -6
  43. package/script/client/0_storage_operations.d.ts.map +1 -1
  44. package/script/client/0_storage_operations.js +8 -8
  45. package/script/client/1_client_encrypted.d.ts.map +1 -1
  46. package/script/client/1_client_encrypted.js +171 -124
  47. package/script/client/1_client_plain.d.ts.map +1 -1
  48. package/script/client/1_client_plain.js +11 -7
  49. package/script/tl/0_api.d.ts +1 -2
  50. package/script/tl/0_api.d.ts.map +1 -1
  51. package/script/tl/0_api.js +7346 -6640
  52. package/script/tl/0_tl_raw_reader.d.ts +2 -0
  53. package/script/tl/0_tl_raw_reader.d.ts.map +1 -1
  54. package/script/tl/0_tl_raw_reader.js +10 -0
  55. package/script/tl/1_utilities.d.ts +10 -1
  56. package/script/tl/1_utilities.d.ts.map +1 -1
  57. package/script/tl/1_utilities.js +29 -1
  58. package/script/tl/{5_message.d.ts → 2_message.d.ts} +5 -8
  59. package/script/tl/2_message.d.ts.map +1 -0
  60. package/script/tl/{5_message.js → 2_message.js} +17 -34
  61. package/script/tl/{3_tl_reader.d.ts → 2_tl_reader.d.ts} +4 -3
  62. package/script/tl/2_tl_reader.d.ts.map +1 -0
  63. package/script/tl/2_tl_reader.js +150 -0
  64. package/script/tl/2_tl_reader_test.d.ts.map +1 -0
  65. package/{esm/tl/4_tl_writer.d.ts → script/tl/2_tl_writer.d.ts} +4 -3
  66. package/script/tl/2_tl_writer.d.ts.map +1 -0
  67. package/script/tl/2_tl_writer.js +210 -0
  68. package/script/tl/2_tl_writer_test.d.ts.map +1 -0
  69. package/{esm/tl/3_utilities.d.ts → script/tl/2_utilities.d.ts} +1 -1
  70. package/script/tl/{3_utilities.d.ts.map → 2_utilities.d.ts.map} +1 -1
  71. package/script/types/2_chosen_inline_result.d.ts.map +1 -1
  72. package/script/types/2_chosen_inline_result.js +1 -1
  73. package/script/types/5_callback_query.d.ts.map +1 -1
  74. package/script/types/5_callback_query.js +2 -2
  75. package/script/utilities/0_misc.d.ts +0 -1
  76. package/script/utilities/0_misc.d.ts.map +1 -1
  77. package/script/utilities/0_misc.js +1 -2
  78. package/esm/tl/2_deserialize.d.ts +0 -23
  79. package/esm/tl/2_deserialize.d.ts.map +0 -1
  80. package/esm/tl/2_deserialize.js +0 -98
  81. package/esm/tl/2_serialize.d.ts +0 -22
  82. package/esm/tl/2_serialize.d.ts.map +0 -1
  83. package/esm/tl/2_serialize.js +0 -163
  84. package/esm/tl/2_serialize_test.d.ts.map +0 -1
  85. package/esm/tl/3_deserialize_test.d.ts.map +0 -1
  86. package/esm/tl/3_tl_reader.d.ts.map +0 -1
  87. package/esm/tl/3_tl_reader.js +0 -49
  88. package/esm/tl/4_rpc_result.d.ts +0 -27
  89. package/esm/tl/4_rpc_result.d.ts.map +0 -1
  90. package/esm/tl/4_rpc_result.js +0 -33
  91. package/esm/tl/4_tl_writer.d.ts.map +0 -1
  92. package/esm/tl/4_tl_writer.js +0 -45
  93. package/esm/tl/5_message.d.ts.map +0 -1
  94. package/script/tl/2_deserialize.d.ts +0 -23
  95. package/script/tl/2_deserialize.d.ts.map +0 -1
  96. package/script/tl/2_deserialize.js +0 -101
  97. package/script/tl/2_serialize.d.ts +0 -22
  98. package/script/tl/2_serialize.d.ts.map +0 -1
  99. package/script/tl/2_serialize.js +0 -166
  100. package/script/tl/2_serialize_test.d.ts.map +0 -1
  101. package/script/tl/3_deserialize_test.d.ts.map +0 -1
  102. package/script/tl/3_tl_reader.d.ts.map +0 -1
  103. package/script/tl/3_tl_reader.js +0 -53
  104. package/script/tl/4_rpc_result.d.ts +0 -27
  105. package/script/tl/4_rpc_result.d.ts.map +0 -1
  106. package/script/tl/4_rpc_result.js +0 -37
  107. package/script/tl/4_tl_writer.d.ts.map +0 -1
  108. package/script/tl/4_tl_writer.js +0 -49
  109. package/script/tl/5_message.d.ts.map +0 -1
  110. /package/esm/tl/{3_utilities.js → 2_utilities.js} +0 -0
  111. /package/script/tl/{3_utilities.js → 2_utilities.js} +0 -0
@@ -1,101 +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.deserialize = deserialize;
24
- const _0_deps_js_1 = require("../0_deps.js");
25
- const _1_utilities_js_1 = require("./1_utilities.js");
26
- const _0_api_js_1 = require("./0_api.js");
27
- function deserializeSingleParam(reader, type, ntype) {
28
- if ((0, _1_utilities_js_1.isOptionalParam)(ntype)) {
29
- ntype = (0, _1_utilities_js_1.getOptionalParamInnerType)(ntype);
30
- }
31
- if (type == Uint8Array) {
32
- return reader.readBytes();
33
- }
34
- else {
35
- switch (type) {
36
- case "bigint":
37
- if (ntype == "int128") {
38
- return reader.readInt128();
39
- }
40
- else if (ntype === "int256") {
41
- return reader.readInt256();
42
- }
43
- else {
44
- return reader.readInt64();
45
- }
46
- case "boolean":
47
- return reader.readInt32(false) == 0x997275B5;
48
- case "number":
49
- if (ntype == "double") {
50
- return reader.readDouble();
51
- }
52
- else {
53
- return reader.readInt32();
54
- }
55
- case "string":
56
- return reader.readString();
57
- case "true":
58
- return true;
59
- default: {
60
- const cid = reader.readInt32(false);
61
- const name = (0, _0_api_js_1.getTypeName)(cid);
62
- if (!name) {
63
- throw new Error(`Constructor with ID 0x${cid.toString(16).toUpperCase()} not found`);
64
- }
65
- return deserialize(reader, (0, _0_api_js_1.getType)(name)[1], name);
66
- }
67
- }
68
- }
69
- }
70
- function deserialize(reader, paramDesc, name) {
71
- const type_ = { _: name };
72
- const flagFields = {};
73
- for (const [name, type, ntype] of paramDesc) {
74
- if ((0, _1_utilities_js_1.isOptionalParam)(ntype)) {
75
- const { flagField, bitIndex } = (0, _1_utilities_js_1.analyzeOptionalParam)(ntype);
76
- const bits = flagFields[flagField];
77
- if ((bits & (1 << bitIndex)) == 0) {
78
- continue;
79
- }
80
- }
81
- if (type == _0_api_js_1.flags && ntype == "#") {
82
- flagFields[name] = reader.readInt32();
83
- continue;
84
- }
85
- if (type instanceof Array) {
86
- (0, _0_deps_js_1.assertEquals)(reader.readInt32(false), 0x1CB5C415);
87
- const count = reader.readInt32();
88
- const items = new Array();
89
- for (let i = 0; i < count; i++) {
90
- items.push(deserializeSingleParam(reader, type[0], ntype));
91
- }
92
- type_[name] = items;
93
- continue;
94
- }
95
- const value = deserializeSingleParam(reader, type, ntype);
96
- if (typeof value !== "boolean" || value) {
97
- type_[name] = value;
98
- }
99
- }
100
- return type_;
101
- }
@@ -1,22 +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
- import { AnyObject } from "./0_api.js";
21
- export declare function serialize(type_: AnyObject): Uint8Array;
22
- //# sourceMappingURL=2_serialize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"2_serialize.d.ts","sourceRoot":"","sources":["../../src/tl/2_serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AA8FvD,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CA0DtD"}
@@ -1,166 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serialize = serialize;
4
- /**
5
- * MTKruto - Cross-runtime JavaScript library for building Telegram clients
6
- * Copyright (C) 2023-2025 Roj <https://roj.im/>
7
- *
8
- * This file is part of MTKruto.
9
- *
10
- * This program is free software: you can redistribute it and/or modify
11
- * it under the terms of the GNU Lesser General Public License as published by
12
- * the Free Software Foundation, either version 3 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU Lesser General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU Lesser General Public License
21
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
- */
23
- // deno-lint-ignore-file no-explicit-any
24
- const _0_api_js_1 = require("./0_api.js");
25
- const _0_tl_raw_writer_js_1 = require("./0_tl_raw_writer.js");
26
- const _1_utilities_js_1 = require("./1_utilities.js");
27
- function serializeSingleParam(writer, value, type, ntype, debugInfo) {
28
- if ((0, _1_utilities_js_1.isOptionalParam)(ntype)) {
29
- ntype = (0, _1_utilities_js_1.getOptionalParamInnerType)(ntype);
30
- }
31
- const valueRepr = value == null ? null : (typeof value === "object" && "_" in value) ? value._ : value.constructor.name;
32
- if (type == Uint8Array) {
33
- if ((value instanceof Uint8Array)) {
34
- writer.writeBytes(value);
35
- return writer.buffer;
36
- }
37
- else {
38
- throw new TypeError(`Expected Uint8Array but received ${valueRepr} ${debugInfo}`);
39
- }
40
- }
41
- switch (type) {
42
- case "bigint":
43
- if (typeof value === "bigint") {
44
- if (ntype == "int128") {
45
- writer.writeInt128(value);
46
- }
47
- else if (ntype === "int256") {
48
- writer.writeInt256(value);
49
- }
50
- else {
51
- writer.writeInt64(value);
52
- }
53
- }
54
- else {
55
- throw new TypeError(`Expected bigint but received ${valueRepr} ${debugInfo}`);
56
- }
57
- break;
58
- case "boolean":
59
- if (typeof value === "boolean") {
60
- if (value) {
61
- writer.writeInt32(0x997275B5);
62
- }
63
- else {
64
- writer.writeInt32(0xBC799737);
65
- }
66
- }
67
- else {
68
- throw new TypeError(`Expected boolean but received ${valueRepr} ${debugInfo}`);
69
- }
70
- break;
71
- case "number":
72
- //
73
- if (value == null) {
74
- value = 0;
75
- }
76
- //
77
- if (typeof value === "number") {
78
- if (ntype == "double") {
79
- writer.writeDouble(value);
80
- }
81
- else {
82
- writer.writeInt32(value);
83
- }
84
- }
85
- else {
86
- throw new TypeError(`Expected number but received ${valueRepr} ${debugInfo}`);
87
- }
88
- break;
89
- case "string":
90
- if (typeof value === "string") {
91
- writer.writeString(value);
92
- }
93
- else if (value instanceof Uint8Array) {
94
- writer.writeBytes(value);
95
- }
96
- else {
97
- writer.writeString("");
98
- }
99
- // else {
100
- // throw new TypeError(`Expected string or Uint8Array but received ${valueRepr}`);
101
- // }
102
- break;
103
- case "true":
104
- if (value !== true) {
105
- throw new TypeError(`Expected true but received ${valueRepr} ${debugInfo}`);
106
- }
107
- break;
108
- default:
109
- // null = !X (generic)
110
- if (type != null && typeof type !== "string") {
111
- throw new TypeError(`Unexpected type: ${type} ${debugInfo}`);
112
- }
113
- writer.write(serialize(value));
114
- }
115
- return writer.buffer;
116
- }
117
- function serialize(type_) {
118
- (0, _1_utilities_js_1.assertIsValidType)(type_);
119
- const maybeParameters = (0, _0_api_js_1.getType)(type_._);
120
- if (!maybeParameters) {
121
- throw new Error(`Unknown type: ${type_._}`);
122
- }
123
- const type__ = type_;
124
- const writer = new _0_tl_raw_writer_js_1.TLRawWriter();
125
- const [id, parameters_] = maybeParameters;
126
- writer.writeInt32(id, false);
127
- for (const [i, [name, type, ntype]] of parameters_.entries()) {
128
- if ((0, _1_utilities_js_1.isOptionalParam)(ntype) && type__[name] === undefined) {
129
- continue;
130
- }
131
- const debugInfo = `[0x${id.toString(16).toUpperCase()}::${i}]`;
132
- if (type == _0_api_js_1.flags) {
133
- let flags = 0;
134
- const flagField_ = name;
135
- for (const [name, _, ntype] of parameters_) {
136
- if ((0, _1_utilities_js_1.isOptionalParam)(ntype)) {
137
- const { flagField, bitIndex } = (0, _1_utilities_js_1.analyzeOptionalParam)(ntype);
138
- if (flagField == flagField_) {
139
- if (type__[name] !== undefined) {
140
- flags |= 1 << bitIndex;
141
- }
142
- }
143
- }
144
- }
145
- writer.writeInt32(flags);
146
- continue;
147
- }
148
- if (type__[name] === undefined && !(0, _1_utilities_js_1.isOptionalParam)(ntype)) {
149
- throw new Error(`Missing required parameter: ${name}`);
150
- }
151
- if (type instanceof Array) {
152
- const itemsType = type[0];
153
- if (!Array.isArray(type__[name])) {
154
- throw new TypeError("Expected array");
155
- }
156
- writer.writeInt32(0x1CB5C415); // vector constructor
157
- writer.writeInt32(type__[name].length);
158
- for (const item of type__[name]) {
159
- serializeSingleParam(writer, item, itemsType, ntype, debugInfo);
160
- }
161
- continue;
162
- }
163
- serializeSingleParam(writer, type__[name], type, ntype, debugInfo);
164
- }
165
- return writer.buffer;
166
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"2_serialize_test.d.ts","sourceRoot":"","sources":["../../src/tl/2_serialize_test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"3_deserialize_test.d.ts","sourceRoot":"","sources":["../../src/tl/3_deserialize_test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"3_tl_reader.d.ts","sourceRoot":"","sources":["../../src/tl/3_tl_reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAW,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAwB,MAAM,YAAY,CAAC;AAG7D,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAEjE,qBAAa,QAAS,SAAQ,WAAW;IACvC,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU;CAsBpC"}
@@ -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