@warriorteam/redai-zalo-sdk 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +448 -0
- package/dist/clients/base-client.d.ts +67 -0
- package/dist/clients/base-client.d.ts.map +1 -0
- package/dist/clients/base-client.js +297 -0
- package/dist/clients/base-client.js.map +1 -0
- package/dist/clients/zalo-client.d.ts +131 -0
- package/dist/clients/zalo-client.d.ts.map +1 -0
- package/dist/clients/zalo-client.js +215 -0
- package/dist/clients/zalo-client.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +82 -0
- package/dist/index.js.map +1 -0
- package/dist/services/article.service.d.ts +144 -0
- package/dist/services/article.service.d.ts.map +1 -0
- package/dist/services/article.service.js +518 -0
- package/dist/services/article.service.js.map +1 -0
- package/dist/services/auth.service.d.ts +55 -0
- package/dist/services/auth.service.d.ts.map +1 -0
- package/dist/services/auth.service.js +269 -0
- package/dist/services/auth.service.js.map +1 -0
- package/dist/services/consultation.service.d.ts +73 -0
- package/dist/services/consultation.service.d.ts.map +1 -0
- package/dist/services/consultation.service.js +208 -0
- package/dist/services/consultation.service.js.map +1 -0
- package/dist/services/general-message.service.d.ts +85 -0
- package/dist/services/general-message.service.d.ts.map +1 -0
- package/dist/services/general-message.service.js +248 -0
- package/dist/services/general-message.service.js.map +1 -0
- package/dist/services/group-management.service.d.ts +220 -0
- package/dist/services/group-management.service.d.ts.map +1 -0
- package/dist/services/group-management.service.js +562 -0
- package/dist/services/group-management.service.js.map +1 -0
- package/dist/services/group-message.service.d.ts +102 -0
- package/dist/services/group-message.service.d.ts.map +1 -0
- package/dist/services/group-message.service.js +233 -0
- package/dist/services/group-message.service.js.map +1 -0
- package/dist/services/message-management.service.d.ts +135 -0
- package/dist/services/message-management.service.d.ts.map +1 -0
- package/dist/services/message-management.service.js +237 -0
- package/dist/services/message-management.service.js.map +1 -0
- package/dist/services/oa.service.d.ts +67 -0
- package/dist/services/oa.service.d.ts.map +1 -0
- package/dist/services/oa.service.js +223 -0
- package/dist/services/oa.service.js.map +1 -0
- package/dist/services/promotion.service.d.ts +114 -0
- package/dist/services/promotion.service.d.ts.map +1 -0
- package/dist/services/promotion.service.js +247 -0
- package/dist/services/promotion.service.js.map +1 -0
- package/dist/services/tag.service.d.ts +144 -0
- package/dist/services/tag.service.d.ts.map +1 -0
- package/dist/services/tag.service.js +184 -0
- package/dist/services/tag.service.js.map +1 -0
- package/dist/services/transaction.service.d.ts +110 -0
- package/dist/services/transaction.service.d.ts.map +1 -0
- package/dist/services/transaction.service.js +231 -0
- package/dist/services/transaction.service.js.map +1 -0
- package/dist/services/user-management.service.d.ts +117 -0
- package/dist/services/user-management.service.d.ts.map +1 -0
- package/dist/services/user-management.service.js +239 -0
- package/dist/services/user-management.service.js.map +1 -0
- package/dist/services/user.service.d.ts +84 -0
- package/dist/services/user.service.d.ts.map +1 -0
- package/dist/services/user.service.js +323 -0
- package/dist/services/user.service.js.map +1 -0
- package/dist/services/video-upload.service.d.ts +83 -0
- package/dist/services/video-upload.service.d.ts.map +1 -0
- package/dist/services/video-upload.service.js +267 -0
- package/dist/services/video-upload.service.js.map +1 -0
- package/dist/services/zns.service.d.ts +116 -0
- package/dist/services/zns.service.d.ts.map +1 -0
- package/dist/services/zns.service.js +234 -0
- package/dist/services/zns.service.js.map +1 -0
- package/dist/types/article.d.ts +352 -0
- package/dist/types/article.d.ts.map +1 -0
- package/dist/types/article.js +70 -0
- package/dist/types/article.js.map +1 -0
- package/dist/types/auth.d.ts +233 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +39 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/common.d.ts +237 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +42 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/group.d.ts +523 -0
- package/dist/types/group.d.ts.map +1 -0
- package/dist/types/group.js +6 -0
- package/dist/types/group.js.map +1 -0
- package/dist/types/message.d.ts +333 -0
- package/dist/types/message.d.ts.map +1 -0
- package/dist/types/message.js +17 -0
- package/dist/types/message.js.map +1 -0
- package/dist/types/oa.d.ts +285 -0
- package/dist/types/oa.d.ts.map +1 -0
- package/dist/types/oa.js +25 -0
- package/dist/types/oa.js.map +1 -0
- package/dist/types/social.d.ts +427 -0
- package/dist/types/social.d.ts.map +1 -0
- package/dist/types/social.js +6 -0
- package/dist/types/social.js.map +1 -0
- package/dist/types/user-management.d.ts +280 -0
- package/dist/types/user-management.d.ts.map +1 -0
- package/dist/types/user-management.js +6 -0
- package/dist/types/user-management.js.map +1 -0
- package/dist/types/user.d.ts +365 -0
- package/dist/types/user.d.ts.map +1 -0
- package/dist/types/user.js +17 -0
- package/dist/types/user.js.map +1 -0
- package/dist/types/webhook.d.ts +1972 -0
- package/dist/types/webhook.d.ts.map +1 -0
- package/dist/types/webhook.js +419 -0
- package/dist/types/webhook.js.map +1 -0
- package/dist/types/zns.d.ts +277 -0
- package/dist/types/zns.d.ts.map +1 -0
- package/dist/types/zns.js +6 -0
- package/dist/types/zns.js.map +1 -0
- package/dist/zalo-sdk.d.ts +228 -0
- package/dist/zalo-sdk.d.ts.map +1 -0
- package/dist/zalo-sdk.js +307 -0
- package/dist/zalo-sdk.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupManagementService = void 0;
|
|
4
|
+
const common_1 = require("../types/common");
|
|
5
|
+
/**
|
|
6
|
+
* Service for handling Zalo Official Account Group Management Framework (GMF) APIs
|
|
7
|
+
*
|
|
8
|
+
* CONDITIONS FOR USING ZALO GMF GROUP MANAGEMENT:
|
|
9
|
+
*
|
|
10
|
+
* 1. GENERAL CONDITIONS:
|
|
11
|
+
* - OA must be granted permission to use GMF (Group Message Framework) feature
|
|
12
|
+
* - Access token must have "manage_group" and "group_message" scopes
|
|
13
|
+
* - OA must have active status and be verified
|
|
14
|
+
* - Must comply with limits on number of groups and members
|
|
15
|
+
*
|
|
16
|
+
* 2. CREATE NEW GROUP:
|
|
17
|
+
* - Group name: required, max 100 characters, no special characters
|
|
18
|
+
* - Description: optional, max 500 characters
|
|
19
|
+
* - Avatar: optional, JPG/PNG format, max 5MB
|
|
20
|
+
* - Initial members: max 200 people, must be users who have interacted with OA
|
|
21
|
+
* - OA automatically becomes admin of the group
|
|
22
|
+
*
|
|
23
|
+
* 3. MEMBER MANAGEMENT:
|
|
24
|
+
* - Only admins can invite/remove members
|
|
25
|
+
* - Invite members: max 50 people per time, users must have interacted with OA
|
|
26
|
+
* - Remove members: cannot remove other admins, must have at least 1 admin
|
|
27
|
+
* - Members can leave group themselves
|
|
28
|
+
*
|
|
29
|
+
* 4. ADMIN MANAGEMENT:
|
|
30
|
+
* - Only current admins can add/remove other admins
|
|
31
|
+
* - Must have at least 1 admin in group
|
|
32
|
+
* - OA always has admin rights and cannot be removed
|
|
33
|
+
*
|
|
34
|
+
* 5. LIMITS AND CONSTRAINTS:
|
|
35
|
+
* - Maximum groups: according to service package (usually 10-100 groups)
|
|
36
|
+
* - Maximum members per group: 200 people
|
|
37
|
+
* - Group creation frequency: max 10 groups/day
|
|
38
|
+
* - Member invitation frequency: max 500 invitations/day
|
|
39
|
+
*/
|
|
40
|
+
class GroupManagementService {
|
|
41
|
+
constructor(client) {
|
|
42
|
+
this.client = client;
|
|
43
|
+
this.apiUrl = "https://openapi.zalo.me/v3.0/oa";
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Create new group chat with asset_id
|
|
47
|
+
* @param accessToken OA access token
|
|
48
|
+
* @param groupData Group information to create
|
|
49
|
+
* @returns Created group information
|
|
50
|
+
*/
|
|
51
|
+
async createGroup(accessToken, groupData) {
|
|
52
|
+
try {
|
|
53
|
+
// Validate input
|
|
54
|
+
if (!groupData.group_name || groupData.group_name.trim().length === 0) {
|
|
55
|
+
throw new common_1.ZaloSDKError("Group name cannot be empty", -1);
|
|
56
|
+
}
|
|
57
|
+
if (groupData.group_name.length > 100) {
|
|
58
|
+
throw new common_1.ZaloSDKError("Group name cannot exceed 100 characters", -1);
|
|
59
|
+
}
|
|
60
|
+
if (groupData.member_uids.length > 99) {
|
|
61
|
+
throw new common_1.ZaloSDKError("Initial member count cannot exceed 99 people", -1);
|
|
62
|
+
}
|
|
63
|
+
if (groupData.member_uids.length === 0) {
|
|
64
|
+
throw new common_1.ZaloSDKError("Member list cannot be empty", -1);
|
|
65
|
+
}
|
|
66
|
+
const data = {
|
|
67
|
+
group_name: groupData.group_name.trim(),
|
|
68
|
+
...(groupData.description && {
|
|
69
|
+
group_description: groupData.description.trim(),
|
|
70
|
+
}),
|
|
71
|
+
asset_id: groupData.asset_id,
|
|
72
|
+
member_user_ids: groupData.member_uids,
|
|
73
|
+
};
|
|
74
|
+
const response = await this.client.apiPost(`${this.apiUrl}/group/creategroupwithoa`, accessToken, data);
|
|
75
|
+
return response;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
throw this.handleGroupManagementError(error, "Failed to create group");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get detailed group information
|
|
83
|
+
* @param accessToken OA access token
|
|
84
|
+
* @param groupId Group ID
|
|
85
|
+
* @returns Detailed group information including group_info, asset_info and group_setting
|
|
86
|
+
*/
|
|
87
|
+
async getGroupInfo(accessToken, groupId) {
|
|
88
|
+
try {
|
|
89
|
+
if (!groupId || groupId.trim().length === 0) {
|
|
90
|
+
throw new common_1.ZaloSDKError("Group ID cannot be empty", -1);
|
|
91
|
+
}
|
|
92
|
+
const response = await this.client.apiGet(`${this.apiUrl}/group/getgroup`, accessToken, {
|
|
93
|
+
group_id: groupId.trim(),
|
|
94
|
+
});
|
|
95
|
+
if (response.error !== 0) {
|
|
96
|
+
throw new common_1.ZaloSDKError(response.message || "Failed to get group info", response.error);
|
|
97
|
+
}
|
|
98
|
+
return response.data;
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw this.handleGroupManagementError(error, "Failed to get group information");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Update group information
|
|
106
|
+
* @param accessToken OA access token
|
|
107
|
+
* @param groupId Group ID
|
|
108
|
+
* @param updateData Information to update
|
|
109
|
+
* @returns Update result
|
|
110
|
+
*/
|
|
111
|
+
async updateGroupInfo(accessToken, groupId, updateData) {
|
|
112
|
+
try {
|
|
113
|
+
// Validate input
|
|
114
|
+
if (updateData.group_name && updateData.group_name.length > 100) {
|
|
115
|
+
throw new common_1.ZaloSDKError("Group name cannot exceed 100 characters", -1);
|
|
116
|
+
}
|
|
117
|
+
if (updateData.description && updateData.description.length > 500) {
|
|
118
|
+
throw new common_1.ZaloSDKError("Group description cannot exceed 500 characters", -1);
|
|
119
|
+
}
|
|
120
|
+
const data = {
|
|
121
|
+
...(updateData.group_name && {
|
|
122
|
+
group_name: updateData.group_name.trim(),
|
|
123
|
+
}),
|
|
124
|
+
...(updateData.description && {
|
|
125
|
+
description: updateData.description.trim(),
|
|
126
|
+
}),
|
|
127
|
+
};
|
|
128
|
+
const response = await this.client.apiPut(`${this.apiUrl}/group/${groupId}/info`, accessToken, data);
|
|
129
|
+
return response;
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
throw this.handleGroupManagementError(error, "Failed to update group information");
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Update group avatar
|
|
137
|
+
* @param accessToken OA access token
|
|
138
|
+
* @param groupId Group ID
|
|
139
|
+
* @param avatarData New avatar information
|
|
140
|
+
* @returns Update result
|
|
141
|
+
*/
|
|
142
|
+
async updateGroupAvatar(accessToken, groupId, avatarData) {
|
|
143
|
+
try {
|
|
144
|
+
const response = await this.client.apiPut(`${this.apiUrl}/group/${groupId}/avatar`, accessToken, avatarData);
|
|
145
|
+
return response;
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
throw this.handleGroupManagementError(error, "Failed to update group avatar");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Invite members to group
|
|
153
|
+
* @param accessToken OA access token
|
|
154
|
+
* @param groupId Group ID
|
|
155
|
+
* @param inviteData List of user IDs to invite
|
|
156
|
+
* @returns Invitation result
|
|
157
|
+
*/
|
|
158
|
+
async inviteMembers(accessToken, groupId, inviteData) {
|
|
159
|
+
try {
|
|
160
|
+
// Validate input
|
|
161
|
+
if (inviteData.member_uids.length === 0) {
|
|
162
|
+
throw new common_1.ZaloSDKError("Member list cannot be empty", -1);
|
|
163
|
+
}
|
|
164
|
+
if (inviteData.member_uids.length > 50) {
|
|
165
|
+
throw new common_1.ZaloSDKError("Cannot invite more than 50 people at once", -1);
|
|
166
|
+
}
|
|
167
|
+
const requestData = {
|
|
168
|
+
group_id: groupId,
|
|
169
|
+
member_user_ids: inviteData.member_uids,
|
|
170
|
+
};
|
|
171
|
+
const response = await this.client.apiPost(`${this.apiUrl}/group/invite`, accessToken, requestData);
|
|
172
|
+
return {
|
|
173
|
+
success: response.error === 0,
|
|
174
|
+
invited_count: inviteData.member_uids.length,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
throw this.handleGroupManagementError(error, "Failed to invite members");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get list of pending members
|
|
183
|
+
* @param accessToken OA access token
|
|
184
|
+
* @param groupId Group ID
|
|
185
|
+
* @param offset Offset for pagination (default: 0)
|
|
186
|
+
* @param count Maximum number to return (default: 20, max: 50)
|
|
187
|
+
* @returns List of pending members
|
|
188
|
+
*/
|
|
189
|
+
async getPendingMembers(accessToken, groupId, offset = 0, count = 5) {
|
|
190
|
+
try {
|
|
191
|
+
// Validate input
|
|
192
|
+
if (!groupId || groupId.trim().length === 0) {
|
|
193
|
+
throw new common_1.ZaloSDKError("Group ID cannot be empty", -1);
|
|
194
|
+
}
|
|
195
|
+
if (offset < 0) {
|
|
196
|
+
throw new common_1.ZaloSDKError("Offset must be >= 0", -1);
|
|
197
|
+
}
|
|
198
|
+
if (count <= 0 || count > 50) {
|
|
199
|
+
throw new common_1.ZaloSDKError("Count must be from 1 to 50", -1);
|
|
200
|
+
}
|
|
201
|
+
const response = await this.client.apiGet(`${this.apiUrl}/group/listpendinginvite`, accessToken, {
|
|
202
|
+
group_id: groupId.trim(),
|
|
203
|
+
offset: offset.toString(),
|
|
204
|
+
count: count.toString(),
|
|
205
|
+
});
|
|
206
|
+
return response;
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
throw this.handleGroupManagementError(error, "Failed to get pending members");
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Accept pending members to group
|
|
214
|
+
* @param accessToken OA access token
|
|
215
|
+
* @param groupId Group ID
|
|
216
|
+
* @param memberUserIds List of user IDs to accept
|
|
217
|
+
* @returns Accept result
|
|
218
|
+
*/
|
|
219
|
+
async acceptPendingMembers(accessToken, groupId, memberUserIds) {
|
|
220
|
+
try {
|
|
221
|
+
// Validate input
|
|
222
|
+
if (!groupId || groupId.trim().length === 0) {
|
|
223
|
+
throw new common_1.ZaloSDKError("Group ID cannot be empty", -1);
|
|
224
|
+
}
|
|
225
|
+
if (!memberUserIds || memberUserIds.length === 0) {
|
|
226
|
+
throw new common_1.ZaloSDKError("Member user IDs list cannot be empty", -1);
|
|
227
|
+
}
|
|
228
|
+
if (memberUserIds.length > 100) {
|
|
229
|
+
throw new common_1.ZaloSDKError("Cannot accept more than 100 members at once", -1);
|
|
230
|
+
}
|
|
231
|
+
// Validate user IDs
|
|
232
|
+
const validUserIds = memberUserIds.filter((id) => id && id.trim().length > 0);
|
|
233
|
+
if (validUserIds.length === 0) {
|
|
234
|
+
throw new common_1.ZaloSDKError("No valid user IDs found", -1);
|
|
235
|
+
}
|
|
236
|
+
const requestBody = {
|
|
237
|
+
group_id: groupId.trim(),
|
|
238
|
+
member_user_ids: validUserIds.map((id) => id.trim()),
|
|
239
|
+
};
|
|
240
|
+
const response = await this.client.apiPost(`${this.apiUrl}/group/acceptpendinginvite`, accessToken, requestBody);
|
|
241
|
+
return response;
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
throw this.handleGroupManagementError(error, "Failed to accept pending members");
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Reject pending members from group
|
|
249
|
+
* @param accessToken OA access token
|
|
250
|
+
* @param groupId Group ID
|
|
251
|
+
* @param memberUserIds List of user IDs to reject
|
|
252
|
+
* @returns Reject result
|
|
253
|
+
*/
|
|
254
|
+
async rejectPendingMembers(accessToken, groupId, memberUserIds) {
|
|
255
|
+
try {
|
|
256
|
+
// Validate input
|
|
257
|
+
if (!groupId || groupId.trim().length === 0) {
|
|
258
|
+
throw new common_1.ZaloSDKError("Group ID cannot be empty", -1);
|
|
259
|
+
}
|
|
260
|
+
if (!memberUserIds || memberUserIds.length === 0) {
|
|
261
|
+
throw new common_1.ZaloSDKError("Member user IDs list cannot be empty", -1);
|
|
262
|
+
}
|
|
263
|
+
if (memberUserIds.length > 100) {
|
|
264
|
+
throw new common_1.ZaloSDKError("Cannot reject more than 100 members at once", -1);
|
|
265
|
+
}
|
|
266
|
+
// Validate user IDs
|
|
267
|
+
const validUserIds = memberUserIds.filter((id) => id && id.trim().length > 0);
|
|
268
|
+
if (validUserIds.length === 0) {
|
|
269
|
+
throw new common_1.ZaloSDKError("No valid user IDs found", -1);
|
|
270
|
+
}
|
|
271
|
+
const requestBody = {
|
|
272
|
+
group_id: groupId.trim(),
|
|
273
|
+
member_user_ids: validUserIds.map((id) => id.trim()),
|
|
274
|
+
};
|
|
275
|
+
const response = await this.client.apiPost(`${this.apiUrl}/group/rejectpendinginvite`, accessToken, requestBody);
|
|
276
|
+
return response;
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
throw this.handleGroupManagementError(error, "Failed to reject pending members");
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Remove members from group
|
|
284
|
+
* @param accessToken OA access token
|
|
285
|
+
* @param groupId Group ID
|
|
286
|
+
* @param memberUserIds List of user IDs to remove
|
|
287
|
+
* @returns Remove result
|
|
288
|
+
*/
|
|
289
|
+
async removeMembers(accessToken, groupId, memberUserIds) {
|
|
290
|
+
try {
|
|
291
|
+
// Validate input
|
|
292
|
+
if (!groupId || groupId.trim().length === 0) {
|
|
293
|
+
throw new common_1.ZaloSDKError("Group ID cannot be empty", -1);
|
|
294
|
+
}
|
|
295
|
+
if (!memberUserIds || memberUserIds.length === 0) {
|
|
296
|
+
throw new common_1.ZaloSDKError("Member user IDs list cannot be empty", -1);
|
|
297
|
+
}
|
|
298
|
+
if (memberUserIds.length > 100) {
|
|
299
|
+
throw new common_1.ZaloSDKError("Cannot remove more than 100 members at once", -1);
|
|
300
|
+
}
|
|
301
|
+
// Validate user IDs
|
|
302
|
+
const validUserIds = memberUserIds.filter((id) => id && id.trim().length > 0);
|
|
303
|
+
if (validUserIds.length === 0) {
|
|
304
|
+
throw new common_1.ZaloSDKError("No valid user IDs found", -1);
|
|
305
|
+
}
|
|
306
|
+
const requestBody = {
|
|
307
|
+
group_id: groupId.trim(),
|
|
308
|
+
member_user_ids: validUserIds.map((id) => id.trim()),
|
|
309
|
+
};
|
|
310
|
+
const response = await this.client.apiPost(`${this.apiUrl}/group/removemembers`, accessToken, requestBody);
|
|
311
|
+
return response;
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
throw this.handleGroupManagementError(error, "Failed to remove members");
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Add admin rights to members
|
|
319
|
+
* @param accessToken OA access token
|
|
320
|
+
* @param groupId Group ID
|
|
321
|
+
* @param adminData List of user IDs to add admin rights
|
|
322
|
+
* @returns Add admin result
|
|
323
|
+
*/
|
|
324
|
+
async addAdmins(accessToken, groupId, adminData) {
|
|
325
|
+
try {
|
|
326
|
+
const requestData = {
|
|
327
|
+
group_id: groupId,
|
|
328
|
+
member_user_ids: adminData.admin_uids,
|
|
329
|
+
};
|
|
330
|
+
const response = await this.client.apiPost(`${this.apiUrl}/group/addadmins`, accessToken, requestData);
|
|
331
|
+
return response;
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
throw this.handleGroupManagementError(error, "Failed to add admins");
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Remove admin rights from members
|
|
339
|
+
* @param accessToken OA access token
|
|
340
|
+
* @param groupId Group ID
|
|
341
|
+
* @param adminData List of user IDs to remove admin rights
|
|
342
|
+
* @returns Remove admin result
|
|
343
|
+
*/
|
|
344
|
+
async removeAdmins(accessToken, groupId, adminData) {
|
|
345
|
+
try {
|
|
346
|
+
const requestData = {
|
|
347
|
+
group_id: groupId,
|
|
348
|
+
member_user_ids: adminData.admin_uids,
|
|
349
|
+
};
|
|
350
|
+
const response = await this.client.apiPost(`${this.apiUrl}/group/removeadmins`, accessToken, requestData);
|
|
351
|
+
return response;
|
|
352
|
+
}
|
|
353
|
+
catch (error) {
|
|
354
|
+
throw this.handleGroupManagementError(error, "Failed to remove admins");
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Delete group chat (Disband group)
|
|
359
|
+
* @param accessToken OA access token
|
|
360
|
+
* @param groupId Group ID to delete
|
|
361
|
+
* @returns Delete result
|
|
362
|
+
*/
|
|
363
|
+
async deleteGroup(accessToken, groupId) {
|
|
364
|
+
try {
|
|
365
|
+
const requestData = {
|
|
366
|
+
group_id: groupId,
|
|
367
|
+
};
|
|
368
|
+
const response = await this.client.apiPost(`${this.apiUrl}/group/delete`, accessToken, requestData);
|
|
369
|
+
return response;
|
|
370
|
+
}
|
|
371
|
+
catch (error) {
|
|
372
|
+
throw this.handleGroupManagementError(error, "Failed to delete group");
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Get list of OA groups
|
|
377
|
+
* @param accessToken OA access token
|
|
378
|
+
* @param offset Offset for pagination (default: 0)
|
|
379
|
+
* @param count Maximum number to return (default: 20, max: 50)
|
|
380
|
+
* @returns List of OA groups
|
|
381
|
+
*/
|
|
382
|
+
async getGroupsOfOA(accessToken, offset = 0, count = 20) {
|
|
383
|
+
try {
|
|
384
|
+
// Validate access token
|
|
385
|
+
if (!accessToken || accessToken.trim().length === 0) {
|
|
386
|
+
throw new common_1.ZaloSDKError("Access token cannot be empty", -1);
|
|
387
|
+
}
|
|
388
|
+
const response = await this.client.apiGet(`${this.apiUrl}/group/getgroupsofoa`, accessToken, {
|
|
389
|
+
offset: offset.toString(),
|
|
390
|
+
count: Math.min(Math.max(count, 1), 50).toString(),
|
|
391
|
+
});
|
|
392
|
+
if (response.error !== 0) {
|
|
393
|
+
throw new common_1.ZaloSDKError(response.message || "Failed to get groups of OA", response.error);
|
|
394
|
+
}
|
|
395
|
+
if (!response.data) {
|
|
396
|
+
throw new common_1.ZaloSDKError("No data received from Zalo API", -1);
|
|
397
|
+
}
|
|
398
|
+
return {
|
|
399
|
+
groups: response.data.groups || [],
|
|
400
|
+
total: response.data.total || 0,
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
catch (error) {
|
|
404
|
+
throw this.handleGroupManagementError(error, "Failed to get groups of OA");
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Get group quota information and asset_id
|
|
409
|
+
* @param accessToken OA access token
|
|
410
|
+
* @param productType Product type (optional)
|
|
411
|
+
* @param quotaType Quota type (optional)
|
|
412
|
+
* @returns Group quota information including asset_id
|
|
413
|
+
*/
|
|
414
|
+
async getGroupQuota(accessToken, productType, quotaType) {
|
|
415
|
+
try {
|
|
416
|
+
const quotaRequest = {
|
|
417
|
+
quota_owner: "OA",
|
|
418
|
+
...(productType && { product_type: productType }),
|
|
419
|
+
...(quotaType && { quota_type: quotaType }),
|
|
420
|
+
};
|
|
421
|
+
const response = await this.client.apiPost(`${this.apiUrl}/quota/group`, accessToken, quotaRequest);
|
|
422
|
+
return response;
|
|
423
|
+
}
|
|
424
|
+
catch (error) {
|
|
425
|
+
throw this.handleGroupManagementError(error, "Failed to get group quota");
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Get asset_id for creating GMF group
|
|
430
|
+
* @param accessToken OA access token
|
|
431
|
+
* @returns Asset_id for group creation
|
|
432
|
+
*/
|
|
433
|
+
async getAssetId(accessToken) {
|
|
434
|
+
try {
|
|
435
|
+
const quotaRequest = {
|
|
436
|
+
quota_owner: "OA",
|
|
437
|
+
};
|
|
438
|
+
const response = await this.client.apiPost(`${this.apiUrl}/quota/group`, accessToken, quotaRequest);
|
|
439
|
+
if (response.error !== 0) {
|
|
440
|
+
throw new common_1.ZaloSDKError(response.message || "Failed to get asset_id", response.error);
|
|
441
|
+
}
|
|
442
|
+
if (response.data && response.data.length > 0) {
|
|
443
|
+
const activeAsset = response.data.find((asset) => asset.status === "available");
|
|
444
|
+
if (activeAsset) {
|
|
445
|
+
return activeAsset.asset_id;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
throw new common_1.ZaloSDKError("No valid asset_id found for group creation. Please check your GMF package.", -1);
|
|
449
|
+
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
throw this.handleGroupManagementError(error, "Failed to get asset_id for group creation");
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Get list of asset_ids available for creating GMF groups
|
|
456
|
+
* @param accessToken OA access token
|
|
457
|
+
* @returns List of asset_ids and quota information
|
|
458
|
+
*/
|
|
459
|
+
async getAssetIds(accessToken) {
|
|
460
|
+
try {
|
|
461
|
+
const quotaRequest = {
|
|
462
|
+
quota_owner: "OA",
|
|
463
|
+
};
|
|
464
|
+
const response = await this.client.apiPost(`${this.apiUrl}/quota/group`, accessToken, quotaRequest);
|
|
465
|
+
return response;
|
|
466
|
+
}
|
|
467
|
+
catch (error) {
|
|
468
|
+
throw this.handleGroupManagementError(error, "Failed to get asset_ids list");
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Get list of recent chats
|
|
473
|
+
* @param accessToken OA access token
|
|
474
|
+
* @param offset Offset for pagination (default: 0)
|
|
475
|
+
* @param count Maximum number to return (default: 20, max: 50)
|
|
476
|
+
* @returns List of recent chats
|
|
477
|
+
*/
|
|
478
|
+
async getRecentChats(accessToken, offset = 0, count = 20) {
|
|
479
|
+
try {
|
|
480
|
+
const response = await this.client.apiGet(`${this.apiUrl}/group/recent`, accessToken, {
|
|
481
|
+
offset: offset.toString(),
|
|
482
|
+
count: Math.min(Math.max(count, 1), 50).toString(),
|
|
483
|
+
});
|
|
484
|
+
return response;
|
|
485
|
+
}
|
|
486
|
+
catch (error) {
|
|
487
|
+
throw this.handleGroupManagementError(error, "Failed to get recent chats");
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Get group conversation history
|
|
492
|
+
* @param accessToken OA access token
|
|
493
|
+
* @param groupId Group ID
|
|
494
|
+
* @param offset Offset for pagination (default: 0)
|
|
495
|
+
* @param count Maximum number of messages to return (default: 20, max: 100)
|
|
496
|
+
* @param fromTime Start time (Unix timestamp, optional)
|
|
497
|
+
* @param toTime End time (Unix timestamp, optional)
|
|
498
|
+
* @returns Group conversation history
|
|
499
|
+
*/
|
|
500
|
+
async getGroupConversation(accessToken, groupId, offset = 0, count = 20, fromTime, toTime) {
|
|
501
|
+
try {
|
|
502
|
+
const params = {
|
|
503
|
+
offset: offset.toString(),
|
|
504
|
+
count: Math.min(Math.max(count, 1), 100).toString(),
|
|
505
|
+
};
|
|
506
|
+
if (fromTime) {
|
|
507
|
+
params.from_time = fromTime.toString();
|
|
508
|
+
}
|
|
509
|
+
if (toTime) {
|
|
510
|
+
params.to_time = toTime.toString();
|
|
511
|
+
}
|
|
512
|
+
const response = await this.client.apiGet(`${this.apiUrl}/group/${groupId}/conversation`, accessToken, params);
|
|
513
|
+
return response;
|
|
514
|
+
}
|
|
515
|
+
catch (error) {
|
|
516
|
+
throw this.handleGroupManagementError(error, "Failed to get group conversation");
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Get group members list from Zalo API
|
|
521
|
+
* @param accessToken OA access token
|
|
522
|
+
* @param groupId Group ID
|
|
523
|
+
* @param offset Offset for pagination (default: 0)
|
|
524
|
+
* @param count Maximum number to return (default: 5, max: 50)
|
|
525
|
+
* @returns Group members list
|
|
526
|
+
*/
|
|
527
|
+
async getGroupMembers(accessToken, groupId, offset = 0, count = 5) {
|
|
528
|
+
try {
|
|
529
|
+
// Validate input
|
|
530
|
+
if (!groupId || groupId.trim().length === 0) {
|
|
531
|
+
throw new common_1.ZaloSDKError("Group ID cannot be empty", -1);
|
|
532
|
+
}
|
|
533
|
+
if (offset < 0) {
|
|
534
|
+
throw new common_1.ZaloSDKError("Offset must be >= 0", -1);
|
|
535
|
+
}
|
|
536
|
+
if (count <= 0 || count > 50) {
|
|
537
|
+
throw new common_1.ZaloSDKError("Count must be from 1 to 50", -1);
|
|
538
|
+
}
|
|
539
|
+
const response = await this.client.apiGet(`${this.apiUrl}/group/listmember`, accessToken, {
|
|
540
|
+
group_id: groupId.trim(),
|
|
541
|
+
offset: offset.toString(),
|
|
542
|
+
count: count.toString(),
|
|
543
|
+
});
|
|
544
|
+
return response;
|
|
545
|
+
}
|
|
546
|
+
catch (error) {
|
|
547
|
+
throw this.handleGroupManagementError(error, "Failed to get group members");
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
handleGroupManagementError(error, defaultMessage) {
|
|
551
|
+
if (error instanceof common_1.ZaloSDKError) {
|
|
552
|
+
return error;
|
|
553
|
+
}
|
|
554
|
+
if (error.response?.data) {
|
|
555
|
+
const errorData = error.response.data;
|
|
556
|
+
return new common_1.ZaloSDKError(`${defaultMessage}: ${errorData.message || errorData.error || "Unknown error"}`, errorData.error || -1, errorData);
|
|
557
|
+
}
|
|
558
|
+
return new common_1.ZaloSDKError(`${defaultMessage}: ${error.message || "Unknown error"}`, -1, error);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
exports.GroupManagementService = GroupManagementService;
|
|
562
|
+
//# sourceMappingURL=group-management.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-management.service.js","sourceRoot":"","sources":["../../src/services/group-management.service.ts"],"names":[],"mappings":";;;AA0BA,4CAA+C;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAa,sBAAsB;IAGjC,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;QAF9B,WAAM,GAAG,iCAAiC,CAAC;IAEV,CAAC;IAEnD;;;;;OAKG;IACH,KAAK,CAAC,WAAW,CACf,WAAmB,EACnB,SAA6B;QAE7B,IAAI,CAAC;YACH,iBAAiB;YACjB,IAAI,CAAC,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtE,MAAM,IAAI,qBAAY,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC,CAAC;YAC3D,CAAC;YAED,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;gBACtC,MAAM,IAAI,qBAAY,CAAC,yCAAyC,EAAE,CAAC,CAAC,CAAC,CAAC;YACxE,CAAC;YAED,IAAI,SAAS,CAAC,WAAW,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;gBACtC,MAAM,IAAI,qBAAY,CACpB,8CAA8C,EAC9C,CAAC,CAAC,CACH,CAAC;YACJ,CAAC;YAED,IAAI,SAAS,CAA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