@softtynet/zca-js 2.1.5 → 2.1.9

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/dist/apis.js CHANGED
@@ -1,299 +1,299 @@
1
1
  import { Listener } from "./apis/listen.js";
2
- import { getListReminderFactory } from "./apis/getListReminder.js";
3
- import { removeUserFromGroupFactory } from "./apis/removeUserFromGroup.js";
4
- import { createReminderFactory } from "./apis/createReminder.js";
5
- import { sendReportFactory } from "./apis/sendReport.js";
6
- import { getGroupInviteBoxListFactory } from "./apis/getGroupInviteBoxList.js";
7
- import { setMuteFactory } from "./apis/setMute.js";
8
- import { getListBoardFactory } from "./apis/getListBoard.js";
9
- import { deleteChatFactory } from "./apis/deleteChat.js";
10
- import { changeGroupNameFactory } from "./apis/changeGroupName.js";
11
- import { updateGroupSettingsFactory } from "./apis/updateGroupSettings.js";
2
+ import { acceptFriendRequestFactory } from "./apis/acceptFriendRequest.js";
3
+ import { addGroupBlockedMemberFactory } from "./apis/addGroupBlockedMember.js";
4
+ import { addGroupDeputyFactory } from "./apis/addGroupDeputy.js";
12
5
  import { addPollOptionsFactory } from "./apis/addPollOptions.js";
13
- import { getReminderResponsesFactory } from "./apis/getReminderResponses.js";
14
- import { getMuteFactory } from "./apis/getMute.js";
15
- import { parseLinkFactory } from "./apis/parseLink.js";
6
+ import { addQuickMessageFactory } from "./apis/addQuickMessage.js";
7
+ import { addReactionFactory } from "./apis/addReaction.js";
8
+ import { addUnreadMarkFactory } from "./apis/addUnreadMark.js";
9
+ import { addUserToGroupFactory } from "./apis/addUserToGroup.js";
10
+ import { blockUserFactory } from "./apis/blockUser.js";
11
+ import { blockViewFeedFactory } from "./apis/blockViewFeed.js";
12
+ import { changeAccountAvatarFactory } from "./apis/changeAccountAvatar.js";
13
+ import { changeFriendAliasFactory } from "./apis/changeFriendAlias.js";
14
+ import { changeGroupAvatarFactory } from "./apis/changeGroupAvatar.js";
15
+ import { changeGroupNameFactory } from "./apis/changeGroupName.js";
16
16
  import { changeGroupOwnerFactory } from "./apis/changeGroupOwner.js";
17
- import { uploadAttachmentFactory } from "./apis/uploadAttachment.js";
18
- import { getProductCatalogListFactory } from "./apis/getProductCatalogList.js";
17
+ import { createAutoReplyFactory } from "./apis/createAutoReply.js";
18
+ import { createCatalogFactory } from "./apis/createCatalog.js";
19
+ import { createGroupFactory } from "./apis/createGroup.js";
20
+ import { createNoteFactory } from "./apis/createNote.js";
21
+ import { createPollFactory } from "./apis/createPoll.js";
22
+ import { createProductCatalogFactory } from "./apis/createProductCatalog.js";
23
+ import { createReminderFactory } from "./apis/createReminder.js";
24
+ import { deleteAutoReplyFactory } from "./apis/deleteAutoReply.js";
25
+ import { deleteAvatarFactory } from "./apis/deleteAvatar.js";
19
26
  import { deleteCatalogFactory } from "./apis/deleteCatalog.js";
20
- import { lastOnlineFactory } from "./apis/lastOnline.js";
21
- import { getGroupLinkInfoFactory } from "./apis/getGroupLinkInfo.js";
22
- import { forwardMessageFactory } from "./apis/forwardMessage.js";
23
- import { getCookieFactory } from "./apis/getCookie.js";
24
- import { updateAutoReplyFactory } from "./apis/updateAutoReply.js";
25
- import { changeFriendAliasFactory } from "./apis/changeFriendAlias.js";
26
- import { findUserFactory } from "./apis/findUser.js";
27
- import { editReminderFactory } from "./apis/editReminder.js";
28
- import { reuseAvatarFactory } from "./apis/reuseAvatar.js";
29
- import { getGroupChatHistoryFactory } from "./apis/getGroupChatHistory.js";
30
- import { getFriendOnlinesFactory } from "./apis/getFriendOnlines.js";
31
- import { uploadProductPhotoFactory } from "./apis/uploadProductPhoto.js";
32
- import { sendBankCardFactory } from "./apis/sendBankCard.js";
33
- import { getGroupInfoFactory } from "./apis/getGroupInfo.js";
27
+ import { deleteChatFactory } from "./apis/deleteChat.js";
28
+ import { deleteGroupInviteBoxFactory } from "./apis/deleteGroupInviteBox.js";
34
29
  import { deleteMessageFactory } from "./apis/deleteMessage.js";
35
- import { votePollFactory } from "./apis/votePoll.js";
36
- import { sendFriendRequestFactory } from "./apis/sendFriendRequest.js";
37
- import { resetHiddenConversPinFactory } from "./apis/resetHiddenConversPin.js";
38
- import { addUserToGroupFactory } from "./apis/addUserToGroup.js";
39
30
  import { deleteProductCatalogFactory } from "./apis/deleteProductCatalog.js";
40
- import { getOwnIdFactory } from "./apis/getOwnId.js";
41
- import { undoFactory } from "./apis/undo.js";
42
- import { joinGroupInviteBoxFactory } from "./apis/joinGroupInviteBox.js";
43
- import { deleteAutoReplyFactory } from "./apis/deleteAutoReply.js";
44
- import { setPinnedConversationsFactory } from "./apis/setPinnedConversations.js";
45
- import { undoFriendRequestFactory } from "./apis/undoFriendRequest.js";
46
- import { getPendingGroupMembersFactory } from "./apis/getPendingGroupMembers.js";
47
- import { removeGroupDeputyFactory } from "./apis/removeGroupDeputy.js";
48
- import { getAllGroupsFactory } from "./apis/getAllGroups.js";
49
- import { changeGroupAvatarFactory } from "./apis/changeGroupAvatar.js";
50
- import { updateQuickMessageFactory } from "./apis/updateQuickMessage.js";
51
- import { reviewPendingMemberRequestFactory } from "./apis/reviewPendingMemberRequest.js";
52
- import { addGroupDeputyFactory } from "./apis/addGroupDeputy.js";
53
- import { rejectFriendRequestFactory } from "./apis/rejectFriendRequest.js";
54
- import { createPollFactory } from "./apis/createPoll.js";
55
- import { sendLinkFactory } from "./apis/sendLink.js";
56
- import { createAutoReplyFactory } from "./apis/createAutoReply.js";
57
- import { setHiddenConversationsFactory } from "./apis/setHiddenConversations.js";
58
- import { getContextFactory } from "./apis/getContext.js";
59
- import { joinGroupLinkFactory } from "./apis/joinGroupLink.js";
60
- import { getGroupBlockedMemberFactory } from "./apis/getGroupBlockedMember.js";
61
- import { updateSettingsFactory } from "./apis/updateSettings.js";
62
- import { sendDeliveredEventFactory } from "./apis/sendDeliveredEvent.js";
63
- import { getAvatarListFactory } from "./apis/getAvatarList.js";
31
+ import { disableGroupLinkFactory } from "./apis/disableGroupLink.js";
64
32
  import { disperseGroupFactory } from "./apis/disperseGroup.js";
65
- import { createNoteFactory } from "./apis/createNote.js";
66
- import { unblockUserFactory } from "./apis/unblockUser.js";
67
- import { lockPollFactory } from "./apis/lockPoll.js";
68
33
  import { editNoteFactory } from "./apis/editNote.js";
69
- import { createProductCatalogFactory } from "./apis/createProductCatalog.js";
70
- import { changeAccountAvatarFactory } from "./apis/changeAccountAvatar.js";
71
- import { updateLangFactory } from "./apis/updateLang.js";
34
+ import { editReminderFactory } from "./apis/editReminder.js";
35
+ import { enableGroupLinkFactory } from "./apis/enableGroupLink.js";
36
+ import { fetchAccountInfoFactory } from "./apis/fetchAccountInfo.js";
37
+ import { findUserFactory } from "./apis/findUser.js";
38
+ import { findUserByUsernameFactory } from "./apis/findUserByUsername.js";
39
+ import { forwardMessageFactory } from "./apis/forwardMessage.js";
40
+ import { getAliasListFactory } from "./apis/getAliasList.js";
41
+ import { getAllFriendsFactory } from "./apis/getAllFriends.js";
42
+ import { getAllGroupsFactory } from "./apis/getAllGroups.js";
72
43
  import { getArchivedChatListFactory } from "./apis/getArchivedChatList.js";
73
- import { removeFriendAliasFactory } from "./apis/removeFriendAlias.js";
74
- import { getQRFactory } from "./apis/getQR.js";
75
- import { sendStickerFactory } from "./apis/sendSticker.js";
44
+ import { getAutoDeleteChatFactory } from "./apis/getAutoDeleteChat.js";
45
+ import { getAutoReplyListFactory } from "./apis/getAutoReplyList.js";
46
+ import { getAvatarListFactory } from "./apis/getAvatarList.js";
47
+ import { getAvatarUrlProfileFactory } from "./apis/getAvatarUrlProfile.js";
48
+ import { getBizAccountFactory } from "./apis/getBizAccount.js";
49
+ import { getCatalogListFactory } from "./apis/getCatalogList.js";
50
+ import { getCloseFriendsFactory } from "./apis/getCloseFriends.js";
51
+ import { getContextFactory } from "./apis/getContext.js";
52
+ import { getCookieFactory } from "./apis/getCookie.js";
53
+ import { getFriendBoardListFactory } from "./apis/getFriendBoardList.js";
54
+ import { getFriendOnlinesFactory } from "./apis/getFriendOnlines.js";
76
55
  import { getFriendRecommendationsFactory } from "./apis/getFriendRecommendations.js";
77
- import { updateLabelsFactory } from "./apis/updateLabels.js";
78
- import { updateActiveStatusFactory } from "./apis/updateActiveStatus.js";
79
- import { upgradeGroupToCommunityFactory } from "./apis/upgradeGroupToCommunity.js";
80
- import { sendTypingEventFactory } from "./apis/sendTypingEvent.js";
81
- import { removeGroupBlockedMemberFactory } from "./apis/removeGroupBlockedMember.js";
56
+ import { getFriendRequestStatusFactory } from "./apis/getFriendRequestStatus.js";
82
57
  import { getFullAvatarFactory } from "./apis/getFullAvatar.js";
83
- import { getAutoDeleteChatFactory } from "./apis/getAutoDeleteChat.js";
84
- import { getAliasListFactory } from "./apis/getAliasList.js";
58
+ import { getGroupBlockedMemberFactory } from "./apis/getGroupBlockedMember.js";
59
+ import { getGroupChatHistoryFactory } from "./apis/getGroupChatHistory.js";
60
+ import { getGroupInfoFactory } from "./apis/getGroupInfo.js";
61
+ import { getGroupInviteBoxInfoFactory } from "./apis/getGroupInviteBoxInfo.js";
62
+ import { getGroupInviteBoxListFactory } from "./apis/getGroupInviteBoxList.js";
63
+ import { getGroupLinkDetailFactory } from "./apis/getGroupLinkDetail.js";
64
+ import { getGroupLinkInfoFactory } from "./apis/getGroupLinkInfo.js";
65
+ import { getGroupMembersInfoFactory } from "./apis/getGroupMembersInfo.js";
66
+ import { getHiddenConversationsFactory } from "./apis/getHiddenConversations.js";
85
67
  import { getLabelsFactory } from "./apis/getLabels.js";
86
- import { addQuickMessageFactory } from "./apis/addQuickMessage.js";
68
+ import { getListBoardFactory } from "./apis/getListBoard.js";
69
+ import { getListReminderFactory } from "./apis/getListReminder.js";
70
+ import { getMultiUsersByPhonesFactory } from "./apis/getMultiUsersByPhones.js";
71
+ import { getMuteFactory } from "./apis/getMute.js";
72
+ import { getOwnIdFactory } from "./apis/getOwnId.js";
73
+ import { getPendingGroupMembersFactory } from "./apis/getPendingGroupMembers.js";
87
74
  import { getPinConversationsFactory } from "./apis/getPinConversations.js";
88
- import { findUserByUsernameFactory } from "./apis/findUserByUsername.js";
89
- import { sendVoiceFactory } from "./apis/sendVoice.js";
90
- import { keepAliveFactory } from "./apis/keepAlive.js";
91
- import { sendSeenEventFactory } from "./apis/sendSeenEvent.js";
92
- import { leaveGroupFactory } from "./apis/leaveGroup.js";
93
- import { acceptFriendRequestFactory } from "./apis/acceptFriendRequest.js";
75
+ import { getPollDetailFactory } from "./apis/getPollDetail.js";
76
+ import { getProductCatalogListFactory } from "./apis/getProductCatalogList.js";
77
+ import { getQRFactory } from "./apis/getQR.js";
78
+ import { getQuickMessageListFactory } from "./apis/getQuickMessageList.js";
79
+ import { getRelatedFriendGroupFactory } from "./apis/getRelatedFriendGroup.js";
94
80
  import { getReminderFactory } from "./apis/getReminder.js";
95
- import { updateCatalogFactory } from "./apis/updateCatalog.js";
96
- import { createGroupFactory } from "./apis/createGroup.js";
81
+ import { getReminderResponsesFactory } from "./apis/getReminderResponses.js";
97
82
  import { getSentFriendRequestFactory } from "./apis/getSentFriendRequest.js";
98
- import { deleteAvatarFactory } from "./apis/deleteAvatar.js";
99
- import { getUnreadMarkFactory } from "./apis/getUnreadMark.js";
83
+ import { getSettingsFactory } from "./apis/getSettings.js";
100
84
  import { getStickerCategoryDetailFactory } from "./apis/getStickerCategoryDetail.js";
101
- import { getAutoReplyListFactory } from "./apis/getAutoReplyList.js";
102
- import { getAllFriendsFactory } from "./apis/getAllFriends.js";
103
- import { getGroupLinkDetailFactory } from "./apis/getGroupLinkDetail.js";
104
- import { createCatalogFactory } from "./apis/createCatalog.js";
105
- import { enableGroupLinkFactory } from "./apis/enableGroupLink.js";
106
- import { getPollDetailFactory } from "./apis/getPollDetail.js";
107
- import { blockViewFeedFactory } from "./apis/blockViewFeed.js";
108
- import { updateProductCatalogFactory } from "./apis/updateProductCatalog.js";
109
- import { sendVideoFactory } from "./apis/sendVideo.js";
110
- import { getCatalogListFactory } from "./apis/getCatalogList.js";
111
- import { searchStickerFactory } from "./apis/searchSticker.js";
85
+ import { getStickersFactory } from "./apis/getStickers.js";
86
+ import { getStickersDetailFactory } from "./apis/getStickersDetail.js";
87
+ import { getUnreadMarkFactory } from "./apis/getUnreadMark.js";
112
88
  import { getUserInfoFactory } from "./apis/getUserInfo.js";
113
- import { sharePollFactory } from "./apis/sharePoll.js";
114
- import { getGroupMembersInfoFactory } from "./apis/getGroupMembersInfo.js";
115
- import { getMultiUsersByPhonesFactory } from "./apis/getMultiUsersByPhones.js";
116
- import { removeUnreadMarkFactory } from "./apis/removeUnreadMark.js";
117
- import { getFriendBoardListFactory } from "./apis/getFriendBoardList.js";
118
- import { addReactionFactory } from "./apis/addReaction.js";
89
+ import { inviteUserToGroupsFactory } from "./apis/inviteUserToGroups.js";
90
+ import { joinGroupInviteBoxFactory } from "./apis/joinGroupInviteBox.js";
91
+ import { joinGroupLinkFactory } from "./apis/joinGroupLink.js";
92
+ import { keepAliveFactory } from "./apis/keepAlive.js";
93
+ import { lastOnlineFactory } from "./apis/lastOnline.js";
94
+ import { leaveGroupFactory } from "./apis/leaveGroup.js";
95
+ import { lockPollFactory } from "./apis/lockPoll.js";
96
+ import { parseLinkFactory } from "./apis/parseLink.js";
97
+ import { rejectFriendRequestFactory } from "./apis/rejectFriendRequest.js";
119
98
  import { removeFriendFactory } from "./apis/removeFriend.js";
120
- import { updateProfileBioFactory } from "./apis/updateProfileBio.js";
121
- import { updateAutoDeleteChatFactory } from "./apis/updateAutoDeleteChat.js";
122
- import { updateHiddenConversPinFactory } from "./apis/updateHiddenConversPin.js";
99
+ import { removeFriendAliasFactory } from "./apis/removeFriendAlias.js";
100
+ import { removeGroupBlockedMemberFactory } from "./apis/removeGroupBlockedMember.js";
101
+ import { removeGroupDeputyFactory } from "./apis/removeGroupDeputy.js";
102
+ import { removeQuickMessageFactory } from "./apis/removeQuickMessage.js";
103
+ import { removeReminderFactory } from "./apis/removeReminder.js";
104
+ import { removeUnreadMarkFactory } from "./apis/removeUnreadMark.js";
105
+ import { removeUserFromGroupFactory } from "./apis/removeUserFromGroup.js";
106
+ import { resetHiddenConversPinFactory } from "./apis/resetHiddenConversPin.js";
107
+ import { reuseAvatarFactory } from "./apis/reuseAvatar.js";
108
+ import { reviewPendingMemberRequestFactory } from "./apis/reviewPendingMemberRequest.js";
109
+ import { searchStickerFactory } from "./apis/searchSticker.js";
110
+ import { sendBankCardFactory } from "./apis/sendBankCard.js";
123
111
  import { sendCardFactory } from "./apis/sendCard.js";
124
- import { getRelatedFriendGroupFactory } from "./apis/getRelatedFriendGroup.js";
125
- import { inviteUserToGroupsFactory } from "./apis/inviteUserToGroups.js";
126
- import { blockUserFactory } from "./apis/blockUser.js";
127
- import { getAvatarUrlProfileFactory } from "./apis/getAvatarUrlProfile.js";
128
- import { updateArchivedChatListFactory } from "./apis/updateArchivedChatList.js";
112
+ import { sendDeliveredEventFactory } from "./apis/sendDeliveredEvent.js";
113
+ import { sendFriendRequestFactory } from "./apis/sendFriendRequest.js";
114
+ import { sendLinkFactory } from "./apis/sendLink.js";
129
115
  import { sendMessageFactory } from "./apis/sendMessage.js";
116
+ import { sendReportFactory } from "./apis/sendReport.js";
117
+ import { sendSeenEventFactory } from "./apis/sendSeenEvent.js";
118
+ import { sendStickerFactory } from "./apis/sendSticker.js";
119
+ import { sendTypingEventFactory } from "./apis/sendTypingEvent.js";
120
+ import { sendVideoFactory } from "./apis/sendVideo.js";
121
+ import { sendVoiceFactory } from "./apis/sendVoice.js";
122
+ import { setHiddenConversationsFactory } from "./apis/setHiddenConversations.js";
123
+ import { setMuteFactory } from "./apis/setMute.js";
124
+ import { setPinnedConversationsFactory } from "./apis/setPinnedConversations.js";
125
+ import { sharePollFactory } from "./apis/sharePoll.js";
126
+ import { unblockUserFactory } from "./apis/unblockUser.js";
127
+ import { undoFactory } from "./apis/undo.js";
128
+ import { undoFriendRequestFactory } from "./apis/undoFriendRequest.js";
129
+ import { updateActiveStatusFactory } from "./apis/updateActiveStatus.js";
130
+ import { updateArchivedChatListFactory } from "./apis/updateArchivedChatList.js";
131
+ import { updateAutoDeleteChatFactory } from "./apis/updateAutoDeleteChat.js";
132
+ import { updateAutoReplyFactory } from "./apis/updateAutoReply.js";
133
+ import { updateCatalogFactory } from "./apis/updateCatalog.js";
134
+ import { updateGroupSettingsFactory } from "./apis/updateGroupSettings.js";
135
+ import { updateHiddenConversPinFactory } from "./apis/updateHiddenConversPin.js";
136
+ import { updateLabelsFactory } from "./apis/updateLabels.js";
137
+ import { updateLangFactory } from "./apis/updateLang.js";
138
+ import { updateProductCatalogFactory } from "./apis/updateProductCatalog.js";
130
139
  import { updateProfileFactory } from "./apis/updateProfile.js";
131
- import { getHiddenConversationsFactory } from "./apis/getHiddenConversations.js";
132
- import { getBizAccountFactory } from "./apis/getBizAccount.js";
133
- import { getFriendRequestStatusFactory } from "./apis/getFriendRequestStatus.js";
134
- import { fetchAccountInfoFactory } from "./apis/fetchAccountInfo.js";
135
- import { disableGroupLinkFactory } from "./apis/disableGroupLink.js";
136
- import { removeQuickMessageFactory } from "./apis/removeQuickMessage.js";
137
- import { removeReminderFactory } from "./apis/removeReminder.js";
138
- import { deleteGroupInviteBoxFactory } from "./apis/deleteGroupInviteBox.js";
139
- import { getCloseFriendsFactory } from "./apis/getCloseFriends.js";
140
- import { addUnreadMarkFactory } from "./apis/addUnreadMark.js";
141
- import { getQuickMessageListFactory } from "./apis/getQuickMessageList.js";
142
- import { getGroupInviteBoxInfoFactory } from "./apis/getGroupInviteBoxInfo.js";
143
- import { getSettingsFactory } from "./apis/getSettings.js";
144
- import { addGroupBlockedMemberFactory } from "./apis/addGroupBlockedMember.js";
145
- import { getStickersFactory } from "./apis/getStickers.js";
146
- import { getStickersDetailFactory } from "./apis/getStickersDetail.js";
140
+ import { updateProfileBioFactory } from "./apis/updateProfileBio.js";
141
+ import { updateQuickMessageFactory } from "./apis/updateQuickMessage.js";
142
+ import { updateSettingsFactory } from "./apis/updateSettings.js";
143
+ import { upgradeGroupToCommunityFactory } from "./apis/upgradeGroupToCommunity.js";
144
+ import { uploadAttachmentFactory } from "./apis/uploadAttachment.js";
145
+ import { uploadProductPhotoFactory } from "./apis/uploadProductPhoto.js";
146
+ import { votePollFactory } from "./apis/votePoll.js";
147
147
  import { customFactory } from "./apis/custom.js";
148
148
  export class API {
149
149
  constructor(ctx, zpwServiceMap, wsUrls) {
150
150
  this.zpwServiceMap = zpwServiceMap;
151
151
  this.listener = new Listener(ctx, wsUrls);
152
- this.getListReminder = getListReminderFactory(ctx, this);
153
- this.removeUserFromGroup = removeUserFromGroupFactory(ctx, this);
154
- this.createReminder = createReminderFactory(ctx, this);
155
- this.sendReport = sendReportFactory(ctx, this);
156
- this.getGroupInviteBoxList = getGroupInviteBoxListFactory(ctx, this);
157
- this.setMute = setMuteFactory(ctx, this);
158
- this.getListBoard = getListBoardFactory(ctx, this);
159
- this.deleteChat = deleteChatFactory(ctx, this);
160
- this.changeGroupName = changeGroupNameFactory(ctx, this);
161
- this.updateGroupSettings = updateGroupSettingsFactory(ctx, this);
152
+ this.acceptFriendRequest = acceptFriendRequestFactory(ctx, this);
153
+ this.addGroupBlockedMember = addGroupBlockedMemberFactory(ctx, this);
154
+ this.addGroupDeputy = addGroupDeputyFactory(ctx, this);
162
155
  this.addPollOptions = addPollOptionsFactory(ctx, this);
163
- this.getReminderResponses = getReminderResponsesFactory(ctx, this);
164
- this.getMute = getMuteFactory(ctx, this);
165
- this.parseLink = parseLinkFactory(ctx, this);
156
+ this.addQuickMessage = addQuickMessageFactory(ctx, this);
157
+ this.addReaction = addReactionFactory(ctx, this);
158
+ this.addUnreadMark = addUnreadMarkFactory(ctx, this);
159
+ this.addUserToGroup = addUserToGroupFactory(ctx, this);
160
+ this.blockUser = blockUserFactory(ctx, this);
161
+ this.blockViewFeed = blockViewFeedFactory(ctx, this);
162
+ this.changeAccountAvatar = changeAccountAvatarFactory(ctx, this);
163
+ this.changeFriendAlias = changeFriendAliasFactory(ctx, this);
164
+ this.changeGroupAvatar = changeGroupAvatarFactory(ctx, this);
165
+ this.changeGroupName = changeGroupNameFactory(ctx, this);
166
166
  this.changeGroupOwner = changeGroupOwnerFactory(ctx, this);
167
- this.uploadAttachment = uploadAttachmentFactory(ctx, this);
168
- this.getProductCatalogList = getProductCatalogListFactory(ctx, this);
167
+ this.createAutoReply = createAutoReplyFactory(ctx, this);
168
+ this.createCatalog = createCatalogFactory(ctx, this);
169
+ this.createGroup = createGroupFactory(ctx, this);
170
+ this.createNote = createNoteFactory(ctx, this);
171
+ this.createPoll = createPollFactory(ctx, this);
172
+ this.createProductCatalog = createProductCatalogFactory(ctx, this);
173
+ this.createReminder = createReminderFactory(ctx, this);
174
+ this.deleteAutoReply = deleteAutoReplyFactory(ctx, this);
175
+ this.deleteAvatar = deleteAvatarFactory(ctx, this);
169
176
  this.deleteCatalog = deleteCatalogFactory(ctx, this);
170
- this.lastOnline = lastOnlineFactory(ctx, this);
171
- this.getGroupLinkInfo = getGroupLinkInfoFactory(ctx, this);
172
- this.forwardMessage = forwardMessageFactory(ctx, this);
173
- this.getCookie = getCookieFactory(ctx, this);
174
- this.updateAutoReply = updateAutoReplyFactory(ctx, this);
175
- this.changeFriendAlias = changeFriendAliasFactory(ctx, this);
176
- this.findUser = findUserFactory(ctx, this);
177
- this.editReminder = editReminderFactory(ctx, this);
178
- this.reuseAvatar = reuseAvatarFactory(ctx, this);
179
- this.getGroupChatHistory = getGroupChatHistoryFactory(ctx, this);
180
- this.getFriendOnlines = getFriendOnlinesFactory(ctx, this);
181
- this.uploadProductPhoto = uploadProductPhotoFactory(ctx, this);
182
- this.sendBankCard = sendBankCardFactory(ctx, this);
183
- this.getGroupInfo = getGroupInfoFactory(ctx, this);
177
+ this.deleteChat = deleteChatFactory(ctx, this);
178
+ this.deleteGroupInviteBox = deleteGroupInviteBoxFactory(ctx, this);
184
179
  this.deleteMessage = deleteMessageFactory(ctx, this);
185
- this.votePoll = votePollFactory(ctx, this);
186
- this.sendFriendRequest = sendFriendRequestFactory(ctx, this);
187
- this.resetHiddenConversPin = resetHiddenConversPinFactory(ctx, this);
188
- this.addUserToGroup = addUserToGroupFactory(ctx, this);
189
180
  this.deleteProductCatalog = deleteProductCatalogFactory(ctx, this);
190
- this.getOwnId = getOwnIdFactory(ctx, this);
191
- this.undo = undoFactory(ctx, this);
192
- this.joinGroupInviteBox = joinGroupInviteBoxFactory(ctx, this);
193
- this.deleteAutoReply = deleteAutoReplyFactory(ctx, this);
194
- this.setPinnedConversations = setPinnedConversationsFactory(ctx, this);
195
- this.undoFriendRequest = undoFriendRequestFactory(ctx, this);
196
- this.getPendingGroupMembers = getPendingGroupMembersFactory(ctx, this);
197
- this.removeGroupDeputy = removeGroupDeputyFactory(ctx, this);
198
- this.getAllGroups = getAllGroupsFactory(ctx, this);
199
- this.changeGroupAvatar = changeGroupAvatarFactory(ctx, this);
200
- this.updateQuickMessage = updateQuickMessageFactory(ctx, this);
201
- this.reviewPendingMemberRequest = reviewPendingMemberRequestFactory(ctx, this);
202
- this.addGroupDeputy = addGroupDeputyFactory(ctx, this);
203
- this.rejectFriendRequest = rejectFriendRequestFactory(ctx, this);
204
- this.createPoll = createPollFactory(ctx, this);
205
- this.sendLink = sendLinkFactory(ctx, this);
206
- this.createAutoReply = createAutoReplyFactory(ctx, this);
207
- this.setHiddenConversations = setHiddenConversationsFactory(ctx, this);
208
- this.getContext = getContextFactory(ctx, this);
209
- this.joinGroupLink = joinGroupLinkFactory(ctx, this);
210
- this.getGroupBlockedMember = getGroupBlockedMemberFactory(ctx, this);
211
- this.updateSettings = updateSettingsFactory(ctx, this);
212
- this.sendDeliveredEvent = sendDeliveredEventFactory(ctx, this);
213
- this.getAvatarList = getAvatarListFactory(ctx, this);
181
+ this.disableGroupLink = disableGroupLinkFactory(ctx, this);
214
182
  this.disperseGroup = disperseGroupFactory(ctx, this);
215
- this.createNote = createNoteFactory(ctx, this);
216
- this.unblockUser = unblockUserFactory(ctx, this);
217
- this.lockPoll = lockPollFactory(ctx, this);
218
183
  this.editNote = editNoteFactory(ctx, this);
219
- this.createProductCatalog = createProductCatalogFactory(ctx, this);
220
- this.changeAccountAvatar = changeAccountAvatarFactory(ctx, this);
221
- this.updateLang = updateLangFactory(ctx, this);
184
+ this.editReminder = editReminderFactory(ctx, this);
185
+ this.enableGroupLink = enableGroupLinkFactory(ctx, this);
186
+ this.fetchAccountInfo = fetchAccountInfoFactory(ctx, this);
187
+ this.findUser = findUserFactory(ctx, this);
188
+ this.findUserByUsername = findUserByUsernameFactory(ctx, this);
189
+ this.forwardMessage = forwardMessageFactory(ctx, this);
190
+ this.getAliasList = getAliasListFactory(ctx, this);
191
+ this.getAllFriends = getAllFriendsFactory(ctx, this);
192
+ this.getAllGroups = getAllGroupsFactory(ctx, this);
222
193
  this.getArchivedChatList = getArchivedChatListFactory(ctx, this);
223
- this.removeFriendAlias = removeFriendAliasFactory(ctx, this);
224
- this.getQR = getQRFactory(ctx, this);
225
- this.sendSticker = sendStickerFactory(ctx, this);
194
+ this.getAutoDeleteChat = getAutoDeleteChatFactory(ctx, this);
195
+ this.getAutoReplyList = getAutoReplyListFactory(ctx, this);
196
+ this.getAvatarList = getAvatarListFactory(ctx, this);
197
+ this.getAvatarUrlProfile = getAvatarUrlProfileFactory(ctx, this);
198
+ this.getBizAccount = getBizAccountFactory(ctx, this);
199
+ this.getCatalogList = getCatalogListFactory(ctx, this);
200
+ this.getCloseFriends = getCloseFriendsFactory(ctx, this);
201
+ this.getContext = getContextFactory(ctx, this);
202
+ this.getCookie = getCookieFactory(ctx, this);
203
+ this.getFriendBoardList = getFriendBoardListFactory(ctx, this);
204
+ this.getFriendOnlines = getFriendOnlinesFactory(ctx, this);
226
205
  this.getFriendRecommendations = getFriendRecommendationsFactory(ctx, this);
227
- this.updateLabels = updateLabelsFactory(ctx, this);
228
- this.updateActiveStatus = updateActiveStatusFactory(ctx, this);
229
- this.upgradeGroupToCommunity = upgradeGroupToCommunityFactory(ctx, this);
230
- this.sendTypingEvent = sendTypingEventFactory(ctx, this);
231
- this.removeGroupBlockedMember = removeGroupBlockedMemberFactory(ctx, this);
206
+ this.getFriendRequestStatus = getFriendRequestStatusFactory(ctx, this);
232
207
  this.getFullAvatar = getFullAvatarFactory(ctx, this);
233
- this.getAutoDeleteChat = getAutoDeleteChatFactory(ctx, this);
234
- this.getAliasList = getAliasListFactory(ctx, this);
208
+ this.getGroupBlockedMember = getGroupBlockedMemberFactory(ctx, this);
209
+ this.getGroupChatHistory = getGroupChatHistoryFactory(ctx, this);
210
+ this.getGroupInfo = getGroupInfoFactory(ctx, this);
211
+ this.getGroupInviteBoxInfo = getGroupInviteBoxInfoFactory(ctx, this);
212
+ this.getGroupInviteBoxList = getGroupInviteBoxListFactory(ctx, this);
213
+ this.getGroupLinkDetail = getGroupLinkDetailFactory(ctx, this);
214
+ this.getGroupLinkInfo = getGroupLinkInfoFactory(ctx, this);
215
+ this.getGroupMembersInfo = getGroupMembersInfoFactory(ctx, this);
216
+ this.getHiddenConversations = getHiddenConversationsFactory(ctx, this);
235
217
  this.getLabels = getLabelsFactory(ctx, this);
236
- this.addQuickMessage = addQuickMessageFactory(ctx, this);
218
+ this.getListBoard = getListBoardFactory(ctx, this);
219
+ this.getListReminder = getListReminderFactory(ctx, this);
220
+ this.getMultiUsersByPhones = getMultiUsersByPhonesFactory(ctx, this);
221
+ this.getMute = getMuteFactory(ctx, this);
222
+ this.getOwnId = getOwnIdFactory(ctx, this);
223
+ this.getPendingGroupMembers = getPendingGroupMembersFactory(ctx, this);
237
224
  this.getPinConversations = getPinConversationsFactory(ctx, this);
238
- this.findUserByUsername = findUserByUsernameFactory(ctx, this);
239
- this.sendVoice = sendVoiceFactory(ctx, this);
240
- this.keepAlive = keepAliveFactory(ctx, this);
241
- this.sendSeenEvent = sendSeenEventFactory(ctx, this);
242
- this.leaveGroup = leaveGroupFactory(ctx, this);
243
- this.acceptFriendRequest = acceptFriendRequestFactory(ctx, this);
225
+ this.getPollDetail = getPollDetailFactory(ctx, this);
226
+ this.getProductCatalogList = getProductCatalogListFactory(ctx, this);
227
+ this.getQR = getQRFactory(ctx, this);
228
+ this.getQuickMessageList = getQuickMessageListFactory(ctx, this);
229
+ this.getRelatedFriendGroup = getRelatedFriendGroupFactory(ctx, this);
244
230
  this.getReminder = getReminderFactory(ctx, this);
245
- this.updateCatalog = updateCatalogFactory(ctx, this);
246
- this.createGroup = createGroupFactory(ctx, this);
231
+ this.getReminderResponses = getReminderResponsesFactory(ctx, this);
247
232
  this.getSentFriendRequest = getSentFriendRequestFactory(ctx, this);
248
- this.deleteAvatar = deleteAvatarFactory(ctx, this);
249
- this.getUnreadMark = getUnreadMarkFactory(ctx, this);
233
+ this.getSettings = getSettingsFactory(ctx, this);
250
234
  this.getStickerCategoryDetail = getStickerCategoryDetailFactory(ctx, this);
251
- this.getAutoReplyList = getAutoReplyListFactory(ctx, this);
252
- this.getAllFriends = getAllFriendsFactory(ctx, this);
253
- this.getGroupLinkDetail = getGroupLinkDetailFactory(ctx, this);
254
- this.createCatalog = createCatalogFactory(ctx, this);
255
- this.enableGroupLink = enableGroupLinkFactory(ctx, this);
256
- this.getPollDetail = getPollDetailFactory(ctx, this);
257
- this.blockViewFeed = blockViewFeedFactory(ctx, this);
258
- this.updateProductCatalog = updateProductCatalogFactory(ctx, this);
259
- this.sendVideo = sendVideoFactory(ctx, this);
260
- this.getCatalogList = getCatalogListFactory(ctx, this);
261
- this.searchSticker = searchStickerFactory(ctx, this);
235
+ this.getStickers = getStickersFactory(ctx, this);
236
+ this.getStickersDetail = getStickersDetailFactory(ctx, this);
237
+ this.getUnreadMark = getUnreadMarkFactory(ctx, this);
262
238
  this.getUserInfo = getUserInfoFactory(ctx, this);
263
- this.sharePoll = sharePollFactory(ctx, this);
264
- this.getGroupMembersInfo = getGroupMembersInfoFactory(ctx, this);
265
- this.getMultiUsersByPhones = getMultiUsersByPhonesFactory(ctx, this);
266
- this.removeUnreadMark = removeUnreadMarkFactory(ctx, this);
267
- this.getFriendBoardList = getFriendBoardListFactory(ctx, this);
268
- this.addReaction = addReactionFactory(ctx, this);
239
+ this.inviteUserToGroups = inviteUserToGroupsFactory(ctx, this);
240
+ this.joinGroupInviteBox = joinGroupInviteBoxFactory(ctx, this);
241
+ this.joinGroupLink = joinGroupLinkFactory(ctx, this);
242
+ this.keepAlive = keepAliveFactory(ctx, this);
243
+ this.lastOnline = lastOnlineFactory(ctx, this);
244
+ this.leaveGroup = leaveGroupFactory(ctx, this);
245
+ this.lockPoll = lockPollFactory(ctx, this);
246
+ this.parseLink = parseLinkFactory(ctx, this);
247
+ this.rejectFriendRequest = rejectFriendRequestFactory(ctx, this);
269
248
  this.removeFriend = removeFriendFactory(ctx, this);
270
- this.updateProfileBio = updateProfileBioFactory(ctx, this);
271
- this.updateAutoDeleteChat = updateAutoDeleteChatFactory(ctx, this);
272
- this.updateHiddenConversPin = updateHiddenConversPinFactory(ctx, this);
249
+ this.removeFriendAlias = removeFriendAliasFactory(ctx, this);
250
+ this.removeGroupBlockedMember = removeGroupBlockedMemberFactory(ctx, this);
251
+ this.removeGroupDeputy = removeGroupDeputyFactory(ctx, this);
252
+ this.removeQuickMessage = removeQuickMessageFactory(ctx, this);
253
+ this.removeReminder = removeReminderFactory(ctx, this);
254
+ this.removeUnreadMark = removeUnreadMarkFactory(ctx, this);
255
+ this.removeUserFromGroup = removeUserFromGroupFactory(ctx, this);
256
+ this.resetHiddenConversPin = resetHiddenConversPinFactory(ctx, this);
257
+ this.reuseAvatar = reuseAvatarFactory(ctx, this);
258
+ this.reviewPendingMemberRequest = reviewPendingMemberRequestFactory(ctx, this);
259
+ this.searchSticker = searchStickerFactory(ctx, this);
260
+ this.sendBankCard = sendBankCardFactory(ctx, this);
273
261
  this.sendCard = sendCardFactory(ctx, this);
274
- this.getRelatedFriendGroup = getRelatedFriendGroupFactory(ctx, this);
275
- this.inviteUserToGroups = inviteUserToGroupsFactory(ctx, this);
276
- this.blockUser = blockUserFactory(ctx, this);
277
- this.getAvatarUrlProfile = getAvatarUrlProfileFactory(ctx, this);
278
- this.updateArchivedChatList = updateArchivedChatListFactory(ctx, this);
262
+ this.sendDeliveredEvent = sendDeliveredEventFactory(ctx, this);
263
+ this.sendFriendRequest = sendFriendRequestFactory(ctx, this);
264
+ this.sendLink = sendLinkFactory(ctx, this);
279
265
  this.sendMessage = sendMessageFactory(ctx, this);
266
+ this.sendReport = sendReportFactory(ctx, this);
267
+ this.sendSeenEvent = sendSeenEventFactory(ctx, this);
268
+ this.sendSticker = sendStickerFactory(ctx, this);
269
+ this.sendTypingEvent = sendTypingEventFactory(ctx, this);
270
+ this.sendVideo = sendVideoFactory(ctx, this);
271
+ this.sendVoice = sendVoiceFactory(ctx, this);
272
+ this.setHiddenConversations = setHiddenConversationsFactory(ctx, this);
273
+ this.setMute = setMuteFactory(ctx, this);
274
+ this.setPinnedConversations = setPinnedConversationsFactory(ctx, this);
275
+ this.sharePoll = sharePollFactory(ctx, this);
276
+ this.unblockUser = unblockUserFactory(ctx, this);
277
+ this.undo = undoFactory(ctx, this);
278
+ this.undoFriendRequest = undoFriendRequestFactory(ctx, this);
279
+ this.updateActiveStatus = updateActiveStatusFactory(ctx, this);
280
+ this.updateArchivedChatList = updateArchivedChatListFactory(ctx, this);
281
+ this.updateAutoDeleteChat = updateAutoDeleteChatFactory(ctx, this);
282
+ this.updateAutoReply = updateAutoReplyFactory(ctx, this);
283
+ this.updateCatalog = updateCatalogFactory(ctx, this);
284
+ this.updateGroupSettings = updateGroupSettingsFactory(ctx, this);
285
+ this.updateHiddenConversPin = updateHiddenConversPinFactory(ctx, this);
286
+ this.updateLabels = updateLabelsFactory(ctx, this);
287
+ this.updateLang = updateLangFactory(ctx, this);
288
+ this.updateProductCatalog = updateProductCatalogFactory(ctx, this);
280
289
  this.updateProfile = updateProfileFactory(ctx, this);
281
- this.getHiddenConversations = getHiddenConversationsFactory(ctx, this);
282
- this.getBizAccount = getBizAccountFactory(ctx, this);
283
- this.getFriendRequestStatus = getFriendRequestStatusFactory(ctx, this);
284
- this.fetchAccountInfo = fetchAccountInfoFactory(ctx, this);
285
- this.disableGroupLink = disableGroupLinkFactory(ctx, this);
286
- this.removeQuickMessage = removeQuickMessageFactory(ctx, this);
287
- this.removeReminder = removeReminderFactory(ctx, this);
288
- this.deleteGroupInviteBox = deleteGroupInviteBoxFactory(ctx, this);
289
- this.getCloseFriends = getCloseFriendsFactory(ctx, this);
290
- this.addUnreadMark = addUnreadMarkFactory(ctx, this);
291
- this.getQuickMessageList = getQuickMessageListFactory(ctx, this);
292
- this.getGroupInviteBoxInfo = getGroupInviteBoxInfoFactory(ctx, this);
293
- this.getSettings = getSettingsFactory(ctx, this);
294
- this.addGroupBlockedMember = addGroupBlockedMemberFactory(ctx, this);
295
- this.getStickers = getStickersFactory(ctx, this);
296
- this.getStickersDetail = getStickersDetailFactory(ctx, this);
290
+ this.updateProfileBio = updateProfileBioFactory(ctx, this);
291
+ this.updateQuickMessage = updateQuickMessageFactory(ctx, this);
292
+ this.updateSettings = updateSettingsFactory(ctx, this);
293
+ this.upgradeGroupToCommunity = upgradeGroupToCommunityFactory(ctx, this);
294
+ this.uploadAttachment = uploadAttachmentFactory(ctx, this);
295
+ this.uploadProductPhoto = uploadProductPhotoFactory(ctx, this);
296
+ this.votePoll = votePollFactory(ctx, this);
297
297
  this.custom = customFactory(ctx, this);
298
298
  }
299
299
  }
@@ -141,7 +141,7 @@ class Listener extends EventEmitter {
141
141
  if (shouldRotate) {
142
142
  this.rotateEndpoint();
143
143
  }
144
- setTimeout(() => {
144
+ this.retryTimeout = setTimeout(() => {
145
145
  this.start({ retryOnClose: true });
146
146
  }, retry);
147
147
  }
@@ -155,6 +155,7 @@ class Listener extends EventEmitter {
155
155
  this.emit("error", event);
156
156
  };
157
157
  ws.onmessage = async (event) => {
158
+ this.emit("pong"); // Pulse event to notify watchdog that socket is alive
158
159
  const { data } = event;
159
160
  if (!(data instanceof Buffer))
160
161
  return;
@@ -179,6 +180,7 @@ class Listener extends EventEmitter {
179
180
  data: { eventId: Date.now() },
180
181
  };
181
182
  this.sendWs(payload, false);
183
+ this.emit("ping");
182
184
  };
183
185
  this.pingInterval = setInterval(() => {
184
186
  ping();
@@ -367,16 +369,24 @@ class Listener extends EventEmitter {
367
369
  }
368
370
  }
369
371
  catch (error) {
372
+ if (error instanceof ZaloApiError.ZaloApiError && error.message.includes("Invalid data length or missing cipher key")) {
373
+ utils.logger(this.ctx).verbose("Ignored undecryptable Zalo packet. This is normal for some reaction/system events.");
374
+ return;
375
+ }
370
376
  this.onErrorCallback(error);
371
377
  this.emit("error", error);
372
378
  }
373
379
  };
374
380
  }
375
381
  stop() {
382
+ if (this.retryTimeout)
383
+ clearTimeout(this.retryTimeout);
376
384
  if (this.ws) {
377
- this.ws.close(exports.CloseReason.ManualClosure);
378
- this.reset();
385
+ if (this.ws.readyState !== WebSocket.CLOSED) {
386
+ this.ws.close(exports.CloseReason.ManualClosure);
387
+ }
379
388
  }
389
+ this.reset();
380
390
  }
381
391
  sendWs(payload, requireId = true) {
382
392
  if (this.ws) {