@mtkruto/node 0.2.4 → 0.2.6

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 (91) hide show
  1. package/esm/0_errors.d.ts +3 -0
  2. package/esm/0_errors.d.ts.map +1 -1
  3. package/esm/0_errors.js +13 -0
  4. package/esm/1_utilities.d.ts +1 -0
  5. package/esm/1_utilities.d.ts.map +1 -1
  6. package/esm/1_utilities.js +1 -0
  7. package/esm/3_errors.d.ts +0 -1
  8. package/esm/3_errors.d.ts.map +1 -1
  9. package/esm/3_errors.js +2 -7
  10. package/esm/_dnt.polyfills.d.ts +7 -0
  11. package/esm/_dnt.polyfills.d.ts.map +1 -0
  12. package/esm/_dnt.polyfills.js +1 -0
  13. package/esm/_dnt.shims.d.ts +3 -3
  14. package/esm/_dnt.shims.d.ts.map +1 -1
  15. package/esm/_dnt.shims.js +3 -3
  16. package/esm/_dnt.test_shims.d.ts.map +1 -1
  17. package/esm/client/0_client_abstract.d.ts.map +1 -1
  18. package/esm/client/0_client_abstract.js +9 -5
  19. package/esm/client/0_filters.d.ts +8 -31
  20. package/esm/client/0_filters.d.ts.map +1 -1
  21. package/esm/client/0_storage_operations.js +3 -3
  22. package/esm/client/1_client_encrypted.js +2 -2
  23. package/esm/client/1_composer.d.ts +5 -5
  24. package/esm/client/1_composer.d.ts.map +1 -1
  25. package/esm/client/2_bot_info_manager.js +4 -4
  26. package/esm/client/2_file_manager.js +5 -5
  27. package/esm/client/2_update_manager.d.ts.map +1 -1
  28. package/esm/client/2_update_manager.js +5 -2
  29. package/esm/client/3_message_manager.d.ts +2 -2
  30. package/esm/client/3_message_manager.js +12 -12
  31. package/esm/client/3_video_chat_manager.js +1 -1
  32. package/esm/client/4_chat_list_manager.js +4 -4
  33. package/esm/client/4_story_manager.js +1 -1
  34. package/esm/client/5_client.d.ts +1 -1
  35. package/esm/client/5_client.d.ts.map +1 -1
  36. package/esm/client/5_client.js +96 -74
  37. package/esm/connection/1_connection_tcp.d.ts.map +1 -1
  38. package/esm/connection/1_connection_tcp.js +3 -1
  39. package/esm/mod.d.ts +1 -0
  40. package/esm/mod.d.ts.map +1 -1
  41. package/esm/mod.js +1 -0
  42. package/esm/transport/1_transport_abridged.d.ts.map +1 -1
  43. package/esm/transport/1_transport_abridged.js +2 -4
  44. package/esm/types/6_update.d.ts +1 -1
  45. package/esm/types/6_update.d.ts.map +1 -1
  46. package/package.json +2 -3
  47. package/script/0_errors.d.ts +3 -0
  48. package/script/0_errors.d.ts.map +1 -1
  49. package/script/0_errors.js +13 -0
  50. package/script/1_utilities.d.ts +1 -0
  51. package/script/1_utilities.d.ts.map +1 -1
  52. package/script/1_utilities.js +16 -15
  53. package/script/3_errors.d.ts +0 -1
  54. package/script/3_errors.d.ts.map +1 -1
  55. package/script/3_errors.js +2 -7
  56. package/script/_dnt.polyfills.d.ts +7 -0
  57. package/script/_dnt.polyfills.d.ts.map +1 -0
  58. package/script/_dnt.polyfills.js +2 -0
  59. package/script/_dnt.shims.d.ts +3 -3
  60. package/script/_dnt.shims.d.ts.map +1 -1
  61. package/script/_dnt.shims.js +5 -5
  62. package/script/_dnt.test_shims.d.ts.map +1 -1
  63. package/script/client/0_client_abstract.d.ts.map +1 -1
  64. package/script/client/0_client_abstract.js +9 -5
  65. package/script/client/0_filters.d.ts +8 -31
  66. package/script/client/0_filters.d.ts.map +1 -1
  67. package/script/client/0_storage_operations.js +3 -3
  68. package/script/client/1_client_encrypted.js +2 -2
  69. package/script/client/1_composer.d.ts +5 -5
  70. package/script/client/1_composer.d.ts.map +1 -1
  71. package/script/client/2_bot_info_manager.js +4 -4
  72. package/script/client/2_file_manager.js +5 -5
  73. package/script/client/2_update_manager.d.ts.map +1 -1
  74. package/script/client/2_update_manager.js +5 -2
  75. package/script/client/3_message_manager.d.ts +2 -2
  76. package/script/client/3_message_manager.js +12 -12
  77. package/script/client/3_video_chat_manager.js +1 -1
  78. package/script/client/4_chat_list_manager.js +4 -4
  79. package/script/client/4_story_manager.js +1 -1
  80. package/script/client/5_client.d.ts +1 -1
  81. package/script/client/5_client.d.ts.map +1 -1
  82. package/script/client/5_client.js +94 -72
  83. package/script/connection/1_connection_tcp.d.ts.map +1 -1
  84. package/script/connection/1_connection_tcp.js +3 -1
  85. package/script/mod.d.ts +1 -0
  86. package/script/mod.d.ts.map +1 -1
  87. package/script/mod.js +20 -19
  88. package/script/transport/1_transport_abridged.d.ts.map +1 -1
  89. package/script/transport/1_transport_abridged.js +2 -4
  90. package/script/types/6_update.d.ts +1 -1
  91. package/script/types/6_update.d.ts.map +1 -1
@@ -29,7 +29,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
29
29
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
30
30
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
31
31
  };
32
- var _Client_instances, _a, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_videoChatManager, _Client_businessConnectionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_storage_, _Client_messageStorage_, _Client_parseMode, _Client_apiId, _Client_apiHash, _Client_publicKeys, _Client_ignoreOutgoing, _Client_persistCache, _Client_cdn, _Client_LsignIn, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_getApiId, _Client_getCdnConnectionPool, _Client_getCdnConnection, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_pingLoopStarted, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
32
+ var _Client_instances, _a, _Client_client, _Client_guaranteeUpdateDelivery, _Client_updateManager, _Client_networkStatisticsManager, _Client_botInfoManager, _Client_fileManager, _Client_reactionManager, _Client_videoChatManager, _Client_businessConnectionManager, _Client_messageManager, _Client_storyManager, _Client_callbackQueryManager, _Client_inlineQueryManager, _Client_chatListManager, _Client_accountManager, _Client_storage_, _Client_messageStorage_, _Client_parseMode, _Client_apiId, _Client_apiHash, _Client_publicKeys, _Client_ignoreOutgoing, _Client_persistCache, _Client_cdn, _Client_LsignIn, _Client_LpingLoop, _Client_LhandleMigrationError, _Client_L$initConncetion, _Client_getApiId, _Client_getCdnConnectionPool, _Client_getCdnConnection, _Client_constructContext, _Client_propagateConnectionState, _Client_lastPropagatedConnectionState, _Client_stateChangeHandler, _Client_storageInited, _Client_initStorage, _Client_connectMutex, _Client_lastConnect, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _Client_pingLoopStarted, _Client_pingLoopAbortController, _Client_pingInterval, _Client_lastUpdates, _Client_startPingLoop, _Client_pingLoop, _Client_invoke, _Client_handleInvokeError, _Client_getUserAccessHash, _Client_getChannelAccessHash, _Client_getInputPeerInner, _Client_handleCtxUpdate, _Client_queueHandleCtxUpdate, _Client_handleUpdate, _Client_lastGetMe, _Client_getMe;
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
34
  exports.Client = exports.handleMigrationError = exports.restartAuth = exports.Composer = void 0;
35
35
  const _0_deps_js_1 = require("../0_deps.js");
@@ -511,6 +511,8 @@ class Client extends Composer {
511
511
  }
512
512
  }).bind(this));
513
513
  _Client_storageInited.set(this, false);
514
+ _Client_connectMutex.set(this, new _1_utilities_js_1.Mutex());
515
+ _Client_lastConnect.set(this, null);
514
516
  _Client_connectionInited.set(this, false);
515
517
  _Client_lastPropagatedAuthorizationState.set(this, null);
516
518
  _Client_pingLoopStarted.set(this, false);
@@ -564,13 +566,7 @@ class Client extends Composer {
564
566
  await __classPrivateFieldGet(this, _Client_updateManager, "f").recoverUpdateGap(source);
565
567
  break;
566
568
  case "decryption":
567
- try {
568
- await this.disconnect();
569
- }
570
- catch {
571
- //
572
- }
573
- await this.connect();
569
+ await this.reconnect();
574
570
  await __classPrivateFieldGet(this, _Client_updateManager, "f").recoverUpdateGap(source);
575
571
  break;
576
572
  }
@@ -655,51 +651,65 @@ class Client extends Composer {
655
651
  transport.connection.callback = __classPrivateFieldGet(this, _Client_networkStatisticsManager, "f").getTransportReadWriteCallback();
656
652
  return transport;
657
653
  };
658
- if (params?.defaultHandlers ?? true) {
659
- let reconnecting = false;
660
- let lastReconnection = null;
661
- this.on("connectionState", ({ connectionState }, next) => {
662
- if (connectionState != "notConnected") {
663
- return;
664
- }
665
- if (this.disconnected) {
666
- L.debug("not reconnecting");
667
- return;
668
- }
669
- if (reconnecting) {
670
- return;
671
- }
672
- reconnecting = true;
673
- (0, _1_utilities_js_1.drop)((async () => {
654
+ this.invoke.use(async ({ error }, next) => {
655
+ if (error instanceof _0_errors_js_1.ConnectionError) {
656
+ while (!this.connected) {
657
+ if (this.disconnected) {
658
+ return next();
659
+ }
674
660
  try {
675
- let delay = 5;
676
- if (lastReconnection != null && Date.now() - lastReconnection.getTime() <= 10 * _1_utilities_js_1.second) {
677
- await new Promise((r) => setTimeout(r, delay * _1_utilities_js_1.second));
661
+ await this.connect();
662
+ }
663
+ catch {
664
+ //
665
+ }
666
+ }
667
+ return true;
668
+ }
669
+ else {
670
+ return next();
671
+ }
672
+ });
673
+ let reconnecting = false;
674
+ this.on("connectionState", ({ connectionState }, next) => {
675
+ if (connectionState != "notConnected") {
676
+ return next();
677
+ }
678
+ if (this.disconnected) {
679
+ L.debug("not reconnecting");
680
+ return next();
681
+ }
682
+ if (reconnecting) {
683
+ return next();
684
+ }
685
+ reconnecting = true;
686
+ (0, _1_utilities_js_1.drop)((async () => {
687
+ try {
688
+ let delay = 5;
689
+ while (!this.connected) {
690
+ L.debug("reconnecting");
691
+ try {
692
+ await this.connect();
693
+ L.debug("reconnected");
694
+ (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_updateManager, "f").recoverUpdateGap("reconnect"));
695
+ break;
678
696
  }
679
- while (!this.connected) {
680
- L.debug("reconnecting");
681
- try {
682
- await this.connect();
683
- lastReconnection = new Date();
684
- L.debug("reconnected");
685
- (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_updateManager, "f").recoverUpdateGap("reconnect"));
686
- break;
687
- }
688
- catch (err) {
689
- if (delay < 15) {
690
- delay += 5;
691
- }
692
- L.debug(`failed to reconnect, retrying in ${delay}:`, err);
697
+ catch (err) {
698
+ if (delay < 15) {
699
+ delay += 5;
693
700
  }
694
- await new Promise((r) => setTimeout(r, delay * _1_utilities_js_1.second));
701
+ L.debug(`failed to reconnect, retrying in ${delay}:`, err);
695
702
  }
703
+ await new Promise((r) => setTimeout(r, delay * _1_utilities_js_1.second));
696
704
  }
697
- finally {
698
- reconnecting = false;
699
- }
700
- })());
701
- return next();
702
- });
705
+ }
706
+ finally {
707
+ reconnecting = false;
708
+ }
709
+ })());
710
+ return next();
711
+ });
712
+ if (params?.defaultHandlers ?? true) {
703
713
  this.invoke.use(async ({ error }, next) => {
704
714
  if (error instanceof _4_errors_js_1.FloodWait && error.seconds <= 10) {
705
715
  L.warning("sleeping for", error.seconds, "because of:", error);
@@ -740,39 +750,51 @@ class Client extends Composer {
740
750
  * Before establishing the connection, the session is saved.
741
751
  */
742
752
  async connect() {
743
- await __classPrivateFieldGet(this, _Client_instances, "m", _Client_initStorage).call(this);
744
- const [authKey, dc] = await Promise.all([this.storage.getAuthKey(), this.storage.getDc()]);
745
- if (authKey != null && dc != null) {
746
- await __classPrivateFieldGet(this, _Client_client, "f").setAuthKey(authKey);
747
- __classPrivateFieldGet(this, _Client_client, "f").setDc(dc);
748
- if (__classPrivateFieldGet(this, _Client_client, "f").serverSalt == 0n) {
749
- __classPrivateFieldGet(this, _Client_client, "f").serverSalt = await this.storage.getServerSalt() ?? 0n;
750
- }
753
+ const unlock = await __classPrivateFieldGet(this, _Client_connectMutex, "f").lock();
754
+ if (this.connected) {
755
+ return;
751
756
  }
752
- else {
753
- const plain = new _1_client_plain_js_1.ClientPlain({ initialDc: __classPrivateFieldGet(this, _Client_client, "f").initialDc, transportProvider: __classPrivateFieldGet(this, _Client_client, "f").transportProvider, cdn: __classPrivateFieldGet(this, _Client_client, "f").cdn, publicKeys: __classPrivateFieldGet(this, _Client_publicKeys, "f") });
754
- const dc = await this.storage.getDc();
755
- if (dc != null) {
756
- plain.setDc(dc);
757
+ if (__classPrivateFieldGet(this, _Client_lastConnect, "f") != null && Date.now() - __classPrivateFieldGet(this, _Client_lastConnect, "f").getTime() <= 10 * _1_utilities_js_1.second) {
758
+ await new Promise((r) => setTimeout(r, 3 * _1_utilities_js_1.second));
759
+ }
760
+ try {
761
+ await __classPrivateFieldGet(this, _Client_instances, "m", _Client_initStorage).call(this);
762
+ const [authKey, dc] = await Promise.all([this.storage.getAuthKey(), this.storage.getDc()]);
763
+ if (authKey != null && dc != null) {
764
+ await __classPrivateFieldGet(this, _Client_client, "f").setAuthKey(authKey);
757
765
  __classPrivateFieldGet(this, _Client_client, "f").setDc(dc);
766
+ if (__classPrivateFieldGet(this, _Client_client, "f").serverSalt == 0n) {
767
+ __classPrivateFieldGet(this, _Client_client, "f").serverSalt = await this.storage.getServerSalt() ?? 0n;
768
+ }
758
769
  }
759
- await plain.connect();
760
- const [authKey, serverSalt] = await plain.createAuthKey();
761
- (0, _1_utilities_js_1.drop)(plain.disconnect());
762
- await __classPrivateFieldGet(this, _Client_client, "f").setAuthKey(authKey);
763
- __classPrivateFieldGet(this, _Client_client, "f").serverSalt = serverSalt;
770
+ else {
771
+ const plain = new _1_client_plain_js_1.ClientPlain({ initialDc: __classPrivateFieldGet(this, _Client_client, "f").initialDc, transportProvider: __classPrivateFieldGet(this, _Client_client, "f").transportProvider, cdn: __classPrivateFieldGet(this, _Client_client, "f").cdn, publicKeys: __classPrivateFieldGet(this, _Client_publicKeys, "f") });
772
+ const dc = await this.storage.getDc();
773
+ if (dc != null) {
774
+ plain.setDc(dc);
775
+ __classPrivateFieldGet(this, _Client_client, "f").setDc(dc);
776
+ }
777
+ await plain.connect();
778
+ const [authKey, serverSalt] = await plain.createAuthKey();
779
+ (0, _1_utilities_js_1.drop)(plain.disconnect());
780
+ await __classPrivateFieldGet(this, _Client_client, "f").setAuthKey(authKey);
781
+ __classPrivateFieldGet(this, _Client_client, "f").serverSalt = serverSalt;
782
+ }
783
+ await __classPrivateFieldGet(this, _Client_client, "f").connect();
784
+ __classPrivateFieldSet(this, _Client_lastConnect, new Date(), "f");
785
+ await Promise.all([this.storage.setAuthKey(__classPrivateFieldGet(this, _Client_client, "f").authKey), this.storage.setDc(__classPrivateFieldGet(this, _Client_client, "f").dc), this.storage.setServerSalt(__classPrivateFieldGet(this, _Client_client, "f").serverSalt)]);
786
+ }
787
+ finally {
788
+ unlock();
764
789
  }
765
- await __classPrivateFieldGet(this, _Client_client, "f").connect();
766
- await Promise.all([this.storage.setAuthKey(__classPrivateFieldGet(this, _Client_client, "f").authKey), this.storage.setDc(__classPrivateFieldGet(this, _Client_client, "f").dc), this.storage.setServerSalt(__classPrivateFieldGet(this, _Client_client, "f").serverSalt)]);
767
790
  }
768
791
  async reconnect(dc) {
769
- await this.disconnect();
770
792
  if (dc) {
771
793
  await this.setDc(dc);
772
794
  }
773
- await this.connect();
795
+ await __classPrivateFieldGet(this, _Client_client, "f").reconnect();
774
796
  }
775
- async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_videoChatManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_storage_ = new WeakMap(), _Client_messageStorage_ = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_apiId = new WeakMap(), _Client_apiHash = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_persistCache = new WeakMap(), _Client_cdn = new WeakMap(), _Client_LsignIn = new WeakMap(), _Client_LpingLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_L$initConncetion = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_pingLoopAbortController = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_instances = new WeakSet(), _Client_getApiId = async function _Client_getApiId() {
797
+ async [(_Client_client = new WeakMap(), _Client_guaranteeUpdateDelivery = new WeakMap(), _Client_updateManager = new WeakMap(), _Client_networkStatisticsManager = new WeakMap(), _Client_botInfoManager = new WeakMap(), _Client_fileManager = new WeakMap(), _Client_reactionManager = new WeakMap(), _Client_videoChatManager = new WeakMap(), _Client_businessConnectionManager = new WeakMap(), _Client_messageManager = new WeakMap(), _Client_storyManager = new WeakMap(), _Client_callbackQueryManager = new WeakMap(), _Client_inlineQueryManager = new WeakMap(), _Client_chatListManager = new WeakMap(), _Client_accountManager = new WeakMap(), _Client_storage_ = new WeakMap(), _Client_messageStorage_ = new WeakMap(), _Client_parseMode = new WeakMap(), _Client_apiId = new WeakMap(), _Client_apiHash = new WeakMap(), _Client_publicKeys = new WeakMap(), _Client_ignoreOutgoing = new WeakMap(), _Client_persistCache = new WeakMap(), _Client_cdn = new WeakMap(), _Client_LsignIn = new WeakMap(), _Client_LpingLoop = new WeakMap(), _Client_LhandleMigrationError = new WeakMap(), _Client_L$initConncetion = new WeakMap(), _Client_constructContext = new WeakMap(), _Client_lastPropagatedConnectionState = new WeakMap(), _Client_stateChangeHandler = new WeakMap(), _Client_storageInited = new WeakMap(), _Client_connectMutex = new WeakMap(), _Client_lastConnect = new WeakMap(), _Client_connectionInited = new WeakMap(), _Client_lastPropagatedAuthorizationState = new WeakMap(), _Client_pingLoopStarted = new WeakMap(), _Client_pingLoopAbortController = new WeakMap(), _Client_pingInterval = new WeakMap(), _Client_lastUpdates = new WeakMap(), _Client_handleInvokeError = new WeakMap(), _Client_lastGetMe = new WeakMap(), _Client_instances = new WeakSet(), _Client_getApiId = async function _Client_getApiId() {
776
798
  const apiId = __classPrivateFieldGet(this, _Client_apiId, "f") || await this.storage.getApiId();
777
799
  if (!apiId) {
778
800
  throw new _0_errors_js_1.InputError("apiId not set");
@@ -1712,7 +1734,7 @@ class Client extends Composer {
1712
1734
  * @returns The forwarded message.
1713
1735
  */
1714
1736
  async forwardMessage(from, to, messageId, params) {
1715
- return await this.forwardMessages(from, to, [messageId], params).then((v) => v[0]);
1737
+ return (await this.forwardMessages(from, to, [messageId], params))[0];
1716
1738
  }
1717
1739
  /**
1718
1740
  * Stop a poll.
@@ -1 +1 @@
1
- {"version":3,"file":"1_connection_tcp.d.ts","sourceRoot":"","sources":["../../src/connection/1_connection_tcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAK5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,qBAAa,aAAc,YAAW,UAAU;;IAU9C,OAAO,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAwB;IAC5D,kBAAkB,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;gBAEtB,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAK1C,IAAI,SAAS,IAAI,OAAO,CAEvB;IAQK,IAAI;IA6CJ,IAAI,CAAC,CAAC,EAAE,UAAU;IAgBlB,KAAK,CAAC,CAAC,EAAE,UAAU;IA0BzB,KAAK;CAON"}
1
+ {"version":3,"file":"1_connection_tcp.d.ts","sourceRoot":"","sources":["../../src/connection/1_connection_tcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAK5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,qBAAa,aAAc,YAAW,UAAU;;IAU9C,OAAO,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAwB;IAC5D,kBAAkB,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;gBAEtB,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAK1C,IAAI,SAAS,IAAI,OAAO,CAEvB;IAQK,IAAI;IA+CJ,IAAI,CAAC,CAAC,EAAE,UAAU;IAgBlB,KAAK,CAAC,CAAC,EAAE,UAAU;IA0BzB,KAAK;CAON"}
@@ -103,6 +103,8 @@ class ConnectionTCP {
103
103
  hostname: __classPrivateFieldGet(this, _ConnectionTCP_hostname, "f"),
104
104
  port: __classPrivateFieldGet(this, _ConnectionTCP_port, "f"),
105
105
  });
106
+ connection.setNoDelay(true);
107
+ connection.setKeepAlive(true);
106
108
  __classPrivateFieldSet(this, _ConnectionTCP_canRead, __classPrivateFieldSet(this, _ConnectionTCP_canWrite, true, "f"), "f");
107
109
  this.stateChangeHandler?.(true);
108
110
  Promise.resolve().then(async () => {
@@ -159,7 +161,7 @@ class ConnectionTCP {
159
161
  written += wrote;
160
162
  }
161
163
  catch (err) {
162
- if (err instanceof dntShim.Deno.errors.BrokenPipe) {
164
+ if (err instanceof dntShim.Deno.errors.BrokenPipe || err instanceof dntShim.Deno.errors.ConnectionReset || (err instanceof Error && "code" in err && err.code == "EAGAIN" || err.code == "ECONNRESET")) {
163
165
  __classPrivateFieldSet(this, _ConnectionTCP_canWrite, false, "f");
164
166
  }
165
167
  if (!this.connected) {
package/script/mod.d.ts CHANGED
@@ -17,6 +17,7 @@
17
17
  * You should have received a copy of the GNU Lesser General Public License
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
+ import "./_dnt.polyfills.js";
20
21
  export { getColorFromPeerId, getColorName, getRandomId, type LoggingProvider, setLoggingProvider, setLogVerbosity } from "./1_utilities.js";
21
22
  export { checkPassword } from "./client/0_password.js";
22
23
  export * from "./2_connection.js";
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC5I,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxI,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,qBAAqB,CAAC;AAG7B,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC5I,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxI,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,cAAc,eAAe,CAAC"}
package/script/mod.js CHANGED
@@ -1,23 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
- * Copyright (C) 2023-2024 Roj <https://roj.im/>
5
- *
6
- * This file is part of MTKruto.
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU Lesser General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU Lesser General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU Lesser General Public License
19
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
- */
21
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
22
3
  if (k2 === undefined) k2 = k;
23
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -46,6 +27,26 @@ var __importStar = (this && this.__importStar) || function (mod) {
46
27
  };
47
28
  Object.defineProperty(exports, "__esModule", { value: true });
48
29
  exports.errors = 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.checkPassword = exports.setLogVerbosity = exports.setLoggingProvider = exports.getRandomId = exports.getColorName = exports.getColorFromPeerId = void 0;
30
+ /**
31
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
32
+ * Copyright (C) 2023-2024 Roj <https://roj.im/>
33
+ *
34
+ * This file is part of MTKruto.
35
+ *
36
+ * This program is free software: you can redistribute it and/or modify
37
+ * it under the terms of the GNU Lesser General Public License as published by
38
+ * the Free Software Foundation, either version 3 of the License, or
39
+ * (at your option) any later version.
40
+ *
41
+ * This program is distributed in the hope that it will be useful,
42
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
43
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44
+ * GNU Lesser General Public License for more details.
45
+ *
46
+ * You should have received a copy of the GNU Lesser General Public License
47
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
48
+ */
49
+ require("./_dnt.polyfills.js");
49
50
  var _1_utilities_js_1 = require("./1_utilities.js");
50
51
  Object.defineProperty(exports, "getColorFromPeerId", { enumerable: true, get: function () { return _1_utilities_js_1.getColorFromPeerId; } });
51
52
  Object.defineProperty(exports, "getColorName", { enumerable: true, get: function () { return _1_utilities_js_1.getColorName; } });
@@ -1 +1 @@
1
- {"version":3,"file":"1_transport_abridged.d.ts","sourceRoot":"","sources":["../../src/transport/1_transport_abridged.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,iBAAkB,SAAQ,SAAU,YAAW,SAAS;;gBAKvD,UAAU,EAAE,UAAU,EAAE,UAAU,UAAQ;IAMhD,UAAU;IAaV,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IA4B9B,IAAI,CAAC,MAAM,EAAE,UAAU;IAe7B,YAAY;IAKZ,IAAI,WAAW,IAAI,OAAO,CAEzB;CACF"}
1
+ {"version":3,"file":"1_transport_abridged.d.ts","sourceRoot":"","sources":["../../src/transport/1_transport_abridged.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,iBAAkB,SAAQ,SAAU,YAAW,SAAS;;gBAKvD,UAAU,EAAE,UAAU,EAAE,UAAU,UAAQ;IAMhD,UAAU;IAWV,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IA4B9B,IAAI,CAAC,MAAM,EAAE,UAAU;IAe7B,YAAY;IAKZ,IAAI,WAAW,IAAI,OAAO,CAEzB;CACF"}
@@ -33,6 +33,7 @@ var _TransportAbridged_initialized, _TransportAbridged_connection, _TransportAbr
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
34
  exports.TransportAbridged = void 0;
35
35
  const _0_deps_js_1 = require("../0_deps.js");
36
+ const _0_errors_js_1 = require("../0_errors.js");
36
37
  const _1_utilities_js_1 = require("../1_utilities.js");
37
38
  const _0_obfuscation_js_1 = require("./0_obfuscation.js");
38
39
  const _0_transport_js_1 = require("./0_transport.js");
@@ -55,9 +56,6 @@ class TransportAbridged extends _0_transport_js_1.Transport {
55
56
  }
56
57
  __classPrivateFieldSet(this, _TransportAbridged_initialized, true, "f");
57
58
  }
58
- else {
59
- throw new Error("Transport already initialized");
60
- }
61
59
  }
62
60
  async receive() {
63
61
  let length;
@@ -84,7 +82,7 @@ class TransportAbridged extends _0_transport_js_1.Transport {
84
82
  }
85
83
  async send(buffer) {
86
84
  if (!this.initialized) {
87
- throw new Error("Transport not initialized");
85
+ throw new _0_errors_js_1.ConnectionError("Transport not initialized");
88
86
  }
89
87
  const bufferLength = buffer.length / 4;
90
88
  const header = new Uint8Array([bufferLength >= 0x7F ? 0x7F : bufferLength]);
@@ -317,7 +317,7 @@ export interface UpdateMap {
317
317
  videoChat: UpdateVideoChat;
318
318
  }
319
319
  /** @unlisted */
320
- export type UpdateIntersection<T> = T & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & UpdateEditedMessage & UpdateDeletedMessages & UpdateCallbackQuery & UpdateInlineQuery & UpdateChosenInlineResult & UpdateNewChat & UpdateEditedChat & UpdateDeletedChat & UpdateMessageInteractions & UpdateMessageReactionCount & UpdateMessageReactions & UpdateChatMember & UpdateMyChatMember & UpdateDeletedStory & UpdateNewStory & UpdateBusinessConnection & UpdateVideoChat>;
320
+ export type UpdateIntersection = Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & UpdateEditedMessage & UpdateDeletedMessages & UpdateCallbackQuery & UpdateInlineQuery & UpdateChosenInlineResult & UpdateNewChat & UpdateEditedChat & UpdateDeletedChat & UpdateMessageInteractions & UpdateMessageReactionCount & UpdateMessageReactions & UpdateChatMember & UpdateMyChatMember & UpdateDeletedStory & UpdateNewStory & UpdateBusinessConnection & UpdateVideoChat>;
321
321
  /** An incoming update. */
322
322
  export type Update = UpdateConnectionState | UpdateAuthorizationState | UpdateNewMessage | UpdateEditedMessage | UpdateDeletedMessages | UpdateCallbackQuery | UpdateInlineQuery | UpdateChosenInlineResult | UpdateNewChat | UpdateEditedChat | UpdateDeletedChat | UpdateMessageInteractions | UpdateMessageReactionCount | UpdateMessageReactions | UpdateChatMember | UpdateMyChatMember | UpdateDeletedStory | UpdateNewStory | UpdateBusinessConnection | UpdateVideoChat;
323
323
  //# sourceMappingURL=6_update.d.ts.map
@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,CACL,qBAAqB,GACrB,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,qBAAqB,GACrB,mBAAmB,GACnB,iBAAiB,GACjB,wBAAwB,GACxB,aAAa,GACb,gBAAgB,GAChB,iBAAiB,GACjB,yBAAyB,GACzB,0BAA0B,GAC1B,sBAAsB,GACtB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,wBAAwB,GACxB,eAAe,CAClB,CAAC;AAEJ,0BAA0B;AAC1B,MAAM,MAAM,MAAM,GACd,qBAAqB,GACrB,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,qBAAqB,GACrB,mBAAmB,GACnB,iBAAiB,GACjB,wBAAwB,GACxB,aAAa,GACb,gBAAgB,GAChB,iBAAiB,GACjB,yBAAyB,GACzB,0BAA0B,GAC1B,sBAAsB,GACtB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,wBAAwB,GACxB,eAAe,CAAC"}
1
+ {"version":3,"file":"6_update.d.ts","sourceRoot":"","sources":["../../src/types/6_update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,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