@mtkruto/node 0.0.990 → 0.0.992

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 (254) hide show
  1. package/esm/1_utilities.d.ts +12 -0
  2. package/esm/1_utilities.js +12 -0
  3. package/esm/2_connection.d.ts +2 -0
  4. package/esm/2_connection.js +2 -0
  5. package/esm/2_tl.d.ts +10 -0
  6. package/esm/2_tl.js +10 -0
  7. package/esm/3_storage.d.ts +6 -0
  8. package/esm/3_storage.js +6 -0
  9. package/esm/3_transport.d.ts +4 -0
  10. package/esm/3_transport.js +4 -0
  11. package/esm/3_types.d.ts +35 -0
  12. package/esm/3_types.js +35 -0
  13. package/esm/{constants.d.ts → 4_constants.d.ts} +2 -2
  14. package/esm/{constants.js → 4_constants.js} +1 -1
  15. package/esm/5_client.d.ts +2 -0
  16. package/esm/5_client.js +2 -0
  17. package/esm/client/0_html.d.ts +1 -1
  18. package/esm/client/0_html.js +1 -1
  19. package/esm/client/0_message.d.ts +1 -2
  20. package/esm/client/0_message.js +7 -14
  21. package/esm/client/0_password.d.ts +2 -2
  22. package/esm/client/0_password.js +2 -4
  23. package/esm/client/0_utilities.d.ts +3 -5
  24. package/esm/client/0_utilities.js +3 -22
  25. package/esm/client/1_client_abstract.d.ts +2 -2
  26. package/esm/client/1_client_abstract.js +3 -3
  27. package/esm/client/2_client_plain.d.ts +3 -3
  28. package/esm/client/2_client_plain.js +13 -20
  29. package/esm/client/3_client.d.ts +43 -18
  30. package/esm/client/3_client.js +107 -46
  31. package/esm/connection/0_connection.d.ts +1 -1
  32. package/esm/connection/1_connection_web_socket.js +1 -1
  33. package/esm/mod.d.ts +7 -21
  34. package/esm/mod.js +7 -21
  35. package/esm/storage/0_storage.d.ts +4 -5
  36. package/esm/storage/0_storage.js +3 -8
  37. package/esm/storage/0_utilities.js +2 -2
  38. package/esm/storage/1_storage_local_storage.d.ts +1 -1
  39. package/esm/storage/1_storage_memory.d.ts +1 -1
  40. package/esm/storage/1_storage_session_storage.d.ts +1 -1
  41. package/esm/tl/0_tl_raw_reader.js +1 -1
  42. package/esm/tl/0_tl_raw_writer.js +1 -1
  43. package/esm/tl/1_tl_object.js +1 -1
  44. package/esm/tl/3_deserialize.js +1 -1
  45. package/esm/tl/3_utilities.d.ts +3 -0
  46. package/esm/tl/3_utilities.js +20 -0
  47. package/esm/tl/4_tl_writer.js +1 -1
  48. package/esm/transport/0_obfuscation.d.ts +2 -2
  49. package/esm/transport/0_obfuscation.js +1 -2
  50. package/esm/transport/0_transport.d.ts +1 -2
  51. package/esm/transport/1_transport_abridged.d.ts +1 -1
  52. package/esm/transport/1_transport_abridged.js +1 -1
  53. package/esm/transport/1_transport_intermediate.d.ts +1 -1
  54. package/esm/transport/1_transport_intermediate.js +1 -1
  55. package/esm/transport/2_transport_provider.d.ts +1 -1
  56. package/esm/transport/2_transport_provider.js +1 -1
  57. package/esm/types/!0_file_id.js +6 -9
  58. package/esm/types/!0_misc.d.ts +7 -0
  59. package/esm/types/!0_misc.js +1 -0
  60. package/esm/types/0_audio.d.ts +3 -3
  61. package/esm/types/0_audio.js +1 -1
  62. package/esm/types/0_chat_administrator_rights.d.ts +1 -1
  63. package/esm/types/0_chat_administrator_rights.js +1 -1
  64. package/esm/types/0_chat_photo.d.ts +3 -3
  65. package/esm/types/0_chat_photo.js +1 -1
  66. package/esm/types/0_color.d.ts +2 -0
  67. package/esm/types/0_color.js +16 -0
  68. package/esm/types/0_contact.d.ts +2 -2
  69. package/esm/types/0_dice.d.ts +1 -1
  70. package/esm/types/0_force_reply.d.ts +1 -1
  71. package/esm/types/0_force_reply.js +1 -1
  72. package/esm/types/0_location.d.ts +1 -1
  73. package/esm/types/0_location.js +1 -2
  74. package/esm/types/0_mask_position.d.ts +1 -1
  75. package/esm/types/0_message_entity.d.ts +5 -5
  76. package/esm/types/0_message_entity.js +1 -1
  77. package/esm/types/0_poll_option.d.ts +1 -1
  78. package/esm/types/0_reply_keyboard_remove.d.ts +1 -1
  79. package/esm/types/0_reply_keyboard_remove.js +2 -2
  80. package/esm/types/0_thumbnail.d.ts +2 -2
  81. package/esm/types/0_thumbnail.js +1 -1
  82. package/esm/types/0_venue.d.ts +1 -1
  83. package/esm/types/0_venue.js +1 -2
  84. package/esm/types/0_voice.d.ts +3 -3
  85. package/esm/types/0_web_app_info.d.ts +2 -2
  86. package/esm/types/1_animation.d.ts +3 -3
  87. package/esm/types/1_animation.js +1 -1
  88. package/esm/types/1_chat.d.ts +5 -4
  89. package/esm/types/1_chat.js +8 -9
  90. package/esm/types/1_document.d.ts +4 -4
  91. package/esm/types/1_document.js +1 -1
  92. package/esm/types/1_inline_keyboard_button.d.ts +4 -4
  93. package/esm/types/1_inline_keyboard_button.js +2 -2
  94. package/esm/types/1_keyboard_button.d.ts +8 -8
  95. package/esm/types/1_keyboard_button.js +2 -2
  96. package/esm/types/1_photo.d.ts +2 -2
  97. package/esm/types/1_photo.js +1 -1
  98. package/esm/types/1_poll.d.ts +8 -8
  99. package/esm/types/1_poll.js +1 -1
  100. package/esm/types/1_sticker.d.ts +3 -3
  101. package/esm/types/1_sticker.js +1 -2
  102. package/esm/types/1_user.d.ts +4 -3
  103. package/esm/types/1_user.js +4 -4
  104. package/esm/types/1_video.d.ts +3 -3
  105. package/esm/types/1_video.js +1 -1
  106. package/esm/types/1_video_note.d.ts +2 -2
  107. package/esm/types/1_video_note.js +1 -1
  108. package/esm/types/2_game.d.ts +3 -3
  109. package/esm/types/2_game.js +2 -3
  110. package/esm/types/2_inline_keyboard_markup.d.ts +2 -2
  111. package/esm/types/2_inline_keyboard_markup.js +1 -1
  112. package/esm/types/2_inline_query.d.ts +19 -0
  113. package/esm/types/2_inline_query.js +41 -0
  114. package/esm/types/2_reply_keyboard_markup.d.ts +2 -2
  115. package/esm/types/2_reply_keyboard_markup.js +1 -1
  116. package/esm/types/3_message.d.ts +23 -23
  117. package/esm/types/3_message.js +19 -18
  118. package/esm/types/4_callback_query.d.ts +14 -0
  119. package/esm/types/4_callback_query.js +24 -0
  120. package/esm/utilities/0_base64.js +1 -1
  121. package/esm/utilities/0_crypto.js +1 -1
  122. package/esm/utilities/0_queue.js +1 -1
  123. package/esm/utilities/1_auth.js +1 -1
  124. package/package.json +1 -1
  125. package/script/1_utilities.d.ts +12 -0
  126. package/script/1_utilities.js +28 -0
  127. package/script/2_connection.d.ts +2 -0
  128. package/script/2_connection.js +18 -0
  129. package/script/2_tl.d.ts +10 -0
  130. package/script/2_tl.js +40 -0
  131. package/script/3_storage.d.ts +6 -0
  132. package/script/3_storage.js +22 -0
  133. package/script/3_transport.d.ts +4 -0
  134. package/script/3_transport.js +20 -0
  135. package/script/3_types.d.ts +35 -0
  136. package/script/3_types.js +51 -0
  137. package/script/{constants.d.ts → 4_constants.d.ts} +2 -2
  138. package/script/{constants.js → 4_constants.js} +1 -1
  139. package/script/5_client.d.ts +2 -0
  140. package/script/5_client.js +18 -0
  141. package/script/client/0_html.d.ts +1 -1
  142. package/script/client/0_html.js +2 -2
  143. package/script/client/0_message.d.ts +1 -2
  144. package/script/client/0_message.js +32 -39
  145. package/script/client/0_password.d.ts +2 -2
  146. package/script/client/0_password.js +20 -22
  147. package/script/client/0_utilities.d.ts +3 -5
  148. package/script/client/0_utilities.js +24 -68
  149. package/script/client/1_client_abstract.d.ts +2 -2
  150. package/script/client/1_client_abstract.js +6 -6
  151. package/script/client/2_client_plain.d.ts +3 -3
  152. package/script/client/2_client_plain.js +45 -52
  153. package/script/client/3_client.d.ts +43 -18
  154. package/script/client/3_client.js +342 -305
  155. package/script/connection/0_connection.d.ts +1 -1
  156. package/script/connection/1_connection_web_socket.js +5 -5
  157. package/script/mod.d.ts +7 -21
  158. package/script/mod.js +17 -45
  159. package/script/storage/0_storage.d.ts +4 -5
  160. package/script/storage/0_storage.js +11 -39
  161. package/script/storage/0_utilities.js +6 -6
  162. package/script/storage/1_storage_local_storage.d.ts +1 -1
  163. package/script/storage/1_storage_memory.d.ts +1 -1
  164. package/script/storage/1_storage_session_storage.d.ts +1 -1
  165. package/script/tl/0_tl_raw_reader.js +6 -6
  166. package/script/tl/0_tl_raw_writer.js +7 -7
  167. package/script/tl/1_tl_object.js +3 -3
  168. package/script/tl/3_deserialize.js +2 -2
  169. package/script/tl/3_utilities.d.ts +3 -0
  170. package/script/tl/3_utilities.js +48 -0
  171. package/script/tl/4_tl_writer.js +2 -2
  172. package/script/transport/0_obfuscation.d.ts +2 -2
  173. package/script/transport/0_obfuscation.js +5 -6
  174. package/script/transport/0_transport.d.ts +1 -2
  175. package/script/transport/1_transport_abridged.d.ts +1 -1
  176. package/script/transport/1_transport_abridged.js +3 -3
  177. package/script/transport/1_transport_intermediate.d.ts +1 -1
  178. package/script/transport/1_transport_intermediate.js +3 -3
  179. package/script/transport/2_transport_provider.d.ts +1 -1
  180. package/script/transport/2_transport_provider.js +2 -2
  181. package/script/types/!0_file_id.js +24 -27
  182. package/script/types/!0_misc.d.ts +7 -0
  183. package/script/types/!0_misc.js +2 -0
  184. package/script/types/0_audio.d.ts +3 -3
  185. package/script/types/0_audio.js +2 -25
  186. package/script/types/0_chat_administrator_rights.d.ts +1 -1
  187. package/script/types/0_chat_administrator_rights.js +2 -25
  188. package/script/types/0_chat_photo.d.ts +3 -3
  189. package/script/types/0_chat_photo.js +2 -25
  190. package/script/types/0_color.d.ts +2 -0
  191. package/script/types/{!0_id_color.js → 0_color.js} +10 -10
  192. package/script/types/0_contact.d.ts +2 -2
  193. package/script/types/0_dice.d.ts +1 -1
  194. package/script/types/0_force_reply.d.ts +1 -1
  195. package/script/types/0_force_reply.js +2 -25
  196. package/script/types/0_location.d.ts +1 -1
  197. package/script/types/0_location.js +5 -29
  198. package/script/types/0_mask_position.d.ts +1 -1
  199. package/script/types/0_message_entity.d.ts +5 -5
  200. package/script/types/0_message_entity.js +39 -62
  201. package/script/types/0_poll_option.d.ts +1 -1
  202. package/script/types/0_reply_keyboard_remove.d.ts +1 -1
  203. package/script/types/0_reply_keyboard_remove.js +4 -27
  204. package/script/types/0_thumbnail.d.ts +2 -2
  205. package/script/types/0_thumbnail.js +2 -25
  206. package/script/types/0_venue.d.ts +1 -1
  207. package/script/types/0_venue.js +2 -26
  208. package/script/types/0_voice.d.ts +3 -3
  209. package/script/types/0_web_app_info.d.ts +2 -2
  210. package/script/types/1_animation.d.ts +3 -3
  211. package/script/types/1_animation.js +2 -25
  212. package/script/types/1_chat.d.ts +5 -4
  213. package/script/types/1_chat.js +20 -44
  214. package/script/types/1_document.d.ts +4 -4
  215. package/script/types/1_document.js +2 -25
  216. package/script/types/1_inline_keyboard_button.d.ts +4 -4
  217. package/script/types/1_inline_keyboard_button.js +19 -42
  218. package/script/types/1_keyboard_button.d.ts +8 -8
  219. package/script/types/1_keyboard_button.js +24 -47
  220. package/script/types/1_photo.d.ts +2 -2
  221. package/script/types/1_photo.js +4 -27
  222. package/script/types/1_poll.d.ts +8 -8
  223. package/script/types/1_poll.js +2 -2
  224. package/script/types/1_sticker.d.ts +3 -3
  225. package/script/types/1_sticker.js +6 -30
  226. package/script/types/1_user.d.ts +4 -3
  227. package/script/types/1_user.js +6 -29
  228. package/script/types/1_video.d.ts +3 -3
  229. package/script/types/1_video.js +2 -25
  230. package/script/types/1_video_note.d.ts +2 -2
  231. package/script/types/1_video_note.js +2 -25
  232. package/script/types/2_game.d.ts +3 -3
  233. package/script/types/2_game.js +6 -30
  234. package/script/types/2_inline_keyboard_markup.d.ts +2 -2
  235. package/script/types/2_inline_keyboard_markup.js +3 -26
  236. package/script/types/2_inline_query.d.ts +19 -0
  237. package/script/types/2_inline_query.js +45 -0
  238. package/script/types/2_reply_keyboard_markup.d.ts +2 -2
  239. package/script/types/2_reply_keyboard_markup.js +3 -26
  240. package/script/types/3_message.d.ts +23 -23
  241. package/script/types/3_message.js +97 -119
  242. package/script/types/4_callback_query.d.ts +14 -0
  243. package/script/types/4_callback_query.js +28 -0
  244. package/script/utilities/0_base64.js +3 -3
  245. package/script/utilities/0_crypto.js +3 -3
  246. package/script/utilities/0_queue.js +2 -2
  247. package/script/utilities/1_auth.js +5 -5
  248. package/esm/types/!0_id_color.d.ts +0 -1
  249. package/esm/types/!0_id_color.js +0 -16
  250. package/script/types/!0_id_color.d.ts +0 -1
  251. /package/esm/{deps.d.ts → 0_deps.d.ts} +0 -0
  252. /package/esm/{deps.js → 0_deps.js} +0 -0
  253. /package/script/{deps.d.ts → 0_deps.d.ts} +0 -0
  254. /package/script/{deps.js → 0_deps.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { MaybePromise } from "../utilities/0_types.js";
1
+ import { MaybePromise } from "../1_utilities.js";
2
2
  declare abstract class Foundation {
3
3
  abstract get connected(): boolean;
4
4
  stateChangeHandler?: (connected: boolean) => void;
@@ -25,9 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.ConnectionWebSocket = void 0;
27
27
  const dntShim = __importStar(require("../_dnt.shims.js"));
28
- const deps_js_1 = require("../deps.js");
28
+ const _0_deps_js_1 = require("../0_deps.js");
29
29
  const _0_connection_js_1 = require("./0_connection.js");
30
- const d = (0, deps_js_1.debug)("ConnectionWebSocket");
30
+ const d = (0, _0_deps_js_1.debug)("ConnectionWebSocket");
31
31
  class ConnectionWebSocket extends _0_connection_js_1.ConnectionUnframed {
32
32
  constructor(url) {
33
33
  super();
@@ -47,13 +47,13 @@ class ConnectionWebSocket extends _0_connection_js_1.ConnectionUnframed {
47
47
  enumerable: true,
48
48
  configurable: true,
49
49
  writable: true,
50
- value: new deps_js_1.Mutex()
50
+ value: new _0_deps_js_1.Mutex()
51
51
  });
52
52
  Object.defineProperty(this, "wMutex", {
53
53
  enumerable: true,
54
54
  configurable: true,
55
55
  writable: true,
56
- value: new deps_js_1.Mutex()
56
+ value: new _0_deps_js_1.Mutex()
57
57
  });
58
58
  Object.defineProperty(this, "buffer", {
59
59
  enumerable: true,
@@ -89,7 +89,7 @@ class ConnectionWebSocket extends _0_connection_js_1.ConnectionUnframed {
89
89
  }
90
90
  initWs() {
91
91
  const webSocket = new dntShim.WebSocket(this.url, "binary");
92
- const mutex = new deps_js_1.Mutex();
92
+ const mutex = new _0_deps_js_1.Mutex();
93
93
  webSocket.addEventListener("close", () => {
94
94
  this.stateChangeHandler?.(false);
95
95
  });
package/script/mod.d.ts CHANGED
@@ -1,26 +1,12 @@
1
- import { getRandomId } from "./utilities/0_bigint.js";
1
+ import { getRandomId } from "./1_utilities.js";
2
2
  import { checkPassword } from "./client/0_password.js";
3
3
  export declare const utils: {
4
4
  checkPassword: typeof checkPassword;
5
5
  getRandomId: typeof getRandomId;
6
6
  };
7
- export { as, serialize } from "./tl/1_tl_object.js";
8
- export * as types from "./tl/2_types.js";
9
- export * as functions from "./tl/3_functions.js";
10
- export * from "./tl/5_rpc_result.js";
11
- export * from "./tl/6_message.js";
12
- export * from "./tl/7_message_container.js";
13
- export * from "./client/2_client_plain.js";
14
- export * from "./client/3_client.js";
15
- export * from "./storage/0_storage.js";
16
- export * from "./storage/1_storage_memory.js";
17
- export * from "./storage/1_storage_local_storage.js";
18
- export * from "./storage/1_storage_session_storage.js";
19
- export * from "./storage/1_storage_indexed_db.js";
20
- export * from "./transport/1_transport_abridged.js";
21
- export * from "./transport/1_transport_intermediate.js";
22
- export * from "./transport/0_transport.js";
23
- export * from "./transport/2_transport_provider.js";
24
- export * from "./connection/0_connection.js";
25
- export * from "./connection/1_connection_web_socket.js";
26
- export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./constants.js";
7
+ export * from "./2_tl.js";
8
+ export * from "./2_connection.js";
9
+ export * from "./3_storage.js";
10
+ export * from "./3_transport.js";
11
+ export { APP_VERSION, DEVICE_MODEL, INITIAL_DC, LANG_CODE, LANG_PACK, LAYER, SYSTEM_LANG_CODE, SYSTEM_VERSION } from "./4_constants.js";
12
+ export * from "./5_client.js";
package/script/mod.js CHANGED
@@ -10,53 +10,25 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
15
  };
28
16
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LAYER = exports.LANG_PACK = exports.LANG_CODE = exports.INITIAL_DC = exports.DEVICE_MODEL = exports.APP_VERSION = exports.functions = exports.types = exports.serialize = exports.as = exports.utils = void 0;
30
- const _0_bigint_js_1 = require("./utilities/0_bigint.js");
17
+ exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LAYER = exports.LANG_PACK = exports.LANG_CODE = exports.INITIAL_DC = exports.DEVICE_MODEL = exports.APP_VERSION = exports.utils = void 0;
18
+ const _1_utilities_js_1 = require("./1_utilities.js");
31
19
  const _0_password_js_1 = require("./client/0_password.js");
32
- exports.utils = { checkPassword: _0_password_js_1.checkPassword, getRandomId: _0_bigint_js_1.getRandomId };
33
- var _1_tl_object_js_1 = require("./tl/1_tl_object.js");
34
- Object.defineProperty(exports, "as", { enumerable: true, get: function () { return _1_tl_object_js_1.as; } });
35
- Object.defineProperty(exports, "serialize", { enumerable: true, get: function () { return _1_tl_object_js_1.serialize; } });
36
- exports.types = __importStar(require("./tl/2_types.js"));
37
- exports.functions = __importStar(require("./tl/3_functions.js"));
38
- __exportStar(require("./tl/5_rpc_result.js"), exports);
39
- __exportStar(require("./tl/6_message.js"), exports);
40
- __exportStar(require("./tl/7_message_container.js"), exports);
41
- __exportStar(require("./client/2_client_plain.js"), exports);
42
- __exportStar(require("./client/3_client.js"), exports);
43
- __exportStar(require("./storage/0_storage.js"), exports);
44
- __exportStar(require("./storage/1_storage_memory.js"), exports);
45
- __exportStar(require("./storage/1_storage_local_storage.js"), exports);
46
- __exportStar(require("./storage/1_storage_session_storage.js"), exports);
47
- __exportStar(require("./storage/1_storage_indexed_db.js"), exports);
48
- __exportStar(require("./transport/1_transport_abridged.js"), exports);
49
- __exportStar(require("./transport/1_transport_intermediate.js"), exports);
50
- __exportStar(require("./transport/0_transport.js"), exports);
51
- __exportStar(require("./transport/2_transport_provider.js"), exports);
52
- __exportStar(require("./connection/0_connection.js"), exports);
53
- __exportStar(require("./connection/1_connection_web_socket.js"), exports);
54
- var constants_js_1 = require("./constants.js");
55
- Object.defineProperty(exports, "APP_VERSION", { enumerable: true, get: function () { return constants_js_1.APP_VERSION; } });
56
- Object.defineProperty(exports, "DEVICE_MODEL", { enumerable: true, get: function () { return constants_js_1.DEVICE_MODEL; } });
57
- Object.defineProperty(exports, "INITIAL_DC", { enumerable: true, get: function () { return constants_js_1.INITIAL_DC; } });
58
- Object.defineProperty(exports, "LANG_CODE", { enumerable: true, get: function () { return constants_js_1.LANG_CODE; } });
59
- Object.defineProperty(exports, "LANG_PACK", { enumerable: true, get: function () { return constants_js_1.LANG_PACK; } });
60
- Object.defineProperty(exports, "LAYER", { enumerable: true, get: function () { return constants_js_1.LAYER; } });
61
- Object.defineProperty(exports, "SYSTEM_LANG_CODE", { enumerable: true, get: function () { return constants_js_1.SYSTEM_LANG_CODE; } });
62
- Object.defineProperty(exports, "SYSTEM_VERSION", { enumerable: true, get: function () { return constants_js_1.SYSTEM_VERSION; } });
20
+ exports.utils = { checkPassword: _0_password_js_1.checkPassword, getRandomId: _1_utilities_js_1.getRandomId };
21
+ __exportStar(require("./2_tl.js"), exports);
22
+ __exportStar(require("./2_connection.js"), exports);
23
+ __exportStar(require("./3_storage.js"), exports);
24
+ __exportStar(require("./3_transport.js"), exports);
25
+ var _4_constants_js_1 = require("./4_constants.js");
26
+ Object.defineProperty(exports, "APP_VERSION", { enumerable: true, get: function () { return _4_constants_js_1.APP_VERSION; } });
27
+ Object.defineProperty(exports, "DEVICE_MODEL", { enumerable: true, get: function () { return _4_constants_js_1.DEVICE_MODEL; } });
28
+ Object.defineProperty(exports, "INITIAL_DC", { enumerable: true, get: function () { return _4_constants_js_1.INITIAL_DC; } });
29
+ Object.defineProperty(exports, "LANG_CODE", { enumerable: true, get: function () { return _4_constants_js_1.LANG_CODE; } });
30
+ Object.defineProperty(exports, "LANG_PACK", { enumerable: true, get: function () { return _4_constants_js_1.LANG_PACK; } });
31
+ Object.defineProperty(exports, "LAYER", { enumerable: true, get: function () { return _4_constants_js_1.LAYER; } });
32
+ Object.defineProperty(exports, "SYSTEM_LANG_CODE", { enumerable: true, get: function () { return _4_constants_js_1.SYSTEM_LANG_CODE; } });
33
+ Object.defineProperty(exports, "SYSTEM_VERSION", { enumerable: true, get: function () { return _4_constants_js_1.SYSTEM_VERSION; } });
34
+ __exportStar(require("./5_client.js"), exports);
@@ -1,7 +1,6 @@
1
- import { MaybePromise } from "../utilities/0_types.js";
2
- import { DC } from "../transport/2_transport_provider.js";
3
- import { TLObject } from "../tl/1_tl_object.js";
4
- import * as types from "../tl/2_types.js";
1
+ import { MaybePromise } from "../1_utilities.js";
2
+ import { TLObject, types } from "../2_tl.js";
3
+ import { DC } from "../3_transport.js";
5
4
  export type StorageKeyPart = string | number | bigint | Uint8Array;
6
5
  export declare abstract class Storage {
7
6
  private _authKeyId;
@@ -21,7 +20,7 @@ export declare abstract class Storage {
21
20
  updateUsernames(type: "user" | "channel", id: bigint, usernames: string[]): Promise<void>;
22
21
  getUsername(username: string): Promise<["channel" | "user", bigint, Date] | null>;
23
22
  setTlObject(key: readonly StorageKeyPart[], value: TLObject | null): Promise<void>;
24
- getTLObject(key: readonly StorageKeyPart[]): Promise<import("../tl/3_tl_reader.js").ReadObject | null>;
23
+ getTLObject(key: readonly StorageKeyPart[]): Promise<import("../2_tl.js").ReadObject | null>;
25
24
  setState(state: types.UpdatesState): Promise<void>;
26
25
  getState(): Promise<types.UpdatesState | null>;
27
26
  setMessage(chatId: number, messageId: number, message: types.TypeMessage | null): Promise<void>;
@@ -1,37 +1,9 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.Storage = void 0;
27
- const _0_control_js_1 = require("../utilities/0_control.js");
28
- const _0_hash_js_1 = require("../utilities/0_hash.js");
29
- const _0_bigint_js_1 = require("../utilities/0_bigint.js");
30
- const _1_tl_object_js_1 = require("../tl/1_tl_object.js");
31
- const types = __importStar(require("../tl/2_types.js"));
32
- const _3_tl_reader_js_1 = require("../tl/3_tl_reader.js");
33
- const _0_rle_js_1 = require("../utilities/0_rle.js");
34
- const constants_js_1 = require("../constants.js");
4
+ const _1_utilities_js_1 = require("../1_utilities.js");
5
+ const _2_tl_js_1 = require("../2_tl.js");
6
+ const _4_constants_js_1 = require("../4_constants.js");
35
7
  const KPARTS__DC = ["dc"];
36
8
  const KPARTS__AUTH_KEY = ["authKey"];
37
9
  const KPARTS__CHANNEL_ACCESS_HASH = (v) => ["channelAccessHash", v];
@@ -61,7 +33,7 @@ class Storage {
61
33
  }
62
34
  async resetAuthKeyId(authKey) {
63
35
  if (authKey != null) {
64
- this._authKeyId = await (0, _0_hash_js_1.sha1)(authKey).then((hash) => (0, _0_bigint_js_1.bigIntFromBuffer)(hash.slice(-8), true, false));
36
+ this._authKeyId = await (0, _1_utilities_js_1.sha1)(authKey).then((hash) => (0, _1_utilities_js_1.bigIntFromBuffer)(hash.slice(-8), true, false));
65
37
  }
66
38
  else {
67
39
  this._authKeyId = null;
@@ -111,13 +83,13 @@ class Storage {
111
83
  await this.set(key, null);
112
84
  }
113
85
  else {
114
- await this.set(key, (0, _0_rle_js_1.rleEncode)(value[_1_tl_object_js_1.serialize]()));
86
+ await this.set(key, (0, _1_utilities_js_1.rleEncode)(value[_2_tl_js_1.serialize]()));
115
87
  }
116
88
  }
117
89
  async getTLObject(key) {
118
90
  const buffer = await this.get(key);
119
91
  if (buffer != null) {
120
- return new _3_tl_reader_js_1.TLReader((0, _0_rle_js_1.rleDecode)(buffer)).readObject();
92
+ return new _2_tl_js_1.TLReader((0, _1_utilities_js_1.rleDecode)(buffer)).readObject();
121
93
  }
122
94
  else {
123
95
  return null;
@@ -130,7 +102,7 @@ class Storage {
130
102
  return await this.getTLObject(KPARTS__STATE);
131
103
  }
132
104
  async setMessage(chatId, messageId, message) {
133
- if (chatId > constants_js_1.ZERO_CHANNEL_ID) {
105
+ if (chatId > _4_constants_js_1.ZERO_CHANNEL_ID) {
134
106
  await this.set(KPARTS_MESSAGE_REF(messageId), message == null ? null : chatId);
135
107
  }
136
108
  await this.setTlObject(KPARTS_MESSAGE(chatId, messageId), message);
@@ -148,13 +120,13 @@ class Storage {
148
120
  return this.get(KPARTS__CHANNEL_PTS(channelId));
149
121
  }
150
122
  async setEntity(peer) {
151
- const type = peer instanceof types.Channel ? "channel" : peer instanceof types.Chat ? "chat" : peer instanceof types.User ? "user" : (0, _0_control_js_1.UNREACHABLE)();
152
- await this.set(KPARTS__PEER(type, peer.id), peer[_1_tl_object_js_1.serialize]());
123
+ const type = peer instanceof _2_tl_js_1.types.Channel ? "channel" : peer instanceof _2_tl_js_1.types.Chat ? "chat" : peer instanceof _2_tl_js_1.types.User ? "user" : (0, _1_utilities_js_1.UNREACHABLE)();
124
+ await this.set(KPARTS__PEER(type, peer.id), peer[_2_tl_js_1.serialize]());
153
125
  }
154
126
  async getEntity(type, id) {
155
127
  const peer_ = await this.get(KPARTS__PEER(type, id));
156
128
  if (peer_ != null) {
157
- return new _3_tl_reader_js_1.TLReader(peer_).readObject();
129
+ return new _2_tl_js_1.TLReader(peer_).readObject();
158
130
  }
159
131
  else {
160
132
  return null;
@@ -163,7 +135,7 @@ class Storage {
163
135
  async setAccountType(type) {
164
136
  try {
165
137
  await this.getAccountType();
166
- (0, _0_control_js_1.UNREACHABLE)();
138
+ (0, _1_utilities_js_1.UNREACHABLE)();
167
139
  }
168
140
  catch (err) {
169
141
  if (!(err instanceof Error) || !(err.message == "Unreachable")) {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fixKey = exports.fromString = exports.toString = exports.ValueType = void 0;
4
- const deps_js_1 = require("../deps.js");
5
- const _0_control_js_1 = require("../utilities/0_control.js");
4
+ const _0_deps_js_1 = require("../0_deps.js");
5
+ const _1_utilities_js_1 = require("../1_utilities.js");
6
6
  var ValueType;
7
7
  (function (ValueType) {
8
8
  ValueType[ValueType["Boolean"] = 0] = "Boolean";
@@ -30,13 +30,13 @@ function toString(value) {
30
30
  return JSON.stringify([ValueType.Date, value.getTime()]);
31
31
  }
32
32
  else if (value instanceof Uint8Array) {
33
- return JSON.stringify([ValueType.Uint8Array, (0, deps_js_1.base64Encode)(value)]);
33
+ return JSON.stringify([ValueType.Uint8Array, (0, _0_deps_js_1.base64Encode)(value)]);
34
34
  }
35
35
  else if (Array.isArray(value)) {
36
36
  return JSON.stringify([ValueType.Array, value.map(toString)]);
37
37
  }
38
38
  else {
39
- (0, _0_control_js_1.UNREACHABLE)();
39
+ (0, _1_utilities_js_1.UNREACHABLE)();
40
40
  }
41
41
  }
42
42
  exports.toString = toString;
@@ -52,13 +52,13 @@ function fromString(string) {
52
52
  return new Date(value);
53
53
  }
54
54
  else if (type == ValueType.Uint8Array) {
55
- return (0, deps_js_1.base64Decode)(value);
55
+ return (0, _0_deps_js_1.base64Decode)(value);
56
56
  }
57
57
  else if (type == ValueType.Array) {
58
58
  return value.map(fromString);
59
59
  }
60
60
  else {
61
- (0, _0_control_js_1.UNREACHABLE)();
61
+ (0, _1_utilities_js_1.UNREACHABLE)();
62
62
  }
63
63
  }
64
64
  exports.fromString = fromString;
@@ -1,4 +1,4 @@
1
- import { MaybePromise } from "../utilities/0_types.js";
1
+ import { MaybePromise } from "../1_utilities.js";
2
2
  import { Storage, StorageKeyPart } from "./0_storage.js";
3
3
  export declare class StorageLocalStorage extends Storage implements Storage {
4
4
  private readonly prefix;
@@ -1,4 +1,4 @@
1
- import { MaybePromise } from "../utilities/0_types.js";
1
+ import { MaybePromise } from "../1_utilities.js";
2
2
  import { Storage, StorageKeyPart } from "./0_storage.js";
3
3
  export declare class StorageMemory extends Storage implements Storage {
4
4
  protected map: Map<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { MaybePromise } from "../utilities/0_types.js";
1
+ import { MaybePromise } from "../1_utilities.js";
2
2
  import { Storage, StorageKeyPart } from "./0_storage.js";
3
3
  export declare class StorageSessionStorage extends Storage implements Storage {
4
4
  private readonly prefix;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TLRawReader = exports.TLError = void 0;
4
- const _0_bigint_js_1 = require("../utilities/0_bigint.js");
4
+ const _1_utilities_js_1 = require("../1_utilities.js");
5
5
  class TLError extends Error {
6
6
  }
7
7
  exports.TLError = TLError;
@@ -27,23 +27,23 @@ class TLRawReader {
27
27
  }
28
28
  readInt24(signed = true) {
29
29
  const buffer = this.read(24 / 8);
30
- return Number((0, _0_bigint_js_1.bigIntFromBuffer)(buffer, true, signed));
30
+ return Number((0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed));
31
31
  }
32
32
  readInt32(signed = true) {
33
33
  const buffer = this.read(32 / 8);
34
- return Number((0, _0_bigint_js_1.bigIntFromBuffer)(buffer, true, signed));
34
+ return Number((0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed));
35
35
  }
36
36
  readInt64(signed = true) {
37
37
  const buffer = this.read(64 / 8);
38
- return (0, _0_bigint_js_1.bigIntFromBuffer)(buffer, true, signed);
38
+ return (0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed);
39
39
  }
40
40
  readInt128(signed = true) {
41
41
  const buffer = this.read(128 / 8);
42
- return (0, _0_bigint_js_1.bigIntFromBuffer)(buffer, true, signed);
42
+ return (0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed);
43
43
  }
44
44
  readInt256(signed = true) {
45
45
  const buffer = this.read(256 / 8);
46
- return (0, _0_bigint_js_1.bigIntFromBuffer)(buffer, true, signed);
46
+ return (0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, signed);
47
47
  }
48
48
  readBytes() {
49
49
  let L = this.read(1)[0];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TLRawWriter = void 0;
4
- const _0_buffer_js_1 = require("../utilities/0_buffer.js");
4
+ const _1_utilities_js_1 = require("../1_utilities.js");
5
5
  class TLRawWriter {
6
6
  constructor() {
7
7
  Object.defineProperty(this, "_buffer", {
@@ -15,27 +15,27 @@ class TLRawWriter {
15
15
  return this._buffer;
16
16
  }
17
17
  write(buffer) {
18
- this._buffer = (0, _0_buffer_js_1.concat)(this._buffer, buffer);
18
+ this._buffer = (0, _1_utilities_js_1.concat)(this._buffer, buffer);
19
19
  return this;
20
20
  }
21
21
  writeInt24(int, signed = true) {
22
- this.write((0, _0_buffer_js_1.bufferFromBigInt)(int, 24 / 8, true, signed));
22
+ this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 24 / 8, true, signed));
23
23
  return this;
24
24
  }
25
25
  writeInt32(int, signed = true) {
26
- this.write((0, _0_buffer_js_1.bufferFromBigInt)(int, 32 / 8, true, signed));
26
+ this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 32 / 8, true, signed));
27
27
  return this;
28
28
  }
29
29
  writeInt64(int, signed = true) {
30
- this.write((0, _0_buffer_js_1.bufferFromBigInt)(int, 64 / 8, true, signed));
30
+ this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 64 / 8, true, signed));
31
31
  return this;
32
32
  }
33
33
  writeInt128(int, signed = true) {
34
- this.write((0, _0_buffer_js_1.bufferFromBigInt)(int, 128 / 8, true, signed));
34
+ this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 128 / 8, true, signed));
35
35
  return this;
36
36
  }
37
37
  writeInt256(int, signed = true) {
38
- this.write((0, _0_buffer_js_1.bufferFromBigInt)(int, 256 / 8, true, signed));
38
+ this.write((0, _1_utilities_js_1.bufferFromBigInt)(int, 256 / 8, true, signed));
39
39
  return this;
40
40
  }
41
41
  writeBytes(bytes) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isTLObjectConstructor = exports.TLObject = exports.analyzeOptionalParam = exports.isOptionalParam = exports.as = exports.serialize = exports.length = exports.paramDesc = exports.params = exports.id = exports.flags = void 0;
4
- const deps_js_1 = require("../deps.js");
4
+ const _0_deps_js_1 = require("../0_deps.js");
5
5
  const _0_tl_raw_writer_js_1 = require("./0_tl_raw_writer.js");
6
6
  exports.flags = Symbol("flags");
7
7
  exports.id = Symbol("id");
@@ -19,9 +19,9 @@ function analyzeOptionalParam(ntype) {
19
19
  throw new Error("Parameter not optional");
20
20
  }
21
21
  const flagField = ntype.split(".")[0];
22
- (0, deps_js_1.assertEquals)(typeof flagField, "string");
22
+ (0, _0_deps_js_1.assertEquals)(typeof flagField, "string");
23
23
  const bitIndex = Number(ntype.split("?")[0].split(".")[1]);
24
- (0, deps_js_1.assertFalse)(isNaN(bitIndex));
24
+ (0, _0_deps_js_1.assertFalse)(isNaN(bitIndex));
25
25
  return { flagField, bitIndex };
26
26
  }
27
27
  exports.analyzeOptionalParam = analyzeOptionalParam;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserialize = void 0;
4
- const deps_js_1 = require("../deps.js");
4
+ const _0_deps_js_1 = require("../0_deps.js");
5
5
  const _1_tl_object_js_1 = require("./1_tl_object.js");
6
6
  const _2_types_js_1 = require("./2_types.js");
7
7
  function deserializeSingleParam(reader, type, ntype) {
@@ -57,7 +57,7 @@ function deserialize(reader, paramDesc, constructor) {
57
57
  continue;
58
58
  }
59
59
  if (type instanceof Array) {
60
- (0, deps_js_1.assertEquals)(reader.readInt32(false), 0x1CB5C415);
60
+ (0, _0_deps_js_1.assertEquals)(reader.readInt32(false), 0x1CB5C415);
61
61
  const count = reader.readInt32();
62
62
  const items = new Array();
63
63
  for (let i = 0; i < count; i++) {
@@ -0,0 +1,3 @@
1
+ import * as types from "./2_types.js";
2
+ export declare function getChannelChatId(channelId: bigint): number;
3
+ export declare function peerToChatId(peer: types.TypePeer | types.TypeInputPeer): number;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.peerToChatId = exports.getChannelChatId = void 0;
27
+ const _1_utilities_js_1 = require("../1_utilities.js");
28
+ const _4_constants_js_1 = require("../4_constants.js");
29
+ const types = __importStar(require("./2_types.js"));
30
+ function getChannelChatId(channelId) {
31
+ return _4_constants_js_1.ZERO_CHANNEL_ID + -Number(channelId);
32
+ }
33
+ exports.getChannelChatId = getChannelChatId;
34
+ function peerToChatId(peer) {
35
+ if (peer instanceof types.PeerUser || peer instanceof types.InputPeerUser) {
36
+ return Number(peer.userId);
37
+ }
38
+ else if (peer instanceof types.PeerChat || peer instanceof types.InputPeerChat) {
39
+ return -Number(peer.chatId);
40
+ }
41
+ else if (peer instanceof types.PeerChannel || peer instanceof types.InputPeerChannel) {
42
+ return getChannelChatId(peer.channelId);
43
+ }
44
+ else {
45
+ (0, _1_utilities_js_1.UNREACHABLE)();
46
+ }
47
+ }
48
+ exports.peerToChatId = peerToChatId;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TLWriter = void 0;
4
- const constants_js_1 = require("../constants.js");
4
+ const _4_constants_js_1 = require("../4_constants.js");
5
5
  const _0_tl_raw_writer_js_1 = require("./0_tl_raw_writer.js");
6
6
  const _1_tl_object_js_1 = require("./1_tl_object.js");
7
7
  class TLWriter extends _0_tl_raw_writer_js_1.TLRawWriter {
8
8
  writeObject(object) {
9
9
  if (Array.isArray(object)) {
10
- this.writeInt32(constants_js_1.VECTOR_CONSTRUCTOR, false);
10
+ this.writeInt32(_4_constants_js_1.VECTOR_CONSTRUCTOR, false);
11
11
  this.writeInt32(object.length);
12
12
  for (const item of object) {
13
13
  this.writeObject(item);
@@ -1,5 +1,5 @@
1
- import { CTR } from "../utilities/0_crypto.js";
2
- import { Connection } from "../connection/0_connection.js";
1
+ import { CTR } from "../1_utilities.js";
2
+ import { Connection } from "../2_connection.js";
3
3
  export declare function getObfuscationParameters(protocol: number, connection: Connection): Promise<{
4
4
  encryptionCTR: CTR;
5
5
  decryptionCTR: CTR;
@@ -25,13 +25,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.getObfuscationParameters = void 0;
27
27
  const dntShim = __importStar(require("../_dnt.shims.js"));
28
- const _0_buffer_js_1 = require("../utilities/0_buffer.js");
29
- const _0_crypto_js_1 = require("../utilities/0_crypto.js");
28
+ const _1_utilities_js_1 = require("../1_utilities.js");
30
29
  async function getObfuscationParameters(protocol, connection) {
31
30
  const dc = 0xFCFF;
32
31
  let init;
33
32
  while (true) {
34
- init = (0, _0_buffer_js_1.concat)(dntShim.crypto.getRandomValues(new Uint8Array(56)), (0, _0_buffer_js_1.bufferFromBigInt)(protocol, 4, false), (0, _0_buffer_js_1.bufferFromBigInt)(dc, 2, false), dntShim.crypto.getRandomValues(new Uint8Array(2)));
33
+ init = (0, _1_utilities_js_1.concat)(dntShim.crypto.getRandomValues(new Uint8Array(56)), (0, _1_utilities_js_1.bufferFromBigInt)(protocol, 4, false), (0, _1_utilities_js_1.bufferFromBigInt)(dc, 2, false), dntShim.crypto.getRandomValues(new Uint8Array(2)));
35
34
  if (init[0] == 0xEF) {
36
35
  continue;
37
36
  }
@@ -48,13 +47,13 @@ async function getObfuscationParameters(protocol, connection) {
48
47
  }
49
48
  const encryptKey = init.slice(8, 8 + 32);
50
49
  const encryptIv = init.slice(40, 40 + 16);
51
- const encryptionCTR = new _0_crypto_js_1.CTR(encryptKey, encryptIv);
50
+ const encryptionCTR = new _1_utilities_js_1.CTR(encryptKey, encryptIv);
52
51
  const encryptedInit = encryptionCTR.encrypt(init);
53
52
  const initRev = new Uint8Array(init).reverse();
54
53
  const decryptKey = initRev.slice(8, 8 + 32);
55
54
  const decryptIv = initRev.slice(40, 40 + 16);
56
- const decryptionCTR = new _0_crypto_js_1.CTR(decryptKey, decryptIv);
57
- await connection.write((0, _0_buffer_js_1.concat)(init.slice(0, 56), encryptedInit.slice(56, 56 + 8)));
55
+ const decryptionCTR = new _1_utilities_js_1.CTR(decryptKey, decryptIv);
56
+ await connection.write((0, _1_utilities_js_1.concat)(init.slice(0, 56), encryptedInit.slice(56, 56 + 8)));
58
57
  return { encryptionCTR, decryptionCTR };
59
58
  }
60
59
  exports.getObfuscationParameters = getObfuscationParameters;
@@ -1,5 +1,4 @@
1
- import { MaybePromise } from "../utilities/0_types.js";
2
- import { CTR } from "../utilities/0_crypto.js";
1
+ import { CTR, MaybePromise } from "../1_utilities.js";
3
2
  export declare abstract class Transport {
4
3
  protected initialized: boolean;
5
4
  protected obfuscationParameters: {
@@ -1,4 +1,4 @@
1
- import { Connection } from "../connection/0_connection.js";
1
+ import { Connection } from "../2_connection.js";
2
2
  import { Transport } from "./0_transport.js";
3
3
  export declare class TransportAbridged extends Transport implements Transport {
4
4
  private readonly connection;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TransportAbridged = void 0;
4
- const _0_buffer_js_1 = require("../utilities/0_buffer.js");
4
+ const _1_utilities_js_1 = require("../1_utilities.js");
5
5
  const _0_obfuscation_js_1 = require("./0_obfuscation.js");
6
6
  const _0_transport_js_1 = require("./0_transport.js");
7
7
  class TransportAbridged extends _0_transport_js_1.Transport {
@@ -63,8 +63,8 @@ class TransportAbridged extends _0_transport_js_1.Transport {
63
63
  }
64
64
  const bufferLength = buffer.length / 4;
65
65
  const header = new Uint8Array([bufferLength >= 0x7F ? 0x7F : bufferLength]);
66
- const length = bufferLength >= 0x7F ? (0, _0_buffer_js_1.bufferFromBigInt)(bufferLength, 3) : new Uint8Array();
67
- await this.connection.write(this.encrypt((0, _0_buffer_js_1.concat)(header, length, buffer)));
66
+ const length = bufferLength >= 0x7F ? (0, _1_utilities_js_1.bufferFromBigInt)(bufferLength, 3) : new Uint8Array();
67
+ await this.connection.write(this.encrypt((0, _1_utilities_js_1.concat)(header, length, buffer)));
68
68
  }
69
69
  deinitialize() {
70
70
  this.initialized = false;
@@ -1,4 +1,4 @@
1
- import { Connection } from "../connection/0_connection.js";
1
+ import { Connection } from "../2_connection.js";
2
2
  import { Transport } from "./0_transport.js";
3
3
  export declare class TransportIntermediate extends Transport implements Transport {
4
4
  private readonly connection;