@webitel/api-services 0.0.66 → 0.0.67
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/package.json
CHANGED
|
@@ -28,51 +28,35 @@ const getAgentsList = async (params) => {
|
|
|
28
28
|
statusDuration: convertStatusDuration(item.statusDuration),
|
|
29
29
|
}));
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
31
|
+
const fieldsToSend = [
|
|
32
|
+
'page',
|
|
33
|
+
'size',
|
|
34
|
+
'search',
|
|
35
|
+
'sort',
|
|
36
|
+
'fields',
|
|
37
|
+
'id',
|
|
38
|
+
'allow_channels',
|
|
39
|
+
'team',
|
|
40
|
+
'region_id',
|
|
41
|
+
'auditor_id',
|
|
42
|
+
'skill',
|
|
43
|
+
'queue_id',
|
|
44
|
+
'is_supervisor',
|
|
45
|
+
'is_not_Supervisor',
|
|
46
|
+
'user_id',
|
|
47
|
+
'not_team_id',
|
|
48
|
+
'supervisor_id',
|
|
49
|
+
'not_skill_id',
|
|
50
|
+
'not_user_id',
|
|
51
|
+
];
|
|
52
|
+
const requestParams = applyTransform(params, [
|
|
53
|
+
camelToSnake(),
|
|
54
|
+
merge(getDefaultGetListResponse()),
|
|
55
|
+
sanitize(fieldsToSend),
|
|
56
|
+
]);
|
|
53
57
|
|
|
54
58
|
try {
|
|
55
|
-
const response = await getAgentService().searchAgent(
|
|
56
|
-
page,
|
|
57
|
-
size,
|
|
58
|
-
search,
|
|
59
|
-
sort,
|
|
60
|
-
fields,
|
|
61
|
-
id,
|
|
62
|
-
allowChannels,
|
|
63
|
-
supervisorId,
|
|
64
|
-
team,
|
|
65
|
-
regionId,
|
|
66
|
-
auditorId,
|
|
67
|
-
isSupervisor,
|
|
68
|
-
skill,
|
|
69
|
-
queueId,
|
|
70
|
-
isNotSupervisor,
|
|
71
|
-
userId,
|
|
72
|
-
notTeamId,
|
|
73
|
-
notSkillId,
|
|
74
|
-
notUserId,
|
|
75
|
-
});
|
|
59
|
+
const response = await getAgentService().searchAgent(requestParams);
|
|
76
60
|
const { items, next } = applyTransform(response.data, [
|
|
77
61
|
snakeToCamel(),
|
|
78
62
|
merge(getDefaultGetListResponse()),
|
|
@@ -238,6 +222,37 @@ const getAgentUsersOptions = async (params) => {
|
|
|
238
222
|
throw applyTransform(err, [notify]);
|
|
239
223
|
}
|
|
240
224
|
};
|
|
225
|
+
|
|
226
|
+
const getUsersStatus = async (params) => {
|
|
227
|
+
const fieldsToSend = [
|
|
228
|
+
'page',
|
|
229
|
+
'size',
|
|
230
|
+
'search',
|
|
231
|
+
'sort',
|
|
232
|
+
'fields',
|
|
233
|
+
'not_user_id',
|
|
234
|
+
];
|
|
235
|
+
const requestParams = applyTransform(params, [
|
|
236
|
+
camelToSnake(),
|
|
237
|
+
merge(getDefaultGetParams()),
|
|
238
|
+
starToSearch('search'),
|
|
239
|
+
sanitize(fieldsToSend),
|
|
240
|
+
]);
|
|
241
|
+
|
|
242
|
+
try {
|
|
243
|
+
const response = await getAgentService().searchUserStatus(requestParams);
|
|
244
|
+
const { items, next } = applyTransform(response.data, [
|
|
245
|
+
snakeToCamel(),
|
|
246
|
+
merge(getDefaultGetListResponse()),
|
|
247
|
+
]);
|
|
248
|
+
return {
|
|
249
|
+
items,
|
|
250
|
+
next,
|
|
251
|
+
};
|
|
252
|
+
} catch (err) {
|
|
253
|
+
throw applyTransform(err, [notify]);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
241
256
|
const getSupervisorOptions = async (params) => {
|
|
242
257
|
const isSupervisor = true;
|
|
243
258
|
return getAgentsList({ ...params, isSupervisor });
|
|
@@ -261,4 +276,5 @@ export const AgentsAPI = {
|
|
|
261
276
|
getRegularAgentsOptions,
|
|
262
277
|
getAgentUsersOptions,
|
|
263
278
|
getSupervisorOptions,
|
|
279
|
+
getUsersStatus,
|
|
264
280
|
};
|