@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
package/.prettierrc
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
+
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity
|
|
10
|
+
and orientation.
|
|
11
|
+
|
|
12
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
|
13
|
+
diverse, inclusive, and healthy community.
|
|
14
|
+
|
|
15
|
+
## Our Standards
|
|
16
|
+
|
|
17
|
+
Examples of behavior that contributes to a positive environment for our
|
|
18
|
+
community include:
|
|
19
|
+
|
|
20
|
+
* Demonstrating empathy and kindness toward other people
|
|
21
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
* Giving and gracefully accepting constructive feedback
|
|
23
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
|
+
and learning from the experience
|
|
25
|
+
* Focusing on what is best not just for us as individuals, but for the
|
|
26
|
+
overall community
|
|
27
|
+
|
|
28
|
+
Examples of unacceptable behavior include:
|
|
29
|
+
|
|
30
|
+
* The use of sexualized language or imagery, and sexual attention or
|
|
31
|
+
advances of any kind
|
|
32
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
* Public or private harassment
|
|
34
|
+
* Publishing others' private information, such as a physical or email
|
|
35
|
+
address, without their explicit permission
|
|
36
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
|
37
|
+
professional setting
|
|
38
|
+
|
|
39
|
+
## Enforcement Responsibilities
|
|
40
|
+
|
|
41
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
|
42
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
|
43
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
44
|
+
or harmful.
|
|
45
|
+
|
|
46
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
|
47
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
|
48
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
|
49
|
+
decisions when appropriate.
|
|
50
|
+
|
|
51
|
+
## Scope
|
|
52
|
+
|
|
53
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
|
54
|
+
an individual is officially representing the community in public spaces.
|
|
55
|
+
Examples of representing our community include using an official e-mail address,
|
|
56
|
+
posting via an official social media account, or acting as an appointed
|
|
57
|
+
representative at an online or offline event.
|
|
58
|
+
|
|
59
|
+
## Enforcement
|
|
60
|
+
|
|
61
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
62
|
+
reported to the community leaders responsible for enforcement through:
|
|
63
|
+
- **GitHub Issues**: Create a private issue with the `[CONDUCT]` label
|
|
64
|
+
- **GitHub Discussions**: Use the "Community" category for general concerns
|
|
65
|
+
- **Direct Contact**: Reach out to any team member through GitHub
|
|
66
|
+
- **Team Members**:
|
|
67
|
+
- [@RFS-ADRENO](https://github.com/RFS-ADRENO)
|
|
68
|
+
- [@truong9c2208](https://github.com/truong9c2208)
|
|
69
|
+
- [@JustKemForFun](https://github.com/JustKemForFun)
|
|
70
|
+
|
|
71
|
+
All complaints will be reviewed and investigated promptly and fairly by the team.
|
|
72
|
+
|
|
73
|
+
All community leaders are obligated to respect the privacy and security of the
|
|
74
|
+
reporter of any incident.
|
|
75
|
+
|
|
76
|
+
## Enforcement Guidelines
|
|
77
|
+
|
|
78
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
|
79
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
|
80
|
+
|
|
81
|
+
### 1. Correction
|
|
82
|
+
|
|
83
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
|
84
|
+
unprofessional or unwelcome in the community.
|
|
85
|
+
|
|
86
|
+
**Consequence**: A private, written warning from community leaders, providing
|
|
87
|
+
clarity around the nature of the violation and an explanation of why the
|
|
88
|
+
behavior was inappropriate. A public apology may be requested.
|
|
89
|
+
|
|
90
|
+
### 2. Warning
|
|
91
|
+
|
|
92
|
+
**Community Impact**: A violation through a single incident or series
|
|
93
|
+
of actions.
|
|
94
|
+
|
|
95
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
|
96
|
+
interaction with the people involved, including unsolicited interaction with
|
|
97
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
|
98
|
+
includes avoiding interactions in community spaces as well as external channels
|
|
99
|
+
like social media. Violating these terms may lead to a temporary or
|
|
100
|
+
permanent ban.
|
|
101
|
+
|
|
102
|
+
### 3. Temporary Ban
|
|
103
|
+
|
|
104
|
+
**Community Impact**: A serious violation of community standards, including
|
|
105
|
+
sustained inappropriate behavior.
|
|
106
|
+
|
|
107
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
|
108
|
+
communication with the community for a specified period of time. No public or
|
|
109
|
+
private interaction with the people involved, including unsolicited interaction
|
|
110
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
|
111
|
+
Violating these terms may lead to a permanent ban.
|
|
112
|
+
|
|
113
|
+
### 4. Permanent Ban
|
|
114
|
+
|
|
115
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
|
116
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
117
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
|
118
|
+
|
|
119
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
|
120
|
+
the community.
|
|
121
|
+
|
|
122
|
+
## Attribution
|
|
123
|
+
|
|
124
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
125
|
+
version 2.0, available at
|
|
126
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
127
|
+
|
|
128
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
|
129
|
+
enforcement ladder](https://github.com/mozilla/diversity).
|
|
130
|
+
|
|
131
|
+
[homepage]: https://www.contributor-covenant.org
|
|
132
|
+
|
|
133
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
|
134
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
|
135
|
+
https://www.contributor-covenant.org/translations.
|
|
136
|
+
|
|
137
|
+
## Special Considerations for zca-js
|
|
138
|
+
|
|
139
|
+
Given that zca-js is an unofficial API library for Zalo, we have additional
|
|
140
|
+
guidelines specific to our project:
|
|
141
|
+
|
|
142
|
+
### Responsible Usage
|
|
143
|
+
|
|
144
|
+
* **Respect Zalo's Terms of Service**: While this is an unofficial library,
|
|
145
|
+
users should be aware of and respect Zalo's terms of service
|
|
146
|
+
* **Account Safety**: Do not encourage or provide guidance on circumventing
|
|
147
|
+
Zalo's security measures
|
|
148
|
+
* **Privacy**: Respect user privacy and do not share personal information
|
|
149
|
+
obtained through the API
|
|
150
|
+
* **Rate Limiting**: Encourage responsible usage that doesn't overload Zalo's
|
|
151
|
+
servers
|
|
152
|
+
|
|
153
|
+
### Technical Discussions
|
|
154
|
+
|
|
155
|
+
* **Security**: When discussing security-related topics, use appropriate
|
|
156
|
+
channels and follow responsible disclosure practices
|
|
157
|
+
* **Bugs and Issues**: Report bugs and issues through proper channels
|
|
158
|
+
* **Documentation**: Help improve documentation and examples for the community
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
**Note**: This Code of Conduct is a living document and may be updated as our
|
|
163
|
+
community grows and evolves.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
# Contributing to zca-js
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to zca-js! This project is maintained by the community and we welcome all contributions.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Code of Conduct](#code-of-conduct)
|
|
8
|
+
- [Getting Started](#getting-started)
|
|
9
|
+
- [Development Setup](#development-setup)
|
|
10
|
+
- [How to Contribute](#how-to-contribute)
|
|
11
|
+
- [Pull Request Process](#pull-request-process)
|
|
12
|
+
- [Code Style Guidelines](#code-style-guidelines)
|
|
13
|
+
- [Testing Guidelines](#testing-guidelines)
|
|
14
|
+
- [Documentation Guidelines](#documentation-guidelines)
|
|
15
|
+
- [Security Guidelines](#security-guidelines)
|
|
16
|
+
- [Release Process](#release-process)
|
|
17
|
+
- [Getting Help](#getting-help)
|
|
18
|
+
|
|
19
|
+
## Code of Conduct
|
|
20
|
+
|
|
21
|
+
This project adheres to our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to abide by these rules.
|
|
22
|
+
|
|
23
|
+
## Getting Started
|
|
24
|
+
|
|
25
|
+
### Prerequisites
|
|
26
|
+
|
|
27
|
+
- Node.js >= 18.0.0
|
|
28
|
+
- Bun (recommended) or npm
|
|
29
|
+
- Git
|
|
30
|
+
|
|
31
|
+
### Fork and Clone
|
|
32
|
+
|
|
33
|
+
1. Fork this repository
|
|
34
|
+
2. Clone your fork:
|
|
35
|
+
```bash
|
|
36
|
+
git clone https://github.com/YOUR_USERNAME/zca-js.git
|
|
37
|
+
cd zca-js
|
|
38
|
+
```
|
|
39
|
+
3. Add upstream remote:
|
|
40
|
+
```bash
|
|
41
|
+
git remote add upstream https://github.com/RFS-ADRENO/zca-js.git
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Development Setup
|
|
45
|
+
|
|
46
|
+
### Install Dependencies
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Using Bun (recommended)
|
|
50
|
+
bun install
|
|
51
|
+
|
|
52
|
+
# Or using npm
|
|
53
|
+
npm install
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Build Project
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Build both ESM and CJS
|
|
60
|
+
bun run build
|
|
61
|
+
|
|
62
|
+
# Build ESM only
|
|
63
|
+
bun run build:esm
|
|
64
|
+
|
|
65
|
+
# Build CJS only
|
|
66
|
+
bun run build:cjs
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Run Tests
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Run feature tests
|
|
73
|
+
bun run test:feat
|
|
74
|
+
|
|
75
|
+
# Run specific test file
|
|
76
|
+
bun run test/test.ts
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Code Formatting
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Format code with Prettier
|
|
83
|
+
bun run prettier
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## How to Contribute
|
|
87
|
+
|
|
88
|
+
### Types of Contributions
|
|
89
|
+
|
|
90
|
+
We welcome the following types of contributions:
|
|
91
|
+
|
|
92
|
+
- 🐛 **Bug Reports**: Report bugs and issues
|
|
93
|
+
- ✨ **Feature Requests**: Suggest new features
|
|
94
|
+
- 🔧 **Code Contributions**: Fix bugs and add features
|
|
95
|
+
- 📚 **Documentation**: Improve docs and examples
|
|
96
|
+
- 🧪 **Tests**: Add or improve tests
|
|
97
|
+
- 🔒 **Security**: Report security vulnerabilities
|
|
98
|
+
- 🌐 **Translations**: Translate docs to other languages
|
|
99
|
+
|
|
100
|
+
### Before You Start
|
|
101
|
+
|
|
102
|
+
1. **Check existing issues**: Search for existing issues before creating new ones
|
|
103
|
+
2. **Discuss major changes**: Create an issue to discuss major changes
|
|
104
|
+
3. **Follow the roadmap**: Check the current roadmap and priorities
|
|
105
|
+
|
|
106
|
+
## Pull Request Process
|
|
107
|
+
|
|
108
|
+
### Creating a Pull Request
|
|
109
|
+
|
|
110
|
+
1. **Create a feature branch**:
|
|
111
|
+
```bash
|
|
112
|
+
git checkout -b feature/your-feature-name
|
|
113
|
+
# or
|
|
114
|
+
git checkout -b fix/your-bug-fix
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
2. **Make your changes**:
|
|
118
|
+
- Follow code style guidelines
|
|
119
|
+
- Add tests for new functionality
|
|
120
|
+
- Update documentation if needed
|
|
121
|
+
|
|
122
|
+
3. **Test your changes**:
|
|
123
|
+
```bash
|
|
124
|
+
bun run build
|
|
125
|
+
bun run test:feat
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
4. **Commit your changes**:
|
|
129
|
+
```bash
|
|
130
|
+
git add .
|
|
131
|
+
git commit -m "feat: add new API method for group management"
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
5. **Push to your fork**:
|
|
135
|
+
```bash
|
|
136
|
+
git push origin feature/your-feature-name
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
6. **Create a Pull Request**:
|
|
140
|
+
- Use the provided PR template
|
|
141
|
+
- Link related issues
|
|
142
|
+
- Provide clear description of changes
|
|
143
|
+
|
|
144
|
+
### PR Review Process
|
|
145
|
+
|
|
146
|
+
1. **Automated checks** must pass
|
|
147
|
+
2. **Code review** by at least one maintainer
|
|
148
|
+
3. **Security review** for security-related changes
|
|
149
|
+
4. **Documentation review** for API changes
|
|
150
|
+
5. **Final approval** before merge
|
|
151
|
+
|
|
152
|
+
## Code Style Guidelines
|
|
153
|
+
|
|
154
|
+
### TypeScript Guidelines
|
|
155
|
+
|
|
156
|
+
- Use TypeScript strict mode
|
|
157
|
+
- Prefer interfaces over types for object shapes
|
|
158
|
+
- Use meaningful variable and function names
|
|
159
|
+
- Add JSDoc comments for public APIs
|
|
160
|
+
- Use async/await over Promises when possible
|
|
161
|
+
|
|
162
|
+
### Code Organization
|
|
163
|
+
|
|
164
|
+
The project follows a modular structure for better maintainability and organization:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
zca-js/
|
|
168
|
+
├── src/ # Source code directory
|
|
169
|
+
│ ├── apis/ # API methods (100+ files)
|
|
170
|
+
│ │ ├── sendMessage.ts # Core messaging functionality
|
|
171
|
+
│ │ ├── login.ts # Authentication methods
|
|
172
|
+
│ │ ├── loginQR.ts # QR code login
|
|
173
|
+
│ │ ├── listen.ts # Event listening
|
|
174
|
+
│ │ ├── sendVideo.ts # Video sending
|
|
175
|
+
│ │ ├── sendVoice.ts # Voice sending
|
|
176
|
+
│ │ ├── sendSticker.ts # Sticker sending
|
|
177
|
+
│ │ ├── createGroup.ts # Group management
|
|
178
|
+
│ │ ├── addReaction.ts # Message reactions
|
|
179
|
+
│ │ ├── uploadAttachment.ts # File uploads
|
|
180
|
+
│ │ └── ... # 90+ other API methods
|
|
181
|
+
│ ├── models/ # TypeScript interfaces and types
|
|
182
|
+
│ │ ├── Message.ts # Message interface
|
|
183
|
+
│ │ ├── Attachment.ts # File attachment types
|
|
184
|
+
│ │ ├── Reaction.ts # Reaction types
|
|
185
|
+
│ │ ├── FriendEvent.ts # Friend event types
|
|
186
|
+
│ │ ├── GroupEvent.ts # Group event types
|
|
187
|
+
│ │ ├── Typing.ts # Typing indicators
|
|
188
|
+
│ │ ├── SeenMessage.ts # Message seen events
|
|
189
|
+
│ │ ├── DeliveredMessage.ts # Message delivery events
|
|
190
|
+
│ │ ├── Undo.ts # Undo functionality
|
|
191
|
+
│ │ ├── Enum.ts # Enumerations
|
|
192
|
+
│ │ └── index.ts # Model exports
|
|
193
|
+
│ ├── Errors/ # Error handling
|
|
194
|
+
│ │ ├── ZaloApiError.ts # Custom API error class
|
|
195
|
+
│ │ └── index.ts # Error exports
|
|
196
|
+
│ ├── context.ts # Context management and state
|
|
197
|
+
│ ├── utils.ts # Utility functions and helpers
|
|
198
|
+
│ ├── zalo.ts # Main Zalo class implementation
|
|
199
|
+
│ ├── update.ts # Update checking functionality
|
|
200
|
+
│ └── index.ts # Public API exports
|
|
201
|
+
├── examples/ # Usage examples
|
|
202
|
+
│ └── echobot.ts # Echo bot example
|
|
203
|
+
├── test/ # Test files
|
|
204
|
+
│ ├── feat.ts # Feature tests
|
|
205
|
+
│ ├── feat.test.ts # Feature test suite
|
|
206
|
+
│ ├── test.ts # General tests
|
|
207
|
+
│ └── a.png # Test assets
|
|
208
|
+
├── .github/ # GitHub configuration
|
|
209
|
+
│ └── ISSUE_TEMPLATE/ # Issue templates
|
|
210
|
+
├── .dev/ # Development tools (developer generated)
|
|
211
|
+
├── dist/ # Build output (generated)
|
|
212
|
+
├── node_modules/ # Dependencies (generated)
|
|
213
|
+
├── package.json # Project configuration
|
|
214
|
+
├── tsconfig.json # TypeScript configuration
|
|
215
|
+
├── rollup.config.js # Build configuration
|
|
216
|
+
├── README.md # Project documentation
|
|
217
|
+
├── CONTRIBUTING.md # Contribution guidelines
|
|
218
|
+
├── SECURITY.md # Security policy
|
|
219
|
+
├── CODE_OF_CONDUCT.md # Community guidelines
|
|
220
|
+
└── LICENSE # MIT License
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Key Directories Explained
|
|
224
|
+
|
|
225
|
+
- **`src/apis/`**: Contains all API method implementations (~100 files)
|
|
226
|
+
|
|
227
|
+
- **`src/models/`**: TypeScript interfaces and type definitions
|
|
228
|
+
- Core data structures for messages, events, and API responses
|
|
229
|
+
- Ensures type safety across the application
|
|
230
|
+
|
|
231
|
+
- **`src/Errors/`**: Custom error handling
|
|
232
|
+
- `ZaloApiError.ts`: Handles API-specific errors
|
|
233
|
+
- Provides consistent error handling across the library
|
|
234
|
+
|
|
235
|
+
- **`examples/`**: Usage examples and demonstrations
|
|
236
|
+
- `echobot.ts`: Complete example of a Zalo bot implementation
|
|
237
|
+
|
|
238
|
+
- **`test/`**: Test suites and test assets
|
|
239
|
+
- Feature tests for core functionality
|
|
240
|
+
- Integration tests for API methods
|
|
241
|
+
|
|
242
|
+
### Naming Conventions
|
|
243
|
+
|
|
244
|
+
- **Files**: camelCase (e.g., `sendMessage.ts`)
|
|
245
|
+
- **Classes**: PascalCase (e.g., `ZaloApiError`)
|
|
246
|
+
- **Functions**: camelCase (e.g., `sendMessage`)
|
|
247
|
+
- **Constants**: UPPER_SNAKE_CASE (e.g., `API_BASE_URL`)
|
|
248
|
+
- **Interfaces**: PascalCase with `I` prefix (e.g., `IMessage`)
|
|
249
|
+
|
|
250
|
+
### Error Handling
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
// Good
|
|
254
|
+
try {
|
|
255
|
+
const result = await api.sendMessage(message);
|
|
256
|
+
return result;
|
|
257
|
+
} catch (error) {
|
|
258
|
+
if (error instanceof ZaloApiError) {
|
|
259
|
+
throw error;
|
|
260
|
+
}
|
|
261
|
+
throw new ZaloApiError(`Failed to send message: ${error.message}`);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Bad
|
|
265
|
+
try {
|
|
266
|
+
const result = await api.sendMessage(message);
|
|
267
|
+
return result;
|
|
268
|
+
} catch (error) {
|
|
269
|
+
console.error(error);
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Testing Guidelines
|
|
275
|
+
|
|
276
|
+
### Test Structure
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
describe('API Method', () => {
|
|
280
|
+
beforeEach(() => {
|
|
281
|
+
// Setup
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
afterEach(() => {
|
|
285
|
+
// Cleanup
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
it('should handle success case', async () => {
|
|
289
|
+
// Test implementation
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it('should handle error case', async () => {
|
|
293
|
+
// Test error handling
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Testing Best Practices
|
|
299
|
+
|
|
300
|
+
- Test both success and failure scenarios
|
|
301
|
+
- Mock external dependencies
|
|
302
|
+
- Use descriptive test names
|
|
303
|
+
- Keep tests independent
|
|
304
|
+
- Test edge cases and error conditions
|
|
305
|
+
|
|
306
|
+
### Running Tests
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
# Run all tests
|
|
310
|
+
bun run test:feat
|
|
311
|
+
|
|
312
|
+
# Run specific test
|
|
313
|
+
bun run test/test.ts
|
|
314
|
+
|
|
315
|
+
# Run with coverage (if available)
|
|
316
|
+
bun run test:coverage
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Documentation Guidelines
|
|
320
|
+
|
|
321
|
+
### API Documentation
|
|
322
|
+
|
|
323
|
+
- Document all public methods with JSDoc
|
|
324
|
+
- Include parameter types and descriptions
|
|
325
|
+
- Provide usage examples
|
|
326
|
+
- Document error conditions
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
/**
|
|
330
|
+
* Sends a message to a specific thread
|
|
331
|
+
* @param message - The message object containing content and metadata
|
|
332
|
+
* @param threadId - The ID of the thread to send the message to
|
|
333
|
+
* @param threadType - The type of thread (User or Group)
|
|
334
|
+
* @returns Promise<Message> - The sent message object
|
|
335
|
+
* @throws {ZaloApiError} When the API request fails
|
|
336
|
+
* @example
|
|
337
|
+
* ```typescript
|
|
338
|
+
* const message = await api.sendMessage(
|
|
339
|
+
* { msg: "Hello, world!" },
|
|
340
|
+
* "123456789",
|
|
341
|
+
* ThreadType.User
|
|
342
|
+
* );
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
async sendMessage(message: IMessage, threadId: string, threadType: ThreadType): Promise<Message>
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### README Updates
|
|
349
|
+
|
|
350
|
+
- Update README.md for new features
|
|
351
|
+
- Add examples for new APIs
|
|
352
|
+
- Update installation instructions if needed
|
|
353
|
+
- Keep the table of contents updated
|
|
354
|
+
|
|
355
|
+
## Security Guidelines
|
|
356
|
+
|
|
357
|
+
### Security Best Practices
|
|
358
|
+
|
|
359
|
+
- Never commit sensitive data (tokens, passwords, etc.)
|
|
360
|
+
- Use environment variables for configuration
|
|
361
|
+
- Validate all user inputs
|
|
362
|
+
- Follow the principle of least privilege
|
|
363
|
+
- Report security issues privately
|
|
364
|
+
|
|
365
|
+
### Security Reporting
|
|
366
|
+
|
|
367
|
+
If you discover a security vulnerability:
|
|
368
|
+
|
|
369
|
+
1. **DO NOT** create a public issue
|
|
370
|
+
2. Use the [SECURITY.md](SECURITY.md) reporting process
|
|
371
|
+
3. Create a private issue with `[SECURITY]` label
|
|
372
|
+
4. Contact team members directly for urgent issues
|
|
373
|
+
|
|
374
|
+
### Code Security
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
// Good - Validate inputs
|
|
378
|
+
function sendMessage(content: string, threadId: string) {
|
|
379
|
+
if (!content || typeof content !== 'string') {
|
|
380
|
+
throw new ZaloApiError('Content must be a non-empty string');
|
|
381
|
+
}
|
|
382
|
+
if (!threadId || typeof threadId !== 'string') {
|
|
383
|
+
throw new ZaloApiError('ThreadId must be a non-empty string');
|
|
384
|
+
}
|
|
385
|
+
// Implementation
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Bad - No validation
|
|
389
|
+
function sendMessage(content: any, threadId: any) {
|
|
390
|
+
// Implementation without validation
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Release Process
|
|
395
|
+
|
|
396
|
+
### Versioning
|
|
397
|
+
|
|
398
|
+
We follow [Semantic Versioning](https://semver.org/):
|
|
399
|
+
|
|
400
|
+
- **MAJOR**: Breaking changes
|
|
401
|
+
- **MINOR**: New features (backward compatible)
|
|
402
|
+
- **PATCH**: Bug fixes (backward compatible)
|
|
403
|
+
|
|
404
|
+
### Release Checklist
|
|
405
|
+
|
|
406
|
+
- [ ] All tests pass
|
|
407
|
+
- [ ] Documentation is updated
|
|
408
|
+
- [ ] Version is bumped in package.json
|
|
409
|
+
- [ ] Build is successful
|
|
410
|
+
- [ ] Release notes are prepared
|
|
411
|
+
|
|
412
|
+
### Publishing
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
# Build the project
|
|
416
|
+
bun run build
|
|
417
|
+
|
|
418
|
+
# Run tests
|
|
419
|
+
bun run test:feat
|
|
420
|
+
|
|
421
|
+
# Publish to npm
|
|
422
|
+
npm publish
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
## Getting Help
|
|
426
|
+
|
|
427
|
+
### Communication Channels
|
|
428
|
+
|
|
429
|
+
- **GitHub Issues**: For bug reports and feature requests
|
|
430
|
+
- **GitHub Discussions**: For questions and general discussion
|
|
431
|
+
- **Pull Requests**: For code contributions
|
|
432
|
+
- **Security Issues**: Use `[SECURITY]` label
|
|
433
|
+
|
|
434
|
+
### Team Members
|
|
435
|
+
|
|
436
|
+
- [@RFS-ADRENO](https://github.com/RFS-ADRENO)
|
|
437
|
+
- [@truong9c2208](https://github.com/truong9c2208)
|
|
438
|
+
- [@JustKemForFun](https://github.com/JustKemForFun)
|
|
439
|
+
|
|
440
|
+
### Resources
|
|
441
|
+
|
|
442
|
+
- [API Documentation](https://tdung.gitbook.io/zca-js)
|
|
443
|
+
- [Examples](examples/)
|
|
444
|
+
- [Security Policy](SECURITY.md)
|
|
445
|
+
- [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
446
|
+
|
|
447
|
+
## Special Considerations for zca-js
|
|
448
|
+
|
|
449
|
+
### Unofficial API Library
|
|
450
|
+
|
|
451
|
+
> [!IMPORTANT]
|
|
452
|
+
> ⚠️ zca-js is an unofficial API library for Zalo. Please be aware of:
|
|
453
|
+
|
|
454
|
+
- **Account Risk**: Using this API may result in account suspension
|
|
455
|
+
- **Terms of Service**: Respect Zalo's ToS in your contributions
|
|
456
|
+
- **Rate Limiting**: Be mindful of API usage limits
|
|
457
|
+
- **Privacy**: Protect user privacy and data
|
|
458
|
+
|
|
459
|
+
### Responsible Development
|
|
460
|
+
|
|
461
|
+
- Test changes thoroughly before submitting
|
|
462
|
+
- Avoid introducing features that could harm users
|
|
463
|
+
- Consider the impact on Zalo's infrastructure
|
|
464
|
+
- Document any risks or limitations
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
**Thank you for contributing to zca-js!** 🚀
|
|
469
|
+
|
|
470
|
+
Your contributions help make this library better for the entire community.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 - 2025 RFS-ADRENO, truong9c2208, JustKemForFun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|