@mtkruto/node 0.1.121 → 0.1.122

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.
@@ -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 = 167;
8
- export declare const APP_VERSION = "MTKruto 0.1.121";
8
+ export declare const APP_VERSION = "MTKruto 0.1.122";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
54
54
  export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
55
55
  export const INITIAL_DC = "2";
56
56
  export const LAYER = 167;
57
- export const APP_VERSION = "MTKruto 0.1.121";
57
+ export const APP_VERSION = "MTKruto 0.1.122";
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];
@@ -24,9 +24,7 @@ export function analyzeOptionalParam(ntype) {
24
24
  function serializeSingleParam(writer, value, type, ntype, debugInfo) {
25
25
  const valueRepr = value == null ? null : (typeof value === "object" && name in value) ? value[name] : value.constructor.name;
26
26
  if (isTLObjectConstructor(type)) {
27
- if (
28
- // TODO: TypeX
29
- (type.name == "TypeX" && value instanceof TLObject) ||
27
+ if ((type[name] == "TypeX" && value instanceof TLObject) ||
30
28
  value instanceof type) {
31
29
  writer.write(value[serialize]());
32
30
  return;
@@ -108,7 +106,7 @@ function serializeSingleParam(writer, value, type, ntype, debugInfo) {
108
106
  }
109
107
  export class TLObject {
110
108
  static get [name]() {
111
- throw new Error("Not implemented");
109
+ return `ctor_${this.constructor.name}`;
112
110
  }
113
111
  get [name]() {
114
112
  return this.constructor[name];
@@ -2,6 +2,7 @@ import { id, params, TLObject, Params, TLObjectConstructor, ParamDesc, paramDesc
2
2
  export declare abstract class Type_ extends TLObject {
3
3
  }
4
4
  export declare abstract class TypeX_ extends Type_ {
5
+ static get [name](): string;
5
6
  }
6
7
  export declare abstract class _ResPQ_ extends Type_ {
7
8
  }
package/esm/tl/2_types.js CHANGED
@@ -4,6 +4,9 @@ export class Type_ extends TLObject {
4
4
  }
5
5
  // Unknown type (generic)
6
6
  export class TypeX_ extends Type_ {
7
+ static get [name]() {
8
+ return "TypeX";
9
+ }
7
10
  }
8
11
  export class _ResPQ_ extends Type_ {
9
12
  }
@@ -1,9 +1,10 @@
1
- import { id } from "./1_tl_object.js";
1
+ import { id, name } from "./1_tl_object.js";
2
2
  import { ReadObject } from "./3_tl_reader.js";
3
3
  export declare class RPCResult {
4
4
  readonly messageId: bigint;
5
5
  readonly result: ReadObject;
6
6
  static get [id](): number;
7
+ get [name](): string;
7
8
  constructor(messageId: bigint, result: ReadObject);
8
9
  static deserialize(buffer: Uint8Array): RPCResult;
9
10
  }
@@ -1,9 +1,12 @@
1
- import { id } from "./1_tl_object.js";
1
+ import { id, name } from "./1_tl_object.js";
2
2
  import { TLReader } from "./3_tl_reader.js";
3
3
  export class RPCResult {
4
4
  static get [id]() {
5
5
  return 0xF35C6D01;
6
6
  }
7
+ get [name]() {
8
+ return "rpc_result";
9
+ }
7
10
  constructor(messageId, result) {
8
11
  Object.defineProperty(this, "messageId", {
9
12
  enumerable: true,
@@ -1,8 +1,9 @@
1
- import { id } from "./1_tl_object.js";
1
+ import { id, name } from "./1_tl_object.js";
2
2
  import { Message_ } from "./6_message.js";
3
3
  export declare class MessageContainer {
4
4
  messages: Message_[];
5
5
  static get [id](): number;
6
+ get [name](): string;
6
7
  constructor(messages: Message_[]);
7
8
  serialize(): Uint8Array;
8
9
  static deserialize(buffer: Uint8Array): MessageContainer;
@@ -1,4 +1,4 @@
1
- import { id } from "./1_tl_object.js";
1
+ import { id, name } from "./1_tl_object.js";
2
2
  import { TLReader } from "./3_tl_reader.js";
3
3
  import { TLWriter } from "./4_tl_writer.js";
4
4
  import { Message_ } from "./6_message.js";
@@ -6,6 +6,9 @@ export class MessageContainer {
6
6
  static get [id]() {
7
7
  return 0x73F1F8DC;
8
8
  }
9
+ get [name]() {
10
+ return "msg_container";
11
+ }
9
12
  constructor(messages) {
10
13
  Object.defineProperty(this, "messages", {
11
14
  enumerable: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtkruto/node",
3
- "version": "0.1.121",
3
+ "version": "0.1.122",
4
4
  "description": "MTKruto for Node.js",
5
5
  "author": "Roj <rojvv@icloud.com>",
6
6
  "repository": {
@@ -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 = 167;
8
- export declare const APP_VERSION = "MTKruto 0.1.121";
8
+ export declare const APP_VERSION = "MTKruto 0.1.122";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
80
80
  exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
81
81
  exports.INITIAL_DC = "2";
82
82
  exports.LAYER = 167;
83
- exports.APP_VERSION = "MTKruto 0.1.121";
83
+ exports.APP_VERSION = "MTKruto 0.1.122";
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];
@@ -29,9 +29,7 @@ exports.analyzeOptionalParam = analyzeOptionalParam;
29
29
  function serializeSingleParam(writer, value, type, ntype, debugInfo) {
30
30
  const valueRepr = value == null ? null : (typeof value === "object" && exports.name in value) ? value[exports.name] : value.constructor.name;
31
31
  if (isTLObjectConstructor(type)) {
32
- if (
33
- // TODO: TypeX
34
- (type.name == "TypeX" && value instanceof TLObject) ||
32
+ if ((type[exports.name] == "TypeX" && value instanceof TLObject) ||
35
33
  value instanceof type) {
36
34
  writer.write(value[exports.serialize]());
37
35
  return;
@@ -113,7 +111,7 @@ function serializeSingleParam(writer, value, type, ntype, debugInfo) {
113
111
  }
114
112
  class TLObject {
115
113
  static get [exports.name]() {
116
- throw new Error("Not implemented");
114
+ return `ctor_${this.constructor.name}`;
117
115
  }
118
116
  get [exports.name]() {
119
117
  return this.constructor[exports.name];
@@ -2,6 +2,7 @@ import { id, params, TLObject, Params, TLObjectConstructor, ParamDesc, paramDesc
2
2
  export declare abstract class Type_ extends TLObject {
3
3
  }
4
4
  export declare abstract class TypeX_ extends Type_ {
5
+ static get [name](): string;
5
6
  }
6
7
  export declare abstract class _ResPQ_ extends Type_ {
7
8
  }
@@ -41,6 +41,9 @@ class Type_ extends _1_tl_object_js_1.TLObject {
41
41
  exports.Type_ = Type_;
42
42
  // Unknown type (generic)
43
43
  class TypeX_ extends Type_ {
44
+ static get [_1_tl_object_js_1.name]() {
45
+ return "TypeX";
46
+ }
44
47
  }
45
48
  exports.TypeX_ = TypeX_;
46
49
  class _ResPQ_ extends Type_ {
@@ -1,9 +1,10 @@
1
- import { id } from "./1_tl_object.js";
1
+ import { id, name } from "./1_tl_object.js";
2
2
  import { ReadObject } from "./3_tl_reader.js";
3
3
  export declare class RPCResult {
4
4
  readonly messageId: bigint;
5
5
  readonly result: ReadObject;
6
6
  static get [id](): number;
7
+ get [name](): string;
7
8
  constructor(messageId: bigint, result: ReadObject);
8
9
  static deserialize(buffer: Uint8Array): RPCResult;
9
10
  }
@@ -7,6 +7,9 @@ class RPCResult {
7
7
  static get [_1_tl_object_js_1.id]() {
8
8
  return 0xF35C6D01;
9
9
  }
10
+ get [_1_tl_object_js_1.name]() {
11
+ return "rpc_result";
12
+ }
10
13
  constructor(messageId, result) {
11
14
  Object.defineProperty(this, "messageId", {
12
15
  enumerable: true,
@@ -1,8 +1,9 @@
1
- import { id } from "./1_tl_object.js";
1
+ import { id, name } from "./1_tl_object.js";
2
2
  import { Message_ } from "./6_message.js";
3
3
  export declare class MessageContainer {
4
4
  messages: Message_[];
5
5
  static get [id](): number;
6
+ get [name](): string;
6
7
  constructor(messages: Message_[]);
7
8
  serialize(): Uint8Array;
8
9
  static deserialize(buffer: Uint8Array): MessageContainer;
@@ -9,6 +9,9 @@ class MessageContainer {
9
9
  static get [_1_tl_object_js_1.id]() {
10
10
  return 0x73F1F8DC;
11
11
  }
12
+ get [_1_tl_object_js_1.name]() {
13
+ return "msg_container";
14
+ }
12
15
  constructor(messages) {
13
16
  Object.defineProperty(this, "messages", {
14
17
  enumerable: true,