@phuquy2203/n8n-nodes-zl-sumo 2.0.15
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/README.md +0 -0
- package/dist/credentials/ZaloApi.credentials.d.ts +7 -0
- package/dist/credentials/ZaloApi.credentials.js +49 -0
- package/dist/nodes/Zalo/Zalo.node.d.ts +5 -0
- package/dist/nodes/Zalo/Zalo.node.js +260 -0
- package/dist/nodes/Zalo/zalo.png +0 -0
- package/dist/nodes/Zalo/zalo.svg +3 -0
- package/dist/src/Errors/ZaloApiError.d.ts +4 -0
- package/dist/src/Errors/ZaloApiError.js +11 -0
- package/dist/src/Errors/ZaloApiLoginQRAborted.d.ts +4 -0
- package/dist/src/Errors/ZaloApiLoginQRAborted.js +11 -0
- package/dist/src/Errors/ZaloApiLoginQRDeclined.d.ts +4 -0
- package/dist/src/Errors/ZaloApiLoginQRDeclined.js +11 -0
- package/dist/src/Errors/ZaloApiMissingImageMetadataGetter.d.ts +4 -0
- package/dist/src/Errors/ZaloApiMissingImageMetadataGetter.js +11 -0
- package/dist/src/Errors/index.d.ts +4 -0
- package/dist/src/Errors/index.js +20 -0
- package/dist/src/apis/acceptFriendRequest.d.ts +2 -0
- package/dist/src/apis/acceptFriendRequest.js +31 -0
- package/dist/src/apis/addGroupBlockedMember.d.ts +2 -0
- package/dist/src/apis/addGroupBlockedMember.js +31 -0
- package/dist/src/apis/addGroupDeputy.d.ts +2 -0
- package/dist/src/apis/addGroupDeputy.js +33 -0
- package/dist/src/apis/addPollOptions.d.ts +14 -0
- package/dist/src/apis/addPollOptions.js +29 -0
- package/dist/src/apis/addQuickMessage.d.ts +11 -0
- package/dist/src/apis/addQuickMessage.js +63 -0
- package/dist/src/apis/addReaction.d.ts +18 -0
- package/dist/src/apis/addReaction.js +297 -0
- package/dist/src/apis/addUnreadMark.d.ts +8 -0
- package/dist/src/apis/addUnreadMark.js +55 -0
- package/dist/src/apis/addUserToGroup.d.ts +5 -0
- package/dist/src/apis/addUserToGroup.js +37 -0
- package/dist/src/apis/blockUser.d.ts +2 -0
- package/dist/src/apis/blockUser.js +31 -0
- package/dist/src/apis/blockViewFeed.d.ts +2 -0
- package/dist/src/apis/blockViewFeed.js +33 -0
- package/dist/src/apis/changeAccountAvatar.d.ts +3 -0
- package/dist/src/apis/changeAccountAvatar.js +58 -0
- package/dist/src/apis/changeFriendAlias.d.ts +2 -0
- package/dist/src/apis/changeFriendAlias.js +30 -0
- package/dist/src/apis/changeGroupAvatar.d.ts +3 -0
- package/dist/src/apis/changeGroupAvatar.js +50 -0
- package/dist/src/apis/changeGroupName.d.ts +4 -0
- package/dist/src/apis/changeGroupName.js +35 -0
- package/dist/src/apis/changeGroupOwner.d.ts +4 -0
- package/dist/src/apis/changeGroupOwner.js +33 -0
- package/dist/src/apis/createAutoReply.d.ts +14 -0
- package/dist/src/apis/createAutoReply.js +40 -0
- package/dist/src/apis/createCatalog.d.ts +7 -0
- package/dist/src/apis/createCatalog.js +32 -0
- package/dist/src/apis/createGroup.d.ts +28 -0
- package/dist/src/apis/createGroup.js +46 -0
- package/dist/src/apis/createNote.d.ts +7 -0
- package/dist/src/apis/createNote.js +50 -0
- package/dist/src/apis/createPoll.d.ts +36 -0
- package/dist/src/apis/createPoll.js +43 -0
- package/dist/src/apis/createProductCatalog.d.ts +23 -0
- package/dist/src/apis/createProductCatalog.js +53 -0
- package/dist/src/apis/createReminder.d.ts +12 -0
- package/dist/src/apis/createReminder.js +66 -0
- package/dist/src/apis/custom.d.ts +9 -0
- package/dist/src/apis/custom.js +17 -0
- package/dist/src/apis/deleteAutoReply.d.ts +5 -0
- package/dist/src/apis/deleteAutoReply.js +32 -0
- package/dist/src/apis/deleteAvatar.d.ts +9 -0
- package/dist/src/apis/deleteAvatar.js +30 -0
- package/dist/src/apis/deleteCatalog.d.ts +2 -0
- package/dist/src/apis/deleteCatalog.js +31 -0
- package/dist/src/apis/deleteChat.d.ts +19 -0
- package/dist/src/apis/deleteChat.js +53 -0
- package/dist/src/apis/deleteGroupInviteBox.d.ts +9 -0
- package/dist/src/apis/deleteGroupInviteBox.js +30 -0
- package/dist/src/apis/deleteMessage.d.ts +14 -0
- package/dist/src/apis/deleteMessage.js +55 -0
- package/dist/src/apis/deleteProductCatalog.d.ts +10 -0
- package/dist/src/apis/deleteProductCatalog.js +34 -0
- package/dist/src/apis/disableGroupLink.d.ts +2 -0
- package/dist/src/apis/disableGroupLink.js +27 -0
- package/dist/src/apis/disperseGroup.d.ts +2 -0
- package/dist/src/apis/disperseGroup.js +31 -0
- package/dist/src/apis/editNote.d.ts +17 -0
- package/dist/src/apis/editNote.js +49 -0
- package/dist/src/apis/editReminder.d.ts +13 -0
- package/dist/src/apis/editReminder.js +64 -0
- package/dist/src/apis/enableGroupLink.d.ts +6 -0
- package/dist/src/apis/enableGroupLink.js +28 -0
- package/dist/src/apis/fetchAccountInfo.d.ts +3 -0
- package/dist/src/apis/fetchAccountInfo.js +13 -0
- package/dist/src/apis/findUser.d.ts +15 -0
- package/dist/src/apis/findUser.js +43 -0
- package/dist/src/apis/forwardMessage.d.ts +24 -0
- package/dist/src/apis/forwardMessage.js +102 -0
- package/dist/src/apis/getAliasList.d.ts +8 -0
- package/dist/src/apis/getAliasList.js +30 -0
- package/dist/src/apis/getAllFriends.d.ts +3 -0
- package/dist/src/apis/getAllFriends.js +35 -0
- package/dist/src/apis/getAllGroups.d.ts +7 -0
- package/dist/src/apis/getAllGroups.js +13 -0
- package/dist/src/apis/getArchivedChatList.d.ts +5 -0
- package/dist/src/apis/getArchivedChatList.js +26 -0
- package/dist/src/apis/getAutoDeleteChat.d.ts +9 -0
- package/dist/src/apis/getAutoDeleteChat.js +24 -0
- package/dist/src/apis/getAutoReplyList.d.ts +6 -0
- package/dist/src/apis/getAutoReplyList.js +27 -0
- package/dist/src/apis/getAvatarList.d.ts +12 -0
- package/dist/src/apis/getAvatarList.js +31 -0
- package/dist/src/apis/getBizAccount.d.ts +24 -0
- package/dist/src/apis/getBizAccount.js +30 -0
- package/dist/src/apis/getCatalogList.d.ts +18 -0
- package/dist/src/apis/getCatalogList.js +35 -0
- package/dist/src/apis/getContext.d.ts +1 -0
- package/dist/src/apis/getContext.js +7 -0
- package/dist/src/apis/getCookie.d.ts +1 -0
- package/dist/src/apis/getCookie.js +12 -0
- package/dist/src/apis/getFriendBoardList.d.ts +5 -0
- package/dist/src/apis/getFriendBoardList.js +29 -0
- package/dist/src/apis/getFriendOnlines.d.ts +10 -0
- package/dist/src/apis/getFriendOnlines.js +38 -0
- package/dist/src/apis/getFriendRecommendations.d.ts +42 -0
- package/dist/src/apis/getFriendRecommendations.js +30 -0
- package/dist/src/apis/getFriendRequestStatus.d.ts +8 -0
- package/dist/src/apis/getFriendRequestStatus.js +28 -0
- package/dist/src/apis/getGroupBlockedMember.d.ts +23 -0
- package/dist/src/apis/getGroupBlockedMember.js +32 -0
- package/dist/src/apis/getGroupInfo.d.ts +16 -0
- package/dist/src/apis/getGroupInfo.js +35 -0
- package/dist/src/apis/getGroupInviteBoxInfo.d.ts +32 -0
- package/dist/src/apis/getGroupInviteBoxInfo.js +41 -0
- package/dist/src/apis/getGroupInviteBoxList.d.ts +38 -0
- package/dist/src/apis/getGroupInviteBoxList.js +34 -0
- package/dist/src/apis/getGroupLinkDetail.d.ts +9 -0
- package/dist/src/apis/getGroupLinkDetail.js +28 -0
- package/dist/src/apis/getGroupLinkInfo.d.ts +34 -0
- package/dist/src/apis/getGroupLinkInfo.js +31 -0
- package/dist/src/apis/getGroupMembersInfo.d.ts +17 -0
- package/dist/src/apis/getGroupMembersInfo.js +27 -0
- package/dist/src/apis/getHiddenConversations.d.ts +11 -0
- package/dist/src/apis/getHiddenConversations.js +26 -0
- package/dist/src/apis/getLabels.d.ts +7 -0
- package/dist/src/apis/getLabels.js +31 -0
- package/dist/src/apis/getListBoard.d.ts +21 -0
- package/dist/src/apis/getListBoard.js +48 -0
- package/dist/src/apis/getListReminder.d.ts +28 -0
- package/dist/src/apis/getListReminder.js +50 -0
- package/dist/src/apis/getMute.d.ts +13 -0
- package/dist/src/apis/getMute.js +25 -0
- package/dist/src/apis/getOwnId.d.ts +1 -0
- package/dist/src/apis/getOwnId.js +7 -0
- package/dist/src/apis/getPendingGroupMembers.d.ts +11 -0
- package/dist/src/apis/getPendingGroupMembers.js +30 -0
- package/dist/src/apis/getPinConversations.d.ts +5 -0
- package/dist/src/apis/getPinConversations.js +25 -0
- package/dist/src/apis/getPollDetail.d.ts +3 -0
- package/dist/src/apis/getPollDetail.js +33 -0
- package/dist/src/apis/getProductCatalogList.d.ts +20 -0
- package/dist/src/apis/getProductCatalogList.js +36 -0
- package/dist/src/apis/getQR.d.ts +4 -0
- package/dist/src/apis/getQR.js +32 -0
- package/dist/src/apis/getQuickMessageList.d.ts +7 -0
- package/dist/src/apis/getQuickMessageList.js +27 -0
- package/dist/src/apis/getRelatedFriendGroup.d.ts +6 -0
- package/dist/src/apis/getRelatedFriendGroup.js +33 -0
- package/dist/src/apis/getReminder.d.ts +3 -0
- package/dist/src/apis/getReminder.js +28 -0
- package/dist/src/apis/getReminderResponses.d.ts +5 -0
- package/dist/src/apis/getReminderResponses.js +27 -0
- package/dist/src/apis/getSentFriendRequest.d.ts +18 -0
- package/dist/src/apis/getSentFriendRequest.js +27 -0
- package/dist/src/apis/getSettings.d.ts +3 -0
- package/dist/src/apis/getSettings.js +23 -0
- package/dist/src/apis/getStickers.d.ts +1 -0
- package/dist/src/apis/getStickers.js +43 -0
- package/dist/src/apis/getStickersDetail.d.ts +24 -0
- package/dist/src/apis/getStickersDetail.js +43 -0
- package/dist/src/apis/getUnreadMark.d.ts +14 -0
- package/dist/src/apis/getUnreadMark.js +33 -0
- package/dist/src/apis/getUserInfo.d.ts +8 -0
- package/dist/src/apis/getUserInfo.js +45 -0
- package/dist/src/apis/inviteUserToGroups.d.ts +10 -0
- package/dist/src/apis/inviteUserToGroups.js +33 -0
- package/dist/src/apis/joinGroupInviteBox.d.ts +2 -0
- package/dist/src/apis/joinGroupInviteBox.js +28 -0
- package/dist/src/apis/joinGroupLink.d.ts +2 -0
- package/dist/src/apis/joinGroupLink.js +30 -0
- package/dist/src/apis/keepAlive.d.ts +4 -0
- package/dist/src/apis/keepAlive.js +25 -0
- package/dist/src/apis/lastOnline.d.ts +7 -0
- package/dist/src/apis/lastOnline.js +29 -0
- package/dist/src/apis/leaveGroup.d.ts +4 -0
- package/dist/src/apis/leaveGroup.js +36 -0
- package/dist/src/apis/listen.d.ts +103 -0
- package/dist/src/apis/listen.js +432 -0
- package/dist/src/apis/lockPoll.d.ts +2 -0
- package/dist/src/apis/lockPoll.js +31 -0
- package/dist/src/apis/login.d.ts +3 -0
- package/dist/src/apis/login.js +101 -0
- package/dist/src/apis/loginQR.d.ts +70 -0
- package/dist/src/apis/loginQR.js +369 -0
- package/dist/src/apis/parseLink.d.ts +21 -0
- package/dist/src/apis/parseLink.js +30 -0
- package/dist/src/apis/rejectFriendRequest.d.ts +2 -0
- package/dist/src/apis/rejectFriendRequest.js +30 -0
- package/dist/src/apis/removeFriend.d.ts +2 -0
- package/dist/src/apis/removeFriend.js +31 -0
- package/dist/src/apis/removeFriendAlias.d.ts +2 -0
- package/dist/src/apis/removeFriendAlias.js +27 -0
- package/dist/src/apis/removeGroupBlockedMember.d.ts +2 -0
- package/dist/src/apis/removeGroupBlockedMember.js +31 -0
- package/dist/src/apis/removeGroupDeputy.d.ts +2 -0
- package/dist/src/apis/removeGroupDeputy.js +33 -0
- package/dist/src/apis/removeQuickMessage.d.ts +5 -0
- package/dist/src/apis/removeQuickMessage.js +30 -0
- package/dist/src/apis/removeReminder.d.ts +3 -0
- package/dist/src/apis/removeReminder.js +43 -0
- package/dist/src/apis/removeUnreadMark.d.ts +8 -0
- package/dist/src/apis/removeUnreadMark.js +53 -0
- package/dist/src/apis/removeUserFromGroup.d.ts +4 -0
- package/dist/src/apis/removeUserFromGroup.js +37 -0
- package/dist/src/apis/resetHiddenConversPin.d.ts +2 -0
- package/dist/src/apis/resetHiddenConversPin.js +23 -0
- package/dist/src/apis/reuseAvatar.d.ts +2 -0
- package/dist/src/apis/reuseAvatar.js +29 -0
- package/dist/src/apis/reviewPendingMemberRequest.d.ts +14 -0
- package/dist/src/apis/reviewPendingMemberRequest.js +41 -0
- package/dist/src/apis/sendBankCard.d.ts +9 -0
- package/dist/src/apis/sendBankCard.js +40 -0
- package/dist/src/apis/sendCard.d.ts +10 -0
- package/dist/src/apis/sendCard.js +62 -0
- package/dist/src/apis/sendDeliveredEvent.d.ts +16 -0
- package/dist/src/apis/sendDeliveredEvent.js +58 -0
- package/dist/src/apis/sendFriendRequest.d.ts +2 -0
- package/dist/src/apis/sendFriendRequest.js +42 -0
- package/dist/src/apis/sendLink.d.ts +10 -0
- package/dist/src/apis/sendLink.js +64 -0
- package/dist/src/apis/sendMessage.d.ts +99 -0
- package/dist/src/apis/sendMessage.js +455 -0
- package/dist/src/apis/sendReport.d.ts +17 -0
- package/dist/src/apis/sendReport.js +56 -0
- package/dist/src/apis/sendSeenEvent.d.ts +16 -0
- package/dist/src/apis/sendSeenEvent.js +66 -0
- package/dist/src/apis/sendSticker.d.ts +10 -0
- package/dist/src/apis/sendSticker.js +60 -0
- package/dist/src/apis/sendTypingEvent.d.ts +5 -0
- package/dist/src/apis/sendTypingEvent.js +36 -0
- package/dist/src/apis/sendVideo.d.ts +35 -0
- package/dist/src/apis/sendVideo.js +121 -0
- package/dist/src/apis/sendVoice.d.ts +12 -0
- package/dist/src/apis/sendVoice.js +76 -0
- package/dist/src/apis/setArchivedConversations.d.ts +10 -0
- package/dist/src/apis/setArchivedConversations.js +37 -0
- package/dist/src/apis/setHiddenConversations.d.ts +3 -0
- package/dist/src/apis/setHiddenConversations.js +42 -0
- package/dist/src/apis/setMute.d.ts +20 -0
- package/dist/src/apis/setMute.js +70 -0
- package/dist/src/apis/setPinnedConversations.d.ts +3 -0
- package/dist/src/apis/setPinnedConversations.js +37 -0
- package/dist/src/apis/sharePoll.d.ts +2 -0
- package/dist/src/apis/sharePoll.js +31 -0
- package/dist/src/apis/unblockUser.d.ts +2 -0
- package/dist/src/apis/unblockUser.js +31 -0
- package/dist/src/apis/undo.d.ts +9 -0
- package/dist/src/apis/undo.js +45 -0
- package/dist/src/apis/undoFriendRequest.d.ts +2 -0
- package/dist/src/apis/undoFriendRequest.js +30 -0
- package/dist/src/apis/updateActiveStatus.d.ts +4 -0
- package/dist/src/apis/updateActiveStatus.js +30 -0
- package/dist/src/apis/updateAutoDeleteChat.d.ts +9 -0
- package/dist/src/apis/updateAutoDeleteChat.js +43 -0
- package/dist/src/apis/updateAutoReply.d.ts +15 -0
- package/dist/src/apis/updateAutoReply.js +41 -0
- package/dist/src/apis/updateCatalog.d.ts +11 -0
- package/dist/src/apis/updateCatalog.js +33 -0
- package/dist/src/apis/updateGroupSettings.d.ts +40 -0
- package/dist/src/apis/updateGroupSettings.js +46 -0
- package/dist/src/apis/updateHiddenConversPin.d.ts +2 -0
- package/dist/src/apis/updateHiddenConversPin.js +33 -0
- package/dist/src/apis/updateLabels.d.ts +15 -0
- package/dist/src/apis/updateLabels.js +37 -0
- package/dist/src/apis/updateLang.d.ts +6 -0
- package/dist/src/apis/updateLang.js +33 -0
- package/dist/src/apis/updateProductCatalog.d.ts +25 -0
- package/dist/src/apis/updateProductCatalog.js +54 -0
- package/dist/src/apis/updateProfile.d.ts +20 -0
- package/dist/src/apis/updateProfile.js +46 -0
- package/dist/src/apis/updateQuickMessage.d.ts +11 -0
- package/dist/src/apis/updateQuickMessage.js +64 -0
- package/dist/src/apis/updateSettings.d.ts +16 -0
- package/dist/src/apis/updateSettings.js +93 -0
- package/dist/src/apis/uploadAttachment.d.ts +50 -0
- package/dist/src/apis/uploadAttachment.js +202 -0
- package/dist/src/apis/uploadProductPhoto.d.ts +14 -0
- package/dist/src/apis/uploadProductPhoto.js +56 -0
- package/dist/src/apis/votePoll.d.ts +5 -0
- package/dist/src/apis/votePoll.js +32 -0
- package/dist/src/apis.d.ts +279 -0
- package/dist/src/apis.js +283 -0
- package/dist/src/context.d.ts +183 -0
- package/dist/src/context.js +33 -0
- package/dist/src/index.d.ts +146 -0
- package/dist/src/index.js +41 -0
- package/dist/src/models/Attachment.d.ts +11 -0
- package/dist/src/models/Attachment.js +2 -0
- package/dist/src/models/AutoReply.d.ts +20 -0
- package/dist/src/models/AutoReply.js +10 -0
- package/dist/src/models/Board.d.ts +60 -0
- package/dist/src/models/Board.js +9 -0
- package/dist/src/models/Catalog.d.ts +16 -0
- package/dist/src/models/Catalog.js +2 -0
- package/dist/src/models/DeliveredMessage.d.ts +27 -0
- package/dist/src/models/DeliveredMessage.js +22 -0
- package/dist/src/models/Enum.d.ts +247 -0
- package/dist/src/models/Enum.js +254 -0
- package/dist/src/models/FriendEvent.d.ts +107 -0
- package/dist/src/models/FriendEvent.js +87 -0
- package/dist/src/models/Group.d.ts +125 -0
- package/dist/src/models/Group.js +14 -0
- package/dist/src/models/GroupEvent.d.ts +178 -0
- package/dist/src/models/GroupEvent.js +94 -0
- package/dist/src/models/Label.d.ts +10 -0
- package/dist/src/models/Label.js +2 -0
- package/dist/src/models/Message.d.ts +91 -0
- package/dist/src/models/Message.js +34 -0
- package/dist/src/models/ProductCatalog.d.ts +17 -0
- package/dist/src/models/ProductCatalog.js +2 -0
- package/dist/src/models/QuickMessage.d.ts +25 -0
- package/dist/src/models/QuickMessage.js +2 -0
- package/dist/src/models/Reaction.d.ts +85 -0
- package/dist/src/models/Reaction.js +74 -0
- package/dist/src/models/Reminder.d.ts +51 -0
- package/dist/src/models/Reminder.js +10 -0
- package/dist/src/models/SeenMessage.d.ts +26 -0
- package/dist/src/models/SeenMessage.js +22 -0
- package/dist/src/models/Typing.d.ts +24 -0
- package/dist/src/models/Typing.js +22 -0
- package/dist/src/models/Undo.d.ts +34 -0
- package/dist/src/models/Undo.js +16 -0
- package/dist/src/models/User.d.ts +49 -0
- package/dist/src/models/User.js +2 -0
- package/dist/src/models/ZBusiness.d.ts +22 -0
- package/dist/src/models/ZBusiness.js +38 -0
- package/dist/src/models/index.d.ts +20 -0
- package/dist/src/models/index.js +36 -0
- package/dist/src/update.d.ts +2 -0
- package/dist/src/update.js +33 -0
- package/dist/src/utils.d.ts +169 -0
- package/dist/src/utils.js +737 -0
- package/dist/src/zalo.d.ts +41 -0
- package/dist/src/zalo.js +110 -0
- package/package.json +60 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getListBoardFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const index_js_1 = require("../models/index.js");
|
|
6
|
+
const utils_js_1 = require("../utils.js");
|
|
7
|
+
exports.getListBoardFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
8
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group_board[0]}/api/board/list`);
|
|
9
|
+
/**
|
|
10
|
+
* Get list board items in a group
|
|
11
|
+
*
|
|
12
|
+
* @param options - The options for the request
|
|
13
|
+
* @param groupId - The ID of the group
|
|
14
|
+
*
|
|
15
|
+
* @throws {ZaloApiError}
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
return async function getListBoard(options, groupId) {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
const requestParams = {
|
|
21
|
+
group_id: groupId,
|
|
22
|
+
board_type: 0,
|
|
23
|
+
page: (_a = options.page) !== null && _a !== void 0 ? _a : 1,
|
|
24
|
+
count: (_b = options.count) !== null && _b !== void 0 ? _b : 20,
|
|
25
|
+
last_id: 0,
|
|
26
|
+
last_type: 0,
|
|
27
|
+
imei: ctx.imei,
|
|
28
|
+
};
|
|
29
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(requestParams));
|
|
30
|
+
if (!encryptedParams)
|
|
31
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
32
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
33
|
+
method: "GET",
|
|
34
|
+
});
|
|
35
|
+
return utils.resolve(response, (result) => {
|
|
36
|
+
const data = result.data;
|
|
37
|
+
data.items.forEach((item) => {
|
|
38
|
+
if (item.boardType != index_js_1.BoardType.Poll) {
|
|
39
|
+
const detailData = item.data;
|
|
40
|
+
if (typeof detailData.params === "string") {
|
|
41
|
+
detailData.params = JSON.parse(detailData.params);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return data;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReminderGroup, ReminderUser } from "../models/index.js";
|
|
2
|
+
import { ThreadType } from "../models/index.js";
|
|
3
|
+
export type ListReminderOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Page number (default: 1)
|
|
6
|
+
*/
|
|
7
|
+
page?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Number of items to retrieve (default: 20)
|
|
10
|
+
*/
|
|
11
|
+
count?: number;
|
|
12
|
+
};
|
|
13
|
+
export type ReminderListUser = ReminderUser;
|
|
14
|
+
export type ReminderListGroup = ReminderGroup & {
|
|
15
|
+
groupId: string;
|
|
16
|
+
eventType: number;
|
|
17
|
+
responseMem: {
|
|
18
|
+
rejectMember: number;
|
|
19
|
+
myResp: number;
|
|
20
|
+
acceptMember: number;
|
|
21
|
+
};
|
|
22
|
+
repeatInfo: {
|
|
23
|
+
list_ts: unknown[];
|
|
24
|
+
};
|
|
25
|
+
repeatData: unknown[];
|
|
26
|
+
};
|
|
27
|
+
export type GetListReminderResponse = (ReminderListUser & ReminderListGroup)[];
|
|
28
|
+
export declare const getListReminderFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => (options: ListReminderOptions, threadId: string, type?: ThreadType) => Promise<GetListReminderResponse>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getListReminderFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const index_js_1 = require("../models/index.js");
|
|
6
|
+
const utils_js_1 = require("../utils.js");
|
|
7
|
+
exports.getListReminderFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
8
|
+
const serviceURL = {
|
|
9
|
+
[index_js_1.ThreadType.User]: utils.makeURL(`${api.zpwServiceMap.group_board[0]}/api/board/oneone/list`),
|
|
10
|
+
[index_js_1.ThreadType.Group]: utils.makeURL(`${api.zpwServiceMap.group_board[0]}/api/board/listReminder`),
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Get list reminder
|
|
14
|
+
*
|
|
15
|
+
* @param options - The options for the request
|
|
16
|
+
* @param threadId - The ID of the thread
|
|
17
|
+
* @param type - The type of the thread (User or Group)
|
|
18
|
+
*
|
|
19
|
+
* @throws {ZaloApiError}
|
|
20
|
+
*/
|
|
21
|
+
return async function getListReminder(options, threadId, type = index_js_1.ThreadType.User) {
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
|
+
const requestParams = Object.assign({ objectData: JSON.stringify(type === index_js_1.ThreadType.User
|
|
24
|
+
? {
|
|
25
|
+
uid: threadId,
|
|
26
|
+
board_type: 1,
|
|
27
|
+
page: (_a = options.page) !== null && _a !== void 0 ? _a : 1,
|
|
28
|
+
count: (_b = options.count) !== null && _b !== void 0 ? _b : 20,
|
|
29
|
+
last_id: 0,
|
|
30
|
+
last_type: 0,
|
|
31
|
+
}
|
|
32
|
+
: {
|
|
33
|
+
group_id: threadId,
|
|
34
|
+
board_type: 1,
|
|
35
|
+
page: (_c = options.page) !== null && _c !== void 0 ? _c : 1,
|
|
36
|
+
count: (_d = options.count) !== null && _d !== void 0 ? _d : 20,
|
|
37
|
+
last_id: 0,
|
|
38
|
+
last_type: 0,
|
|
39
|
+
}) }, (type === index_js_1.ThreadType.Group && { imei: ctx.imei }));
|
|
40
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(requestParams));
|
|
41
|
+
if (!encryptedParams)
|
|
42
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
43
|
+
const response = await utils.request(utils.makeURL(serviceURL[type], { params: encryptedParams }), {
|
|
44
|
+
method: "GET",
|
|
45
|
+
});
|
|
46
|
+
return utils.resolve(response, (result) => {
|
|
47
|
+
return JSON.parse(result.data);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MuteEntriesInfo = {
|
|
2
|
+
id: string;
|
|
3
|
+
duration: number;
|
|
4
|
+
startTime: number;
|
|
5
|
+
systemTime: number;
|
|
6
|
+
currentTime: number;
|
|
7
|
+
muteMode: number;
|
|
8
|
+
};
|
|
9
|
+
export type GetMuteResponse = {
|
|
10
|
+
chatEntries: MuteEntriesInfo[];
|
|
11
|
+
groupChatEntries: MuteEntriesInfo[];
|
|
12
|
+
};
|
|
13
|
+
export declare const getMuteFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => () => Promise<GetMuteResponse>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMuteFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getMuteFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.profile[0]}/api/social/profile/getmute`);
|
|
8
|
+
/**
|
|
9
|
+
* Get mute
|
|
10
|
+
*
|
|
11
|
+
* @throws {ZaloApiError}
|
|
12
|
+
*/
|
|
13
|
+
return async function getMute() {
|
|
14
|
+
const params = {
|
|
15
|
+
imei: ctx.imei,
|
|
16
|
+
};
|
|
17
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
18
|
+
if (!encryptedParams)
|
|
19
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
20
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
21
|
+
method: "GET",
|
|
22
|
+
});
|
|
23
|
+
return utils.resolve(response);
|
|
24
|
+
};
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getOwnIdFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => () => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type GetPendingGroupMembersUserInfo = {
|
|
2
|
+
uid: string;
|
|
3
|
+
dpn: string;
|
|
4
|
+
avatar: string;
|
|
5
|
+
user_submit: null;
|
|
6
|
+
};
|
|
7
|
+
export type GetPendingGroupMembersResponse = {
|
|
8
|
+
time: number;
|
|
9
|
+
users: GetPendingGroupMembersUserInfo[];
|
|
10
|
+
};
|
|
11
|
+
export declare const getPendingGroupMembersFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => (groupId: string) => Promise<GetPendingGroupMembersResponse>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPendingGroupMembersFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getPendingGroupMembersFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group[0]}/api/group/pending-mems/list`);
|
|
8
|
+
/**
|
|
9
|
+
* Get pending group members
|
|
10
|
+
*
|
|
11
|
+
* @param groupId - The id of the group to get the pending members
|
|
12
|
+
*
|
|
13
|
+
* @note Only the group leader and deputy group leader can view
|
|
14
|
+
*
|
|
15
|
+
* @throws {ZaloApiError}
|
|
16
|
+
*/
|
|
17
|
+
return async function getPendingGroupMembers(groupId) {
|
|
18
|
+
const params = {
|
|
19
|
+
grid: groupId,
|
|
20
|
+
imei: ctx.imei,
|
|
21
|
+
};
|
|
22
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
23
|
+
if (!encryptedParams)
|
|
24
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
25
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
26
|
+
method: "GET",
|
|
27
|
+
});
|
|
28
|
+
return utils.resolve(response);
|
|
29
|
+
};
|
|
30
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPinConversationsFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getPinConversationsFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.conversation[0]}/api/pinconvers/list`);
|
|
8
|
+
/**
|
|
9
|
+
* Get pin conversations
|
|
10
|
+
*
|
|
11
|
+
* @throws {ZaloApiError}
|
|
12
|
+
*/
|
|
13
|
+
return async function getPinConversations() {
|
|
14
|
+
const params = {
|
|
15
|
+
imei: ctx.imei,
|
|
16
|
+
};
|
|
17
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
18
|
+
if (!encryptedParams)
|
|
19
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
20
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
21
|
+
method: "GET",
|
|
22
|
+
});
|
|
23
|
+
return utils.resolve(response);
|
|
24
|
+
};
|
|
25
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPollDetailFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getPollDetailFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group[0]}/api/poll/detail`);
|
|
8
|
+
/**
|
|
9
|
+
* Get poll detail
|
|
10
|
+
*
|
|
11
|
+
* @param pollId Poll ID
|
|
12
|
+
*
|
|
13
|
+
* @throws {ZaloApiError}
|
|
14
|
+
*/
|
|
15
|
+
return async function getPollDetail(pollId) {
|
|
16
|
+
if (!pollId)
|
|
17
|
+
throw new ZaloApiError_js_1.ZaloApiError("Missing poll id");
|
|
18
|
+
const params = {
|
|
19
|
+
poll_id: pollId,
|
|
20
|
+
imei: ctx.imei,
|
|
21
|
+
};
|
|
22
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
23
|
+
if (!encryptedParams)
|
|
24
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt message");
|
|
25
|
+
const response = await utils.request(serviceURL, {
|
|
26
|
+
method: "POST",
|
|
27
|
+
body: new URLSearchParams({
|
|
28
|
+
params: encryptedParams,
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
return utils.resolve(response);
|
|
32
|
+
};
|
|
33
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ProductCatalogItem } from "../models/index.js";
|
|
2
|
+
export type GetProductCatalogListPayload = {
|
|
3
|
+
catalogId: string;
|
|
4
|
+
/**
|
|
5
|
+
* Number of items to retrieve (default: 100)
|
|
6
|
+
*/
|
|
7
|
+
limit?: number;
|
|
8
|
+
versionCatalog?: number;
|
|
9
|
+
lastProductId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Page number (default: 0)
|
|
12
|
+
*/
|
|
13
|
+
page?: number;
|
|
14
|
+
};
|
|
15
|
+
export type GetProductCatalogListResponse = {
|
|
16
|
+
items: ProductCatalogItem[];
|
|
17
|
+
version: number;
|
|
18
|
+
has_more: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const getProductCatalogListFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => (payload: GetProductCatalogListPayload) => Promise<GetProductCatalogListResponse>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProductCatalogListFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getProductCatalogListFactory = (0, utils_js_1.apiFactory)()((api, _, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.catalog[0]}/api/prodcatalog/product/list`);
|
|
8
|
+
/**
|
|
9
|
+
* Get product catalog list?
|
|
10
|
+
*
|
|
11
|
+
* @param payload payload
|
|
12
|
+
*
|
|
13
|
+
* @note this API is used for zBusiness
|
|
14
|
+
* @throws {ZaloApiError}
|
|
15
|
+
*/
|
|
16
|
+
return async function getProductCatalogList(payload) {
|
|
17
|
+
var _a, _b, _c, _d;
|
|
18
|
+
const params = {
|
|
19
|
+
catalog_id: payload.catalogId,
|
|
20
|
+
limit: (_a = payload.limit) !== null && _a !== void 0 ? _a : 100,
|
|
21
|
+
version_catalog: (_b = payload.versionCatalog) !== null && _b !== void 0 ? _b : 0,
|
|
22
|
+
last_product_id: (_c = payload.lastProductId) !== null && _c !== void 0 ? _c : -1,
|
|
23
|
+
page: (_d = payload.page) !== null && _d !== void 0 ? _d : 0,
|
|
24
|
+
};
|
|
25
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
26
|
+
if (!encryptedParams)
|
|
27
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
28
|
+
const response = await utils.request(serviceURL, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
body: new URLSearchParams({
|
|
31
|
+
params: encryptedParams,
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
return utils.resolve(response);
|
|
35
|
+
};
|
|
36
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getQRFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getQRFactory = (0, utils_js_1.apiFactory)()((api, _, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend[0]}/api/friend/mget-qr`);
|
|
8
|
+
/**
|
|
9
|
+
* Get QR code for users
|
|
10
|
+
*
|
|
11
|
+
* @param userId User ID or list of user IDs
|
|
12
|
+
*
|
|
13
|
+
* @throws {ZaloApiError}
|
|
14
|
+
*/
|
|
15
|
+
return async function getQR(userId) {
|
|
16
|
+
if (typeof userId == "string")
|
|
17
|
+
userId = [userId];
|
|
18
|
+
const params = {
|
|
19
|
+
fids: userId,
|
|
20
|
+
};
|
|
21
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
22
|
+
if (!encryptedParams)
|
|
23
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
24
|
+
const response = await utils.request(serviceURL, {
|
|
25
|
+
method: "POST",
|
|
26
|
+
body: new URLSearchParams({
|
|
27
|
+
params: encryptedParams,
|
|
28
|
+
}),
|
|
29
|
+
});
|
|
30
|
+
return utils.resolve(response);
|
|
31
|
+
};
|
|
32
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { QuickMessage } from "../models/index.js";
|
|
2
|
+
export type GetQuickMessageListResponse = {
|
|
3
|
+
cursor: number;
|
|
4
|
+
version: number;
|
|
5
|
+
items: QuickMessage[];
|
|
6
|
+
};
|
|
7
|
+
export declare const getQuickMessageListFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => () => Promise<GetQuickMessageListResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getQuickMessageListFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getQuickMessageListFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.quick_message[0]}/api/quickmessage/list`);
|
|
8
|
+
/**
|
|
9
|
+
* Get quick message list
|
|
10
|
+
*
|
|
11
|
+
* @throws {ZaloApiError}
|
|
12
|
+
*/
|
|
13
|
+
return async function getQuickMessageList() {
|
|
14
|
+
const params = {
|
|
15
|
+
version: 0,
|
|
16
|
+
lang: 0,
|
|
17
|
+
imei: ctx.imei,
|
|
18
|
+
};
|
|
19
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
20
|
+
if (!encryptedParams)
|
|
21
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
22
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
23
|
+
method: "GET",
|
|
24
|
+
});
|
|
25
|
+
return utils.resolve(response);
|
|
26
|
+
};
|
|
27
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type GetRelatedFriendGroupResponse = {
|
|
2
|
+
groupRelateds: {
|
|
3
|
+
[friendId: string]: string[];
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
export declare const getRelatedFriendGroupFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => (friendId: string | string[]) => Promise<GetRelatedFriendGroupResponse>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRelatedFriendGroupFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getRelatedFriendGroupFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend[0]}/api/friend/group/related`);
|
|
8
|
+
/**
|
|
9
|
+
* Get related friend group
|
|
10
|
+
*
|
|
11
|
+
* @param friendId friend ids
|
|
12
|
+
*
|
|
13
|
+
* @note this API is used for zBusiness
|
|
14
|
+
* @throws {ZaloApiError}
|
|
15
|
+
*/
|
|
16
|
+
return async function getRelatedFriendGroup(friendId) {
|
|
17
|
+
const friendIds = Array.isArray(friendId) ? friendId : [friendId];
|
|
18
|
+
const params = {
|
|
19
|
+
friend_ids: JSON.stringify(friendIds),
|
|
20
|
+
imei: ctx.imei,
|
|
21
|
+
};
|
|
22
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
23
|
+
if (!encryptedParams)
|
|
24
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
25
|
+
const response = await utils.request(serviceURL, {
|
|
26
|
+
method: "POST",
|
|
27
|
+
body: new URLSearchParams({
|
|
28
|
+
params: encryptedParams,
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
return utils.resolve(response);
|
|
32
|
+
};
|
|
33
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReminderFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getReminderFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group_board[0]}/api/board/topic/getReminder`);
|
|
8
|
+
/**
|
|
9
|
+
* Get reminder details from a group
|
|
10
|
+
*
|
|
11
|
+
* @param reminderId Reminder ID
|
|
12
|
+
*
|
|
13
|
+
* @throws {ZaloApiError}
|
|
14
|
+
*/
|
|
15
|
+
return async function getReminder(reminderId) {
|
|
16
|
+
const params = {
|
|
17
|
+
eventId: reminderId,
|
|
18
|
+
imei: ctx.imei,
|
|
19
|
+
};
|
|
20
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
21
|
+
if (!encryptedParams)
|
|
22
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
23
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
24
|
+
method: "GET",
|
|
25
|
+
});
|
|
26
|
+
return utils.resolve(response);
|
|
27
|
+
};
|
|
28
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type GetReminderResponsesResponse = {
|
|
2
|
+
rejectMember: string[];
|
|
3
|
+
acceptMember: string[];
|
|
4
|
+
};
|
|
5
|
+
export declare const getReminderResponsesFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => (reminderId: string) => Promise<GetReminderResponsesResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReminderResponsesFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getReminderResponsesFactory = (0, utils_js_1.apiFactory)()((api, _ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.group_board[0]}/api/board/topic/listResponseEvent`);
|
|
8
|
+
/**
|
|
9
|
+
* Get reminder responses
|
|
10
|
+
*
|
|
11
|
+
* @param reminderId reminder id
|
|
12
|
+
*
|
|
13
|
+
* @throws {ZaloApiError}
|
|
14
|
+
*/
|
|
15
|
+
return async function getReminderResponses(reminderId) {
|
|
16
|
+
const params = {
|
|
17
|
+
eventId: reminderId,
|
|
18
|
+
};
|
|
19
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
20
|
+
if (!encryptedParams)
|
|
21
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
22
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
23
|
+
method: "GET",
|
|
24
|
+
});
|
|
25
|
+
return utils.resolve(response);
|
|
26
|
+
};
|
|
27
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ZBusinessPackage } from "../models/ZBusiness.js";
|
|
2
|
+
export type SentFriendRequestInfo = {
|
|
3
|
+
userId: string;
|
|
4
|
+
zaloName: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
avatar: string;
|
|
7
|
+
globalId: string;
|
|
8
|
+
bizPkg: ZBusinessPackage;
|
|
9
|
+
fReqInfo: {
|
|
10
|
+
message: string;
|
|
11
|
+
src: number;
|
|
12
|
+
time: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type GetSentFriendRequestResponse = {
|
|
16
|
+
[userId: string]: SentFriendRequestInfo;
|
|
17
|
+
};
|
|
18
|
+
export declare const getSentFriendRequestFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => () => Promise<GetSentFriendRequestResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSentFriendRequestFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getSentFriendRequestFactory = (0, utils_js_1.apiFactory)()((api, ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend[0]}/api/friend/requested/list`);
|
|
8
|
+
/**
|
|
9
|
+
* Get friend requested
|
|
10
|
+
*
|
|
11
|
+
* @note Zalo might throw an error with code 112 if you have no friend requests.
|
|
12
|
+
*
|
|
13
|
+
* @throws {ZaloApiError}
|
|
14
|
+
*/
|
|
15
|
+
return async function getSentFriendRequest() {
|
|
16
|
+
const params = {
|
|
17
|
+
imei: ctx.imei,
|
|
18
|
+
};
|
|
19
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
20
|
+
if (!encryptedParams)
|
|
21
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
22
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
23
|
+
method: "GET",
|
|
24
|
+
});
|
|
25
|
+
return utils.resolve(response);
|
|
26
|
+
};
|
|
27
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSettingsFactory = void 0;
|
|
4
|
+
const ZaloApiError_js_1 = require("../Errors/ZaloApiError.js");
|
|
5
|
+
const utils_js_1 = require("../utils.js");
|
|
6
|
+
exports.getSettingsFactory = (0, utils_js_1.apiFactory)()((_api, _ctx, utils) => {
|
|
7
|
+
const serviceURL = utils.makeURL(`https://wpa.chat.zalo.me/api/setting/me`);
|
|
8
|
+
/**
|
|
9
|
+
* Get my account settings
|
|
10
|
+
*
|
|
11
|
+
* @throws {ZaloApiError}
|
|
12
|
+
*/
|
|
13
|
+
return async function getSettings() {
|
|
14
|
+
const params = {};
|
|
15
|
+
const encryptedParams = utils.encodeAES(JSON.stringify(params));
|
|
16
|
+
if (!encryptedParams)
|
|
17
|
+
throw new ZaloApiError_js_1.ZaloApiError("Failed to encrypt params");
|
|
18
|
+
const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
|
|
19
|
+
method: "GET",
|
|
20
|
+
});
|
|
21
|
+
return utils.resolve(response);
|
|
22
|
+
};
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getStickersFactory: (ctx: import("../context.js").ContextBase, api: import("../apis.js").API) => (keyword: string) => Promise<number[]>;
|