@ohos-ports/zca-js 2.2.0-beta.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/LICENSE +21 -0
- package/README.md +225 -0
- package/dist/Errors/ZaloApiError.d.ts +4 -0
- package/dist/Errors/ZaloApiError.js +7 -0
- package/dist/Errors/ZaloApiLoginQRAborted.d.ts +4 -0
- package/dist/Errors/ZaloApiLoginQRAborted.js +7 -0
- package/dist/Errors/ZaloApiLoginQRDeclined.d.ts +4 -0
- package/dist/Errors/ZaloApiLoginQRDeclined.js +7 -0
- package/dist/Errors/ZaloApiMissingImageMetadataGetter.d.ts +4 -0
- package/dist/Errors/ZaloApiMissingImageMetadataGetter.js +7 -0
- package/dist/Errors/index.d.ts +4 -0
- package/dist/Errors/index.js +4 -0
- package/dist/apis/acceptFriendRequest.d.ts +2 -0
- package/dist/apis/acceptFriendRequest.js +28 -0
- package/dist/apis/addGroupBlockedMember.d.ts +2 -0
- package/dist/apis/addGroupBlockedMember.js +28 -0
- package/dist/apis/addGroupDeputy.d.ts +2 -0
- package/dist/apis/addGroupDeputy.js +30 -0
- package/dist/apis/addPollOptions.d.ts +14 -0
- package/dist/apis/addPollOptions.js +26 -0
- package/dist/apis/addQuickMessage.d.ts +11 -0
- package/dist/apis/addQuickMessage.js +60 -0
- package/dist/apis/addReaction.d.ts +18 -0
- package/dist/apis/addReaction.js +294 -0
- package/dist/apis/addUnreadMark.d.ts +8 -0
- package/dist/apis/addUnreadMark.js +52 -0
- package/dist/apis/addUserToGroup.d.ts +5 -0
- package/dist/apis/addUserToGroup.js +34 -0
- package/dist/apis/blockUser.d.ts +2 -0
- package/dist/apis/blockUser.js +28 -0
- package/dist/apis/blockViewFeed.d.ts +2 -0
- package/dist/apis/blockViewFeed.js +30 -0
- package/dist/apis/changeAccountAvatar.d.ts +3 -0
- package/dist/apis/changeAccountAvatar.js +52 -0
- package/dist/apis/changeFriendAlias.d.ts +2 -0
- package/dist/apis/changeFriendAlias.js +27 -0
- package/dist/apis/changeGroupAvatar.d.ts +3 -0
- package/dist/apis/changeGroupAvatar.js +44 -0
- package/dist/apis/changeGroupName.d.ts +4 -0
- package/dist/apis/changeGroupName.js +32 -0
- package/dist/apis/changeGroupOwner.d.ts +4 -0
- package/dist/apis/changeGroupOwner.js +30 -0
- package/dist/apis/createAutoReply.d.ts +14 -0
- package/dist/apis/createAutoReply.js +37 -0
- package/dist/apis/createBankAccount.d.ts +8 -0
- package/dist/apis/createBankAccount.js +32 -0
- package/dist/apis/createCatalog.d.ts +7 -0
- package/dist/apis/createCatalog.js +29 -0
- package/dist/apis/createGroup.d.ts +28 -0
- package/dist/apis/createGroup.js +43 -0
- package/dist/apis/createNote.d.ts +7 -0
- package/dist/apis/createNote.js +47 -0
- package/dist/apis/createPoll.d.ts +36 -0
- package/dist/apis/createPoll.js +40 -0
- package/dist/apis/createProductCatalog.d.ts +23 -0
- package/dist/apis/createProductCatalog.js +50 -0
- package/dist/apis/createReminder.d.ts +12 -0
- package/dist/apis/createReminder.js +63 -0
- package/dist/apis/custom.d.ts +9 -0
- package/dist/apis/custom.js +15 -0
- package/dist/apis/deleteAutoReply.d.ts +5 -0
- package/dist/apis/deleteAutoReply.js +29 -0
- package/dist/apis/deleteAvatar.d.ts +9 -0
- package/dist/apis/deleteAvatar.js +27 -0
- package/dist/apis/deleteBankAccount.d.ts +11 -0
- package/dist/apis/deleteBankAccount.js +32 -0
- package/dist/apis/deleteCatalog.d.ts +2 -0
- package/dist/apis/deleteCatalog.js +28 -0
- package/dist/apis/deleteChat.d.ts +19 -0
- package/dist/apis/deleteChat.js +50 -0
- package/dist/apis/deleteGroupInviteBox.d.ts +9 -0
- package/dist/apis/deleteGroupInviteBox.js +27 -0
- package/dist/apis/deleteMessage.d.ts +14 -0
- package/dist/apis/deleteMessage.js +52 -0
- package/dist/apis/deleteProductCatalog.d.ts +10 -0
- package/dist/apis/deleteProductCatalog.js +31 -0
- package/dist/apis/disableGroupLink.d.ts +2 -0
- package/dist/apis/disableGroupLink.js +24 -0
- package/dist/apis/disperseGroup.d.ts +2 -0
- package/dist/apis/disperseGroup.js +28 -0
- package/dist/apis/editNote.d.ts +17 -0
- package/dist/apis/editNote.js +46 -0
- package/dist/apis/editReminder.d.ts +13 -0
- package/dist/apis/editReminder.js +61 -0
- package/dist/apis/enableGroupLink.d.ts +6 -0
- package/dist/apis/enableGroupLink.js +25 -0
- package/dist/apis/fetchAccountInfo.d.ts +5 -0
- package/dist/apis/fetchAccountInfo.js +10 -0
- package/dist/apis/findUser.d.ts +3 -0
- package/dist/apis/findUser.js +42 -0
- package/dist/apis/findUserByUsername.d.ts +3 -0
- package/dist/apis/findUserByUsername.js +27 -0
- package/dist/apis/forwardMessage.d.ts +24 -0
- package/dist/apis/forwardMessage.js +99 -0
- package/dist/apis/getAliasList.d.ts +8 -0
- package/dist/apis/getAliasList.js +27 -0
- package/dist/apis/getAllFriends.d.ts +3 -0
- package/dist/apis/getAllFriends.js +34 -0
- package/dist/apis/getAllGroups.d.ts +7 -0
- package/dist/apis/getAllGroups.js +10 -0
- package/dist/apis/getArchivedChatList.d.ts +5 -0
- package/dist/apis/getArchivedChatList.js +23 -0
- package/dist/apis/getAutoDeleteChat.d.ts +9 -0
- package/dist/apis/getAutoDeleteChat.js +21 -0
- package/dist/apis/getAutoReplyList.d.ts +6 -0
- package/dist/apis/getAutoReplyList.js +24 -0
- package/dist/apis/getAvatarList.d.ts +12 -0
- package/dist/apis/getAvatarList.js +28 -0
- package/dist/apis/getAvatarUrlProfile.d.ts +7 -0
- package/dist/apis/getAvatarUrlProfile.js +30 -0
- package/dist/apis/getBizAccount.d.ts +24 -0
- package/dist/apis/getBizAccount.js +27 -0
- package/dist/apis/getCatalogList.d.ts +18 -0
- package/dist/apis/getCatalogList.js +32 -0
- package/dist/apis/getCloseFriends.d.ts +3 -0
- package/dist/apis/getCloseFriends.js +20 -0
- package/dist/apis/getContext.d.ts +1 -0
- package/dist/apis/getContext.js +4 -0
- package/dist/apis/getCookie.d.ts +1 -0
- package/dist/apis/getCookie.js +9 -0
- package/dist/apis/getFriendBoardList.d.ts +5 -0
- package/dist/apis/getFriendBoardList.js +26 -0
- package/dist/apis/getFriendOnlines.d.ts +10 -0
- package/dist/apis/getFriendOnlines.js +35 -0
- package/dist/apis/getFriendRecommendations.d.ts +42 -0
- package/dist/apis/getFriendRecommendations.js +27 -0
- package/dist/apis/getFriendRequestStatus.d.ts +8 -0
- package/dist/apis/getFriendRequestStatus.js +25 -0
- package/dist/apis/getFullAvatar.d.ts +5 -0
- package/dist/apis/getFullAvatar.js +25 -0
- package/dist/apis/getGroupBlockedMember.d.ts +23 -0
- package/dist/apis/getGroupBlockedMember.js +29 -0
- package/dist/apis/getGroupChatHistory.d.ts +8 -0
- package/dist/apis/getGroupChatHistory.js +36 -0
- package/dist/apis/getGroupInfo.d.ts +16 -0
- package/dist/apis/getGroupInfo.js +32 -0
- package/dist/apis/getGroupInviteBoxInfo.d.ts +32 -0
- package/dist/apis/getGroupInviteBoxInfo.js +38 -0
- package/dist/apis/getGroupInviteBoxList.d.ts +38 -0
- package/dist/apis/getGroupInviteBoxList.js +31 -0
- package/dist/apis/getGroupLinkDetail.d.ts +9 -0
- package/dist/apis/getGroupLinkDetail.js +25 -0
- package/dist/apis/getGroupLinkInfo.d.ts +34 -0
- package/dist/apis/getGroupLinkInfo.js +28 -0
- package/dist/apis/getGroupMembersInfo.d.ts +17 -0
- package/dist/apis/getGroupMembersInfo.js +24 -0
- package/dist/apis/getHiddenConversations.d.ts +11 -0
- package/dist/apis/getHiddenConversations.js +23 -0
- package/dist/apis/getLabels.d.ts +7 -0
- package/dist/apis/getLabels.js +28 -0
- package/dist/apis/getListBank.d.ts +5 -0
- package/dist/apis/getListBank.js +20 -0
- package/dist/apis/getListBankAccount.d.ts +7 -0
- package/dist/apis/getListBankAccount.js +27 -0
- package/dist/apis/getListBoard.d.ts +21 -0
- package/dist/apis/getListBoard.js +45 -0
- package/dist/apis/getListDevice.d.ts +10 -0
- package/dist/apis/getListDevice.js +22 -0
- package/dist/apis/getListReminder.d.ts +28 -0
- package/dist/apis/getListReminder.js +47 -0
- package/dist/apis/getMultiUsersByPhones.d.ts +5 -0
- package/dist/apis/getMultiUsersByPhones.js +39 -0
- package/dist/apis/getMute.d.ts +13 -0
- package/dist/apis/getMute.js +22 -0
- package/dist/apis/getOwnId.d.ts +1 -0
- package/dist/apis/getOwnId.js +4 -0
- package/dist/apis/getPendingGroupMembers.d.ts +11 -0
- package/dist/apis/getPendingGroupMembers.js +27 -0
- package/dist/apis/getPinConversations.d.ts +5 -0
- package/dist/apis/getPinConversations.js +22 -0
- package/dist/apis/getPollDetail.d.ts +3 -0
- package/dist/apis/getPollDetail.js +30 -0
- package/dist/apis/getProductCatalogList.d.ts +20 -0
- package/dist/apis/getProductCatalogList.js +33 -0
- package/dist/apis/getQR.d.ts +4 -0
- package/dist/apis/getQR.js +29 -0
- package/dist/apis/getQuickMessageList.d.ts +7 -0
- package/dist/apis/getQuickMessageList.js +24 -0
- package/dist/apis/getRelatedFriendGroup.d.ts +6 -0
- package/dist/apis/getRelatedFriendGroup.js +30 -0
- package/dist/apis/getReminder.d.ts +3 -0
- package/dist/apis/getReminder.js +25 -0
- package/dist/apis/getReminderResponses.d.ts +5 -0
- package/dist/apis/getReminderResponses.js +24 -0
- package/dist/apis/getSentFriendRequest.d.ts +18 -0
- package/dist/apis/getSentFriendRequest.js +24 -0
- package/dist/apis/getSettings.d.ts +3 -0
- package/dist/apis/getSettings.js +20 -0
- package/dist/apis/getStickerCategoryDetail.d.ts +3 -0
- package/dist/apis/getStickerCategoryDetail.js +24 -0
- package/dist/apis/getStickers.d.ts +1 -0
- package/dist/apis/getStickers.js +40 -0
- package/dist/apis/getStickersDetail.d.ts +3 -0
- package/dist/apis/getStickersDetail.js +40 -0
- package/dist/apis/getUnreadMark.d.ts +14 -0
- package/dist/apis/getUnreadMark.js +30 -0
- package/dist/apis/getUserInfo.d.ts +8 -0
- package/dist/apis/getUserInfo.js +44 -0
- package/dist/apis/inviteUserToGroups.d.ts +10 -0
- package/dist/apis/inviteUserToGroups.js +30 -0
- package/dist/apis/joinGroupInviteBox.d.ts +2 -0
- package/dist/apis/joinGroupInviteBox.js +25 -0
- package/dist/apis/joinGroupLink.d.ts +2 -0
- package/dist/apis/joinGroupLink.js +27 -0
- package/dist/apis/keepAlive.d.ts +4 -0
- package/dist/apis/keepAlive.js +22 -0
- package/dist/apis/lastOnline.d.ts +7 -0
- package/dist/apis/lastOnline.js +26 -0
- package/dist/apis/leaveGroup.d.ts +4 -0
- package/dist/apis/leaveGroup.js +33 -0
- package/dist/apis/listen.d.ts +102 -0
- package/dist/apis/listen.js +425 -0
- package/dist/apis/lockPoll.d.ts +2 -0
- package/dist/apis/lockPoll.js +28 -0
- package/dist/apis/login.d.ts +3 -0
- package/dist/apis/login.js +96 -0
- package/dist/apis/loginQR.d.ts +71 -0
- package/dist/apis/loginQR.js +365 -0
- package/dist/apis/lostFocus.d.ts +4 -0
- package/dist/apis/lostFocus.js +23 -0
- package/dist/apis/parseLink.d.ts +21 -0
- package/dist/apis/parseLink.js +27 -0
- package/dist/apis/registerCatalog.d.ts +2 -0
- package/dist/apis/registerCatalog.js +27 -0
- package/dist/apis/rejectFriendRequest.d.ts +2 -0
- package/dist/apis/rejectFriendRequest.js +27 -0
- package/dist/apis/removeFriend.d.ts +2 -0
- package/dist/apis/removeFriend.js +28 -0
- package/dist/apis/removeFriendAlias.d.ts +2 -0
- package/dist/apis/removeFriendAlias.js +24 -0
- package/dist/apis/removeGroupBlockedMember.d.ts +2 -0
- package/dist/apis/removeGroupBlockedMember.js +28 -0
- package/dist/apis/removeGroupDeputy.d.ts +2 -0
- package/dist/apis/removeGroupDeputy.js +30 -0
- package/dist/apis/removeQuickMessage.d.ts +5 -0
- package/dist/apis/removeQuickMessage.js +27 -0
- package/dist/apis/removeReminder.d.ts +3 -0
- package/dist/apis/removeReminder.js +40 -0
- package/dist/apis/removeUnreadMark.d.ts +8 -0
- package/dist/apis/removeUnreadMark.js +50 -0
- package/dist/apis/removeUserFromGroup.d.ts +4 -0
- package/dist/apis/removeUserFromGroup.js +34 -0
- package/dist/apis/resetHiddenConversPin.d.ts +2 -0
- package/dist/apis/resetHiddenConversPin.js +20 -0
- package/dist/apis/reuseAvatar.d.ts +2 -0
- package/dist/apis/reuseAvatar.js +26 -0
- package/dist/apis/reviewPendingMemberRequest.d.ts +14 -0
- package/dist/apis/reviewPendingMemberRequest.js +38 -0
- package/dist/apis/scanURL.d.ts +4 -0
- package/dist/apis/scanURL.js +28 -0
- package/dist/apis/searchSticker.d.ts +3 -0
- package/dist/apis/searchSticker.js +28 -0
- package/dist/apis/sendBankCard.d.ts +9 -0
- package/dist/apis/sendBankCard.js +37 -0
- package/dist/apis/sendCard.d.ts +10 -0
- package/dist/apis/sendCard.js +59 -0
- package/dist/apis/sendDeliveredEvent.d.ts +16 -0
- package/dist/apis/sendDeliveredEvent.js +55 -0
- package/dist/apis/sendFriendRequest.d.ts +2 -0
- package/dist/apis/sendFriendRequest.js +39 -0
- package/dist/apis/sendLink.d.ts +10 -0
- package/dist/apis/sendLink.js +61 -0
- package/dist/apis/sendMessage.d.ts +99 -0
- package/dist/apis/sendMessage.js +452 -0
- package/dist/apis/sendReport.d.ts +17 -0
- package/dist/apis/sendReport.js +53 -0
- package/dist/apis/sendSeenEvent.d.ts +16 -0
- package/dist/apis/sendSeenEvent.js +63 -0
- package/dist/apis/sendSticker.d.ts +10 -0
- package/dist/apis/sendSticker.js +57 -0
- package/dist/apis/sendTypingEvent.d.ts +5 -0
- package/dist/apis/sendTypingEvent.js +33 -0
- package/dist/apis/sendVideo.d.ts +35 -0
- package/dist/apis/sendVideo.js +118 -0
- package/dist/apis/sendVoice.d.ts +12 -0
- package/dist/apis/sendVoice.js +73 -0
- package/dist/apis/setHiddenConversations.d.ts +3 -0
- package/dist/apis/setHiddenConversations.js +39 -0
- package/dist/apis/setMute.d.ts +20 -0
- package/dist/apis/setMute.js +67 -0
- package/dist/apis/setPinnedConversations.d.ts +3 -0
- package/dist/apis/setPinnedConversations.js +34 -0
- package/dist/apis/sharePoll.d.ts +2 -0
- package/dist/apis/sharePoll.js +28 -0
- package/dist/apis/unblockUser.d.ts +2 -0
- package/dist/apis/unblockUser.js +28 -0
- package/dist/apis/undo.d.ts +9 -0
- package/dist/apis/undo.js +42 -0
- package/dist/apis/undoFriendRequest.d.ts +2 -0
- package/dist/apis/undoFriendRequest.js +27 -0
- package/dist/apis/updateActiveStatus.d.ts +4 -0
- package/dist/apis/updateActiveStatus.js +27 -0
- package/dist/apis/updateArchivedChatList.d.ts +10 -0
- package/dist/apis/updateArchivedChatList.js +34 -0
- package/dist/apis/updateAutoDeleteChat.d.ts +9 -0
- package/dist/apis/updateAutoDeleteChat.js +40 -0
- package/dist/apis/updateAutoReply.d.ts +15 -0
- package/dist/apis/updateAutoReply.js +38 -0
- package/dist/apis/updateBankAccount.d.ts +9 -0
- package/dist/apis/updateBankAccount.js +31 -0
- package/dist/apis/updateCatalog.d.ts +11 -0
- package/dist/apis/updateCatalog.js +30 -0
- package/dist/apis/updateGroupSettings.d.ts +40 -0
- package/dist/apis/updateGroupSettings.js +43 -0
- package/dist/apis/updateHiddenConversPin.d.ts +2 -0
- package/dist/apis/updateHiddenConversPin.js +30 -0
- package/dist/apis/updateLabels.d.ts +15 -0
- package/dist/apis/updateLabels.js +34 -0
- package/dist/apis/updateLang.d.ts +6 -0
- package/dist/apis/updateLang.js +30 -0
- package/dist/apis/updateProductCatalog.d.ts +25 -0
- package/dist/apis/updateProductCatalog.js +51 -0
- package/dist/apis/updateProfile.d.ts +20 -0
- package/dist/apis/updateProfile.js +43 -0
- package/dist/apis/updateProfileBio.d.ts +2 -0
- package/dist/apis/updateProfileBio.js +27 -0
- package/dist/apis/updateQuickMessage.d.ts +11 -0
- package/dist/apis/updateQuickMessage.js +61 -0
- package/dist/apis/updateSettings.d.ts +16 -0
- package/dist/apis/updateSettings.js +90 -0
- package/dist/apis/upgradeGroupToCommunity.d.ts +2 -0
- package/dist/apis/upgradeGroupToCommunity.js +27 -0
- package/dist/apis/uploadAttachment.d.ts +50 -0
- package/dist/apis/uploadAttachment.js +197 -0
- package/dist/apis/uploadProductPhoto.d.ts +14 -0
- package/dist/apis/uploadProductPhoto.js +50 -0
- package/dist/apis/votePoll.d.ts +5 -0
- package/dist/apis/votePoll.js +29 -0
- package/dist/apis.d.ts +317 -0
- package/dist/apis.js +317 -0
- package/dist/cjs/Errors/ZaloApiError.cjs +11 -0
- package/dist/cjs/Errors/ZaloApiLoginQRAborted.cjs +12 -0
- package/dist/cjs/Errors/ZaloApiLoginQRDeclined.cjs +12 -0
- package/dist/cjs/Errors/ZaloApiMissingImageMetadataGetter.cjs +12 -0
- package/dist/cjs/apis/acceptFriendRequest.cjs +33 -0
- package/dist/cjs/apis/addGroupBlockedMember.cjs +33 -0
- package/dist/cjs/apis/addGroupDeputy.cjs +35 -0
- package/dist/cjs/apis/addPollOptions.cjs +31 -0
- package/dist/cjs/apis/addQuickMessage.cjs +65 -0
- package/dist/cjs/apis/addReaction.cjs +308 -0
- package/dist/cjs/apis/addUnreadMark.cjs +66 -0
- package/dist/cjs/apis/addUserToGroup.cjs +39 -0
- package/dist/cjs/apis/blockUser.cjs +33 -0
- package/dist/cjs/apis/blockViewFeed.cjs +35 -0
- package/dist/cjs/apis/changeAccountAvatar.cjs +57 -0
- package/dist/cjs/apis/changeFriendAlias.cjs +32 -0
- package/dist/cjs/apis/changeGroupAvatar.cjs +49 -0
- package/dist/cjs/apis/changeGroupName.cjs +37 -0
- package/dist/cjs/apis/changeGroupOwner.cjs +35 -0
- package/dist/cjs/apis/createAutoReply.cjs +42 -0
- package/dist/cjs/apis/createBankAccount.cjs +37 -0
- package/dist/cjs/apis/createCatalog.cjs +34 -0
- package/dist/cjs/apis/createGroup.cjs +48 -0
- package/dist/cjs/apis/createNote.cjs +52 -0
- package/dist/cjs/apis/createPoll.cjs +45 -0
- package/dist/cjs/apis/createProductCatalog.cjs +55 -0
- package/dist/cjs/apis/createReminder.cjs +77 -0
- package/dist/cjs/apis/custom.cjs +19 -0
- package/dist/cjs/apis/deleteAutoReply.cjs +34 -0
- package/dist/cjs/apis/deleteAvatar.cjs +32 -0
- package/dist/cjs/apis/deleteBankAccount.cjs +37 -0
- package/dist/cjs/apis/deleteCatalog.cjs +33 -0
- package/dist/cjs/apis/deleteChat.cjs +64 -0
- package/dist/cjs/apis/deleteGroupInviteBox.cjs +32 -0
- package/dist/cjs/apis/deleteMessage.cjs +66 -0
- package/dist/cjs/apis/deleteProductCatalog.cjs +36 -0
- package/dist/cjs/apis/disableGroupLink.cjs +29 -0
- package/dist/cjs/apis/disperseGroup.cjs +33 -0
- package/dist/cjs/apis/editNote.cjs +51 -0
- package/dist/cjs/apis/editReminder.cjs +75 -0
- package/dist/cjs/apis/enableGroupLink.cjs +30 -0
- package/dist/cjs/apis/fetchAccountInfo.cjs +15 -0
- package/dist/cjs/apis/findUser.cjs +56 -0
- package/dist/cjs/apis/findUserByUsername.cjs +41 -0
- package/dist/cjs/apis/forwardMessage.cjs +113 -0
- package/dist/cjs/apis/getAliasList.cjs +32 -0
- package/dist/cjs/apis/getAllFriends.cjs +48 -0
- package/dist/cjs/apis/getAllGroups.cjs +15 -0
- package/dist/cjs/apis/getArchivedChatList.cjs +28 -0
- package/dist/cjs/apis/getAutoDeleteChat.cjs +26 -0
- package/dist/cjs/apis/getAutoReplyList.cjs +29 -0
- package/dist/cjs/apis/getAvatarList.cjs +33 -0
- package/dist/cjs/apis/getAvatarUrlProfile.cjs +44 -0
- package/dist/cjs/apis/getBizAccount.cjs +32 -0
- package/dist/cjs/apis/getCatalogList.cjs +37 -0
- package/dist/cjs/apis/getCloseFriends.cjs +25 -0
- package/dist/cjs/apis/getContext.cjs +9 -0
- package/dist/cjs/apis/getCookie.cjs +14 -0
- package/dist/cjs/apis/getFriendBoardList.cjs +31 -0
- package/dist/cjs/apis/getFriendOnlines.cjs +40 -0
- package/dist/cjs/apis/getFriendRecommendations.cjs +32 -0
- package/dist/cjs/apis/getFriendRequestStatus.cjs +30 -0
- package/dist/cjs/apis/getFullAvatar.cjs +30 -0
- package/dist/cjs/apis/getGroupBlockedMember.cjs +34 -0
- package/dist/cjs/apis/getGroupChatHistory.cjs +51 -0
- package/dist/cjs/apis/getGroupInfo.cjs +37 -0
- package/dist/cjs/apis/getGroupInviteBoxInfo.cjs +43 -0
- package/dist/cjs/apis/getGroupInviteBoxList.cjs +36 -0
- package/dist/cjs/apis/getGroupLinkDetail.cjs +30 -0
- package/dist/cjs/apis/getGroupLinkInfo.cjs +33 -0
- package/dist/cjs/apis/getGroupMembersInfo.cjs +29 -0
- package/dist/cjs/apis/getHiddenConversations.cjs +28 -0
- package/dist/cjs/apis/getLabels.cjs +33 -0
- package/dist/cjs/apis/getListBank.cjs +25 -0
- package/dist/cjs/apis/getListBankAccount.cjs +32 -0
- package/dist/cjs/apis/getListBoard.cjs +59 -0
- package/dist/cjs/apis/getListDevice.cjs +27 -0
- package/dist/cjs/apis/getListReminder.cjs +61 -0
- package/dist/cjs/apis/getMultiUsersByPhones.cjs +53 -0
- package/dist/cjs/apis/getMute.cjs +27 -0
- package/dist/cjs/apis/getOwnId.cjs +9 -0
- package/dist/cjs/apis/getPendingGroupMembers.cjs +32 -0
- package/dist/cjs/apis/getPinConversations.cjs +27 -0
- package/dist/cjs/apis/getPollDetail.cjs +35 -0
- package/dist/cjs/apis/getProductCatalogList.cjs +38 -0
- package/dist/cjs/apis/getQR.cjs +34 -0
- package/dist/cjs/apis/getQuickMessageList.cjs +29 -0
- package/dist/cjs/apis/getRelatedFriendGroup.cjs +35 -0
- package/dist/cjs/apis/getReminder.cjs +30 -0
- package/dist/cjs/apis/getReminderResponses.cjs +29 -0
- package/dist/cjs/apis/getSentFriendRequest.cjs +29 -0
- package/dist/cjs/apis/getSettings.cjs +25 -0
- package/dist/cjs/apis/getStickerCategoryDetail.cjs +29 -0
- package/dist/cjs/apis/getStickers.cjs +45 -0
- package/dist/cjs/apis/getStickersDetail.cjs +45 -0
- package/dist/cjs/apis/getUnreadMark.cjs +35 -0
- package/dist/cjs/apis/getUserInfo.cjs +58 -0
- package/dist/cjs/apis/inviteUserToGroups.cjs +35 -0
- package/dist/cjs/apis/joinGroupInviteBox.cjs +30 -0
- package/dist/cjs/apis/joinGroupLink.cjs +32 -0
- package/dist/cjs/apis/keepAlive.cjs +27 -0
- package/dist/cjs/apis/lastOnline.cjs +31 -0
- package/dist/cjs/apis/leaveGroup.cjs +38 -0
- package/dist/cjs/apis/listen.cjs +440 -0
- package/dist/cjs/apis/lockPoll.cjs +33 -0
- package/dist/cjs/apis/login.cjs +102 -0
- package/dist/cjs/apis/loginQR.cjs +370 -0
- package/dist/cjs/apis/lostFocus.cjs +28 -0
- package/dist/cjs/apis/parseLink.cjs +32 -0
- package/dist/cjs/apis/registerCatalog.cjs +32 -0
- package/dist/cjs/apis/rejectFriendRequest.cjs +32 -0
- package/dist/cjs/apis/removeFriend.cjs +33 -0
- package/dist/cjs/apis/removeFriendAlias.cjs +29 -0
- package/dist/cjs/apis/removeGroupBlockedMember.cjs +33 -0
- package/dist/cjs/apis/removeGroupDeputy.cjs +35 -0
- package/dist/cjs/apis/removeQuickMessage.cjs +32 -0
- package/dist/cjs/apis/removeReminder.cjs +54 -0
- package/dist/cjs/apis/removeUnreadMark.cjs +64 -0
- package/dist/cjs/apis/removeUserFromGroup.cjs +39 -0
- package/dist/cjs/apis/resetHiddenConversPin.cjs +25 -0
- package/dist/cjs/apis/reuseAvatar.cjs +31 -0
- package/dist/cjs/apis/reviewPendingMemberRequest.cjs +43 -0
- package/dist/cjs/apis/scanURL.cjs +33 -0
- package/dist/cjs/apis/searchSticker.cjs +33 -0
- package/dist/cjs/apis/sendBankCard.cjs +51 -0
- package/dist/cjs/apis/sendCard.cjs +73 -0
- package/dist/cjs/apis/sendDeliveredEvent.cjs +69 -0
- package/dist/cjs/apis/sendFriendRequest.cjs +44 -0
- package/dist/cjs/apis/sendLink.cjs +75 -0
- package/dist/cjs/apis/sendMessage.cjs +466 -0
- package/dist/cjs/apis/sendReport.cjs +67 -0
- package/dist/cjs/apis/sendSeenEvent.cjs +77 -0
- package/dist/cjs/apis/sendSticker.cjs +71 -0
- package/dist/cjs/apis/sendTypingEvent.cjs +47 -0
- package/dist/cjs/apis/sendVideo.cjs +132 -0
- package/dist/cjs/apis/sendVoice.cjs +87 -0
- package/dist/cjs/apis/setHiddenConversations.cjs +53 -0
- package/dist/cjs/apis/setMute.cjs +81 -0
- package/dist/cjs/apis/setPinnedConversations.cjs +48 -0
- package/dist/cjs/apis/sharePoll.cjs +33 -0
- package/dist/cjs/apis/unblockUser.cjs +33 -0
- package/dist/cjs/apis/undo.cjs +56 -0
- package/dist/cjs/apis/undoFriendRequest.cjs +32 -0
- package/dist/cjs/apis/updateActiveStatus.cjs +32 -0
- package/dist/cjs/apis/updateArchivedChatList.cjs +39 -0
- package/dist/cjs/apis/updateAutoDeleteChat.cjs +54 -0
- package/dist/cjs/apis/updateAutoReply.cjs +43 -0
- package/dist/cjs/apis/updateBankAccount.cjs +36 -0
- package/dist/cjs/apis/updateCatalog.cjs +35 -0
- package/dist/cjs/apis/updateGroupSettings.cjs +48 -0
- package/dist/cjs/apis/updateHiddenConversPin.cjs +35 -0
- package/dist/cjs/apis/updateLabels.cjs +39 -0
- package/dist/cjs/apis/updateLang.cjs +35 -0
- package/dist/cjs/apis/updateProductCatalog.cjs +56 -0
- package/dist/cjs/apis/updateProfile.cjs +48 -0
- package/dist/cjs/apis/updateProfileBio.cjs +32 -0
- package/dist/cjs/apis/updateQuickMessage.cjs +66 -0
- package/dist/cjs/apis/updateSettings.cjs +95 -0
- package/dist/cjs/apis/upgradeGroupToCommunity.cjs +32 -0
- package/dist/cjs/apis/uploadAttachment.cjs +211 -0
- package/dist/cjs/apis/uploadProductPhoto.cjs +55 -0
- package/dist/cjs/apis/votePoll.cjs +34 -0
- package/dist/cjs/apis.cjs +322 -0
- package/dist/cjs/context.cjs +34 -0
- package/dist/cjs/index.cjs +159 -0
- package/dist/cjs/models/AutoReply.cjs +9 -0
- package/dist/cjs/models/Bank.cjs +263 -0
- package/dist/cjs/models/Board.cjs +8 -0
- package/dist/cjs/models/DeliveredMessage.cjs +23 -0
- package/dist/cjs/models/Enum.cjs +27 -0
- package/dist/cjs/models/FriendEvent.cjs +87 -0
- package/dist/cjs/models/Group.cjs +13 -0
- package/dist/cjs/models/GroupEvent.cjs +94 -0
- package/dist/cjs/models/Message.cjs +35 -0
- package/dist/cjs/models/Reaction.cjs +74 -0
- package/dist/cjs/models/Reminder.cjs +9 -0
- package/dist/cjs/models/SeenMessage.cjs +23 -0
- package/dist/cjs/models/Typing.cjs +23 -0
- package/dist/cjs/models/Undo.cjs +16 -0
- package/dist/cjs/models/ZBusiness.cjs +39 -0
- package/dist/cjs/update.cjs +34 -0
- package/dist/cjs/utils.cjs +703 -0
- package/dist/cjs/zalo.cjs +112 -0
- package/dist/context.d.ts +179 -0
- package/dist/context.js +28 -0
- package/dist/index.d.ts +166 -0
- package/dist/index.js +14 -0
- package/dist/models/Attachment.d.ts +9 -0
- package/dist/models/Attachment.js +1 -0
- package/dist/models/AutoReply.d.ts +20 -0
- package/dist/models/AutoReply.js +7 -0
- package/dist/models/Bank.d.ts +291 -0
- package/dist/models/Bank.js +262 -0
- package/dist/models/Board.d.ts +60 -0
- package/dist/models/Board.js +6 -0
- package/dist/models/Catalog.d.ts +16 -0
- package/dist/models/Catalog.js +1 -0
- package/dist/models/DeliveredMessage.d.ts +27 -0
- package/dist/models/DeliveredMessage.js +17 -0
- package/dist/models/Enum.d.ts +21 -0
- package/dist/models/Enum.js +25 -0
- package/dist/models/FriendEvent.d.ts +107 -0
- package/dist/models/FriendEvent.js +83 -0
- package/dist/models/Group.d.ts +125 -0
- package/dist/models/Group.js +11 -0
- package/dist/models/GroupEvent.d.ts +178 -0
- package/dist/models/GroupEvent.js +90 -0
- package/dist/models/Label.d.ts +10 -0
- package/dist/models/Label.js +1 -0
- package/dist/models/Message.d.ts +91 -0
- package/dist/models/Message.js +29 -0
- package/dist/models/ProductCatalog.d.ts +17 -0
- package/dist/models/ProductCatalog.js +1 -0
- package/dist/models/QuickMessage.d.ts +25 -0
- package/dist/models/QuickMessage.js +1 -0
- package/dist/models/Reaction.d.ts +85 -0
- package/dist/models/Reaction.js +70 -0
- package/dist/models/Reminder.d.ts +51 -0
- package/dist/models/Reminder.js +7 -0
- package/dist/models/SeenMessage.d.ts +26 -0
- package/dist/models/SeenMessage.js +17 -0
- package/dist/models/Sticker.d.ts +27 -0
- package/dist/models/Sticker.js +1 -0
- package/dist/models/Typing.d.ts +24 -0
- package/dist/models/Typing.js +17 -0
- package/dist/models/Undo.d.ts +34 -0
- package/dist/models/Undo.js +12 -0
- package/dist/models/User.d.ts +70 -0
- package/dist/models/User.js +1 -0
- package/dist/models/ZBusiness.d.ts +22 -0
- package/dist/models/ZBusiness.js +35 -0
- package/dist/models/index.d.ts +22 -0
- package/dist/models/index.js +22 -0
- package/dist/update.d.ts +2 -0
- package/dist/update.js +29 -0
- package/dist/utils.d.ts +167 -0
- package/dist/utils.js +719 -0
- package/dist/zalo.d.ts +41 -0
- package/dist/zalo.js +107 -0
- package/index.d.ts +2 -0
- package/package.json +85 -0
package/dist/apis.js
ADDED
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { Listener } from "./apis/listen.js";
|
|
2
|
+
import { acceptFriendRequestFactory } from "./apis/acceptFriendRequest.js";
|
|
3
|
+
import { addGroupBlockedMemberFactory } from "./apis/addGroupBlockedMember.js";
|
|
4
|
+
import { addGroupDeputyFactory } from "./apis/addGroupDeputy.js";
|
|
5
|
+
import { addPollOptionsFactory } from "./apis/addPollOptions.js";
|
|
6
|
+
import { addQuickMessageFactory } from "./apis/addQuickMessage.js";
|
|
7
|
+
import { addReactionFactory } from "./apis/addReaction.js";
|
|
8
|
+
import { addUnreadMarkFactory } from "./apis/addUnreadMark.js";
|
|
9
|
+
import { addUserToGroupFactory } from "./apis/addUserToGroup.js";
|
|
10
|
+
import { blockUserFactory } from "./apis/blockUser.js";
|
|
11
|
+
import { blockViewFeedFactory } from "./apis/blockViewFeed.js";
|
|
12
|
+
import { changeAccountAvatarFactory } from "./apis/changeAccountAvatar.js";
|
|
13
|
+
import { changeFriendAliasFactory } from "./apis/changeFriendAlias.js";
|
|
14
|
+
import { changeGroupAvatarFactory } from "./apis/changeGroupAvatar.js";
|
|
15
|
+
import { changeGroupNameFactory } from "./apis/changeGroupName.js";
|
|
16
|
+
import { changeGroupOwnerFactory } from "./apis/changeGroupOwner.js";
|
|
17
|
+
import { createAutoReplyFactory } from "./apis/createAutoReply.js";
|
|
18
|
+
import { createBankAccountFactory } from "./apis/createBankAccount.js";
|
|
19
|
+
import { createCatalogFactory } from "./apis/createCatalog.js";
|
|
20
|
+
import { createGroupFactory } from "./apis/createGroup.js";
|
|
21
|
+
import { createNoteFactory } from "./apis/createNote.js";
|
|
22
|
+
import { createPollFactory } from "./apis/createPoll.js";
|
|
23
|
+
import { createProductCatalogFactory } from "./apis/createProductCatalog.js";
|
|
24
|
+
import { createReminderFactory } from "./apis/createReminder.js";
|
|
25
|
+
import { deleteAutoReplyFactory } from "./apis/deleteAutoReply.js";
|
|
26
|
+
import { deleteAvatarFactory } from "./apis/deleteAvatar.js";
|
|
27
|
+
import { deleteBankAccountFactory } from "./apis/deleteBankAccount.js";
|
|
28
|
+
import { deleteCatalogFactory } from "./apis/deleteCatalog.js";
|
|
29
|
+
import { deleteChatFactory } from "./apis/deleteChat.js";
|
|
30
|
+
import { deleteGroupInviteBoxFactory } from "./apis/deleteGroupInviteBox.js";
|
|
31
|
+
import { deleteMessageFactory } from "./apis/deleteMessage.js";
|
|
32
|
+
import { deleteProductCatalogFactory } from "./apis/deleteProductCatalog.js";
|
|
33
|
+
import { disableGroupLinkFactory } from "./apis/disableGroupLink.js";
|
|
34
|
+
import { disperseGroupFactory } from "./apis/disperseGroup.js";
|
|
35
|
+
import { editNoteFactory } from "./apis/editNote.js";
|
|
36
|
+
import { editReminderFactory } from "./apis/editReminder.js";
|
|
37
|
+
import { enableGroupLinkFactory } from "./apis/enableGroupLink.js";
|
|
38
|
+
import { fetchAccountInfoFactory } from "./apis/fetchAccountInfo.js";
|
|
39
|
+
import { findUserFactory } from "./apis/findUser.js";
|
|
40
|
+
import { findUserByUsernameFactory } from "./apis/findUserByUsername.js";
|
|
41
|
+
import { forwardMessageFactory } from "./apis/forwardMessage.js";
|
|
42
|
+
import { getAliasListFactory } from "./apis/getAliasList.js";
|
|
43
|
+
import { getAllFriendsFactory } from "./apis/getAllFriends.js";
|
|
44
|
+
import { getAllGroupsFactory } from "./apis/getAllGroups.js";
|
|
45
|
+
import { getArchivedChatListFactory } from "./apis/getArchivedChatList.js";
|
|
46
|
+
import { getAutoDeleteChatFactory } from "./apis/getAutoDeleteChat.js";
|
|
47
|
+
import { getAutoReplyListFactory } from "./apis/getAutoReplyList.js";
|
|
48
|
+
import { getAvatarListFactory } from "./apis/getAvatarList.js";
|
|
49
|
+
import { getAvatarUrlProfileFactory } from "./apis/getAvatarUrlProfile.js";
|
|
50
|
+
import { getBizAccountFactory } from "./apis/getBizAccount.js";
|
|
51
|
+
import { getCatalogListFactory } from "./apis/getCatalogList.js";
|
|
52
|
+
import { getCloseFriendsFactory } from "./apis/getCloseFriends.js";
|
|
53
|
+
import { getContextFactory } from "./apis/getContext.js";
|
|
54
|
+
import { getCookieFactory } from "./apis/getCookie.js";
|
|
55
|
+
import { getFriendBoardListFactory } from "./apis/getFriendBoardList.js";
|
|
56
|
+
import { getFriendOnlinesFactory } from "./apis/getFriendOnlines.js";
|
|
57
|
+
import { getFriendRecommendationsFactory } from "./apis/getFriendRecommendations.js";
|
|
58
|
+
import { getFriendRequestStatusFactory } from "./apis/getFriendRequestStatus.js";
|
|
59
|
+
import { getFullAvatarFactory } from "./apis/getFullAvatar.js";
|
|
60
|
+
import { getGroupBlockedMemberFactory } from "./apis/getGroupBlockedMember.js";
|
|
61
|
+
import { getGroupChatHistoryFactory } from "./apis/getGroupChatHistory.js";
|
|
62
|
+
import { getGroupInfoFactory } from "./apis/getGroupInfo.js";
|
|
63
|
+
import { getGroupInviteBoxInfoFactory } from "./apis/getGroupInviteBoxInfo.js";
|
|
64
|
+
import { getGroupInviteBoxListFactory } from "./apis/getGroupInviteBoxList.js";
|
|
65
|
+
import { getGroupLinkDetailFactory } from "./apis/getGroupLinkDetail.js";
|
|
66
|
+
import { getGroupLinkInfoFactory } from "./apis/getGroupLinkInfo.js";
|
|
67
|
+
import { getGroupMembersInfoFactory } from "./apis/getGroupMembersInfo.js";
|
|
68
|
+
import { getHiddenConversationsFactory } from "./apis/getHiddenConversations.js";
|
|
69
|
+
import { getLabelsFactory } from "./apis/getLabels.js";
|
|
70
|
+
import { getListBankFactory } from "./apis/getListBank.js";
|
|
71
|
+
import { getListBankAccountFactory } from "./apis/getListBankAccount.js";
|
|
72
|
+
import { getListBoardFactory } from "./apis/getListBoard.js";
|
|
73
|
+
import { getListDeviceFactory } from "./apis/getListDevice.js";
|
|
74
|
+
import { getListReminderFactory } from "./apis/getListReminder.js";
|
|
75
|
+
import { getMultiUsersByPhonesFactory } from "./apis/getMultiUsersByPhones.js";
|
|
76
|
+
import { getMuteFactory } from "./apis/getMute.js";
|
|
77
|
+
import { getOwnIdFactory } from "./apis/getOwnId.js";
|
|
78
|
+
import { getPendingGroupMembersFactory } from "./apis/getPendingGroupMembers.js";
|
|
79
|
+
import { getPinConversationsFactory } from "./apis/getPinConversations.js";
|
|
80
|
+
import { getPollDetailFactory } from "./apis/getPollDetail.js";
|
|
81
|
+
import { getProductCatalogListFactory } from "./apis/getProductCatalogList.js";
|
|
82
|
+
import { getQRFactory } from "./apis/getQR.js";
|
|
83
|
+
import { getQuickMessageListFactory } from "./apis/getQuickMessageList.js";
|
|
84
|
+
import { getRelatedFriendGroupFactory } from "./apis/getRelatedFriendGroup.js";
|
|
85
|
+
import { getReminderFactory } from "./apis/getReminder.js";
|
|
86
|
+
import { getReminderResponsesFactory } from "./apis/getReminderResponses.js";
|
|
87
|
+
import { getSentFriendRequestFactory } from "./apis/getSentFriendRequest.js";
|
|
88
|
+
import { getSettingsFactory } from "./apis/getSettings.js";
|
|
89
|
+
import { getStickerCategoryDetailFactory } from "./apis/getStickerCategoryDetail.js";
|
|
90
|
+
import { getStickersFactory } from "./apis/getStickers.js";
|
|
91
|
+
import { getStickersDetailFactory } from "./apis/getStickersDetail.js";
|
|
92
|
+
import { getUnreadMarkFactory } from "./apis/getUnreadMark.js";
|
|
93
|
+
import { getUserInfoFactory } from "./apis/getUserInfo.js";
|
|
94
|
+
import { inviteUserToGroupsFactory } from "./apis/inviteUserToGroups.js";
|
|
95
|
+
import { joinGroupInviteBoxFactory } from "./apis/joinGroupInviteBox.js";
|
|
96
|
+
import { joinGroupLinkFactory } from "./apis/joinGroupLink.js";
|
|
97
|
+
import { keepAliveFactory } from "./apis/keepAlive.js";
|
|
98
|
+
import { lastOnlineFactory } from "./apis/lastOnline.js";
|
|
99
|
+
import { leaveGroupFactory } from "./apis/leaveGroup.js";
|
|
100
|
+
import { lockPollFactory } from "./apis/lockPoll.js";
|
|
101
|
+
import { lostFocusFactory } from "./apis/lostFocus.js";
|
|
102
|
+
import { parseLinkFactory } from "./apis/parseLink.js";
|
|
103
|
+
import { registerCatalogFactory } from "./apis/registerCatalog.js";
|
|
104
|
+
import { rejectFriendRequestFactory } from "./apis/rejectFriendRequest.js";
|
|
105
|
+
import { removeFriendFactory } from "./apis/removeFriend.js";
|
|
106
|
+
import { removeFriendAliasFactory } from "./apis/removeFriendAlias.js";
|
|
107
|
+
import { removeGroupBlockedMemberFactory } from "./apis/removeGroupBlockedMember.js";
|
|
108
|
+
import { removeGroupDeputyFactory } from "./apis/removeGroupDeputy.js";
|
|
109
|
+
import { removeQuickMessageFactory } from "./apis/removeQuickMessage.js";
|
|
110
|
+
import { removeReminderFactory } from "./apis/removeReminder.js";
|
|
111
|
+
import { removeUnreadMarkFactory } from "./apis/removeUnreadMark.js";
|
|
112
|
+
import { removeUserFromGroupFactory } from "./apis/removeUserFromGroup.js";
|
|
113
|
+
import { resetHiddenConversPinFactory } from "./apis/resetHiddenConversPin.js";
|
|
114
|
+
import { reuseAvatarFactory } from "./apis/reuseAvatar.js";
|
|
115
|
+
import { reviewPendingMemberRequestFactory } from "./apis/reviewPendingMemberRequest.js";
|
|
116
|
+
import { scanURLFactory } from "./apis/scanURL.js";
|
|
117
|
+
import { searchStickerFactory } from "./apis/searchSticker.js";
|
|
118
|
+
import { sendBankCardFactory } from "./apis/sendBankCard.js";
|
|
119
|
+
import { sendCardFactory } from "./apis/sendCard.js";
|
|
120
|
+
import { sendDeliveredEventFactory } from "./apis/sendDeliveredEvent.js";
|
|
121
|
+
import { sendFriendRequestFactory } from "./apis/sendFriendRequest.js";
|
|
122
|
+
import { sendLinkFactory } from "./apis/sendLink.js";
|
|
123
|
+
import { sendMessageFactory } from "./apis/sendMessage.js";
|
|
124
|
+
import { sendReportFactory } from "./apis/sendReport.js";
|
|
125
|
+
import { sendSeenEventFactory } from "./apis/sendSeenEvent.js";
|
|
126
|
+
import { sendStickerFactory } from "./apis/sendSticker.js";
|
|
127
|
+
import { sendTypingEventFactory } from "./apis/sendTypingEvent.js";
|
|
128
|
+
import { sendVideoFactory } from "./apis/sendVideo.js";
|
|
129
|
+
import { sendVoiceFactory } from "./apis/sendVoice.js";
|
|
130
|
+
import { setHiddenConversationsFactory } from "./apis/setHiddenConversations.js";
|
|
131
|
+
import { setMuteFactory } from "./apis/setMute.js";
|
|
132
|
+
import { setPinnedConversationsFactory } from "./apis/setPinnedConversations.js";
|
|
133
|
+
import { sharePollFactory } from "./apis/sharePoll.js";
|
|
134
|
+
import { unblockUserFactory } from "./apis/unblockUser.js";
|
|
135
|
+
import { undoFactory } from "./apis/undo.js";
|
|
136
|
+
import { undoFriendRequestFactory } from "./apis/undoFriendRequest.js";
|
|
137
|
+
import { updateActiveStatusFactory } from "./apis/updateActiveStatus.js";
|
|
138
|
+
import { updateArchivedChatListFactory } from "./apis/updateArchivedChatList.js";
|
|
139
|
+
import { updateAutoDeleteChatFactory } from "./apis/updateAutoDeleteChat.js";
|
|
140
|
+
import { updateAutoReplyFactory } from "./apis/updateAutoReply.js";
|
|
141
|
+
import { updateBankAccountFactory } from "./apis/updateBankAccount.js";
|
|
142
|
+
import { updateCatalogFactory } from "./apis/updateCatalog.js";
|
|
143
|
+
import { updateGroupSettingsFactory } from "./apis/updateGroupSettings.js";
|
|
144
|
+
import { updateHiddenConversPinFactory } from "./apis/updateHiddenConversPin.js";
|
|
145
|
+
import { updateLabelsFactory } from "./apis/updateLabels.js";
|
|
146
|
+
import { updateLangFactory } from "./apis/updateLang.js";
|
|
147
|
+
import { updateProductCatalogFactory } from "./apis/updateProductCatalog.js";
|
|
148
|
+
import { updateProfileFactory } from "./apis/updateProfile.js";
|
|
149
|
+
import { updateProfileBioFactory } from "./apis/updateProfileBio.js";
|
|
150
|
+
import { updateQuickMessageFactory } from "./apis/updateQuickMessage.js";
|
|
151
|
+
import { updateSettingsFactory } from "./apis/updateSettings.js";
|
|
152
|
+
import { upgradeGroupToCommunityFactory } from "./apis/upgradeGroupToCommunity.js";
|
|
153
|
+
import { uploadAttachmentFactory } from "./apis/uploadAttachment.js";
|
|
154
|
+
import { uploadProductPhotoFactory } from "./apis/uploadProductPhoto.js";
|
|
155
|
+
import { votePollFactory } from "./apis/votePoll.js";
|
|
156
|
+
import { customFactory } from "./apis/custom.js";
|
|
157
|
+
export class API {
|
|
158
|
+
constructor(ctx, zpwServiceMap, wsUrls) {
|
|
159
|
+
this.zpwServiceMap = zpwServiceMap;
|
|
160
|
+
this.listener = new Listener(ctx, wsUrls);
|
|
161
|
+
this.acceptFriendRequest = acceptFriendRequestFactory(ctx, this);
|
|
162
|
+
this.addGroupBlockedMember = addGroupBlockedMemberFactory(ctx, this);
|
|
163
|
+
this.addGroupDeputy = addGroupDeputyFactory(ctx, this);
|
|
164
|
+
this.addPollOptions = addPollOptionsFactory(ctx, this);
|
|
165
|
+
this.addQuickMessage = addQuickMessageFactory(ctx, this);
|
|
166
|
+
this.addReaction = addReactionFactory(ctx, this);
|
|
167
|
+
this.addUnreadMark = addUnreadMarkFactory(ctx, this);
|
|
168
|
+
this.addUserToGroup = addUserToGroupFactory(ctx, this);
|
|
169
|
+
this.blockUser = blockUserFactory(ctx, this);
|
|
170
|
+
this.blockViewFeed = blockViewFeedFactory(ctx, this);
|
|
171
|
+
this.changeAccountAvatar = changeAccountAvatarFactory(ctx, this);
|
|
172
|
+
this.changeFriendAlias = changeFriendAliasFactory(ctx, this);
|
|
173
|
+
this.changeGroupAvatar = changeGroupAvatarFactory(ctx, this);
|
|
174
|
+
this.changeGroupName = changeGroupNameFactory(ctx, this);
|
|
175
|
+
this.changeGroupOwner = changeGroupOwnerFactory(ctx, this);
|
|
176
|
+
this.createAutoReply = createAutoReplyFactory(ctx, this);
|
|
177
|
+
this.createBankAccount = createBankAccountFactory(ctx, this);
|
|
178
|
+
this.createCatalog = createCatalogFactory(ctx, this);
|
|
179
|
+
this.createGroup = createGroupFactory(ctx, this);
|
|
180
|
+
this.createNote = createNoteFactory(ctx, this);
|
|
181
|
+
this.createPoll = createPollFactory(ctx, this);
|
|
182
|
+
this.createProductCatalog = createProductCatalogFactory(ctx, this);
|
|
183
|
+
this.createReminder = createReminderFactory(ctx, this);
|
|
184
|
+
this.deleteAutoReply = deleteAutoReplyFactory(ctx, this);
|
|
185
|
+
this.deleteAvatar = deleteAvatarFactory(ctx, this);
|
|
186
|
+
this.deleteBankAccount = deleteBankAccountFactory(ctx, this);
|
|
187
|
+
this.deleteCatalog = deleteCatalogFactory(ctx, this);
|
|
188
|
+
this.deleteChat = deleteChatFactory(ctx, this);
|
|
189
|
+
this.deleteGroupInviteBox = deleteGroupInviteBoxFactory(ctx, this);
|
|
190
|
+
this.deleteMessage = deleteMessageFactory(ctx, this);
|
|
191
|
+
this.deleteProductCatalog = deleteProductCatalogFactory(ctx, this);
|
|
192
|
+
this.disableGroupLink = disableGroupLinkFactory(ctx, this);
|
|
193
|
+
this.disperseGroup = disperseGroupFactory(ctx, this);
|
|
194
|
+
this.editNote = editNoteFactory(ctx, this);
|
|
195
|
+
this.editReminder = editReminderFactory(ctx, this);
|
|
196
|
+
this.enableGroupLink = enableGroupLinkFactory(ctx, this);
|
|
197
|
+
this.fetchAccountInfo = fetchAccountInfoFactory(ctx, this);
|
|
198
|
+
this.findUser = findUserFactory(ctx, this);
|
|
199
|
+
this.findUserByUsername = findUserByUsernameFactory(ctx, this);
|
|
200
|
+
this.forwardMessage = forwardMessageFactory(ctx, this);
|
|
201
|
+
this.getAliasList = getAliasListFactory(ctx, this);
|
|
202
|
+
this.getAllFriends = getAllFriendsFactory(ctx, this);
|
|
203
|
+
this.getAllGroups = getAllGroupsFactory(ctx, this);
|
|
204
|
+
this.getArchivedChatList = getArchivedChatListFactory(ctx, this);
|
|
205
|
+
this.getAutoDeleteChat = getAutoDeleteChatFactory(ctx, this);
|
|
206
|
+
this.getAutoReplyList = getAutoReplyListFactory(ctx, this);
|
|
207
|
+
this.getAvatarList = getAvatarListFactory(ctx, this);
|
|
208
|
+
this.getAvatarUrlProfile = getAvatarUrlProfileFactory(ctx, this);
|
|
209
|
+
this.getBizAccount = getBizAccountFactory(ctx, this);
|
|
210
|
+
this.getCatalogList = getCatalogListFactory(ctx, this);
|
|
211
|
+
this.getCloseFriends = getCloseFriendsFactory(ctx, this);
|
|
212
|
+
this.getContext = getContextFactory(ctx, this);
|
|
213
|
+
this.getCookie = getCookieFactory(ctx, this);
|
|
214
|
+
this.getFriendBoardList = getFriendBoardListFactory(ctx, this);
|
|
215
|
+
this.getFriendOnlines = getFriendOnlinesFactory(ctx, this);
|
|
216
|
+
this.getFriendRecommendations = getFriendRecommendationsFactory(ctx, this);
|
|
217
|
+
this.getFriendRequestStatus = getFriendRequestStatusFactory(ctx, this);
|
|
218
|
+
this.getFullAvatar = getFullAvatarFactory(ctx, this);
|
|
219
|
+
this.getGroupBlockedMember = getGroupBlockedMemberFactory(ctx, this);
|
|
220
|
+
this.getGroupChatHistory = getGroupChatHistoryFactory(ctx, this);
|
|
221
|
+
this.getGroupInfo = getGroupInfoFactory(ctx, this);
|
|
222
|
+
this.getGroupInviteBoxInfo = getGroupInviteBoxInfoFactory(ctx, this);
|
|
223
|
+
this.getGroupInviteBoxList = getGroupInviteBoxListFactory(ctx, this);
|
|
224
|
+
this.getGroupLinkDetail = getGroupLinkDetailFactory(ctx, this);
|
|
225
|
+
this.getGroupLinkInfo = getGroupLinkInfoFactory(ctx, this);
|
|
226
|
+
this.getGroupMembersInfo = getGroupMembersInfoFactory(ctx, this);
|
|
227
|
+
this.getHiddenConversations = getHiddenConversationsFactory(ctx, this);
|
|
228
|
+
this.getLabels = getLabelsFactory(ctx, this);
|
|
229
|
+
this.getListBank = getListBankFactory(ctx, this);
|
|
230
|
+
this.getListBankAccount = getListBankAccountFactory(ctx, this);
|
|
231
|
+
this.getListBoard = getListBoardFactory(ctx, this);
|
|
232
|
+
this.getListDevice = getListDeviceFactory(ctx, this);
|
|
233
|
+
this.getListReminder = getListReminderFactory(ctx, this);
|
|
234
|
+
this.getMultiUsersByPhones = getMultiUsersByPhonesFactory(ctx, this);
|
|
235
|
+
this.getMute = getMuteFactory(ctx, this);
|
|
236
|
+
this.getOwnId = getOwnIdFactory(ctx, this);
|
|
237
|
+
this.getPendingGroupMembers = getPendingGroupMembersFactory(ctx, this);
|
|
238
|
+
this.getPinConversations = getPinConversationsFactory(ctx, this);
|
|
239
|
+
this.getPollDetail = getPollDetailFactory(ctx, this);
|
|
240
|
+
this.getProductCatalogList = getProductCatalogListFactory(ctx, this);
|
|
241
|
+
this.getQR = getQRFactory(ctx, this);
|
|
242
|
+
this.getQuickMessageList = getQuickMessageListFactory(ctx, this);
|
|
243
|
+
this.getRelatedFriendGroup = getRelatedFriendGroupFactory(ctx, this);
|
|
244
|
+
this.getReminder = getReminderFactory(ctx, this);
|
|
245
|
+
this.getReminderResponses = getReminderResponsesFactory(ctx, this);
|
|
246
|
+
this.getSentFriendRequest = getSentFriendRequestFactory(ctx, this);
|
|
247
|
+
this.getSettings = getSettingsFactory(ctx, this);
|
|
248
|
+
this.getStickerCategoryDetail = getStickerCategoryDetailFactory(ctx, this);
|
|
249
|
+
this.getStickers = getStickersFactory(ctx, this);
|
|
250
|
+
this.getStickersDetail = getStickersDetailFactory(ctx, this);
|
|
251
|
+
this.getUnreadMark = getUnreadMarkFactory(ctx, this);
|
|
252
|
+
this.getUserInfo = getUserInfoFactory(ctx, this);
|
|
253
|
+
this.inviteUserToGroups = inviteUserToGroupsFactory(ctx, this);
|
|
254
|
+
this.joinGroupInviteBox = joinGroupInviteBoxFactory(ctx, this);
|
|
255
|
+
this.joinGroupLink = joinGroupLinkFactory(ctx, this);
|
|
256
|
+
this.keepAlive = keepAliveFactory(ctx, this);
|
|
257
|
+
this.lastOnline = lastOnlineFactory(ctx, this);
|
|
258
|
+
this.leaveGroup = leaveGroupFactory(ctx, this);
|
|
259
|
+
this.lockPoll = lockPollFactory(ctx, this);
|
|
260
|
+
this.lostFocus = lostFocusFactory(ctx, this);
|
|
261
|
+
this.parseLink = parseLinkFactory(ctx, this);
|
|
262
|
+
this.registerCatalog = registerCatalogFactory(ctx, this);
|
|
263
|
+
this.rejectFriendRequest = rejectFriendRequestFactory(ctx, this);
|
|
264
|
+
this.removeFriend = removeFriendFactory(ctx, this);
|
|
265
|
+
this.removeFriendAlias = removeFriendAliasFactory(ctx, this);
|
|
266
|
+
this.removeGroupBlockedMember = removeGroupBlockedMemberFactory(ctx, this);
|
|
267
|
+
this.removeGroupDeputy = removeGroupDeputyFactory(ctx, this);
|
|
268
|
+
this.removeQuickMessage = removeQuickMessageFactory(ctx, this);
|
|
269
|
+
this.removeReminder = removeReminderFactory(ctx, this);
|
|
270
|
+
this.removeUnreadMark = removeUnreadMarkFactory(ctx, this);
|
|
271
|
+
this.removeUserFromGroup = removeUserFromGroupFactory(ctx, this);
|
|
272
|
+
this.resetHiddenConversPin = resetHiddenConversPinFactory(ctx, this);
|
|
273
|
+
this.reuseAvatar = reuseAvatarFactory(ctx, this);
|
|
274
|
+
this.reviewPendingMemberRequest = reviewPendingMemberRequestFactory(ctx, this);
|
|
275
|
+
this.scanURL = scanURLFactory(ctx, this);
|
|
276
|
+
this.searchSticker = searchStickerFactory(ctx, this);
|
|
277
|
+
this.sendBankCard = sendBankCardFactory(ctx, this);
|
|
278
|
+
this.sendCard = sendCardFactory(ctx, this);
|
|
279
|
+
this.sendDeliveredEvent = sendDeliveredEventFactory(ctx, this);
|
|
280
|
+
this.sendFriendRequest = sendFriendRequestFactory(ctx, this);
|
|
281
|
+
this.sendLink = sendLinkFactory(ctx, this);
|
|
282
|
+
this.sendMessage = sendMessageFactory(ctx, this);
|
|
283
|
+
this.sendReport = sendReportFactory(ctx, this);
|
|
284
|
+
this.sendSeenEvent = sendSeenEventFactory(ctx, this);
|
|
285
|
+
this.sendSticker = sendStickerFactory(ctx, this);
|
|
286
|
+
this.sendTypingEvent = sendTypingEventFactory(ctx, this);
|
|
287
|
+
this.sendVideo = sendVideoFactory(ctx, this);
|
|
288
|
+
this.sendVoice = sendVoiceFactory(ctx, this);
|
|
289
|
+
this.setHiddenConversations = setHiddenConversationsFactory(ctx, this);
|
|
290
|
+
this.setMute = setMuteFactory(ctx, this);
|
|
291
|
+
this.setPinnedConversations = setPinnedConversationsFactory(ctx, this);
|
|
292
|
+
this.sharePoll = sharePollFactory(ctx, this);
|
|
293
|
+
this.unblockUser = unblockUserFactory(ctx, this);
|
|
294
|
+
this.undo = undoFactory(ctx, this);
|
|
295
|
+
this.undoFriendRequest = undoFriendRequestFactory(ctx, this);
|
|
296
|
+
this.updateActiveStatus = updateActiveStatusFactory(ctx, this);
|
|
297
|
+
this.updateArchivedChatList = updateArchivedChatListFactory(ctx, this);
|
|
298
|
+
this.updateAutoDeleteChat = updateAutoDeleteChatFactory(ctx, this);
|
|
299
|
+
this.updateAutoReply = updateAutoReplyFactory(ctx, this);
|
|
300
|
+
this.updateBankAccount = updateBankAccountFactory(ctx, this);
|
|
301
|
+
this.updateCatalog = updateCatalogFactory(ctx, this);
|
|
302
|
+
this.updateGroupSettings = updateGroupSettingsFactory(ctx, this);
|
|
303
|
+
this.updateHiddenConversPin = updateHiddenConversPinFactory(ctx, this);
|
|
304
|
+
this.updateLabels = updateLabelsFactory(ctx, this);
|
|
305
|
+
this.updateLang = updateLangFactory(ctx, this);
|
|
306
|
+
this.updateProductCatalog = updateProductCatalogFactory(ctx, this);
|
|
307
|
+
this.updateProfile = updateProfileFactory(ctx, this);
|
|
308
|
+
this.updateProfileBio = updateProfileBioFactory(ctx, this);
|
|
309
|
+
this.updateQuickMessage = updateQuickMessageFactory(ctx, this);
|
|
310
|
+
this.updateSettings = updateSettingsFactory(ctx, this);
|
|
311
|
+
this.upgradeGroupToCommunity = upgradeGroupToCommunityFactory(ctx, this);
|
|
312
|
+
this.uploadAttachment = uploadAttachmentFactory(ctx, this);
|
|
313
|
+
this.uploadProductPhoto = uploadProductPhotoFactory(ctx, this);
|
|
314
|
+
this.votePoll = votePollFactory(ctx, this);
|
|
315
|
+
this.custom = customFactory(ctx, this);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ZaloApiError = require('./ZaloApiError.cjs');
|
|
4
|
+
|
|
5
|
+
class ZaloApiLoginQRAborted extends ZaloApiError.ZaloApiError {
|
|
6
|
+
constructor(message = "Operation aborted") {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "ZaloApiLoginQRAborted";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.ZaloApiLoginQRAborted = ZaloApiLoginQRAborted;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ZaloApiError = require('./ZaloApiError.cjs');
|
|
4
|
+
|
|
5
|
+
class ZaloApiLoginQRDeclined extends ZaloApiError.ZaloApiError {
|
|
6
|
+
constructor(message = "Login QR request declined") {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "ZaloApiLoginQRDeclined";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.ZaloApiLoginQRDeclined = ZaloApiLoginQRDeclined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ZaloApiError = require('./ZaloApiError.cjs');
|
|
4
|
+
|
|
5
|
+
class ZaloApiMissingImageMetadataGetter extends ZaloApiError.ZaloApiError {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("Missing `imageMetadataGetter`. Please provide it in the Zalo object options.");
|
|
8
|
+
this.name = "ZaloApiMissingImageMetadataGetter";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.ZaloApiMissingImageMetadataGetter = ZaloApiMissingImageMetadataGetter;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ZaloApiError = require('../Errors/ZaloApiError.cjs');
|
|
4
|
+
var utils = require('../utils.cjs');
|
|
5
|
+
|
|
6
|
+
const acceptFriendRequestFactory = utils.apiFactory()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend[0]}/api/friend/accept`);
|
|
8
|
+
/**
|
|
9
|
+
* Accept a friend request from a User
|
|
10
|
+
*
|
|
11
|
+
* @param friendId The friend ID to user request is accept
|
|
12
|
+
*
|
|
13
|
+
* @throws {ZaloApiError}
|
|
14
|
+
*/
|
|
15
|
+
return async function acceptFriendRequest(friendId) {
|
|
16
|
+
const params = {
|
|
17
|
+
fid: friendId,
|
|
18
|
+
language: ctx.language,
|
|
19
|
+
};
|
|
20
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
21
|
+
if (!encryptedParams)
|
|
22
|
+
throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
|
|
23
|
+
const response = await utils.request(serviceURL, {
|
|
24
|
+
method: "POST",
|
|
25
|
+
body: new URLSearchParams({
|
|
26
|
+
params: encryptedParams,
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
return utils.resolve(response);
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
exports.acceptFriendRequestFactory = acceptFriendRequestFactory;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ZaloApiError = require('../Errors/ZaloApiError.cjs');
|
|
4
|
+
var utils = require('../utils.cjs');
|
|
5
|
+
|
|
6
|
+
const addGroupBlockedMemberFactory = utils.apiFactory()((api, _, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group[0]}/api/group/blockedmems/add`);
|
|
8
|
+
/**
|
|
9
|
+
* Add group blocked member
|
|
10
|
+
*
|
|
11
|
+
* @param memberId member id(s)
|
|
12
|
+
* @param groupId group id
|
|
13
|
+
*
|
|
14
|
+
* @throws {ZaloApiError}
|
|
15
|
+
*/
|
|
16
|
+
return async function addGroupBlockedMember(memberId, groupId) {
|
|
17
|
+
if (!Array.isArray(memberId))
|
|
18
|
+
memberId = [memberId];
|
|
19
|
+
const params = {
|
|
20
|
+
grid: groupId,
|
|
21
|
+
members: memberId,
|
|
22
|
+
};
|
|
23
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
24
|
+
if (!encryptedParams)
|
|
25
|
+
throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
|
|
26
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
27
|
+
method: "GET",
|
|
28
|
+
});
|
|
29
|
+
return utils.resolve(response);
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
exports.addGroupBlockedMemberFactory = addGroupBlockedMemberFactory;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ZaloApiError = require('../Errors/ZaloApiError.cjs');
|
|
4
|
+
var utils = require('../utils.cjs');
|
|
5
|
+
|
|
6
|
+
const addGroupDeputyFactory = utils.apiFactory()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group[0]}/api/group/admins/add`);
|
|
8
|
+
/**
|
|
9
|
+
* Add group deputy
|
|
10
|
+
*
|
|
11
|
+
* @param memberId user Id or list of user Ids
|
|
12
|
+
* @param groupId group Id
|
|
13
|
+
*
|
|
14
|
+
* @throws {ZaloApiError}
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
return async function addGroupDeputy(memberId, groupId) {
|
|
18
|
+
if (!Array.isArray(memberId))
|
|
19
|
+
memberId = [memberId];
|
|
20
|
+
const params = {
|
|
21
|
+
grid: groupId,
|
|
22
|
+
members: memberId,
|
|
23
|
+
imei: ctx.imei,
|
|
24
|
+
};
|
|
25
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
26
|
+
if (!encryptedParams)
|
|
27
|
+
throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
|
|
28
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
29
|
+
method: "GET",
|
|
30
|
+
});
|
|
31
|
+
return utils.resolve(response);
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
exports.addGroupDeputyFactory = addGroupDeputyFactory;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ZaloApiError = require('../Errors/ZaloApiError.cjs');
|
|
4
|
+
var utils = require('../utils.cjs');
|
|
5
|
+
|
|
6
|
+
const addPollOptionsFactory = utils.apiFactory()((api, _ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group[0]}/api/poll/option/add`);
|
|
8
|
+
/**
|
|
9
|
+
* Add new option to poll
|
|
10
|
+
*
|
|
11
|
+
* @param payload
|
|
12
|
+
*
|
|
13
|
+
* @throws {ZaloApiError}
|
|
14
|
+
*/
|
|
15
|
+
return async function addPollOptions(payload) {
|
|
16
|
+
const params = {
|
|
17
|
+
poll_id: payload.pollId,
|
|
18
|
+
new_options: JSON.stringify(payload.options),
|
|
19
|
+
voted_option_ids: payload.votedOptionIds,
|
|
20
|
+
};
|
|
21
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
22
|
+
if (!encryptedParams)
|
|
23
|
+
throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
|
|
24
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
25
|
+
method: "GET",
|
|
26
|
+
});
|
|
27
|
+
return utils.resolve(response);
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
exports.addPollOptionsFactory = addPollOptionsFactory;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ZaloApiError = require('../Errors/ZaloApiError.cjs');
|
|
4
|
+
var utils = require('../utils.cjs');
|
|
5
|
+
|
|
6
|
+
const addQuickMessageFactory = utils.apiFactory()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.quick_message[0]}/api/quickmessage/create`);
|
|
8
|
+
/**
|
|
9
|
+
* Add quick message
|
|
10
|
+
*
|
|
11
|
+
* @param addPayload - The payload containing data to add the quick message
|
|
12
|
+
*
|
|
13
|
+
* @note Zalo might throw an error with code 821 if you have reached the limit of quick messages.
|
|
14
|
+
*
|
|
15
|
+
* @throws {ZaloApiError}
|
|
16
|
+
*/
|
|
17
|
+
return async function addQuickMessage(addPayload) {
|
|
18
|
+
const isType = !addPayload.media ? 0 : 1;
|
|
19
|
+
const params = {
|
|
20
|
+
keyword: addPayload.keyword,
|
|
21
|
+
message: {
|
|
22
|
+
title: addPayload.title,
|
|
23
|
+
params: "",
|
|
24
|
+
},
|
|
25
|
+
type: isType,
|
|
26
|
+
imei: ctx.imei,
|
|
27
|
+
};
|
|
28
|
+
if (isType === 1) {
|
|
29
|
+
if (!addPayload.media)
|
|
30
|
+
throw new ZaloApiError.ZaloApiError("Media is required");
|
|
31
|
+
const uploadMedia = await api.uploadProductPhoto({
|
|
32
|
+
file: addPayload.media,
|
|
33
|
+
});
|
|
34
|
+
const photoId = uploadMedia.photoId;
|
|
35
|
+
const thumbUrl = uploadMedia.thumbUrl;
|
|
36
|
+
const normalUrl = uploadMedia.normalUrl;
|
|
37
|
+
const hdUrl = uploadMedia.hdUrl;
|
|
38
|
+
params.media = {
|
|
39
|
+
items: [
|
|
40
|
+
{
|
|
41
|
+
type: 0,
|
|
42
|
+
photoId: photoId,
|
|
43
|
+
title: "",
|
|
44
|
+
width: "",
|
|
45
|
+
height: "",
|
|
46
|
+
previewThumb: thumbUrl,
|
|
47
|
+
rawUrl: normalUrl || hdUrl,
|
|
48
|
+
thumbUrl: thumbUrl,
|
|
49
|
+
normalUrl: normalUrl || hdUrl,
|
|
50
|
+
hdUrl: hdUrl || normalUrl,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
56
|
+
if (!encryptedParams)
|
|
57
|
+
throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
|
|
58
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
59
|
+
method: "GET",
|
|
60
|
+
});
|
|
61
|
+
return utils.resolve(response);
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
exports.addQuickMessageFactory = addQuickMessageFactory;
|