@mtkruto/node 0.1.191 → 0.1.200

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 (173) hide show
  1. package/esm/1_utilities.d.ts +1 -1
  2. package/esm/1_utilities.js +1 -1
  3. package/esm/2_tl.d.ts +6 -6
  4. package/esm/2_tl.js +6 -6
  5. package/esm/3_storage.d.ts +5 -5
  6. package/esm/3_storage.js +5 -5
  7. package/esm/3_types.d.ts +6 -5
  8. package/esm/3_types.js +6 -5
  9. package/esm/4_constants.d.ts +2 -2
  10. package/esm/4_constants.js +2 -2
  11. package/esm/5_client.d.ts +1 -1
  12. package/esm/5_client.js +1 -1
  13. package/esm/client/0_params.d.ts +7 -1
  14. package/esm/client/0_types.d.ts +1 -0
  15. package/esm/client/0_utilities.d.ts +0 -3
  16. package/esm/client/0_utilities.js +0 -20
  17. package/esm/client/1_business_connection_manager.d.ts +11 -0
  18. package/esm/client/1_business_connection_manager.js +47 -0
  19. package/esm/client/1_update_manager.d.ts +8 -1
  20. package/esm/client/1_update_manager.js +88 -8
  21. package/esm/client/2_message_manager.d.ts +7 -6
  22. package/esm/client/2_message_manager.js +48 -31
  23. package/esm/client/4_client.d.ts +421 -420
  24. package/esm/client/4_client.js +565 -516
  25. package/esm/storage/0_storage.d.ts +5 -0
  26. package/esm/storage/0_storage.js +20 -0
  27. package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
  28. package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
  29. package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
  30. package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
  31. package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
  32. package/esm/tl/2_types.d.ts +1071 -183
  33. package/esm/tl/2_types.js +2916 -464
  34. package/esm/tl/3_functions.d.ts +381 -17
  35. package/esm/tl/3_functions.js +1002 -120
  36. package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
  37. package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
  38. package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
  39. package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
  40. package/esm/tl/{6_message.js → 7_message.js} +3 -3
  41. package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
  42. package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
  43. package/esm/types/0_chat_photo.js +1 -1
  44. package/esm/types/0_message_entity.d.ts +1 -1
  45. package/esm/types/0_thumbnail.js +1 -1
  46. package/esm/types/1_bot_command_scope.d.ts +1 -1
  47. package/esm/types/1_photo.js +2 -2
  48. package/esm/types/1_story_privacy.d.ts +1 -1
  49. package/esm/types/2_business_connection.d.ts +11 -0
  50. package/esm/types/2_business_connection.js +12 -0
  51. package/esm/types/2_chat_member.d.ts +1 -1
  52. package/esm/types/2_chosen_inline_result.d.ts +1 -1
  53. package/esm/types/2_game.js +1 -1
  54. package/esm/types/2_inline_keyboard_button.d.ts +1 -1
  55. package/esm/types/2_inline_query.d.ts +1 -1
  56. package/esm/types/2_invite_link.d.ts +1 -1
  57. package/esm/types/2_message_reaction_count.d.ts +1 -1
  58. package/esm/types/2_message_reactions.d.ts +1 -1
  59. package/esm/types/2_story_content.js +1 -1
  60. package/{script/types/1_story_interactive_area.d.ts → esm/types/2_story_interactive_area.d.ts} +2 -2
  61. package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
  62. package/esm/types/3_chat_member_updated.d.ts +1 -1
  63. package/esm/types/3_reply_markup.d.ts +1 -1
  64. package/esm/types/3_story.d.ts +2 -2
  65. package/esm/types/3_story.js +1 -1
  66. package/esm/types/4_inline_query_result.d.ts +1 -1
  67. package/esm/types/4_inline_query_result.js +1 -1
  68. package/esm/types/4_message.d.ts +9 -3
  69. package/esm/types/4_message.js +22 -5
  70. package/esm/types/5_callback_query.d.ts +1 -1
  71. package/esm/types/5_chat.d.ts +1 -1
  72. package/esm/types/6_update.d.ts +12 -2
  73. package/package.json +1 -1
  74. package/script/1_utilities.d.ts +1 -1
  75. package/script/1_utilities.js +1 -1
  76. package/script/2_tl.d.ts +6 -6
  77. package/script/2_tl.js +6 -6
  78. package/script/3_storage.d.ts +5 -5
  79. package/script/3_storage.js +5 -5
  80. package/script/3_types.d.ts +6 -5
  81. package/script/3_types.js +6 -5
  82. package/script/4_constants.d.ts +2 -2
  83. package/script/4_constants.js +2 -2
  84. package/script/5_client.d.ts +1 -1
  85. package/script/5_client.js +1 -1
  86. package/script/client/0_params.d.ts +7 -1
  87. package/script/client/0_types.d.ts +1 -0
  88. package/script/client/0_utilities.d.ts +0 -3
  89. package/script/client/0_utilities.js +1 -23
  90. package/script/client/1_business_connection_manager.d.ts +11 -0
  91. package/script/client/1_business_connection_manager.js +51 -0
  92. package/script/client/1_update_manager.d.ts +8 -1
  93. package/script/client/1_update_manager.js +88 -8
  94. package/script/client/2_message_manager.d.ts +7 -6
  95. package/script/client/2_message_manager.js +47 -30
  96. package/script/client/4_client.d.ts +421 -420
  97. package/script/client/4_client.js +565 -516
  98. package/script/storage/0_storage.d.ts +5 -0
  99. package/script/storage/0_storage.js +20 -0
  100. package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
  101. package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
  102. package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
  103. package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
  104. package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
  105. package/script/tl/2_types.d.ts +1071 -183
  106. package/script/tl/2_types.js +3028 -504
  107. package/script/tl/3_functions.d.ts +381 -17
  108. package/script/tl/3_functions.js +1047 -143
  109. package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
  110. package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
  111. package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
  112. package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
  113. package/script/tl/{6_message.js → 7_message.js} +8 -8
  114. package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
  115. package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
  116. package/script/types/0_chat_photo.js +9 -9
  117. package/script/types/0_message_entity.d.ts +1 -1
  118. package/script/types/0_thumbnail.js +6 -6
  119. package/script/types/1_bot_command_scope.d.ts +1 -1
  120. package/script/types/1_photo.js +7 -7
  121. package/script/types/1_story_privacy.d.ts +1 -1
  122. package/script/types/2_business_connection.d.ts +11 -0
  123. package/script/types/2_business_connection.js +16 -0
  124. package/script/types/2_chat_member.d.ts +1 -1
  125. package/script/types/2_chosen_inline_result.d.ts +1 -1
  126. package/script/types/2_game.js +3 -3
  127. package/script/types/2_inline_keyboard_button.d.ts +1 -1
  128. package/script/types/2_inline_query.d.ts +1 -1
  129. package/script/types/2_invite_link.d.ts +1 -1
  130. package/script/types/2_message_reaction_count.d.ts +1 -1
  131. package/script/types/2_message_reactions.d.ts +1 -1
  132. package/script/types/2_story_content.js +4 -4
  133. package/{esm/types/1_story_interactive_area.d.ts → script/types/2_story_interactive_area.d.ts} +2 -2
  134. package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
  135. package/script/types/3_chat_member_updated.d.ts +1 -1
  136. package/script/types/3_reply_markup.d.ts +1 -1
  137. package/script/types/3_story.d.ts +2 -2
  138. package/script/types/3_story.js +2 -2
  139. package/script/types/4_inline_query_result.d.ts +1 -1
  140. package/script/types/4_inline_query_result.js +2 -2
  141. package/script/types/4_message.d.ts +9 -3
  142. package/script/types/4_message.js +37 -20
  143. package/script/types/5_callback_query.d.ts +1 -1
  144. package/script/types/5_chat.d.ts +1 -1
  145. package/script/types/6_update.d.ts +12 -2
  146. /package/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
  147. /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
  148. /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
  149. /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
  150. /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
  151. /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
  152. /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
  153. /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
  154. /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
  155. /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
  156. /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
  157. /package/esm/types/{0__file_id.js → _file_id.js} +0 -0
  158. /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
  159. /package/esm/types/{1__getters.js → _getters.js} +0 -0
  160. /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
  161. /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
  162. /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
  163. /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
  164. /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
  165. /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
  166. /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
  167. /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
  168. /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
  169. /package/script/types/{0_venue.js → 1_venue.js} +0 -0
  170. /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
  171. /package/script/types/{0__file_id.js → _file_id.js} +0 -0
  172. /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
  173. /package/script/types/{1__getters.js → _getters.js} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { TLRawWriter } from "./0_tl_raw_writer.js";
2
- import { ReadObject } from "./3_tl_reader.js";
2
+ import { ReadObject } from "./4_tl_reader.js";
3
3
  export declare class TLWriter extends TLRawWriter {
4
4
  writeObject(object: ReadObject): typeof this;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { id, name } from "./1_tl_object.js";
2
- import { ReadObject } from "./3_tl_reader.js";
2
+ import { ReadObject } from "./4_tl_reader.js";
3
3
  export declare class RPCResult {
4
4
  readonly messageId: bigint;
5
5
  readonly result: ReadObject;
@@ -1,5 +1,5 @@
1
1
  import { id, name } from "./1_tl_object.js";
2
- import { TLReader } from "./3_tl_reader.js";
2
+ import { TLReader } from "./4_tl_reader.js";
3
3
  export class RPCResult {
4
4
  static get [id]() {
5
5
  return 0xF35C6D01;
@@ -1,6 +1,6 @@
1
1
  import { serialize } from "./1_tl_object.js";
2
- import { ReadObject, TLReader } from "./3_tl_reader.js";
3
- import { RPCResult } from "./4_rpc_result.js";
2
+ import { ReadObject, TLReader } from "./4_tl_reader.js";
3
+ import { RPCResult } from "./6_rpc_result.js";
4
4
  export declare function calculateLength(object: Message_ | ReadObject): number;
5
5
  export declare class Message_ {
6
6
  readonly id: bigint;
@@ -1,7 +1,7 @@
1
1
  import { id, serialize } from "./1_tl_object.js";
2
- import { TLReader } from "./3_tl_reader.js";
3
- import { RPCResult } from "./4_rpc_result.js";
4
- import { TLWriter } from "./4_tl_writer.js";
2
+ import { TLReader } from "./4_tl_reader.js";
3
+ import { TLWriter } from "./5_tl_writer.js";
4
+ import { RPCResult } from "./6_rpc_result.js";
5
5
  export function calculateLength(object) {
6
6
  let length = 0;
7
7
  if (Array.isArray(object)) {
@@ -1,5 +1,5 @@
1
1
  import { id, name, serialize } from "./1_tl_object.js";
2
- import { Message_ } from "./6_message.js";
2
+ import { Message_ } from "./7_message.js";
3
3
  export declare class MessageContainer {
4
4
  readonly id: bigint;
5
5
  readonly seqNo: number;
@@ -1,7 +1,7 @@
1
1
  import { id, name, serialize } from "./1_tl_object.js";
2
- import { TLReader } from "./3_tl_reader.js";
3
- import { TLWriter } from "./4_tl_writer.js";
4
- import { calculateLength, Message_ } from "./6_message.js";
2
+ import { TLReader } from "./4_tl_reader.js";
3
+ import { TLWriter } from "./5_tl_writer.js";
4
+ import { calculateLength, Message_ } from "./7_message.js";
5
5
  export class MessageContainer {
6
6
  static get [id]() {
7
7
  return 0x73F1F8DC;
@@ -1,6 +1,6 @@
1
1
  import { cleanObject } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
- import { FileType, PhotoSourceType, serializeFileId, toUniqueFileId } from "./0__file_id.js";
3
+ import { FileType, PhotoSourceType, serializeFileId, toUniqueFileId } from "./_file_id.js";
4
4
  export function constructChatPhoto(photo, chatId, chatAccessHash) {
5
5
  const smallFileId_ = {
6
6
  type: FileType.ProfilePhoto,
@@ -1,5 +1,5 @@
1
1
  import { enums } from "../2_tl.js";
2
- import { EntityGetter } from "./1__getters.js";
2
+ import { EntityGetter } from "./_getters.js";
3
3
  /** @unlisted */
4
4
  export type MessageEntityType = "mention" | "hashtag" | "botCommand" | "url" | "email" | "bold" | "italic" | "code" | "pre" | "textLink" | "textMention" | "cashtag" | "phoneNumber" | "underline" | "strikethrough" | "blockquote" | "bankCard" | "spoiler" | "customEmoji";
5
5
  /** @unlisted */
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { FileType, PhotoSourceType, serializeFileId, toUniqueFileId } from "./0__file_id.js";
2
+ import { FileType, PhotoSourceType, serializeFileId, toUniqueFileId } from "./_file_id.js";
3
3
  export function constructThumbnail(size, file) {
4
4
  const type = file instanceof types.Photo ? FileType.Photo : FileType.Thumbnail;
5
5
  const fileType = file instanceof types.Photo ? FileType.Photo : FileType.Document;
@@ -1,6 +1,6 @@
1
1
  import { enums } from "../2_tl.js";
2
+ import { InputPeerGetter } from "./_getters.js";
2
3
  import { ID } from "./0_id.js";
3
- import { InputPeerGetter } from "./1__getters.js";
4
4
  /** @unlisted */
5
5
  export interface BotCommandScopeDefault {
6
6
  type: "default";
@@ -1,6 +1,6 @@
1
1
  import { types } from "../2_tl.js";
2
- import { PhotoSourceType } from "./0__file_id.js";
3
- import { FileType, serializeFileId, toUniqueFileId } from "./0__file_id.js";
2
+ import { PhotoSourceType } from "./_file_id.js";
3
+ import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
4
4
  import { constructThumbnail } from "./0_thumbnail.js";
5
5
  export function constructPhoto(photo) {
6
6
  const sizes = photo.sizes
@@ -1,5 +1,5 @@
1
1
  import { enums } from "../2_tl.js";
2
- import { EntityGetter } from "./1__getters.js";
2
+ import { EntityGetter } from "./_getters.js";
3
3
  /** @unlisted */
4
4
  export interface StoryPrivacyEveryone {
5
5
  everyoneExcept: number[];
@@ -0,0 +1,11 @@
1
+ import { types } from "../2_tl.js";
2
+ import { EntityGetter } from "./_getters.js";
3
+ import { User } from "./1_user.js";
4
+ export interface BusinessConnection {
5
+ id: string;
6
+ user: User;
7
+ date: Date;
8
+ canReply: boolean;
9
+ isEnabled: boolean;
10
+ }
11
+ export declare function constructBusinessConnection(connection: types.BotBusinessConnection, getEntity: EntityGetter): Promise<BusinessConnection>;
@@ -0,0 +1,12 @@
1
+ import { fromUnixTimestamp } from "../1_utilities.js";
2
+ import { types } from "../2_tl.js";
3
+ import { constructUser } from "./1_user.js";
4
+ export async function constructBusinessConnection(connection, getEntity) {
5
+ return {
6
+ id: connection.connection_id,
7
+ user: constructUser((await getEntity(new types.PeerUser(connection)))),
8
+ date: fromUnixTimestamp(connection.date),
9
+ canReply: !!connection.can_reply,
10
+ isEnabled: !connection.disabled,
11
+ };
12
+ }
@@ -1,7 +1,7 @@
1
1
  import { enums } from "../2_tl.js";
2
+ import { EntityGetter } from "./_getters.js";
2
3
  import { ChatAdministratorRights } from "./0_chat_administrator_rights.js";
3
4
  import { ChatMemberRights } from "./0_chat_member_rights.js";
4
- import { EntityGetter } from "./1__getters.js";
5
5
  import { User } from "./1_user.js";
6
6
  /** @unlisted */
7
7
  export type ChatMemberStatus = "creator" | "administrator" | "member" | "restricted" | "left" | "banned";
@@ -1,6 +1,6 @@
1
1
  import { types } from "../2_tl.js";
2
+ import { EntityGetter } from "./_getters.js";
2
3
  import { Location } from "./0_location.js";
3
- import { EntityGetter } from "./1__getters.js";
4
4
  import { User } from "./1_user.js";
5
5
  /** A chosen inline result. */
6
6
  export interface ChosenInlineResult {
@@ -1,6 +1,6 @@
1
1
  import { cleanObject } from "../1_utilities.js";
2
2
  import { as, types } from "../2_tl.js";
3
- import { FileType, serializeFileId, toUniqueFileId } from "./0__file_id.js";
3
+ import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
4
4
  import { constructAnimation } from "./1_animation.js";
5
5
  import { constructPhoto } from "./1_photo.js";
6
6
  export function constructGame(media_) {
@@ -1,7 +1,7 @@
1
1
  import { enums } from "../2_tl.js";
2
+ import { UsernameResolver } from "./_getters.js";
2
3
  import { LoginUrl } from "./0_login_url.js";
3
4
  import { MiniAppInfo } from "./0_mini_app_info.js";
4
- import { UsernameResolver } from "./1__getters.js";
5
5
  /** @unlisted */
6
6
  export interface _InlineKeyboardButtonBase {
7
7
  text: string;
@@ -1,6 +1,6 @@
1
1
  import { types } from "../2_tl.js";
2
+ import { EntityGetter } from "./_getters.js";
2
3
  import { Location } from "./0_location.js";
3
- import { EntityGetter } from "./1__getters.js";
4
4
  import { User } from "./1_user.js";
5
5
  /** An incoming inline query. */
6
6
  export interface InlineQuery {
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { EntityGetter } from "./1__getters.js";
2
+ import { EntityGetter } from "./_getters.js";
3
3
  import { User } from "./1_user.js";
4
4
  /** A chat invite link. */
5
5
  export interface InviteLink {
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { EntityGetter } from "./1__getters.js";
2
+ import { EntityGetter } from "./_getters.js";
3
3
  import { ChatP } from "./1_chat_p.js";
4
4
  import { ReactionCount } from "./1_reaction_count.js";
5
5
  /** Information on the reactions made to a channel post. */
@@ -1,6 +1,6 @@
1
1
  import { types } from "../2_tl.js";
2
+ import { EntityGetter } from "./_getters.js";
2
3
  import { Reaction } from "./0_reaction.js";
3
- import { EntityGetter } from "./1__getters.js";
4
4
  import { ChatP } from "./1_chat_p.js";
5
5
  import { User } from "./1_user.js";
6
6
  /** The reactions of a user to a messages in a group. */
@@ -1,6 +1,6 @@
1
1
  import { UNREACHABLE } from "../1_utilities.js";
2
2
  import { as, types } from "../2_tl.js";
3
- import { FileType, serializeFileId, toUniqueFileId } from "./0__file_id.js";
3
+ import { FileType, serializeFileId, toUniqueFileId } from "./_file_id.js";
4
4
  import { constructPhoto } from "./1_photo.js";
5
5
  import { constructVideo } from "./1_video.js";
6
6
  export function constructStoryContent(media) {
@@ -1,9 +1,9 @@
1
1
  import { enums } from "../2_tl.js";
2
+ import { EntityGetter } from "./_getters.js";
2
3
  import { Location } from "./0_location.js";
3
4
  import { MessageReference } from "./0_message_reference.js";
4
5
  import { Reaction } from "./0_reaction.js";
5
- import { Venue } from "./0_venue.js";
6
- import { EntityGetter } from "./1__getters.js";
6
+ import { Venue } from "./1_venue.js";
7
7
  /** @unlisted */
8
8
  export interface StoryInteractiveAreaPosition {
9
9
  xPercentage: number;
@@ -2,7 +2,7 @@ import { UNREACHABLE } from "../1_utilities.js";
2
2
  import { chatIdToPeer, peerToChatId, types } from "../2_tl.js";
3
3
  import { constructLocation } from "./0_location.js";
4
4
  import { constructReaction, reactionToTlObject } from "./0_reaction.js";
5
- import { constructVenue } from "./0_venue.js";
5
+ import { constructVenue } from "./1_venue.js";
6
6
  function constructStoryInteractiveAreaPosition(position) {
7
7
  return {
8
8
  xPercentage: position.x,
@@ -1,5 +1,5 @@
1
1
  import { types } from "../2_tl.js";
2
- import { EntityGetter } from "./1__getters.js";
2
+ import { EntityGetter } from "./_getters.js";
3
3
  import { ChatP } from "./1_chat_p.js";
4
4
  import { User } from "./1_user.js";
5
5
  import { ChatMember } from "./2_chat_member.js";
@@ -1,5 +1,5 @@
1
1
  import { enums } from "../2_tl.js";
2
- import { UsernameResolver } from "./1__getters.js";
2
+ import { UsernameResolver } from "./_getters.js";
3
3
  import { KeyboardButton } from "./1_keyboard_button.js";
4
4
  import { InlineKeyboardButton } from "./2_inline_keyboard_button.js";
5
5
  /** @unlisted */
@@ -1,11 +1,11 @@
1
1
  import { types } from "../2_tl.js";
2
+ import { EntityGetter } from "./_getters.js";
2
3
  import { MessageEntity } from "./0_message_entity.js";
3
- import { EntityGetter } from "./1__getters.js";
4
4
  import { ChatP } from "./1_chat_p.js";
5
- import { StoryInteractiveArea } from "./1_story_interactive_area.js";
6
5
  import { StoryPrivacy } from "./1_story_privacy.js";
7
6
  import { StoryContent } from "./2_story_content.js";
8
7
  import { StoryInteractions } from "./2_story_interactions.js";
8
+ import { StoryInteractiveArea } from "./2_story_interactive_area.js";
9
9
  /** A story. */
10
10
  export interface Story {
11
11
  out: boolean;
@@ -1,10 +1,10 @@
1
1
  import { cleanObject, fromUnixTimestamp, UNREACHABLE } from "../1_utilities.js";
2
2
  import { constructMessageEntity } from "./0_message_entity.js";
3
3
  import { constructChatP } from "./1_chat_p.js";
4
- import { constructStoryInteractiveArea } from "./1_story_interactive_area.js";
5
4
  import { constructStoryPrivacy } from "./1_story_privacy.js";
6
5
  import { constructStoryContent } from "./2_story_content.js";
7
6
  import { constructStoryInteractions } from "./2_story_interactions.js";
7
+ import { constructStoryInteractiveArea } from "./2_story_interactive_area.js";
8
8
  export async function constructStory(story, peer, getEntity) {
9
9
  const id = story.id;
10
10
  const entity = await getEntity(peer);
@@ -1,7 +1,7 @@
1
1
  import { enums } from "../2_tl.js";
2
+ import { UsernameResolver } from "./_getters.js";
2
3
  import { MessageEntity } from "./0_message_entity.js";
3
4
  import { ParseMode } from "./0_parse_mode.js";
4
- import { UsernameResolver } from "./1__getters.js";
5
5
  import { InputMessageContent } from "./1_input_message_content.js";
6
6
  import { ReplyMarkupInlineKeyboard } from "./3_reply_markup.js";
7
7
  /** @unlisted */
@@ -1,6 +1,6 @@
1
1
  import { UNREACHABLE } from "../1_utilities.js";
2
2
  import { types } from "../2_tl.js";
3
- import { deserializeFileId } from "./0__file_id.js";
3
+ import { deserializeFileId } from "./_file_id.js";
4
4
  import { replyMarkupToTlObject } from "./3_reply_markup.js";
5
5
  // deno-lint-ignore no-explicit-any
6
6
  export async function inlineQueryResultToTlObject(result_, parseText, usernameResolver) {
@@ -1,13 +1,12 @@
1
1
  import { MaybePromise } from "../1_utilities.js";
2
2
  import { enums } from "../2_tl.js";
3
+ import { EntityGetter } from "./_getters.js";
3
4
  import { Contact } from "./0_contact.js";
4
5
  import { Dice } from "./0_dice.js";
5
6
  import { LinkPreview } from "./0_link_preview.js";
6
7
  import { Location } from "./0_location.js";
7
8
  import { MessageEntity } from "./0_message_entity.js";
8
- import { Venue } from "./0_venue.js";
9
9
  import { Voice } from "./0_voice.js";
10
- import { EntityGetter } from "./1__getters.js";
11
10
  import { Animation } from "./1_animation.js";
12
11
  import { Audio } from "./1_audio.js";
13
12
  import { ChatP } from "./1_chat_p.js";
@@ -19,6 +18,7 @@ import { Poll } from "./1_poll.js";
19
18
  import { ReplyQuote } from "./1_reply_quote.js";
20
19
  import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
21
20
  import { User } from "./1_user.js";
21
+ import { Venue } from "./1_venue.js";
22
22
  import { VideoNote } from "./1_video_note.js";
23
23
  import { Video } from "./1_video.js";
24
24
  import { Game } from "./2_game.js";
@@ -84,6 +84,9 @@ export interface _MessageBase {
84
84
  forwards?: number;
85
85
  /** The message's reply markup. */
86
86
  replyMarkup?: ReplyMarkup;
87
+ businessConnectionId?: string;
88
+ senderBoostCount?: number;
89
+ viaBusinessBot?: User;
87
90
  }
88
91
  /**
89
92
  * Properties shared between media message types.
@@ -464,5 +467,8 @@ export interface MessageGetter {
464
467
  (chatId: number, messageId: number): MaybePromise<Message | null>;
465
468
  }
466
469
  type Message_MessageGetter = MessageGetter | null;
467
- export declare function constructMessage(message_: enums.Message, getEntity: EntityGetter, getMessage: Message_MessageGetter, getStickerSetName: StickerSetNameGetter, getReply_?: boolean): Promise<Message>;
470
+ export declare function constructMessage(message_: enums.Message, getEntity: EntityGetter, getMessage: Message_MessageGetter, getStickerSetName: StickerSetNameGetter, getReply_?: boolean, business?: {
471
+ connectionId: string;
472
+ replyToMessage?: enums.Message;
473
+ }): Promise<Message>;
468
474
  export {};
@@ -1,13 +1,12 @@
1
1
  import { cleanObject, fromUnixTimestamp, getLogger, UNREACHABLE, ZERO_CHANNEL_ID } from "../1_utilities.js";
2
2
  import { as, types } from "../2_tl.js";
3
- import { FileType, toUniqueFileId } from "./0__file_id.js";
4
- import { serializeFileId } from "./0__file_id.js";
3
+ import { FileType, toUniqueFileId } from "./_file_id.js";
4
+ import { serializeFileId } from "./_file_id.js";
5
5
  import { constructContact } from "./0_contact.js";
6
6
  import { constructDice } from "./0_dice.js";
7
7
  import { constructLinkPreview } from "./0_link_preview.js";
8
8
  import { constructLocation } from "./0_location.js";
9
9
  import { constructMessageEntity } from "./0_message_entity.js";
10
- import { constructVenue } from "./0_venue.js";
11
10
  import { constructVoice } from "./0_voice.js";
12
11
  import { constructAnimation } from "./1_animation.js";
13
12
  import { constructAudio } from "./1_audio.js";
@@ -20,6 +19,7 @@ import { constructPoll } from "./1_poll.js";
20
19
  import { constructReplyQuote } from "./1_reply_quote.js";
21
20
  import { constructSticker } from "./1_sticker.js";
22
21
  import { constructUser } from "./1_user.js";
22
+ import { constructVenue } from "./1_venue.js";
23
23
  import { constructVideoNote } from "./1_video_note.js";
24
24
  import { constructVideo } from "./1_video.js";
25
25
  import { constructGame } from "./2_game.js";
@@ -249,7 +249,7 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
249
249
  }
250
250
  return { ...message, unsupported: true };
251
251
  }
252
- export async function constructMessage(message_, getEntity, getMessage, getStickerSetName, getReply_ = true) {
252
+ export async function constructMessage(message_, getEntity, getMessage, getStickerSetName, getReply_ = true, business) {
253
253
  if (!(message_ instanceof types.Message) && !(message_ instanceof types.MessageService)) {
254
254
  UNREACHABLE();
255
255
  }
@@ -299,6 +299,7 @@ export async function constructMessage(message_, getEntity, getMessage, getStick
299
299
  forwards: message_.forwards,
300
300
  isTopicMessage: false,
301
301
  hasProtectedContent: message_.noforwards || false,
302
+ senderBoostCount: message_.from_boosts_applied,
302
303
  };
303
304
  if (message_.reactions) {
304
305
  const recentReactions = message_.reactions.recent_reactions ?? [];
@@ -310,7 +311,14 @@ export async function constructMessage(message_, getEntity, getMessage, getStick
310
311
  }
311
312
  message.replyToMessageId = message_.reply_to.reply_to_msg_id;
312
313
  }
313
- if (getReply_) {
314
+ if (business) {
315
+ message.businessConnectionId = business.connectionId;
316
+ if (business.replyToMessage) {
317
+ message.replyToMessageId = business.replyToMessage.id;
318
+ message.replyToMessage = await constructMessage(business.replyToMessage, getEntity, getMessage, getStickerSetName, false, { connectionId: business.connectionId });
319
+ }
320
+ }
321
+ else if (getReply_) {
314
322
  Object.assign(message, await getReply(message_, chat_, getMessage));
315
323
  }
316
324
  Object.assign(message, await getSender(message_, getEntity));
@@ -326,6 +334,15 @@ export async function constructMessage(message_, getEntity, getMessage, getStick
326
334
  UNREACHABLE();
327
335
  }
328
336
  }
337
+ if (message_.via_business_bot_id != undefined) {
338
+ const viaBusinessBot = await getEntity(new types.PeerUser({ user_id: message_.via_business_bot_id }));
339
+ if (viaBusinessBot) {
340
+ message.viaBusinessBot = constructUser(viaBusinessBot);
341
+ }
342
+ else {
343
+ UNREACHABLE();
344
+ }
345
+ }
329
346
  if (message_.post_author != undefined) {
330
347
  message.authorSignature = message_.post_author;
331
348
  }
@@ -1,5 +1,5 @@
1
1
  import { enums, types } from "../2_tl.js";
2
- import { EntityGetter } from "./1__getters.js";
2
+ import { EntityGetter } from "./_getters.js";
3
3
  import { User } from "./1_user.js";
4
4
  import { Message, MessageGetter } from "./4_message.js";
5
5
  /** A received callback query. */
@@ -1,6 +1,6 @@
1
1
  import { enums, types } from "../2_tl.js";
2
+ import { EntityGetter } from "./_getters.js";
2
3
  import { ChatPhotoChat, ChatPhotoUser } from "./0_chat_photo.js";
3
- import { EntityGetter } from "./1__getters.js";
4
4
  import { ChatPChannel, ChatPGroup, ChatPPrivate, ChatPSupergroup } from "./1_chat_p.js";
5
5
  import { StickerSetNameGetter } from "./1_sticker.js";
6
6
  import { Message, MessageGetter } from "./4_message.js";
@@ -2,6 +2,7 @@ import { AuthorizationState } from "./0_authorization_state.js";
2
2
  import { ConnectionState } from "./0_connection_state.js";
3
3
  import { MessageReference } from "./0_message_reference.js";
4
4
  import { StoryReference } from "./0_story_reference.js";
5
+ import { BusinessConnection } from "./2_business_connection.js";
5
6
  import { ChosenInlineResult } from "./2_chosen_inline_result.js";
6
7
  import { InlineQuery } from "./2_inline_query.js";
7
8
  import { MessageInteractions } from "./2_message_interactions.js";
@@ -100,6 +101,7 @@ export interface UpdateEditedMessage {
100
101
  export interface UpdateDeletedMessages {
101
102
  /** The deleted messages. */
102
103
  deletedMessages: MessageReference[];
104
+ businessConnectionId?: string;
103
105
  }
104
106
  /**
105
107
  * A callback query was made (a user presses an inline button). Bot-only.
@@ -214,6 +216,13 @@ export interface UpdateDeletedStory {
214
216
  export interface UpdateNewStory {
215
217
  story: Story;
216
218
  }
219
+ /**
220
+ * A business connection was added, modified, or removed.
221
+ * @unlisted
222
+ */
223
+ export interface UpdateBusinessConnection {
224
+ businessConnection: BusinessConnection;
225
+ }
217
226
  /** @unlisted */
218
227
  export interface UpdateMap {
219
228
  message: UpdateNewMessage;
@@ -234,8 +243,9 @@ export interface UpdateMap {
234
243
  myChatMember: UpdateMyChatMember;
235
244
  deletedStory: UpdateDeletedStory;
236
245
  story: UpdateNewStory;
246
+ businessConnection: UpdateBusinessConnection;
237
247
  }
238
248
  /** @unlisted */
239
- export type UpdateIntersection<T> = T & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & UpdateEditedMessage & UpdateDeletedMessages & UpdateCallbackQuery & UpdateInlineQuery & UpdateChosenInlineResult & UpdateNewChat & UpdateEditedChat & UpdateDeletedChat & UpdateMessageInteractions & UpdateMessageReactionCount & UpdateMessageReactions & UpdateChatMember & UpdateMyChatMember & UpdateDeletedStory & UpdateNewStory>;
249
+ 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>;
240
250
  /** An incoming update. */
241
- export type Update = UpdateConnectionState | UpdateAuthorizationState | UpdateNewMessage | UpdateEditedMessage | UpdateDeletedMessages | UpdateCallbackQuery | UpdateInlineQuery | UpdateChosenInlineResult | UpdateNewChat | UpdateEditedChat | UpdateDeletedChat | UpdateMessageInteractions | UpdateMessageReactionCount | UpdateMessageReactions | UpdateChatMember | UpdateMyChatMember | UpdateDeletedStory | UpdateNewStory;
251
+ export type Update = UpdateConnectionState | UpdateAuthorizationState | UpdateNewMessage | UpdateEditedMessage | UpdateDeletedMessages | UpdateCallbackQuery | UpdateInlineQuery | UpdateChosenInlineResult | UpdateNewChat | UpdateEditedChat | UpdateDeletedChat | UpdateMessageInteractions | UpdateMessageReactionCount | UpdateMessageReactions | UpdateChatMember | UpdateMyChatMember | UpdateDeletedStory | UpdateNewStory | UpdateBusinessConnection;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtkruto/node",
3
- "version": "0.1.191",
3
+ "version": "0.1.200",
4
4
  "description": "MTKruto for Node.js",
5
5
  "author": "Roj <rojvv@icloud.com>",
6
6
  "repository": {
@@ -1,4 +1,3 @@
1
- export * from "./utilities/1_base64.js";
2
1
  export * from "./utilities/0_bigint.js";
3
2
  export * from "./utilities/0_buffer.js";
4
3
  export * from "./utilities/0_cache_map.js";
@@ -12,5 +11,6 @@ export * from "./utilities/0_object.js";
12
11
  export * from "./utilities/0_rle.js";
13
12
  export * from "./utilities/0_types.js";
14
13
  export * from "./utilities/1_auth.js";
14
+ export * from "./utilities/1_base64.js";
15
15
  export * from "./utilities/1_misc.js";
16
16
  export * from "./utilities/1_queue.js";
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./utilities/1_base64.js"), exports);
18
17
  __exportStar(require("./utilities/0_bigint.js"), exports);
19
18
  __exportStar(require("./utilities/0_buffer.js"), exports);
20
19
  __exportStar(require("./utilities/0_cache_map.js"), exports);
@@ -28,5 +27,6 @@ __exportStar(require("./utilities/0_object.js"), exports);
28
27
  __exportStar(require("./utilities/0_rle.js"), exports);
29
28
  __exportStar(require("./utilities/0_types.js"), exports);
30
29
  __exportStar(require("./utilities/1_auth.js"), exports);
30
+ __exportStar(require("./utilities/1_base64.js"), exports);
31
31
  __exportStar(require("./utilities/1_misc.js"), exports);
32
32
  __exportStar(require("./utilities/1_queue.js"), exports);
package/script/2_tl.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  export { TLError } from "./tl/0_tl_raw_reader.js";
2
2
  export * from "./tl/1_tl_object.js";
3
3
  export { type enums, types } from "./tl/2_types.js";
4
- export { functions } from "./tl/3_functions.js";
5
- export * from "./tl/3_tl_reader.js";
6
4
  export * from "./tl/3_utilities.js";
7
- export * from "./tl/4_tl_writer.js";
8
- export * from "./tl/4_rpc_result.js";
9
- export * from "./tl/6_message.js";
10
- export * from "./tl/7_message_container.js";
5
+ export { functions } from "./tl/3_functions.js";
6
+ export * from "./tl/4_tl_reader.js";
7
+ export * from "./tl/5_tl_writer.js";
8
+ export * from "./tl/6_rpc_result.js";
9
+ export * from "./tl/7_message.js";
10
+ export * from "./tl/8_message_container.js";
package/script/2_tl.js CHANGED
@@ -20,11 +20,11 @@ Object.defineProperty(exports, "TLError", { enumerable: true, get: function () {
20
20
  __exportStar(require("./tl/1_tl_object.js"), exports);
21
21
  var _2_types_js_1 = require("./tl/2_types.js");
22
22
  Object.defineProperty(exports, "types", { enumerable: true, get: function () { return _2_types_js_1.types; } });
23
+ __exportStar(require("./tl/3_utilities.js"), exports);
23
24
  var _3_functions_js_1 = require("./tl/3_functions.js");
24
25
  Object.defineProperty(exports, "functions", { enumerable: true, get: function () { return _3_functions_js_1.functions; } });
25
- __exportStar(require("./tl/3_tl_reader.js"), exports);
26
- __exportStar(require("./tl/3_utilities.js"), exports);
27
- __exportStar(require("./tl/4_tl_writer.js"), exports);
28
- __exportStar(require("./tl/4_rpc_result.js"), exports);
29
- __exportStar(require("./tl/6_message.js"), exports);
30
- __exportStar(require("./tl/7_message_container.js"), exports);
26
+ __exportStar(require("./tl/4_tl_reader.js"), exports);
27
+ __exportStar(require("./tl/5_tl_writer.js"), exports);
28
+ __exportStar(require("./tl/6_rpc_result.js"), exports);
29
+ __exportStar(require("./tl/7_message.js"), exports);
30
+ __exportStar(require("./tl/8_message_container.js"), exports);
@@ -1,6 +1,6 @@
1
1
  export * from "./storage/0_storage.js";
2
- export * from "./storage/0_utilities.js";
3
- export * from "./storage/1_storage_indexed_db.js";
4
- export * from "./storage/1_storage_local_storage.js";
5
- export * from "./storage/1_storage_memory.js";
6
- export * from "./storage/1_storage_session_storage.js";
2
+ export * from "./storage/1_utilities.js";
3
+ export * from "./storage/2_storage_indexed_db.js";
4
+ export * from "./storage/2_storage_local_storage.js";
5
+ export * from "./storage/2_storage_memory.js";
6
+ export * from "./storage/2_storage_session_storage.js";
@@ -15,8 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./storage/0_storage.js"), exports);
18
- __exportStar(require("./storage/0_utilities.js"), exports);
19
- __exportStar(require("./storage/1_storage_indexed_db.js"), exports);
20
- __exportStar(require("./storage/1_storage_local_storage.js"), exports);
21
- __exportStar(require("./storage/1_storage_memory.js"), exports);
22
- __exportStar(require("./storage/1_storage_session_storage.js"), exports);
18
+ __exportStar(require("./storage/1_utilities.js"), exports);
19
+ __exportStar(require("./storage/2_storage_indexed_db.js"), exports);
20
+ __exportStar(require("./storage/2_storage_local_storage.js"), exports);
21
+ __exportStar(require("./storage/2_storage_memory.js"), exports);
22
+ __exportStar(require("./storage/2_storage_session_storage.js"), exports);