@softtynet/zca-js 2.2.8 → 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 (142) hide show
  1. package/README.md +1 -0
  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/utils.cjs +25 -0
  136. package/dist/context.d.ts +4 -0
  137. package/dist/index.d.ts +42 -1
  138. package/dist/index.js +1 -1
  139. package/dist/utils.d.ts +10 -0
  140. package/dist/utils.js +23 -0
  141. package/docs/INTEGRATION_GUIDE_SYNC_AND_CALL.md +110 -0
  142. package/package.json +1 -1
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ require('../models/AutoReply.cjs');
5
+ require('../models/Bank.cjs');
6
+ require('../models/Board.cjs');
7
+ var Enum = require('../models/Enum.cjs');
8
+ require('../models/FriendEvent.cjs');
9
+ require('../models/Group.cjs');
10
+ require('../models/GroupEvent.cjs');
11
+ require('../models/Reaction.cjs');
12
+ require('../models/Reminder.cjs');
13
+ require('../models/ZBusiness.cjs');
14
+ require('../models/SyncEvent.cjs');
15
+ require('../models/CallEvent.cjs');
16
+ var utils = require('../utils.cjs');
17
+
18
+ const undoMultiMessageFactory = utils.apiFactory()((api, _ctx, utils) => {
19
+ /**
20
+ * Thu hồi hàng loạt nhiều tin nhắn cùng lúc trong hội thoại cá nhân hoặc nhóm (command 12115 / 12116)
21
+ *
22
+ * @param msgs Danh sách tin nhắn cần thu hồi (`globalMsgId`, `cliMsgId` của tin nhắn gốc)
23
+ * @param threadId ID người nhận hoặc ID nhóm
24
+ * @param type Loại hội thoại (`ThreadType.User` hoặc `ThreadType.Group`)
25
+ * @throws {ZaloApiError}
26
+ */
27
+ return async function undoMultiMessage(msgs, threadId, type = Enum.ThreadType.User) {
28
+ if (!Array.isArray(msgs) || msgs.length === 0) {
29
+ throw new ZaloApiError.ZaloApiError("Missing messages to undo");
30
+ }
31
+ if (!threadId) {
32
+ throw new ZaloApiError.ZaloApiError("Missing threadId");
33
+ }
34
+ const isGroup = type === Enum.ThreadType.Group || threadId.startsWith("g");
35
+ const cleanThreadId = threadId.startsWith("g") ? threadId.slice(1) : threadId;
36
+ const serviceURL = isGroup
37
+ ? utils.makeURL(`${api.zpwServiceMap.group[0]}/api/group/multi_undomsg`)
38
+ : utils.makeURL(`${api.zpwServiceMap.chat[0]}/api/message/multi_undo`);
39
+ const now = Date.now();
40
+ const normalizedMsgs = msgs.map((m, idx) => ({
41
+ cliMsgId: m.cliMsgIdUndo !== undefined ? m.cliMsgId : now + idx,
42
+ cliMsgIdUndo: m.cliMsgIdUndo !== undefined ? m.cliMsgIdUndo : m.cliMsgId,
43
+ globalMsgId: String(m.globalMsgId),
44
+ }));
45
+ const payload = isGroup
46
+ ? { grid: cleanThreadId, msgs: normalizedMsgs }
47
+ : { toid: cleanThreadId, msgs: normalizedMsgs };
48
+ const encryptedParams = utils.encodeAES(JSON.stringify(payload));
49
+ if (!encryptedParams) {
50
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
51
+ }
52
+ const response = await utils.request(serviceURL, {
53
+ method: "POST",
54
+ body: new URLSearchParams({
55
+ params: encryptedParams,
56
+ }),
57
+ });
58
+ return utils.resolve(response);
59
+ };
60
+ });
61
+
62
+ exports.undoMultiMessageFactory = undoMultiMessageFactory;
@@ -0,0 +1,46 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const updateRecentSearchFactory = utils.apiFactory()((api, ctx, utils) => {
7
+ const serviceURL = utils.makeURL(`${api.zpwServiceMap.recent_search[0]}/api/recentsearch/update`);
8
+ /**
9
+ * Cập nhật danh sách lịch sử tìm kiếm gần đây trên Zalo (command 12126)
10
+ *
11
+ * @param options Danh sách tìm kiếm gần đây và từ khóa (`listRecent`, `listKeyword`, `version`)
12
+ * @throws {ZaloApiError}
13
+ */
14
+ return async function updateRecentSearch(options = {}) {
15
+ var _a, _b, _c;
16
+ let currentVersion = options.version;
17
+ if (currentVersion === undefined) {
18
+ try {
19
+ const current = await api.getRecentSearchList(0);
20
+ currentVersion = (_a = current === null || current === void 0 ? void 0 : current.version) !== null && _a !== void 0 ? _a : 0;
21
+ }
22
+ catch (_d) {
23
+ currentVersion = 0;
24
+ }
25
+ }
26
+ const params = {
27
+ list_recent: (_b = options.listRecent) !== null && _b !== void 0 ? _b : [],
28
+ version: currentVersion,
29
+ list_keyword: (_c = options.listKeyword) !== null && _c !== void 0 ? _c : [],
30
+ imei: ctx.imei,
31
+ };
32
+ const encryptedParams = utils.encodeAES(JSON.stringify(params));
33
+ if (!encryptedParams) {
34
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
35
+ }
36
+ const response = await utils.request(serviceURL, {
37
+ method: "POST",
38
+ body: new URLSearchParams({
39
+ params: encryptedParams,
40
+ }),
41
+ });
42
+ return utils.resolve(response);
43
+ };
44
+ });
45
+
46
+ exports.updateRecentSearchFactory = updateRecentSearchFactory;
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const verifyCloudMediaFactory = 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/queue/pc/verify`);
10
+ /**
11
+ * Kiểm tra và lấy danh sách mục Media lưu trữ trên ZCloud (command 12740 / 12761)
12
+ *
13
+ * @param options Tùy chọn truy vấn (`lastNoiseId`, `loadType`, `listNoiseIds`, `trackingSource`)
14
+ * @param viewerKeyInfo (Tùy chọn) Cặp `{ viewer_key, enk }` từ `api.getCloudViewerKey()`.
15
+ * @throws {ZaloApiError}
16
+ */
17
+ return async function verifyCloudMedia(options = {}, viewerKeyInfo) {
18
+ var _a, _b, _c, _d;
19
+ const keyInfo = viewerKeyInfo !== null && viewerKeyInfo !== void 0 ? viewerKeyInfo : (await api.getCloudViewerKey());
20
+ if (!(keyInfo === null || keyInfo === void 0 ? void 0 : keyInfo.viewer_key) || !(keyInfo === null || keyInfo === void 0 ? void 0 : keyInfo.enk)) {
21
+ throw new ZaloApiError.ZaloApiError("Invalid CloudViewerKey");
22
+ }
23
+ const payload = {
24
+ lastNoiseId: (_a = options.lastNoiseId) !== null && _a !== void 0 ? _a : "",
25
+ loadType: (_b = options.loadType) !== null && _b !== void 0 ? _b : 0,
26
+ listNoiseIds: (_c = options.listNoiseIds) !== null && _c !== void 0 ? _c : [],
27
+ tracking_source: (_d = options.trackingSource) !== null && _d !== void 0 ? _d : 0,
28
+ };
29
+ const encryptedParams = utils.encryptZCloudAES(JSON.stringify(payload), keyInfo.enk);
30
+ const response = await utils$1.request(utils$1.makeURL(serviceURL, { params: encryptedParams }), {
31
+ method: "GET",
32
+ headers: {
33
+ "cloud-viewer-key": keyInfo.viewer_key,
34
+ },
35
+ });
36
+ const json = (await response.json());
37
+ if (json.error_code !== 0 && json.error_code !== -904) {
38
+ throw new ZaloApiError.ZaloApiError(json.error_message || "verifyCloudMedia failed", json.error_code);
39
+ }
40
+ if (!json.data) {
41
+ throw new ZaloApiError.ZaloApiError("Empty verifyCloudMedia response", json.error_code);
42
+ }
43
+ const decrypted = utils.decryptZCloudAES(json.data, keyInfo.enk);
44
+ return JSON.parse(decrypted);
45
+ };
46
+ });
47
+
48
+ exports.verifyCloudMediaFactory = verifyCloudMediaFactory;
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var ZaloApiError = require('../Errors/ZaloApiError.cjs');
4
+ var utils = require('../utils.cjs');
5
+
6
+ const voiceToTextFactory = utils.apiFactory()((api, _ctx, utils) => {
7
+ var _a;
8
+ const baseDomain = ((_a = api.zpwServiceMap.ai_features) === null || _a === void 0 ? void 0 : _a[0]) || "https://tt-ai-features-wpa.chat.zalo.me";
9
+ const serviceURL = utils.makeURL(`${baseDomain}/api/aifeatures/voice2text`);
10
+ /**
11
+ * Gửi yêu cầu chuyển đổi tin nhắn thoại sang văn bản bằng Zalo AI (command 13394).
12
+ * Kết quả văn bản sau khi xử lý xong sẽ được đẩy về qua sự kiện `api.listener.on("voice2text_event", ...)` khớp với `req_id`.
13
+ *
14
+ * @param voiceUrl Đường dẫn URL của tệp ghi âm tin nhắn thoại (`.aac` / `.mp3` / `.m4a`)
15
+ * @throws {ZaloApiError}
16
+ */
17
+ return async function voiceToText(voiceUrl) {
18
+ if (!voiceUrl) {
19
+ throw new ZaloApiError.ZaloApiError("Missing voiceUrl");
20
+ }
21
+ const encryptedParams = utils.encodeAES(JSON.stringify({ url: voiceUrl }));
22
+ if (!encryptedParams) {
23
+ throw new ZaloApiError.ZaloApiError("Failed to encrypt params");
24
+ }
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
+ });
34
+
35
+ exports.voiceToTextFactory = voiceToTextFactory;
package/dist/cjs/apis.cjs CHANGED
@@ -18,6 +18,7 @@ var changeFriendAlias = require('./apis/changeFriendAlias.cjs');
18
18
  var changeGroupAvatar = require('./apis/changeGroupAvatar.cjs');
19
19
  var changeGroupName = require('./apis/changeGroupName.cjs');
20
20
  var changeGroupOwner = require('./apis/changeGroupOwner.cjs');
21
+ var clearUnreadFriendRequests = require('./apis/clearUnreadFriendRequests.cjs');
21
22
  var createAutoReply = require('./apis/createAutoReply.cjs');
22
23
  var createBankAccount = require('./apis/createBankAccount.cjs');
23
24
  var createCatalog = require('./apis/createCatalog.cjs');
@@ -41,12 +42,14 @@ var downloadTransferSync = require('./apis/downloadTransferSync.cjs');
41
42
  var editNote = require('./apis/editNote.cjs');
42
43
  var editReminder = require('./apis/editReminder.cjs');
43
44
  var enableGroupLink = require('./apis/enableGroupLink.cjs');
45
+ var encryptGids = require('./apis/encryptGids.cjs');
44
46
  var endVoiceCall = require('./apis/endVoiceCall.cjs');
45
47
  var fetchAccountInfo = require('./apis/fetchAccountInfo.cjs');
46
48
  var findUser = require('./apis/findUser.cjs');
47
49
  var findUserByUsername = require('./apis/findUserByUsername.cjs');
48
50
  var forwardMessage = require('./apis/forwardMessage.cjs');
49
51
  var getAliasList = require('./apis/getAliasList.cjs');
52
+ var getAliasListV2 = require('./apis/getAliasListV2.cjs');
50
53
  var getAllFriends = require('./apis/getAllFriends.cjs');
51
54
  var getAllGroups = require('./apis/getAllGroups.cjs');
52
55
  var getArchivedChatList = require('./apis/getArchivedChatList.cjs');
@@ -55,17 +58,30 @@ var getAutoReplyList = require('./apis/getAutoReplyList.cjs');
55
58
  var getAvatarList = require('./apis/getAvatarList.cjs');
56
59
  var getAvatarUrlProfile = require('./apis/getAvatarUrlProfile.cjs');
57
60
  var getBizAccount = require('./apis/getBizAccount.cjs');
61
+ var getBlockFriends = require('./apis/getBlockFriends.cjs');
58
62
  var getCatalogList = require('./apis/getCatalogList.cjs');
59
63
  var getCloseFriends = require('./apis/getCloseFriends.cjs');
64
+ var getCloudInfo = require('./apis/getCloudInfo.cjs');
65
+ var getCloudSettings = require('./apis/getCloudSettings.cjs');
66
+ var getCloudViewerKey = require('./apis/getCloudViewerKey.cjs');
60
67
  var getContext = require('./apis/getContext.cjs');
68
+ var getConversationMedia = require('./apis/getConversationMedia.cjs');
61
69
  var getCookie = require('./apis/getCookie.cjs');
70
+ var getEmojiStatusConfig = require('./apis/getEmojiStatusConfig.cjs');
71
+ var getExtraFriendInfo = require('./apis/getExtraFriendInfo.cjs');
72
+ var getExtraGroupInfo = require('./apis/getExtraGroupInfo.cjs');
73
+ var getFamilyProfile = require('./apis/getFamilyProfile.cjs');
74
+ var getFamilyUsage = require('./apis/getFamilyUsage.cjs');
75
+ var getFamilyViewerKey = require('./apis/getFamilyViewerKey.cjs');
62
76
  var getFriendBoardList = require('./apis/getFriendBoardList.cjs');
63
77
  var getFriendOnlines = require('./apis/getFriendOnlines.cjs');
64
78
  var getFriendRecommendations = require('./apis/getFriendRecommendations.cjs');
65
79
  var getFriendRequestStatus = require('./apis/getFriendRequestStatus.cjs');
80
+ var getFriendsEmojiStatus = require('./apis/getFriendsEmojiStatus.cjs');
66
81
  var getFullAvatar = require('./apis/getFullAvatar.cjs');
67
82
  var getGroupBlockedMember = require('./apis/getGroupBlockedMember.cjs');
68
83
  var getGroupChatHistory = require('./apis/getGroupChatHistory.cjs');
84
+ var getGroupCloudMessageJump = require('./apis/getGroupCloudMessageJump.cjs');
69
85
  var getGroupInfo = require('./apis/getGroupInfo.cjs');
70
86
  var getGroupInviteBoxInfo = require('./apis/getGroupInviteBoxInfo.cjs');
71
87
  var getGroupInviteBoxList = require('./apis/getGroupInviteBoxList.cjs');
@@ -74,31 +90,50 @@ var getGroupLinkInfo = require('./apis/getGroupLinkInfo.cjs');
74
90
  var getGroupMembersInfo = require('./apis/getGroupMembersInfo.cjs');
75
91
  var getHiddenConversations = require('./apis/getHiddenConversations.cjs');
76
92
  var getLabels = require('./apis/getLabels.cjs');
93
+ var getLastReadContactTab = require('./apis/getLastReadContactTab.cjs');
94
+ var getLastSeen = require('./apis/getLastSeen.cjs');
95
+ var getLastSeenReaction = require('./apis/getLastSeenReaction.cjs');
77
96
  var getListBank = require('./apis/getListBank.cjs');
78
97
  var getListBankAccount = require('./apis/getListBankAccount.cjs');
79
98
  var getListBoard = require('./apis/getListBoard.cjs');
80
99
  var getListDevice = require('./apis/getListDevice.cjs');
100
+ var getListPinTopics = require('./apis/getListPinTopics.cjs');
81
101
  var getListReminder = require('./apis/getListReminder.cjs');
102
+ var getMediaStorePreview = require('./apis/getMediaStorePreview.cjs');
103
+ var getMiniProfile = require('./apis/getMiniProfile.cjs');
82
104
  var getMultiUsersByPhones = require('./apis/getMultiUsersByPhones.cjs');
83
105
  var getMute = require('./apis/getMute.cjs');
84
106
  var getNoisedIds = require('./apis/getNoisedIds.cjs');
85
107
  var getOwnId = require('./apis/getOwnId.cjs');
86
108
  var getPendingGroupMembers = require('./apis/getPendingGroupMembers.cjs');
109
+ var getPersonalizedStickerList = require('./apis/getPersonalizedStickerList.cjs');
110
+ var getPhonebookV2 = require('./apis/getPhonebookV2.cjs');
87
111
  var getPinConversations = require('./apis/getPinConversations.cjs');
88
112
  var getPollDetail = require('./apis/getPollDetail.cjs');
89
113
  var getProductCatalogList = require('./apis/getProductCatalogList.cjs');
114
+ var getProfileRank = require('./apis/getProfileRank.cjs');
115
+ var getProfileVerificationStatus = require('./apis/getProfileVerificationStatus.cjs');
90
116
  var getQR = require('./apis/getQR.cjs');
91
117
  var getQuickMessageList = require('./apis/getQuickMessageList.cjs');
118
+ var getQuotaCommunity = require('./apis/getQuotaCommunity.cjs');
119
+ var getRecentSearchList = require('./apis/getRecentSearchList.cjs');
92
120
  var getRelatedFriendGroup = require('./apis/getRelatedFriendGroup.cjs');
93
121
  var getReminder = require('./apis/getReminder.cjs');
94
122
  var getReminderResponses = require('./apis/getReminderResponses.cjs');
95
123
  var getSentFriendRequest = require('./apis/getSentFriendRequest.cjs');
96
124
  var getSettings = require('./apis/getSettings.cjs');
125
+ var getStickerCategoriesV2 = require('./apis/getStickerCategoriesV2.cjs');
126
+ var getStickerCategoryData = require('./apis/getStickerCategoryData.cjs');
97
127
  var getStickerCategoryDetail = require('./apis/getStickerCategoryDetail.cjs');
128
+ var getStickerHello = require('./apis/getStickerHello.cjs');
129
+ var getStickerSuggestKeywords = require('./apis/getStickerSuggestKeywords.cjs');
130
+ var getStickerSuggestion = require('./apis/getStickerSuggestion.cjs');
98
131
  var getStickers = require('./apis/getStickers.cjs');
99
132
  var getStickersDetail = require('./apis/getStickersDetail.cjs');
100
133
  var getSyncData = require('./apis/getSyncData.cjs');
101
134
  var getUnreadMark = require('./apis/getUnreadMark.cjs');
135
+ var getUsageMyCloud = require('./apis/getUsageMyCloud.cjs');
136
+ var getUsageZCloud = require('./apis/getUsageZCloud.cjs');
102
137
  var getUserInfo = require('./apis/getUserInfo.cjs');
103
138
  var inviteUserToGroups = require('./apis/inviteUserToGroups.cjs');
104
139
  var joinGroupInviteBox = require('./apis/joinGroupInviteBox.cjs');
@@ -111,8 +146,10 @@ var lostFocus = require('./apis/lostFocus.cjs');
111
146
  var parseLink = require('./apis/parseLink.cjs');
112
147
  var preloadConversations = require('./apis/preloadConversations.cjs');
113
148
  var pullMobile = require('./apis/pullMobile.cjs');
149
+ var readContactTab = require('./apis/readContactTab.cjs');
114
150
  var registerCatalog = require('./apis/registerCatalog.cjs');
115
151
  var rejectFriendRequest = require('./apis/rejectFriendRequest.cjs');
152
+ var removeConversationMedia = require('./apis/removeConversationMedia.cjs');
116
153
  var removeFriend = require('./apis/removeFriend.cjs');
117
154
  var removeFriendAlias = require('./apis/removeFriendAlias.cjs');
118
155
  var removeGroupBlockedMember = require('./apis/removeGroupBlockedMember.cjs');
@@ -147,6 +184,7 @@ var sharePoll = require('./apis/sharePoll.cjs');
147
184
  var unblockUser = require('./apis/unblockUser.cjs');
148
185
  var undo = require('./apis/undo.cjs');
149
186
  var undoFriendRequest = require('./apis/undoFriendRequest.cjs');
187
+ var undoMultiMessage = require('./apis/undoMultiMessage.cjs');
150
188
  var updateActiveStatus = require('./apis/updateActiveStatus.cjs');
151
189
  var updateArchivedChatList = require('./apis/updateArchivedChatList.cjs');
152
190
  var updateAutoDeleteChat = require('./apis/updateAutoDeleteChat.cjs');
@@ -161,10 +199,13 @@ var updateProductCatalog = require('./apis/updateProductCatalog.cjs');
161
199
  var updateProfile = require('./apis/updateProfile.cjs');
162
200
  var updateProfileBio = require('./apis/updateProfileBio.cjs');
163
201
  var updateQuickMessage = require('./apis/updateQuickMessage.cjs');
202
+ var updateRecentSearch = require('./apis/updateRecentSearch.cjs');
164
203
  var updateSettings = require('./apis/updateSettings.cjs');
165
204
  var upgradeGroupToCommunity = require('./apis/upgradeGroupToCommunity.cjs');
166
205
  var uploadAttachment = require('./apis/uploadAttachment.cjs');
167
206
  var uploadProductPhoto = require('./apis/uploadProductPhoto.cjs');
207
+ var verifyCloudMedia = require('./apis/verifyCloudMedia.cjs');
208
+ var voiceToText = require('./apis/voiceToText.cjs');
168
209
  var votePoll = require('./apis/votePoll.cjs');
169
210
  var custom = require('./apis/custom.cjs');
170
211
 
@@ -189,6 +230,7 @@ class API {
189
230
  this.changeGroupAvatar = changeGroupAvatar.changeGroupAvatarFactory(ctx, this);
190
231
  this.changeGroupName = changeGroupName.changeGroupNameFactory(ctx, this);
191
232
  this.changeGroupOwner = changeGroupOwner.changeGroupOwnerFactory(ctx, this);
233
+ this.clearUnreadFriendRequests = clearUnreadFriendRequests.clearUnreadFriendRequestsFactory(ctx, this);
192
234
  this.createAutoReply = createAutoReply.createAutoReplyFactory(ctx, this);
193
235
  this.createBankAccount = createBankAccount.createBankAccountFactory(ctx, this);
194
236
  this.createCatalog = createCatalog.createCatalogFactory(ctx, this);
@@ -212,12 +254,14 @@ class API {
212
254
  this.editNote = editNote.editNoteFactory(ctx, this);
213
255
  this.editReminder = editReminder.editReminderFactory(ctx, this);
214
256
  this.enableGroupLink = enableGroupLink.enableGroupLinkFactory(ctx, this);
257
+ this.encryptGids = encryptGids.encryptGidsFactory(ctx, this);
215
258
  this.endVoiceCall = endVoiceCall.endVoiceCallFactory(ctx, this);
216
259
  this.fetchAccountInfo = fetchAccountInfo.fetchAccountInfoFactory(ctx, this);
217
260
  this.findUser = findUser.findUserFactory(ctx, this);
218
261
  this.findUserByUsername = findUserByUsername.findUserByUsernameFactory(ctx, this);
219
262
  this.forwardMessage = forwardMessage.forwardMessageFactory(ctx, this);
220
263
  this.getAliasList = getAliasList.getAliasListFactory(ctx, this);
264
+ this.getAliasListV2 = getAliasListV2.getAliasListV2Factory(ctx, this);
221
265
  this.getAllFriends = getAllFriends.getAllFriendsFactory(ctx, this);
222
266
  this.getAllGroups = getAllGroups.getAllGroupsFactory(ctx, this);
223
267
  this.getArchivedChatList = getArchivedChatList.getArchivedChatListFactory(ctx, this);
@@ -226,17 +270,30 @@ class API {
226
270
  this.getAvatarList = getAvatarList.getAvatarListFactory(ctx, this);
227
271
  this.getAvatarUrlProfile = getAvatarUrlProfile.getAvatarUrlProfileFactory(ctx, this);
228
272
  this.getBizAccount = getBizAccount.getBizAccountFactory(ctx, this);
273
+ this.getBlockFriends = getBlockFriends.getBlockFriendsFactory(ctx, this);
229
274
  this.getCatalogList = getCatalogList.getCatalogListFactory(ctx, this);
230
275
  this.getCloseFriends = getCloseFriends.getCloseFriendsFactory(ctx, this);
276
+ this.getCloudInfo = getCloudInfo.getCloudInfoFactory(ctx, this);
277
+ this.getCloudSettings = getCloudSettings.getCloudSettingsFactory(ctx, this);
278
+ this.getCloudViewerKey = getCloudViewerKey.getCloudViewerKeyFactory(ctx, this);
231
279
  this.getContext = getContext.getContextFactory(ctx, this);
280
+ this.getConversationMedia = getConversationMedia.getConversationMediaFactory(ctx, this);
232
281
  this.getCookie = getCookie.getCookieFactory(ctx, this);
282
+ this.getEmojiStatusConfig = getEmojiStatusConfig.getEmojiStatusConfigFactory(ctx, this);
283
+ this.getExtraFriendInfo = getExtraFriendInfo.getExtraFriendInfoFactory(ctx, this);
284
+ this.getExtraGroupInfo = getExtraGroupInfo.getExtraGroupInfoFactory(ctx, this);
285
+ this.getFamilyProfile = getFamilyProfile.getFamilyProfileFactory(ctx, this);
286
+ this.getFamilyUsage = getFamilyUsage.getFamilyUsageFactory(ctx, this);
287
+ this.getFamilyViewerKey = getFamilyViewerKey.getFamilyViewerKeyFactory(ctx, this);
233
288
  this.getFriendBoardList = getFriendBoardList.getFriendBoardListFactory(ctx, this);
234
289
  this.getFriendOnlines = getFriendOnlines.getFriendOnlinesFactory(ctx, this);
235
290
  this.getFriendRecommendations = getFriendRecommendations.getFriendRecommendationsFactory(ctx, this);
236
291
  this.getFriendRequestStatus = getFriendRequestStatus.getFriendRequestStatusFactory(ctx, this);
292
+ this.getFriendsEmojiStatus = getFriendsEmojiStatus.getFriendsEmojiStatusFactory(ctx, this);
237
293
  this.getFullAvatar = getFullAvatar.getFullAvatarFactory(ctx, this);
238
294
  this.getGroupBlockedMember = getGroupBlockedMember.getGroupBlockedMemberFactory(ctx, this);
239
295
  this.getGroupChatHistory = getGroupChatHistory.getGroupChatHistoryFactory(ctx, this);
296
+ this.getGroupCloudMessageJump = getGroupCloudMessageJump.getGroupCloudMessageJumpFactory(ctx, this);
240
297
  this.getGroupInfo = getGroupInfo.getGroupInfoFactory(ctx, this);
241
298
  this.getGroupInviteBoxInfo = getGroupInviteBoxInfo.getGroupInviteBoxInfoFactory(ctx, this);
242
299
  this.getGroupInviteBoxList = getGroupInviteBoxList.getGroupInviteBoxListFactory(ctx, this);
@@ -245,31 +302,50 @@ class API {
245
302
  this.getGroupMembersInfo = getGroupMembersInfo.getGroupMembersInfoFactory(ctx, this);
246
303
  this.getHiddenConversations = getHiddenConversations.getHiddenConversationsFactory(ctx, this);
247
304
  this.getLabels = getLabels.getLabelsFactory(ctx, this);
305
+ this.getLastReadContactTab = getLastReadContactTab.getLastReadContactTabFactory(ctx, this);
306
+ this.getLastSeen = getLastSeen.getLastSeenFactory(ctx, this);
307
+ this.getLastSeenReaction = getLastSeenReaction.getLastSeenReactionFactory(ctx, this);
248
308
  this.getListBank = getListBank.getListBankFactory(ctx, this);
249
309
  this.getListBankAccount = getListBankAccount.getListBankAccountFactory(ctx, this);
250
310
  this.getListBoard = getListBoard.getListBoardFactory(ctx, this);
251
311
  this.getListDevice = getListDevice.getListDeviceFactory(ctx, this);
312
+ this.getListPinTopics = getListPinTopics.getListPinTopicsFactory(ctx, this);
252
313
  this.getListReminder = getListReminder.getListReminderFactory(ctx, this);
314
+ this.getMediaStorePreview = getMediaStorePreview.getMediaStorePreviewFactory(ctx, this);
315
+ this.getMiniProfile = getMiniProfile.getMiniProfileFactory(ctx, this);
253
316
  this.getMultiUsersByPhones = getMultiUsersByPhones.getMultiUsersByPhonesFactory(ctx, this);
254
317
  this.getMute = getMute.getMuteFactory(ctx, this);
255
318
  this.getNoisedIds = getNoisedIds.getNoisedIdsFactory(ctx, this);
256
319
  this.getOwnId = getOwnId.getOwnIdFactory(ctx, this);
257
320
  this.getPendingGroupMembers = getPendingGroupMembers.getPendingGroupMembersFactory(ctx, this);
321
+ this.getPersonalizedStickerList = getPersonalizedStickerList.getPersonalizedStickerListFactory(ctx, this);
322
+ this.getPhonebookV2 = getPhonebookV2.getPhonebookV2Factory(ctx, this);
258
323
  this.getPinConversations = getPinConversations.getPinConversationsFactory(ctx, this);
259
324
  this.getPollDetail = getPollDetail.getPollDetailFactory(ctx, this);
260
325
  this.getProductCatalogList = getProductCatalogList.getProductCatalogListFactory(ctx, this);
326
+ this.getProfileRank = getProfileRank.getProfileRankFactory(ctx, this);
327
+ this.getProfileVerificationStatus = getProfileVerificationStatus.getProfileVerificationStatusFactory(ctx, this);
261
328
  this.getQR = getQR.getQRFactory(ctx, this);
262
329
  this.getQuickMessageList = getQuickMessageList.getQuickMessageListFactory(ctx, this);
330
+ this.getQuotaCommunity = getQuotaCommunity.getQuotaCommunityFactory(ctx, this);
331
+ this.getRecentSearchList = getRecentSearchList.getRecentSearchListFactory(ctx, this);
263
332
  this.getRelatedFriendGroup = getRelatedFriendGroup.getRelatedFriendGroupFactory(ctx, this);
264
333
  this.getReminder = getReminder.getReminderFactory(ctx, this);
265
334
  this.getReminderResponses = getReminderResponses.getReminderResponsesFactory(ctx, this);
266
335
  this.getSentFriendRequest = getSentFriendRequest.getSentFriendRequestFactory(ctx, this);
267
336
  this.getSettings = getSettings.getSettingsFactory(ctx, this);
337
+ this.getStickerCategoriesV2 = getStickerCategoriesV2.getStickerCategoriesV2Factory(ctx, this);
338
+ this.getStickerCategoryData = getStickerCategoryData.getStickerCategoryDataFactory(ctx, this);
268
339
  this.getStickerCategoryDetail = getStickerCategoryDetail.getStickerCategoryDetailFactory(ctx, this);
340
+ this.getStickerHello = getStickerHello.getStickerHelloFactory(ctx, this);
341
+ this.getStickerSuggestKeywords = getStickerSuggestKeywords.getStickerSuggestKeywordsFactory(ctx, this);
342
+ this.getStickerSuggestion = getStickerSuggestion.getStickerSuggestionFactory(ctx, this);
269
343
  this.getStickers = getStickers.getStickersFactory(ctx, this);
270
344
  this.getStickersDetail = getStickersDetail.getStickersDetailFactory(ctx, this);
271
345
  this.getSyncData = getSyncData.getSyncDataFactory(ctx, this);
272
346
  this.getUnreadMark = getUnreadMark.getUnreadMarkFactory(ctx, this);
347
+ this.getUsageMyCloud = getUsageMyCloud.getUsageMyCloudFactory(ctx, this);
348
+ this.getUsageZCloud = getUsageZCloud.getUsageZCloudFactory(ctx, this);
273
349
  this.getUserInfo = getUserInfo.getUserInfoFactory(ctx, this);
274
350
  this.inviteUserToGroups = inviteUserToGroups.inviteUserToGroupsFactory(ctx, this);
275
351
  this.joinGroupInviteBox = joinGroupInviteBox.joinGroupInviteBoxFactory(ctx, this);
@@ -282,8 +358,10 @@ class API {
282
358
  this.parseLink = parseLink.parseLinkFactory(ctx, this);
283
359
  this.preloadConversations = preloadConversations.preloadConversationsFactory(ctx, this);
284
360
  this.pullMobile = pullMobile.pullMobileFactory(ctx, this);
361
+ this.readContactTab = readContactTab.readContactTabFactory(ctx, this);
285
362
  this.registerCatalog = registerCatalog.registerCatalogFactory(ctx, this);
286
363
  this.rejectFriendRequest = rejectFriendRequest.rejectFriendRequestFactory(ctx, this);
364
+ this.removeConversationMedia = removeConversationMedia.removeConversationMediaFactory(ctx, this);
287
365
  this.removeFriend = removeFriend.removeFriendFactory(ctx, this);
288
366
  this.removeFriendAlias = removeFriendAlias.removeFriendAliasFactory(ctx, this);
289
367
  this.removeGroupBlockedMember = removeGroupBlockedMember.removeGroupBlockedMemberFactory(ctx, this);
@@ -318,6 +396,7 @@ class API {
318
396
  this.unblockUser = unblockUser.unblockUserFactory(ctx, this);
319
397
  this.undo = undo.undoFactory(ctx, this);
320
398
  this.undoFriendRequest = undoFriendRequest.undoFriendRequestFactory(ctx, this);
399
+ this.undoMultiMessage = undoMultiMessage.undoMultiMessageFactory(ctx, this);
321
400
  this.updateActiveStatus = updateActiveStatus.updateActiveStatusFactory(ctx, this);
322
401
  this.updateArchivedChatList = updateArchivedChatList.updateArchivedChatListFactory(ctx, this);
323
402
  this.updateAutoDeleteChat = updateAutoDeleteChat.updateAutoDeleteChatFactory(ctx, this);
@@ -332,10 +411,13 @@ class API {
332
411
  this.updateProfile = updateProfile.updateProfileFactory(ctx, this);
333
412
  this.updateProfileBio = updateProfileBio.updateProfileBioFactory(ctx, this);
334
413
  this.updateQuickMessage = updateQuickMessage.updateQuickMessageFactory(ctx, this);
414
+ this.updateRecentSearch = updateRecentSearch.updateRecentSearchFactory(ctx, this);
335
415
  this.updateSettings = updateSettings.updateSettingsFactory(ctx, this);
336
416
  this.upgradeGroupToCommunity = upgradeGroupToCommunity.upgradeGroupToCommunityFactory(ctx, this);
337
417
  this.uploadAttachment = uploadAttachment.uploadAttachmentFactory(ctx, this);
338
418
  this.uploadProductPhoto = uploadProductPhoto.uploadProductPhotoFactory(ctx, this);
419
+ this.verifyCloudMedia = verifyCloudMedia.verifyCloudMediaFactory(ctx, this);
420
+ this.voiceToText = voiceToText.voiceToTextFactory(ctx, this);
339
421
  this.votePoll = votePoll.votePollFactory(ctx, this);
340
422
  this.custom = custom.customFactory(ctx, this);
341
423
  }
@@ -177,8 +177,10 @@ Object.defineProperty(exports, "CallType", {
177
177
  get: function () { return sendVoiceCall.CallType; }
178
178
  });
179
179
  exports.decryptWithPrivateKey = utils.decryptWithPrivateKey;
180
+ exports.decryptZCloudAES = utils.decryptZCloudAES;
180
181
  exports.decryptZdbBuffer = utils.decryptZdbBuffer;
181
182
  exports.deriveZdbAesKey = utils.deriveZdbAesKey;
183
+ exports.encryptZCloudAES = utils.encryptZCloudAES;
182
184
  exports.generateRSAKeyPair = utils.generateRSAKeyPair;
183
185
  exports.parseZdbHeader = utils.parseZdbHeader;
184
186
  exports.API = apis.API;
@@ -931,6 +931,29 @@ function parseZdbHeader(zdbPlaintext) {
931
931
  }
932
932
  return { entries, xzOffset: offset };
933
933
  }
934
+ /**
935
+ * Encrypts a plaintext string for ZCloud / ZFamily APIs (`CLOUD_API` / `CLOUD_FAMILY_API`, module `"98yS"`),
936
+ * using AES-256-CBC with a random 16-byte IV prepended to the ciphertext before Base64 encoding.
937
+ */
938
+ function encryptZCloudAES(plainText, base64Key) {
939
+ const key = Buffer.from(base64Key, "base64");
940
+ const iv = crypto.randomBytes(16);
941
+ const cipher = crypto.createCipheriv("aes-256-cbc", key, iv);
942
+ const encrypted = Buffer.concat([cipher.update(plainText, "utf8"), cipher.final()]);
943
+ return Buffer.concat([iv, encrypted]).toString("base64");
944
+ }
945
+ /**
946
+ * Decrypts a Base64 payload from ZCloud / ZFamily APIs (`CLOUD_API` / `CLOUD_FAMILY_API`, module `"98yS"`),
947
+ * extracting the first 16 bytes as the AES-256-CBC IV and the remainder as PKCS#7-padded ciphertext.
948
+ */
949
+ function decryptZCloudAES(base64CipherText, base64Key) {
950
+ const key = Buffer.from(base64Key, "base64");
951
+ const raw = Buffer.from(base64CipherText, "base64");
952
+ const iv = raw.subarray(0, 16);
953
+ const ciphertext = raw.subarray(16);
954
+ const decipher = crypto.createDecipheriv("aes-256-cbc", key, iv);
955
+ return Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString("utf8");
956
+ }
934
957
 
935
958
  exports.ParamsEncryptor = ParamsEncryptor;
936
959
  exports.apiFactory = apiFactory;
@@ -940,10 +963,12 @@ exports.decodeEventData = decodeEventData;
940
963
  exports.decodeUnit8Array = decodeUnit8Array;
941
964
  exports.decryptResp = decryptResp;
942
965
  exports.decryptWithPrivateKey = decryptWithPrivateKey;
966
+ exports.decryptZCloudAES = decryptZCloudAES;
943
967
  exports.decryptZdbBuffer = decryptZdbBuffer;
944
968
  exports.deriveZdbAesKey = deriveZdbAesKey;
945
969
  exports.encodeAES = encodeAES;
946
970
  exports.encryptPin = encryptPin;
971
+ exports.encryptZCloudAES = encryptZCloudAES;
947
972
  exports.formatTime = formatTime;
948
973
  exports.generateRSAKeyPair = generateRSAKeyPair;
949
974
  exports.generateZaloUUID = generateZaloUUID;
package/dist/context.d.ts CHANGED
@@ -100,6 +100,10 @@ type LoginInfo = {
100
100
  recent_search: string[];
101
101
  group_e2e: string[];
102
102
  quick_message: string[];
103
+ ai_features: string[];
104
+ emoji_stt: string[];
105
+ backuppcmobile: string[];
106
+ banner: string[];
103
107
  };
104
108
  };
105
109
  type ExtraVer = {
package/dist/index.d.ts CHANGED
@@ -165,6 +165,47 @@ export type { FileData, ImageData, UploadAttachmentResponse, UploadAttachmentTyp
165
165
  export type { UploadProductPhotoPayload, UploadProductPhotoResponse } from "./apis/uploadProductPhoto.js";
166
166
  export type { VotePollResponse } from "./apis/votePoll.js";
167
167
  export type { CustomAPICallback, CustomAPIProps } from "./apis/custom.js";
168
+ export type { ClearUnreadFriendRequestsResponse } from "./apis/clearUnreadFriendRequests.js";
169
+ export type { EncryptGidsResponse } from "./apis/encryptGids.js";
170
+ export type { GetAliasListV2Response } from "./apis/getAliasListV2.js";
171
+ export type { GetBlockFriendsResponse } from "./apis/getBlockFriends.js";
172
+ export type { GetCloudInfoResponse } from "./apis/getCloudInfo.js";
173
+ export type { GetCloudSettingsResponse } from "./apis/getCloudSettings.js";
174
+ export type { GetCloudViewerKeyResponse } from "./apis/getCloudViewerKey.js";
175
+ export type { GetConversationMediaOptions, GetConversationMediaResponse } from "./apis/getConversationMedia.js";
176
+ export type { GetEmojiStatusConfigResponse } from "./apis/getEmojiStatusConfig.js";
177
+ export type { GetExtraFriendInfoResponse } from "./apis/getExtraFriendInfo.js";
178
+ export type { GetExtraGroupInfoResponse } from "./apis/getExtraGroupInfo.js";
179
+ export type { GetFamilyProfileResponse } from "./apis/getFamilyProfile.js";
180
+ export type { GetFamilyUsageResponse } from "./apis/getFamilyUsage.js";
181
+ export type { GetFamilyViewerKeyResponse } from "./apis/getFamilyViewerKey.js";
182
+ export type { GetFriendsEmojiStatusOptions, GetFriendsEmojiStatusResponse } from "./apis/getFriendsEmojiStatus.js";
183
+ export type { GetGroupCloudMessageJumpResponse } from "./apis/getGroupCloudMessageJump.js";
184
+ export type { GetLastReadContactTabResponse } from "./apis/getLastReadContactTab.js";
185
+ export type { GetLastSeenOptions, GetLastSeenResponse } from "./apis/getLastSeen.js";
186
+ export type { GetLastSeenReactionOptions, GetLastSeenReactionResponse } from "./apis/getLastSeenReaction.js";
187
+ export type { GetMediaStorePreviewResponse } from "./apis/getMediaStorePreview.js";
188
+ export type { GetMiniProfileResponse, MiniProfileItem } from "./apis/getMiniProfile.js";
189
+ export type { GetPersonalizedStickerListResponse } from "./apis/getPersonalizedStickerList.js";
190
+ export type { GetPhonebookV2Response } from "./apis/getPhonebookV2.js";
191
+ export type { GetProfileRankResponse } from "./apis/getProfileRank.js";
192
+ export type { GetProfileVerificationStatusResponse } from "./apis/getProfileVerificationStatus.js";
193
+ export type { GetQuotaCommunityResponse } from "./apis/getQuotaCommunity.js";
194
+ export type { GetRecentSearchListResponse } from "./apis/getRecentSearchList.js";
195
+ export type { GetStickerCategoriesV2Response, StickerCategoryV2Item } from "./apis/getStickerCategoriesV2.js";
196
+ export type { GetStickerCategoryDataResponse } from "./apis/getStickerCategoryData.js";
197
+ export type { GetStickerHelloResponse, StickerHelloItem } from "./apis/getStickerHello.js";
198
+ export type { GetStickerSuggestionOptions, GetStickerSuggestionResponse } from "./apis/getStickerSuggestion.js";
199
+ export type { GetStickerSuggestKeywordsResponse } from "./apis/getStickerSuggestKeywords.js";
200
+ export type { GetUsageMyCloudResponse } from "./apis/getUsageMyCloud.js";
201
+ export type { GetUsageZCloudResponse } from "./apis/getUsageZCloud.js";
202
+ export type { ReadContactTabResponse } from "./apis/readContactTab.js";
203
+ export type { RemoveConversationMediaOptions, RemoveConversationMediaResponse } from "./apis/removeConversationMedia.js";
204
+ export type { UndoMultiMessageItem, UndoMultiMessageResponse } from "./apis/undoMultiMessage.js";
205
+ export type { UpdateRecentSearchOptions, UpdateRecentSearchResponse } from "./apis/updateRecentSearch.js";
206
+ export type { VerifyCloudMediaOptions, VerifyCloudMediaResponse } from "./apis/verifyCloudMedia.js";
207
+ export type { VoiceToTextResponse } from "./apis/voiceToText.js";
208
+ export type { Voice2TextEvent, Voice2TextEventData } from "./apis/listen.js";
168
209
  export { CloseReason } from "./apis/listen.js";
169
210
  export { LoginQRCallbackEventType } from "./apis/loginQR.js";
170
211
  export { FriendRecommendationsType } from "./apis/getFriendRecommendations.js";
@@ -176,4 +217,4 @@ export { ChatTTL } from "./apis/updateAutoDeleteChat.js";
176
217
  export { UpdateLangAvailableLanguages } from "./apis/updateLang.js";
177
218
  export { UpdateSettingsType } from "./apis/updateSettings.js";
178
219
  export { CallType } from "./apis/sendVoiceCall.js";
179
- export { generateRSAKeyPair, decryptWithPrivateKey, deriveZdbAesKey, decryptZdbBuffer, parseZdbHeader, type ZdbTocEntry, } from "./utils.js";
220
+ export { generateRSAKeyPair, decryptWithPrivateKey, deriveZdbAesKey, decryptZdbBuffer, parseZdbHeader, encryptZCloudAES, decryptZCloudAES, type ZdbTocEntry, } from "./utils.js";
package/dist/index.js CHANGED
@@ -13,4 +13,4 @@ export { ChatTTL } from "./apis/updateAutoDeleteChat.js";
13
13
  export { UpdateLangAvailableLanguages } from "./apis/updateLang.js";
14
14
  export { UpdateSettingsType } from "./apis/updateSettings.js";
15
15
  export { CallType } from "./apis/sendVoiceCall.js";
16
- export { generateRSAKeyPair, decryptWithPrivateKey, deriveZdbAesKey, decryptZdbBuffer, parseZdbHeader, } from "./utils.js";
16
+ export { generateRSAKeyPair, decryptWithPrivateKey, deriveZdbAesKey, decryptZdbBuffer, parseZdbHeader, encryptZCloudAES, decryptZCloudAES, } from "./utils.js";
package/dist/utils.d.ts CHANGED
@@ -255,4 +255,14 @@ export declare function parseZdbHeader(zdbPlaintext: Buffer): {
255
255
  entries: ZdbTocEntry[];
256
256
  xzOffset: number;
257
257
  };
258
+ /**
259
+ * Encrypts a plaintext string for ZCloud / ZFamily APIs (`CLOUD_API` / `CLOUD_FAMILY_API`, module `"98yS"`),
260
+ * using AES-256-CBC with a random 16-byte IV prepended to the ciphertext before Base64 encoding.
261
+ */
262
+ export declare function encryptZCloudAES(plainText: string, base64Key: string): string;
263
+ /**
264
+ * Decrypts a Base64 payload from ZCloud / ZFamily APIs (`CLOUD_API` / `CLOUD_FAMILY_API`, module `"98yS"`),
265
+ * extracting the first 16 bytes as the AES-256-CBC IV and the remainder as PKCS#7-padded ciphertext.
266
+ */
267
+ export declare function decryptZCloudAES(base64CipherText: string, base64Key: string): string;
258
268
  export {};
package/dist/utils.js CHANGED
@@ -981,3 +981,26 @@ export function parseZdbHeader(zdbPlaintext) {
981
981
  }
982
982
  return { entries, xzOffset: offset };
983
983
  }
984
+ /**
985
+ * Encrypts a plaintext string for ZCloud / ZFamily APIs (`CLOUD_API` / `CLOUD_FAMILY_API`, module `"98yS"`),
986
+ * using AES-256-CBC with a random 16-byte IV prepended to the ciphertext before Base64 encoding.
987
+ */
988
+ export function encryptZCloudAES(plainText, base64Key) {
989
+ const key = Buffer.from(base64Key, "base64");
990
+ const iv = crypto.randomBytes(16);
991
+ const cipher = crypto.createCipheriv("aes-256-cbc", key, iv);
992
+ const encrypted = Buffer.concat([cipher.update(plainText, "utf8"), cipher.final()]);
993
+ return Buffer.concat([iv, encrypted]).toString("base64");
994
+ }
995
+ /**
996
+ * Decrypts a Base64 payload from ZCloud / ZFamily APIs (`CLOUD_API` / `CLOUD_FAMILY_API`, module `"98yS"`),
997
+ * extracting the first 16 bytes as the AES-256-CBC IV and the remainder as PKCS#7-padded ciphertext.
998
+ */
999
+ export function decryptZCloudAES(base64CipherText, base64Key) {
1000
+ const key = Buffer.from(base64Key, "base64");
1001
+ const raw = Buffer.from(base64CipherText, "base64");
1002
+ const iv = raw.subarray(0, 16);
1003
+ const ciphertext = raw.subarray(16);
1004
+ const decipher = crypto.createDecipheriv("aes-256-cbc", key, iv);
1005
+ return Buffer.concat([decipher.update(ciphertext), decipher.final()]).toString("utf8");
1006
+ }