zalo-api-sdk 1.0.0
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/.prettierrc +5 -0
- package/.tmp-cache/_update-notifier-last-checked +0 -0
- package/CODE_OF_CONDUCT.md +157 -0
- package/CONTRIBUTING.md +491 -0
- package/LICENSE +21 -0
- package/README.md +421 -0
- package/SECURITY.md +82 -0
- package/commit-push.sh +79 -0
- package/deploy.sh +172 -0
- package/dist/Errors/ZaloApiError.d.ts +4 -0
- package/dist/Errors/ZaloApiError.js +7 -0
- package/dist/Errors/index.d.ts +1 -0
- package/dist/Errors/index.js +1 -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/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/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/createNoteGroup.d.ts +7 -0
- package/dist/apis/createNoteGroup.js +47 -0
- package/dist/apis/createPoll.d.ts +57 -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 +10 -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/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/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/editNoteGroup.d.ts +32 -0
- package/dist/apis/editNoteGroup.js +40 -0
- package/dist/apis/editReminder.d.ts +18 -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 +34 -0
- package/dist/apis/fetchAccountInfo.js +10 -0
- package/dist/apis/findUser.d.ts +15 -0
- package/dist/apis/findUser.js +40 -0
- package/dist/apis/forwardMessage.d.ts +26 -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 +34 -0
- package/dist/apis/getAllFriends.js +32 -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/getBizAccount.d.ts +19 -0
- package/dist/apis/getBizAccount.js +27 -0
- package/dist/apis/getCatalogList.d.ts +12 -0
- package/dist/apis/getCatalogList.js +32 -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/getFriendRequestStatus.d.ts +8 -0
- package/dist/apis/getFriendRequestStatus.js +25 -0
- package/dist/apis/getGroupBlockedMember.d.ts +17 -0
- package/dist/apis/getGroupBlockedMember.js +29 -0
- package/dist/apis/getGroupInfo.d.ts +43 -0
- package/dist/apis/getGroupInfo.js +32 -0
- package/dist/apis/getGroupLinkDetail.d.ts +6 -0
- package/dist/apis/getGroupLinkDetail.js +25 -0
- package/dist/apis/getGroupLinkInfo.d.ts +31 -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 +15 -0
- package/dist/apis/getLabels.js +28 -0
- package/dist/apis/getListBoard.d.ts +15 -0
- package/dist/apis/getListBoard.js +45 -0
- package/dist/apis/getListReminder.d.ts +22 -0
- package/dist/apis/getListReminder.js +47 -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 +10 -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 +14 -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/getQuickMessage.d.ts +7 -0
- package/dist/apis/getQuickMessage.js +24 -0
- package/dist/apis/getReceivedFriendRequests.d.ts +35 -0
- package/dist/apis/getReceivedFriendRequests.js +22 -0
- package/dist/apis/getReminder.d.ts +13 -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 +17 -0
- package/dist/apis/getSentFriendRequest.js +24 -0
- package/dist/apis/getStickers.d.ts +1 -0
- package/dist/apis/getStickers.js +40 -0
- package/dist/apis/getStickersDetail.d.ts +24 -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 +39 -0
- package/dist/apis/getUserInfo.js +42 -0
- package/dist/apis/inviteUserToGroups.d.ts +10 -0
- package/dist/apis/inviteUserToGroups.js +30 -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 +100 -0
- package/dist/apis/listen.js +424 -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 +70 -0
- package/dist/apis/loginQR.js +359 -0
- package/dist/apis/parseLink.d.ts +21 -0
- package/dist/apis/parseLink.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 +6 -0
- package/dist/apis/reviewPendingMemberRequest.js +31 -0
- package/dist/apis/sendBankCard.d.ts +9 -0
- package/dist/apis/sendBankCard.js +39 -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 +460 -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 +6 -0
- package/dist/apis/sendSticker.js +56 -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 +37 -0
- package/dist/apis/setMute.d.ts +17 -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/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/updateAutoDeleteChat.d.ts +9 -0
- package/dist/apis/updateAutoDeleteChat.js +40 -0
- package/dist/apis/updateAutoReply.d.ts +14 -0
- package/dist/apis/updateAutoReply.js +37 -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 +24 -0
- package/dist/apis/updateLabels.js +34 -0
- package/dist/apis/updateLang.d.ts +7 -0
- package/dist/apis/updateLang.js +32 -0
- package/dist/apis/updateProductCatalog.d.ts +25 -0
- package/dist/apis/updateProductCatalog.js +51 -0
- package/dist/apis/updateProfile.d.ts +13 -0
- package/dist/apis/updateProfile.js +42 -0
- package/dist/apis/updateQuickMessage.d.ts +11 -0
- package/dist/apis/updateQuickMessage.js +61 -0
- package/dist/apis/updateSettings.d.ts +3 -0
- package/dist/apis/updateSettings.js +23 -0
- package/dist/apis/uploadAttachment.d.ts +50 -0
- package/dist/apis/uploadAttachment.js +205 -0
- package/dist/apis/uploadProductPhoto.d.ts +14 -0
- package/dist/apis/uploadProductPhoto.js +50 -0
- package/dist/cjs/Errors/ZaloApiError.cjs +11 -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/addQuickMessage.cjs +65 -0
- package/dist/cjs/apis/addReaction.cjs +304 -0
- package/dist/cjs/apis/addUnreadMark.cjs +62 -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/createCatalog.cjs +34 -0
- package/dist/cjs/apis/createGroup.cjs +48 -0
- package/dist/cjs/apis/createNoteGroup.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 +73 -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/deleteCatalog.cjs +33 -0
- package/dist/cjs/apis/deleteChat.cjs +60 -0
- package/dist/cjs/apis/deleteMessage.cjs +62 -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/editNoteGroup.cjs +45 -0
- package/dist/cjs/apis/editReminder.cjs +71 -0
- package/dist/cjs/apis/enableGroupLink.cjs +30 -0
- package/dist/cjs/apis/fetchAccountInfo.cjs +15 -0
- package/dist/cjs/apis/findUser.cjs +45 -0
- package/dist/cjs/apis/forwardMessage.cjs +109 -0
- package/dist/cjs/apis/getAliasList.cjs +32 -0
- package/dist/cjs/apis/getAllFriends.cjs +37 -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/getBizAccount.cjs +32 -0
- package/dist/cjs/apis/getCatalogList.cjs +37 -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/getFriendRequestStatus.cjs +30 -0
- package/dist/cjs/apis/getGroupBlockedMember.cjs +34 -0
- package/dist/cjs/apis/getGroupInfo.cjs +37 -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/getListBoard.cjs +55 -0
- package/dist/cjs/apis/getListReminder.cjs +57 -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/getQuickMessage.cjs +29 -0
- package/dist/cjs/apis/getReceivedFriendRequests.cjs +27 -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/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 +47 -0
- package/dist/cjs/apis/inviteUserToGroups.cjs +35 -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 +435 -0
- package/dist/cjs/apis/lockPoll.cjs +33 -0
- package/dist/cjs/apis/login.cjs +102 -0
- package/dist/cjs/apis/loginQR.cjs +364 -0
- package/dist/cjs/apis/parseLink.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 +50 -0
- package/dist/cjs/apis/removeUnreadMark.cjs +60 -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 +36 -0
- package/dist/cjs/apis/sendBankCard.cjs +49 -0
- package/dist/cjs/apis/sendCard.cjs +69 -0
- package/dist/cjs/apis/sendDeliveredEvent.cjs +65 -0
- package/dist/cjs/apis/sendFriendRequest.cjs +44 -0
- package/dist/cjs/apis/sendLink.cjs +71 -0
- package/dist/cjs/apis/sendMessage.cjs +469 -0
- package/dist/cjs/apis/sendReport.cjs +63 -0
- package/dist/cjs/apis/sendSeenEvent.cjs +73 -0
- package/dist/cjs/apis/sendSticker.cjs +66 -0
- package/dist/cjs/apis/sendTypingEvent.cjs +43 -0
- package/dist/cjs/apis/sendVideo.cjs +128 -0
- package/dist/cjs/apis/sendVoice.cjs +83 -0
- package/dist/cjs/apis/setHiddenConversations.cjs +47 -0
- package/dist/cjs/apis/setMute.cjs +77 -0
- package/dist/cjs/apis/setPinnedConversations.cjs +44 -0
- package/dist/cjs/apis/unblockUser.cjs +33 -0
- package/dist/cjs/apis/undo.cjs +52 -0
- package/dist/cjs/apis/undoFriendRequest.cjs +32 -0
- package/dist/cjs/apis/updateAutoDeleteChat.cjs +50 -0
- package/dist/cjs/apis/updateAutoReply.cjs +42 -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 +37 -0
- package/dist/cjs/apis/updateProductCatalog.cjs +56 -0
- package/dist/cjs/apis/updateProfile.cjs +47 -0
- package/dist/cjs/apis/updateQuickMessage.cjs +66 -0
- package/dist/cjs/apis/updateSettings.cjs +28 -0
- package/dist/cjs/apis/uploadAttachment.cjs +215 -0
- package/dist/cjs/apis/uploadProductPhoto.cjs +55 -0
- package/dist/cjs/context.cjs +34 -0
- package/dist/cjs/index.cjs +121 -0
- package/dist/cjs/models/AutoReply.cjs +9 -0
- package/dist/cjs/models/DeliveredMessage.cjs +23 -0
- package/dist/cjs/models/Enum.cjs +95 -0
- package/dist/cjs/models/FriendEvent.cjs +87 -0
- package/dist/cjs/models/GroupEvent.cjs +88 -0
- package/dist/cjs/models/Message.cjs +32 -0
- package/dist/cjs/models/Reaction.cjs +74 -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 +46 -0
- package/dist/cjs/update.cjs +27 -0
- package/dist/cjs/utils.cjs +732 -0
- package/dist/cjs/zalo.cjs +360 -0
- package/dist/context.d.ts +177 -0
- package/dist/context.js +28 -0
- package/dist/index.d.ts +130 -0
- package/dist/index.js +11 -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/Board.d.ts +54 -0
- package/dist/models/Board.js +1 -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 +87 -0
- package/dist/models/Enum.js +93 -0
- package/dist/models/FriendEvent.d.ts +107 -0
- package/dist/models/FriendEvent.js +83 -0
- package/dist/models/GroupEvent.d.ts +197 -0
- package/dist/models/GroupEvent.js +84 -0
- package/dist/models/Message.d.ts +91 -0
- package/dist/models/Message.js +26 -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 +35 -0
- package/dist/models/Reminder.js +1 -0
- package/dist/models/SeenMessage.d.ts +26 -0
- package/dist/models/SeenMessage.js +17 -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/ZBusiness.d.ts +29 -0
- package/dist/models/ZBusiness.js +42 -0
- package/dist/models/index.d.ts +17 -0
- package/dist/models/index.js +17 -0
- package/dist/update.d.ts +2 -0
- package/dist/update.js +22 -0
- package/dist/utils.d.ts +168 -0
- package/dist/utils.js +748 -0
- package/dist/zalo.d.ts +291 -0
- package/dist/zalo.js +354 -0
- package/eslint.config.js +21 -0
- package/index.d.ts +2 -0
- package/package.json +143 -0
- package/qr.png +0 -0
- package/rollup.config.js +28 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { ThreadType } from "../models/index.js";
|
|
3
|
+
import { apiFactory } from "../utils.js";
|
|
4
|
+
export const editReminderFactory = apiFactory()((api, ctx, utils) => {
|
|
5
|
+
const serviceURL = {
|
|
6
|
+
[ThreadType.User]: utils.makeURL(`${api.zpwServiceMap.group_board[0]}/api/board/oneone/update`),
|
|
7
|
+
[ThreadType.Group]: utils.makeURL(`${api.zpwServiceMap.group_board[0]}/api/board/topic/updatev2`),
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Edit an existing reminder
|
|
11
|
+
*
|
|
12
|
+
* @param options Reminder parameters
|
|
13
|
+
* @param threadId Thread ID
|
|
14
|
+
* @param type Thread type (User/Group)
|
|
15
|
+
*
|
|
16
|
+
* @throws ZaloApiError
|
|
17
|
+
*/
|
|
18
|
+
return async function editReminder(options, threadId, type = ThreadType.User) {
|
|
19
|
+
var _a, _b, _c, _d, _e, _f;
|
|
20
|
+
const requestParams = type === ThreadType.User
|
|
21
|
+
? {
|
|
22
|
+
objectData: JSON.stringify({
|
|
23
|
+
toUid: threadId,
|
|
24
|
+
type: 0,
|
|
25
|
+
color: -16777216,
|
|
26
|
+
emoji: (_a = options.emoji) !== null && _a !== void 0 ? _a : "",
|
|
27
|
+
startTime: (_b = options.startTime) !== null && _b !== void 0 ? _b : Date.now(),
|
|
28
|
+
duration: -1,
|
|
29
|
+
params: { title: options.title },
|
|
30
|
+
needPin: false,
|
|
31
|
+
reminderId: options.topicId,
|
|
32
|
+
repeat: (_c = options.repeat) !== null && _c !== void 0 ? _c : 0,
|
|
33
|
+
}),
|
|
34
|
+
}
|
|
35
|
+
: {
|
|
36
|
+
grid: threadId,
|
|
37
|
+
type: 0,
|
|
38
|
+
color: -16777216,
|
|
39
|
+
emoji: (_d = options.emoji) !== null && _d !== void 0 ? _d : "",
|
|
40
|
+
startTime: (_e = options.startTime) !== null && _e !== void 0 ? _e : Date.now(),
|
|
41
|
+
duration: -1,
|
|
42
|
+
params: JSON.stringify({
|
|
43
|
+
title: options.title,
|
|
44
|
+
}),
|
|
45
|
+
topicId: options.topicId,
|
|
46
|
+
repeat: (_f = options.repeat) !== null && _f !== void 0 ? _f : 0,
|
|
47
|
+
imei: ctx.imei,
|
|
48
|
+
pinAct: 2,
|
|
49
|
+
};
|
|
50
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(requestParams));
|
|
51
|
+
if (!encryptedParams)
|
|
52
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
53
|
+
const response = await utils.request(serviceURL[type], {
|
|
54
|
+
method: "POST",
|
|
55
|
+
body: new URLSearchParams({
|
|
56
|
+
params: encryptedParams,
|
|
57
|
+
}),
|
|
58
|
+
});
|
|
59
|
+
return utils.resolve(response);
|
|
60
|
+
};
|
|
61
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type EnableGroupLinkResponse = {
|
|
2
|
+
link: string;
|
|
3
|
+
expiration_date: number;
|
|
4
|
+
enabled: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const enableGroupLinkFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => (groupId: string) => Promise<EnableGroupLinkResponse>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const enableGroupLinkFactory = apiFactory()((api, ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group[0]}/api/group/link/new`);
|
|
5
|
+
/**
|
|
6
|
+
* Enable and create new group link
|
|
7
|
+
*
|
|
8
|
+
* @param groupId The group id
|
|
9
|
+
*
|
|
10
|
+
* @throws ZaloApiError
|
|
11
|
+
*/
|
|
12
|
+
return async function enableGroupLink(groupId) {
|
|
13
|
+
const params = {
|
|
14
|
+
grid: groupId,
|
|
15
|
+
imei: ctx.imei,
|
|
16
|
+
};
|
|
17
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
18
|
+
if (!encryptedParams)
|
|
19
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
20
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
21
|
+
method: "GET",
|
|
22
|
+
});
|
|
23
|
+
return utils.resolve(response);
|
|
24
|
+
};
|
|
25
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Gender, ZBusinessPackage } from "../models/index.js";
|
|
2
|
+
export type FetchAccountInfoResponse = {
|
|
3
|
+
userId: string;
|
|
4
|
+
username: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
zaloName: string;
|
|
7
|
+
avatar: string;
|
|
8
|
+
bgavatar: string;
|
|
9
|
+
cover: string;
|
|
10
|
+
gender: Gender;
|
|
11
|
+
dob: number;
|
|
12
|
+
sdob: string;
|
|
13
|
+
status: string;
|
|
14
|
+
phoneNumber: string;
|
|
15
|
+
isFr: number;
|
|
16
|
+
isBlocked: number;
|
|
17
|
+
lastActionTime: number;
|
|
18
|
+
lastUpdateTime: number;
|
|
19
|
+
isActive: number;
|
|
20
|
+
key: number;
|
|
21
|
+
type: number;
|
|
22
|
+
isActivePC: number;
|
|
23
|
+
isActiveWeb: number;
|
|
24
|
+
isValid: number;
|
|
25
|
+
userKey: string;
|
|
26
|
+
accountStatus: number;
|
|
27
|
+
oaInfo: unknown;
|
|
28
|
+
user_mode: number;
|
|
29
|
+
globalId: string;
|
|
30
|
+
bizPkg: ZBusinessPackage;
|
|
31
|
+
createdTs: number;
|
|
32
|
+
oa_status: unknown;
|
|
33
|
+
};
|
|
34
|
+
export declare const fetchAccountInfoFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => () => Promise<FetchAccountInfoResponse>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { apiFactory } from "../utils.js";
|
|
2
|
+
export const fetchAccountInfoFactory = apiFactory()((api, _, utils) => {
|
|
3
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.profile[0]}/api/social/profile/me-v2`);
|
|
4
|
+
return async function fetchAccountInfo() {
|
|
5
|
+
const response = await utils.request(serviceURL, {
|
|
6
|
+
method: "GET",
|
|
7
|
+
});
|
|
8
|
+
return utils.resolve(response);
|
|
9
|
+
};
|
|
10
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Gender, ZBusinessPackage } from "../models/index.js";
|
|
2
|
+
export type FindUserResponse = {
|
|
3
|
+
avatar: string;
|
|
4
|
+
cover: string;
|
|
5
|
+
status: string;
|
|
6
|
+
gender: Gender;
|
|
7
|
+
dob: number;
|
|
8
|
+
sdob: string;
|
|
9
|
+
globalId: string;
|
|
10
|
+
bizPkg: ZBusinessPackage;
|
|
11
|
+
uid: string;
|
|
12
|
+
zalo_name: string;
|
|
13
|
+
display_name: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const findUserFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => (phoneNumber: string) => Promise<FindUserResponse>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const findUserFactory = apiFactory()((api, ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend[0]}/api/friend/profile/get`);
|
|
5
|
+
/**
|
|
6
|
+
* Find user by phone number
|
|
7
|
+
*
|
|
8
|
+
* @param phoneNumber Phone number
|
|
9
|
+
*
|
|
10
|
+
* @throws ZaloApiError
|
|
11
|
+
*/
|
|
12
|
+
return async function findUser(phoneNumber) {
|
|
13
|
+
if (!phoneNumber)
|
|
14
|
+
throw new ZaloApiError("Missing phoneNumber");
|
|
15
|
+
if (phoneNumber.startsWith("0")) {
|
|
16
|
+
if (ctx.language == "vi")
|
|
17
|
+
phoneNumber = "84" + phoneNumber.slice(1);
|
|
18
|
+
}
|
|
19
|
+
const params = {
|
|
20
|
+
phone: phoneNumber,
|
|
21
|
+
avatar_size: 240,
|
|
22
|
+
language: ctx.language,
|
|
23
|
+
imei: ctx.imei,
|
|
24
|
+
reqSrc: 40,
|
|
25
|
+
};
|
|
26
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
27
|
+
if (!encryptedParams)
|
|
28
|
+
throw new ZaloApiError("Failed to encrypt message");
|
|
29
|
+
const finalServiceUrl = new URL(serviceURL);
|
|
30
|
+
finalServiceUrl.searchParams.append("params", encryptedParams);
|
|
31
|
+
const response = await utils.request(utils.makeURL(finalServiceUrl.toString(), {
|
|
32
|
+
params: encryptedParams,
|
|
33
|
+
}));
|
|
34
|
+
return utils.resolve(response, (result) => {
|
|
35
|
+
if (result.error && result.error.code != 216)
|
|
36
|
+
throw new ZaloApiError(result.error.message, result.error.code);
|
|
37
|
+
return result.data;
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ThreadType } from "../models/index.js";
|
|
2
|
+
export type ForwardMessagePayload = {
|
|
3
|
+
message: string;
|
|
4
|
+
threadIds: string[];
|
|
5
|
+
ttl?: number;
|
|
6
|
+
reference?: {
|
|
7
|
+
id: string;
|
|
8
|
+
ts: number;
|
|
9
|
+
logSrcType: number;
|
|
10
|
+
fwLvl: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type Success = {
|
|
14
|
+
clientId: string;
|
|
15
|
+
msgId: string;
|
|
16
|
+
};
|
|
17
|
+
export type Failed = {
|
|
18
|
+
clientId: string;
|
|
19
|
+
errorCode: number;
|
|
20
|
+
errorMessage: string;
|
|
21
|
+
};
|
|
22
|
+
export type ForwardMessageResponse = {
|
|
23
|
+
success: Success[];
|
|
24
|
+
failed: Failed[];
|
|
25
|
+
};
|
|
26
|
+
export declare const forwardMessageFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => (payload: ForwardMessagePayload, type?: ThreadType) => Promise<ForwardMessageResponse>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { ThreadType } from "../models/index.js";
|
|
3
|
+
import { apiFactory } from "../utils.js";
|
|
4
|
+
export const forwardMessageFactory = apiFactory()((api, ctx, utils) => {
|
|
5
|
+
const serviceURL = {
|
|
6
|
+
[ThreadType.User]: utils.makeURL(`${api.zpwServiceMap.file[0]}/api/message/mforward`),
|
|
7
|
+
[ThreadType.Group]: utils.makeURL(`${api.zpwServiceMap.file[0]}/api/group/mforward`),
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Forward message to multiple threads
|
|
11
|
+
*
|
|
12
|
+
* @param payload Forward message payload
|
|
13
|
+
* @param threadId Thread ID(s)
|
|
14
|
+
* @param type Thread type (User/Group)
|
|
15
|
+
*
|
|
16
|
+
* @throws ZaloApiError
|
|
17
|
+
*/
|
|
18
|
+
return async function forwardMessage(payload, type = ThreadType.User) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
if (!payload.message)
|
|
21
|
+
throw new ZaloApiError("Missing message content");
|
|
22
|
+
if (!payload.threadIds || payload.threadIds.length === 0)
|
|
23
|
+
throw new ZaloApiError("Missing thread IDs");
|
|
24
|
+
const timestamp = Date.now();
|
|
25
|
+
const clientId = timestamp.toString();
|
|
26
|
+
const msgInfo = {
|
|
27
|
+
message: payload.message,
|
|
28
|
+
reference: payload.reference
|
|
29
|
+
? JSON.stringify({
|
|
30
|
+
type: 3,
|
|
31
|
+
data: JSON.stringify(payload.reference),
|
|
32
|
+
})
|
|
33
|
+
: undefined,
|
|
34
|
+
};
|
|
35
|
+
const decorLog = payload.reference
|
|
36
|
+
? {
|
|
37
|
+
fw: {
|
|
38
|
+
pmsg: {
|
|
39
|
+
st: 1,
|
|
40
|
+
ts: payload.reference.ts,
|
|
41
|
+
id: payload.reference.id,
|
|
42
|
+
},
|
|
43
|
+
rmsg: {
|
|
44
|
+
st: 1,
|
|
45
|
+
ts: payload.reference.ts,
|
|
46
|
+
id: payload.reference.id,
|
|
47
|
+
},
|
|
48
|
+
fwLvl: payload.reference.fwLvl,
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
: null;
|
|
52
|
+
let params;
|
|
53
|
+
if (type === ThreadType.User) {
|
|
54
|
+
params = {
|
|
55
|
+
toIds: payload.threadIds.map((threadId) => {
|
|
56
|
+
var _a;
|
|
57
|
+
return ({
|
|
58
|
+
clientId,
|
|
59
|
+
toUid: threadId,
|
|
60
|
+
ttl: (_a = payload.ttl) !== null && _a !== void 0 ? _a : 0,
|
|
61
|
+
});
|
|
62
|
+
}),
|
|
63
|
+
imei: ctx.imei,
|
|
64
|
+
ttl: (_a = payload.ttl) !== null && _a !== void 0 ? _a : 0,
|
|
65
|
+
msgType: "1",
|
|
66
|
+
totalIds: payload.threadIds.length,
|
|
67
|
+
msgInfo: JSON.stringify(msgInfo),
|
|
68
|
+
decorLog: JSON.stringify(decorLog),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
params = {
|
|
73
|
+
grids: payload.threadIds.map((threadId) => {
|
|
74
|
+
var _a;
|
|
75
|
+
return ({
|
|
76
|
+
clientId,
|
|
77
|
+
grid: threadId,
|
|
78
|
+
ttl: (_a = payload.ttl) !== null && _a !== void 0 ? _a : 0,
|
|
79
|
+
});
|
|
80
|
+
}),
|
|
81
|
+
ttl: (_b = payload.ttl) !== null && _b !== void 0 ? _b : 0,
|
|
82
|
+
msgType: "1",
|
|
83
|
+
totalIds: payload.threadIds.length,
|
|
84
|
+
msgInfo: JSON.stringify(msgInfo),
|
|
85
|
+
decorLog: JSON.stringify(decorLog),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
89
|
+
if (!encryptedParams)
|
|
90
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
91
|
+
const response = await utils.request(serviceURL[type], {
|
|
92
|
+
method: "POST",
|
|
93
|
+
body: new URLSearchParams({
|
|
94
|
+
params: encryptedParams,
|
|
95
|
+
}),
|
|
96
|
+
});
|
|
97
|
+
return utils.resolve(response);
|
|
98
|
+
};
|
|
99
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type GetAliasListResponse = {
|
|
2
|
+
items: {
|
|
3
|
+
userId: string;
|
|
4
|
+
alias: string;
|
|
5
|
+
}[];
|
|
6
|
+
updateTime: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const getAliasListFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => (count?: number, page?: number) => Promise<GetAliasListResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const getAliasListFactory = apiFactory()((api, ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.alias[0]}/api/alias/list`);
|
|
5
|
+
/**
|
|
6
|
+
* Get alias list
|
|
7
|
+
*
|
|
8
|
+
* @param count Page size (default: 100)
|
|
9
|
+
* @param page Page number (default: 1)
|
|
10
|
+
*
|
|
11
|
+
* @throws ZaloApiError
|
|
12
|
+
*/
|
|
13
|
+
return async function getAliasList(count = 100, page = 1) {
|
|
14
|
+
const params = {
|
|
15
|
+
page,
|
|
16
|
+
count,
|
|
17
|
+
imei: ctx.imei,
|
|
18
|
+
};
|
|
19
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
20
|
+
if (!encryptedParams)
|
|
21
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
22
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
23
|
+
method: "GET",
|
|
24
|
+
});
|
|
25
|
+
return utils.resolve(response);
|
|
26
|
+
};
|
|
27
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Gender, ZBusinessPackage } from "../models/index.js";
|
|
2
|
+
export type GetAllFriendsResponse = {
|
|
3
|
+
userId: string;
|
|
4
|
+
username: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
zaloName: string;
|
|
7
|
+
avatar: string;
|
|
8
|
+
bgavatar: string;
|
|
9
|
+
cover: string;
|
|
10
|
+
gender: Gender;
|
|
11
|
+
dob: number;
|
|
12
|
+
sdob: string;
|
|
13
|
+
status: string;
|
|
14
|
+
phoneNumber: string;
|
|
15
|
+
isFr: number;
|
|
16
|
+
isBlocked: number;
|
|
17
|
+
lastActionTime: number;
|
|
18
|
+
lastUpdateTime: number;
|
|
19
|
+
isActive: number;
|
|
20
|
+
key: number;
|
|
21
|
+
type: number;
|
|
22
|
+
isActivePC: number;
|
|
23
|
+
isActiveWeb: number;
|
|
24
|
+
isValid: number;
|
|
25
|
+
userKey: string;
|
|
26
|
+
accountStatus: number;
|
|
27
|
+
oaInfo: unknown;
|
|
28
|
+
user_mode: number;
|
|
29
|
+
globalId: string;
|
|
30
|
+
bizPkg: ZBusinessPackage;
|
|
31
|
+
createdTs: number;
|
|
32
|
+
oa_status: unknown;
|
|
33
|
+
}[];
|
|
34
|
+
export declare const getAllFriendsFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => (count?: number, page?: number) => Promise<GetAllFriendsResponse>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const getAllFriendsFactory = apiFactory()((api, ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.profile[0]}/api/social/friend/getfriends`);
|
|
5
|
+
/**
|
|
6
|
+
* Get all friends
|
|
7
|
+
*
|
|
8
|
+
* @param count Page size (default: 20000)
|
|
9
|
+
* @param page Page number (default: 1)
|
|
10
|
+
*
|
|
11
|
+
* @throws ZaloApiError
|
|
12
|
+
*/
|
|
13
|
+
return async function getAllFriends(count = 20000, page = 1) {
|
|
14
|
+
const params = {
|
|
15
|
+
incInvalid: 1,
|
|
16
|
+
page,
|
|
17
|
+
count,
|
|
18
|
+
avatar_size: 120,
|
|
19
|
+
actiontime: 0,
|
|
20
|
+
imei: ctx.imei,
|
|
21
|
+
};
|
|
22
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
23
|
+
if (!encryptedParams)
|
|
24
|
+
throw new ZaloApiError("Failed to encrypt message");
|
|
25
|
+
const response = await utils.request(utils.makeURL(serviceURL, {
|
|
26
|
+
params: encryptedParams,
|
|
27
|
+
}), {
|
|
28
|
+
method: "GET",
|
|
29
|
+
});
|
|
30
|
+
return utils.resolve(response);
|
|
31
|
+
};
|
|
32
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type GetAllGroupsResponse = {
|
|
2
|
+
version: string;
|
|
3
|
+
gridVerMap: {
|
|
4
|
+
[groupId: string]: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
export declare const getAllGroupsFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => () => Promise<GetAllGroupsResponse>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { apiFactory } from "../utils.js";
|
|
2
|
+
export const getAllGroupsFactory = apiFactory()((api, _, utils) => {
|
|
3
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group_poll[0]}/api/group/getlg/v4`);
|
|
4
|
+
return async function getAllGroups() {
|
|
5
|
+
const response = await utils.request(serviceURL, {
|
|
6
|
+
method: "GET",
|
|
7
|
+
});
|
|
8
|
+
return utils.resolve(response);
|
|
9
|
+
};
|
|
10
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const getArchivedChatListFactory = apiFactory()((api, ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.label[0]}/api/archivedchat/list`);
|
|
5
|
+
/**
|
|
6
|
+
* Get arcnived chat list
|
|
7
|
+
*
|
|
8
|
+
* @throws ZaloApiError
|
|
9
|
+
*/
|
|
10
|
+
return async function getArchivedChatList() {
|
|
11
|
+
const params = {
|
|
12
|
+
version: 1,
|
|
13
|
+
imei: ctx.imei,
|
|
14
|
+
};
|
|
15
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
16
|
+
if (!encryptedParams)
|
|
17
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
18
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
19
|
+
method: "GET",
|
|
20
|
+
});
|
|
21
|
+
return utils.resolve(response);
|
|
22
|
+
};
|
|
23
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type GetAutoDeleteChatResponse = {
|
|
2
|
+
convers: {
|
|
3
|
+
destId: string;
|
|
4
|
+
isGroup: boolean;
|
|
5
|
+
ttl: number;
|
|
6
|
+
createdAt: number;
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
9
|
+
export declare const getAutoDeleteChatFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => () => Promise<GetAutoDeleteChatResponse>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const getAutoDeleteChatFactory = apiFactory()((api, _ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.conversation[0]}/api/conv/autodelete/getConvers`);
|
|
5
|
+
/**
|
|
6
|
+
* Get auto delete chat
|
|
7
|
+
*
|
|
8
|
+
* @throws ZaloApiError
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
return async function getAutoDeleteChat() {
|
|
12
|
+
const params = {};
|
|
13
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
14
|
+
if (!encryptedParams)
|
|
15
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
16
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
17
|
+
method: "GET",
|
|
18
|
+
});
|
|
19
|
+
return utils.resolve(response);
|
|
20
|
+
};
|
|
21
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AutoReplyItem } from "../models/index.js";
|
|
2
|
+
export type GetAutoReplyListResponse = {
|
|
3
|
+
item: AutoReplyItem[];
|
|
4
|
+
version: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const getAutoReplyListFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => () => Promise<GetAutoReplyListResponse>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const getAutoReplyListFactory = apiFactory()((api, ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.auto_reply[0]}/api/autoreply/list`);
|
|
5
|
+
/**
|
|
6
|
+
* Get auto reply list
|
|
7
|
+
*
|
|
8
|
+
* @note this API used for zBusiness
|
|
9
|
+
* @throws ZaloApiError
|
|
10
|
+
*/
|
|
11
|
+
return async function getAutoReplyList() {
|
|
12
|
+
const params = {
|
|
13
|
+
version: 0,
|
|
14
|
+
cliLang: ctx.language,
|
|
15
|
+
};
|
|
16
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
17
|
+
if (!encryptedParams)
|
|
18
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
19
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
20
|
+
method: "GET",
|
|
21
|
+
});
|
|
22
|
+
return utils.resolve(response);
|
|
23
|
+
};
|
|
24
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type GetAvatarListResponse = {
|
|
2
|
+
albumId: string;
|
|
3
|
+
nextPhotoId: string;
|
|
4
|
+
hasMore: number;
|
|
5
|
+
photos: {
|
|
6
|
+
photoId: string;
|
|
7
|
+
thumbnail: string;
|
|
8
|
+
url: string;
|
|
9
|
+
bkUrl: string;
|
|
10
|
+
}[];
|
|
11
|
+
};
|
|
12
|
+
export declare const getAvatarListFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => (count?: number, page?: number) => Promise<GetAvatarListResponse>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const getAvatarListFactory = apiFactory()((api, ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.profile[0]}/api/social/avatar-list`);
|
|
5
|
+
/**
|
|
6
|
+
* Get avatar list
|
|
7
|
+
*
|
|
8
|
+
* @param count The number of avatars to fetch (default: 50)
|
|
9
|
+
* @param page The page number to fetch (default: 1)
|
|
10
|
+
*
|
|
11
|
+
* @throws ZaloApiError
|
|
12
|
+
*/
|
|
13
|
+
return async function getAvatarList(count = 50, page = 1) {
|
|
14
|
+
const params = {
|
|
15
|
+
page,
|
|
16
|
+
albumId: "0",
|
|
17
|
+
count,
|
|
18
|
+
imei: ctx.imei,
|
|
19
|
+
};
|
|
20
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
21
|
+
if (!encryptedParams)
|
|
22
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
23
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
24
|
+
method: "GET",
|
|
25
|
+
});
|
|
26
|
+
return utils.resolve(response);
|
|
27
|
+
};
|
|
28
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BusinessCategory } from "../models/index.js";
|
|
2
|
+
export type GetBizAccountResponse = {
|
|
3
|
+
biz?: {
|
|
4
|
+
desc: string;
|
|
5
|
+
cate: BusinessCategory;
|
|
6
|
+
addr: string;
|
|
7
|
+
website: string;
|
|
8
|
+
email: string;
|
|
9
|
+
};
|
|
10
|
+
setting_start_page?: {
|
|
11
|
+
enable_biz_label: number;
|
|
12
|
+
enable_cate: number;
|
|
13
|
+
enable_add: number;
|
|
14
|
+
cta_profile: number;
|
|
15
|
+
cta_catalog: unknown;
|
|
16
|
+
};
|
|
17
|
+
pkgId: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const getBizAccountFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => (friendId: string) => Promise<GetBizAccountResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ZaloApiError } from "../Errors/ZaloApiError.js";
|
|
2
|
+
import { apiFactory } from "../utils.js";
|
|
3
|
+
export const getBizAccountFactory = apiFactory()((api, _ctx, utils) => {
|
|
4
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.profile[0]}/api/social/friend/get-bizacc`);
|
|
5
|
+
/**
|
|
6
|
+
* Get biz account
|
|
7
|
+
*
|
|
8
|
+
* @param friendId The friend ID to get biz account
|
|
9
|
+
*
|
|
10
|
+
* @throws ZaloApiError
|
|
11
|
+
*/
|
|
12
|
+
return async function getBizAccount(friendId) {
|
|
13
|
+
const params = {
|
|
14
|
+
fid: friendId,
|
|
15
|
+
};
|
|
16
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
17
|
+
if (!encryptedParams)
|
|
18
|
+
throw new ZaloApiError("Failed to encrypt params");
|
|
19
|
+
const response = await utils.request(serviceURL, {
|
|
20
|
+
method: "POST",
|
|
21
|
+
body: new URLSearchParams({
|
|
22
|
+
params: encryptedParams,
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
return utils.resolve(response);
|
|
26
|
+
};
|
|
27
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CatalogItem } from "../models/index.js";
|
|
2
|
+
export type GetCatalogListPayload = {
|
|
3
|
+
limit?: number;
|
|
4
|
+
lastProductId?: number;
|
|
5
|
+
page?: number;
|
|
6
|
+
};
|
|
7
|
+
export type GetCatalogListResponse = {
|
|
8
|
+
items: CatalogItem[];
|
|
9
|
+
version: number;
|
|
10
|
+
has_more: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const getCatalogListFactory: (ctx: import("../context.js").ContextBase, api: import("../zalo.js").API) => (payload: GetCatalogListPayload) => Promise<GetCatalogListResponse>;
|