rubjs 2.9.3 → 3.0.1

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 (833) hide show
  1. package/README.md +32 -25
  2. package/lib/clients/VoiceChatClient.d.ts +31 -0
  3. package/lib/clients/VoiceChatClient.js +147 -0
  4. package/lib/clients/index.d.ts +3 -0
  5. package/lib/clients/index.js +10 -0
  6. package/lib/clients/loginClient.d.ts +47 -0
  7. package/lib/clients/loginClient.js +108 -0
  8. package/lib/clients/network_login.d.ts +47 -0
  9. package/lib/clients/network_login.js +137 -0
  10. package/lib/core/client.d.ts +29 -0
  11. package/lib/core/client.js +65 -0
  12. package/lib/core/context/activities.type.d.ts +12 -0
  13. package/lib/core/context/activities.type.js +18 -0
  14. package/lib/core/context/chat.type.d.ts +14 -0
  15. package/lib/core/context/chat.type.js +20 -0
  16. package/lib/core/context/contextConstructors.d.ts +10 -0
  17. package/lib/core/context/contextConstructors.js +16 -0
  18. package/lib/core/context/index.d.ts +5 -0
  19. package/lib/core/context/index.js +14 -0
  20. package/lib/core/context/message.type.d.ts +26 -0
  21. package/lib/core/context/message.type.js +72 -0
  22. package/lib/core/context/notifications.type.d.ts +14 -0
  23. package/lib/core/context/notifications.type.js +20 -0
  24. package/lib/core/crypto.d.ts +12 -0
  25. package/lib/core/crypto.js +95 -0
  26. package/lib/core/filters.d.ts +33 -0
  27. package/lib/core/filters.js +153 -0
  28. package/lib/core/methods/advanced/builder.d.ts +3 -0
  29. package/lib/core/methods/advanced/builder.js +30 -0
  30. package/lib/core/methods/auth/logout.d.ts +3 -0
  31. package/lib/core/methods/auth/logout.js +6 -0
  32. package/lib/core/methods/auth/registerDevice.d.ts +3 -0
  33. package/lib/core/methods/auth/registerDevice.js +47 -0
  34. package/lib/core/methods/auth/sendCode.d.ts +3 -0
  35. package/lib/core/methods/auth/sendCode.js +16 -0
  36. package/lib/core/methods/auth/signIn.d.ts +3 -0
  37. package/lib/core/methods/auth/signIn.js +13 -0
  38. package/lib/core/methods/channels/addChannel.d.ts +3 -0
  39. package/lib/core/methods/channels/addChannel.js +15 -0
  40. package/lib/core/methods/channels/addChannelMembers.d.ts +3 -0
  41. package/lib/core/methods/channels/addChannelMembers.js +11 -0
  42. package/lib/core/methods/channels/banChannelMember.d.ts +3 -0
  43. package/lib/core/methods/channels/banChannelMember.js +14 -0
  44. package/lib/core/methods/channels/cancelChangeObjectOwner.d.ts +3 -0
  45. package/lib/core/methods/channels/cancelChangeObjectOwner.js +6 -0
  46. package/lib/core/methods/channels/channelPreviewByJoinLink.d.ts +3 -0
  47. package/lib/core/methods/channels/channelPreviewByJoinLink.js +8 -0
  48. package/lib/core/methods/channels/checkChannelUsername.d.ts +3 -0
  49. package/lib/core/methods/channels/checkChannelUsername.js +8 -0
  50. package/lib/core/methods/channels/createChannelVoiceChat.d.ts +3 -0
  51. package/lib/core/methods/channels/createChannelVoiceChat.js +6 -0
  52. package/lib/core/methods/channels/discardChannelVoiceChat.d.ts +3 -0
  53. package/lib/core/methods/channels/discardChannelVoiceChat.js +9 -0
  54. package/lib/core/methods/channels/editChannelInfo.d.ts +4 -0
  55. package/lib/core/methods/channels/editChannelInfo.js +39 -0
  56. package/lib/core/methods/channels/getBannedChannelMembers.d.ts +3 -0
  57. package/lib/core/methods/channels/getBannedChannelMembers.js +9 -0
  58. package/lib/core/methods/channels/getChannelAdminAccessList.d.ts +3 -0
  59. package/lib/core/methods/channels/getChannelAdminAccessList.js +9 -0
  60. package/lib/core/methods/channels/getChannelAdminMembers.d.ts +3 -0
  61. package/lib/core/methods/channels/getChannelAdminMembers.js +9 -0
  62. package/lib/core/methods/channels/getChannelAllMembers.d.ts +3 -0
  63. package/lib/core/methods/channels/getChannelAllMembers.js +10 -0
  64. package/lib/core/methods/channels/getChannelInfo.d.ts +3 -0
  65. package/lib/core/methods/channels/getChannelInfo.js +6 -0
  66. package/lib/core/methods/channels/getChannelLink.d.ts +3 -0
  67. package/lib/core/methods/channels/getChannelLink.js +6 -0
  68. package/lib/core/methods/channels/getPendingObjectOwner.d.ts +3 -0
  69. package/lib/core/methods/channels/getPendingObjectOwner.js +6 -0
  70. package/lib/core/methods/channels/joinChannelAction.d.ts +3 -0
  71. package/lib/core/methods/channels/joinChannelAction.js +10 -0
  72. package/lib/core/methods/channels/joinChannelByLink.d.ts +3 -0
  73. package/lib/core/methods/channels/joinChannelByLink.js +8 -0
  74. package/lib/core/methods/channels/leaveChannelVoiceChat.d.ts +3 -0
  75. package/lib/core/methods/channels/leaveChannelVoiceChat.js +9 -0
  76. package/lib/core/methods/channels/removeChannel.d.ts +3 -0
  77. package/lib/core/methods/channels/removeChannel.js +6 -0
  78. package/lib/core/methods/channels/requestChangeObjectOwner.d.ts +3 -0
  79. package/lib/core/methods/channels/requestChangeObjectOwner.js +9 -0
  80. package/lib/core/methods/channels/seenChannelMessages.d.ts +3 -0
  81. package/lib/core/methods/channels/seenChannelMessages.js +10 -0
  82. package/lib/core/methods/channels/setChannelLink.d.ts +3 -0
  83. package/lib/core/methods/channels/setChannelLink.js +6 -0
  84. package/lib/core/methods/channels/setChannelVoiceChatSetting.d.ts +3 -0
  85. package/lib/core/methods/channels/setChannelVoiceChatSetting.js +15 -0
  86. package/lib/core/methods/channels/updateChannelUsername.d.ts +3 -0
  87. package/lib/core/methods/channels/updateChannelUsername.js +9 -0
  88. package/lib/core/methods/chats/actionOnJoinRequest.d.ts +3 -0
  89. package/lib/core/methods/chats/actionOnJoinRequest.js +11 -0
  90. package/lib/core/methods/chats/addLiveComment.d.ts +3 -0
  91. package/lib/core/methods/chats/addLiveComment.js +6 -0
  92. package/lib/core/methods/chats/clickMessageUrl.d.ts +3 -0
  93. package/lib/core/methods/chats/clickMessageUrl.js +6 -0
  94. package/lib/core/methods/chats/createJoinLink.d.ts +3 -0
  95. package/lib/core/methods/chats/createJoinLink.js +12 -0
  96. package/lib/core/methods/chats/deleteAvatar.d.ts +3 -0
  97. package/lib/core/methods/chats/deleteAvatar.js +6 -0
  98. package/lib/core/methods/chats/deleteChatHistory.d.ts +3 -0
  99. package/lib/core/methods/chats/deleteChatHistory.js +9 -0
  100. package/lib/core/methods/chats/editJoinLink.d.ts +3 -0
  101. package/lib/core/methods/chats/editJoinLink.js +23 -0
  102. package/lib/core/methods/chats/getAbsObjects.d.ts +3 -0
  103. package/lib/core/methods/chats/getAbsObjects.js +8 -0
  104. package/lib/core/methods/chats/getAvatars.d.ts +3 -0
  105. package/lib/core/methods/chats/getAvatars.js +6 -0
  106. package/lib/core/methods/chats/getChatReaction.d.ts +3 -0
  107. package/lib/core/methods/chats/getChatReaction.js +6 -0
  108. package/lib/core/methods/chats/getChats.d.ts +3 -0
  109. package/lib/core/methods/chats/getChats.js +6 -0
  110. package/lib/core/methods/chats/getChatsUpdates.d.ts +3 -0
  111. package/lib/core/methods/chats/getChatsUpdates.js +6 -0
  112. package/lib/core/methods/chats/getJoinLinks.d.ts +3 -0
  113. package/lib/core/methods/chats/getJoinLinks.js +6 -0
  114. package/lib/core/methods/chats/getJoinRequests.d.ts +3 -0
  115. package/lib/core/methods/chats/getJoinRequests.js +6 -0
  116. package/lib/core/methods/chats/getLinkFromAppUrl.d.ts +3 -0
  117. package/lib/core/methods/chats/getLinkFromAppUrl.js +6 -0
  118. package/lib/core/methods/chats/getLiveComments.d.ts +3 -0
  119. package/lib/core/methods/chats/getLiveComments.js +6 -0
  120. package/lib/core/methods/chats/getLivePlayUrl.d.ts +3 -0
  121. package/lib/core/methods/chats/getLivePlayUrl.js +6 -0
  122. package/lib/core/methods/chats/getLiveStatus.d.ts +3 -0
  123. package/lib/core/methods/chats/getLiveStatus.js +6 -0
  124. package/lib/core/methods/chats/getObjectInfoByUsername.d.ts +3 -0
  125. package/lib/core/methods/chats/getObjectInfoByUsername.js +8 -0
  126. package/lib/core/methods/chats/getTopChatUsers.d.ts +3 -0
  127. package/lib/core/methods/chats/getTopChatUsers.js +7 -0
  128. package/lib/core/methods/chats/removeFromTopChatUsers.d.ts +3 -0
  129. package/lib/core/methods/chats/removeFromTopChatUsers.js +6 -0
  130. package/lib/core/methods/chats/removeJoinLink.d.ts +3 -0
  131. package/lib/core/methods/chats/removeJoinLink.js +8 -0
  132. package/lib/core/methods/chats/searchChatMessages.d.ts +3 -0
  133. package/lib/core/methods/chats/searchChatMessages.js +14 -0
  134. package/lib/core/methods/chats/searchGlobalMessages.d.ts +3 -0
  135. package/lib/core/methods/chats/searchGlobalMessages.js +6 -0
  136. package/lib/core/methods/chats/seenChats.d.ts +3 -0
  137. package/lib/core/methods/chats/seenChats.js +6 -0
  138. package/lib/core/methods/chats/sendChatActivity.d.ts +3 -0
  139. package/lib/core/methods/chats/sendChatActivity.js +10 -0
  140. package/lib/core/methods/chats/sendLive.d.ts +3 -0
  141. package/lib/core/methods/chats/sendLive.js +17 -0
  142. package/lib/core/methods/chats/setActionChat.d.ts +3 -0
  143. package/lib/core/methods/chats/setActionChat.js +10 -0
  144. package/lib/core/methods/chats/uploadAvatar.d.ts +3 -0
  145. package/lib/core/methods/chats/uploadAvatar.js +14 -0
  146. package/lib/core/methods/contacts/addAddressBook.d.ts +3 -0
  147. package/lib/core/methods/contacts/addAddressBook.js +6 -0
  148. package/lib/core/methods/contacts/deleteContact.d.ts +3 -0
  149. package/lib/core/methods/contacts/deleteContact.js +6 -0
  150. package/lib/core/methods/contacts/getContacts.d.ts +3 -0
  151. package/lib/core/methods/contacts/getContacts.js +6 -0
  152. package/lib/core/methods/contacts/getContactsLastOnline.d.ts +3 -0
  153. package/lib/core/methods/contacts/getContactsLastOnline.js +6 -0
  154. package/lib/core/methods/contacts/getContactsUpdates.d.ts +3 -0
  155. package/lib/core/methods/contacts/getContactsUpdates.js +6 -0
  156. package/lib/core/methods/contacts/resetContacts.d.ts +3 -0
  157. package/lib/core/methods/contacts/resetContacts.js +7 -0
  158. package/lib/core/methods/extras/banMember.d.ts +3 -0
  159. package/lib/core/methods/extras/banMember.js +9 -0
  160. package/lib/core/methods/extras/deleteMessagebyCount.d.ts +3 -0
  161. package/lib/core/methods/extras/deleteMessagebyCount.js +19 -0
  162. package/lib/core/methods/extras/getInfo.d.ts +3 -0
  163. package/lib/core/methods/extras/getInfo.js +15 -0
  164. package/lib/core/methods/extras/getObjectByUsername.d.ts +3 -0
  165. package/lib/core/methods/extras/getObjectByUsername.js +8 -0
  166. package/lib/core/methods/extras/getProfileLinkItems.d.ts +3 -0
  167. package/lib/core/methods/extras/getProfileLinkItems.js +6 -0
  168. package/lib/core/methods/extras/getRelatedObjects.d.ts +3 -0
  169. package/lib/core/methods/extras/getRelatedObjects.js +6 -0
  170. package/lib/core/methods/extras/getTranscription.d.ts +3 -0
  171. package/lib/core/methods/extras/getTranscription.js +9 -0
  172. package/lib/core/methods/extras/join.d.ts +3 -0
  173. package/lib/core/methods/extras/join.js +11 -0
  174. package/lib/core/methods/extras/joinVoiceChat.d.ts +3 -0
  175. package/lib/core/methods/extras/joinVoiceChat.js +11 -0
  176. package/lib/core/methods/extras/leaveChat.d.ts +3 -0
  177. package/lib/core/methods/extras/leaveChat.js +9 -0
  178. package/lib/core/methods/extras/onEditMessages.d.ts +4 -0
  179. package/lib/core/methods/extras/onEditMessages.js +32 -0
  180. package/lib/core/methods/extras/reportObject.d.ts +14 -0
  181. package/lib/core/methods/extras/reportObject.js +21 -0
  182. package/lib/core/methods/extras/searchGlobalObjects.d.ts +3 -0
  183. package/lib/core/methods/extras/searchGlobalObjects.js +6 -0
  184. package/lib/core/methods/extras/sendVoiceChatActivity.d.ts +3 -0
  185. package/lib/core/methods/extras/sendVoiceChatActivity.js +13 -0
  186. package/lib/core/methods/extras/setVoiceChatState.d.ts +3 -0
  187. package/lib/core/methods/extras/setVoiceChatState.js +14 -0
  188. package/lib/core/methods/extras/transcribeVoice.d.ts +3 -0
  189. package/lib/core/methods/extras/transcribeVoice.js +6 -0
  190. package/lib/core/methods/extras/userIsAdmin.d.ts +3 -0
  191. package/lib/core/methods/extras/userIsAdmin.js +18 -0
  192. package/lib/core/methods/gif/addToMyGifSet.d.ts +3 -0
  193. package/lib/core/methods/gif/addToMyGifSet.js +6 -0
  194. package/lib/core/methods/gif/getMyGifSet.d.ts +3 -0
  195. package/lib/core/methods/gif/getMyGifSet.js +6 -0
  196. package/lib/core/methods/gif/removeFromMyGifSet.d.ts +3 -0
  197. package/lib/core/methods/gif/removeFromMyGifSet.js +6 -0
  198. package/lib/core/methods/groups/addGroup.d.ts +3 -0
  199. package/lib/core/methods/groups/addGroup.js +8 -0
  200. package/lib/core/methods/groups/addGroupMembers.d.ts +3 -0
  201. package/lib/core/methods/groups/addGroupMembers.js +8 -0
  202. package/lib/core/methods/groups/banGroupMember.d.ts +3 -0
  203. package/lib/core/methods/groups/banGroupMember.js +14 -0
  204. package/lib/core/methods/groups/createGroupVoiceChat.d.ts +3 -0
  205. package/lib/core/methods/groups/createGroupVoiceChat.js +6 -0
  206. package/lib/core/methods/groups/deleteNoAccessGroupChat.d.ts +3 -0
  207. package/lib/core/methods/groups/deleteNoAccessGroupChat.js +6 -0
  208. package/lib/core/methods/groups/discardGroupVoiceChat.d.ts +3 -0
  209. package/lib/core/methods/groups/discardGroupVoiceChat.js +9 -0
  210. package/lib/core/methods/groups/editGroupInfo.d.ts +6 -0
  211. package/lib/core/methods/groups/editGroupInfo.js +41 -0
  212. package/lib/core/methods/groups/getBannedGroupMembers.d.ts +3 -0
  213. package/lib/core/methods/groups/getBannedGroupMembers.js +6 -0
  214. package/lib/core/methods/groups/getGroupAdminAccessList.d.ts +3 -0
  215. package/lib/core/methods/groups/getGroupAdminAccessList.js +9 -0
  216. package/lib/core/methods/groups/getGroupAdminMembers.d.ts +3 -0
  217. package/lib/core/methods/groups/getGroupAdminMembers.js +6 -0
  218. package/lib/core/methods/groups/getGroupAllMembers.d.ts +3 -0
  219. package/lib/core/methods/groups/getGroupAllMembers.js +10 -0
  220. package/lib/core/methods/groups/getGroupDefaultAccess.d.ts +3 -0
  221. package/lib/core/methods/groups/getGroupDefaultAccess.js +6 -0
  222. package/lib/core/methods/groups/getGroupInfo.d.ts +3 -0
  223. package/lib/core/methods/groups/getGroupInfo.js +6 -0
  224. package/lib/core/methods/groups/getGroupLink.d.ts +3 -0
  225. package/lib/core/methods/groups/getGroupLink.js +6 -0
  226. package/lib/core/methods/groups/getGroupMentionList.d.ts +3 -0
  227. package/lib/core/methods/groups/getGroupMentionList.js +9 -0
  228. package/lib/core/methods/groups/getGroupOnlineCount.d.ts +3 -0
  229. package/lib/core/methods/groups/getGroupOnlineCount.js +6 -0
  230. package/lib/core/methods/groups/getGroupVoiceChatParticipants.d.ts +3 -0
  231. package/lib/core/methods/groups/getGroupVoiceChatParticipants.js +7 -0
  232. package/lib/core/methods/groups/getGroupVoiceChatUpdates.d.ts +3 -0
  233. package/lib/core/methods/groups/getGroupVoiceChatUpdates.js +10 -0
  234. package/lib/core/methods/groups/groupPreviewByJoinLink.d.ts +3 -0
  235. package/lib/core/methods/groups/groupPreviewByJoinLink.js +8 -0
  236. package/lib/core/methods/groups/joinGroup.d.ts +3 -0
  237. package/lib/core/methods/groups/joinGroup.js +8 -0
  238. package/lib/core/methods/groups/joinGroupVoiceChat.d.ts +3 -0
  239. package/lib/core/methods/groups/joinGroupVoiceChat.js +11 -0
  240. package/lib/core/methods/groups/leaveGroup.d.ts +3 -0
  241. package/lib/core/methods/groups/leaveGroup.js +6 -0
  242. package/lib/core/methods/groups/leaveGroupVoiceChat.d.ts +3 -0
  243. package/lib/core/methods/groups/leaveGroupVoiceChat.js +9 -0
  244. package/lib/core/methods/groups/removeGroup.d.ts +3 -0
  245. package/lib/core/methods/groups/removeGroup.js +6 -0
  246. package/lib/core/methods/groups/seenGroupMessages.d.ts +3 -0
  247. package/lib/core/methods/groups/seenGroupMessages.js +10 -0
  248. package/lib/core/methods/groups/setGroupAdmin.d.ts +5 -0
  249. package/lib/core/methods/groups/setGroupAdmin.js +17 -0
  250. package/lib/core/methods/groups/setGroupDefaultAccess.d.ts +4 -0
  251. package/lib/core/methods/groups/setGroupDefaultAccess.js +11 -0
  252. package/lib/core/methods/groups/setGroupLink.d.ts +3 -0
  253. package/lib/core/methods/groups/setGroupLink.js +6 -0
  254. package/lib/core/methods/groups/setGroupVoiceChatSetting.d.ts +3 -0
  255. package/lib/core/methods/groups/setGroupVoiceChatSetting.js +15 -0
  256. package/lib/core/methods/index.d.ts +189 -0
  257. package/lib/core/methods/index.js +589 -0
  258. package/lib/core/methods/messages/actionOnMessageReaction.d.ts +3 -0
  259. package/lib/core/methods/messages/actionOnMessageReaction.js +14 -0
  260. package/lib/core/methods/messages/createPoll.d.ts +3 -0
  261. package/lib/core/methods/messages/createPoll.js +26 -0
  262. package/lib/core/methods/messages/deleteMessages.d.ts +3 -0
  263. package/lib/core/methods/messages/deleteMessages.js +17 -0
  264. package/lib/core/methods/messages/editMessage.d.ts +3 -0
  265. package/lib/core/methods/messages/editMessage.js +15 -0
  266. package/lib/core/methods/messages/forwardMessages.d.ts +3 -0
  267. package/lib/core/methods/messages/forwardMessages.js +22 -0
  268. package/lib/core/methods/messages/getMessageShareUrl.d.ts +3 -0
  269. package/lib/core/methods/messages/getMessageShareUrl.js +6 -0
  270. package/lib/core/methods/messages/getMessages.d.ts +3 -0
  271. package/lib/core/methods/messages/getMessages.js +12 -0
  272. package/lib/core/methods/messages/getMessagesByID.d.ts +3 -0
  273. package/lib/core/methods/messages/getMessagesByID.js +11 -0
  274. package/lib/core/methods/messages/getMessagesInterval.d.ts +3 -0
  275. package/lib/core/methods/messages/getMessagesInterval.js +9 -0
  276. package/lib/core/methods/messages/getMessagesUpdates.d.ts +3 -0
  277. package/lib/core/methods/messages/getMessagesUpdates.js +6 -0
  278. package/lib/core/methods/messages/getPollOptionVoters.d.ts +3 -0
  279. package/lib/core/methods/messages/getPollOptionVoters.js +10 -0
  280. package/lib/core/methods/messages/getPollStatus.d.ts +3 -0
  281. package/lib/core/methods/messages/getPollStatus.js +6 -0
  282. package/lib/core/methods/messages/index.d.ts +26 -0
  283. package/lib/core/methods/messages/index.js +56 -0
  284. package/lib/core/methods/messages/sendDocument.d.ts +3 -0
  285. package/lib/core/methods/messages/sendDocument.js +6 -0
  286. package/lib/core/methods/messages/sendFileInline.d.ts +18 -0
  287. package/lib/core/methods/messages/sendFileInline.js +24 -0
  288. package/lib/core/methods/messages/sendGif.d.ts +3 -0
  289. package/lib/core/methods/messages/sendGif.js +6 -0
  290. package/lib/core/methods/messages/sendMessage.d.ts +3 -0
  291. package/lib/core/methods/messages/sendMessage.js +139 -0
  292. package/lib/core/methods/messages/sendMusic.d.ts +3 -0
  293. package/lib/core/methods/messages/sendMusic.js +6 -0
  294. package/lib/core/methods/messages/sendPhoto.d.ts +3 -0
  295. package/lib/core/methods/messages/sendPhoto.js +6 -0
  296. package/lib/core/methods/messages/sendSticker.d.ts +3 -0
  297. package/lib/core/methods/messages/sendSticker.js +6 -0
  298. package/lib/core/methods/messages/sendText.d.ts +3 -0
  299. package/lib/core/methods/messages/sendText.js +6 -0
  300. package/lib/core/methods/messages/sendVideo.d.ts +3 -0
  301. package/lib/core/methods/messages/sendVideo.js +6 -0
  302. package/lib/core/methods/messages/sendVideoMessage.d.ts +3 -0
  303. package/lib/core/methods/messages/sendVideoMessage.js +6 -0
  304. package/lib/core/methods/messages/sendVoice.d.ts +3 -0
  305. package/lib/core/methods/messages/sendVoice.js +6 -0
  306. package/lib/core/methods/messages/setPinMessage.d.ts +3 -0
  307. package/lib/core/methods/messages/setPinMessage.js +14 -0
  308. package/lib/core/methods/messages/votePoll.d.ts +3 -0
  309. package/lib/core/methods/messages/votePoll.js +6 -0
  310. package/lib/core/methods/settings/changePassword.d.ts +3 -0
  311. package/lib/core/methods/settings/changePassword.js +6 -0
  312. package/lib/core/methods/settings/checkTwoStepPasscode.d.ts +3 -0
  313. package/lib/core/methods/settings/checkTwoStepPasscode.js +6 -0
  314. package/lib/core/methods/settings/deleteFolder.d.ts +3 -0
  315. package/lib/core/methods/settings/deleteFolder.js +6 -0
  316. package/lib/core/methods/settings/getBlockedUsers.d.ts +3 -0
  317. package/lib/core/methods/settings/getBlockedUsers.js +6 -0
  318. package/lib/core/methods/settings/getFolders.d.ts +3 -0
  319. package/lib/core/methods/settings/getFolders.js +6 -0
  320. package/lib/core/methods/settings/getMySessions.d.ts +3 -0
  321. package/lib/core/methods/settings/getMySessions.js +6 -0
  322. package/lib/core/methods/settings/getPrivacySetting.d.ts +3 -0
  323. package/lib/core/methods/settings/getPrivacySetting.js +6 -0
  324. package/lib/core/methods/settings/getSuggestedFolders.d.ts +3 -0
  325. package/lib/core/methods/settings/getSuggestedFolders.js +6 -0
  326. package/lib/core/methods/settings/getTwoPasscodeStatus.d.ts +3 -0
  327. package/lib/core/methods/settings/getTwoPasscodeStatus.js +6 -0
  328. package/lib/core/methods/settings/requestRecoveryEmail.d.ts +3 -0
  329. package/lib/core/methods/settings/requestRecoveryEmail.js +9 -0
  330. package/lib/core/methods/settings/setSetting.d.ts +5 -0
  331. package/lib/core/methods/settings/setSetting.js +51 -0
  332. package/lib/core/methods/settings/setupTwoStepVerification.d.ts +3 -0
  333. package/lib/core/methods/settings/setupTwoStepVerification.js +10 -0
  334. package/lib/core/methods/settings/terminateOtherSessions.d.ts +3 -0
  335. package/lib/core/methods/settings/terminateOtherSessions.js +7 -0
  336. package/lib/core/methods/settings/terminateSession.d.ts +3 -0
  337. package/lib/core/methods/settings/terminateSession.js +6 -0
  338. package/lib/core/methods/settings/turnOffTwoStep.d.ts +3 -0
  339. package/lib/core/methods/settings/turnOffTwoStep.js +7 -0
  340. package/lib/core/methods/settings/updateProfile.d.ts +3 -0
  341. package/lib/core/methods/settings/updateProfile.js +21 -0
  342. package/lib/core/methods/settings/updateUsername.d.ts +3 -0
  343. package/lib/core/methods/settings/updateUsername.js +6 -0
  344. package/lib/core/methods/settings/verifyRecoveryEmail.d.ts +3 -0
  345. package/lib/core/methods/settings/verifyRecoveryEmail.js +6 -0
  346. package/lib/core/methods/stickers/actionOnStickerSet.d.ts +3 -0
  347. package/lib/core/methods/stickers/actionOnStickerSet.js +10 -0
  348. package/lib/core/methods/stickers/getMyStickerSets.d.ts +3 -0
  349. package/lib/core/methods/stickers/getMyStickerSets.js +6 -0
  350. package/lib/core/methods/stickers/getStickerSetByID.d.ts +3 -0
  351. package/lib/core/methods/stickers/getStickerSetByID.js +6 -0
  352. package/lib/core/methods/stickers/getStickersByEmoji.d.ts +3 -0
  353. package/lib/core/methods/stickers/getStickersByEmoji.js +6 -0
  354. package/lib/core/methods/stickers/getStickersBySetIds.d.ts +3 -0
  355. package/lib/core/methods/stickers/getStickersBySetIds.js +8 -0
  356. package/lib/core/methods/stickers/getTrendStickerSets.d.ts +3 -0
  357. package/lib/core/methods/stickers/getTrendStickerSets.js +6 -0
  358. package/lib/core/methods/stickers/searchStickers.d.ts +3 -0
  359. package/lib/core/methods/stickers/searchStickers.js +6 -0
  360. package/lib/core/methods/users/checkUserUsername.d.ts +3 -0
  361. package/lib/core/methods/users/checkUserUsername.js +6 -0
  362. package/lib/core/methods/users/deleteUserChat.d.ts +3 -0
  363. package/lib/core/methods/users/deleteUserChat.js +9 -0
  364. package/lib/core/methods/users/getMe.d.ts +3 -0
  365. package/lib/core/methods/users/getMe.js +6 -0
  366. package/lib/core/methods/users/getUserInfo.d.ts +3 -0
  367. package/lib/core/methods/users/getUserInfo.js +7 -0
  368. package/lib/core/methods/users/setBlockUser.d.ts +3 -0
  369. package/lib/core/methods/users/setBlockUser.js +9 -0
  370. package/lib/core/methods/utilities/download.d.ts +4 -0
  371. package/lib/core/methods/utilities/download.js +6 -0
  372. package/lib/core/methods/utilities/downloadProfilePicture.d.ts +4 -0
  373. package/lib/core/methods/utilities/downloadProfilePicture.js +28 -0
  374. package/lib/core/methods/utilities/index.d.ts +8 -0
  375. package/lib/core/methods/utilities/index.js +20 -0
  376. package/lib/core/methods/utilities/requestSendFile.d.ts +3 -0
  377. package/lib/core/methods/utilities/requestSendFile.js +11 -0
  378. package/lib/core/methods/utilities/run.d.ts +3 -0
  379. package/lib/core/methods/utilities/run.js +9 -0
  380. package/lib/core/methods/utilities/start.d.ts +3 -0
  381. package/lib/core/methods/utilities/start.js +71 -0
  382. package/lib/core/methods/utilities/thumbnail.js +70 -0
  383. package/lib/core/methods/utilities/usePlugin.d.ts +4 -0
  384. package/lib/core/methods/utilities/usePlugin.js +25 -0
  385. package/lib/core/network/api.d.ts +16 -0
  386. package/lib/core/network/api.js +95 -0
  387. package/lib/core/network/file.d.ts +3 -0
  388. package/lib/core/network/file.js +117 -0
  389. package/lib/core/network/index.d.ts +25 -0
  390. package/lib/core/network/index.js +31 -0
  391. package/lib/core/network/utils.d.ts +9 -0
  392. package/lib/core/network/utils.js +34 -0
  393. package/lib/core/network/websocket.d.ts +3 -0
  394. package/lib/core/network/websocket.js +190 -0
  395. package/lib/core/session.d.ts +12 -0
  396. package/lib/core/session.js +65 -0
  397. package/lib/index.d.ts +11 -0
  398. package/lib/index.js +48 -0
  399. package/lib/types/client.type.d.ts +31 -0
  400. package/lib/types/decorators.type.d.ts +173 -0
  401. package/lib/types/index.type.d.ts +5 -0
  402. package/lib/types/index.type.js +44 -0
  403. package/lib/types/network.type.d.ts +7 -0
  404. package/lib/types/session.type.d.ts +7 -0
  405. package/lib/utils/prompt.d.ts +1 -0
  406. package/lib/utils/prompt.js +17 -0
  407. package/package.json +45 -43
  408. package/rubjs/client.d.ts +0 -41
  409. package/rubjs/client.js +0 -40
  410. package/rubjs/clients/VoiceChatClient.d.ts +0 -30
  411. package/rubjs/clients/VoiceChatClient.js +0 -183
  412. package/rubjs/clients/index.d.ts +0 -4
  413. package/rubjs/clients/index.js +0 -12
  414. package/rubjs/clients/loginClient.d.ts +0 -47
  415. package/rubjs/clients/loginClient.js +0 -122
  416. package/rubjs/clients/sendLiveClient.d.ts +0 -25
  417. package/rubjs/clients/sendLiveClient.js +0 -146
  418. package/rubjs/crypto/index.d.ts +0 -12
  419. package/rubjs/crypto/index.js +0 -95
  420. package/rubjs/index.d.ts +0 -7
  421. package/rubjs/index.js +0 -53
  422. package/rubjs/methods/advanced/builder.d.ts +0 -3
  423. package/rubjs/methods/advanced/builder.js +0 -41
  424. package/rubjs/methods/auth/logout.d.ts +0 -3
  425. package/rubjs/methods/auth/logout.js +0 -17
  426. package/rubjs/methods/auth/registerDevice.d.ts +0 -3
  427. package/rubjs/methods/auth/registerDevice.js +0 -61
  428. package/rubjs/methods/auth/sendCode.d.ts +0 -3
  429. package/rubjs/methods/auth/sendCode.js +0 -27
  430. package/rubjs/methods/auth/signIn.d.ts +0 -3
  431. package/rubjs/methods/auth/signIn.js +0 -24
  432. package/rubjs/methods/channels/addChannel.d.ts +0 -3
  433. package/rubjs/methods/channels/addChannel.js +0 -26
  434. package/rubjs/methods/channels/addChannelMembers.d.ts +0 -3
  435. package/rubjs/methods/channels/addChannelMembers.js +0 -22
  436. package/rubjs/methods/channels/banChannelMember.d.ts +0 -3
  437. package/rubjs/methods/channels/banChannelMember.js +0 -25
  438. package/rubjs/methods/channels/cancelChangeObjectOwner.d.ts +0 -3
  439. package/rubjs/methods/channels/cancelChangeObjectOwner.js +0 -17
  440. package/rubjs/methods/channels/channelPreviewByJoinLink.d.ts +0 -3
  441. package/rubjs/methods/channels/channelPreviewByJoinLink.js +0 -19
  442. package/rubjs/methods/channels/checkChannelUsername.d.ts +0 -3
  443. package/rubjs/methods/channels/checkChannelUsername.js +0 -19
  444. package/rubjs/methods/channels/createChannelVoiceChat.d.ts +0 -3
  445. package/rubjs/methods/channels/createChannelVoiceChat.js +0 -17
  446. package/rubjs/methods/channels/discardChannelVoiceChat.d.ts +0 -3
  447. package/rubjs/methods/channels/discardChannelVoiceChat.js +0 -20
  448. package/rubjs/methods/channels/editChannelInfo.d.ts +0 -4
  449. package/rubjs/methods/channels/editChannelInfo.js +0 -50
  450. package/rubjs/methods/channels/getBannedChannelMembers.d.ts +0 -3
  451. package/rubjs/methods/channels/getBannedChannelMembers.js +0 -20
  452. package/rubjs/methods/channels/getChannelAdminAccessList.d.ts +0 -3
  453. package/rubjs/methods/channels/getChannelAdminAccessList.js +0 -20
  454. package/rubjs/methods/channels/getChannelAdminMembers.d.ts +0 -3
  455. package/rubjs/methods/channels/getChannelAdminMembers.js +0 -20
  456. package/rubjs/methods/channels/getChannelAllMembers.d.ts +0 -3
  457. package/rubjs/methods/channels/getChannelAllMembers.js +0 -21
  458. package/rubjs/methods/channels/getChannelInfo.d.ts +0 -3
  459. package/rubjs/methods/channels/getChannelInfo.js +0 -17
  460. package/rubjs/methods/channels/getChannelLink.d.ts +0 -3
  461. package/rubjs/methods/channels/getChannelLink.js +0 -17
  462. package/rubjs/methods/channels/getPendingObjectOwner.d.ts +0 -3
  463. package/rubjs/methods/channels/getPendingObjectOwner.js +0 -17
  464. package/rubjs/methods/channels/joinChannelAction.d.ts +0 -3
  465. package/rubjs/methods/channels/joinChannelAction.js +0 -21
  466. package/rubjs/methods/channels/joinChannelByLink.d.ts +0 -3
  467. package/rubjs/methods/channels/joinChannelByLink.js +0 -19
  468. package/rubjs/methods/channels/leaveChannelVoiceChat.d.ts +0 -3
  469. package/rubjs/methods/channels/leaveChannelVoiceChat.js +0 -20
  470. package/rubjs/methods/channels/removeChannel.d.ts +0 -3
  471. package/rubjs/methods/channels/removeChannel.js +0 -17
  472. package/rubjs/methods/channels/requestChangeObjectOwner.d.ts +0 -3
  473. package/rubjs/methods/channels/requestChangeObjectOwner.js +0 -20
  474. package/rubjs/methods/channels/seenChannelMessages.d.ts +0 -3
  475. package/rubjs/methods/channels/seenChannelMessages.js +0 -21
  476. package/rubjs/methods/channels/setChannelLink.d.ts +0 -3
  477. package/rubjs/methods/channels/setChannelLink.js +0 -17
  478. package/rubjs/methods/channels/setChannelVoiceChatSetting.d.ts +0 -3
  479. package/rubjs/methods/channels/setChannelVoiceChatSetting.js +0 -26
  480. package/rubjs/methods/channels/updateChannelUsername.d.ts +0 -3
  481. package/rubjs/methods/channels/updateChannelUsername.js +0 -20
  482. package/rubjs/methods/chats/actionOnJoinRequest.d.ts +0 -3
  483. package/rubjs/methods/chats/actionOnJoinRequest.js +0 -22
  484. package/rubjs/methods/chats/addLiveComment.d.ts +0 -3
  485. package/rubjs/methods/chats/addLiveComment.js +0 -17
  486. package/rubjs/methods/chats/clickMessageUrl.d.ts +0 -3
  487. package/rubjs/methods/chats/clickMessageUrl.js +0 -17
  488. package/rubjs/methods/chats/createJoinLink.d.ts +0 -3
  489. package/rubjs/methods/chats/createJoinLink.js +0 -23
  490. package/rubjs/methods/chats/deleteAvatar.d.ts +0 -3
  491. package/rubjs/methods/chats/deleteAvatar.js +0 -17
  492. package/rubjs/methods/chats/deleteChatHistory.d.ts +0 -3
  493. package/rubjs/methods/chats/deleteChatHistory.js +0 -20
  494. package/rubjs/methods/chats/editJoinLink.d.ts +0 -3
  495. package/rubjs/methods/chats/editJoinLink.js +0 -34
  496. package/rubjs/methods/chats/getAbsObjects.d.ts +0 -3
  497. package/rubjs/methods/chats/getAbsObjects.js +0 -19
  498. package/rubjs/methods/chats/getAvatars.d.ts +0 -3
  499. package/rubjs/methods/chats/getAvatars.js +0 -17
  500. package/rubjs/methods/chats/getChatReaction.d.ts +0 -3
  501. package/rubjs/methods/chats/getChatReaction.js +0 -17
  502. package/rubjs/methods/chats/getChats.d.ts +0 -3
  503. package/rubjs/methods/chats/getChats.js +0 -17
  504. package/rubjs/methods/chats/getChatsUpdates.d.ts +0 -3
  505. package/rubjs/methods/chats/getChatsUpdates.js +0 -17
  506. package/rubjs/methods/chats/getJoinLinks.d.ts +0 -3
  507. package/rubjs/methods/chats/getJoinLinks.js +0 -17
  508. package/rubjs/methods/chats/getJoinRequests.d.ts +0 -3
  509. package/rubjs/methods/chats/getJoinRequests.js +0 -17
  510. package/rubjs/methods/chats/getLinkFromAppUrl.d.ts +0 -3
  511. package/rubjs/methods/chats/getLinkFromAppUrl.js +0 -17
  512. package/rubjs/methods/chats/getLiveComments.d.ts +0 -3
  513. package/rubjs/methods/chats/getLiveComments.js +0 -17
  514. package/rubjs/methods/chats/getLivePlayUrl.d.ts +0 -3
  515. package/rubjs/methods/chats/getLivePlayUrl.js +0 -17
  516. package/rubjs/methods/chats/getLiveStatus.d.ts +0 -3
  517. package/rubjs/methods/chats/getLiveStatus.js +0 -17
  518. package/rubjs/methods/chats/getObjectInfoByUsername.d.ts +0 -3
  519. package/rubjs/methods/chats/getObjectInfoByUsername.js +0 -19
  520. package/rubjs/methods/chats/getTopChatUsers.d.ts +0 -3
  521. package/rubjs/methods/chats/getTopChatUsers.js +0 -18
  522. package/rubjs/methods/chats/removeFromTopChatUsers.d.ts +0 -3
  523. package/rubjs/methods/chats/removeFromTopChatUsers.js +0 -17
  524. package/rubjs/methods/chats/removeJoinLink.d.ts +0 -3
  525. package/rubjs/methods/chats/removeJoinLink.js +0 -19
  526. package/rubjs/methods/chats/searchChatMessages.d.ts +0 -3
  527. package/rubjs/methods/chats/searchChatMessages.js +0 -25
  528. package/rubjs/methods/chats/searchGlobalMessages.d.ts +0 -3
  529. package/rubjs/methods/chats/searchGlobalMessages.js +0 -17
  530. package/rubjs/methods/chats/seenChats.d.ts +0 -3
  531. package/rubjs/methods/chats/seenChats.js +0 -17
  532. package/rubjs/methods/chats/sendChatActivity.d.ts +0 -3
  533. package/rubjs/methods/chats/sendChatActivity.js +0 -21
  534. package/rubjs/methods/chats/sendLive.d.ts +0 -3
  535. package/rubjs/methods/chats/sendLive.js +0 -28
  536. package/rubjs/methods/chats/setActionChat.d.ts +0 -3
  537. package/rubjs/methods/chats/setActionChat.js +0 -21
  538. package/rubjs/methods/chats/uploadAvatar.d.ts +0 -3
  539. package/rubjs/methods/chats/uploadAvatar.js +0 -29
  540. package/rubjs/methods/contacts/addAddressBook.d.ts +0 -3
  541. package/rubjs/methods/contacts/addAddressBook.js +0 -17
  542. package/rubjs/methods/contacts/deleteContact.d.ts +0 -3
  543. package/rubjs/methods/contacts/deleteContact.js +0 -17
  544. package/rubjs/methods/contacts/getContacts.d.ts +0 -3
  545. package/rubjs/methods/contacts/getContacts.js +0 -17
  546. package/rubjs/methods/contacts/getContactsLastOnline.d.ts +0 -3
  547. package/rubjs/methods/contacts/getContactsLastOnline.js +0 -17
  548. package/rubjs/methods/contacts/getContactsUpdates.d.ts +0 -3
  549. package/rubjs/methods/contacts/getContactsUpdates.js +0 -17
  550. package/rubjs/methods/contacts/resetContacts.d.ts +0 -3
  551. package/rubjs/methods/contacts/resetContacts.js +0 -18
  552. package/rubjs/methods/extras/banMember.d.ts +0 -3
  553. package/rubjs/methods/extras/banMember.js +0 -20
  554. package/rubjs/methods/extras/deleteMessagebyCount.d.ts +0 -3
  555. package/rubjs/methods/extras/deleteMessagebyCount.js +0 -30
  556. package/rubjs/methods/extras/getInfo.d.ts +0 -3
  557. package/rubjs/methods/extras/getInfo.js +0 -26
  558. package/rubjs/methods/extras/getObjectByUsername.d.ts +0 -3
  559. package/rubjs/methods/extras/getObjectByUsername.js +0 -19
  560. package/rubjs/methods/extras/getProfileLinkItems.d.ts +0 -3
  561. package/rubjs/methods/extras/getProfileLinkItems.js +0 -17
  562. package/rubjs/methods/extras/getRelatedObjects.d.ts +0 -3
  563. package/rubjs/methods/extras/getRelatedObjects.js +0 -17
  564. package/rubjs/methods/extras/getTranscription.d.ts +0 -3
  565. package/rubjs/methods/extras/getTranscription.js +0 -20
  566. package/rubjs/methods/extras/join.d.ts +0 -3
  567. package/rubjs/methods/extras/join.js +0 -22
  568. package/rubjs/methods/extras/joinVoiceChat.d.ts +0 -3
  569. package/rubjs/methods/extras/joinVoiceChat.js +0 -22
  570. package/rubjs/methods/extras/leaveChat.d.ts +0 -3
  571. package/rubjs/methods/extras/leaveChat.js +0 -20
  572. package/rubjs/methods/extras/onEditMessages.d.ts +0 -3
  573. package/rubjs/methods/extras/onEditMessages.js +0 -41
  574. package/rubjs/methods/extras/reportObject.d.ts +0 -14
  575. package/rubjs/methods/extras/reportObject.js +0 -32
  576. package/rubjs/methods/extras/searchGlobalObjects.d.ts +0 -3
  577. package/rubjs/methods/extras/searchGlobalObjects.js +0 -17
  578. package/rubjs/methods/extras/sendVoiceChatActivity.d.ts +0 -3
  579. package/rubjs/methods/extras/sendVoiceChatActivity.js +0 -24
  580. package/rubjs/methods/extras/setVoiceChatState.d.ts +0 -3
  581. package/rubjs/methods/extras/setVoiceChatState.js +0 -25
  582. package/rubjs/methods/extras/transcribeVoice.d.ts +0 -3
  583. package/rubjs/methods/extras/transcribeVoice.js +0 -17
  584. package/rubjs/methods/extras/userIsAdmin.d.ts +0 -3
  585. package/rubjs/methods/extras/userIsAdmin.js +0 -29
  586. package/rubjs/methods/gif/addToMyGifSet.d.ts +0 -3
  587. package/rubjs/methods/gif/addToMyGifSet.js +0 -17
  588. package/rubjs/methods/gif/getMyGifSet.d.ts +0 -3
  589. package/rubjs/methods/gif/getMyGifSet.js +0 -17
  590. package/rubjs/methods/gif/removeFromMyGifSet.d.ts +0 -3
  591. package/rubjs/methods/gif/removeFromMyGifSet.js +0 -17
  592. package/rubjs/methods/groups/addGroup.d.ts +0 -3
  593. package/rubjs/methods/groups/addGroup.js +0 -19
  594. package/rubjs/methods/groups/addGroupMembers.d.ts +0 -3
  595. package/rubjs/methods/groups/addGroupMembers.js +0 -19
  596. package/rubjs/methods/groups/banGroupMember.d.ts +0 -3
  597. package/rubjs/methods/groups/banGroupMember.js +0 -25
  598. package/rubjs/methods/groups/createGroupVoiceChat.d.ts +0 -3
  599. package/rubjs/methods/groups/createGroupVoiceChat.js +0 -17
  600. package/rubjs/methods/groups/deleteNoAccessGroupChat.d.ts +0 -3
  601. package/rubjs/methods/groups/deleteNoAccessGroupChat.js +0 -17
  602. package/rubjs/methods/groups/discardGroupVoiceChat.d.ts +0 -3
  603. package/rubjs/methods/groups/discardGroupVoiceChat.js +0 -20
  604. package/rubjs/methods/groups/editGroupInfo.d.ts +0 -6
  605. package/rubjs/methods/groups/editGroupInfo.js +0 -52
  606. package/rubjs/methods/groups/getBannedGroupMembers.d.ts +0 -3
  607. package/rubjs/methods/groups/getBannedGroupMembers.js +0 -17
  608. package/rubjs/methods/groups/getGroupAdminAccessList.d.ts +0 -3
  609. package/rubjs/methods/groups/getGroupAdminAccessList.js +0 -20
  610. package/rubjs/methods/groups/getGroupAdminMembers.d.ts +0 -3
  611. package/rubjs/methods/groups/getGroupAdminMembers.js +0 -17
  612. package/rubjs/methods/groups/getGroupAllMembers.d.ts +0 -3
  613. package/rubjs/methods/groups/getGroupAllMembers.js +0 -21
  614. package/rubjs/methods/groups/getGroupDefaultAccess.d.ts +0 -3
  615. package/rubjs/methods/groups/getGroupDefaultAccess.js +0 -17
  616. package/rubjs/methods/groups/getGroupInfo.d.ts +0 -3
  617. package/rubjs/methods/groups/getGroupInfo.js +0 -17
  618. package/rubjs/methods/groups/getGroupLink.d.ts +0 -3
  619. package/rubjs/methods/groups/getGroupLink.js +0 -17
  620. package/rubjs/methods/groups/getGroupMentionList.d.ts +0 -3
  621. package/rubjs/methods/groups/getGroupMentionList.js +0 -20
  622. package/rubjs/methods/groups/getGroupOnlineCount.d.ts +0 -3
  623. package/rubjs/methods/groups/getGroupOnlineCount.js +0 -17
  624. package/rubjs/methods/groups/getGroupVoiceChatParticipants.d.ts +0 -3
  625. package/rubjs/methods/groups/getGroupVoiceChatParticipants.js +0 -18
  626. package/rubjs/methods/groups/getGroupVoiceChatUpdates.d.ts +0 -3
  627. package/rubjs/methods/groups/getGroupVoiceChatUpdates.js +0 -21
  628. package/rubjs/methods/groups/groupPreviewByJoinLink.d.ts +0 -3
  629. package/rubjs/methods/groups/groupPreviewByJoinLink.js +0 -19
  630. package/rubjs/methods/groups/joinGroup.d.ts +0 -3
  631. package/rubjs/methods/groups/joinGroup.js +0 -19
  632. package/rubjs/methods/groups/joinGroupVoiceChat.d.ts +0 -3
  633. package/rubjs/methods/groups/joinGroupVoiceChat.js +0 -22
  634. package/rubjs/methods/groups/leaveGroup.d.ts +0 -3
  635. package/rubjs/methods/groups/leaveGroup.js +0 -17
  636. package/rubjs/methods/groups/leaveGroupVoiceChat.d.ts +0 -3
  637. package/rubjs/methods/groups/leaveGroupVoiceChat.js +0 -20
  638. package/rubjs/methods/groups/removeGroup.d.ts +0 -3
  639. package/rubjs/methods/groups/removeGroup.js +0 -17
  640. package/rubjs/methods/groups/seenGroupMessages.d.ts +0 -3
  641. package/rubjs/methods/groups/seenGroupMessages.js +0 -21
  642. package/rubjs/methods/groups/setGroupAdmin.d.ts +0 -5
  643. package/rubjs/methods/groups/setGroupAdmin.js +0 -28
  644. package/rubjs/methods/groups/setGroupDefaultAccess.d.ts +0 -4
  645. package/rubjs/methods/groups/setGroupDefaultAccess.js +0 -22
  646. package/rubjs/methods/groups/setGroupLink.d.ts +0 -3
  647. package/rubjs/methods/groups/setGroupLink.js +0 -17
  648. package/rubjs/methods/groups/setGroupVoiceChatSetting.d.ts +0 -3
  649. package/rubjs/methods/groups/setGroupVoiceChatSetting.js +0 -26
  650. package/rubjs/methods/index.d.ts +0 -203
  651. package/rubjs/methods/index.js +0 -967
  652. package/rubjs/methods/messages/actionOnMessageReaction.d.ts +0 -3
  653. package/rubjs/methods/messages/actionOnMessageReaction.js +0 -25
  654. package/rubjs/methods/messages/createPoll.d.ts +0 -3
  655. package/rubjs/methods/messages/createPoll.js +0 -37
  656. package/rubjs/methods/messages/deleteMessages.d.ts +0 -3
  657. package/rubjs/methods/messages/deleteMessages.js +0 -28
  658. package/rubjs/methods/messages/editMessage.d.ts +0 -3
  659. package/rubjs/methods/messages/editMessage.js +0 -23
  660. package/rubjs/methods/messages/forwardMessages.d.ts +0 -3
  661. package/rubjs/methods/messages/forwardMessages.js +0 -31
  662. package/rubjs/methods/messages/getMessageShareUrl.d.ts +0 -3
  663. package/rubjs/methods/messages/getMessageShareUrl.js +0 -17
  664. package/rubjs/methods/messages/getMessages.d.ts +0 -3
  665. package/rubjs/methods/messages/getMessages.js +0 -23
  666. package/rubjs/methods/messages/getMessagesByID.d.ts +0 -3
  667. package/rubjs/methods/messages/getMessagesByID.js +0 -22
  668. package/rubjs/methods/messages/getMessagesInterval.d.ts +0 -3
  669. package/rubjs/methods/messages/getMessagesInterval.js +0 -20
  670. package/rubjs/methods/messages/getMessagesUpdates.d.ts +0 -3
  671. package/rubjs/methods/messages/getMessagesUpdates.js +0 -17
  672. package/rubjs/methods/messages/getPollOptionVoters.d.ts +0 -3
  673. package/rubjs/methods/messages/getPollOptionVoters.js +0 -21
  674. package/rubjs/methods/messages/getPollStatus.d.ts +0 -3
  675. package/rubjs/methods/messages/getPollStatus.js +0 -17
  676. package/rubjs/methods/messages/index.d.ts +0 -27
  677. package/rubjs/methods/messages/index.js +0 -58
  678. package/rubjs/methods/messages/requestSendFile.d.ts +0 -4
  679. package/rubjs/methods/messages/requestSendFile.js +0 -22
  680. package/rubjs/methods/messages/sendDocument.d.ts +0 -3
  681. package/rubjs/methods/messages/sendDocument.js +0 -17
  682. package/rubjs/methods/messages/sendFileInline.d.ts +0 -18
  683. package/rubjs/methods/messages/sendFileInline.js +0 -35
  684. package/rubjs/methods/messages/sendGif.d.ts +0 -3
  685. package/rubjs/methods/messages/sendGif.js +0 -17
  686. package/rubjs/methods/messages/sendMessage.d.ts +0 -3
  687. package/rubjs/methods/messages/sendMessage.js +0 -149
  688. package/rubjs/methods/messages/sendMusic.d.ts +0 -3
  689. package/rubjs/methods/messages/sendMusic.js +0 -17
  690. package/rubjs/methods/messages/sendPhoto.d.ts +0 -3
  691. package/rubjs/methods/messages/sendPhoto.js +0 -17
  692. package/rubjs/methods/messages/sendSticker.d.ts +0 -3
  693. package/rubjs/methods/messages/sendSticker.js +0 -17
  694. package/rubjs/methods/messages/sendText.d.ts +0 -3
  695. package/rubjs/methods/messages/sendText.js +0 -17
  696. package/rubjs/methods/messages/sendVideo.d.ts +0 -3
  697. package/rubjs/methods/messages/sendVideo.js +0 -17
  698. package/rubjs/methods/messages/sendVideoMessage.d.ts +0 -3
  699. package/rubjs/methods/messages/sendVideoMessage.js +0 -17
  700. package/rubjs/methods/messages/sendVoice.d.ts +0 -3
  701. package/rubjs/methods/messages/sendVoice.js +0 -17
  702. package/rubjs/methods/messages/setPinMessage.d.ts +0 -3
  703. package/rubjs/methods/messages/setPinMessage.js +0 -25
  704. package/rubjs/methods/messages/votePoll.d.ts +0 -3
  705. package/rubjs/methods/messages/votePoll.js +0 -17
  706. package/rubjs/methods/settings/changePassword.d.ts +0 -3
  707. package/rubjs/methods/settings/changePassword.js +0 -17
  708. package/rubjs/methods/settings/checkTwoStepPasscode.d.ts +0 -3
  709. package/rubjs/methods/settings/checkTwoStepPasscode.js +0 -17
  710. package/rubjs/methods/settings/deleteFolder.d.ts +0 -3
  711. package/rubjs/methods/settings/deleteFolder.js +0 -17
  712. package/rubjs/methods/settings/getBlockedUsers.d.ts +0 -3
  713. package/rubjs/methods/settings/getBlockedUsers.js +0 -17
  714. package/rubjs/methods/settings/getFolders.d.ts +0 -3
  715. package/rubjs/methods/settings/getFolders.js +0 -17
  716. package/rubjs/methods/settings/getMySessions.d.ts +0 -3
  717. package/rubjs/methods/settings/getMySessions.js +0 -17
  718. package/rubjs/methods/settings/getPrivacySetting.d.ts +0 -3
  719. package/rubjs/methods/settings/getPrivacySetting.js +0 -17
  720. package/rubjs/methods/settings/getSuggestedFolders.d.ts +0 -3
  721. package/rubjs/methods/settings/getSuggestedFolders.js +0 -17
  722. package/rubjs/methods/settings/getTwoPasscodeStatus.d.ts +0 -3
  723. package/rubjs/methods/settings/getTwoPasscodeStatus.js +0 -17
  724. package/rubjs/methods/settings/requestRecoveryEmail.d.ts +0 -3
  725. package/rubjs/methods/settings/requestRecoveryEmail.js +0 -20
  726. package/rubjs/methods/settings/setSetting.d.ts +0 -5
  727. package/rubjs/methods/settings/setSetting.js +0 -60
  728. package/rubjs/methods/settings/setupTwoStepVerification.d.ts +0 -3
  729. package/rubjs/methods/settings/setupTwoStepVerification.js +0 -21
  730. package/rubjs/methods/settings/terminateOtherSessions.d.ts +0 -3
  731. package/rubjs/methods/settings/terminateOtherSessions.js +0 -18
  732. package/rubjs/methods/settings/terminateSession.d.ts +0 -3
  733. package/rubjs/methods/settings/terminateSession.js +0 -17
  734. package/rubjs/methods/settings/turnOffTwoStep.d.ts +0 -3
  735. package/rubjs/methods/settings/turnOffTwoStep.js +0 -18
  736. package/rubjs/methods/settings/updateProfile.d.ts +0 -3
  737. package/rubjs/methods/settings/updateProfile.js +0 -30
  738. package/rubjs/methods/settings/updateUsername.d.ts +0 -3
  739. package/rubjs/methods/settings/updateUsername.js +0 -17
  740. package/rubjs/methods/settings/verifyRecoveryEmail.d.ts +0 -3
  741. package/rubjs/methods/settings/verifyRecoveryEmail.js +0 -17
  742. package/rubjs/methods/stickers/actionOnStickerSet.d.ts +0 -3
  743. package/rubjs/methods/stickers/actionOnStickerSet.js +0 -21
  744. package/rubjs/methods/stickers/getMyStickerSets.d.ts +0 -3
  745. package/rubjs/methods/stickers/getMyStickerSets.js +0 -17
  746. package/rubjs/methods/stickers/getStickerSetByID.d.ts +0 -3
  747. package/rubjs/methods/stickers/getStickerSetByID.js +0 -17
  748. package/rubjs/methods/stickers/getStickersByEmoji.d.ts +0 -3
  749. package/rubjs/methods/stickers/getStickersByEmoji.js +0 -17
  750. package/rubjs/methods/stickers/getStickersBySetIds.d.ts +0 -3
  751. package/rubjs/methods/stickers/getStickersBySetIds.js +0 -19
  752. package/rubjs/methods/stickers/getTrendStickerSets.d.ts +0 -3
  753. package/rubjs/methods/stickers/getTrendStickerSets.js +0 -17
  754. package/rubjs/methods/stickers/searchStickers.d.ts +0 -3
  755. package/rubjs/methods/stickers/searchStickers.js +0 -17
  756. package/rubjs/methods/users/checkUserUsername.d.ts +0 -3
  757. package/rubjs/methods/users/checkUserUsername.js +0 -17
  758. package/rubjs/methods/users/deleteUserChat.d.ts +0 -3
  759. package/rubjs/methods/users/deleteUserChat.js +0 -20
  760. package/rubjs/methods/users/getMe.d.ts +0 -3
  761. package/rubjs/methods/users/getMe.js +0 -17
  762. package/rubjs/methods/users/getUserInfo.d.ts +0 -4
  763. package/rubjs/methods/users/getUserInfo.js +0 -18
  764. package/rubjs/methods/users/setBlockUser.d.ts +0 -3
  765. package/rubjs/methods/users/setBlockUser.js +0 -20
  766. package/rubjs/methods/utilities/download.d.ts +0 -4
  767. package/rubjs/methods/utilities/download.js +0 -17
  768. package/rubjs/methods/utilities/downloadProfilePicture.d.ts +0 -3
  769. package/rubjs/methods/utilities/downloadProfilePicture.js +0 -27
  770. package/rubjs/methods/utilities/get.d.ts +0 -4
  771. package/rubjs/methods/utilities/get.js +0 -21
  772. package/rubjs/methods/utilities/index.d.ts +0 -8
  773. package/rubjs/methods/utilities/index.js +0 -20
  774. package/rubjs/methods/utilities/post.d.ts +0 -4
  775. package/rubjs/methods/utilities/post.js +0 -21
  776. package/rubjs/methods/utilities/run.d.ts +0 -3
  777. package/rubjs/methods/utilities/run.js +0 -24
  778. package/rubjs/methods/utilities/start.d.ts +0 -3
  779. package/rubjs/methods/utilities/start.js +0 -82
  780. package/rubjs/methods/utilities/thumbnail.js +0 -85
  781. package/rubjs/network/index.d.ts +0 -37
  782. package/rubjs/network/index.js +0 -405
  783. package/rubjs/network/loginNetwork.d.ts +0 -39
  784. package/rubjs/network/loginNetwork.js +0 -122
  785. package/rubjs/session/index.d.ts +0 -23
  786. package/rubjs/session/index.js +0 -65
  787. package/rubjs/types/auth.d.ts +0 -40
  788. package/rubjs/types/chats.d.ts +0 -79
  789. package/rubjs/types/decorators.d.ts +0 -170
  790. package/rubjs/types/groups.d.ts +0 -155
  791. package/rubjs/types/index.d.ts +0 -8
  792. package/rubjs/types/index.js +0 -53
  793. package/rubjs/types/message.d.ts +0 -26
  794. package/rubjs/types/message.js +0 -81
  795. package/rubjs/types/messages.d.ts +0 -178
  796. package/rubjs/types/messages.js +0 -2
  797. package/rubjs/types/users.d.ts +0 -64
  798. package/rubjs/types/users.js +0 -2
  799. package/rubjs/utils/filters.d.ts +0 -33
  800. package/rubjs/utils/filters.js +0 -167
  801. package/rubjs/utils/index.d.ts +0 -3
  802. package/rubjs/utils/index.js +0 -10
  803. /package/{rubjs → lib/core}/methods/advanced/index.d.ts +0 -0
  804. /package/{rubjs → lib/core}/methods/advanced/index.js +0 -0
  805. /package/{rubjs → lib/core}/methods/auth/index.d.ts +0 -0
  806. /package/{rubjs → lib/core}/methods/auth/index.js +0 -0
  807. /package/{rubjs → lib/core}/methods/channels/index.d.ts +0 -0
  808. /package/{rubjs → lib/core}/methods/channels/index.js +0 -0
  809. /package/{rubjs → lib/core}/methods/chats/index.d.ts +0 -0
  810. /package/{rubjs → lib/core}/methods/chats/index.js +0 -0
  811. /package/{rubjs → lib/core}/methods/contacts/index.d.ts +0 -0
  812. /package/{rubjs → lib/core}/methods/contacts/index.js +0 -0
  813. /package/{rubjs → lib/core}/methods/extras/index.d.ts +0 -0
  814. /package/{rubjs → lib/core}/methods/extras/index.js +0 -0
  815. /package/{rubjs → lib/core}/methods/gif/index.d.ts +0 -0
  816. /package/{rubjs → lib/core}/methods/gif/index.js +0 -0
  817. /package/{rubjs → lib/core}/methods/groups/index.d.ts +0 -0
  818. /package/{rubjs → lib/core}/methods/groups/index.js +0 -0
  819. /package/{rubjs → lib/core}/methods/settings/index.d.ts +0 -0
  820. /package/{rubjs → lib/core}/methods/settings/index.js +0 -0
  821. /package/{rubjs → lib/core}/methods/stickers/index.d.ts +0 -0
  822. /package/{rubjs → lib/core}/methods/stickers/index.js +0 -0
  823. /package/{rubjs → lib/core}/methods/users/index.d.ts +0 -0
  824. /package/{rubjs → lib/core}/methods/users/index.js +0 -0
  825. /package/{rubjs → lib/core}/methods/utilities/thumbnail.d.ts +0 -0
  826. /package/{rubjs/parser/index.d.ts → lib/core/parser.d.ts} +0 -0
  827. /package/{rubjs/parser/index.js → lib/core/parser.js} +0 -0
  828. /package/{rubjs/types/auth.js → lib/types/client.type.js} +0 -0
  829. /package/{rubjs/types/chats.js → lib/types/decorators.type.js} +0 -0
  830. /package/{rubjs/types/decorators.js → lib/types/network.type.js} +0 -0
  831. /package/{rubjs/types/groups.js → lib/types/session.type.js} +0 -0
  832. /package/{rubjs → lib}/utils/utils.d.ts +0 -0
  833. /package/{rubjs → lib}/utils/utils.js +0 -0
@@ -1,183 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const child_process_1 = require("child_process");
13
- const optional_require_1 = require("optional-require");
14
- const optionalWrtc = (0, optional_require_1.optionalRequire)("wrtc");
15
- class VoiceChatClient {
16
- constructor(getMusicUrl) {
17
- this.buffer = Buffer.alloc(0);
18
- this.frameSize = 960;
19
- this.playlist = [];
20
- this.currentIndex = 0;
21
- this.isPaused = false;
22
- this.lastPosition = 0;
23
- this.isManualSkip = false;
24
- if (!optionalWrtc) {
25
- throw new Error("wrtc module is not installed. Some features may be disabled.");
26
- }
27
- this.pc = new optionalWrtc.RTCPeerConnection();
28
- this.source = new optionalWrtc.nonstandard.RTCAudioSource();
29
- this.track = this.source.createTrack();
30
- this.pc.addTrack(this.track);
31
- this.getMusicUrl = getMusicUrl;
32
- }
33
- play(filePath) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- if (this.ffmpeg)
36
- this.stop();
37
- if (!filePath) {
38
- if (this.playlist.length === 0) {
39
- if (this.getMusicUrl) {
40
- this.playlist = [yield this.getMusicUrl()];
41
- }
42
- else
43
- return;
44
- }
45
- filePath = this.playlist[this.currentIndex];
46
- }
47
- if (!this.chatGuid || !this.voiceChatId || !this.client) {
48
- throw new Error("Voice chat not initialized. Call `joinVoiceChat` first.");
49
- }
50
- this.isPaused = false;
51
- this.isManualSkip = false;
52
- this.buffer = Buffer.alloc(0);
53
- const seekArgs = this.lastPosition > 0 ? ["-ss", this.lastPosition.toString()] : [];
54
- this.ffmpeg = (0, child_process_1.spawn)("ffmpeg", [
55
- "-loglevel",
56
- "quiet",
57
- "-re",
58
- "-threads",
59
- "1",
60
- "-protocol_whitelist",
61
- "file,http,https,tcp,tls",
62
- ...seekArgs,
63
- "-i",
64
- filePath,
65
- "-acodec",
66
- "pcm_s16le",
67
- "-ar",
68
- "48000",
69
- "-ac",
70
- "1",
71
- "-f",
72
- "s16le",
73
- "pipe:1",
74
- ]);
75
- this.ffmpeg.stdout.on("data", (chunk) => {
76
- this.buffer = Buffer.concat([this.buffer, chunk]);
77
- while (this.buffer.length >= this.frameSize) {
78
- if (this.isPaused)
79
- return;
80
- const frame = this.buffer.subarray(0, this.frameSize);
81
- this.buffer = this.buffer.subarray(this.frameSize);
82
- const samples = new Int16Array(frame.buffer, frame.byteOffset, this.frameSize / 2);
83
- const trimmedSamples = samples.slice(0, 960);
84
- this.source.onData({ samples: trimmedSamples, sampleRate: 48000 });
85
- this.lastPosition += 0.02;
86
- }
87
- });
88
- this.ffmpeg.on("close", (code) => __awaiter(this, void 0, void 0, function* () {
89
- if (!this.isManualSkip && code !== null && !this.isPaused) {
90
- yield this.next();
91
- }
92
- this.isManualSkip = false;
93
- }));
94
- this.clearIntervals();
95
- this.intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
96
- try {
97
- yield this.client.getGroupVoiceChatUpdates(this.chatGuid, this.voiceChatId);
98
- }
99
- catch (_a) { }
100
- }), 10 * 1000);
101
- this.intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
102
- try {
103
- if (this.isPaused)
104
- return;
105
- yield this.client.sendVoiceChatActivity(this.chatGuid, this.voiceChatId, this.client.userGuid);
106
- }
107
- catch (_a) { }
108
- }), 2 * 1000);
109
- });
110
- }
111
- stop() {
112
- if (this.ffmpeg) {
113
- this.ffmpeg.kill();
114
- this.ffmpeg = undefined;
115
- this.isPaused = true;
116
- this.buffer = Buffer.alloc(0);
117
- }
118
- }
119
- resume() {
120
- if (this.isPaused)
121
- this.play();
122
- }
123
- next() {
124
- return __awaiter(this, void 0, void 0, function* () {
125
- if (this.playlist.length > this.currentIndex + 1) {
126
- this.isManualSkip = true;
127
- this.stop();
128
- this.currentIndex += 1;
129
- this.lastPosition = 0;
130
- this.isPaused = true;
131
- this.play(this.playlist[this.currentIndex]);
132
- }
133
- else {
134
- if (this.getMusicUrl) {
135
- this.playlist = [...this.playlist, yield this.getMusicUrl()];
136
- yield this.next();
137
- }
138
- }
139
- });
140
- }
141
- previous() {
142
- if (this.currentIndex > 0) {
143
- this.isManualSkip = true;
144
- this.stop();
145
- this.currentIndex--;
146
- this.lastPosition = 0;
147
- this.isPaused = true;
148
- this.play();
149
- }
150
- }
151
- addToPlaylist(filePath) {
152
- this.playlist.push(filePath);
153
- }
154
- removeFromPlaylist(filePath) {
155
- const index = this.playlist.indexOf(filePath);
156
- if (index !== -1) {
157
- this.playlist.splice(index, 1);
158
- if (index <= this.currentIndex && this.currentIndex > 0) {
159
- this.currentIndex--;
160
- }
161
- }
162
- }
163
- joinVoiceChat(chatGuid, voiceChatId, client) {
164
- return __awaiter(this, void 0, void 0, function* () {
165
- this.chatGuid = chatGuid;
166
- this.voiceChatId = voiceChatId;
167
- this.client = client;
168
- const offer = yield this.pc.createOffer();
169
- yield this.pc.setLocalDescription(offer);
170
- const connect = yield client.joinGroupVoiceChat(chatGuid, voiceChatId, offer.sdp, client.userGuid);
171
- const sdpAnswer = connect.sdp_answer_data;
172
- yield this.pc.setRemoteDescription(new optionalWrtc.RTCSessionDescription({ type: "answer", sdp: sdpAnswer }));
173
- yield client.setVoiceChatState(chatGuid, voiceChatId);
174
- });
175
- }
176
- clearIntervals() {
177
- if (this.intervalId) {
178
- clearInterval(this.intervalId);
179
- this.intervalId = undefined;
180
- }
181
- }
182
- }
183
- exports.default = VoiceChatClient;
@@ -1,4 +0,0 @@
1
- import VoiceChatClient from "./VoiceChatClient";
2
- import SendLiveClient from "./sendLiveClient";
3
- import LoginClient from "./loginClient";
4
- export { VoiceChatClient, SendLiveClient, LoginClient };
@@ -1,12 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LoginClient = exports.SendLiveClient = exports.VoiceChatClient = void 0;
7
- const VoiceChatClient_1 = __importDefault(require("./VoiceChatClient"));
8
- exports.VoiceChatClient = VoiceChatClient_1.default;
9
- const sendLiveClient_1 = __importDefault(require("./sendLiveClient"));
10
- exports.SendLiveClient = sendLiveClient_1.default;
11
- const loginClient_1 = __importDefault(require("./loginClient"));
12
- exports.LoginClient = loginClient_1.default;
@@ -1,47 +0,0 @@
1
- import Network from "../network/loginNetwork";
2
- interface AuthResult {
3
- isOk: boolean;
4
- status?: string;
5
- phone_code_hash?: string;
6
- code_digits_count?: number;
7
- auth?: string;
8
- key?: Buffer;
9
- decode_auth?: string;
10
- phone_number?: string;
11
- }
12
- interface AuthFace {
13
- auth: string;
14
- key: Buffer;
15
- privateKey: any;
16
- decode_auth?: string;
17
- }
18
- declare class LoginClient {
19
- static systemVersions: Record<string, string>;
20
- static sendCode(phone_number: string, pass_key?: string): Promise<AuthResult>;
21
- static signIn(phone_code: string, datas: AuthResult, sessionPath?: string): Promise<{
22
- isOk: boolean;
23
- status: string;
24
- sessionData?: undefined;
25
- } | {
26
- isOk: boolean;
27
- status: string;
28
- sessionData: {
29
- phone: any;
30
- auth: string;
31
- guid: any;
32
- agent: string;
33
- private_key: any;
34
- };
35
- }>;
36
- static registerDevice(network: Network, datas: AuthFace): Promise<void>;
37
- static getBrowser(userAgent: string, langCode: string, appVersion: string): Promise<{
38
- token: string;
39
- lang_code: string;
40
- token_type: string;
41
- app_version: string;
42
- system_version: string;
43
- device_model: string;
44
- device_hash: string;
45
- }>;
46
- }
47
- export default LoginClient;
@@ -1,122 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const crypto_1 = __importDefault(require("../crypto"));
16
- const loginNetwork_1 = __importDefault(require("../network/loginNetwork"));
17
- const session_1 = __importDefault(require("../session"));
18
- class LoginClient {
19
- static sendCode(phone_number, pass_key) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const network = new loginNetwork_1.default();
22
- const data = {
23
- phone_number,
24
- pass_key: pass_key || null,
25
- send_type: "SMS",
26
- };
27
- const result = yield network.bulder("sendCode", data, {}, true);
28
- if (result)
29
- return {
30
- isOk: true,
31
- status: result.status,
32
- phone_code_hash: result.phone_code_hash,
33
- code_digits_count: result.code_digits_count,
34
- auth: result.auth_data,
35
- key: result.key_data,
36
- phone_number,
37
- };
38
- return {
39
- isOk: false,
40
- };
41
- });
42
- }
43
- static signIn(phone_code, datas, sessionPath) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- const network = new loginNetwork_1.default();
46
- const [publicKey, privateKey] = crypto_1.default.createKeys();
47
- const data = {
48
- phone_code,
49
- phone_number: datas.phone_number,
50
- phone_code_hash: datas.phone_code_hash,
51
- public_key: publicKey,
52
- };
53
- const auth = {
54
- auth: datas.auth,
55
- key: datas.key,
56
- privateKey,
57
- };
58
- const response = yield network.bulder("signIn", data, auth, true);
59
- if ((response === null || response === void 0 ? void 0 : response.status) === "CodeIsInvalid") {
60
- return { isOk: false, status: "CodeIsInvalid" };
61
- }
62
- const sampleAuth = crypto_1.default.decrypt_RSA_OAEP(privateKey, response.auth);
63
- auth.key = Buffer.from(crypto_1.default.passphrase(sampleAuth), "utf8");
64
- auth.auth = sampleAuth;
65
- auth.decode_auth = crypto_1.default.decode_auth(sampleAuth);
66
- yield this.registerDevice(network, auth);
67
- const sessionData = {
68
- phone: response.user.phone,
69
- auth: auth.auth,
70
- guid: response.user.user_guid,
71
- agent: network.userAgent,
72
- private_key: privateKey,
73
- };
74
- if (sessionPath) {
75
- const session = new session_1.default(sessionPath);
76
- session.saveSession(sessionData);
77
- }
78
- return { isOk: true, status: "Sucessfull", sessionData };
79
- });
80
- }
81
- static registerDevice(network, datas) {
82
- return __awaiter(this, void 0, void 0, function* () {
83
- const browserData = yield this.getBrowser(network.userAgent, network.defaultPlatform.lang_code, network.defaultPlatform.app_version);
84
- yield network.bulder("registerDevice", browserData, datas);
85
- });
86
- }
87
- static getBrowser(userAgent, langCode, appVersion) {
88
- return __awaiter(this, void 0, void 0, function* () {
89
- var _a, _b;
90
- const match = userAgent
91
- .toLowerCase()
92
- .match(/(opera|chrome|safari|firefox|msie|trident)\/(\d+)/);
93
- if (!match) {
94
- throw new Error(`Cannot parse user-agent: ${userAgent}`);
95
- }
96
- const deviceModel = `${match[1]} ${match[2]}`;
97
- const systemVersion = ((_a = Object.entries(this.systemVersions).find(([key]) => userAgent.includes(key))) === null || _a === void 0 ? void 0 : _a[1]) || "Unknown";
98
- const deviceHash = "2" + (((_b = userAgent.match(/\d+/g)) === null || _b === void 0 ? void 0 : _b.join("")) || "");
99
- return {
100
- token: "",
101
- lang_code: langCode,
102
- token_type: "Web",
103
- app_version: `WB_${appVersion}`,
104
- system_version: systemVersion,
105
- device_model: deviceModel.charAt(0).toUpperCase() + deviceModel.slice(1),
106
- device_hash: deviceHash,
107
- };
108
- });
109
- }
110
- }
111
- LoginClient.systemVersions = {
112
- "Windows NT 10.0": "Windows 10",
113
- "Windows NT 6.2": "Windows 8",
114
- "Windows NT 6.1": "Windows 7",
115
- "Windows NT 6.0": "Windows Vista",
116
- "Windows NT 5.1": "Windows XP",
117
- "Windows NT 5.0": "Windows 2000",
118
- Mac: "Mac/iOS",
119
- X11: "UNIX",
120
- Linux: "Linux",
121
- };
122
- exports.default = LoginClient;
@@ -1,25 +0,0 @@
1
- import Client from "..";
2
- declare class SendLiveClient {
3
- private client;
4
- private title;
5
- private object_guid;
6
- private streamUrlRegex;
7
- private streamKeyRegex;
8
- private playlist;
9
- private currentIndex;
10
- private getVideoUrl;
11
- private ffmpeg?;
12
- private isPaused;
13
- private lastPosition;
14
- constructor(client: Client, title: string, object_guid: string, getVideoUrl?: () => Promise<string>);
15
- detectOrientation(filePath: string): Promise<boolean>;
16
- createLive(filePath?: string, startTime?: number): Promise<void>;
17
- stop(): void;
18
- getCurrentTime(): Promise<void>;
19
- resume(): void;
20
- next(): Promise<void>;
21
- previous(): void;
22
- addToPlaylist(filePath: string): void;
23
- removeFromPlaylist(filePath: string): void;
24
- }
25
- export default SendLiveClient;
@@ -1,146 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const child_process_1 = require("child_process");
13
- class SendLiveClient {
14
- constructor(client, title, object_guid, getVideoUrl) {
15
- this.streamUrlRegex = /Stream url:\s*(rtmp:\/\/[^\n]+)/;
16
- this.streamKeyRegex = /Stream key:\s*([^\n]+)/;
17
- this.playlist = [];
18
- this.currentIndex = 0;
19
- this.isPaused = false;
20
- this.lastPosition = 0;
21
- this.client = client;
22
- this.getVideoUrl = getVideoUrl;
23
- this.title = title;
24
- this.object_guid = object_guid;
25
- }
26
- detectOrientation(filePath) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- return new Promise((resolve) => {
29
- const ffprobe = (0, child_process_1.spawn)("ffprobe", [
30
- "-v", "error",
31
- "-select_streams", "v:0",
32
- "-show_entries", "stream=width,height",
33
- "-of", "csv=p=0",
34
- filePath,
35
- ]);
36
- let output = "";
37
- ffprobe.stdout.on("data", (data) => {
38
- output += data.toString();
39
- });
40
- ffprobe.on("close", () => {
41
- const [width, height] = output.trim().split(",").map(Number);
42
- resolve(width > height);
43
- });
44
- });
45
- });
46
- }
47
- createLive(filePath_1) {
48
- return __awaiter(this, arguments, void 0, function* (filePath, startTime = 0) {
49
- var _a;
50
- if (!filePath) {
51
- if (!this.playlist.length && this.getVideoUrl) {
52
- this.playlist = [yield this.getVideoUrl()];
53
- }
54
- filePath = (_a = this.playlist[this.currentIndex]) !== null && _a !== void 0 ? _a : "";
55
- }
56
- if (!filePath)
57
- return;
58
- let isLandscape = yield this.detectOrientation(filePath);
59
- let res = yield this.client.sendLive(this.title, this.object_guid, filePath);
60
- const streamUrl = res.publish_text.match(this.streamUrlRegex)[1];
61
- const streamKey = res.publish_text.match(this.streamKeyRegex)[1];
62
- const streamSendUrl = streamUrl + streamKey;
63
- const resolution = !isLandscape ? "1920:1080" : "1080:1920";
64
- const rotateFilter = !isLandscape ? "" : "transpose=1,";
65
- const seekArgs = startTime > 0 ? ["-ss", startTime.toFixed(2)] : [];
66
- this.ffmpeg = (0, child_process_1.spawn)("ffmpeg", [
67
- "-re",
68
- ...seekArgs,
69
- "-i", filePath,
70
- "-c:v", "libx264",
71
- "-preset", "ultrafast",
72
- "-b:v", "1200k",
73
- "-c:a", "aac",
74
- "-b:a", "128k",
75
- "-vf", `${rotateFilter}scale=${resolution}`,
76
- "-rtbufsize", "100M",
77
- "-f", "flv",
78
- streamSendUrl,
79
- ]);
80
- this.ffmpeg.on("close", (code) => {
81
- console.log(`FFmpeg process exited with code ${code}`);
82
- });
83
- });
84
- }
85
- stop() {
86
- if (this.ffmpeg) {
87
- this.ffmpeg.kill();
88
- this.ffmpeg = undefined;
89
- this.isPaused = true;
90
- this.getCurrentTime();
91
- }
92
- }
93
- getCurrentTime() {
94
- return __awaiter(this, void 0, void 0, function* () {
95
- if (!this.ffmpeg)
96
- return;
97
- const ffprobe = (0, child_process_1.spawn)("ffprobe", ["-i", this.playlist[this.currentIndex], "-show_entries", "format=start_time", "-of", "default=noprint_wrappers=1:nokey=1"]);
98
- let output = "";
99
- ffprobe.stdout.on("data", (data) => {
100
- output += data.toString();
101
- });
102
- ffprobe.on("close", () => {
103
- this.lastPosition = parseFloat(output.trim()) || 0;
104
- });
105
- });
106
- }
107
- resume() {
108
- if (this.isPaused) {
109
- this.createLive(this.playlist[this.currentIndex], this.lastPosition);
110
- this.isPaused = false;
111
- }
112
- }
113
- next() {
114
- return __awaiter(this, void 0, void 0, function* () {
115
- if (this.playlist.length > this.currentIndex + 1) {
116
- this.stop();
117
- this.currentIndex += 1;
118
- this.lastPosition = 0;
119
- this.isPaused = true;
120
- this.createLive(this.playlist[this.currentIndex]);
121
- }
122
- });
123
- }
124
- previous() {
125
- if (this.currentIndex > 0) {
126
- this.stop();
127
- this.currentIndex--;
128
- this.lastPosition = 0;
129
- this.isPaused = true;
130
- this.createLive();
131
- }
132
- }
133
- addToPlaylist(filePath) {
134
- this.playlist.push(filePath);
135
- }
136
- removeFromPlaylist(filePath) {
137
- const index = this.playlist.indexOf(filePath);
138
- if (index !== -1) {
139
- this.playlist.splice(index, 1);
140
- if (index <= this.currentIndex && this.currentIndex > 0) {
141
- this.currentIndex--;
142
- }
143
- }
144
- }
145
- }
146
- exports.default = SendLiveClient;
@@ -1,12 +0,0 @@
1
- declare class Crypto {
2
- static AES_IV: Buffer<ArrayBuffer>;
3
- static decode_auth: (auth: string) => string;
4
- static passphrase(auth: string): string;
5
- static secret(length: number): string;
6
- static decrypt(data_enc: string, key: Buffer<ArrayBufferLike>): string;
7
- static encrypt(data: string, key: Buffer<ArrayBufferLike>): string;
8
- static sign(data_enc: string, privateKey: string): string;
9
- static createKeys(): any[];
10
- static decrypt_RSA_OAEP(private_key: string, data: string): any;
11
- }
12
- export default Crypto;
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const node_rsa_1 = __importDefault(require("node-rsa"));
7
- const crypto_1 = __importDefault(require("crypto"));
8
- class Crypto {
9
- static passphrase(auth) {
10
- if (auth.length !== 32) {
11
- throw new Error("auth length should be 32 digits");
12
- }
13
- const resultList = [];
14
- const chunks = auth.match(/.{8}/g);
15
- if (!chunks || chunks.length !== 4) {
16
- throw new Error("Invalid auth format");
17
- }
18
- const combined = chunks[2] + chunks[0] + chunks[3] + chunks[1];
19
- for (const character of combined) {
20
- const newChar = String.fromCharCode(((character.charCodeAt(0) - 97 + 9) % 26) + 97);
21
- resultList.push(newChar);
22
- }
23
- return resultList.join("");
24
- }
25
- static secret(length) {
26
- if (length <= 0 || !Number.isInteger(length)) {
27
- throw new Error("Length must be a positive integer");
28
- }
29
- const characters = "abcdefghijklmnopqrstuvwxyz";
30
- let secret = "";
31
- for (let i = 0; i < length; i++) {
32
- const randomIndex = Math.floor(Math.random() * characters.length);
33
- secret += characters[randomIndex];
34
- }
35
- return secret;
36
- }
37
- static decrypt(data_enc, key) {
38
- const decipher = crypto_1.default.createDecipheriv("aes-256-cbc", key, this.AES_IV);
39
- let decrypted = decipher.update(data_enc, "base64", "utf8");
40
- decrypted += decipher.final("utf8");
41
- return decrypted;
42
- }
43
- static encrypt(data, key) {
44
- const cipher = crypto_1.default.createCipheriv("aes-256-cbc", key, this.AES_IV);
45
- let encrypted = cipher.update(data, "utf8", "base64");
46
- encrypted += cipher.final("base64");
47
- return encrypted;
48
- }
49
- static sign(data_enc, privateKey) {
50
- if (!privateKey) {
51
- throw new Error("Private key is not defined");
52
- }
53
- const sign = crypto_1.default.createSign("SHA256");
54
- sign.update(data_enc);
55
- sign.end();
56
- const signature = sign.sign(privateKey, "base64");
57
- return signature;
58
- }
59
- static createKeys() {
60
- const keyPair = new node_rsa_1.default({
61
- b: 1024,
62
- });
63
- let publicKey = Crypto.decode_auth(Buffer.from(keyPair.exportKey("pkcs1-public-pem"), "binary").toString("base64"));
64
- let privateKey = keyPair.exportKey("pkcs1-private-pem");
65
- return [publicKey, privateKey];
66
- }
67
- static decrypt_RSA_OAEP(private_key, data) {
68
- const keyPair = new node_rsa_1.default(private_key);
69
- const decrypted = keyPair.decrypt(data, "utf8");
70
- return decrypted;
71
- }
72
- }
73
- Crypto.AES_IV = Buffer.alloc(16, 0);
74
- Crypto.decode_auth = (auth) => {
75
- let n = "";
76
- const lowercase = "abcdefghijklmnopqrstuvwxyz";
77
- const uppercase = lowercase.toUpperCase();
78
- const digits = "0123456789";
79
- for (const s of auth) {
80
- if (lowercase.includes(s)) {
81
- n += String.fromCharCode(((32 - (s.charCodeAt(0) - 97)) % 26) + 97);
82
- }
83
- else if (uppercase.includes(s)) {
84
- n += String.fromCharCode(((29 - (s.charCodeAt(0) - 65)) % 26) + 65);
85
- }
86
- else if (digits.includes(s)) {
87
- n += String.fromCharCode(((13 - (s.charCodeAt(0) - 48)) % 10) + 48);
88
- }
89
- else {
90
- n += s;
91
- }
92
- }
93
- return n;
94
- };
95
- exports.default = Crypto;
package/rubjs/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import Client from "./client";
2
- import Crypto from "./crypto";
3
- import * as Types from "./types";
4
- import { Filters, Utils } from "./utils";
5
- import { VoiceChatClient, SendLiveClient, LoginClient } from "./clients";
6
- export default Client;
7
- export { Utils, Types, Crypto, Client, Filters, LoginClient, SendLiveClient, VoiceChatClient };