@trungdlp/zca-js 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/CODE_OF_CONDUCT.md +163 -0
- package/CONTRIBUTING.md +470 -0
- package/LICENSE +21 -0
- package/README.md +225 -0
- package/SECURITY.md +83 -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/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/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 +3 -0
- package/dist/apis/fetchAccountInfo.js +10 -0
- package/dist/apis/findUser.d.ts +3 -0
- package/dist/apis/findUser.js +41 -0
- package/dist/apis/findUserByUsername.d.ts +3 -0
- package/dist/apis/findUserByUsername.js +26 -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 +33 -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 +6 -0
- package/dist/apis/getAvatarUrlProfile.js +29 -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/getListBoard.d.ts +21 -0
- package/dist/apis/getListBoard.js +45 -0
- package/dist/apis/getListReminder.d.ts +28 -0
- package/dist/apis/getListReminder.js +47 -0
- package/dist/apis/getMultiUsersByPhone.d.ts +5 -0
- package/dist/apis/getMultiUsersByPhone.js +38 -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/getSearchSticker.d.ts +3 -0
- package/dist/apis/getSearchSticker.js +28 -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 +43 -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 +70 -0
- package/dist/apis/loginQR.js +365 -0
- package/dist/apis/parseLink.d.ts +21 -0
- package/dist/apis/parseLink.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/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 +451 -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/setArchivedConversations.d.ts +10 -0
- package/dist/apis/setArchivedConversations.js +34 -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/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/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/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/updateStatus.d.ts +2 -0
- package/dist/apis/updateStatus.js +27 -0
- package/dist/apis/upgradeGroupCommunity.d.ts +2 -0
- package/dist/apis/upgradeGroupCommunity.js +27 -0
- package/dist/apis/uploadAttachment.d.ts +50 -0
- package/dist/apis/uploadAttachment.js +196 -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 +299 -0
- package/dist/apis.js +299 -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 +307 -0
- package/dist/cjs/apis/addUnreadMark.cjs +65 -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/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 +76 -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 +63 -0
- package/dist/cjs/apis/deleteGroupInviteBox.cjs +32 -0
- package/dist/cjs/apis/deleteMessage.cjs +65 -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 +74 -0
- package/dist/cjs/apis/enableGroupLink.cjs +30 -0
- package/dist/cjs/apis/fetchAccountInfo.cjs +15 -0
- package/dist/cjs/apis/findUser.cjs +46 -0
- package/dist/cjs/apis/findUserByUsername.cjs +31 -0
- package/dist/cjs/apis/forwardMessage.cjs +112 -0
- package/dist/cjs/apis/getAliasList.cjs +32 -0
- package/dist/cjs/apis/getAllFriends.cjs +38 -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 +34 -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 +50 -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/getListBoard.cjs +58 -0
- package/dist/cjs/apis/getListReminder.cjs +60 -0
- package/dist/cjs/apis/getMultiUsersByPhone.cjs +43 -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/getSearchSticker.cjs +33 -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 +48 -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 +439 -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/parseLink.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 +53 -0
- package/dist/cjs/apis/removeUnreadMark.cjs +63 -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/sendBankCard.cjs +50 -0
- package/dist/cjs/apis/sendCard.cjs +72 -0
- package/dist/cjs/apis/sendDeliveredEvent.cjs +68 -0
- package/dist/cjs/apis/sendFriendRequest.cjs +44 -0
- package/dist/cjs/apis/sendLink.cjs +74 -0
- package/dist/cjs/apis/sendMessage.cjs +464 -0
- package/dist/cjs/apis/sendReport.cjs +66 -0
- package/dist/cjs/apis/sendSeenEvent.cjs +76 -0
- package/dist/cjs/apis/sendSticker.cjs +70 -0
- package/dist/cjs/apis/sendTypingEvent.cjs +46 -0
- package/dist/cjs/apis/sendVideo.cjs +131 -0
- package/dist/cjs/apis/sendVoice.cjs +86 -0
- package/dist/cjs/apis/setArchivedConversations.cjs +39 -0
- package/dist/cjs/apis/setHiddenConversations.cjs +52 -0
- package/dist/cjs/apis/setMute.cjs +80 -0
- package/dist/cjs/apis/setPinnedConversations.cjs +47 -0
- package/dist/cjs/apis/sharePoll.cjs +33 -0
- package/dist/cjs/apis/unblockUser.cjs +33 -0
- package/dist/cjs/apis/undo.cjs +55 -0
- package/dist/cjs/apis/undoFriendRequest.cjs +32 -0
- package/dist/cjs/apis/updateActiveStatus.cjs +32 -0
- package/dist/cjs/apis/updateAutoDeleteChat.cjs +53 -0
- package/dist/cjs/apis/updateAutoReply.cjs +43 -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/updateQuickMessage.cjs +66 -0
- package/dist/cjs/apis/updateSettings.cjs +95 -0
- package/dist/cjs/apis/updateStatus.cjs +32 -0
- package/dist/cjs/apis/upgradeGroupCommunity.cjs +32 -0
- package/dist/cjs/apis/uploadAttachment.cjs +209 -0
- package/dist/cjs/apis/uploadProductPhoto.cjs +55 -0
- package/dist/cjs/apis/votePoll.cjs +34 -0
- package/dist/cjs/apis.cjs +304 -0
- package/dist/cjs/context.cjs +34 -0
- package/dist/cjs/index.cjs +149 -0
- package/dist/cjs/models/AutoReply.cjs +9 -0
- package/dist/cjs/models/Board.cjs +8 -0
- package/dist/cjs/models/DeliveredMessage.cjs +23 -0
- package/dist/cjs/models/Enum.cjs +253 -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 +680 -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 +156 -0
- package/dist/index.js +13 -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 +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 +247 -0
- package/dist/models/Enum.js +251 -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 +62 -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 +21 -0
- package/dist/models/index.js +21 -0
- package/dist/update.d.ts +2 -0
- package/dist/update.js +29 -0
- package/dist/utils.d.ts +166 -0
- package/dist/utils.js +697 -0
- package/dist/zalo.d.ts +41 -0
- package/dist/zalo.js +107 -0
- package/eslint.config.js +21 -0
- package/index.d.ts +2 -0
- package/package.json +78 -0
- package/rollup.config.js +28 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var loginQR = require('./apis/loginQR.cjs');
|
|
4
|
+
var login = require('./apis/login.cjs');
|
|
5
|
+
var context = require('./context.cjs');
|
|
6
|
+
var utils = require('./utils.cjs');
|
|
7
|
+
var toughCookie = require('tough-cookie');
|
|
8
|
+
var ZaloApiError = require('./Errors/ZaloApiError.cjs');
|
|
9
|
+
var update = require('./update.cjs');
|
|
10
|
+
var apis = require('./apis.cjs');
|
|
11
|
+
|
|
12
|
+
class Zalo {
|
|
13
|
+
constructor(options = {}) {
|
|
14
|
+
this.options = options;
|
|
15
|
+
this.enableEncryptParam = true;
|
|
16
|
+
}
|
|
17
|
+
parseCookies(cookie) {
|
|
18
|
+
const cookieArr = Array.isArray(cookie) ? cookie : cookie.cookies;
|
|
19
|
+
cookieArr.forEach((e, i) => {
|
|
20
|
+
if (typeof e.domain == "string" && e.domain.startsWith("."))
|
|
21
|
+
cookieArr[i].domain = e.domain.slice(1);
|
|
22
|
+
});
|
|
23
|
+
const jar = new toughCookie.CookieJar();
|
|
24
|
+
for (const each of cookieArr) {
|
|
25
|
+
try {
|
|
26
|
+
const cookieObj = toughCookie.Cookie.fromJSON(Object.assign(Object.assign({}, each), { key: each.key || each.name }));
|
|
27
|
+
if (cookieObj) {
|
|
28
|
+
const domain = cookieObj.domain || "chat.zalo.me";
|
|
29
|
+
const url = `https://${domain.startsWith(".") ? domain.slice(1) : domain}`;
|
|
30
|
+
jar.setCookieSync(cookieObj, url);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
utils.logger({
|
|
35
|
+
options: {
|
|
36
|
+
logging: this.options.logging,
|
|
37
|
+
},
|
|
38
|
+
}).error("Failed to set cookie:", error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return jar;
|
|
42
|
+
}
|
|
43
|
+
validateParams(credentials) {
|
|
44
|
+
if (!credentials.imei || !credentials.cookie || !credentials.userAgent) {
|
|
45
|
+
throw new ZaloApiError.ZaloApiError("Missing required params");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async login(credentials) {
|
|
49
|
+
const ctx = context.createContext(this.options.apiType, this.options.apiVersion);
|
|
50
|
+
Object.assign(ctx.options, this.options);
|
|
51
|
+
return this.loginCookie(ctx, credentials);
|
|
52
|
+
}
|
|
53
|
+
async loginCookie(ctx, credentials) {
|
|
54
|
+
await update.checkUpdate(ctx);
|
|
55
|
+
this.validateParams(credentials);
|
|
56
|
+
ctx.imei = credentials.imei;
|
|
57
|
+
ctx.cookie = this.parseCookies(credentials.cookie);
|
|
58
|
+
ctx.userAgent = credentials.userAgent;
|
|
59
|
+
ctx.language = credentials.language || "vi";
|
|
60
|
+
const loginData = await login.login(ctx, this.enableEncryptParam);
|
|
61
|
+
const serverInfo = await login.getServerInfo(ctx, this.enableEncryptParam);
|
|
62
|
+
const loginInfo = loginData === null || loginData === void 0 ? void 0 : loginData.data;
|
|
63
|
+
if (!loginData || !loginInfo || !serverInfo)
|
|
64
|
+
throw new ZaloApiError.ZaloApiError("Đăng nhập thất bại");
|
|
65
|
+
ctx.secretKey = loginInfo.zpw_enk;
|
|
66
|
+
ctx.uid = loginInfo.uid;
|
|
67
|
+
// Zalo currently responds with setttings instead of settings
|
|
68
|
+
// they might fix this in the future, so we should have a fallback just in case
|
|
69
|
+
ctx.settings = serverInfo.setttings || serverInfo.settings;
|
|
70
|
+
ctx.extraVer = serverInfo.extra_ver;
|
|
71
|
+
ctx.loginInfo = loginInfo;
|
|
72
|
+
if (!context.isContextSession(ctx))
|
|
73
|
+
throw new ZaloApiError.ZaloApiError("Khởi tạo ngữ cảnh thất bại.");
|
|
74
|
+
utils.logger(ctx).info("Logged in as", loginInfo.uid);
|
|
75
|
+
return new apis.API(ctx, loginInfo.zpw_service_map_v3, loginInfo.zpw_ws);
|
|
76
|
+
}
|
|
77
|
+
async loginQR(options, callback) {
|
|
78
|
+
if (!options)
|
|
79
|
+
options = {};
|
|
80
|
+
if (!options.userAgent)
|
|
81
|
+
options.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:133.0) Gecko/20100101 Firefox/133.0";
|
|
82
|
+
if (!options.language)
|
|
83
|
+
options.language = "vi";
|
|
84
|
+
const ctx = context.createContext(this.options.apiType, this.options.apiVersion);
|
|
85
|
+
Object.assign(ctx.options, this.options);
|
|
86
|
+
const loginQRResult = await loginQR.loginQR(ctx, options, callback);
|
|
87
|
+
if (!loginQRResult)
|
|
88
|
+
throw new ZaloApiError.ZaloApiError("Unable to login with QRCode");
|
|
89
|
+
const imei = utils.generateZaloUUID(options.userAgent);
|
|
90
|
+
if (callback) {
|
|
91
|
+
// Thanks to @YanCastle for this great suggestion!
|
|
92
|
+
callback({
|
|
93
|
+
type: loginQR.LoginQRCallbackEventType.GotLoginInfo,
|
|
94
|
+
data: {
|
|
95
|
+
cookie: loginQRResult.cookies,
|
|
96
|
+
imei,
|
|
97
|
+
userAgent: options.userAgent,
|
|
98
|
+
},
|
|
99
|
+
actions: null,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return this.loginCookie(ctx, {
|
|
103
|
+
cookie: loginQRResult.cookies,
|
|
104
|
+
imei,
|
|
105
|
+
userAgent: options.userAgent,
|
|
106
|
+
language: options.language,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
exports.API = apis.API;
|
|
112
|
+
exports.Zalo = Zalo;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type { Agent } from "http";
|
|
2
|
+
import type { CookieJar } from "tough-cookie";
|
|
3
|
+
type UploadEventData = {
|
|
4
|
+
fileUrl: string;
|
|
5
|
+
fileId: string;
|
|
6
|
+
};
|
|
7
|
+
export type UploadCallback = (data: UploadEventData) => unknown;
|
|
8
|
+
type ShareFileSettings = {
|
|
9
|
+
big_file_domain_list: string[];
|
|
10
|
+
max_size_share_file_v2: number;
|
|
11
|
+
max_size_share_file_v3: number;
|
|
12
|
+
file_upload_show_icon_1GB: boolean;
|
|
13
|
+
restricted_ext: string;
|
|
14
|
+
next_file_time: number;
|
|
15
|
+
max_file: number;
|
|
16
|
+
max_size_photo: number;
|
|
17
|
+
max_size_share_file: number;
|
|
18
|
+
max_size_resize_photo: number;
|
|
19
|
+
max_size_gif: number;
|
|
20
|
+
max_size_original_photo: number;
|
|
21
|
+
chunk_size_file: number;
|
|
22
|
+
restricted_ext_file: string[];
|
|
23
|
+
};
|
|
24
|
+
type SocketSettings = {
|
|
25
|
+
rotate_error_codes: number[];
|
|
26
|
+
retries: {
|
|
27
|
+
[key: string]: {
|
|
28
|
+
max?: number;
|
|
29
|
+
times: number[] | number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
debug: {
|
|
33
|
+
enable: boolean;
|
|
34
|
+
};
|
|
35
|
+
ping_interval: number;
|
|
36
|
+
reset_endpoint: number;
|
|
37
|
+
queue_ctrl_actionid_map: {
|
|
38
|
+
"611_0": string;
|
|
39
|
+
"610_1": string;
|
|
40
|
+
"610_0": string;
|
|
41
|
+
"603_0": string;
|
|
42
|
+
"611_1": string;
|
|
43
|
+
};
|
|
44
|
+
close_and_retry_codes: number[];
|
|
45
|
+
max_msg_size: number;
|
|
46
|
+
enable_ctrl_socket: boolean;
|
|
47
|
+
reconnect_after_fallback: boolean;
|
|
48
|
+
enable_chat_socket: boolean;
|
|
49
|
+
submit_wss_log: boolean;
|
|
50
|
+
disable_lp: boolean;
|
|
51
|
+
offline_monitor: {
|
|
52
|
+
enable: boolean;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
type LoginInfo = {
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
haspcclient: number;
|
|
58
|
+
public_ip: string;
|
|
59
|
+
language: string;
|
|
60
|
+
send2me_id: string;
|
|
61
|
+
zpw_service_map_v3: {
|
|
62
|
+
other_contact: string[];
|
|
63
|
+
chat_e2e: string[];
|
|
64
|
+
workspace: string[];
|
|
65
|
+
catalog: string[];
|
|
66
|
+
boards: string[];
|
|
67
|
+
downloadStickerUrl: string[];
|
|
68
|
+
sp_contact: string[];
|
|
69
|
+
zcloud_up_file: string[];
|
|
70
|
+
media_store_send2me: string[];
|
|
71
|
+
push_act: string[];
|
|
72
|
+
aext: string[];
|
|
73
|
+
zfamily: string[];
|
|
74
|
+
group_poll: string[];
|
|
75
|
+
group_cloud_message: string[];
|
|
76
|
+
media_store: string[];
|
|
77
|
+
file: string[];
|
|
78
|
+
auto_reply: string[];
|
|
79
|
+
sync_action: string[];
|
|
80
|
+
friendLan: string[];
|
|
81
|
+
friend: string[];
|
|
82
|
+
alias: string[];
|
|
83
|
+
zimsg: string[];
|
|
84
|
+
group_board: string[];
|
|
85
|
+
conversation: string[];
|
|
86
|
+
group: string[];
|
|
87
|
+
fallback_LP: string[];
|
|
88
|
+
friend_board: string[];
|
|
89
|
+
up_file: string[];
|
|
90
|
+
zavi: string[];
|
|
91
|
+
reaction: string[];
|
|
92
|
+
voice_call: string[];
|
|
93
|
+
profile: string[];
|
|
94
|
+
sticker: string[];
|
|
95
|
+
label: string[];
|
|
96
|
+
consent: string[];
|
|
97
|
+
zcloud: string[];
|
|
98
|
+
chat: string[];
|
|
99
|
+
todoUrl: string[];
|
|
100
|
+
recent_search: string[];
|
|
101
|
+
group_e2e: string[];
|
|
102
|
+
quick_message: string[];
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
type ExtraVer = {
|
|
106
|
+
phonebook: number;
|
|
107
|
+
conv_label: string;
|
|
108
|
+
friend: string;
|
|
109
|
+
ver_sticker_giphy_suggest: number;
|
|
110
|
+
ver_giphy_cate: number;
|
|
111
|
+
alias: string;
|
|
112
|
+
ver_sticker_cate_list: number;
|
|
113
|
+
block_friend: string;
|
|
114
|
+
};
|
|
115
|
+
export type ZPWServiceMap = LoginInfo["zpw_service_map_v3"];
|
|
116
|
+
export type AppContextBase = {
|
|
117
|
+
uid: string;
|
|
118
|
+
imei: string;
|
|
119
|
+
cookie: CookieJar;
|
|
120
|
+
userAgent: string;
|
|
121
|
+
language: string;
|
|
122
|
+
secretKey: string | null;
|
|
123
|
+
zpwServiceMap: ZPWServiceMap;
|
|
124
|
+
settings: {
|
|
125
|
+
[key: string]: any;
|
|
126
|
+
features: {
|
|
127
|
+
[key: string]: any;
|
|
128
|
+
sharefile: ShareFileSettings;
|
|
129
|
+
socket: SocketSettings;
|
|
130
|
+
};
|
|
131
|
+
keepalive: {
|
|
132
|
+
alway_keepalive: number;
|
|
133
|
+
keepalive_duration: number;
|
|
134
|
+
time_deactive: number;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
loginInfo: LoginInfo;
|
|
138
|
+
extraVer: ExtraVer;
|
|
139
|
+
};
|
|
140
|
+
export type ImageMetadataGetterResponse = {
|
|
141
|
+
width: number;
|
|
142
|
+
height: number;
|
|
143
|
+
size: number;
|
|
144
|
+
} | null;
|
|
145
|
+
export type ImageMetadataGetter = (filePath: string) => Promise<ImageMetadataGetterResponse>;
|
|
146
|
+
export type Options = {
|
|
147
|
+
selfListen: boolean;
|
|
148
|
+
checkUpdate: boolean;
|
|
149
|
+
logging: boolean;
|
|
150
|
+
apiType: number;
|
|
151
|
+
apiVersion: number;
|
|
152
|
+
agent?: Agent;
|
|
153
|
+
/**
|
|
154
|
+
* Optional fetch implementation for polyfills in non-standard environments.
|
|
155
|
+
* If using proxy, `node-fetch` is highly recommended.
|
|
156
|
+
*/
|
|
157
|
+
polyfill: typeof fetch;
|
|
158
|
+
imageMetadataGetter?: ImageMetadataGetter;
|
|
159
|
+
};
|
|
160
|
+
declare class CallbacksMap extends Map<string, UploadCallback> {
|
|
161
|
+
/**
|
|
162
|
+
* @param ttl Time to live in milliseconds. Default is 5 minutes.
|
|
163
|
+
*/
|
|
164
|
+
set(key: string, value: UploadCallback, ttl?: number): this;
|
|
165
|
+
}
|
|
166
|
+
export type AppContextExtended = {
|
|
167
|
+
uploadCallbacks: CallbacksMap;
|
|
168
|
+
options: Options;
|
|
169
|
+
readonly API_TYPE: number;
|
|
170
|
+
readonly API_VERSION: number;
|
|
171
|
+
};
|
|
172
|
+
export type ContextBase = Partial<AppContextBase> & AppContextExtended;
|
|
173
|
+
export declare const createContext: (apiType?: number, apiVersion?: number) => ContextBase;
|
|
174
|
+
export type ContextSession = AppContextBase & AppContextExtended & {
|
|
175
|
+
secretKey: string;
|
|
176
|
+
};
|
|
177
|
+
export declare function isContextSession(ctx: ContextBase): ctx is ContextSession;
|
|
178
|
+
export declare const MAX_MESSAGES_PER_SEND = 50;
|
|
179
|
+
export {};
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const _5_MINUTES = 5 * 60 * 1000;
|
|
2
|
+
class CallbacksMap extends Map {
|
|
3
|
+
/**
|
|
4
|
+
* @param ttl Time to live in milliseconds. Default is 5 minutes.
|
|
5
|
+
*/
|
|
6
|
+
set(key, value, ttl = _5_MINUTES) {
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
this.delete(key);
|
|
9
|
+
}, ttl);
|
|
10
|
+
return super.set(key, value);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export const createContext = (apiType = 30, apiVersion = 671) => ({
|
|
14
|
+
API_TYPE: apiType,
|
|
15
|
+
API_VERSION: apiVersion,
|
|
16
|
+
uploadCallbacks: new CallbacksMap(),
|
|
17
|
+
options: {
|
|
18
|
+
selfListen: false,
|
|
19
|
+
checkUpdate: true,
|
|
20
|
+
logging: true,
|
|
21
|
+
polyfill: global.fetch,
|
|
22
|
+
},
|
|
23
|
+
secretKey: null,
|
|
24
|
+
});
|
|
25
|
+
export function isContextSession(ctx) {
|
|
26
|
+
return !!ctx.secretKey;
|
|
27
|
+
}
|
|
28
|
+
export const MAX_MESSAGES_PER_SEND = 50;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export * from "./Errors/index.js";
|
|
2
|
+
export * from "./models/index.js";
|
|
3
|
+
export * from "./zalo.js";
|
|
4
|
+
export type { ContextSession, ContextBase, AppContextExtended, AppContextBase, Options, ZPWServiceMap, ImageMetadataGetter, ImageMetadataGetterResponse } from "./context.js";
|
|
5
|
+
export type { AcceptFriendRequestResponse } from "./apis/acceptFriendRequest.js";
|
|
6
|
+
export type { AddGroupBlockedMemberResponse } from "./apis/addGroupBlockedMember.js";
|
|
7
|
+
export type { AddGroupDeputyResponse } from "./apis/addGroupDeputy.js";
|
|
8
|
+
export type { AddPollOptionsPayload, AddPollOptionsResponse, AddPollOptionsOption } from "./apis/addPollOptions.js";
|
|
9
|
+
export type { AddQuickMessagePayload, AddQuickMessageResponse } from "./apis/addQuickMessage.js";
|
|
10
|
+
export type { AddReactionDestination, AddReactionResponse, CustomReaction } from "./apis/addReaction.js";
|
|
11
|
+
export type { AddUnreadMarkResponse } from "./apis/addUnreadMark.js";
|
|
12
|
+
export type { AddUserToGroupResponse } from "./apis/addUserToGroup.js";
|
|
13
|
+
export type { BlockUserResponse } from "./apis/blockUser.js";
|
|
14
|
+
export type { BlockViewFeedResponse } from "./apis/blockViewFeed.js";
|
|
15
|
+
export type { ChangeAccountAvatarResponse } from "./apis/changeAccountAvatar.js";
|
|
16
|
+
export type { ChangeFriendAliasResponse } from "./apis/changeFriendAlias.js";
|
|
17
|
+
export type { ChangeGroupAvatarResponse } from "./apis/changeGroupAvatar.js";
|
|
18
|
+
export type { ChangeGroupNameResponse } from "./apis/changeGroupName.js";
|
|
19
|
+
export type { ChangeGroupOwnerResponse } from "./apis/changeGroupOwner.js";
|
|
20
|
+
export type { CreateAutoReplyPayload, CreateAutoReplyResponse } from "./apis/createAutoReply.js";
|
|
21
|
+
export type { CreateCatalogResponse } from "./apis/createCatalog.js";
|
|
22
|
+
export type { CreateGroupOptions, CreateGroupResponse } from "./apis/createGroup.js";
|
|
23
|
+
export type { CreateNoteOptions, CreateNoteResponse } from "./apis/createNote.js";
|
|
24
|
+
export type { CreatePollOptions, CreatePollResponse } from "./apis/createPoll.js";
|
|
25
|
+
export type { CreateProductCatalogPayload, CreateProductCatalogResponse } from "./apis/createProductCatalog.js";
|
|
26
|
+
export type { CreateReminderOptions, CreateReminderResponse, CreateReminderUser, CreateReminderGroup } from "./apis/createReminder.js";
|
|
27
|
+
export type { DeleteAutoReplyResponse } from "./apis/deleteAutoReply.js";
|
|
28
|
+
export type { DeleteAvatarResponse } from "./apis/deleteAvatar.js";
|
|
29
|
+
export type { DeleteCatalogResponse } from "./apis/deleteCatalog.js";
|
|
30
|
+
export type { DeleteChatLastMessage, DeleteChatResponse } from "./apis/deleteChat.js";
|
|
31
|
+
export type { DeleteGroupInviteBoxResponse } from "./apis/deleteGroupInviteBox.js";
|
|
32
|
+
export type { DeleteMessageDestination, DeleteMessageResponse } from "./apis/deleteMessage.js";
|
|
33
|
+
export type { DeleteProductCatalogPayload, DeleteProductCatalogResponse } from "./apis/deleteProductCatalog.js";
|
|
34
|
+
export type { DisableGroupLinkResponse } from "./apis/disableGroupLink.js";
|
|
35
|
+
export type { DisperseGroupResponse } from "./apis/disperseGroup.js";
|
|
36
|
+
export type { EditNoteOptions, EditNoteResponse } from "./apis/editNote.js";
|
|
37
|
+
export type { EditReminderGroup, EditReminderUser, EditReminderOptions, EditReminderResponse } from "./apis/editReminder.js";
|
|
38
|
+
export type { EnableGroupLinkResponse } from "./apis/enableGroupLink.js";
|
|
39
|
+
export type { FetchAccountInfoResponse } from "./apis/fetchAccountInfo.js";
|
|
40
|
+
export type { FindUserResponse } from "./apis/findUser.js";
|
|
41
|
+
export type { FindUserByUsernameResponse } from "./apis/findUserByUsername.js";
|
|
42
|
+
export type { ForwardMessageSuccess, ForwardMessageFail, ForwardMessagePayload, ForwardMessageResponse } from "./apis/forwardMessage.js";
|
|
43
|
+
export type { GetAliasListResponse } from "./apis/getAliasList.js";
|
|
44
|
+
export type { GetAllFriendsResponse } from "./apis/getAllFriends.js";
|
|
45
|
+
export type { GetAllGroupsResponse } from "./apis/getAllGroups.js";
|
|
46
|
+
export type { GetArchivedChatListResponse } from "./apis/getArchivedChatList.js";
|
|
47
|
+
export type { GetAutoDeleteChatResponse } from "./apis/getAutoDeleteChat.js";
|
|
48
|
+
export type { GetAutoReplyListResponse } from "./apis/getAutoReplyList.js";
|
|
49
|
+
export type { GetAvatarListResponse } from "./apis/getAvatarList.js";
|
|
50
|
+
export type { GetAvatarUrlProfileResponse } from "./apis/getAvatarUrlProfile.js";
|
|
51
|
+
export type { GetBizAccountResponse } from "./apis/getBizAccount.js";
|
|
52
|
+
export type { GetCatalogListPayload, GetCatalogListResponse } from "./apis/getCatalogList.js";
|
|
53
|
+
export type { GetCloseFriendsResponse } from "./apis/getCloseFriends.js";
|
|
54
|
+
export type { GetFriendBoardListResponse } from "./apis/getFriendBoardList.js";
|
|
55
|
+
export type { GetFriendOnlinesResponse, GetFriendOnlinesStatus } from "./apis/getFriendOnlines.js";
|
|
56
|
+
export type { GetFriendRecommendationsResponse, FriendRecommendationsCollapseMsgListConfig, FriendRecommendationsDataInfo, FriendRecommendationsRecommItem, FriendRecommendationsType } from "./apis/getFriendRecommendations.js";
|
|
57
|
+
export type { GetFriendRequestStatusResponse } from "./apis/getFriendRequestStatus.js";
|
|
58
|
+
export type { GetFullAvatarResponse } from "./apis/getFullAvatar.js";
|
|
59
|
+
export type { GetGroupBlockedMemberPayload, GetGroupBlockedMemberResponse } from "./apis/getGroupBlockedMember.js";
|
|
60
|
+
export type { GetGroupChatHistoryResponse } from "./apis/getGroupChatHistory.js";
|
|
61
|
+
export type { GroupInfoPendingApprove, GroupInfoResponse } from "./apis/getGroupInfo.js";
|
|
62
|
+
export type { GetGroupInviteBoxInfoPayload, GetGroupInviteBoxInfoResponse } from "./apis/getGroupInviteBoxInfo.js";
|
|
63
|
+
export type { GetGroupInviteBoxListPayload, GetGroupInviteBoxListResponse } from "./apis/getGroupInviteBoxList.js";
|
|
64
|
+
export type { GetGroupLinkDetailResponse } from "./apis/getGroupLinkDetail.js";
|
|
65
|
+
export type { GetGroupLinkInfoPayload, GetGroupLinkInfoResponse } from "./apis/getGroupLinkInfo.js";
|
|
66
|
+
export type { GetGroupMembersInfoResponse, GroupMemberProfile } from "./apis/getGroupMembersInfo.js";
|
|
67
|
+
export type { GetHiddenConversationsResponse } from "./apis/getHiddenConversations.js";
|
|
68
|
+
export type { GetLabelsResponse } from "./apis/getLabels.js";
|
|
69
|
+
export type { BoardItem, GetListBoardResponse, ListBoardOptions } from "./apis/getListBoard.js";
|
|
70
|
+
export type { GetListReminderResponse, ListReminderOptions, ReminderListGroup, ReminderListUser } from "./apis/getListReminder.js";
|
|
71
|
+
export type { GetMultiUsersByPhoneResponse } from "./apis/getMultiUsersByPhone.js";
|
|
72
|
+
export type { GetMuteResponse, MuteEntriesInfo } from "./apis/getMute.js";
|
|
73
|
+
export type { GetPendingGroupMembersResponse, GetPendingGroupMembersUserInfo } from "./apis/getPendingGroupMembers.js";
|
|
74
|
+
export type { GetPinConversationsResponse } from "./apis/getPinConversations.js";
|
|
75
|
+
export type { PollDetailResponse } from "./apis/getPollDetail.js";
|
|
76
|
+
export type { GetProductCatalogListPayload, GetProductCatalogListResponse } from "./apis/getProductCatalogList.js";
|
|
77
|
+
export type { GetQRResponse } from "./apis/getQR.js";
|
|
78
|
+
export type { GetQuickMessageListResponse } from "./apis/getQuickMessageList.js";
|
|
79
|
+
export type { GetRelatedFriendGroupResponse } from "./apis/getRelatedFriendGroup.js";
|
|
80
|
+
export type { GetReminderResponse } from "./apis/getReminder.js";
|
|
81
|
+
export type { GetReminderResponsesResponse } from "./apis/getReminderResponses.js";
|
|
82
|
+
export type { GetSearchStickerResponse } from "./apis/getSearchSticker.js";
|
|
83
|
+
export type { GetSentFriendRequestResponse, SentFriendRequestInfo } from "./apis/getSentFriendRequest.js";
|
|
84
|
+
export type { GetSettingsResponse } from "./apis/getSettings.js";
|
|
85
|
+
export type { GetStickerCategoryDetailResponse } from "./apis/getStickerCategoryDetail.js";
|
|
86
|
+
export type { StickerDetailResponse } from "./apis/getStickersDetail.js";
|
|
87
|
+
export type { GetUnreadMarkResponse, UnreadMark } from "./apis/getUnreadMark.js";
|
|
88
|
+
export type { ProfileInfo, UserInfoResponse } from "./apis/getUserInfo.js";
|
|
89
|
+
export type { InviteUserToGroupsResponse } from "./apis/inviteUserToGroups.js";
|
|
90
|
+
export type { JoinGroupInviteBoxResponse } from "./apis/joinGroupInviteBox.js";
|
|
91
|
+
export type { JoinGroupLinkResponse } from "./apis/joinGroupLink.js";
|
|
92
|
+
export type { KeepAliveResponse } from "./apis/keepAlive.js";
|
|
93
|
+
export type { LastOnlineResponse } from "./apis/lastOnline.js";
|
|
94
|
+
export type { LeaveGroupResponse } from "./apis/leaveGroup.js";
|
|
95
|
+
export type { LockPollResponse } from "./apis/lockPoll.js";
|
|
96
|
+
export type { LoginQRCallback, LoginQRCallbackEvent } from "./apis/loginQR.js";
|
|
97
|
+
export type { ParseLinkErrorMaps, ParseLinkResponse } from "./apis/parseLink.js";
|
|
98
|
+
export type { RejectFriendRequestResponse } from "./apis/rejectFriendRequest.js";
|
|
99
|
+
export type { RemoveFriendResponse } from "./apis/removeFriend.js";
|
|
100
|
+
export type { RemoveFriendAliasResponse } from "./apis/removeFriendAlias.js";
|
|
101
|
+
export type { RemoveGroupBlockedMemberResponse } from "./apis/removeGroupBlockedMember.js";
|
|
102
|
+
export type { RemoveGroupDeputyResponse } from "./apis/removeGroupDeputy.js";
|
|
103
|
+
export type { RemoveQuickMessageResponse } from "./apis/removeQuickMessage.js";
|
|
104
|
+
export type { RemoveReminderResponse } from "./apis/removeReminder.js";
|
|
105
|
+
export type { RemoveUnreadMarkResponse } from "./apis/removeUnreadMark.js";
|
|
106
|
+
export type { RemoveUserFromGroupResponse } from "./apis/removeUserFromGroup.js";
|
|
107
|
+
export type { ResetHiddenConversPinResponse } from "./apis/resetHiddenConversPin.js";
|
|
108
|
+
export type { ReuseAvatarResponse } from "./apis/reuseAvatar.js";
|
|
109
|
+
export type { ReviewPendingMemberRequestPayload, ReviewPendingMemberRequestResponse } from "./apis/reviewPendingMemberRequest.js";
|
|
110
|
+
export type { SendBankCardPayload, SendBankCardResponse } from "./apis/sendBankCard.js";
|
|
111
|
+
export type { SendCardOptions, SendCardResponse } from "./apis/sendCard.js";
|
|
112
|
+
export type { SendDeliveredEventMessageParams, SendDeliveredEventResponse } from "./apis/sendDeliveredEvent.js";
|
|
113
|
+
export type { SendFriendRequestResponse } from "./apis/sendFriendRequest.js";
|
|
114
|
+
export type { SendLinkOptions, SendLinkResponse } from "./apis/sendLink.js";
|
|
115
|
+
export type { Mention, MessageContent, SendMessageQuote, SendMessageResponse, SendMessageResult, Style } from "./apis/sendMessage.js";
|
|
116
|
+
export type { SendReportOptions, SendReportResponse } from "./apis/sendReport.js";
|
|
117
|
+
export type { SendSeenEventMessageParams, SendSeenEventResponse } from "./apis/sendSeenEvent.js";
|
|
118
|
+
export type { SendStickerResponse, SendStickerPayload } from "./apis/sendSticker.js";
|
|
119
|
+
export type { SendTypingEventResponse } from "./apis/sendTypingEvent.js";
|
|
120
|
+
export type { SendVideoOptions, SendVideoResponse } from "./apis/sendVideo.js";
|
|
121
|
+
export type { SendVoiceOptions, SendVoiceResponse } from "./apis/sendVoice.js";
|
|
122
|
+
export type { SetArchivedConversationsTarget, SetArchivedConversationsResponse } from "./apis/setArchivedConversations.js";
|
|
123
|
+
export type { SetHiddenConversationsResponse } from "./apis/setHiddenConversations.js";
|
|
124
|
+
export type { SetMuteParams, SetMuteResponse } from "./apis/setMute.js";
|
|
125
|
+
export type { SetPinnedConversationsResponse } from "./apis/setPinnedConversations.js";
|
|
126
|
+
export type { SharePollResponse } from "./apis/sharePoll.js";
|
|
127
|
+
export type { UnBlockUserResponse } from "./apis/unblockUser.js";
|
|
128
|
+
export type { UndoPayload, UndoResponse } from "./apis/undo.js";
|
|
129
|
+
export type { UndoFriendRequestResponse } from "./apis/undoFriendRequest.js";
|
|
130
|
+
export type { UpdateActiveStatusResponse } from "./apis/updateActiveStatus.js";
|
|
131
|
+
export type { UpdateAutoDeleteChatResponse } from "./apis/updateAutoDeleteChat.js";
|
|
132
|
+
export type { UpdateAutoReplyPayload, UpdateAutoReplyResponse } from "./apis/updateAutoReply.js";
|
|
133
|
+
export type { UpdateCatalogPayload, UpdateCatalogResponse } from "./apis/updateCatalog.js";
|
|
134
|
+
export type { UpdateGroupSettingsOptions, UpdateGroupSettingsResponse } from "./apis/updateGroupSettings.js";
|
|
135
|
+
export type { UpdateHiddenConversPinResponse } from "./apis/updateHiddenConversPin.js";
|
|
136
|
+
export type { UpdateLabelsPayload, UpdateLabelsResponse } from "./apis/updateLabels.js";
|
|
137
|
+
export type { UpdateLangResponse } from "./apis/updateLang.js";
|
|
138
|
+
export type { UpdateProductCatalogPayload, UpdateProductCatalogResponse } from "./apis/updateProductCatalog.js";
|
|
139
|
+
export type { UpdateProfilePayload, UpdateProfileResponse } from "./apis/updateProfile.js";
|
|
140
|
+
export type { UpdateQuickMessagePayload, UpdateQuickMessageResponse } from "./apis/updateQuickMessage.js";
|
|
141
|
+
export type { UpdateSettingsResponse } from "./apis/updateSettings.js";
|
|
142
|
+
export type { UpdateStatusResponse } from "./apis/updateStatus.js";
|
|
143
|
+
export type { UpgradeGroupCommunityResponse } from "./apis/upgradeGroupCommunity.js";
|
|
144
|
+
export type { FileData, ImageData, UploadAttachmentResponse, UploadAttachmentType, UploadAttachmentImageResponse, UploadAttachmentVideoResponse, UploadAttachmentFileResponse } from "./apis/uploadAttachment.js";
|
|
145
|
+
export type { UploadProductPhotoPayload, UploadProductPhotoResponse } from "./apis/uploadProductPhoto.js";
|
|
146
|
+
export type { VotePollResponse } from "./apis/votePoll.js";
|
|
147
|
+
export type { CustomAPICallback, CustomAPIProps } from "./apis/custom.js";
|
|
148
|
+
export { CloseReason } from "./apis/listen.js";
|
|
149
|
+
export { LoginQRCallbackEventType } from "./apis/loginQR.js";
|
|
150
|
+
export { ReviewPendingMemberRequestStatus } from "./apis/reviewPendingMemberRequest.js";
|
|
151
|
+
export { TextStyle, Urgency } from "./apis/sendMessage.js";
|
|
152
|
+
export { ReportReason } from "./apis/sendReport.js";
|
|
153
|
+
export { MuteAction, MuteDuration } from "./apis/setMute.js";
|
|
154
|
+
export { ChatTTL } from "./apis/updateAutoDeleteChat.js";
|
|
155
|
+
export { UpdateLangAvailableLanguages } from "./apis/updateLang.js";
|
|
156
|
+
export { UpdateSettingsType } from "./apis/updateSettings.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./Errors/index.js";
|
|
2
|
+
export * from "./models/index.js";
|
|
3
|
+
export * from "./zalo.js";
|
|
4
|
+
// Others (Enum)
|
|
5
|
+
export { CloseReason } from "./apis/listen.js";
|
|
6
|
+
export { LoginQRCallbackEventType } from "./apis/loginQR.js";
|
|
7
|
+
export { ReviewPendingMemberRequestStatus } from "./apis/reviewPendingMemberRequest.js";
|
|
8
|
+
export { TextStyle, Urgency } from "./apis/sendMessage.js";
|
|
9
|
+
export { ReportReason } from "./apis/sendReport.js";
|
|
10
|
+
export { MuteAction, MuteDuration } from "./apis/setMute.js";
|
|
11
|
+
export { ChatTTL } from "./apis/updateAutoDeleteChat.js";
|
|
12
|
+
export { UpdateLangAvailableLanguages } from "./apis/updateLang.js";
|
|
13
|
+
export { UpdateSettingsType } from "./apis/updateSettings.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type AutoReplyItem = {
|
|
2
|
+
id: number;
|
|
3
|
+
weight: number;
|
|
4
|
+
enable: boolean;
|
|
5
|
+
modifiedTime: number;
|
|
6
|
+
startTime: number;
|
|
7
|
+
endTime: number;
|
|
8
|
+
content: string;
|
|
9
|
+
scope: AutoReplyScope;
|
|
10
|
+
uids: string[] | null;
|
|
11
|
+
ownerId: number;
|
|
12
|
+
recurrence: string[];
|
|
13
|
+
createdTime: number;
|
|
14
|
+
};
|
|
15
|
+
export declare enum AutoReplyScope {
|
|
16
|
+
Everyone = 0,
|
|
17
|
+
Stranger = 1,
|
|
18
|
+
SpecificFriends = 2,
|
|
19
|
+
FriendsExcept = 3
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var AutoReplyScope;
|
|
2
|
+
(function (AutoReplyScope) {
|
|
3
|
+
AutoReplyScope[AutoReplyScope["Everyone"] = 0] = "Everyone";
|
|
4
|
+
AutoReplyScope[AutoReplyScope["Stranger"] = 1] = "Stranger";
|
|
5
|
+
AutoReplyScope[AutoReplyScope["SpecificFriends"] = 2] = "SpecificFriends";
|
|
6
|
+
AutoReplyScope[AutoReplyScope["FriendsExcept"] = 3] = "FriendsExcept";
|
|
7
|
+
})(AutoReplyScope || (AutoReplyScope = {}));
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export declare enum BoardType {
|
|
2
|
+
Note = 1,
|
|
3
|
+
PinnedMessage = 2,
|
|
4
|
+
Poll = 3
|
|
5
|
+
}
|
|
6
|
+
export type PollDetail = {
|
|
7
|
+
creator: string;
|
|
8
|
+
question: string;
|
|
9
|
+
options: PollOptions[];
|
|
10
|
+
joined: boolean;
|
|
11
|
+
closed: boolean;
|
|
12
|
+
poll_id: number;
|
|
13
|
+
allow_multi_choices: boolean;
|
|
14
|
+
allow_add_new_option: boolean;
|
|
15
|
+
is_anonymous: boolean;
|
|
16
|
+
poll_type: number;
|
|
17
|
+
created_time: number;
|
|
18
|
+
updated_time: number;
|
|
19
|
+
expired_time: number;
|
|
20
|
+
is_hide_vote_preview: boolean;
|
|
21
|
+
num_vote: number;
|
|
22
|
+
};
|
|
23
|
+
export type PollOptions = {
|
|
24
|
+
content: string;
|
|
25
|
+
votes: number;
|
|
26
|
+
voted: boolean;
|
|
27
|
+
voters: string[];
|
|
28
|
+
option_id: number;
|
|
29
|
+
};
|
|
30
|
+
export type NoteDetail = {
|
|
31
|
+
id: string;
|
|
32
|
+
type: number;
|
|
33
|
+
color: number;
|
|
34
|
+
emoji: string;
|
|
35
|
+
startTime: number;
|
|
36
|
+
duration: number;
|
|
37
|
+
params: {
|
|
38
|
+
title: string;
|
|
39
|
+
extra?: string;
|
|
40
|
+
};
|
|
41
|
+
creatorId: string;
|
|
42
|
+
editorId: string;
|
|
43
|
+
createTime: number;
|
|
44
|
+
editTime: number;
|
|
45
|
+
repeat: number;
|
|
46
|
+
};
|
|
47
|
+
export type PinnedMessageDetail = {
|
|
48
|
+
id: string;
|
|
49
|
+
type: number;
|
|
50
|
+
color: number;
|
|
51
|
+
emoji: string;
|
|
52
|
+
startTime: number;
|
|
53
|
+
duration: number;
|
|
54
|
+
params: Record<string, unknown>;
|
|
55
|
+
creatorId: string;
|
|
56
|
+
editorId: string;
|
|
57
|
+
createTime: number;
|
|
58
|
+
editTime: number;
|
|
59
|
+
repeat: number;
|
|
60
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type CatalogItem = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
version: number;
|
|
5
|
+
ownerId: string;
|
|
6
|
+
isDefault: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Relative path used to build the catalog URL.
|
|
9
|
+
*
|
|
10
|
+
* Example: `https://catalog.zalo.me/${path}`
|
|
11
|
+
*/
|
|
12
|
+
path: string;
|
|
13
|
+
catalogPhoto: string | null;
|
|
14
|
+
totalProduct: number;
|
|
15
|
+
created_time: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ThreadType } from "./Enum.js";
|
|
2
|
+
export type TDeliveredMessage = {
|
|
3
|
+
msgId: string;
|
|
4
|
+
seen: number;
|
|
5
|
+
deliveredUids: string[];
|
|
6
|
+
seenUids: string[];
|
|
7
|
+
realMsgId: string;
|
|
8
|
+
mSTs: number;
|
|
9
|
+
};
|
|
10
|
+
export type TGroupDeliveredMessage = TDeliveredMessage & {
|
|
11
|
+
groupId: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class UserDeliveredMessage {
|
|
14
|
+
type: ThreadType.User;
|
|
15
|
+
data: TDeliveredMessage;
|
|
16
|
+
threadId: string;
|
|
17
|
+
isSelf: false;
|
|
18
|
+
constructor(data: TDeliveredMessage);
|
|
19
|
+
}
|
|
20
|
+
export declare class GroupDeliveredMessage {
|
|
21
|
+
type: ThreadType.Group;
|
|
22
|
+
data: TGroupDeliveredMessage;
|
|
23
|
+
threadId: string;
|
|
24
|
+
isSelf: boolean;
|
|
25
|
+
constructor(uid: string, data: TGroupDeliveredMessage);
|
|
26
|
+
}
|
|
27
|
+
export type DeliveredMessage = UserDeliveredMessage | GroupDeliveredMessage;
|