@mtkruto/node 0.2.11 → 0.2.21

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 (181) hide show
  1. package/esm/3_types.d.ts +5 -0
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +5 -0
  4. package/esm/client/0_filters.d.ts +1 -1
  5. package/esm/client/0_filters.d.ts.map +1 -1
  6. package/esm/client/0_html.js +1 -1
  7. package/esm/client/0_message.d.ts +1 -1
  8. package/esm/client/0_message.d.ts.map +1 -1
  9. package/esm/client/0_message.js +2 -2
  10. package/esm/client/0_params.d.ts +17 -6
  11. package/esm/client/0_params.d.ts.map +1 -1
  12. package/esm/client/0_storage_operations.d.ts +1 -1
  13. package/esm/client/0_storage_operations.d.ts.map +1 -1
  14. package/esm/client/0_storage_operations.js +1 -1
  15. package/esm/client/1_client_encrypted.d.ts.map +1 -1
  16. package/esm/client/1_client_encrypted.js +51 -6
  17. package/esm/client/1_client_plain.js +1 -1
  18. package/esm/client/1_types.d.ts +1 -1
  19. package/esm/client/1_types.d.ts.map +1 -1
  20. package/esm/client/2_business_connection_manager.d.ts +3 -1
  21. package/esm/client/2_business_connection_manager.d.ts.map +1 -1
  22. package/esm/client/2_business_connection_manager.js +5 -3
  23. package/esm/client/2_payment_manager.d.ts +35 -0
  24. package/esm/client/2_payment_manager.d.ts.map +1 -0
  25. package/esm/client/2_payment_manager.js +68 -0
  26. package/esm/client/2_reaction_manager.d.ts +2 -1
  27. package/esm/client/2_reaction_manager.d.ts.map +1 -1
  28. package/esm/client/2_reaction_manager.js +8 -7
  29. package/esm/client/3_message_manager.d.ts +7 -2
  30. package/esm/client/3_message_manager.d.ts.map +1 -1
  31. package/esm/client/3_message_manager.js +53 -13
  32. package/esm/client/3_video_chat_manager.d.ts +2 -1
  33. package/esm/client/3_video_chat_manager.d.ts.map +1 -1
  34. package/esm/client/3_video_chat_manager.js +5 -2
  35. package/esm/client/4_callback_query_manager.d.ts +2 -1
  36. package/esm/client/4_callback_query_manager.d.ts.map +1 -1
  37. package/esm/client/4_callback_query_manager.js +6 -2
  38. package/esm/client/4_chat_list_manager.d.ts +2 -1
  39. package/esm/client/4_chat_list_manager.d.ts.map +1 -1
  40. package/esm/client/4_chat_list_manager.js +12 -2
  41. package/esm/client/4_inline_query_manager.d.ts +2 -1
  42. package/esm/client/4_inline_query_manager.d.ts.map +1 -1
  43. package/esm/client/4_inline_query_manager.js +6 -2
  44. package/esm/client/4_story_manager.d.ts +2 -1
  45. package/esm/client/4_story_manager.d.ts.map +1 -1
  46. package/esm/client/4_story_manager.js +5 -2
  47. package/esm/client/5_client.d.ts +51 -3
  48. package/esm/client/5_client.d.ts.map +1 -1
  49. package/esm/client/5_client.js +87 -12
  50. package/esm/connection/1_connection_tcp.node.d.ts +19 -0
  51. package/esm/connection/1_connection_tcp.node.d.ts.map +1 -1
  52. package/esm/connection/1_connection_tcp.node.js +22 -1
  53. package/esm/connection/1_connection_web_socket.d.ts.map +1 -1
  54. package/esm/connection/1_connection_web_socket.js +1 -0
  55. package/esm/tl/1_utilities.d.ts +1 -1
  56. package/esm/tl/1_utilities.d.ts.map +1 -1
  57. package/esm/tl/5_message.d.ts +1 -1
  58. package/esm/tl/5_message.d.ts.map +1 -1
  59. package/esm/tl/5_message.js +2 -2
  60. package/esm/types/0_invoice.d.ts +19 -0
  61. package/esm/types/0_invoice.d.ts.map +1 -1
  62. package/esm/types/0_invoice.js +19 -0
  63. package/esm/types/0_shipping_address.d.ts +31 -0
  64. package/esm/types/0_shipping_address.d.ts.map +1 -0
  65. package/esm/types/0_shipping_address.js +29 -0
  66. package/esm/types/1_keyboard_button.d.ts +7 -0
  67. package/esm/types/1_keyboard_button.d.ts.map +1 -1
  68. package/esm/types/1_order_info.d.ts +29 -0
  69. package/esm/types/1_order_info.d.ts.map +1 -0
  70. package/esm/types/1_order_info.js +29 -0
  71. package/esm/types/2_chat.d.ts +2 -2
  72. package/esm/types/2_chat.d.ts.map +1 -1
  73. package/esm/types/2_chat.js +3 -3
  74. package/esm/types/2_pre_checkout_query.d.ts +34 -0
  75. package/esm/types/2_pre_checkout_query.d.ts.map +1 -0
  76. package/esm/types/2_pre_checkout_query.js +39 -0
  77. package/esm/types/2_successful_payment.d.ts +32 -0
  78. package/esm/types/2_successful_payment.d.ts.map +1 -0
  79. package/esm/types/2_successful_payment.js +32 -0
  80. package/esm/types/3_join_request.d.ts +20 -0
  81. package/esm/types/3_join_request.d.ts.map +1 -0
  82. package/esm/types/3_join_request.js +26 -0
  83. package/esm/types/4_inline_query_result.d.ts +1 -1
  84. package/esm/types/4_inline_query_result.d.ts.map +1 -1
  85. package/esm/types/4_inline_query_result.js +2 -2
  86. package/esm/types/4_message.d.ts +11 -1
  87. package/esm/types/4_message.d.ts.map +1 -1
  88. package/esm/types/4_message.js +9 -0
  89. package/esm/types/6_update.d.ts +20 -3
  90. package/esm/types/6_update.d.ts.map +1 -1
  91. package/package.json +1 -1
  92. package/script/3_types.d.ts +5 -0
  93. package/script/3_types.d.ts.map +1 -1
  94. package/script/3_types.js +5 -0
  95. package/script/client/0_filters.d.ts +1 -1
  96. package/script/client/0_filters.d.ts.map +1 -1
  97. package/script/client/0_html.js +1 -1
  98. package/script/client/0_message.d.ts +1 -1
  99. package/script/client/0_message.d.ts.map +1 -1
  100. package/script/client/0_message.js +2 -2
  101. package/script/client/0_params.d.ts +17 -6
  102. package/script/client/0_params.d.ts.map +1 -1
  103. package/script/client/0_storage_operations.d.ts +1 -1
  104. package/script/client/0_storage_operations.d.ts.map +1 -1
  105. package/script/client/0_storage_operations.js +1 -1
  106. package/script/client/1_client_encrypted.d.ts.map +1 -1
  107. package/script/client/1_client_encrypted.js +50 -5
  108. package/script/client/1_client_plain.js +1 -1
  109. package/script/client/1_types.d.ts +1 -1
  110. package/script/client/1_types.d.ts.map +1 -1
  111. package/script/client/2_business_connection_manager.d.ts +3 -1
  112. package/script/client/2_business_connection_manager.d.ts.map +1 -1
  113. package/script/client/2_business_connection_manager.js +6 -4
  114. package/script/client/2_payment_manager.d.ts +35 -0
  115. package/script/client/2_payment_manager.d.ts.map +1 -0
  116. package/script/client/2_payment_manager.js +72 -0
  117. package/script/client/2_reaction_manager.d.ts +2 -1
  118. package/script/client/2_reaction_manager.d.ts.map +1 -1
  119. package/script/client/2_reaction_manager.js +8 -7
  120. package/script/client/3_message_manager.d.ts +7 -2
  121. package/script/client/3_message_manager.d.ts.map +1 -1
  122. package/script/client/3_message_manager.js +51 -11
  123. package/script/client/3_video_chat_manager.d.ts +2 -1
  124. package/script/client/3_video_chat_manager.d.ts.map +1 -1
  125. package/script/client/3_video_chat_manager.js +4 -1
  126. package/script/client/4_callback_query_manager.d.ts +2 -1
  127. package/script/client/4_callback_query_manager.d.ts.map +1 -1
  128. package/script/client/4_callback_query_manager.js +6 -2
  129. package/script/client/4_chat_list_manager.d.ts +2 -1
  130. package/script/client/4_chat_list_manager.d.ts.map +1 -1
  131. package/script/client/4_chat_list_manager.js +11 -1
  132. package/script/client/4_inline_query_manager.d.ts +2 -1
  133. package/script/client/4_inline_query_manager.d.ts.map +1 -1
  134. package/script/client/4_inline_query_manager.js +5 -1
  135. package/script/client/4_story_manager.d.ts +2 -1
  136. package/script/client/4_story_manager.d.ts.map +1 -1
  137. package/script/client/4_story_manager.js +4 -1
  138. package/script/client/5_client.d.ts +51 -3
  139. package/script/client/5_client.d.ts.map +1 -1
  140. package/script/client/5_client.js +87 -12
  141. package/script/connection/1_connection_tcp.node.d.ts +19 -0
  142. package/script/connection/1_connection_tcp.node.d.ts.map +1 -1
  143. package/script/connection/1_connection_tcp.node.js +22 -1
  144. package/script/connection/1_connection_web_socket.d.ts.map +1 -1
  145. package/script/connection/1_connection_web_socket.js +1 -0
  146. package/script/tl/1_utilities.d.ts +1 -1
  147. package/script/tl/1_utilities.d.ts.map +1 -1
  148. package/script/tl/5_message.d.ts +1 -1
  149. package/script/tl/5_message.d.ts.map +1 -1
  150. package/script/tl/5_message.js +2 -2
  151. package/script/types/0_invoice.d.ts +19 -0
  152. package/script/types/0_invoice.d.ts.map +1 -1
  153. package/script/types/0_invoice.js +19 -0
  154. package/script/types/0_shipping_address.d.ts +31 -0
  155. package/script/types/0_shipping_address.d.ts.map +1 -0
  156. package/script/types/0_shipping_address.js +33 -0
  157. package/script/types/1_keyboard_button.d.ts +7 -0
  158. package/script/types/1_keyboard_button.d.ts.map +1 -1
  159. package/script/types/1_order_info.d.ts +29 -0
  160. package/script/types/1_order_info.d.ts.map +1 -0
  161. package/script/types/1_order_info.js +33 -0
  162. package/script/types/2_chat.d.ts +2 -2
  163. package/script/types/2_chat.d.ts.map +1 -1
  164. package/script/types/2_chat.js +3 -3
  165. package/script/types/2_pre_checkout_query.d.ts +34 -0
  166. package/script/types/2_pre_checkout_query.d.ts.map +1 -0
  167. package/script/types/2_pre_checkout_query.js +43 -0
  168. package/script/types/2_successful_payment.d.ts +32 -0
  169. package/script/types/2_successful_payment.d.ts.map +1 -0
  170. package/script/types/2_successful_payment.js +36 -0
  171. package/script/types/3_join_request.d.ts +20 -0
  172. package/script/types/3_join_request.d.ts.map +1 -0
  173. package/script/types/3_join_request.js +30 -0
  174. package/script/types/4_inline_query_result.d.ts +1 -1
  175. package/script/types/4_inline_query_result.d.ts.map +1 -1
  176. package/script/types/4_inline_query_result.js +2 -2
  177. package/script/types/4_message.d.ts +11 -1
  178. package/script/types/4_message.d.ts.map +1 -1
  179. package/script/types/4_message.js +9 -0
  180. package/script/types/6_update.d.ts +20 -3
  181. package/script/types/6_update.d.ts.map +1 -1
@@ -29,37 +29,38 @@ 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_connectMutex, _Client_lastConnect, _Client_connectionInited, _Client_lastPropagatedAuthorizationState, _Client_propagateAuthorizationState, _Client_getSelfId, _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_paymentManager, _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_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");
36
36
  const _0_errors_js_1 = require("../0_errors.js");
37
37
  const _1_utilities_js_1 = require("../1_utilities.js");
38
- const _2_tl_js_1 = require("../2_tl.js");
39
38
  const _2_storage_js_1 = require("../2_storage.js");
39
+ const _2_tl_js_1 = require("../2_tl.js");
40
40
  const _3_types_js_1 = require("../3_types.js");
41
41
  const _4_constants_js_1 = require("../4_constants.js");
42
42
  const _4_errors_js_1 = require("../4_errors.js");
43
+ const _4_errors_js_2 = require("../4_errors.js");
43
44
  const _0_password_js_1 = require("./0_password.js");
45
+ const _0_storage_operations_js_1 = require("./0_storage_operations.js");
44
46
  const _0_utilities_js_1 = require("./0_utilities.js");
45
- const _2_account_manager_js_1 = require("./2_account_manager.js");
46
- const _2_bot_info_manager_js_1 = require("./2_bot_info_manager.js");
47
- const _2_business_connection_manager_js_1 = require("./2_business_connection_manager.js");
48
47
  const _1_client_encrypted_js_1 = require("./1_client_encrypted.js");
49
48
  const _1_client_plain_js_1 = require("./1_client_plain.js");
50
49
  const _1_composer_js_1 = require("./1_composer.js");
50
+ const _2_account_manager_js_1 = require("./2_account_manager.js");
51
+ const _2_bot_info_manager_js_1 = require("./2_bot_info_manager.js");
52
+ const _2_business_connection_manager_js_1 = require("./2_business_connection_manager.js");
51
53
  const _2_file_manager_js_1 = require("./2_file_manager.js");
52
54
  const _2_network_statistics_manager_js_1 = require("./2_network_statistics_manager.js");
55
+ const _2_payment_manager_js_1 = require("./2_payment_manager.js");
53
56
  const _2_reaction_manager_js_1 = require("./2_reaction_manager.js");
54
57
  const _2_update_manager_js_1 = require("./2_update_manager.js");
55
58
  const _3_message_manager_js_1 = require("./3_message_manager.js");
59
+ const _3_video_chat_manager_js_1 = require("./3_video_chat_manager.js");
56
60
  const _4_callback_query_manager_js_1 = require("./4_callback_query_manager.js");
57
61
  const _4_chat_list_manager_js_1 = require("./4_chat_list_manager.js");
58
62
  const _4_inline_query_manager_js_1 = require("./4_inline_query_manager.js");
59
63
  const _4_story_manager_js_1 = require("./4_story_manager.js");
60
- const _3_video_chat_manager_js_1 = require("./3_video_chat_manager.js");
61
- const _0_storage_operations_js_1 = require("./0_storage_operations.js");
62
- const _4_errors_js_2 = require("../4_errors.js");
63
64
  class Composer extends _1_composer_js_1.Composer {
64
65
  }
65
66
  exports.Composer = Composer;
@@ -96,6 +97,7 @@ class Client extends Composer {
96
97
  _Client_inlineQueryManager.set(this, void 0);
97
98
  _Client_chatListManager.set(this, void 0);
98
99
  _Client_accountManager.set(this, void 0);
100
+ _Client_paymentManager.set(this, void 0);
99
101
  _Client_storage_.set(this, void 0);
100
102
  _Client_messageStorage_.set(this, void 0);
101
103
  Object.defineProperty(this, "storage", {
@@ -198,9 +200,9 @@ class Client extends Composer {
198
200
  }
199
201
  (0, _0_deps_js_1.unreachable)();
200
202
  };
201
- const chat_ = "messageReactions" in update ? update.messageReactions.chat : "messageReactionCount" in update ? update.messageReactionCount.chat : "chatMember" in update ? update.chatMember.chat : undefined;
203
+ const chat_ = "messageReactions" in update ? update.messageReactions.chat : "messageReactionCount" in update ? update.messageReactionCount.chat : "chatMember" in update ? update.chatMember.chat : "joinRequest" in update ? update.joinRequest.chat : undefined;
202
204
  const chat = chat_ ?? msg?.chat;
203
- const from = "callbackQuery" in update ? update.callbackQuery.from : "inlineQuery" in update ? update.inlineQuery.from : "message" in update ? update.message.from : "editedMessage" in update ? update.editedMessage?.from : "chatMember" in update ? update.chatMember.from : "messageReactions" in update ? update.messageReactions.user : undefined;
205
+ const from = "callbackQuery" in update ? update.callbackQuery.from : "inlineQuery" in update ? update.inlineQuery.from : "message" in update ? update.message.from : "editedMessage" in update ? update.editedMessage?.from : "chatMember" in update ? update.chatMember.from : "messageReactions" in update ? update.messageReactions.user : "preCheckoutQuery" in update ? update.preCheckoutQuery.from : "joinRequest" in update ? update.joinRequest.user : undefined;
204
206
  const senderChat = msg?.senderChat;
205
207
  const getReplyToMessageId = (quote, chatId, messageId) => {
206
208
  const isPrivate = chatId > 0;
@@ -500,6 +502,12 @@ class Client extends Composer {
500
502
  }
501
503
  return this.getBusinessConnection(businessConnectionId);
502
504
  },
505
+ answerPreCheckoutQuery: (ok, params) => {
506
+ if (!("preCheckoutQuery" in update)) {
507
+ (0, _0_deps_js_1.unreachable)();
508
+ }
509
+ return this.answerPreCheckoutQuery(update.preCheckoutQuery.id, ok, params);
510
+ },
503
511
  };
504
512
  return (0, _1_utilities_js_1.cleanObject)(context);
505
513
  });
@@ -643,6 +651,7 @@ class Client extends Composer {
643
651
  __classPrivateFieldSet(this, _Client_inlineQueryManager, new _4_inline_query_manager_js_1.InlineQueryManager({ ...c, messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
644
652
  __classPrivateFieldSet(this, _Client_chatListManager, new _4_chat_list_manager_js_1.ChatListManager({ ...c, fileManager: __classPrivateFieldGet(this, _Client_fileManager, "f"), messageManager: __classPrivateFieldGet(this, _Client_messageManager, "f") }), "f");
645
653
  __classPrivateFieldSet(this, _Client_accountManager, new _2_account_manager_js_1.AccountManager(c), "f");
654
+ __classPrivateFieldSet(this, _Client_paymentManager, new _2_payment_manager_js_1.PaymentManager(c), "f");
646
655
  __classPrivateFieldGet(this, _Client_updateManager, "f").setUpdateHandler(__classPrivateFieldGet(this, _Client_instances, "m", _Client_handleUpdate).bind(this));
647
656
  const transportProvider = __classPrivateFieldGet(this, _Client_client, "f").transportProvider;
648
657
  __classPrivateFieldGet(this, _Client_client, "f").transportProvider = (params) => {
@@ -665,6 +674,9 @@ class Client extends Composer {
665
674
  }
666
675
  return true;
667
676
  }
677
+ else if ((0, _2_tl_js_1.is)("bad_msg_notification", error)) {
678
+ return true;
679
+ }
668
680
  else {
669
681
  return next();
670
682
  }
@@ -795,7 +807,7 @@ class Client extends Composer {
795
807
  }
796
808
  await __classPrivateFieldGet(this, _Client_client, "f").reconnect();
797
809
  }
798
- 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_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() {
810
+ 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_paymentManager = 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_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() {
799
811
  const apiId = __classPrivateFieldGet(this, _Client_apiId, "f") || await this.storage.getApiId();
800
812
  if (!apiId) {
801
813
  throw new _0_errors_js_1.InputError("apiId not set");
@@ -1170,7 +1182,9 @@ class Client extends Composer {
1170
1182
  await this.invoke({ _: "ping_delay_disconnect", ping_id: (0, _1_utilities_js_1.getRandomId)(), disconnect_delay: __classPrivateFieldGet(this, _Client_pingInterval, "f") / _1_utilities_js_1.second + 15 });
1171
1183
  __classPrivateFieldGet(this, _Client_pingLoopAbortController, "f").signal.throwIfAborted();
1172
1184
  if (Date.now() - __classPrivateFieldGet(this, _Client_lastUpdates, "f").getTime() >= 15 * _1_utilities_js_1.minute) {
1173
- (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_updateManager, "f").recoverUpdateGap("lastUpdates"));
1185
+ (0, _1_utilities_js_1.drop)(__classPrivateFieldGet(this, _Client_updateManager, "f").recoverUpdateGap("lastUpdates").then(() => {
1186
+ __classPrivateFieldSet(this, _Client_lastUpdates, new Date(), "f");
1187
+ }));
1174
1188
  }
1175
1189
  }
1176
1190
  catch (err) {
@@ -2019,6 +2033,44 @@ class Client extends Composer {
2019
2033
  async createInviteLink(chatId, params) {
2020
2034
  return await __classPrivateFieldGet(this, _Client_messageManager, "f").createInviteLink(chatId, params);
2021
2035
  }
2036
+ /**
2037
+ * Approve a join request.
2038
+ *
2039
+ * @method ch
2040
+ * @param chatId The identifier of the chat that contains the join request.
2041
+ * @param userId The user who made the join request.
2042
+ */
2043
+ async approveJoinRequest(chatId, userId) {
2044
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").approveJoinRequest(chatId, userId);
2045
+ }
2046
+ /**
2047
+ * Decline a join request.
2048
+ *
2049
+ * @method ch
2050
+ * @param chatId The identifier of the chat that contains the join request.
2051
+ * @param userId The user who made the join request.
2052
+ */
2053
+ async declineJoinRequest(chatId, userId) {
2054
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").declineJoinRequest(chatId, userId);
2055
+ }
2056
+ /**
2057
+ * Approve all join requests. User-only.
2058
+ *
2059
+ * @method ch
2060
+ * @param chatId The identifier of the chat that contains the join requests.
2061
+ */
2062
+ async approveJoinRequests(chatId, params) {
2063
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").approveJoinRequests(chatId, params);
2064
+ }
2065
+ /**
2066
+ * Decline all join requests. User-only.
2067
+ *
2068
+ * @method ch
2069
+ * @param chatId The identifier of the chat that contains the join requests.
2070
+ */
2071
+ async declineJoinRequests(chatId, params) {
2072
+ await __classPrivateFieldGet(this, _Client_messageManager, "f").declineJoinRequests(chatId, params);
2073
+ }
2022
2074
  //
2023
2075
  // ========================= CALLBACK QUERIES ========================= //
2024
2076
  //
@@ -2384,6 +2436,29 @@ class Client extends Composer {
2384
2436
  async *downloadLiveStreamChunk(id, channelId, scale, timestamp, params) {
2385
2437
  yield* __classPrivateFieldGet(this, _Client_videoChatManager, "f").downloadLiveStreamChunk(id, channelId, scale, timestamp, params);
2386
2438
  }
2439
+ //
2440
+ // ========================= PAYMENTS ========================= //
2441
+ //
2442
+ /**
2443
+ * Answer a pre-checkout query. Bot-only.
2444
+ *
2445
+ * @method pa
2446
+ * @param preCheckoutQueryId The identifier of the pre-checkout query.
2447
+ * @param ok Whether the checkout is going to be processed.
2448
+ */
2449
+ async answerPreCheckoutQuery(preCheckoutQueryId, ok, params) {
2450
+ await __classPrivateFieldGet(this, _Client_paymentManager, "f").answerPreCheckoutQuery(preCheckoutQueryId, ok, params);
2451
+ }
2452
+ /**
2453
+ * Refund a star payment. Bot-only.
2454
+ *
2455
+ * @method pa
2456
+ * @param userId The identifier of the user that was charged.
2457
+ * @param telegramPaymentChargeId The identifier of the charge.
2458
+ */
2459
+ async refundStarPayment(userId, telegramPaymentChargeId) {
2460
+ await __classPrivateFieldGet(this, _Client_paymentManager, "f").refundStarPayment(userId, telegramPaymentChargeId);
2461
+ }
2387
2462
  }
2388
2463
  exports.Client = Client;
2389
2464
  _a = Client, _Client_handleCtxUpdate = async function _Client_handleCtxUpdate(update) {
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
1
20
  import { Connection } from "./0_connection.js";
2
21
  export declare class ConnectionTCP implements Connection {
3
22
  #private;
@@ -1 +1 @@
1
- {"version":3,"file":"1_connection_tcp.node.d.ts","sourceRoot":"","sources":["../../src/connection/1_connection_tcp.node.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,qBAAa,aAAc,YAAW,UAAU;;IAW9C,kBAAkB,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;gBAE1C,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAY1C,IAAI;IAsCJ,IAAI,SAAS,YAEZ;IAQK,IAAI,CAAC,CAAC,EAAE,UAAU;IAclB,KAAK,CAAC,CAAC,EAAE,UAAU;IA0BzB,KAAK;CAKN"}
1
+ {"version":3,"file":"1_connection_tcp.node.d.ts","sourceRoot":"","sources":["../../src/connection/1_connection_tcp.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,qBAAa,aAAc,YAAW,UAAU;;IAW9C,kBAAkB,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;gBAE1C,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAY1C,IAAI;IAuCJ,IAAI,SAAS,YAEZ;IAQK,IAAI,CAAC,CAAC,EAAE,UAAU;IAclB,KAAK,CAAC,CAAC,EAAE,UAAU;IA0BzB,KAAK;CAKN"}
@@ -1,4 +1,23 @@
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
+ */
2
21
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
22
  if (kind === "m") throw new TypeError("Private method is not writable");
4
23
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
@@ -14,8 +33,9 @@ var _ConnectionTCP_instances, _ConnectionTCP_hostname, _ConnectionTCP_port, _Con
14
33
  Object.defineProperty(exports, "__esModule", { value: true });
15
34
  exports.ConnectionTCP = void 0;
16
35
  const node_net_1 = require("node:net");
17
- const _1_utilities_js_1 = require("../1_utilities.js");
18
36
  const _0_errors_js_1 = require("../0_errors.js");
37
+ const _1_utilities_js_1 = require("../1_utilities.js");
38
+ const L = (0, _1_utilities_js_1.getLogger)("ConnectionTCP");
19
39
  const errConnectionNotOpen = new _0_errors_js_1.ConnectionError("Connection not open");
20
40
  class ConnectionTCP {
21
41
  constructor(hostname, port) {
@@ -62,6 +82,7 @@ class ConnectionTCP {
62
82
  __classPrivateFieldGet(this, _ConnectionTCP_socket, "f").off("error", reject);
63
83
  resolve();
64
84
  this.stateChangeHandler?.(true);
85
+ L.debug("connected to", __classPrivateFieldGet(this, _ConnectionTCP_hostname, "f"), "port", __classPrivateFieldGet(this, _ConnectionTCP_port, "f"));
65
86
  });
66
87
  });
67
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"1_connection_web_socket.d.ts","sourceRoot":"","sources":["../../src/connection/1_connection_web_socket.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,qBAAa,mBAAoB,YAAW,UAAU;;IAOpD,kBAAkB,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;gBAE1C,GAAG,EAAE,MAAM;IA6CvB,IAAI,SAAS,IAAI,OAAO,CAEvB;IAGK,IAAI;IAuBJ,IAAI,CAAC,CAAC,EAAE,UAAU;IAgBlB,KAAK,CAAC,CAAC,EAAE,UAAU;IAkBzB,KAAK;CAMN"}
1
+ {"version":3,"file":"1_connection_web_socket.d.ts","sourceRoot":"","sources":["../../src/connection/1_connection_web_socket.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK/C,qBAAa,mBAAoB,YAAW,UAAU;;IAOpD,kBAAkB,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;gBAE1C,GAAG,EAAE,MAAM;IA8CvB,IAAI,SAAS,IAAI,OAAO,CAEvB;IAGK,IAAI;IAuBJ,IAAI,CAAC,CAAC,EAAE,UAAU;IAgBlB,KAAK,CAAC,CAAC,EAAE,UAAU;IAkBzB,KAAK;CAMN"}
@@ -143,6 +143,7 @@ _ConnectionWebSocket_url = new WeakMap(), _ConnectionWebSocket_webSocket = new W
143
143
  webSocket.addEventListener("open", () => {
144
144
  this.stateChangeHandler?.(true);
145
145
  resolve(webSocket);
146
+ L.debug("connected to", __classPrivateFieldGet(this, _ConnectionWebSocket_url, "f"));
146
147
  });
147
148
  webSocket.addEventListener("message", async (e) => {
148
149
  if (typeof e.data === "string") {
@@ -26,7 +26,7 @@ export declare function analyzeOptionalParam(ntype: string): {
26
26
  export declare function isValidType(object: any): object is AnyType;
27
27
  export declare function assertIsValidType(object: any): void;
28
28
  export declare function is<S extends keyof (Types & Functions)>(typeName: S, value: unknown): value is S extends keyof Types ? Types[S] : S extends keyof Functions ? Functions[S] : never;
29
- export declare function isOneOf<S extends keyof (Types & Functions)>(typeNames: S[], value: unknown): value is S extends keyof Types ? Types[S] : S extends keyof Functions ? Functions[S] : never;
29
+ export declare function isOneOf<S extends keyof (Types & Functions)>(typeNames: S[] | readonly S[], value: unknown): value is S extends keyof Types ? Types[S] : S extends keyof Functions ? Functions[S] : never;
30
30
  export declare function isOfEnum<S extends keyof Enums>(enumName: S, value: unknown): value is Enums[S];
31
31
  export declare function as<S extends keyof Types>(typeName: S, value: unknown): Types[S];
32
32
  //# sourceMappingURL=1_utilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"1_utilities.d.ts","sourceRoot":"","sources":["../../src/tl/1_utilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAoB,KAAK,EAAE,MAAM,YAAY,CAAC;AAEhF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEtD;AACD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAY3F;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,OAAO,CAE1D;AACD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,GAAG,QAI5C;AAED,wBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO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I5C;AAED,wBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,SAAS,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAMjL;AACD,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,SAAS,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAExM;AACD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAE9F;AACD,wBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAM/E"}
@@ -17,9 +17,9 @@
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 { AnyObject } from "./0_api.js";
20
21
  import { TLReader } from "./3_tl_reader.js";
21
22
  import { rpc_result } from "./4_rpc_result.js";
22
- import { AnyObject } from "./0_api.js";
23
23
  export interface message {
24
24
  _: "message";
25
25
  msg_id: bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"5_message.d.ts","sourceRoot":"","sources":["../../src/tl/5_message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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CAAC;IACd,IAAI,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;CAC9C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG,MAAM,CAgBpF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAc7D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAiB5D;AAID,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,eAAe,CAAC;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,aAAa,GAAG,UAAU,CAQ7E;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAQzE"}
@@ -20,10 +20,10 @@
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.deserializeMsgContainer = exports.serializeMsgContainer = exports.MSG_CONTAINER_ID = exports.deserializeMessage = exports.serializeMessage = exports.calculateLength = void 0;
23
+ const _2_serialize_js_1 = require("./2_serialize.js");
23
24
  const _3_tl_reader_js_1 = require("./3_tl_reader.js");
24
- const _4_tl_writer_js_1 = require("./4_tl_writer.js");
25
25
  const _4_rpc_result_js_1 = require("./4_rpc_result.js");
26
- const _2_serialize_js_1 = require("./2_serialize.js");
26
+ const _4_tl_writer_js_1 = require("./4_tl_writer.js");
27
27
  function calculateLength(object) {
28
28
  let length = 0;
29
29
  if (Array.isArray(object)) {
@@ -1,3 +1,22 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
1
20
  import { Api } from "../2_tl.js";
2
21
  export interface Invoice {
3
22
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"0_invoice.d.ts","sourceRoot":"","sources":["../../src/types/0_invoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,mBAAmB,GAAG,OAAO,CAQ1E"}
1
+ {"version":3,"file":"0_invoice.d.ts","sourceRoot":"","sources":["../../src/types/0_invoice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,mBAAmB,GAAG,OAAO,CAQ1E"}
@@ -1,4 +1,23 @@
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
+ */
2
21
  Object.defineProperty(exports, "__esModule", { value: true });
3
22
  exports.constructInvoice = void 0;
4
23
  function constructInvoice(invoice) {
@@ -0,0 +1,31 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { Api } from "../2_tl.js";
21
+ /** A shipping address. */
22
+ export interface ShippingAddress {
23
+ countryCode: string;
24
+ state: string;
25
+ city: string;
26
+ streetLine1: string;
27
+ streetLine2: string;
28
+ postCode: string;
29
+ }
30
+ export declare function constructShippingAddress(shippingAddress: Api.postAddress): ShippingAddress;
31
+ //# sourceMappingURL=0_shipping_address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_shipping_address.d.ts","sourceRoot":"","sources":["../../src/types/0_shipping_address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,0BAA0B;AAC1B,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,GAAG,CAAC,WAAW,GAAG,eAAe,CAS1F"}
@@ -0,0 +1,33 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.constructShippingAddress = void 0;
23
+ function constructShippingAddress(shippingAddress) {
24
+ return {
25
+ countryCode: shippingAddress.country_iso2,
26
+ state: shippingAddress.state,
27
+ city: shippingAddress.city,
28
+ streetLine1: shippingAddress.street_line1,
29
+ streetLine2: shippingAddress.street_line2,
30
+ postCode: shippingAddress.post_code,
31
+ };
32
+ }
33
+ exports.constructShippingAddress = constructShippingAddress;
@@ -23,10 +23,12 @@ import { KeyboardButtonPollType } from "./0_keyboard_button_poll_type.js";
23
23
  import { MiniAppInfo } from "./0_mini_app_info.js";
24
24
  /** @unlisted */
25
25
  export interface KeyboardButtonText {
26
+ /** @discriminator */
26
27
  text: string;
27
28
  }
28
29
  /** @unlisted */
29
30
  export interface KeyboardButtonRequestUser extends KeyboardButtonText {
31
+ /** @discriminator */
30
32
  requestUser: {
31
33
  requestId: number;
32
34
  userIsBot?: boolean;
@@ -35,6 +37,7 @@ export interface KeyboardButtonRequestUser extends KeyboardButtonText {
35
37
  }
36
38
  /** @unlisted */
37
39
  export interface KeyboardButtonRequestChat extends KeyboardButtonText {
40
+ /** @discriminator */
38
41
  requestChat: {
39
42
  requestId: number;
40
43
  chatIsChannel: boolean;
@@ -48,18 +51,22 @@ export interface KeyboardButtonRequestChat extends KeyboardButtonText {
48
51
  }
49
52
  /** @unlisted */
50
53
  export interface KeyboardButtonRequestContact extends KeyboardButtonText {
54
+ /** @discriminator */
51
55
  requestContact: true;
52
56
  }
53
57
  /** @unlisted */
54
58
  export interface KeyboardButtonRequestLocation extends KeyboardButtonText {
59
+ /** @discriminator */
55
60
  requestLocation: true;
56
61
  }
57
62
  /** @unlisted */
58
63
  export interface KeyboardButtonRequestPoll extends KeyboardButtonText {
64
+ /** @discriminator */
59
65
  requestPoll: KeyboardButtonPollType;
60
66
  }
61
67
  /** @unlisted */
62
68
  export interface KeyboardButtonMiniApp extends KeyboardButtonText {
69
+ /** @discriminator */
63
70
  miniApp: MiniAppInfo;
64
71
  }
65
72
  /** A button of a custom keyboard. */
@@ -1 +1 @@
1
- {"version":3,"file":"1_keyboard_button.d.ts","sourceRoot":"","sources":["../../src/types/1_keyboard_button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,uBAAuB,E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;CACH;AAED,gBAAgB;AAChB,MAAM,WAAW,4BAA6B,SAAQ,kBAAkB;IACtE,qBAAqB;IACrB,cAAc,EAAE,IAAI,CAAC;CACtB;AAED,gBAAgB;AAChB,MAAM,WAAW,6BAA8B,SAAQ,kBAAkB;IACvE,qBAAqB;IACrB,eAAe,EAAE,IAAI,CAAC;CACvB;AAED,gBAAgB;AAChB,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE,qBAAqB;IACrB,WAAW,EAAE,sBAAsB,CAAC;CACrC;AAED,gBAAgB;AAChB,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,qBAAqB;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,qCAAqC;AACrC,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,yBAAyB,GACzB,yBAAyB,GACzB,4BAA4B,GAC5B,6BAA6B,GAC7B,yBAAyB,GACzB,qBAAqB,CAAC;AAE1B,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,GAAG,CAAC,cAAc,GAAG,cAAc,CAqEnF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG,CAAC,cAAc,CAoBnF"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
+ * Copyright (C) 2023-2024 Roj <https://roj.im/>
4
+ *
5
+ * This file is part of MTKruto.
6
+ *
7
+ * This program is free software: you can redistribute it and/or modify
8
+ * it under the terms of the GNU Lesser General Public License as published by
9
+ * the Free Software Foundation, either version 3 of the License, or
10
+ * (at your option) any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU Lesser General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU Lesser General Public License
18
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+ */
20
+ import { Api } from "../2_tl.js";
21
+ import { ShippingAddress } from "./0_shipping_address.js";
22
+ export interface OrderInfo {
23
+ name?: string;
24
+ phoneNumber?: string;
25
+ email?: string;
26
+ shippingAddress?: ShippingAddress;
27
+ }
28
+ export declare function constructOrderInfo(info: Api.paymentRequestedInfo): OrderInfo;
29
+ //# sourceMappingURL=1_order_info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1_order_info.d.ts","sourceRoot":"","sources":["../../src/types/1_order_info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA4B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEpF,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC,oBAAoB,GAAG,SAAS,CAO5E"}
@@ -0,0 +1,33 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.constructOrderInfo = void 0;
23
+ const _1_utilities_js_1 = require("../1_utilities.js");
24
+ const _0_shipping_address_js_1 = require("./0_shipping_address.js");
25
+ function constructOrderInfo(info) {
26
+ return (0, _1_utilities_js_1.cleanObject)({
27
+ name: info.name,
28
+ phoneNumber: info.phone,
29
+ email: info.email,
30
+ shippingAddress: info.shipping_address ? (0, _0_shipping_address_js_1.constructShippingAddress)(info.shipping_address) : undefined,
31
+ });
32
+ }
33
+ exports.constructOrderInfo = constructOrderInfo;
@@ -19,11 +19,11 @@
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
21
  import { EntityGetter } from "./_getters.js";
22
+ import { Birthday } from "./0_birthday.js";
23
+ import { Location } from "./0_location.js";
22
24
  import { OpeningHours } from "./0_opening_hours.js";
23
25
  import { ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup } from "./1_chat_p.js";
24
26
  import { Photo } from "./1_photo.js";
25
- import { Location } from "./0_location.js";
26
- import { Birthday } from "./0_birthday.js";
27
27
  /** @unlisted */
28
28
  export interface ChatBase {
29
29
  /** The chat's photo. */
@@ -1 +1 @@
1
- {"version":3,"file":"2_chat.d.ts","sourceRoot":"","sources":["../../src/types/2_chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAyB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAC;AAExG,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAqB,MAAM,iBAAiB,CAAC;AAG9D,gBAAgB;AAChB,MAAM,W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AC,CAiCnI"}
@@ -21,13 +21,13 @@
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructChat = void 0;
23
23
  const _0_deps_js_1 = require("../0_deps.js");
24
+ const _1_utilities_js_1 = require("../1_utilities.js");
24
25
  const _2_tl_js_1 = require("../2_tl.js");
26
+ const _0_birthday_js_1 = require("./0_birthday.js");
27
+ const _0_location_js_1 = require("./0_location.js");
25
28
  const _0_opening_hours_js_1 = require("./0_opening_hours.js");
26
29
  const _1_chat_p_js_1 = require("./1_chat_p.js");
27
30
  const _1_photo_js_1 = require("./1_photo.js");
28
- const _0_location_js_1 = require("./0_location.js");
29
- const _0_birthday_js_1 = require("./0_birthday.js");
30
- const _1_utilities_js_1 = require("../1_utilities.js");
31
31
  async function constructChat(fullChat, getEntity) {
32
32
  if ((0, _2_tl_js_1.is)("userFull", fullChat)) {
33
33
  const user = await getEntity({ _: "peerUser", user_id: fullChat.id });