@softtynet/zca-js 2.2.7 → 2.2.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.
Files changed (147) hide show
  1. package/README.md +160 -179
  2. package/dist/apis/clearUnreadFriendRequests.d.ts +2 -0
  3. package/dist/apis/clearUnreadFriendRequests.js +29 -0
  4. package/dist/apis/encryptGids.d.ts +4 -0
  5. package/dist/apis/encryptGids.js +24 -0
  6. package/dist/apis/getAliasListV2.d.ts +10 -0
  7. package/dist/apis/getAliasListV2.js +28 -0
  8. package/dist/apis/getBlockFriends.d.ts +6 -0
  9. package/dist/apis/getBlockFriends.js +28 -0
  10. package/dist/apis/getCloudInfo.d.ts +3 -0
  11. package/dist/apis/getCloudInfo.js +34 -0
  12. package/dist/apis/getCloudSettings.d.ts +10 -0
  13. package/dist/apis/getCloudSettings.js +34 -0
  14. package/dist/apis/getCloudViewerKey.d.ts +5 -0
  15. package/dist/apis/getCloudViewerKey.js +25 -0
  16. package/dist/apis/getConversationMedia.d.ts +26 -0
  17. package/dist/apis/getConversationMedia.js +39 -0
  18. package/dist/apis/getEmojiStatusConfig.d.ts +17 -0
  19. package/dist/apis/getEmojiStatusConfig.js +23 -0
  20. package/dist/apis/getExtraFriendInfo.d.ts +3 -0
  21. package/dist/apis/getExtraFriendInfo.js +31 -0
  22. package/dist/apis/getExtraGroupInfo.d.ts +7 -0
  23. package/dist/apis/getExtraGroupInfo.js +32 -0
  24. package/dist/apis/getFamilyProfile.d.ts +3 -0
  25. package/dist/apis/getFamilyProfile.js +34 -0
  26. package/dist/apis/getFamilyUsage.d.ts +7 -0
  27. package/dist/apis/getFamilyUsage.js +34 -0
  28. package/dist/apis/getFamilyViewerKey.d.ts +5 -0
  29. package/dist/apis/getFamilyViewerKey.js +25 -0
  30. package/dist/apis/getFriendsEmojiStatus.d.ts +17 -0
  31. package/dist/apis/getFriendsEmojiStatus.js +30 -0
  32. package/dist/apis/getGroupCloudMessageJump.d.ts +3 -0
  33. package/dist/apis/getGroupCloudMessageJump.js +46 -0
  34. package/dist/apis/getLastReadContactTab.d.ts +4 -0
  35. package/dist/apis/getLastReadContactTab.js +15 -0
  36. package/dist/apis/getLastSeen.d.ts +11 -0
  37. package/dist/apis/getLastSeen.js +40 -0
  38. package/dist/apis/getLastSeenReaction.d.ts +9 -0
  39. package/dist/apis/getLastSeenReaction.js +28 -0
  40. package/dist/apis/getListPinTopics.d.ts +5 -0
  41. package/dist/apis/getListPinTopics.js +28 -0
  42. package/dist/apis/getMediaStorePreview.d.ts +3 -0
  43. package/dist/apis/getMediaStorePreview.js +31 -0
  44. package/dist/apis/getMiniProfile.d.ts +13 -0
  45. package/dist/apis/getMiniProfile.js +34 -0
  46. package/dist/apis/getPersonalizedStickerList.d.ts +5 -0
  47. package/dist/apis/getPersonalizedStickerList.js +24 -0
  48. package/dist/apis/getPhonebookV2.d.ts +6 -0
  49. package/dist/apis/getPhonebookV2.js +21 -0
  50. package/dist/apis/getProfileRank.d.ts +5 -0
  51. package/dist/apis/getProfileRank.js +25 -0
  52. package/dist/apis/getProfileVerificationStatus.d.ts +5 -0
  53. package/dist/apis/getProfileVerificationStatus.js +20 -0
  54. package/dist/apis/getQuotaCommunity.d.ts +8 -0
  55. package/dist/apis/getQuotaCommunity.js +27 -0
  56. package/dist/apis/getRecentSearchList.d.ts +6 -0
  57. package/dist/apis/getRecentSearchList.js +25 -0
  58. package/dist/apis/getStickerCategoriesV2.d.ts +17 -0
  59. package/dist/apis/getStickerCategoriesV2.js +21 -0
  60. package/dist/apis/getStickerCategoryData.d.ts +3 -0
  61. package/dist/apis/getStickerCategoryData.js +25 -0
  62. package/dist/apis/getStickerHello.d.ts +16 -0
  63. package/dist/apis/getStickerHello.js +34 -0
  64. package/dist/apis/getStickerSuggestKeywords.d.ts +12 -0
  65. package/dist/apis/getStickerSuggestKeywords.js +24 -0
  66. package/dist/apis/getStickerSuggestion.d.ts +12 -0
  67. package/dist/apis/getStickerSuggestion.js +30 -0
  68. package/dist/apis/getUsageMyCloud.d.ts +7 -0
  69. package/dist/apis/getUsageMyCloud.js +34 -0
  70. package/dist/apis/getUsageZCloud.d.ts +11 -0
  71. package/dist/apis/getUsageZCloud.js +34 -0
  72. package/dist/apis/keepAlive.d.ts +2 -1
  73. package/dist/apis/keepAlive.js +5 -3
  74. package/dist/apis/listen.d.ts +13 -0
  75. package/dist/apis/listen.js +10 -0
  76. package/dist/apis/readContactTab.d.ts +2 -0
  77. package/dist/apis/readContactTab.js +26 -0
  78. package/dist/apis/removeConversationMedia.d.ts +8 -0
  79. package/dist/apis/removeConversationMedia.js +30 -0
  80. package/dist/apis/undoMultiMessage.d.ts +9 -0
  81. package/dist/apis/undoMultiMessage.js +46 -0
  82. package/dist/apis/updateRecentSearch.d.ts +11 -0
  83. package/dist/apis/updateRecentSearch.js +41 -0
  84. package/dist/apis/verifyCloudMedia.d.ts +14 -0
  85. package/dist/apis/verifyCloudMedia.js +43 -0
  86. package/dist/apis/voiceToText.d.ts +4 -0
  87. package/dist/apis/voiceToText.js +30 -0
  88. package/dist/apis.d.ts +82 -0
  89. package/dist/apis.js +82 -0
  90. package/dist/cjs/apis/clearUnreadFriendRequests.cjs +34 -0
  91. package/dist/cjs/apis/encryptGids.cjs +29 -0
  92. package/dist/cjs/apis/getAliasListV2.cjs +33 -0
  93. package/dist/cjs/apis/getBlockFriends.cjs +33 -0
  94. package/dist/cjs/apis/getCloudInfo.cjs +39 -0
  95. package/dist/cjs/apis/getCloudSettings.cjs +39 -0
  96. package/dist/cjs/apis/getCloudViewerKey.cjs +30 -0
  97. package/dist/cjs/apis/getConversationMedia.cjs +44 -0
  98. package/dist/cjs/apis/getEmojiStatusConfig.cjs +28 -0
  99. package/dist/cjs/apis/getExtraFriendInfo.cjs +36 -0
  100. package/dist/cjs/apis/getExtraGroupInfo.cjs +37 -0
  101. package/dist/cjs/apis/getFamilyProfile.cjs +39 -0
  102. package/dist/cjs/apis/getFamilyUsage.cjs +39 -0
  103. package/dist/cjs/apis/getFamilyViewerKey.cjs +30 -0
  104. package/dist/cjs/apis/getFriendsEmojiStatus.cjs +35 -0
  105. package/dist/cjs/apis/getGroupCloudMessageJump.cjs +63 -0
  106. package/dist/cjs/apis/getLastReadContactTab.cjs +20 -0
  107. package/dist/cjs/apis/getLastSeen.cjs +45 -0
  108. package/dist/cjs/apis/getLastSeenReaction.cjs +33 -0
  109. package/dist/cjs/apis/getListPinTopics.cjs +33 -0
  110. package/dist/cjs/apis/getMediaStorePreview.cjs +36 -0
  111. package/dist/cjs/apis/getMiniProfile.cjs +39 -0
  112. package/dist/cjs/apis/getPersonalizedStickerList.cjs +29 -0
  113. package/dist/cjs/apis/getPhonebookV2.cjs +26 -0
  114. package/dist/cjs/apis/getProfileRank.cjs +30 -0
  115. package/dist/cjs/apis/getProfileVerificationStatus.cjs +25 -0
  116. package/dist/cjs/apis/getQuotaCommunity.cjs +32 -0
  117. package/dist/cjs/apis/getRecentSearchList.cjs +30 -0
  118. package/dist/cjs/apis/getStickerCategoriesV2.cjs +26 -0
  119. package/dist/cjs/apis/getStickerCategoryData.cjs +30 -0
  120. package/dist/cjs/apis/getStickerHello.cjs +39 -0
  121. package/dist/cjs/apis/getStickerSuggestKeywords.cjs +29 -0
  122. package/dist/cjs/apis/getStickerSuggestion.cjs +35 -0
  123. package/dist/cjs/apis/getUsageMyCloud.cjs +39 -0
  124. package/dist/cjs/apis/getUsageZCloud.cjs +39 -0
  125. package/dist/cjs/apis/keepAlive.cjs +5 -3
  126. package/dist/cjs/apis/listen.cjs +10 -0
  127. package/dist/cjs/apis/readContactTab.cjs +31 -0
  128. package/dist/cjs/apis/removeConversationMedia.cjs +35 -0
  129. package/dist/cjs/apis/undoMultiMessage.cjs +62 -0
  130. package/dist/cjs/apis/updateRecentSearch.cjs +46 -0
  131. package/dist/cjs/apis/verifyCloudMedia.cjs +48 -0
  132. package/dist/cjs/apis/voiceToText.cjs +35 -0
  133. package/dist/cjs/apis.cjs +82 -0
  134. package/dist/cjs/index.cjs +2 -0
  135. package/dist/cjs/update.cjs +8 -6
  136. package/dist/cjs/utils.cjs +25 -0
  137. package/dist/context.d.ts +4 -0
  138. package/dist/index.d.ts +42 -1
  139. package/dist/index.js +1 -1
  140. package/dist/update.js +8 -6
  141. package/dist/utils.d.ts +10 -0
  142. package/dist/utils.js +23 -0
  143. package/docs/INTEGRATION_GUIDE_SYNC_AND_CALL.md +110 -0
  144. package/package.json +12 -9
  145. package/CODE_OF_CONDUCT.md +0 -163
  146. package/CONTRIBUTING.md +0 -470
  147. package/SECURITY.md +0 -83
package/dist/apis.js CHANGED
@@ -16,6 +16,7 @@ import { changeFriendAliasFactory } from "./apis/changeFriendAlias.js";
16
16
  import { changeGroupAvatarFactory } from "./apis/changeGroupAvatar.js";
17
17
  import { changeGroupNameFactory } from "./apis/changeGroupName.js";
18
18
  import { changeGroupOwnerFactory } from "./apis/changeGroupOwner.js";
19
+ import { clearUnreadFriendRequestsFactory } from "./apis/clearUnreadFriendRequests.js";
19
20
  import { createAutoReplyFactory } from "./apis/createAutoReply.js";
20
21
  import { createBankAccountFactory } from "./apis/createBankAccount.js";
21
22
  import { createCatalogFactory } from "./apis/createCatalog.js";
@@ -39,12 +40,14 @@ import { downloadTransferSyncFactory } from "./apis/downloadTransferSync.js";
39
40
  import { editNoteFactory } from "./apis/editNote.js";
40
41
  import { editReminderFactory } from "./apis/editReminder.js";
41
42
  import { enableGroupLinkFactory } from "./apis/enableGroupLink.js";
43
+ import { encryptGidsFactory } from "./apis/encryptGids.js";
42
44
  import { endVoiceCallFactory } from "./apis/endVoiceCall.js";
43
45
  import { fetchAccountInfoFactory } from "./apis/fetchAccountInfo.js";
44
46
  import { findUserFactory } from "./apis/findUser.js";
45
47
  import { findUserByUsernameFactory } from "./apis/findUserByUsername.js";
46
48
  import { forwardMessageFactory } from "./apis/forwardMessage.js";
47
49
  import { getAliasListFactory } from "./apis/getAliasList.js";
50
+ import { getAliasListV2Factory } from "./apis/getAliasListV2.js";
48
51
  import { getAllFriendsFactory } from "./apis/getAllFriends.js";
49
52
  import { getAllGroupsFactory } from "./apis/getAllGroups.js";
50
53
  import { getArchivedChatListFactory } from "./apis/getArchivedChatList.js";
@@ -53,17 +56,30 @@ import { getAutoReplyListFactory } from "./apis/getAutoReplyList.js";
53
56
  import { getAvatarListFactory } from "./apis/getAvatarList.js";
54
57
  import { getAvatarUrlProfileFactory } from "./apis/getAvatarUrlProfile.js";
55
58
  import { getBizAccountFactory } from "./apis/getBizAccount.js";
59
+ import { getBlockFriendsFactory } from "./apis/getBlockFriends.js";
56
60
  import { getCatalogListFactory } from "./apis/getCatalogList.js";
57
61
  import { getCloseFriendsFactory } from "./apis/getCloseFriends.js";
62
+ import { getCloudInfoFactory } from "./apis/getCloudInfo.js";
63
+ import { getCloudSettingsFactory } from "./apis/getCloudSettings.js";
64
+ import { getCloudViewerKeyFactory } from "./apis/getCloudViewerKey.js";
58
65
  import { getContextFactory } from "./apis/getContext.js";
66
+ import { getConversationMediaFactory } from "./apis/getConversationMedia.js";
59
67
  import { getCookieFactory } from "./apis/getCookie.js";
68
+ import { getEmojiStatusConfigFactory } from "./apis/getEmojiStatusConfig.js";
69
+ import { getExtraFriendInfoFactory } from "./apis/getExtraFriendInfo.js";
70
+ import { getExtraGroupInfoFactory } from "./apis/getExtraGroupInfo.js";
71
+ import { getFamilyProfileFactory } from "./apis/getFamilyProfile.js";
72
+ import { getFamilyUsageFactory } from "./apis/getFamilyUsage.js";
73
+ import { getFamilyViewerKeyFactory } from "./apis/getFamilyViewerKey.js";
60
74
  import { getFriendBoardListFactory } from "./apis/getFriendBoardList.js";
61
75
  import { getFriendOnlinesFactory } from "./apis/getFriendOnlines.js";
62
76
  import { getFriendRecommendationsFactory } from "./apis/getFriendRecommendations.js";
63
77
  import { getFriendRequestStatusFactory } from "./apis/getFriendRequestStatus.js";
78
+ import { getFriendsEmojiStatusFactory } from "./apis/getFriendsEmojiStatus.js";
64
79
  import { getFullAvatarFactory } from "./apis/getFullAvatar.js";
65
80
  import { getGroupBlockedMemberFactory } from "./apis/getGroupBlockedMember.js";
66
81
  import { getGroupChatHistoryFactory } from "./apis/getGroupChatHistory.js";
82
+ import { getGroupCloudMessageJumpFactory } from "./apis/getGroupCloudMessageJump.js";
67
83
  import { getGroupInfoFactory } from "./apis/getGroupInfo.js";
68
84
  import { getGroupInviteBoxInfoFactory } from "./apis/getGroupInviteBoxInfo.js";
69
85
  import { getGroupInviteBoxListFactory } from "./apis/getGroupInviteBoxList.js";
@@ -72,31 +88,50 @@ import { getGroupLinkInfoFactory } from "./apis/getGroupLinkInfo.js";
72
88
  import { getGroupMembersInfoFactory } from "./apis/getGroupMembersInfo.js";
73
89
  import { getHiddenConversationsFactory } from "./apis/getHiddenConversations.js";
74
90
  import { getLabelsFactory } from "./apis/getLabels.js";
91
+ import { getLastReadContactTabFactory } from "./apis/getLastReadContactTab.js";
92
+ import { getLastSeenFactory } from "./apis/getLastSeen.js";
93
+ import { getLastSeenReactionFactory } from "./apis/getLastSeenReaction.js";
75
94
  import { getListBankFactory } from "./apis/getListBank.js";
76
95
  import { getListBankAccountFactory } from "./apis/getListBankAccount.js";
77
96
  import { getListBoardFactory } from "./apis/getListBoard.js";
78
97
  import { getListDeviceFactory } from "./apis/getListDevice.js";
98
+ import { getListPinTopicsFactory } from "./apis/getListPinTopics.js";
79
99
  import { getListReminderFactory } from "./apis/getListReminder.js";
100
+ import { getMediaStorePreviewFactory } from "./apis/getMediaStorePreview.js";
101
+ import { getMiniProfileFactory } from "./apis/getMiniProfile.js";
80
102
  import { getMultiUsersByPhonesFactory } from "./apis/getMultiUsersByPhones.js";
81
103
  import { getMuteFactory } from "./apis/getMute.js";
82
104
  import { getNoisedIdsFactory } from "./apis/getNoisedIds.js";
83
105
  import { getOwnIdFactory } from "./apis/getOwnId.js";
84
106
  import { getPendingGroupMembersFactory } from "./apis/getPendingGroupMembers.js";
107
+ import { getPersonalizedStickerListFactory } from "./apis/getPersonalizedStickerList.js";
108
+ import { getPhonebookV2Factory } from "./apis/getPhonebookV2.js";
85
109
  import { getPinConversationsFactory } from "./apis/getPinConversations.js";
86
110
  import { getPollDetailFactory } from "./apis/getPollDetail.js";
87
111
  import { getProductCatalogListFactory } from "./apis/getProductCatalogList.js";
112
+ import { getProfileRankFactory } from "./apis/getProfileRank.js";
113
+ import { getProfileVerificationStatusFactory } from "./apis/getProfileVerificationStatus.js";
88
114
  import { getQRFactory } from "./apis/getQR.js";
89
115
  import { getQuickMessageListFactory } from "./apis/getQuickMessageList.js";
116
+ import { getQuotaCommunityFactory } from "./apis/getQuotaCommunity.js";
117
+ import { getRecentSearchListFactory } from "./apis/getRecentSearchList.js";
90
118
  import { getRelatedFriendGroupFactory } from "./apis/getRelatedFriendGroup.js";
91
119
  import { getReminderFactory } from "./apis/getReminder.js";
92
120
  import { getReminderResponsesFactory } from "./apis/getReminderResponses.js";
93
121
  import { getSentFriendRequestFactory } from "./apis/getSentFriendRequest.js";
94
122
  import { getSettingsFactory } from "./apis/getSettings.js";
123
+ import { getStickerCategoriesV2Factory } from "./apis/getStickerCategoriesV2.js";
124
+ import { getStickerCategoryDataFactory } from "./apis/getStickerCategoryData.js";
95
125
  import { getStickerCategoryDetailFactory } from "./apis/getStickerCategoryDetail.js";
126
+ import { getStickerHelloFactory } from "./apis/getStickerHello.js";
127
+ import { getStickerSuggestKeywordsFactory } from "./apis/getStickerSuggestKeywords.js";
128
+ import { getStickerSuggestionFactory } from "./apis/getStickerSuggestion.js";
96
129
  import { getStickersFactory } from "./apis/getStickers.js";
97
130
  import { getStickersDetailFactory } from "./apis/getStickersDetail.js";
98
131
  import { getSyncDataFactory } from "./apis/getSyncData.js";
99
132
  import { getUnreadMarkFactory } from "./apis/getUnreadMark.js";
133
+ import { getUsageMyCloudFactory } from "./apis/getUsageMyCloud.js";
134
+ import { getUsageZCloudFactory } from "./apis/getUsageZCloud.js";
100
135
  import { getUserInfoFactory } from "./apis/getUserInfo.js";
101
136
  import { inviteUserToGroupsFactory } from "./apis/inviteUserToGroups.js";
102
137
  import { joinGroupInviteBoxFactory } from "./apis/joinGroupInviteBox.js";
@@ -109,8 +144,10 @@ import { lostFocusFactory } from "./apis/lostFocus.js";
109
144
  import { parseLinkFactory } from "./apis/parseLink.js";
110
145
  import { preloadConversationsFactory } from "./apis/preloadConversations.js";
111
146
  import { pullMobileFactory } from "./apis/pullMobile.js";
147
+ import { readContactTabFactory } from "./apis/readContactTab.js";
112
148
  import { registerCatalogFactory } from "./apis/registerCatalog.js";
113
149
  import { rejectFriendRequestFactory } from "./apis/rejectFriendRequest.js";
150
+ import { removeConversationMediaFactory } from "./apis/removeConversationMedia.js";
114
151
  import { removeFriendFactory } from "./apis/removeFriend.js";
115
152
  import { removeFriendAliasFactory } from "./apis/removeFriendAlias.js";
116
153
  import { removeGroupBlockedMemberFactory } from "./apis/removeGroupBlockedMember.js";
@@ -145,6 +182,7 @@ import { sharePollFactory } from "./apis/sharePoll.js";
145
182
  import { unblockUserFactory } from "./apis/unblockUser.js";
146
183
  import { undoFactory } from "./apis/undo.js";
147
184
  import { undoFriendRequestFactory } from "./apis/undoFriendRequest.js";
185
+ import { undoMultiMessageFactory } from "./apis/undoMultiMessage.js";
148
186
  import { updateActiveStatusFactory } from "./apis/updateActiveStatus.js";
149
187
  import { updateArchivedChatListFactory } from "./apis/updateArchivedChatList.js";
150
188
  import { updateAutoDeleteChatFactory } from "./apis/updateAutoDeleteChat.js";
@@ -159,10 +197,13 @@ import { updateProductCatalogFactory } from "./apis/updateProductCatalog.js";
159
197
  import { updateProfileFactory } from "./apis/updateProfile.js";
160
198
  import { updateProfileBioFactory } from "./apis/updateProfileBio.js";
161
199
  import { updateQuickMessageFactory } from "./apis/updateQuickMessage.js";
200
+ import { updateRecentSearchFactory } from "./apis/updateRecentSearch.js";
162
201
  import { updateSettingsFactory } from "./apis/updateSettings.js";
163
202
  import { upgradeGroupToCommunityFactory } from "./apis/upgradeGroupToCommunity.js";
164
203
  import { uploadAttachmentFactory } from "./apis/uploadAttachment.js";
165
204
  import { uploadProductPhotoFactory } from "./apis/uploadProductPhoto.js";
205
+ import { verifyCloudMediaFactory } from "./apis/verifyCloudMedia.js";
206
+ import { voiceToTextFactory } from "./apis/voiceToText.js";
166
207
  import { votePollFactory } from "./apis/votePoll.js";
167
208
  import { customFactory } from "./apis/custom.js";
168
209
  export class API {
@@ -186,6 +227,7 @@ export class API {
186
227
  this.changeGroupAvatar = changeGroupAvatarFactory(ctx, this);
187
228
  this.changeGroupName = changeGroupNameFactory(ctx, this);
188
229
  this.changeGroupOwner = changeGroupOwnerFactory(ctx, this);
230
+ this.clearUnreadFriendRequests = clearUnreadFriendRequestsFactory(ctx, this);
189
231
  this.createAutoReply = createAutoReplyFactory(ctx, this);
190
232
  this.createBankAccount = createBankAccountFactory(ctx, this);
191
233
  this.createCatalog = createCatalogFactory(ctx, this);
@@ -209,12 +251,14 @@ export class API {
209
251
  this.editNote = editNoteFactory(ctx, this);
210
252
  this.editReminder = editReminderFactory(ctx, this);
211
253
  this.enableGroupLink = enableGroupLinkFactory(ctx, this);
254
+ this.encryptGids = encryptGidsFactory(ctx, this);
212
255
  this.endVoiceCall = endVoiceCallFactory(ctx, this);
213
256
  this.fetchAccountInfo = fetchAccountInfoFactory(ctx, this);
214
257
  this.findUser = findUserFactory(ctx, this);
215
258
  this.findUserByUsername = findUserByUsernameFactory(ctx, this);
216
259
  this.forwardMessage = forwardMessageFactory(ctx, this);
217
260
  this.getAliasList = getAliasListFactory(ctx, this);
261
+ this.getAliasListV2 = getAliasListV2Factory(ctx, this);
218
262
  this.getAllFriends = getAllFriendsFactory(ctx, this);
219
263
  this.getAllGroups = getAllGroupsFactory(ctx, this);
220
264
  this.getArchivedChatList = getArchivedChatListFactory(ctx, this);
@@ -223,17 +267,30 @@ export class API {
223
267
  this.getAvatarList = getAvatarListFactory(ctx, this);
224
268
  this.getAvatarUrlProfile = getAvatarUrlProfileFactory(ctx, this);
225
269
  this.getBizAccount = getBizAccountFactory(ctx, this);
270
+ this.getBlockFriends = getBlockFriendsFactory(ctx, this);
226
271
  this.getCatalogList = getCatalogListFactory(ctx, this);
227
272
  this.getCloseFriends = getCloseFriendsFactory(ctx, this);
273
+ this.getCloudInfo = getCloudInfoFactory(ctx, this);
274
+ this.getCloudSettings = getCloudSettingsFactory(ctx, this);
275
+ this.getCloudViewerKey = getCloudViewerKeyFactory(ctx, this);
228
276
  this.getContext = getContextFactory(ctx, this);
277
+ this.getConversationMedia = getConversationMediaFactory(ctx, this);
229
278
  this.getCookie = getCookieFactory(ctx, this);
279
+ this.getEmojiStatusConfig = getEmojiStatusConfigFactory(ctx, this);
280
+ this.getExtraFriendInfo = getExtraFriendInfoFactory(ctx, this);
281
+ this.getExtraGroupInfo = getExtraGroupInfoFactory(ctx, this);
282
+ this.getFamilyProfile = getFamilyProfileFactory(ctx, this);
283
+ this.getFamilyUsage = getFamilyUsageFactory(ctx, this);
284
+ this.getFamilyViewerKey = getFamilyViewerKeyFactory(ctx, this);
230
285
  this.getFriendBoardList = getFriendBoardListFactory(ctx, this);
231
286
  this.getFriendOnlines = getFriendOnlinesFactory(ctx, this);
232
287
  this.getFriendRecommendations = getFriendRecommendationsFactory(ctx, this);
233
288
  this.getFriendRequestStatus = getFriendRequestStatusFactory(ctx, this);
289
+ this.getFriendsEmojiStatus = getFriendsEmojiStatusFactory(ctx, this);
234
290
  this.getFullAvatar = getFullAvatarFactory(ctx, this);
235
291
  this.getGroupBlockedMember = getGroupBlockedMemberFactory(ctx, this);
236
292
  this.getGroupChatHistory = getGroupChatHistoryFactory(ctx, this);
293
+ this.getGroupCloudMessageJump = getGroupCloudMessageJumpFactory(ctx, this);
237
294
  this.getGroupInfo = getGroupInfoFactory(ctx, this);
238
295
  this.getGroupInviteBoxInfo = getGroupInviteBoxInfoFactory(ctx, this);
239
296
  this.getGroupInviteBoxList = getGroupInviteBoxListFactory(ctx, this);
@@ -242,31 +299,50 @@ export class API {
242
299
  this.getGroupMembersInfo = getGroupMembersInfoFactory(ctx, this);
243
300
  this.getHiddenConversations = getHiddenConversationsFactory(ctx, this);
244
301
  this.getLabels = getLabelsFactory(ctx, this);
302
+ this.getLastReadContactTab = getLastReadContactTabFactory(ctx, this);
303
+ this.getLastSeen = getLastSeenFactory(ctx, this);
304
+ this.getLastSeenReaction = getLastSeenReactionFactory(ctx, this);
245
305
  this.getListBank = getListBankFactory(ctx, this);
246
306
  this.getListBankAccount = getListBankAccountFactory(ctx, this);
247
307
  this.getListBoard = getListBoardFactory(ctx, this);
248
308
  this.getListDevice = getListDeviceFactory(ctx, this);
309
+ this.getListPinTopics = getListPinTopicsFactory(ctx, this);
249
310
  this.getListReminder = getListReminderFactory(ctx, this);
311
+ this.getMediaStorePreview = getMediaStorePreviewFactory(ctx, this);
312
+ this.getMiniProfile = getMiniProfileFactory(ctx, this);
250
313
  this.getMultiUsersByPhones = getMultiUsersByPhonesFactory(ctx, this);
251
314
  this.getMute = getMuteFactory(ctx, this);
252
315
  this.getNoisedIds = getNoisedIdsFactory(ctx, this);
253
316
  this.getOwnId = getOwnIdFactory(ctx, this);
254
317
  this.getPendingGroupMembers = getPendingGroupMembersFactory(ctx, this);
318
+ this.getPersonalizedStickerList = getPersonalizedStickerListFactory(ctx, this);
319
+ this.getPhonebookV2 = getPhonebookV2Factory(ctx, this);
255
320
  this.getPinConversations = getPinConversationsFactory(ctx, this);
256
321
  this.getPollDetail = getPollDetailFactory(ctx, this);
257
322
  this.getProductCatalogList = getProductCatalogListFactory(ctx, this);
323
+ this.getProfileRank = getProfileRankFactory(ctx, this);
324
+ this.getProfileVerificationStatus = getProfileVerificationStatusFactory(ctx, this);
258
325
  this.getQR = getQRFactory(ctx, this);
259
326
  this.getQuickMessageList = getQuickMessageListFactory(ctx, this);
327
+ this.getQuotaCommunity = getQuotaCommunityFactory(ctx, this);
328
+ this.getRecentSearchList = getRecentSearchListFactory(ctx, this);
260
329
  this.getRelatedFriendGroup = getRelatedFriendGroupFactory(ctx, this);
261
330
  this.getReminder = getReminderFactory(ctx, this);
262
331
  this.getReminderResponses = getReminderResponsesFactory(ctx, this);
263
332
  this.getSentFriendRequest = getSentFriendRequestFactory(ctx, this);
264
333
  this.getSettings = getSettingsFactory(ctx, this);
334
+ this.getStickerCategoriesV2 = getStickerCategoriesV2Factory(ctx, this);
335
+ this.getStickerCategoryData = getStickerCategoryDataFactory(ctx, this);
265
336
  this.getStickerCategoryDetail = getStickerCategoryDetailFactory(ctx, this);
337
+ this.getStickerHello = getStickerHelloFactory(ctx, this);
338
+ this.getStickerSuggestKeywords = getStickerSuggestKeywordsFactory(ctx, this);
339
+ this.getStickerSuggestion = getStickerSuggestionFactory(ctx, this);
266
340
  this.getStickers = getStickersFactory(ctx, this);
267
341
  this.getStickersDetail = getStickersDetailFactory(ctx, this);
268
342
  this.getSyncData = getSyncDataFactory(ctx, this);
269
343
  this.getUnreadMark = getUnreadMarkFactory(ctx, this);
344
+ this.getUsageMyCloud = getUsageMyCloudFactory(ctx, this);
345
+ this.getUsageZCloud = getUsageZCloudFactory(ctx, this);
270
346
  this.getUserInfo = getUserInfoFactory(ctx, this);
271
347
  this.inviteUserToGroups = inviteUserToGroupsFactory(ctx, this);
272
348
  this.joinGroupInviteBox = joinGroupInviteBoxFactory(ctx, this);
@@ -279,8 +355,10 @@ export class API {
279
355
  this.parseLink = parseLinkFactory(ctx, this);
280
356
  this.preloadConversations = preloadConversationsFactory(ctx, this);
281
357
  this.pullMobile = pullMobileFactory(ctx, this);
358
+ this.readContactTab = readContactTabFactory(ctx, this);
282
359
  this.registerCatalog = registerCatalogFactory(ctx, this);
283
360
  this.rejectFriendRequest = rejectFriendRequestFactory(ctx, this);
361
+ this.removeConversationMedia = removeConversationMediaFactory(ctx, this);
284
362
  this.removeFriend = removeFriendFactory(ctx, this);
285
363
  this.removeFriendAlias = removeFriendAliasFactory(ctx, this);
286
364
  this.removeGroupBlockedMember = removeGroupBlockedMemberFactory(ctx, this);
@@ -315,6 +393,7 @@ export class API {
315
393
  this.unblockUser = unblockUserFactory(ctx, this);
316
394
  this.undo = undoFactory(ctx, this);
317
395
  this.undoFriendRequest = undoFriendRequestFactory(ctx, this);
396
+ this.undoMultiMessage = undoMultiMessageFactory(ctx, this);
318
397
  this.updateActiveStatus = updateActiveStatusFactory(ctx, this);
319
398
  this.updateArchivedChatList = updateArchivedChatListFactory(ctx, this);
320
399
  this.updateAutoDeleteChat = updateAutoDeleteChatFactory(ctx, this);
@@ -329,10 +408,13 @@ export class API {
329
408
  this.updateProfile = updateProfileFactory(ctx, this);
330
409
  this.updateProfileBio = updateProfileBioFactory(ctx, this);
331
410
  this.updateQuickMessage = updateQuickMessageFactory(ctx, this);
411
+ this.updateRecentSearch = updateRecentSearchFactory(ctx, this);
332
412
  this.updateSettings = updateSettingsFactory(ctx, this);
333
413
  this.upgradeGroupToCommunity = upgradeGroupToCommunityFactory(ctx, this);
334
414
  this.uploadAttachment = uploadAttachmentFactory(ctx, this);
335
415
  this.uploadProductPhoto = uploadProductPhotoFactory(ctx, this);
416
+ this.verifyCloudMedia = verifyCloudMediaFactory(ctx, this);
417
+ this.voiceToText = voiceToTextFactory(ctx, this);
336
418
  this.votePoll = votePollFactory(ctx, this);
337
419
  this.custom = customFactory(ctx, this);
338
420
  }
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const clearUnreadFriendRequestsFactory = utils.apiFactory()((api, _ctx, utils) => {
7
+ const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend[0]}/api/friend/recommendsv2/read-requests`);
8
+ /**
9
+ * Đánh dấu đã xem danh sách lời mời kết bạn chưa đọc (command 12232)
10
+ *
11
+ * @param uidsSeen Danh sách UID đã xem lời mời kết bạn (mặc định `[]`)
12
+ * @throws {ZaloApiError}
13
+ */
14
+ return async function clearUnreadFriendRequests(uidsSeen = []) {
15
+ if (!uidsSeen || uidsSeen.length === 0) {
16
+ return {};
17
+ }
18
+ const params = {
19
+ uids_seen: uidsSeen,
20
+ };
21
+ const encryptedParams = utils.encodeAES(JSON.stringify(params));
22
+ if (!encryptedParams)
23
+ throw new ZaloApiError.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
+ });
33
+
34
+ exports.clearUnreadFriendRequestsFactory = clearUnreadFriendRequestsFactory;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const encryptGidsFactory = utils.apiFactory()((api, _ctx, utils) => {
7
+ const serviceURL = utils.makeURL(`${api.zpwServiceMap.profile[0]}/api/gid/encrypt`);
8
+ /**
9
+ * Mã hóa danh sách UID thật sang định danh ẩn danh Global Noise ID (`OTDAKO...`) (command 12053)
10
+ *
11
+ * @param uids Mảng chuỗi các UID cần mã hóa
12
+ * @throws {ZaloApiError}
13
+ */
14
+ return async function encryptGids(uids) {
15
+ if (!Array.isArray(uids) || uids.length === 0) {
16
+ return { data: {} };
17
+ }
18
+ const encryptedParams = utils.encodeAES(JSON.stringify({ noiseUids: uids }));
19
+ if (!encryptedParams) {
20
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
21
+ }
22
+ const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
23
+ method: "GET",
24
+ });
25
+ return utils.resolve(response);
26
+ };
27
+ });
28
+
29
+ exports.encryptGidsFactory = encryptGidsFactory;
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const getAliasListV2Factory = utils.apiFactory()((api, ctx, utils) => {
7
+ const serviceURL = utils.makeURL(`${api.zpwServiceMap.alias[0]}/api/alias/list/v2`);
8
+ /**
9
+ * Lấy danh sách tên gợi nhớ (Alias) của bạn bè chuẩn V2 có hỗ trợ phân trang (command 12205)
10
+ *
11
+ * @param page Trang cần lấy (mặc định: 1)
12
+ * @param count Số lượng mục mỗi trang (mặc định: 100)
13
+ * @throws {ZaloApiError}
14
+ */
15
+ return async function getAliasListV2(page = 1, count = 100) {
16
+ const params = {
17
+ page,
18
+ count,
19
+ src: -1,
20
+ imei: ctx.imei,
21
+ };
22
+ const encryptedParams = utils.encodeAES(JSON.stringify(params));
23
+ if (!encryptedParams) {
24
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
25
+ }
26
+ const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
27
+ method: "GET",
28
+ });
29
+ return utils.resolve(response);
30
+ };
31
+ });
32
+
33
+ exports.getAliasListV2Factory = getAliasListV2Factory;
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const getBlockFriendsFactory = utils.apiFactory()((api, _ctx, utils) => {
7
+ const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend[0]}/api/friend/blocklistv2`);
8
+ /**
9
+ * Lấy danh sách người dùng đang bị chặn chuẩn V2 (command 11429)
10
+ *
11
+ * @param page Trang cần lấy (mặc định: 1)
12
+ * @param count Số lượng mỗi trang (mặc định: 50)
13
+ * @param avatarSize Kích thước ảnh đại diện (mặc định: 120)
14
+ * @throws {ZaloApiError}
15
+ */
16
+ return async function getBlockFriends(page = 1, count = 50, avatarSize = 120) {
17
+ const params = {
18
+ page,
19
+ count,
20
+ avatar: avatarSize,
21
+ };
22
+ const encryptedParams = utils.encodeAES(JSON.stringify(params));
23
+ if (!encryptedParams) {
24
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
25
+ }
26
+ const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
27
+ method: "GET",
28
+ });
29
+ return utils.resolve(response);
30
+ };
31
+ });
32
+
33
+ exports.getBlockFriendsFactory = getBlockFriendsFactory;
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const getCloudInfoFactory = utils.apiFactory()((api, _ctx, utils$1) => {
7
+ var _a;
8
+ const baseDomain = ((_a = api.zpwServiceMap.zcloud) === null || _a === void 0 ? void 0 : _a[0]) || "https://zcld.chat.zalo.me";
9
+ const serviceURL = utils$1.makeURL(`${baseDomain}/zalocloud/cloudinfopcweb/v1/info`);
10
+ /**
11
+ * Lấy thông tin gói thuê bao Zalo Cloud (command 12754)
12
+ *
13
+ * @param viewerKeyInfo (Tùy chọn) Cặp `{ viewer_key, enk }` từ `api.getCloudViewerKey()`.
14
+ * @throws {ZaloApiError}
15
+ */
16
+ return async function getCloudInfo(viewerKeyInfo) {
17
+ const keyInfo = viewerKeyInfo !== null && viewerKeyInfo !== void 0 ? viewerKeyInfo : (await api.getCloudViewerKey());
18
+ if (!(keyInfo === null || keyInfo === void 0 ? void 0 : keyInfo.viewer_key) || !(keyInfo === null || keyInfo === void 0 ? void 0 : keyInfo.enk)) {
19
+ throw new ZaloApiError.ZaloApiError("Invalid CloudViewerKey");
20
+ }
21
+ const response = await utils$1.request(serviceURL, {
22
+ method: "GET",
23
+ headers: {
24
+ "cloud-viewer-key": keyInfo.viewer_key,
25
+ },
26
+ });
27
+ const json = (await response.json());
28
+ if (json.error_code !== 0 && json.error_code !== -904) {
29
+ throw new ZaloApiError.ZaloApiError(json.error_message || "getCloudInfo failed", json.error_code);
30
+ }
31
+ if (!json.data) {
32
+ return {};
33
+ }
34
+ const decrypted = utils.decryptZCloudAES(json.data, keyInfo.enk);
35
+ return JSON.parse(decrypted);
36
+ };
37
+ });
38
+
39
+ exports.getCloudInfoFactory = getCloudInfoFactory;
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const getCloudSettingsFactory = utils.apiFactory()((api, _ctx, utils$1) => {
7
+ var _a;
8
+ const baseDomain = ((_a = api.zpwServiceMap.zcloud) === null || _a === void 0 ? void 0 : _a[0]) || "https://zcld.chat.zalo.me";
9
+ const serviceURL = utils$1.makeURL(`${baseDomain}/cloudmedia/info/pc/v1/cloud-settings`);
10
+ /**
11
+ * Lấy cấu hình giới hạn tệp và cài đặt ZCloud của tài khoản (command 12756)
12
+ *
13
+ * @param viewerKeyInfo (Tùy chọn) Cặp `{ viewer_key, enk }` từ `api.getCloudViewerKey()`. Nếu không truyền sẽ tự động lấy mới.
14
+ * @throws {ZaloApiError}
15
+ */
16
+ return async function getCloudSettings(viewerKeyInfo) {
17
+ const keyInfo = viewerKeyInfo !== null && viewerKeyInfo !== void 0 ? viewerKeyInfo : (await api.getCloudViewerKey());
18
+ if (!(keyInfo === null || keyInfo === void 0 ? void 0 : keyInfo.viewer_key) || !(keyInfo === null || keyInfo === void 0 ? void 0 : keyInfo.enk)) {
19
+ throw new ZaloApiError.ZaloApiError("Invalid CloudViewerKey");
20
+ }
21
+ const response = await utils$1.request(serviceURL, {
22
+ method: "GET",
23
+ headers: {
24
+ "cloud-viewer-key": keyInfo.viewer_key,
25
+ },
26
+ });
27
+ const json = (await response.json());
28
+ if (json.error_code !== 0 && json.error_code !== -904) {
29
+ throw new ZaloApiError.ZaloApiError(json.error_message || "getCloudSettings failed", json.error_code);
30
+ }
31
+ if (!json.data) {
32
+ throw new ZaloApiError.ZaloApiError("Empty ZCloud settings data", json.error_code);
33
+ }
34
+ const decrypted = utils.decryptZCloudAES(json.data, keyInfo.enk);
35
+ return JSON.parse(decrypted);
36
+ };
37
+ });
38
+
39
+ exports.getCloudSettingsFactory = getCloudSettingsFactory;
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const getCloudViewerKeyFactory = utils.apiFactory()((_api, _ctx, utils) => {
7
+ const serviceURL = utils.makeURL("https://wpa.chat.zalo.me/api/getCloudViewerKey");
8
+ /**
9
+ * Lấy cặp khóa phiên (`viewer_key` và khóa giải mã AES-256 `enk`) cho hệ thống ZCloud / MyCloud (command 12741)
10
+ *
11
+ * @throws {ZaloApiError}
12
+ */
13
+ return async function getCloudViewerKey() {
14
+ const response = await utils.request(serviceURL, {
15
+ method: "GET",
16
+ });
17
+ const res = await utils.resolve(response);
18
+ if (typeof res === "string") {
19
+ try {
20
+ return JSON.parse(res);
21
+ }
22
+ catch (_a) {
23
+ throw new ZaloApiError.ZaloApiError("Failed to parse CloudViewerKey response");
24
+ }
25
+ }
26
+ return res;
27
+ };
28
+ });
29
+
30
+ exports.getCloudViewerKeyFactory = getCloudViewerKeyFactory;
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const getConversationMediaFactory = utils.apiFactory()((api, ctx, utils) => {
7
+ const serviceURL = utils.makeURL(`${api.zpwServiceMap.media_store[0]}/api/mediastore/list`);
8
+ /**
9
+ * Lấy danh sách Kho Lưu Trữ (Ảnh/Video `"media"`, File `"file"`, hoặc Link `"link"`) trong hội thoại nhóm (command 11841)
10
+ *
11
+ * @param options Tùy chọn truy vấn (`groupId`, `mediaType`, `limit`, `lastId`, `lastFetchId`)
12
+ * @throws {ZaloApiError}
13
+ */
14
+ return async function getConversationMedia(options) {
15
+ var _a, _b;
16
+ const rawGroupId = options.groupId || options.threadId;
17
+ if (!rawGroupId) {
18
+ throw new ZaloApiError.ZaloApiError("Missing groupId");
19
+ }
20
+ const groupId = rawGroupId.startsWith("g") ? rawGroupId.slice(1) : rawGroupId;
21
+ const params = {
22
+ media_type: (_a = options.mediaType) !== null && _a !== void 0 ? _a : "media",
23
+ group_id: groupId,
24
+ limit: (_b = options.limit) !== null && _b !== void 0 ? _b : 20,
25
+ imei: ctx.imei,
26
+ };
27
+ if (options.lastId !== undefined) {
28
+ params.last_id = options.lastId;
29
+ }
30
+ if (options.lastFetchId !== undefined && !Number.isNaN(options.lastFetchId)) {
31
+ params.lastFetchId = options.lastFetchId;
32
+ }
33
+ const encryptedParams = utils.encodeAES(JSON.stringify(params));
34
+ if (!encryptedParams) {
35
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
36
+ }
37
+ const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
38
+ method: "GET",
39
+ });
40
+ return utils.resolve(response);
41
+ };
42
+ });
43
+
44
+ exports.getConversationMediaFactory = getConversationMediaFactory;
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const getEmojiStatusConfigFactory = utils.apiFactory()((api, _ctx, utils) => {
7
+ var _a;
8
+ const baseDomain = ((_a = api.zpwServiceMap.emoji_stt) === null || _a === void 0 ? void 0 : _a[0]) || "https://emoji-status.chat.zalo.me";
9
+ const serviceURL = utils.makeURL(`${baseDomain}/api/v1/emoji-status/resource-config`);
10
+ /**
11
+ * Lấy cấu hình và danh sách bộ biểu tượng Trạng thái Emoji (Emoji Status - command 16300)
12
+ *
13
+ * @param version Phiên bản bộ nhớ đệm (mặc định: 0 để lấy đầy đủ danh sách)
14
+ * @throws {ZaloApiError}
15
+ */
16
+ return async function getEmojiStatusConfig(version = 0) {
17
+ const encryptedParams = utils.encodeAES(JSON.stringify({ version }));
18
+ if (!encryptedParams) {
19
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
20
+ }
21
+ const response = await utils.request(utils.makeURL(serviceURL, { params: encryptedParams }), {
22
+ method: "GET",
23
+ });
24
+ return utils.resolve(response);
25
+ };
26
+ });
27
+
28
+ exports.getEmojiStatusConfigFactory = getEmojiStatusConfigFactory;
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const getExtraFriendInfoFactory = utils.apiFactory()((api, ctx, utils) => {
7
+ const serviceURL = utils.makeURL(`${api.zpwServiceMap.friend[0]}/api/friend/context/multiget`);
8
+ /**
9
+ * Lấy ngữ cảnh và vai trò mở rộng (ví dụ `role: ["boss"]`) của danh sách bạn bè (command 11442)
10
+ *
11
+ * @param friendIds Mảng UID cần truy vấn
12
+ * @throws {ZaloApiError}
13
+ */
14
+ return async function getExtraFriendInfo(friendIds) {
15
+ if (!Array.isArray(friendIds) || friendIds.length === 0) {
16
+ return {};
17
+ }
18
+ const params = {
19
+ fids: friendIds,
20
+ imei: ctx.imei,
21
+ };
22
+ const encryptedParams = utils.encodeAES(JSON.stringify(params));
23
+ if (!encryptedParams) {
24
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
25
+ }
26
+ const response = await utils.request(serviceURL, {
27
+ method: "POST",
28
+ body: new URLSearchParams({
29
+ params: encryptedParams,
30
+ }),
31
+ });
32
+ return utils.resolve(response);
33
+ };
34
+ });
35
+
36
+ exports.getExtraFriendInfoFactory = getExtraFriendInfoFactory;