rubjs 2.4.0 → 2.4.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.
- package/package.json +1 -1
- package/rubjs/client.d.ts +0 -35
- package/rubjs/client.js +0 -48
- package/rubjs/crypto/index.d.ts +0 -12
- package/rubjs/crypto/index.js +0 -95
- package/rubjs/index.d.ts +0 -7
- package/rubjs/index.js +0 -51
- package/rubjs/methods/advanced/builder.d.ts +0 -3
- package/rubjs/methods/advanced/builder.js +0 -41
- package/rubjs/methods/advanced/index.d.ts +0 -2
- package/rubjs/methods/advanced/index.js +0 -8
- package/rubjs/methods/auth/index.d.ts +0 -5
- package/rubjs/methods/auth/index.js +0 -14
- package/rubjs/methods/auth/logout.d.ts +0 -3
- package/rubjs/methods/auth/logout.js +0 -17
- package/rubjs/methods/auth/registerDevice.d.ts +0 -3
- package/rubjs/methods/auth/registerDevice.js +0 -61
- package/rubjs/methods/auth/sendCode.d.ts +0 -3
- package/rubjs/methods/auth/sendCode.js +0 -25
- package/rubjs/methods/auth/signIn.d.ts +0 -3
- package/rubjs/methods/auth/signIn.js +0 -24
- package/rubjs/methods/channels/addChannel.d.ts +0 -3
- package/rubjs/methods/channels/addChannel.js +0 -26
- package/rubjs/methods/channels/addChannelMembers.d.ts +0 -3
- package/rubjs/methods/channels/addChannelMembers.js +0 -22
- package/rubjs/methods/channels/banChannelMember.d.ts +0 -3
- package/rubjs/methods/channels/banChannelMember.js +0 -23
- package/rubjs/methods/channels/cancelChangeObjectOwner.d.ts +0 -3
- package/rubjs/methods/channels/cancelChangeObjectOwner.js +0 -17
- package/rubjs/methods/channels/channelPreviewByJoinLink.d.ts +0 -3
- package/rubjs/methods/channels/channelPreviewByJoinLink.js +0 -19
- package/rubjs/methods/channels/checkChannelUsername.d.ts +0 -3
- package/rubjs/methods/channels/checkChannelUsername.js +0 -19
- package/rubjs/methods/channels/createChannelVoiceChat.d.ts +0 -3
- package/rubjs/methods/channels/createChannelVoiceChat.js +0 -17
- package/rubjs/methods/channels/discardChannelVoiceChat.d.ts +0 -3
- package/rubjs/methods/channels/discardChannelVoiceChat.js +0 -20
- package/rubjs/methods/channels/editChannelInfo.d.ts +0 -4
- package/rubjs/methods/channels/editChannelInfo.js +0 -48
- package/rubjs/methods/channels/getBannedChannelMembers.d.ts +0 -3
- package/rubjs/methods/channels/getBannedChannelMembers.js +0 -20
- package/rubjs/methods/channels/getChannelAdminAccessList.d.ts +0 -3
- package/rubjs/methods/channels/getChannelAdminAccessList.js +0 -20
- package/rubjs/methods/channels/getChannelAdminMembers.d.ts +0 -3
- package/rubjs/methods/channels/getChannelAdminMembers.js +0 -20
- package/rubjs/methods/channels/getChannelAllMembers.d.ts +0 -3
- package/rubjs/methods/channels/getChannelAllMembers.js +0 -21
- package/rubjs/methods/channels/getChannelInfo.d.ts +0 -3
- package/rubjs/methods/channels/getChannelInfo.js +0 -17
- package/rubjs/methods/channels/getChannelLink.d.ts +0 -3
- package/rubjs/methods/channels/getChannelLink.js +0 -17
- package/rubjs/methods/channels/getPendingObjectOwner.d.ts +0 -3
- package/rubjs/methods/channels/getPendingObjectOwner.js +0 -17
- package/rubjs/methods/channels/index.d.ts +0 -26
- package/rubjs/methods/channels/index.js +0 -56
- package/rubjs/methods/channels/joinChannelAction.d.ts +0 -3
- package/rubjs/methods/channels/joinChannelAction.js +0 -19
- package/rubjs/methods/channels/joinChannelByLink.d.ts +0 -3
- package/rubjs/methods/channels/joinChannelByLink.js +0 -19
- package/rubjs/methods/channels/leaveChannelVoiceChat.d.ts +0 -3
- package/rubjs/methods/channels/leaveChannelVoiceChat.js +0 -20
- package/rubjs/methods/channels/removeChannel.d.ts +0 -3
- package/rubjs/methods/channels/removeChannel.js +0 -17
- package/rubjs/methods/channels/requestChangeObjectOwner.d.ts +0 -3
- package/rubjs/methods/channels/requestChangeObjectOwner.js +0 -20
- package/rubjs/methods/channels/seenChannelMessages.d.ts +0 -3
- package/rubjs/methods/channels/seenChannelMessages.js +0 -21
- package/rubjs/methods/channels/setChannelLink.d.ts +0 -3
- package/rubjs/methods/channels/setChannelLink.js +0 -17
- package/rubjs/methods/channels/setChannelVoiceChatSetting.d.ts +0 -3
- package/rubjs/methods/channels/setChannelVoiceChatSetting.js +0 -26
- package/rubjs/methods/channels/updateChannelUsername.d.ts +0 -3
- package/rubjs/methods/channels/updateChannelUsername.js +0 -20
- package/rubjs/methods/chats/actionOnJoinRequest.d.ts +0 -3
- package/rubjs/methods/chats/actionOnJoinRequest.js +0 -22
- package/rubjs/methods/chats/addLiveComment.d.ts +0 -3
- package/rubjs/methods/chats/addLiveComment.js +0 -17
- package/rubjs/methods/chats/clickMessageUrl.d.ts +0 -3
- package/rubjs/methods/chats/clickMessageUrl.js +0 -17
- package/rubjs/methods/chats/createJoinLink.d.ts +0 -3
- package/rubjs/methods/chats/createJoinLink.js +0 -23
- package/rubjs/methods/chats/deleteAvatar.d.ts +0 -3
- package/rubjs/methods/chats/deleteAvatar.js +0 -17
- package/rubjs/methods/chats/deleteChatHistory.d.ts +0 -3
- package/rubjs/methods/chats/deleteChatHistory.js +0 -20
- package/rubjs/methods/chats/editJoinLink.d.ts +0 -3
- package/rubjs/methods/chats/editJoinLink.js +0 -34
- package/rubjs/methods/chats/getAbsObjects.d.ts +0 -3
- package/rubjs/methods/chats/getAbsObjects.js +0 -19
- package/rubjs/methods/chats/getAvatars.d.ts +0 -3
- package/rubjs/methods/chats/getAvatars.js +0 -17
- package/rubjs/methods/chats/getChatReaction.d.ts +0 -3
- package/rubjs/methods/chats/getChatReaction.js +0 -17
- package/rubjs/methods/chats/getChats.d.ts +0 -3
- package/rubjs/methods/chats/getChats.js +0 -17
- package/rubjs/methods/chats/getChatsUpdates.d.ts +0 -3
- package/rubjs/methods/chats/getChatsUpdates.js +0 -17
- package/rubjs/methods/chats/getJoinLinks.d.ts +0 -3
- package/rubjs/methods/chats/getJoinLinks.js +0 -17
- package/rubjs/methods/chats/getJoinRequests.d.ts +0 -3
- package/rubjs/methods/chats/getJoinRequests.js +0 -17
- package/rubjs/methods/chats/getLinkFromAppUrl.d.ts +0 -3
- package/rubjs/methods/chats/getLinkFromAppUrl.js +0 -17
- package/rubjs/methods/chats/getLiveComments.d.ts +0 -3
- package/rubjs/methods/chats/getLiveComments.js +0 -17
- package/rubjs/methods/chats/getLivePlayUrl.d.ts +0 -3
- package/rubjs/methods/chats/getLivePlayUrl.js +0 -17
- package/rubjs/methods/chats/getLiveStatus.d.ts +0 -3
- package/rubjs/methods/chats/getLiveStatus.js +0 -17
- package/rubjs/methods/chats/getObjectInfoByUsername.d.ts +0 -3
- package/rubjs/methods/chats/getObjectInfoByUsername.js +0 -19
- package/rubjs/methods/chats/getTopChatUsers.d.ts +0 -3
- package/rubjs/methods/chats/getTopChatUsers.js +0 -18
- package/rubjs/methods/chats/index.d.ts +0 -29
- package/rubjs/methods/chats/index.js +0 -62
- package/rubjs/methods/chats/removeFromTopChatUsers.d.ts +0 -3
- package/rubjs/methods/chats/removeFromTopChatUsers.js +0 -17
- package/rubjs/methods/chats/removeJoinLink.d.ts +0 -3
- package/rubjs/methods/chats/removeJoinLink.js +0 -19
- package/rubjs/methods/chats/searchChatMessages.d.ts +0 -3
- package/rubjs/methods/chats/searchChatMessages.js +0 -23
- package/rubjs/methods/chats/searchGlobalMessages.d.ts +0 -3
- package/rubjs/methods/chats/searchGlobalMessages.js +0 -17
- package/rubjs/methods/chats/seenChats.d.ts +0 -3
- package/rubjs/methods/chats/seenChats.js +0 -17
- package/rubjs/methods/chats/sendChatActivity.d.ts +0 -3
- package/rubjs/methods/chats/sendChatActivity.js +0 -19
- package/rubjs/methods/chats/sendLive.d.ts +0 -3
- package/rubjs/methods/chats/sendLive.js +0 -28
- package/rubjs/methods/chats/setActionChat.d.ts +0 -3
- package/rubjs/methods/chats/setActionChat.js +0 -19
- package/rubjs/methods/chats/uploadAvatar.d.ts +0 -3
- package/rubjs/methods/chats/uploadAvatar.js +0 -29
- package/rubjs/methods/contacts/addAddressBook.d.ts +0 -3
- package/rubjs/methods/contacts/addAddressBook.js +0 -17
- package/rubjs/methods/contacts/deleteContact.d.ts +0 -3
- package/rubjs/methods/contacts/deleteContact.js +0 -17
- package/rubjs/methods/contacts/getContacts.d.ts +0 -3
- package/rubjs/methods/contacts/getContacts.js +0 -17
- package/rubjs/methods/contacts/getContactsLastOnline.d.ts +0 -3
- package/rubjs/methods/contacts/getContactsLastOnline.js +0 -17
- package/rubjs/methods/contacts/getContactsUpdates.d.ts +0 -3
- package/rubjs/methods/contacts/getContactsUpdates.js +0 -17
- package/rubjs/methods/contacts/index.d.ts +0 -7
- package/rubjs/methods/contacts/index.js +0 -18
- package/rubjs/methods/contacts/resetContacts.d.ts +0 -3
- package/rubjs/methods/contacts/resetContacts.js +0 -18
- package/rubjs/methods/extras/banMember.d.ts +0 -3
- package/rubjs/methods/extras/banMember.js +0 -20
- package/rubjs/methods/extras/getInfo.d.ts +0 -3
- package/rubjs/methods/extras/getInfo.js +0 -26
- package/rubjs/methods/extras/getObjectByUsername.d.ts +0 -3
- package/rubjs/methods/extras/getObjectByUsername.js +0 -19
- package/rubjs/methods/extras/getProfileLinkItems.d.ts +0 -3
- package/rubjs/methods/extras/getProfileLinkItems.js +0 -17
- package/rubjs/methods/extras/getRelatedObjects.d.ts +0 -3
- package/rubjs/methods/extras/getRelatedObjects.js +0 -17
- package/rubjs/methods/extras/getTranscription.d.ts +0 -3
- package/rubjs/methods/extras/getTranscription.js +0 -20
- package/rubjs/methods/extras/index.d.ts +0 -13
- package/rubjs/methods/extras/index.js +0 -30
- package/rubjs/methods/extras/join.d.ts +0 -3
- package/rubjs/methods/extras/join.js +0 -22
- package/rubjs/methods/extras/leaveChat.d.ts +0 -3
- package/rubjs/methods/extras/leaveChat.js +0 -20
- package/rubjs/methods/extras/reportObject.d.ts +0 -14
- package/rubjs/methods/extras/reportObject.js +0 -32
- package/rubjs/methods/extras/searchGlobalObjects.d.ts +0 -3
- package/rubjs/methods/extras/searchGlobalObjects.js +0 -17
- package/rubjs/methods/extras/transcribeVoice.d.ts +0 -3
- package/rubjs/methods/extras/transcribeVoice.js +0 -17
- package/rubjs/methods/extras/userIsAdmin.d.ts +0 -3
- package/rubjs/methods/extras/userIsAdmin.js +0 -29
- package/rubjs/methods/gif/addToMyGifSet.d.ts +0 -3
- package/rubjs/methods/gif/addToMyGifSet.js +0 -17
- package/rubjs/methods/gif/getMyGifSet.d.ts +0 -3
- package/rubjs/methods/gif/getMyGifSet.js +0 -17
- package/rubjs/methods/gif/index.d.ts +0 -4
- package/rubjs/methods/gif/index.js +0 -12
- package/rubjs/methods/gif/removeFromMyGifSet.d.ts +0 -3
- package/rubjs/methods/gif/removeFromMyGifSet.js +0 -17
- package/rubjs/methods/groups/addGroup.d.ts +0 -3
- package/rubjs/methods/groups/addGroup.js +0 -19
- package/rubjs/methods/groups/addGroupMembers.d.ts +0 -3
- package/rubjs/methods/groups/addGroupMembers.js +0 -19
- package/rubjs/methods/groups/banGroupMember.d.ts +0 -3
- package/rubjs/methods/groups/banGroupMember.js +0 -23
- package/rubjs/methods/groups/createGroupVoiceChat.d.ts +0 -3
- package/rubjs/methods/groups/createGroupVoiceChat.js +0 -17
- package/rubjs/methods/groups/deleteNoAccessGroupChat.d.ts +0 -3
- package/rubjs/methods/groups/deleteNoAccessGroupChat.js +0 -17
- package/rubjs/methods/groups/discardGroupVoiceChat.d.ts +0 -3
- package/rubjs/methods/groups/discardGroupVoiceChat.js +0 -20
- package/rubjs/methods/groups/editGroupInfo.d.ts +0 -6
- package/rubjs/methods/groups/editGroupInfo.js +0 -51
- package/rubjs/methods/groups/getBannedGroupMembers.d.ts +0 -3
- package/rubjs/methods/groups/getBannedGroupMembers.js +0 -17
- package/rubjs/methods/groups/getGroupAdminAccessList.d.ts +0 -3
- package/rubjs/methods/groups/getGroupAdminAccessList.js +0 -20
- package/rubjs/methods/groups/getGroupAdminMembers.d.ts +0 -3
- package/rubjs/methods/groups/getGroupAdminMembers.js +0 -17
- package/rubjs/methods/groups/getGroupAllMembers.d.ts +0 -3
- package/rubjs/methods/groups/getGroupAllMembers.js +0 -21
- package/rubjs/methods/groups/getGroupDefaultAccess.d.ts +0 -3
- package/rubjs/methods/groups/getGroupDefaultAccess.js +0 -17
- package/rubjs/methods/groups/getGroupInfo.d.ts +0 -3
- package/rubjs/methods/groups/getGroupInfo.js +0 -17
- package/rubjs/methods/groups/getGroupLink.d.ts +0 -3
- package/rubjs/methods/groups/getGroupLink.js +0 -17
- package/rubjs/methods/groups/getGroupMentionList.d.ts +0 -3
- package/rubjs/methods/groups/getGroupMentionList.js +0 -20
- package/rubjs/methods/groups/getGroupOnlineCount.d.ts +0 -3
- package/rubjs/methods/groups/getGroupOnlineCount.js +0 -17
- package/rubjs/methods/groups/getGroupVoiceChatUpdates.d.ts +0 -3
- package/rubjs/methods/groups/getGroupVoiceChatUpdates.js +0 -21
- package/rubjs/methods/groups/groupPreviewByJoinLink.d.ts +0 -3
- package/rubjs/methods/groups/groupPreviewByJoinLink.js +0 -19
- package/rubjs/methods/groups/index.d.ts +0 -28
- package/rubjs/methods/groups/index.js +0 -60
- package/rubjs/methods/groups/joinGroup.d.ts +0 -3
- package/rubjs/methods/groups/joinGroup.js +0 -19
- package/rubjs/methods/groups/leaveGroup.d.ts +0 -3
- package/rubjs/methods/groups/leaveGroup.js +0 -17
- package/rubjs/methods/groups/leaveGroupVoiceChat.d.ts +0 -3
- package/rubjs/methods/groups/leaveGroupVoiceChat.js +0 -20
- package/rubjs/methods/groups/removeGroup.d.ts +0 -3
- package/rubjs/methods/groups/removeGroup.js +0 -17
- package/rubjs/methods/groups/seenGroupMessages.d.ts +0 -3
- package/rubjs/methods/groups/seenGroupMessages.js +0 -21
- package/rubjs/methods/groups/setGroupAdmin.d.ts +0 -5
- package/rubjs/methods/groups/setGroupAdmin.js +0 -26
- package/rubjs/methods/groups/setGroupDefaultAccess.d.ts +0 -4
- package/rubjs/methods/groups/setGroupDefaultAccess.js +0 -22
- package/rubjs/methods/groups/setGroupLink.d.ts +0 -3
- package/rubjs/methods/groups/setGroupLink.js +0 -17
- package/rubjs/methods/groups/setGroupVoiceChatSetting.d.ts +0 -3
- package/rubjs/methods/groups/setGroupVoiceChatSetting.js +0 -26
- package/rubjs/methods/index.d.ts +0 -195
- package/rubjs/methods/index.js +0 -929
- package/rubjs/methods/messages/actionOnMessageReaction.d.ts +0 -3
- package/rubjs/methods/messages/actionOnMessageReaction.js +0 -25
- package/rubjs/methods/messages/createPoll.d.ts +0 -3
- package/rubjs/methods/messages/createPoll.js +0 -35
- package/rubjs/methods/messages/deleteMessages.d.ts +0 -3
- package/rubjs/methods/messages/deleteMessages.js +0 -26
- package/rubjs/methods/messages/editMessage.d.ts +0 -3
- package/rubjs/methods/messages/editMessage.js +0 -23
- package/rubjs/methods/messages/forwardMessages.d.ts +0 -3
- package/rubjs/methods/messages/forwardMessages.js +0 -31
- package/rubjs/methods/messages/getMessageShareUrl.d.ts +0 -3
- package/rubjs/methods/messages/getMessageShareUrl.js +0 -17
- package/rubjs/methods/messages/getMessages.d.ts +0 -3
- package/rubjs/methods/messages/getMessages.js +0 -23
- package/rubjs/methods/messages/getMessagesByID.d.ts +0 -3
- package/rubjs/methods/messages/getMessagesByID.js +0 -22
- package/rubjs/methods/messages/getMessagesInterval.d.ts +0 -3
- package/rubjs/methods/messages/getMessagesInterval.js +0 -20
- package/rubjs/methods/messages/getMessagesUpdates.d.ts +0 -3
- package/rubjs/methods/messages/getMessagesUpdates.js +0 -17
- package/rubjs/methods/messages/getPollOptionVoters.d.ts +0 -3
- package/rubjs/methods/messages/getPollOptionVoters.js +0 -21
- package/rubjs/methods/messages/getPollStatus.d.ts +0 -3
- package/rubjs/methods/messages/getPollStatus.js +0 -17
- package/rubjs/methods/messages/index.d.ts +0 -26
- package/rubjs/methods/messages/index.js +0 -56
- package/rubjs/methods/messages/requestSendFile.d.ts +0 -4
- package/rubjs/methods/messages/requestSendFile.js +0 -22
- package/rubjs/methods/messages/sendDocument.d.ts +0 -3
- package/rubjs/methods/messages/sendDocument.js +0 -17
- package/rubjs/methods/messages/sendGif.d.ts +0 -3
- package/rubjs/methods/messages/sendGif.js +0 -17
- package/rubjs/methods/messages/sendMessage.d.ts +0 -3
- package/rubjs/methods/messages/sendMessage.js +0 -146
- package/rubjs/methods/messages/sendMusic.d.ts +0 -3
- package/rubjs/methods/messages/sendMusic.js +0 -17
- package/rubjs/methods/messages/sendPhoto.d.ts +0 -3
- package/rubjs/methods/messages/sendPhoto.js +0 -17
- package/rubjs/methods/messages/sendSticker.d.ts +0 -3
- package/rubjs/methods/messages/sendSticker.js +0 -17
- package/rubjs/methods/messages/sendText.d.ts +0 -3
- package/rubjs/methods/messages/sendText.js +0 -17
- package/rubjs/methods/messages/sendVideo.d.ts +0 -3
- package/rubjs/methods/messages/sendVideo.js +0 -17
- package/rubjs/methods/messages/sendVideoMessage.d.ts +0 -3
- package/rubjs/methods/messages/sendVideoMessage.js +0 -17
- package/rubjs/methods/messages/sendVoice.d.ts +0 -3
- package/rubjs/methods/messages/sendVoice.js +0 -17
- package/rubjs/methods/messages/setPinMessage.d.ts +0 -3
- package/rubjs/methods/messages/setPinMessage.js +0 -23
- package/rubjs/methods/messages/votePoll.d.ts +0 -3
- package/rubjs/methods/messages/votePoll.js +0 -17
- package/rubjs/methods/settings/changePassword.d.ts +0 -3
- package/rubjs/methods/settings/changePassword.js +0 -17
- package/rubjs/methods/settings/checkTwoStepPasscode.d.ts +0 -3
- package/rubjs/methods/settings/checkTwoStepPasscode.js +0 -17
- package/rubjs/methods/settings/deleteFolder.d.ts +0 -3
- package/rubjs/methods/settings/deleteFolder.js +0 -17
- package/rubjs/methods/settings/getBlockedUsers.d.ts +0 -3
- package/rubjs/methods/settings/getBlockedUsers.js +0 -17
- package/rubjs/methods/settings/getFolders.d.ts +0 -3
- package/rubjs/methods/settings/getFolders.js +0 -17
- package/rubjs/methods/settings/getMySessions.d.ts +0 -3
- package/rubjs/methods/settings/getMySessions.js +0 -17
- package/rubjs/methods/settings/getPrivacySetting.d.ts +0 -3
- package/rubjs/methods/settings/getPrivacySetting.js +0 -17
- package/rubjs/methods/settings/getSuggestedFolders.d.ts +0 -3
- package/rubjs/methods/settings/getSuggestedFolders.js +0 -17
- package/rubjs/methods/settings/getTwoPasscodeStatus.d.ts +0 -3
- package/rubjs/methods/settings/getTwoPasscodeStatus.js +0 -17
- package/rubjs/methods/settings/index.d.ts +0 -19
- package/rubjs/methods/settings/index.js +0 -42
- package/rubjs/methods/settings/requestRecoveryEmail.d.ts +0 -3
- package/rubjs/methods/settings/requestRecoveryEmail.js +0 -20
- package/rubjs/methods/settings/setSetting.d.ts +0 -5
- package/rubjs/methods/settings/setSetting.js +0 -50
- package/rubjs/methods/settings/setupTwoStepVerification.d.ts +0 -3
- package/rubjs/methods/settings/setupTwoStepVerification.js +0 -21
- package/rubjs/methods/settings/terminateOtherSessions.d.ts +0 -3
- package/rubjs/methods/settings/terminateOtherSessions.js +0 -18
- package/rubjs/methods/settings/terminateSession.d.ts +0 -3
- package/rubjs/methods/settings/terminateSession.js +0 -17
- package/rubjs/methods/settings/turnOffTwoStep.d.ts +0 -3
- package/rubjs/methods/settings/turnOffTwoStep.js +0 -18
- package/rubjs/methods/settings/updateProfile.d.ts +0 -3
- package/rubjs/methods/settings/updateProfile.js +0 -30
- package/rubjs/methods/settings/updateUsername.d.ts +0 -3
- package/rubjs/methods/settings/updateUsername.js +0 -17
- package/rubjs/methods/settings/verifyRecoveryEmail.d.ts +0 -3
- package/rubjs/methods/settings/verifyRecoveryEmail.js +0 -17
- package/rubjs/methods/stickers/actionOnStickerSet.d.ts +0 -3
- package/rubjs/methods/stickers/actionOnStickerSet.js +0 -19
- package/rubjs/methods/stickers/getMyStickerSets.d.ts +0 -3
- package/rubjs/methods/stickers/getMyStickerSets.js +0 -17
- package/rubjs/methods/stickers/getStickerSetByID.d.ts +0 -3
- package/rubjs/methods/stickers/getStickerSetByID.js +0 -17
- package/rubjs/methods/stickers/getStickersByEmoji.d.ts +0 -3
- package/rubjs/methods/stickers/getStickersByEmoji.js +0 -17
- package/rubjs/methods/stickers/getStickersBySetIds.d.ts +0 -3
- package/rubjs/methods/stickers/getStickersBySetIds.js +0 -19
- package/rubjs/methods/stickers/getTrendStickerSets.d.ts +0 -3
- package/rubjs/methods/stickers/getTrendStickerSets.js +0 -17
- package/rubjs/methods/stickers/index.d.ts +0 -8
- package/rubjs/methods/stickers/index.js +0 -20
- package/rubjs/methods/stickers/searchStickers.d.ts +0 -3
- package/rubjs/methods/stickers/searchStickers.js +0 -17
- package/rubjs/methods/users/checkUserUsername.d.ts +0 -3
- package/rubjs/methods/users/checkUserUsername.js +0 -17
- package/rubjs/methods/users/deleteUserChat.d.ts +0 -3
- package/rubjs/methods/users/deleteUserChat.js +0 -20
- package/rubjs/methods/users/getMe.d.ts +0 -3
- package/rubjs/methods/users/getMe.js +0 -17
- package/rubjs/methods/users/getUserInfo.d.ts +0 -4
- package/rubjs/methods/users/getUserInfo.js +0 -18
- package/rubjs/methods/users/index.d.ts +0 -6
- package/rubjs/methods/users/index.js +0 -16
- package/rubjs/methods/users/setBlockUser.d.ts +0 -3
- package/rubjs/methods/users/setBlockUser.js +0 -19
- package/rubjs/methods/utilities/download.d.ts +0 -4
- package/rubjs/methods/utilities/download.js +0 -17
- package/rubjs/methods/utilities/downloadProfilePicture.d.ts +0 -3
- package/rubjs/methods/utilities/downloadProfilePicture.js +0 -27
- package/rubjs/methods/utilities/get.d.ts +0 -4
- package/rubjs/methods/utilities/get.js +0 -21
- package/rubjs/methods/utilities/index.d.ts +0 -8
- package/rubjs/methods/utilities/index.js +0 -20
- package/rubjs/methods/utilities/post.d.ts +0 -4
- package/rubjs/methods/utilities/post.js +0 -21
- package/rubjs/methods/utilities/run.d.ts +0 -3
- package/rubjs/methods/utilities/run.js +0 -24
- package/rubjs/methods/utilities/start.d.ts +0 -3
- package/rubjs/methods/utilities/start.js +0 -70
- package/rubjs/methods/utilities/thumbnail.d.ts +0 -6
- package/rubjs/methods/utilities/thumbnail.js +0 -75
- package/rubjs/network/index.d.ts +0 -38
- package/rubjs/network/index.js +0 -338
- package/rubjs/parser/index.d.ts +0 -25
- package/rubjs/parser/index.js +0 -112
- package/rubjs/session/index.d.ts +0 -18
- package/rubjs/session/index.js +0 -57
- package/rubjs/types/auth.d.ts +0 -40
- package/rubjs/types/auth.js +0 -2
- package/rubjs/types/chats.d.ts +0 -79
- package/rubjs/types/chats.js +0 -2
- package/rubjs/types/decorators.d.ts +0 -168
- package/rubjs/types/decorators.js +0 -2
- package/rubjs/types/groups.d.ts +0 -129
- package/rubjs/types/groups.js +0 -2
- package/rubjs/types/index.d.ts +0 -8
- package/rubjs/types/index.js +0 -53
- package/rubjs/types/message.d.ts +0 -25
- package/rubjs/types/message.js +0 -61
- package/rubjs/types/messages.d.ts +0 -176
- package/rubjs/types/messages.js +0 -2
- package/rubjs/types/users.d.ts +0 -64
- package/rubjs/types/users.js +0 -2
- package/rubjs/utils/filters.d.ts +0 -29
- package/rubjs/utils/filters.js +0 -123
- package/rubjs/utils/index.d.ts +0 -3
- package/rubjs/utils/index.js +0 -10
- package/rubjs/utils/utils.d.ts +0 -10
- package/rubjs/utils/utils.js +0 -12
package/package.json
CHANGED
package/rubjs/client.d.ts
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
import Methods from "./methods";
|
2
|
-
import Network from "./network";
|
3
|
-
import SQLiteSession from "./session";
|
4
|
-
interface Platform {
|
5
|
-
app_name: string;
|
6
|
-
app_version: string;
|
7
|
-
platform: string;
|
8
|
-
package: string;
|
9
|
-
lang_code: string;
|
10
|
-
}
|
11
|
-
type TypeUpdate = "show_activities" | "chat_updates" | "message_updates" | "show_notifications";
|
12
|
-
type PlatformType = "Web" | "Android";
|
13
|
-
declare class Client extends Methods {
|
14
|
-
defaultPlatform: Platform;
|
15
|
-
apiVersion: string;
|
16
|
-
userAgent: string;
|
17
|
-
key: Buffer<ArrayBuffer>;
|
18
|
-
decode_auth: string;
|
19
|
-
auth: string | null;
|
20
|
-
timeout: number;
|
21
|
-
network: Network;
|
22
|
-
privateKey: string | null;
|
23
|
-
sessionFile: string;
|
24
|
-
platform: PlatformType;
|
25
|
-
userGuid: string | null;
|
26
|
-
sessionDb: SQLiteSession;
|
27
|
-
initialize: boolean;
|
28
|
-
eventHandlers: {
|
29
|
-
callback: Function;
|
30
|
-
filters: ((msg: any) => boolean)[];
|
31
|
-
updateType: TypeUpdate;
|
32
|
-
}[];
|
33
|
-
constructor(sessionFile: string, timeout?: number, platform?: PlatformType);
|
34
|
-
}
|
35
|
-
export default Client;
|
package/rubjs/client.js
DELETED
@@ -1,48 +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 methods_1 = __importDefault(require("./methods"));
|
7
|
-
const network_1 = __importDefault(require("./network"));
|
8
|
-
const session_1 = __importDefault(require("./session"));
|
9
|
-
class Client extends methods_1.default {
|
10
|
-
constructor(sessionFile, timeout, platform = "Web") {
|
11
|
-
super();
|
12
|
-
this.defaultPlatform = {
|
13
|
-
app_name: "Main",
|
14
|
-
app_version: "4.4.9",
|
15
|
-
platform: "Web",
|
16
|
-
package: "web.rubika.ir",
|
17
|
-
lang_code: "fa",
|
18
|
-
};
|
19
|
-
this.apiVersion = "6";
|
20
|
-
this.userAgent = `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36`;
|
21
|
-
if (platform.toLowerCase() === "android") {
|
22
|
-
this.defaultPlatform.platform = "Android";
|
23
|
-
this.defaultPlatform.package = "app.rbmain.a";
|
24
|
-
this.defaultPlatform.app_version = "3.6.4";
|
25
|
-
}
|
26
|
-
this.sessionFile = sessionFile;
|
27
|
-
this.userGuid = null;
|
28
|
-
this.timeout = timeout !== null && timeout !== void 0 ? timeout : 0;
|
29
|
-
this.eventHandlers = [];
|
30
|
-
this.platform = platform;
|
31
|
-
this.sessionDb = new session_1.default(sessionFile);
|
32
|
-
this.network = new network_1.default(this);
|
33
|
-
this.auth = null;
|
34
|
-
this.privateKey = null;
|
35
|
-
this.eventHandlers = [];
|
36
|
-
this.initialize = false;
|
37
|
-
const DBInformation = this.sessionDb.getSession();
|
38
|
-
if (DBInformation) {
|
39
|
-
this.auth = DBInformation.auth;
|
40
|
-
this.userGuid = DBInformation.guid;
|
41
|
-
this.privateKey = DBInformation.private_key;
|
42
|
-
if (typeof DBInformation.agent === "string")
|
43
|
-
this.userAgent = DBInformation.agent || this.userAgent;
|
44
|
-
}
|
45
|
-
this.start();
|
46
|
-
}
|
47
|
-
}
|
48
|
-
exports.default = Client;
|
package/rubjs/crypto/index.d.ts
DELETED
@@ -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;
|
package/rubjs/crypto/index.js
DELETED
@@ -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
package/rubjs/index.js
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
19
|
-
var ownKeys = function(o) {
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
-
var ar = [];
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
-
return ar;
|
24
|
-
};
|
25
|
-
return ownKeys(o);
|
26
|
-
};
|
27
|
-
return function (mod) {
|
28
|
-
if (mod && mod.__esModule) return mod;
|
29
|
-
var result = {};
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
-
__setModuleDefault(result, mod);
|
32
|
-
return result;
|
33
|
-
};
|
34
|
-
})();
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
37
|
-
};
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
39
|
-
exports.Types = exports.Filters = exports.Utils = exports.Markdown = exports.Crypto = exports.Client = void 0;
|
40
|
-
const client_1 = __importDefault(require("./client"));
|
41
|
-
exports.Client = client_1.default;
|
42
|
-
const crypto_1 = __importDefault(require("./crypto"));
|
43
|
-
exports.Crypto = crypto_1.default;
|
44
|
-
const parser_1 = __importDefault(require("./parser"));
|
45
|
-
exports.Markdown = parser_1.default;
|
46
|
-
const Types = __importStar(require("./types"));
|
47
|
-
exports.Types = Types;
|
48
|
-
const utils_1 = require("./utils");
|
49
|
-
Object.defineProperty(exports, "Filters", { enumerable: true, get: function () { return utils_1.Filters; } });
|
50
|
-
Object.defineProperty(exports, "Utils", { enumerable: true, get: function () { return utils_1.Utils; } });
|
51
|
-
exports.default = client_1.default;
|
@@ -1,41 +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
|
-
function builder(name_1, input_1) {
|
17
|
-
return __awaiter(this, arguments, void 0, function* (name, input, tmp_session = false) {
|
18
|
-
if (!this.auth)
|
19
|
-
this.auth = crypto_1.default.secret(32);
|
20
|
-
if (!this.key)
|
21
|
-
this.key = Buffer.from(crypto_1.default.passphrase(this.auth), "utf8");
|
22
|
-
let result = yield this.network.send({
|
23
|
-
input,
|
24
|
-
tmp_session,
|
25
|
-
method: name,
|
26
|
-
});
|
27
|
-
if (result) {
|
28
|
-
const data_enc = result.data_enc;
|
29
|
-
if (data_enc) {
|
30
|
-
const decrypted = crypto_1.default.decrypt(data_enc, this.key);
|
31
|
-
result = JSON.parse(decrypted);
|
32
|
-
}
|
33
|
-
const status = result.status;
|
34
|
-
const status_det = result.status_det;
|
35
|
-
if (status == "OK" && status_det == "OK") {
|
36
|
-
return result.data;
|
37
|
-
}
|
38
|
-
}
|
39
|
-
});
|
40
|
-
}
|
41
|
-
exports.default = builder;
|
@@ -1,8 +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.builder = void 0;
|
7
|
-
const builder_1 = __importDefault(require("./builder"));
|
8
|
-
exports.builder = builder_1.default;
|
@@ -1,14 +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.logout = exports.signIn = exports.sendCode = exports.registerDevice = void 0;
|
7
|
-
const registerDevice_1 = __importDefault(require("./registerDevice"));
|
8
|
-
exports.registerDevice = registerDevice_1.default;
|
9
|
-
const sendCode_1 = __importDefault(require("./sendCode"));
|
10
|
-
exports.sendCode = sendCode_1.default;
|
11
|
-
const signIn_1 = __importDefault(require("./signIn"));
|
12
|
-
exports.signIn = signIn_1.default;
|
13
|
-
const logout_1 = __importDefault(require("./logout"));
|
14
|
-
exports.logout = logout_1.default;
|
@@ -1,17 +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
|
-
function logout() {
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
14
|
-
return yield this.builder("logout", {});
|
15
|
-
});
|
16
|
-
}
|
17
|
-
exports.default = logout;
|
@@ -1,61 +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 systemVersions = {
|
13
|
-
"Windows NT 10.0": "Windows 10",
|
14
|
-
"Windows NT 6.2": "Windows 8",
|
15
|
-
"Windows NT 6.1": "Windows 7",
|
16
|
-
"Windows NT 6.0": "Windows Vista",
|
17
|
-
"Windows NT 5.1": "windows XP",
|
18
|
-
"Windows NT 5.0": "Windows 2000",
|
19
|
-
Mac: "Mac/iOS",
|
20
|
-
X11: "UNIX",
|
21
|
-
Linux: "Linux",
|
22
|
-
};
|
23
|
-
function getBrowser(userAgent, langCode, appVersion, ...args) {
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
25
|
-
var _a;
|
26
|
-
const deviceModelMatch = userAgent
|
27
|
-
.toLowerCase()
|
28
|
-
.match(/(opera|chrome|safari|firefox|msie|trident)\/(\d+)/);
|
29
|
-
let deviceModel = "Unknown";
|
30
|
-
if (!deviceModelMatch) {
|
31
|
-
console.warn(`Cannot parse user-agent (${userAgent})`);
|
32
|
-
}
|
33
|
-
else {
|
34
|
-
deviceModel = `${deviceModelMatch[1]} ${deviceModelMatch[2]}`;
|
35
|
-
}
|
36
|
-
let systemVersion = "Unknown";
|
37
|
-
for (const [key, value] of Object.entries(systemVersions)) {
|
38
|
-
if (userAgent.includes(key)) {
|
39
|
-
systemVersion = value;
|
40
|
-
break;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
const deviceHash = "2" + (((_a = userAgent.match(/\d+/g)) === null || _a === void 0 ? void 0 : _a.join("")) || "");
|
44
|
-
return {
|
45
|
-
token: "",
|
46
|
-
lang_code: langCode,
|
47
|
-
token_type: "Web",
|
48
|
-
app_version: `WB_${appVersion}`,
|
49
|
-
system_version: systemVersion,
|
50
|
-
device_model: deviceModel.charAt(0).toUpperCase() + deviceModel.slice(1),
|
51
|
-
device_hash: deviceHash,
|
52
|
-
};
|
53
|
-
});
|
54
|
-
}
|
55
|
-
function registerDevice() {
|
56
|
-
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const result = yield this.builder("registerDevice", yield getBrowser(this.userAgent, this.defaultPlatform.lang_code, this.defaultPlatform.app_version));
|
58
|
-
return result;
|
59
|
-
});
|
60
|
-
}
|
61
|
-
exports.default = registerDevice;
|
@@ -1,25 +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
|
-
function sendCode(phone_number_1) {
|
13
|
-
return __awaiter(this, arguments, void 0, function* (phone_number, pass_key = null, send_type = "SMS") {
|
14
|
-
if (!["SMS", "Internal"].includes(send_type))
|
15
|
-
throw new Error("send_type can only be `SMS` or `Internal`.");
|
16
|
-
const data = {
|
17
|
-
phone_number,
|
18
|
-
pass_key,
|
19
|
-
send_type,
|
20
|
-
};
|
21
|
-
const result = yield this.builder("sendCode", data, true);
|
22
|
-
return result;
|
23
|
-
});
|
24
|
-
}
|
25
|
-
exports.default = sendCode;
|
@@ -1,24 +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
|
-
function signIn(phone_code, phone_number, phone_code_hash, public_key) {
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
14
|
-
const data = {
|
15
|
-
phone_code,
|
16
|
-
phone_number,
|
17
|
-
phone_code_hash,
|
18
|
-
public_key,
|
19
|
-
};
|
20
|
-
const result = yield this.builder("signIn", data, true);
|
21
|
-
return result;
|
22
|
-
});
|
23
|
-
}
|
24
|
-
exports.default = signIn;
|
@@ -1,26 +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
|
-
function addChannel(title, description, member_guids) {
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
14
|
-
let input = { title };
|
15
|
-
if (description)
|
16
|
-
input.description = description;
|
17
|
-
if (member_guids) {
|
18
|
-
if (typeof member_guids === "string") {
|
19
|
-
member_guids = [member_guids];
|
20
|
-
}
|
21
|
-
input.member_guids = member_guids;
|
22
|
-
}
|
23
|
-
return yield this.builder("addChannel", input);
|
24
|
-
});
|
25
|
-
}
|
26
|
-
exports.default = addChannel;
|
@@ -1,22 +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
|
-
function addChannelMembers(channel_guid, member_guids) {
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
14
|
-
if (typeof member_guids === "string")
|
15
|
-
member_guids = [member_guids];
|
16
|
-
return yield this.builder("addChannelMembers", {
|
17
|
-
channel_guid,
|
18
|
-
member_guids,
|
19
|
-
});
|
20
|
-
});
|
21
|
-
}
|
22
|
-
exports.default = addChannelMembers;
|
@@ -1,23 +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
|
-
function banChannelMember(channel_guid_1, member_guid_1) {
|
13
|
-
return __awaiter(this, arguments, void 0, function* (channel_guid, member_guid, action = "Set") {
|
14
|
-
if (!["Set", "Unset"].includes(action))
|
15
|
-
throw new Error(`${action} argument can only be in ["Set", "Unset"]`);
|
16
|
-
return yield this.builder("banChannelMember", {
|
17
|
-
channel_guid,
|
18
|
-
member_guid,
|
19
|
-
action,
|
20
|
-
});
|
21
|
-
});
|
22
|
-
}
|
23
|
-
exports.default = banChannelMember;
|
@@ -1,17 +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
|
-
function cancelChangeObjectOwner(object_guid) {
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
14
|
-
return yield this.builder("cancelChangeObjectOwner", { object_guid });
|
15
|
-
});
|
16
|
-
}
|
17
|
-
exports.default = cancelChangeObjectOwner;
|
@@ -1,19 +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
|
-
function channelPreviewByJoinLink(link) {
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
14
|
-
if (link.includes("/"))
|
15
|
-
link = link.split("/")[-1];
|
16
|
-
return yield this.builder("channelPreviewByJoinLink", { hash_link: link });
|
17
|
-
});
|
18
|
-
}
|
19
|
-
exports.default = channelPreviewByJoinLink;
|