@mtkruto/node 0.0.820 → 0.0.822

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 (148) hide show
  1. package/esm/_dnt.test_shims.d.ts +10 -0
  2. package/esm/client/client.d.ts +114 -0
  3. package/esm/client/client.js +126 -1
  4. package/esm/tl/0_tl_raw_reader_test.d.ts +1 -0
  5. package/esm/tl/0_tl_raw_writer_test.d.ts +1 -0
  6. package/esm/tl/1_tl_object_test.d.ts +1 -0
  7. package/{types → esm}/tl/2_types.d.ts +48 -48
  8. package/esm/tl/2_types.js +180 -180
  9. package/esm/tl/2_types_test.d.ts +1 -0
  10. package/esm/tl/3_deserialize_test.d.ts +1 -0
  11. package/{types → esm}/tl/3_functions.d.ts +13 -13
  12. package/esm/tl/3_functions.js +39 -39
  13. package/esm/tl/3_functions_test.d.ts +1 -0
  14. package/esm/utilities/0_bigint_test.d.ts +1 -0
  15. package/esm/utilities/0_buffer_test.d.ts +1 -0
  16. package/{types → esm}/utilities/1_password.d.ts +1 -1
  17. package/esm/utilities/1_password.js +2 -1
  18. package/esm/utilities/1_password_test.d.ts +1 -0
  19. package/package.json +5 -12
  20. package/script/_dnt.shims.d.ts +10 -0
  21. package/script/_dnt.test_shims.d.ts +10 -0
  22. package/script/client/client.d.ts +114 -0
  23. package/script/client/client.js +127 -2
  24. package/script/client/client_abstract.d.ts +16 -0
  25. package/script/client/client_plain.d.ts +9 -0
  26. package/script/connection/connection.d.ts +7 -0
  27. package/script/connection/connection_web_socket.d.ts +13 -0
  28. package/script/constants.d.ts +12 -0
  29. package/script/deps/deno.land/std@0.186.0/fmt/colors.d.ts +270 -0
  30. package/script/deps/deno.land/std@0.186.0/testing/_diff.d.ts +26 -0
  31. package/script/deps/deno.land/std@0.186.0/testing/_format.d.ts +1 -0
  32. package/script/deps/deno.land/std@0.186.0/testing/asserts.d.ts +284 -0
  33. package/script/deps/deno.land/x/crc32@v0.2.0/mod.d.ts +15 -0
  34. package/script/deps/deno.land/x/tgcrypto@0.1.3/mod.d.ts +47 -0
  35. package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +2 -0
  36. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/gzip/gzip.d.ts +16 -0
  37. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/utils/uint8.d.ts +1 -0
  38. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/deflate.d.ts +29 -0
  39. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/inflate.d.ts +23 -0
  40. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/mod.d.ts +2 -0
  41. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/adler32.d.ts +1 -0
  42. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/crc32.d.ts +2 -0
  43. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/deflate.d.ts +78 -0
  44. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/gzheader.d.ts +12 -0
  45. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inffast.d.ts +1 -0
  46. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inflate.d.ts +47 -0
  47. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inftrees.d.ts +1 -0
  48. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/messages.d.ts +12 -0
  49. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/status.d.ts +30 -0
  50. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/trees.d.ts +5 -0
  51. package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/zstream.d.ts +14 -0
  52. package/script/deps.d.ts +4 -0
  53. package/script/mod.d.ts +24 -0
  54. package/script/session/session.d.ts +12 -0
  55. package/script/session/session_local_storage.d.ts +7 -0
  56. package/script/session/session_memory.d.ts +5 -0
  57. package/script/tl/0_tl_raw_reader.d.ts +13 -0
  58. package/script/tl/0_tl_raw_reader_test.d.ts +1 -0
  59. package/script/tl/0_tl_raw_writer.d.ts +13 -0
  60. package/script/tl/0_tl_raw_writer_test.d.ts +1 -0
  61. package/script/tl/1_tl_object.d.ts +40 -0
  62. package/script/tl/1_tl_object_test.d.ts +1 -0
  63. package/script/tl/2_types.d.ts +14815 -0
  64. package/script/tl/2_types.js +180 -180
  65. package/script/tl/2_types_test.d.ts +1 -0
  66. package/script/tl/3_deserialize.d.ts +3 -0
  67. package/script/tl/3_deserialize_test.d.ts +1 -0
  68. package/script/tl/3_functions.d.ts +6122 -0
  69. package/script/tl/3_functions.js +39 -39
  70. package/script/tl/3_functions_test.d.ts +1 -0
  71. package/script/tl/3_tl_reader.d.ts +6 -0
  72. package/script/tl/3_tl_writer.d.ts +5 -0
  73. package/script/tl/4_rpc_result.d.ts +8 -0
  74. package/script/tl/5_message.d.ts +11 -0
  75. package/script/tl/6_message_container.d.ts +9 -0
  76. package/script/transport/transport.d.ts +15 -0
  77. package/script/transport/transport_abridged.d.ts +11 -0
  78. package/script/transport/transport_intermediate.d.ts +11 -0
  79. package/script/transport/transport_provider.d.ts +17 -0
  80. package/script/types.d.ts +1 -0
  81. package/script/utilities/0_bigint.d.ts +5 -0
  82. package/script/utilities/0_bigint_test.d.ts +1 -0
  83. package/script/utilities/0_buffer.d.ts +2 -0
  84. package/script/utilities/0_buffer_test.d.ts +1 -0
  85. package/script/utilities/0_crypto.d.ts +8 -0
  86. package/script/utilities/0_hash.d.ts +2 -0
  87. package/script/utilities/1_auth.d.ts +1 -0
  88. package/script/utilities/1_message.d.ts +10 -0
  89. package/script/utilities/1_obfuscation.d.ts +6 -0
  90. package/script/utilities/1_password.d.ts +11 -0
  91. package/script/utilities/1_password.js +2 -1
  92. package/script/utilities/1_password_test.d.ts +1 -0
  93. package/types/client/client.d.ts +0 -50
  94. /package/{types → esm}/_dnt.shims.d.ts +0 -0
  95. /package/{types → esm}/client/client_abstract.d.ts +0 -0
  96. /package/{types → esm}/client/client_plain.d.ts +0 -0
  97. /package/{types → esm}/connection/connection.d.ts +0 -0
  98. /package/{types → esm}/connection/connection_web_socket.d.ts +0 -0
  99. /package/{types → esm}/constants.d.ts +0 -0
  100. /package/{types → esm}/deps/deno.land/std@0.186.0/fmt/colors.d.ts +0 -0
  101. /package/{types → esm}/deps/deno.land/std@0.186.0/testing/_diff.d.ts +0 -0
  102. /package/{types → esm}/deps/deno.land/std@0.186.0/testing/_format.d.ts +0 -0
  103. /package/{types → esm}/deps/deno.land/std@0.186.0/testing/asserts.d.ts +0 -0
  104. /package/{types → esm}/deps/deno.land/x/crc32@v0.2.0/mod.d.ts +0 -0
  105. /package/{types → esm}/deps/deno.land/x/tgcrypto@0.1.3/mod.d.ts +0 -0
  106. /package/{types → esm}/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -0
  107. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/gzip/gzip.d.ts +0 -0
  108. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/utils/uint8.d.ts +0 -0
  109. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/deflate.d.ts +0 -0
  110. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/inflate.d.ts +0 -0
  111. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/mod.d.ts +0 -0
  112. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/adler32.d.ts +0 -0
  113. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/crc32.d.ts +0 -0
  114. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/deflate.d.ts +0 -0
  115. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/gzheader.d.ts +0 -0
  116. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inffast.d.ts +0 -0
  117. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inflate.d.ts +0 -0
  118. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inftrees.d.ts +0 -0
  119. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/messages.d.ts +0 -0
  120. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/status.d.ts +0 -0
  121. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/trees.d.ts +0 -0
  122. /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/zstream.d.ts +0 -0
  123. /package/{types → esm}/deps.d.ts +0 -0
  124. /package/{types → esm}/mod.d.ts +0 -0
  125. /package/{types → esm}/session/session.d.ts +0 -0
  126. /package/{types → esm}/session/session_local_storage.d.ts +0 -0
  127. /package/{types → esm}/session/session_memory.d.ts +0 -0
  128. /package/{types → esm}/tl/0_tl_raw_reader.d.ts +0 -0
  129. /package/{types → esm}/tl/0_tl_raw_writer.d.ts +0 -0
  130. /package/{types → esm}/tl/1_tl_object.d.ts +0 -0
  131. /package/{types → esm}/tl/3_deserialize.d.ts +0 -0
  132. /package/{types → esm}/tl/3_tl_reader.d.ts +0 -0
  133. /package/{types → esm}/tl/3_tl_writer.d.ts +0 -0
  134. /package/{types → esm}/tl/4_rpc_result.d.ts +0 -0
  135. /package/{types → esm}/tl/5_message.d.ts +0 -0
  136. /package/{types → esm}/tl/6_message_container.d.ts +0 -0
  137. /package/{types → esm}/transport/transport.d.ts +0 -0
  138. /package/{types → esm}/transport/transport_abridged.d.ts +0 -0
  139. /package/{types → esm}/transport/transport_intermediate.d.ts +0 -0
  140. /package/{types → esm}/transport/transport_provider.d.ts +0 -0
  141. /package/{types → esm}/types.d.ts +0 -0
  142. /package/{types → esm}/utilities/0_bigint.d.ts +0 -0
  143. /package/{types → esm}/utilities/0_buffer.d.ts +0 -0
  144. /package/{types → esm}/utilities/0_crypto.d.ts +0 -0
  145. /package/{types → esm}/utilities/0_hash.d.ts +0 -0
  146. /package/{types → esm}/utilities/1_auth.d.ts +0 -0
  147. /package/{types → esm}/utilities/1_message.d.ts +0 -0
  148. /package/{types → esm}/utilities/1_obfuscation.d.ts +0 -0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -496,7 +496,7 @@ export declare class AccountUpdateProfile extends Function<types.TypeUser> {
496
496
  protected get [id](): number;
497
497
  static get [paramDesc](): ParamDesc;
498
498
  protected get [params](): Params;
499
- constructor(params: {
499
+ constructor(params?: {
500
500
  firstName?: string;
501
501
  lastName?: string;
502
502
  about?: string;
@@ -847,7 +847,7 @@ export declare class AccountInitTakeoutSession extends Function<types.AccountTak
847
847
  protected get [id](): number;
848
848
  static get [paramDesc](): ParamDesc;
849
849
  protected get [params](): Params;
850
- constructor(params: {
850
+ constructor(params?: {
851
851
  contacts?: true;
852
852
  messageUsers?: true;
853
853
  messageChats?: true;
@@ -862,7 +862,7 @@ export declare class AccountFinishTakeoutSession extends Function<boolean> {
862
862
  protected get [id](): number;
863
863
  static get [paramDesc](): ParamDesc;
864
864
  protected get [params](): Params;
865
- constructor(params: {
865
+ constructor(params?: {
866
866
  success?: true;
867
867
  });
868
868
  }
@@ -908,7 +908,7 @@ export declare class AccountGetNotifyExceptions extends Function<types.TypeUpdat
908
908
  protected get [id](): number;
909
909
  static get [paramDesc](): ParamDesc;
910
910
  protected get [params](): Params;
911
- constructor(params: {
911
+ constructor(params?: {
912
912
  compareSound?: true;
913
913
  peer?: types.TypeInputNotifyPeer;
914
914
  });
@@ -1054,7 +1054,7 @@ export declare class AccountInstallTheme extends Function<boolean> {
1054
1054
  protected get [id](): number;
1055
1055
  static get [paramDesc](): ParamDesc;
1056
1056
  protected get [params](): Params;
1057
- constructor(params: {
1057
+ constructor(params?: {
1058
1058
  dark?: true;
1059
1059
  theme?: types.TypeInputTheme;
1060
1060
  format?: string;
@@ -1088,7 +1088,7 @@ export declare class AccountSetContentSettings extends Function<boolean> {
1088
1088
  protected get [id](): number;
1089
1089
  static get [paramDesc](): ParamDesc;
1090
1090
  protected get [params](): Params;
1091
- constructor(params: {
1091
+ constructor(params?: {
1092
1092
  sensitiveEnabled?: true;
1093
1093
  });
1094
1094
  }
@@ -2550,7 +2550,7 @@ export declare class MessagesClearRecentStickers extends Function<boolean> {
2550
2550
  protected get [id](): number;
2551
2551
  static get [paramDesc](): ParamDesc;
2552
2552
  protected get [params](): Params;
2553
- constructor(params: {
2553
+ constructor(params?: {
2554
2554
  attached?: true;
2555
2555
  });
2556
2556
  }
@@ -3041,7 +3041,7 @@ export declare class MessagesRequestURLAuth extends Function<types.TypeURLAuthRe
3041
3041
  protected get [id](): number;
3042
3042
  static get [paramDesc](): ParamDesc;
3043
3043
  protected get [params](): Params;
3044
- constructor(params: {
3044
+ constructor(params?: {
3045
3045
  peer?: types.TypeInputPeer;
3046
3046
  msgId?: number;
3047
3047
  buttonId?: number;
@@ -3057,7 +3057,7 @@ export declare class MessagesAcceptURLAuth extends Function<types.TypeURLAuthRes
3057
3057
  protected get [id](): number;
3058
3058
  static get [paramDesc](): ParamDesc;
3059
3059
  protected get [params](): Params;
3060
- constructor(params: {
3060
+ constructor(params?: {
3061
3061
  writeAllowed?: true;
3062
3062
  peer?: types.TypeInputPeer;
3063
3063
  msgId?: number;
@@ -3269,7 +3269,7 @@ export declare class MessagesDeletePhoneCallHistory extends Function<types.Messa
3269
3269
  protected get [id](): number;
3270
3270
  static get [paramDesc](): ParamDesc;
3271
3271
  protected get [params](): Params;
3272
- constructor(params: {
3272
+ constructor(params?: {
3273
3273
  revoke?: true;
3274
3274
  });
3275
3275
  }
@@ -4092,7 +4092,7 @@ export declare class PhotosUploadProfilePhoto extends Function<types.PhotosPhoto
4092
4092
  protected get [id](): number;
4093
4093
  static get [paramDesc](): ParamDesc;
4094
4094
  protected get [params](): Params;
4095
- constructor(params: {
4095
+ constructor(params?: {
4096
4096
  fallback?: true;
4097
4097
  bot?: types.TypeInputUser;
4098
4098
  file?: types.TypeInputFile;
@@ -4686,7 +4686,7 @@ export declare class ChannelsGetAdminedPublicChannels extends Function<types.Typ
4686
4686
  protected get [id](): number;
4687
4687
  static get [paramDesc](): ParamDesc;
4688
4688
  protected get [params](): Params;
4689
- constructor(params: {
4689
+ constructor(params?: {
4690
4690
  byLocation?: true;
4691
4691
  checkLimit?: true;
4692
4692
  });
@@ -5306,7 +5306,7 @@ export declare class PaymentsClearSavedInfo extends Function<boolean> {
5306
5306
  protected get [id](): number;
5307
5307
  static get [paramDesc](): ParamDesc;
5308
5308
  protected get [params](): Params;
5309
- constructor(params: {
5309
+ constructor(params?: {
5310
5310
  credentials?: true;
5311
5311
  info?: true;
5312
5312
  });
@@ -1594,9 +1594,9 @@ export class AccountUpdateProfile extends Function {
1594
1594
  writable: true,
1595
1595
  value: void 0
1596
1596
  });
1597
- this.firstName = params.firstName;
1598
- this.lastName = params.lastName;
1599
- this.about = params.about;
1597
+ this.firstName = params?.firstName;
1598
+ this.lastName = params?.lastName;
1599
+ this.about = params?.about;
1600
1600
  }
1601
1601
  }
1602
1602
  export class AccountUpdateStatus extends Function {
@@ -2664,13 +2664,13 @@ export class AccountInitTakeoutSession extends Function {
2664
2664
  writable: true,
2665
2665
  value: void 0
2666
2666
  });
2667
- this.contacts = params.contacts;
2668
- this.messageUsers = params.messageUsers;
2669
- this.messageChats = params.messageChats;
2670
- this.messageMegagroups = params.messageMegagroups;
2671
- this.messageChannels = params.messageChannels;
2672
- this.files = params.files;
2673
- this.fileMaxSize = params.fileMaxSize;
2667
+ this.contacts = params?.contacts;
2668
+ this.messageUsers = params?.messageUsers;
2669
+ this.messageChats = params?.messageChats;
2670
+ this.messageMegagroups = params?.messageMegagroups;
2671
+ this.messageChannels = params?.messageChannels;
2672
+ this.files = params?.files;
2673
+ this.fileMaxSize = params?.fileMaxSize;
2674
2674
  }
2675
2675
  }
2676
2676
  export class AccountFinishTakeoutSession extends Function {
@@ -2697,7 +2697,7 @@ export class AccountFinishTakeoutSession extends Function {
2697
2697
  writable: true,
2698
2698
  value: void 0
2699
2699
  });
2700
- this.success = params.success;
2700
+ this.success = params?.success;
2701
2701
  }
2702
2702
  }
2703
2703
  export class AccountConfirmPasswordEmail extends Function {
@@ -2824,8 +2824,8 @@ export class AccountGetNotifyExceptions extends Function {
2824
2824
  writable: true,
2825
2825
  value: void 0
2826
2826
  });
2827
- this.compareSound = params.compareSound;
2828
- this.peer = params.peer;
2827
+ this.compareSound = params?.compareSound;
2828
+ this.peer = params?.peer;
2829
2829
  }
2830
2830
  }
2831
2831
  export class AccountGetWallPaper extends Function {
@@ -3319,10 +3319,10 @@ export class AccountInstallTheme extends Function {
3319
3319
  writable: true,
3320
3320
  value: void 0
3321
3321
  });
3322
- this.dark = params.dark;
3323
- this.theme = params.theme;
3324
- this.format = params.format;
3325
- this.baseTheme = params.baseTheme;
3322
+ this.dark = params?.dark;
3323
+ this.theme = params?.theme;
3324
+ this.format = params?.format;
3325
+ this.baseTheme = params?.baseTheme;
3326
3326
  }
3327
3327
  }
3328
3328
  export class AccountGetTheme extends Function {
@@ -3417,7 +3417,7 @@ export class AccountSetContentSettings extends Function {
3417
3417
  writable: true,
3418
3418
  value: void 0
3419
3419
  });
3420
- this.sensitiveEnabled = params.sensitiveEnabled;
3420
+ this.sensitiveEnabled = params?.sensitiveEnabled;
3421
3421
  }
3422
3422
  }
3423
3423
  export class AccountGetContentSettings extends Function {
@@ -8265,7 +8265,7 @@ export class MessagesClearRecentStickers extends Function {
8265
8265
  writable: true,
8266
8266
  value: void 0
8267
8267
  });
8268
- this.attached = params.attached;
8268
+ this.attached = params?.attached;
8269
8269
  }
8270
8270
  }
8271
8271
  export class MessagesGetArchivedStickers extends Function {
@@ -9887,10 +9887,10 @@ export class MessagesRequestURLAuth extends Function {
9887
9887
  writable: true,
9888
9888
  value: void 0
9889
9889
  });
9890
- this.peer = params.peer;
9891
- this.msgId = params.msgId;
9892
- this.buttonId = params.buttonId;
9893
- this.url = params.url;
9890
+ this.peer = params?.peer;
9891
+ this.msgId = params?.msgId;
9892
+ this.buttonId = params?.buttonId;
9893
+ this.url = params?.url;
9894
9894
  }
9895
9895
  }
9896
9896
  export class MessagesAcceptURLAuth extends Function {
@@ -9949,11 +9949,11 @@ export class MessagesAcceptURLAuth extends Function {
9949
9949
  writable: true,
9950
9950
  value: void 0
9951
9951
  });
9952
- this.writeAllowed = params.writeAllowed;
9953
- this.peer = params.peer;
9954
- this.msgId = params.msgId;
9955
- this.buttonId = params.buttonId;
9956
- this.url = params.url;
9952
+ this.writeAllowed = params?.writeAllowed;
9953
+ this.peer = params?.peer;
9954
+ this.msgId = params?.msgId;
9955
+ this.buttonId = params?.buttonId;
9956
+ this.url = params?.url;
9957
9957
  }
9958
9958
  }
9959
9959
  export class MessagesHidePeerSettingsBar extends Function {
@@ -10625,7 +10625,7 @@ export class MessagesDeletePhoneCallHistory extends Function {
10625
10625
  writable: true,
10626
10626
  value: void 0
10627
10627
  });
10628
- this.revoke = params.revoke;
10628
+ this.revoke = params?.revoke;
10629
10629
  }
10630
10630
  }
10631
10631
  export class MessagesCheckHistoryImport extends Function {
@@ -13388,12 +13388,12 @@ export class PhotosUploadProfilePhoto extends Function {
13388
13388
  writable: true,
13389
13389
  value: void 0
13390
13390
  });
13391
- this.fallback = params.fallback;
13392
- this.bot = params.bot;
13393
- this.file = params.file;
13394
- this.video = params.video;
13395
- this.videoStartTs = params.videoStartTs;
13396
- this.videoEmojiMarkup = params.videoEmojiMarkup;
13391
+ this.fallback = params?.fallback;
13392
+ this.bot = params?.bot;
13393
+ this.file = params?.file;
13394
+ this.video = params?.video;
13395
+ this.videoStartTs = params?.videoStartTs;
13396
+ this.videoEmojiMarkup = params?.videoEmojiMarkup;
13397
13397
  }
13398
13398
  }
13399
13399
  export class PhotosDeletePhotos extends Function {
@@ -15227,8 +15227,8 @@ export class ChannelsGetAdminedPublicChannels extends Function {
15227
15227
  writable: true,
15228
15228
  value: void 0
15229
15229
  });
15230
- this.byLocation = params.byLocation;
15231
- this.checkLimit = params.checkLimit;
15230
+ this.byLocation = params?.byLocation;
15231
+ this.checkLimit = params?.checkLimit;
15232
15232
  }
15233
15233
  }
15234
15234
  export class ChannelsEditBanned extends Function {
@@ -17227,8 +17227,8 @@ export class PaymentsClearSavedInfo extends Function {
17227
17227
  writable: true,
17228
17228
  value: void 0
17229
17229
  });
17230
- this.credentials = params.credentials;
17231
- this.info = params.info;
17230
+ this.credentials = params?.credentials;
17231
+ this.info = params?.info;
17232
17232
  }
17233
17233
  }
17234
17234
  export class PaymentsGetBankCardData extends Function {
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -8,4 +8,4 @@ export declare function pbkdf2(password: Uint8Array, salt: Uint8Array, iteration
8
8
  export declare const ph2: (password: Uint8Array, salt1: Uint8Array, salt2: Uint8Array) => Promise<Uint8Array>;
9
9
  export declare function isGoodModExpFirst(modexp: bigint, prime: bigint): boolean;
10
10
  export declare function pad(bigint: number | bigint | Uint8Array): Uint8Array;
11
- export declare function checkPassword(password: Uint8Array, ap: types.AccountPassword): Promise<types.InputCheckPasswordSRP>;
11
+ export declare function checkPassword(password_: string, ap: types.AccountPassword): Promise<types.InputCheckPasswordSRP>;
@@ -69,7 +69,8 @@ export function pad(bigint) {
69
69
  return concat(new Uint8Array(256 - bigint.length), bigint);
70
70
  }
71
71
  }
72
- export async function checkPassword(password, ap) {
72
+ export async function checkPassword(password_, ap) {
73
+ const password = new TextEncoder().encode(password_);
73
74
  const algo = ap.currentAlgo;
74
75
  if (!(algo instanceof
75
76
  types.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow)) {
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "module": "./esm/mod.js",
3
3
  "main": "./script/mod.js",
4
- "types": "./types/mod.d.ts",
5
4
  "name": "@mtkruto/node",
6
- "version": "0.0.820",
5
+ "version": "0.0.822",
7
6
  "description": "MTKruto for Node.js",
8
7
  "author": "Roj <rojvv@icloud.com>",
9
8
  "license": "LGPL-3.0-or-later",
@@ -13,14 +12,8 @@
13
12
  },
14
13
  "exports": {
15
14
  ".": {
16
- "import": {
17
- "types": "./types/mod.d.ts",
18
- "default": "./esm/mod.js"
19
- },
20
- "require": {
21
- "types": "./types/mod.d.ts",
22
- "default": "./script/mod.js"
23
- }
15
+ "import": "./esm/mod.js",
16
+ "require": "./script/mod.js"
24
17
  }
25
18
  },
26
19
  "scripts": {
@@ -28,13 +21,13 @@
28
21
  },
29
22
  "dependencies": {
30
23
  "async-mutex": "0.4.0",
31
- "@deno/shim-deno": "~0.15.0",
24
+ "@deno/shim-deno": "~0.16.1",
32
25
  "@deno/shim-crypto": "~0.3.1",
33
26
  "ws": "^8.13.0"
34
27
  },
35
28
  "devDependencies": {
36
29
  "@types/node": "^18.11.9",
37
- "chalk": "^4.1.2",
30
+ "picocolors": "^1.0.0",
38
31
  "@types/ws": "^8.5.4"
39
32
  }
40
33
  }
@@ -0,0 +1,10 @@
1
+ import { Deno } from "@deno/shim-deno";
2
+ export { Deno } from "@deno/shim-deno";
3
+ export { crypto, type Crypto, type SubtleCrypto, type AlgorithmIdentifier, type Algorithm, type RsaOaepParams, type BufferSource, type AesCtrParams, type AesCbcParams, type AesGcmParams, type CryptoKey, type KeyAlgorithm, type KeyType, type KeyUsage, type EcdhKeyDeriveParams, type HkdfParams, type HashAlgorithmIdentifier, type Pbkdf2Params, type AesDerivedKeyParams, type HmacImportParams, type JsonWebKey, type RsaOtherPrimesInfo, type KeyFormat, type RsaHashedKeyGenParams, type RsaKeyGenParams, type BigInteger, type EcKeyGenParams, type NamedCurve, type CryptoKeyPair, type AesKeyGenParams, type HmacKeyGenParams, type RsaHashedImportParams, type EcKeyImportParams, type AesKeyAlgorithm, type RsaPssParams, type EcdsaParams } from "@deno/shim-crypto";
4
+ import { default as WebSocket } from "ws";
5
+ export { default as WebSocket } from "ws";
6
+ export declare const dntGlobalThis: Omit<typeof globalThis, "WebSocket" | "crypto" | "Deno"> & {
7
+ Deno: typeof Deno;
8
+ crypto: import("@deno/shim-crypto").Crypto;
9
+ WebSocket: typeof WebSocket;
10
+ };
@@ -0,0 +1,10 @@
1
+ import { Deno } from "@deno/shim-deno";
2
+ export { Deno } from "@deno/shim-deno";
3
+ export { crypto, type Crypto, type SubtleCrypto, type AlgorithmIdentifier, type Algorithm, type RsaOaepParams, type BufferSource, type AesCtrParams, type AesCbcParams, type AesGcmParams, type CryptoKey, type KeyAlgorithm, type KeyType, type KeyUsage, type EcdhKeyDeriveParams, type HkdfParams, type HashAlgorithmIdentifier, type Pbkdf2Params, type AesDerivedKeyParams, type HmacImportParams, type JsonWebKey, type RsaOtherPrimesInfo, type KeyFormat, type RsaHashedKeyGenParams, type RsaKeyGenParams, type BigInteger, type EcKeyGenParams, type NamedCurve, type CryptoKeyPair, type AesKeyGenParams, type HmacKeyGenParams, type RsaHashedImportParams, type EcKeyImportParams, type AesKeyAlgorithm, type RsaPssParams, type EcdsaParams } from "@deno/shim-crypto";
4
+ import { default as WebSocket } from "ws";
5
+ export { default as WebSocket } from "ws";
6
+ export declare const dntGlobalThis: Omit<typeof globalThis, "WebSocket" | "crypto" | "Deno"> & {
7
+ Deno: typeof Deno;
8
+ crypto: import("@deno/shim-crypto").Crypto;
9
+ WebSocket: typeof WebSocket;
10
+ };
@@ -0,0 +1,114 @@
1
+ import { MaybePromise } from "../types.js";
2
+ import * as types from "../tl/2_types.js";
3
+ import * as functions from "../tl/3_functions.js";
4
+ import { ClientAbstract } from "./client_abstract.js";
5
+ import { Session } from "../session/session.js";
6
+ import { DC, TransportProvider } from "../transport/transport_provider.js";
7
+ export declare const restartAuth: unique symbol;
8
+ export interface AuthorizeUserParams<S = string> {
9
+ phone: S | (() => MaybePromise<S>);
10
+ code: S | (() => MaybePromise<S>);
11
+ password: S | (() => MaybePromise<S>);
12
+ }
13
+ export type UpdatesHandler = null | ((client: Client, update: types.Updates) => MaybePromise<void>);
14
+ export interface ClientParams {
15
+ /**
16
+ * The transport provider to use. Defaults to `defaultTransportProvider`.
17
+ */
18
+ transportProvider?: TransportProvider;
19
+ /**
20
+ * The app_version parameter to be passed to initConnection when calling `authorize`.
21
+ */
22
+ appVersion?: string;
23
+ /**
24
+ * The device_version parameter to be passed to initConnection when calling `authorize`.
25
+ */
26
+ deviceModel?: string;
27
+ /**
28
+ * The lang_code parameter to be passed to initConnection when calling `authorize`.
29
+ */
30
+ langCode?: string;
31
+ /**
32
+ * The lang_pack parameter to be passed to initConnection when calling `authorize`.
33
+ */
34
+ langPack?: string;
35
+ /**
36
+ * The system_lang_cde parameter to be passed to initConnection when calling `authorize`.
37
+ */
38
+ systemLangCode?: string;
39
+ /**
40
+ * The system_version parameter to be passed to initConnection when calling `authorize`.
41
+ */
42
+ systemVersion?: string;
43
+ }
44
+ export declare class Client extends ClientAbstract {
45
+ readonly session: Session;
46
+ readonly apiId: number;
47
+ readonly apiHash: string;
48
+ private sessionId;
49
+ private state;
50
+ private promises;
51
+ private toAcknowledge;
52
+ updatesHandler: UpdatesHandler;
53
+ readonly appVersion: string;
54
+ readonly deviceModel: string;
55
+ readonly langCode: string;
56
+ readonly langPack: string;
57
+ readonly systemLangCode: string;
58
+ readonly systemVersion: string;
59
+ /**
60
+ * Constructs the client.
61
+ *
62
+ * @param session The session provider to use. Defaults to in-memory session.
63
+ * @param apiId App's API ID from [my.telegram.org](https://my.telegram.org/apps). Defaults to 0 (unset).
64
+ * @param apiHash App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Default to empty string (unset).
65
+ * @param params Other parameters.
66
+ */
67
+ constructor(session?: Session, apiId?: number, apiHash?: string, params?: ClientParams);
68
+ private shouldLoadSession;
69
+ /**
70
+ * Sets the DC and resets the auth key stored in the session provider
71
+ * if the stored DC was not the same as the `dc` parameter.
72
+ *
73
+ * @param dc The DC to change to.
74
+ */
75
+ setDc(dc: DC): void;
76
+ /**
77
+ * Loads the session if `setDc` was not called, initializes and connnects
78
+ * a `ClientPlain` to generate auth key if there was none, and connects the client.
79
+ * Before establishing the connection, the session is saved.
80
+ */
81
+ connect(): Promise<void>;
82
+ /**
83
+ * Calls [initConnection](1) and authorizes the client with one of the following:
84
+ *
85
+ * - Bot token (`string`)
86
+ * - Exported authorization (`types.AuthExportedAuthorization`)
87
+ * - User authorization handlers (`AuthorizeUserParams`)
88
+ *
89
+ * if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling [updates.getState](2).
90
+ *
91
+ * Notes:
92
+ * 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
93
+ * 2. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
94
+ * 3. The parameters passed to the [initConnection][1] call can be configured with the last parameter of the constructor.
95
+ *
96
+ * [1]: https://core.telegram.org/method/initConnection
97
+ * [2]: https://core.telegram.org/method/updates.getState
98
+ */
99
+ authorize(params: string | types.AuthExportedAuthorization | AuthorizeUserParams): Promise<void>;
100
+ private receiveLoop;
101
+ private pingLoop;
102
+ /**
103
+ * Invokes a function waiting and returning its reply if the second parameter is not `true`. Requires the client
104
+ * to be connected.
105
+ *
106
+ * @param function_ The function to invoke.
107
+ */
108
+ invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T): Promise<T extends functions.Function<unknown> ? T["__R"] : void>;
109
+ invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, noWait: true): Promise<void>;
110
+ /**
111
+ * Alias for `invoke` with its second parameter being `true`.
112
+ */
113
+ send<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T): Promise<void>;
114
+ }