@mtkruto/node 0.0.969 → 0.0.971
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/constants.d.ts +1 -1
- package/esm/constants.js +1 -1
- package/esm/tl/1_tl_object.js +11 -10
- package/package.json +1 -1
- package/script/constants.d.ts +1 -1
- package/script/constants.js +1 -1
- package/script/tl/1_tl_object.js +11 -10
package/esm/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
|
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 160;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.971";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/esm/constants.js
CHANGED
|
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
|
|
|
54
54
|
export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
55
55
|
export const INITIAL_DC = "2-test";
|
|
56
56
|
export const LAYER = 160;
|
|
57
|
-
export const APP_VERSION = "MTKruto 0.0.
|
|
57
|
+
export const APP_VERSION = "MTKruto 0.0.971";
|
|
58
58
|
// @ts-ignore: lib
|
|
59
59
|
export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
60
60
|
export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
package/esm/tl/1_tl_object.js
CHANGED
|
@@ -20,7 +20,7 @@ export function analyzeOptionalParam(ntype) {
|
|
|
20
20
|
assertFalse(isNaN(bitIndex));
|
|
21
21
|
return { flagField, bitIndex };
|
|
22
22
|
}
|
|
23
|
-
function serializeSingleParam(writer, value, type, ntype) {
|
|
23
|
+
function serializeSingleParam(writer, value, type, ntype, debugInfo) {
|
|
24
24
|
const valueRepr = value == null ? null : value.constructor.name;
|
|
25
25
|
if (isTLObjectConstructor(type)) {
|
|
26
26
|
if ((type.name == "TypeX" && value instanceof TLObject) ||
|
|
@@ -29,7 +29,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
throw new TypeError(`Expected ${type.name} but received ${valueRepr}`);
|
|
32
|
+
throw new TypeError(`Expected ${type.name} but received ${valueRepr} ${debugInfo}`);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
if (type == Uint8Array) {
|
|
@@ -37,7 +37,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
37
37
|
writer.writeBytes(value);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
throw new TypeError(`Expected Uint8Array but received ${valueRepr}`);
|
|
40
|
+
throw new TypeError(`Expected Uint8Array but received ${valueRepr} ${debugInfo}`);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
switch (type) {
|
|
@@ -54,7 +54,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
|
-
throw new TypeError(`Expected bigint but received ${valueRepr}`);
|
|
57
|
+
throw new TypeError(`Expected bigint but received ${valueRepr} ${debugInfo}`);
|
|
58
58
|
}
|
|
59
59
|
break;
|
|
60
60
|
case "boolean":
|
|
@@ -67,7 +67,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
|
-
throw new TypeError(`Expected boolean but received ${valueRepr}`);
|
|
70
|
+
throw new TypeError(`Expected boolean but received ${valueRepr} ${debugInfo}`);
|
|
71
71
|
}
|
|
72
72
|
break;
|
|
73
73
|
case "number":
|
|
@@ -80,7 +80,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
80
80
|
writer.writeInt32(value);
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
|
-
throw new TypeError(`Expected number but received ${valueRepr}`);
|
|
83
|
+
throw new TypeError(`Expected number but received ${valueRepr} ${debugInfo}`);
|
|
84
84
|
}
|
|
85
85
|
break;
|
|
86
86
|
case "string":
|
|
@@ -99,7 +99,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
99
99
|
break;
|
|
100
100
|
case "true":
|
|
101
101
|
if (value !== true) {
|
|
102
|
-
throw new TypeError(`Expected true but received ${valueRepr}`);
|
|
102
|
+
throw new TypeError(`Expected true but received ${valueRepr} ${debugInfo}`);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -114,10 +114,11 @@ export class TLObject {
|
|
|
114
114
|
[serialize]() {
|
|
115
115
|
const writer = new TLRawWriter();
|
|
116
116
|
writer.writeInt32(this[id], false);
|
|
117
|
-
for (const [value, type, ntype] of this[params]) {
|
|
117
|
+
for (const [i, [value, type, ntype]] of this[params].entries()) {
|
|
118
118
|
if (isOptionalParam(ntype) && value == null) {
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
121
|
+
const debugInfo = `[${this[id].toString(16).toUpperCase()} ${i}]`;
|
|
121
122
|
if (type == flags) {
|
|
122
123
|
let flags = 0;
|
|
123
124
|
const flagField_ = value;
|
|
@@ -142,11 +143,11 @@ export class TLObject {
|
|
|
142
143
|
writer.writeInt32(0x1CB5C415); // vector constructor
|
|
143
144
|
writer.writeInt32(value.length);
|
|
144
145
|
for (const item of value) {
|
|
145
|
-
serializeSingleParam(writer, item, itemsType, ntype);
|
|
146
|
+
serializeSingleParam(writer, item, itemsType, ntype, debugInfo);
|
|
146
147
|
}
|
|
147
148
|
continue;
|
|
148
149
|
}
|
|
149
|
-
serializeSingleParam(writer, value, type, ntype);
|
|
150
|
+
serializeSingleParam(writer, value, type, ntype, debugInfo);
|
|
150
151
|
}
|
|
151
152
|
return writer.buffer;
|
|
152
153
|
}
|
package/package.json
CHANGED
package/script/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
|
|
|
5
5
|
export declare const VECTOR_CONSTRUCTOR = 481674261;
|
|
6
6
|
export declare const INITIAL_DC: DC;
|
|
7
7
|
export declare const LAYER = 160;
|
|
8
|
-
export declare const APP_VERSION = "MTKruto 0.0.
|
|
8
|
+
export declare const APP_VERSION = "MTKruto 0.0.971";
|
|
9
9
|
export declare const DEVICE_MODEL: string;
|
|
10
10
|
export declare const LANG_CODE: string;
|
|
11
11
|
export declare const LANG_PACK = "";
|
package/script/constants.js
CHANGED
|
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
|
|
|
80
80
|
exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
|
|
81
81
|
exports.INITIAL_DC = "2-test";
|
|
82
82
|
exports.LAYER = 160;
|
|
83
|
-
exports.APP_VERSION = "MTKruto 0.0.
|
|
83
|
+
exports.APP_VERSION = "MTKruto 0.0.971";
|
|
84
84
|
// @ts-ignore: lib
|
|
85
85
|
exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
|
|
86
86
|
exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
|
package/script/tl/1_tl_object.js
CHANGED
|
@@ -25,7 +25,7 @@ function analyzeOptionalParam(ntype) {
|
|
|
25
25
|
return { flagField, bitIndex };
|
|
26
26
|
}
|
|
27
27
|
exports.analyzeOptionalParam = analyzeOptionalParam;
|
|
28
|
-
function serializeSingleParam(writer, value, type, ntype) {
|
|
28
|
+
function serializeSingleParam(writer, value, type, ntype, debugInfo) {
|
|
29
29
|
const valueRepr = value == null ? null : value.constructor.name;
|
|
30
30
|
if (isTLObjectConstructor(type)) {
|
|
31
31
|
if ((type.name == "TypeX" && value instanceof TLObject) ||
|
|
@@ -34,7 +34,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
throw new TypeError(`Expected ${type.name} but received ${valueRepr}`);
|
|
37
|
+
throw new TypeError(`Expected ${type.name} but received ${valueRepr} ${debugInfo}`);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
if (type == Uint8Array) {
|
|
@@ -42,7 +42,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
42
42
|
writer.writeBytes(value);
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
|
-
throw new TypeError(`Expected Uint8Array but received ${valueRepr}`);
|
|
45
|
+
throw new TypeError(`Expected Uint8Array but received ${valueRepr} ${debugInfo}`);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
switch (type) {
|
|
@@ -59,7 +59,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
|
-
throw new TypeError(`Expected bigint but received ${valueRepr}`);
|
|
62
|
+
throw new TypeError(`Expected bigint but received ${valueRepr} ${debugInfo}`);
|
|
63
63
|
}
|
|
64
64
|
break;
|
|
65
65
|
case "boolean":
|
|
@@ -72,7 +72,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
75
|
-
throw new TypeError(`Expected boolean but received ${valueRepr}`);
|
|
75
|
+
throw new TypeError(`Expected boolean but received ${valueRepr} ${debugInfo}`);
|
|
76
76
|
}
|
|
77
77
|
break;
|
|
78
78
|
case "number":
|
|
@@ -85,7 +85,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
85
85
|
writer.writeInt32(value);
|
|
86
86
|
}
|
|
87
87
|
else {
|
|
88
|
-
throw new TypeError(`Expected number but received ${valueRepr}`);
|
|
88
|
+
throw new TypeError(`Expected number but received ${valueRepr} ${debugInfo}`);
|
|
89
89
|
}
|
|
90
90
|
break;
|
|
91
91
|
case "string":
|
|
@@ -104,7 +104,7 @@ function serializeSingleParam(writer, value, type, ntype) {
|
|
|
104
104
|
break;
|
|
105
105
|
case "true":
|
|
106
106
|
if (value !== true) {
|
|
107
|
-
throw new TypeError(`Expected true but received ${valueRepr}`);
|
|
107
|
+
throw new TypeError(`Expected true but received ${valueRepr} ${debugInfo}`);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -119,10 +119,11 @@ class TLObject {
|
|
|
119
119
|
[exports.serialize]() {
|
|
120
120
|
const writer = new _0_tl_raw_writer_js_1.TLRawWriter();
|
|
121
121
|
writer.writeInt32(this[exports.id], false);
|
|
122
|
-
for (const [value, type, ntype] of this[exports.params]) {
|
|
122
|
+
for (const [i, [value, type, ntype]] of this[exports.params].entries()) {
|
|
123
123
|
if (isOptionalParam(ntype) && value == null) {
|
|
124
124
|
continue;
|
|
125
125
|
}
|
|
126
|
+
const debugInfo = `[${this[exports.id].toString(16).toUpperCase()} ${i}]`;
|
|
126
127
|
if (type == exports.flags) {
|
|
127
128
|
let flags = 0;
|
|
128
129
|
const flagField_ = value;
|
|
@@ -147,11 +148,11 @@ class TLObject {
|
|
|
147
148
|
writer.writeInt32(0x1CB5C415); // vector constructor
|
|
148
149
|
writer.writeInt32(value.length);
|
|
149
150
|
for (const item of value) {
|
|
150
|
-
serializeSingleParam(writer, item, itemsType, ntype);
|
|
151
|
+
serializeSingleParam(writer, item, itemsType, ntype, debugInfo);
|
|
151
152
|
}
|
|
152
153
|
continue;
|
|
153
154
|
}
|
|
154
|
-
serializeSingleParam(writer, value, type, ntype);
|
|
155
|
+
serializeSingleParam(writer, value, type, ntype, debugInfo);
|
|
155
156
|
}
|
|
156
157
|
return writer.buffer;
|
|
157
158
|
}
|