@webitel/ui-sdk 26.8.67 → 26.8.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients-D5pO5FKV.js +39334 -0
- package/dist/{components-CXPq3d81.js → components-BH_gLkO3.js} +7 -7
- package/dist/{genClient-DMVlC4Uy.js → genClient-DtYJ9KWy.js} +1 -1
- package/dist/ui-sdk.js +3 -3
- package/dist/ui-sdk.umd.cjs +659 -735
- package/dist/{wt-button-l_CCN7zG.js → wt-button-TVtG0saz.js} +1 -1
- package/dist/{wt-chat-emoji-BwCLLExE.js → wt-chat-emoji-B-FoXVDr.js} +3 -3
- package/dist/{wt-display-chip-items-DgDn6xoK.js → wt-display-chip-items-CZzcHtcb.js} +1 -1
- package/dist/{wt-icon-btn-BbPNcD-O.js → wt-icon-btn-B_hS2f_v.js} +1 -1
- package/dist/{wt-icon-CjNYdMOP.js → wt-icon-md5nPR1T.js} +2 -2
- package/dist/{wt-notifications-bar-BTt1vqwz.js → wt-notifications-bar-k3Osz6gY.js} +1 -1
- package/dist/{wt-player-CoB2InY0.js → wt-player-R3rAiIxl.js} +2 -2
- package/dist/{wt-send-message-popup-TJdbzgRF.js → wt-send-message-popup-Cc92sY9q.js} +2 -2
- package/dist/{wt-toast-DHV4UvFz.js → wt-toast-DsIX8ZW_.js} +1 -1
- package/dist/wt-tree-CfvNlw7N.js +2042 -0
- package/dist/{wt-tree-table-9vnEJcX0.js → wt-tree-table-R02DpJ7M.js} +1 -1
- package/dist/{wt-type-extension-value-input-D5Y-ds9V.js → wt-type-extension-value-input-DfbrgPNa.js} +2 -2
- package/dist/{wt-vidstack-player-DKf1aSC7.js → wt-vidstack-player-DtbNeGgs.js} +3 -3
- package/package.json +1 -1
- package/src/api/clients/index.js +5 -66
- package/src/assets/icons/sprite/call--filled.svg +2 -2
- package/src/assets/icons/sprite/call-end--filled.svg +2 -3
- package/src/modules/AgentStatusSelect/api/agent-status.ts +44 -0
- package/src/modules/AgentStatusSelect/api/pause-cause.ts +54 -0
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +4 -10
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +2 -6
- package/types/.tsbuildinfo +1 -1
- package/types/api/clients/index.d.ts +1 -33
- package/types/modules/AgentStatusSelect/api/agent-status.d.ts +4 -12
- package/types/modules/AgentStatusSelect/api/pause-cause.d.ts +7 -9
- package/dist/clients-DpqA006B.js +0 -40042
- package/dist/side-channel-M3LABDql.js +0 -833
- package/dist/wt-tree-DKSphRxr.js +0 -1216
- package/src/api/clients/agents/agentChats.js +0 -79
- package/src/api/clients/agents/agents.js +0 -300
- package/src/api/clients/buckets/buckets.js +0 -134
- package/src/api/clients/calendars/calendars.js +0 -239
- package/src/api/clients/caseCloseReasonGroups/caseCloseReasonGroups.js +0 -161
- package/src/api/clients/caseCloseReasons/caseCloseReasons.js +0 -165
- package/src/api/clients/casePriorities/casePriorities.js +0 -166
- package/src/api/clients/caseServiceCatalogs/serviceCatalogs.js +0 -231
- package/src/api/clients/caseServices/services.js +0 -221
- package/src/api/clients/caseSources/caseSources.ts +0 -2
- package/src/api/clients/caseStatusConditions/caseStatusConditions.js +0 -207
- package/src/api/clients/caseStatuses/caseStatuses.js +0 -152
- package/src/api/clients/catalog/catalog.js +0 -63
- package/src/api/clients/chatGateways/chatGateways.js +0 -338
- package/src/api/clients/chatGateways/defaults/defaultChatGateway.js +0 -18
- package/src/api/clients/chatGateways/defaults/webChatGateway.js +0 -72
- package/src/api/clients/chatGateways/enums/WebchatAlternativeChannel.enum.js +0 -14
- package/src/api/clients/chatGateways/scripts/generateUri.js +0 -9
- package/src/api/clients/communications/communications.js +0 -172
- package/src/api/clients/configurations/configurations.js +0 -168
- package/src/api/clients/contactGroups/contactGroups.js +0 -221
- package/src/api/clients/flows/flow.js +0 -252
- package/src/api/clients/gateways/defaults/defaultGateway.js +0 -9
- package/src/api/clients/gateways/defaults/registerGateway.js +0 -12
- package/src/api/clients/gateways/defaults/trunkingGateway.js +0 -16
- package/src/api/clients/gateways/gateways.js +0 -221
- package/src/api/clients/labels/labels.js +0 -69
- package/src/api/clients/lists/blacklists.js +0 -142
- package/src/api/clients/media/media.js +0 -136
- package/src/api/clients/object/object.js +0 -138
- package/src/api/clients/queues/queues.js +0 -263
- package/src/api/clients/quickReplies/quickReplies.ts +0 -2
- package/src/api/clients/skills/skills.js +0 -134
- package/src/api/clients/slaConditions/slaConditions.js +0 -190
- package/src/api/clients/slas/slas.js +0 -148
- package/src/api/clients/teams/teams.js +0 -161
- package/src/api/clients/users/__tests__/users.spec.js +0 -282
- package/src/api/clients/users/users.js +0 -334
- package/src/api/clients/wtTypes/_shared/utils/sortDynamicFields.ts +0 -38
- package/src/api/clients/wtTypes/sysTypes/sysTypes.ts +0 -92
- package/src/api/clients/wtTypes/typeExtensions/typeExtensions.ts +0 -156
- package/src/api/clients//321/201ontacts/contactChatMessagesHistory.js +0 -119
- package/src/api/clients//321/201ontacts/contacts.js +0 -449
- package/src/api/clients//321/201ontacts/enums/ContactsSearchMode.js +0 -9
- package/src/api/clients//321/201ontacts/index.js +0 -5
- package/src/modules/AgentStatusSelect/api/agent-status.js +0 -30
- package/src/modules/AgentStatusSelect/api/pause-cause.js +0 -49
- package/types/api/clients/agents/agentChats.d.ts +0 -10
- package/types/api/clients/agents/agents.d.ts +0 -55
- package/types/api/clients/buckets/buckets.d.ts +0 -30
- package/types/api/clients/calendars/calendars.d.ts +0 -35
- package/types/api/clients/caseCloseReasonGroups/caseCloseReasonGroups.d.ts +0 -30
- package/types/api/clients/caseCloseReasons/caseCloseReasons.d.ts +0 -36
- package/types/api/clients/casePriorities/casePriorities.d.ts +0 -30
- package/types/api/clients/caseServiceCatalogs/serviceCatalogs.d.ts +0 -30
- package/types/api/clients/caseServices/services.d.ts +0 -42
- package/types/api/clients/caseSources/caseSources.d.ts +0 -1
- package/types/api/clients/caseStatusConditions/caseStatusConditions.d.ts +0 -43
- package/types/api/clients/caseStatuses/caseStatuses.d.ts +0 -30
- package/types/api/clients/catalog/catalog.d.ts +0 -13
- package/types/api/clients/chatGateways/chatGateways.d.ts +0 -35
- package/types/api/clients/chatGateways/defaults/defaultChatGateway.d.ts +0 -15
- package/types/api/clients/chatGateways/defaults/webChatGateway.d.ts +0 -64
- package/types/api/clients/chatGateways/enums/WebchatAlternativeChannel.enum.d.ts +0 -8
- package/types/api/clients/chatGateways/scripts/generateUri.d.ts +0 -2
- package/types/api/clients/communications/communications.d.ts +0 -35
- package/types/api/clients/configurations/configurations.d.ts +0 -35
- package/types/api/clients/contactGroups/contactGroups.d.ts +0 -47
- package/types/api/clients/flows/flow.d.ts +0 -35
- package/types/api/clients/gateways/defaults/defaultGateway.d.ts +0 -8
- package/types/api/clients/gateways/defaults/registerGateway.d.ts +0 -13
- package/types/api/clients/gateways/defaults/trunkingGateway.d.ts +0 -11
- package/types/api/clients/gateways/gateways.d.ts +0 -35
- package/types/api/clients/labels/labels.d.ts +0 -13
- package/types/api/clients/lists/blacklists.d.ts +0 -30
- package/types/api/clients/media/media.d.ts +0 -24
- package/types/api/clients/object/object.d.ts +0 -13
- package/types/api/clients/queues/queues.d.ts +0 -40
- package/types/api/clients/quickReplies/quickReplies.d.ts +0 -1
- package/types/api/clients/skills/skills.d.ts +0 -30
- package/types/api/clients/slaConditions/slaConditions.d.ts +0 -36
- package/types/api/clients/slas/slas.d.ts +0 -30
- package/types/api/clients/teams/teams.d.ts +0 -30
- package/types/api/clients/users/__tests__/users.spec.d.ts +0 -1
- package/types/api/clients/users/users.d.ts +0 -46
- package/types/api/clients/wtTypes/_shared/utils/sortDynamicFields.d.ts +0 -2
- package/types/api/clients/wtTypes/sysTypes/sysTypes.d.ts +0 -29
- package/types/api/clients/wtTypes/typeExtensions/typeExtensions.d.ts +0 -33
- package/types/api/clients//321/201ontacts/contactChatMessagesHistory.d.ts +0 -16
- package/types/api/clients//321/201ontacts/contacts.d.ts +0 -29
- package/types/api/clients//321/201ontacts/enums/ContactsSearchMode.d.ts +0 -8
- package/types/api/clients//321/201ontacts/index.d.ts +0 -4
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
import deepCopy from 'deep-copy';
|
|
2
|
-
import { ContactsApiFactory } from 'webitel-sdk';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
getDefaultGetListResponse,
|
|
6
|
-
getDefaultGetParams,
|
|
7
|
-
getDefaultInstance,
|
|
8
|
-
getDefaultOpenAPIConfig,
|
|
9
|
-
} from '../../defaults/index.js';
|
|
10
|
-
import applyTransform, {
|
|
11
|
-
camelToSnake,
|
|
12
|
-
merge,
|
|
13
|
-
notify,
|
|
14
|
-
sanitize,
|
|
15
|
-
snakeToCamel,
|
|
16
|
-
} from '../../transformers/index.js';
|
|
17
|
-
import ContactsSearchMode from './enums/ContactsSearchMode.js';
|
|
18
|
-
|
|
19
|
-
const instance = getDefaultInstance();
|
|
20
|
-
const configuration = getDefaultOpenAPIConfig();
|
|
21
|
-
|
|
22
|
-
const contactService = new ContactsApiFactory(configuration, '', instance);
|
|
23
|
-
|
|
24
|
-
const formatAccessMode = (item) => ({
|
|
25
|
-
...item,
|
|
26
|
-
access: {
|
|
27
|
-
edit: item.mode.includes('w'),
|
|
28
|
-
delete: item.mode.includes('d'),
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const getList = async (params) => {
|
|
33
|
-
const fieldsToSend = [
|
|
34
|
-
'page',
|
|
35
|
-
'size',
|
|
36
|
-
'q',
|
|
37
|
-
'sort',
|
|
38
|
-
'fields',
|
|
39
|
-
'id',
|
|
40
|
-
'qin',
|
|
41
|
-
'notIdGroup',
|
|
42
|
-
'group',
|
|
43
|
-
'owner',
|
|
44
|
-
'label',
|
|
45
|
-
'user',
|
|
46
|
-
];
|
|
47
|
-
|
|
48
|
-
if (!params.fields) {
|
|
49
|
-
params.fields = [
|
|
50
|
-
'id',
|
|
51
|
-
'etag',
|
|
52
|
-
'name',
|
|
53
|
-
'managers',
|
|
54
|
-
'labels',
|
|
55
|
-
'about',
|
|
56
|
-
'variables',
|
|
57
|
-
'timezones',
|
|
58
|
-
'phones',
|
|
59
|
-
'emails',
|
|
60
|
-
'imclients',
|
|
61
|
-
];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const listResponseHandler = (items) =>
|
|
65
|
-
items?.map((item) => ({
|
|
66
|
-
...item,
|
|
67
|
-
name: item.name.commonName,
|
|
68
|
-
managers: item.managers
|
|
69
|
-
? [
|
|
70
|
-
...item.managers.data,
|
|
71
|
-
]
|
|
72
|
-
: [],
|
|
73
|
-
labels: item.labels
|
|
74
|
-
? [
|
|
75
|
-
...item.labels.data,
|
|
76
|
-
]
|
|
77
|
-
: [],
|
|
78
|
-
groups: getGroupsFromResponse(item),
|
|
79
|
-
variables: item.variables
|
|
80
|
-
? [
|
|
81
|
-
...item.variables.data,
|
|
82
|
-
]
|
|
83
|
-
: [],
|
|
84
|
-
timezones: item.timezones
|
|
85
|
-
? [
|
|
86
|
-
...item.timezones.data,
|
|
87
|
-
]
|
|
88
|
-
: [],
|
|
89
|
-
phones: item.phones
|
|
90
|
-
? [
|
|
91
|
-
...item.phones.data,
|
|
92
|
-
]
|
|
93
|
-
: [],
|
|
94
|
-
emails: item.emails
|
|
95
|
-
? [
|
|
96
|
-
...item.emails.data,
|
|
97
|
-
]
|
|
98
|
-
: [],
|
|
99
|
-
}));
|
|
100
|
-
|
|
101
|
-
let changedParams;
|
|
102
|
-
|
|
103
|
-
if (params?.search) {
|
|
104
|
-
changedParams = {
|
|
105
|
-
...params,
|
|
106
|
-
q: params.search,
|
|
107
|
-
};
|
|
108
|
-
} else if (params?.q && params?.qin) {
|
|
109
|
-
changedParams = {
|
|
110
|
-
...params,
|
|
111
|
-
};
|
|
112
|
-
} else {
|
|
113
|
-
let searchValue = '';
|
|
114
|
-
let searchKey = '';
|
|
115
|
-
|
|
116
|
-
if (params[ContactsSearchMode.NAME]) {
|
|
117
|
-
searchValue = params[ContactsSearchMode.NAME];
|
|
118
|
-
searchKey = ContactsSearchMode.NAME;
|
|
119
|
-
} else if (params[ContactsSearchMode.LABELS]) {
|
|
120
|
-
searchValue = params[ContactsSearchMode.LABELS];
|
|
121
|
-
searchKey = ContactsSearchMode.LABELS;
|
|
122
|
-
} else if (params[ContactsSearchMode.ABOUT]) {
|
|
123
|
-
searchValue = params[ContactsSearchMode.ABOUT];
|
|
124
|
-
searchKey = ContactsSearchMode.ABOUT;
|
|
125
|
-
} else if (params[ContactsSearchMode.VARIABLES]) {
|
|
126
|
-
searchValue = params[ContactsSearchMode.VARIABLES];
|
|
127
|
-
searchKey = ContactsSearchMode.VARIABLES;
|
|
128
|
-
} else if (params[ContactsSearchMode.DESTINATION]) {
|
|
129
|
-
searchValue = params[ContactsSearchMode.DESTINATION];
|
|
130
|
-
searchKey = 'emails,phones,imclients{user{name}}';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// This code needed for adding starToSearch method to applyTransform while searchKey !== SearchMode.VARIABLES because '*' in variables search mode brokes backend logic.
|
|
134
|
-
// if (searchKey !== ContactsSearchMode.VARIABLES) {
|
|
135
|
-
// transformations.push(starToSearch('q')); WTEL-4265
|
|
136
|
-
// }
|
|
137
|
-
|
|
138
|
-
changedParams = {
|
|
139
|
-
...params,
|
|
140
|
-
q: searchValue || '',
|
|
141
|
-
qin: searchKey || '',
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
if (params.hasUser != null) {
|
|
145
|
-
changedParams.user = params.hasUser;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (params.contactGroup) {
|
|
149
|
-
changedParams.group = [
|
|
150
|
-
...params.contactGroup.list,
|
|
151
|
-
];
|
|
152
|
-
}
|
|
153
|
-
if (params.contactLabel) {
|
|
154
|
-
changedParams.label = params.contactLabel.map((item) => item.label);
|
|
155
|
-
}
|
|
156
|
-
if (params.contactOwner) {
|
|
157
|
-
changedParams.owner = params.contactOwner;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (params.parentId) {
|
|
162
|
-
changedParams.group = [
|
|
163
|
-
params.parentId,
|
|
164
|
-
];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const transformations = [
|
|
168
|
-
sanitize(fieldsToSend),
|
|
169
|
-
merge(getDefaultGetParams()),
|
|
170
|
-
camelToSnake(),
|
|
171
|
-
];
|
|
172
|
-
|
|
173
|
-
const {
|
|
174
|
-
page,
|
|
175
|
-
size,
|
|
176
|
-
q,
|
|
177
|
-
sort,
|
|
178
|
-
fields,
|
|
179
|
-
id,
|
|
180
|
-
qin,
|
|
181
|
-
mode,
|
|
182
|
-
group,
|
|
183
|
-
not_id_group,
|
|
184
|
-
owner,
|
|
185
|
-
label,
|
|
186
|
-
user,
|
|
187
|
-
} = applyTransform(changedParams, transformations);
|
|
188
|
-
|
|
189
|
-
try {
|
|
190
|
-
const response = await contactService.searchContacts(
|
|
191
|
-
page,
|
|
192
|
-
size,
|
|
193
|
-
q,
|
|
194
|
-
sort || '+name',
|
|
195
|
-
[
|
|
196
|
-
'mode',
|
|
197
|
-
...fields,
|
|
198
|
-
],
|
|
199
|
-
id,
|
|
200
|
-
qin,
|
|
201
|
-
mode,
|
|
202
|
-
not_id_group,
|
|
203
|
-
group,
|
|
204
|
-
owner,
|
|
205
|
-
label,
|
|
206
|
-
user,
|
|
207
|
-
);
|
|
208
|
-
|
|
209
|
-
const { items, next } = applyTransform(
|
|
210
|
-
{
|
|
211
|
-
...response.data,
|
|
212
|
-
items: response.data.data || [],
|
|
213
|
-
},
|
|
214
|
-
[
|
|
215
|
-
snakeToCamel([
|
|
216
|
-
'custom',
|
|
217
|
-
]),
|
|
218
|
-
merge(getDefaultGetListResponse()),
|
|
219
|
-
],
|
|
220
|
-
);
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
items: applyTransform(items, [
|
|
224
|
-
(items) => items?.map((item) => formatAccessMode(item)),
|
|
225
|
-
listResponseHandler,
|
|
226
|
-
]),
|
|
227
|
-
next,
|
|
228
|
-
};
|
|
229
|
-
} catch (err) {
|
|
230
|
-
throw applyTransform(err, [
|
|
231
|
-
notify,
|
|
232
|
-
]);
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
const get = async ({ itemId: id }) => {
|
|
237
|
-
const fields = [
|
|
238
|
-
'name',
|
|
239
|
-
'about',
|
|
240
|
-
'labels',
|
|
241
|
-
'groups',
|
|
242
|
-
'etag',
|
|
243
|
-
'mode',
|
|
244
|
-
'managers',
|
|
245
|
-
'timezones',
|
|
246
|
-
'variables',
|
|
247
|
-
'phones',
|
|
248
|
-
'emails',
|
|
249
|
-
'imclients',
|
|
250
|
-
'user',
|
|
251
|
-
'custom',
|
|
252
|
-
];
|
|
253
|
-
|
|
254
|
-
const defaultObject = {};
|
|
255
|
-
const itemResponseHandler = (item) => {
|
|
256
|
-
return {
|
|
257
|
-
...item,
|
|
258
|
-
name: item.name.commonName,
|
|
259
|
-
labels: item.labels
|
|
260
|
-
? [
|
|
261
|
-
...item.labels.data,
|
|
262
|
-
]
|
|
263
|
-
: [],
|
|
264
|
-
groups: getGroupsFromResponse(item),
|
|
265
|
-
managers: item.managers
|
|
266
|
-
? [
|
|
267
|
-
...item.managers.data,
|
|
268
|
-
]
|
|
269
|
-
: [],
|
|
270
|
-
timezones: item.timezones
|
|
271
|
-
? [
|
|
272
|
-
...item.timezones.data,
|
|
273
|
-
]
|
|
274
|
-
: [],
|
|
275
|
-
variables: item.variables
|
|
276
|
-
? [
|
|
277
|
-
...item.variables.data,
|
|
278
|
-
]
|
|
279
|
-
: [],
|
|
280
|
-
phones: item.phones
|
|
281
|
-
? [
|
|
282
|
-
...item.phones.data,
|
|
283
|
-
]
|
|
284
|
-
: [],
|
|
285
|
-
emails: item.emails
|
|
286
|
-
? [
|
|
287
|
-
...item.emails.data,
|
|
288
|
-
]
|
|
289
|
-
: [],
|
|
290
|
-
};
|
|
291
|
-
};
|
|
292
|
-
try {
|
|
293
|
-
const response = await contactService.locateContact(id, fields);
|
|
294
|
-
return applyTransform(response.data, [
|
|
295
|
-
snakeToCamel([
|
|
296
|
-
'custom',
|
|
297
|
-
]),
|
|
298
|
-
merge(defaultObject),
|
|
299
|
-
itemResponseHandler,
|
|
300
|
-
formatAccessMode,
|
|
301
|
-
]);
|
|
302
|
-
} catch (err) {
|
|
303
|
-
throw applyTransform(err, [
|
|
304
|
-
notify,
|
|
305
|
-
]);
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
const fieldsToSend = [
|
|
310
|
-
'name',
|
|
311
|
-
'labels',
|
|
312
|
-
'about',
|
|
313
|
-
'managers',
|
|
314
|
-
'timezones',
|
|
315
|
-
'groups',
|
|
316
|
-
'custom',
|
|
317
|
-
'phones',
|
|
318
|
-
];
|
|
319
|
-
|
|
320
|
-
const sanitizeManagers = (itemInstance) => {
|
|
321
|
-
// handle many managers and even no managers field cases
|
|
322
|
-
const managers = (itemInstance.managers || []).filter(
|
|
323
|
-
({ user } = {}) => user.id,
|
|
324
|
-
);
|
|
325
|
-
return {
|
|
326
|
-
...itemInstance,
|
|
327
|
-
managers,
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
const sanitizeTimezones = (itemInstance) => {
|
|
332
|
-
// handle many timezones and even no timezones field cases
|
|
333
|
-
const timezones = (itemInstance.timezones || []).filter(
|
|
334
|
-
({ timezone } = {}) => timezone.id,
|
|
335
|
-
);
|
|
336
|
-
return {
|
|
337
|
-
...itemInstance,
|
|
338
|
-
timezones,
|
|
339
|
-
};
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
const sanitizeGroups = (itemInstance) => {
|
|
343
|
-
// handle many groups and even no groups field cases
|
|
344
|
-
const groups = (itemInstance.groups || []).map((item) => ({
|
|
345
|
-
group: item,
|
|
346
|
-
}));
|
|
347
|
-
return {
|
|
348
|
-
...itemInstance,
|
|
349
|
-
groups,
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
const preRequestHandler = (item) => {
|
|
354
|
-
const copy = deepCopy(item);
|
|
355
|
-
copy.name = {
|
|
356
|
-
commonName: copy.name,
|
|
357
|
-
};
|
|
358
|
-
return copy;
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
const getGroupsFromResponse = (item) => {
|
|
362
|
-
return item.groups
|
|
363
|
-
? [
|
|
364
|
-
...item.groups.data.map((el) => el.group),
|
|
365
|
-
]
|
|
366
|
-
: [];
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
const add = async ({ itemInstance }) => {
|
|
370
|
-
const item = applyTransform(itemInstance, [
|
|
371
|
-
preRequestHandler,
|
|
372
|
-
sanitizeManagers,
|
|
373
|
-
sanitizeTimezones,
|
|
374
|
-
sanitizeGroups,
|
|
375
|
-
sanitize(fieldsToSend),
|
|
376
|
-
camelToSnake([
|
|
377
|
-
'custom',
|
|
378
|
-
]),
|
|
379
|
-
]);
|
|
380
|
-
try {
|
|
381
|
-
const response = await contactService.createContact(item);
|
|
382
|
-
return applyTransform(response.data, [
|
|
383
|
-
snakeToCamel([
|
|
384
|
-
'custom',
|
|
385
|
-
]),
|
|
386
|
-
]);
|
|
387
|
-
} catch (err) {
|
|
388
|
-
throw applyTransform(err, [
|
|
389
|
-
notify,
|
|
390
|
-
]);
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
const update = async ({ itemInstance }) => {
|
|
395
|
-
const { etag } = itemInstance;
|
|
396
|
-
const item = applyTransform(itemInstance, [
|
|
397
|
-
preRequestHandler,
|
|
398
|
-
sanitizeManagers,
|
|
399
|
-
sanitizeTimezones,
|
|
400
|
-
sanitizeGroups,
|
|
401
|
-
sanitize(fieldsToSend),
|
|
402
|
-
camelToSnake([
|
|
403
|
-
'custom',
|
|
404
|
-
]),
|
|
405
|
-
]);
|
|
406
|
-
try {
|
|
407
|
-
const response = await contactService.updateContact(etag, item);
|
|
408
|
-
return applyTransform(response.data, [
|
|
409
|
-
snakeToCamel([
|
|
410
|
-
'custom',
|
|
411
|
-
]),
|
|
412
|
-
]);
|
|
413
|
-
} catch (err) {
|
|
414
|
-
throw applyTransform(err, [
|
|
415
|
-
notify,
|
|
416
|
-
]);
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
const deleteContact = async ({ id }) => {
|
|
421
|
-
try {
|
|
422
|
-
const response = await contactService.deleteContact(id);
|
|
423
|
-
return applyTransform(response.data, []);
|
|
424
|
-
} catch (err) {
|
|
425
|
-
throw applyTransform(err, [
|
|
426
|
-
notify,
|
|
427
|
-
]);
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
const getContactsLookup = (params) =>
|
|
432
|
-
getList({
|
|
433
|
-
...params,
|
|
434
|
-
fields: params.fields || [
|
|
435
|
-
'id',
|
|
436
|
-
'name',
|
|
437
|
-
],
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
const ContactsAPI = {
|
|
441
|
-
getList,
|
|
442
|
-
get,
|
|
443
|
-
add,
|
|
444
|
-
update,
|
|
445
|
-
delete: deleteContact,
|
|
446
|
-
getLookup: getContactsLookup,
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
export default ContactsAPI;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { AgentServiceApiFactory } from 'webitel-sdk';
|
|
2
|
-
|
|
3
|
-
const AgentStatusAPIFactory = ({ instance, OpenAPIConfig }) => {
|
|
4
|
-
const service = new AgentServiceApiFactory(OpenAPIConfig, '', instance);
|
|
5
|
-
|
|
6
|
-
const patchAgentStatus = async ({
|
|
7
|
-
agentId,
|
|
8
|
-
status,
|
|
9
|
-
pauseCause,
|
|
10
|
-
statusComment,
|
|
11
|
-
onlineSkill,
|
|
12
|
-
}) => {
|
|
13
|
-
const res = await service.updateAgentStatus(agentId, {
|
|
14
|
-
status,
|
|
15
|
-
id: agentId,
|
|
16
|
-
payload: pauseCause,
|
|
17
|
-
status_comment: statusComment,
|
|
18
|
-
online_skill: onlineSkill,
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
success: !!res,
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
return {
|
|
26
|
-
patch: patchAgentStatus,
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default AgentStatusAPIFactory;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { getDefaultGetListResponse } from '@webitel/api-services/api/defaults';
|
|
2
|
-
import {
|
|
3
|
-
applyTransform,
|
|
4
|
-
merge,
|
|
5
|
-
mergeEach,
|
|
6
|
-
notify,
|
|
7
|
-
snakeToCamel,
|
|
8
|
-
} from '@webitel/api-services/api/transformers';
|
|
9
|
-
import { AgentServiceApiFactory } from 'webitel-sdk';
|
|
10
|
-
|
|
11
|
-
const PauseCauseAPIFactory = ({ instance, OpenAPIConfig }) => {
|
|
12
|
-
const service = new AgentServiceApiFactory(OpenAPIConfig, '', instance);
|
|
13
|
-
|
|
14
|
-
const getList = async ({ agentId }) => {
|
|
15
|
-
const defaultObject = {
|
|
16
|
-
name: '',
|
|
17
|
-
durationMin: 0,
|
|
18
|
-
limitMin: 0,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const allowChange = true;
|
|
22
|
-
try {
|
|
23
|
-
const response = await service.searchPauseCauseForAgent(
|
|
24
|
-
agentId,
|
|
25
|
-
allowChange,
|
|
26
|
-
);
|
|
27
|
-
const { items, next } = applyTransform(response.data, [
|
|
28
|
-
snakeToCamel(),
|
|
29
|
-
merge(getDefaultGetListResponse()),
|
|
30
|
-
]);
|
|
31
|
-
return {
|
|
32
|
-
items: applyTransform(items, [
|
|
33
|
-
mergeEach(defaultObject),
|
|
34
|
-
]),
|
|
35
|
-
next,
|
|
36
|
-
};
|
|
37
|
-
} catch (err) {
|
|
38
|
-
throw applyTransform(err, [
|
|
39
|
-
notify,
|
|
40
|
-
]);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
getList,
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default PauseCauseAPIFactory;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default AgentChatsAPI;
|
|
2
|
-
declare namespace AgentChatsAPI {
|
|
3
|
-
export { getChatsList as getList };
|
|
4
|
-
export { markChatProcessed };
|
|
5
|
-
}
|
|
6
|
-
declare function getChatsList(params: any): Promise<{
|
|
7
|
-
items: any;
|
|
8
|
-
next: any;
|
|
9
|
-
}>;
|
|
10
|
-
declare function markChatProcessed(chatId: any): Promise<any>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
export default AgentsAPI;
|
|
2
|
-
declare namespace AgentsAPI {
|
|
3
|
-
export { getAgentsList as getList };
|
|
4
|
-
export { getAgent as get };
|
|
5
|
-
export { addAgent as add };
|
|
6
|
-
export { patchAgent as patch };
|
|
7
|
-
export { updateAgent as update };
|
|
8
|
-
export { deleteAgent as delete };
|
|
9
|
-
export { getAgentsLookup as getLookup };
|
|
10
|
-
export { getAgentHistory };
|
|
11
|
-
export { getRegularAgentsOptions };
|
|
12
|
-
export { getAgentUsersOptions };
|
|
13
|
-
export { getSupervisorOptions };
|
|
14
|
-
}
|
|
15
|
-
declare function getAgentsList(params: any): Promise<{
|
|
16
|
-
items: any;
|
|
17
|
-
next: any;
|
|
18
|
-
}>;
|
|
19
|
-
declare function getAgent({ itemId: id }: {
|
|
20
|
-
itemId: any;
|
|
21
|
-
}): Promise<any>;
|
|
22
|
-
declare function addAgent({ itemInstance }: {
|
|
23
|
-
itemInstance: any;
|
|
24
|
-
}): Promise<any>;
|
|
25
|
-
declare function patchAgent({ changes, id }: {
|
|
26
|
-
changes: any;
|
|
27
|
-
id: any;
|
|
28
|
-
}): Promise<any>;
|
|
29
|
-
declare function updateAgent({ itemInstance, itemId: id }: {
|
|
30
|
-
itemInstance: any;
|
|
31
|
-
itemId: any;
|
|
32
|
-
}): Promise<any>;
|
|
33
|
-
declare function deleteAgent({ id }: {
|
|
34
|
-
id: any;
|
|
35
|
-
}): Promise<any>;
|
|
36
|
-
declare function getAgentsLookup(params: any): Promise<{
|
|
37
|
-
items: any;
|
|
38
|
-
next: any;
|
|
39
|
-
}>;
|
|
40
|
-
declare function getAgentHistory(params: any): Promise<{
|
|
41
|
-
items: any;
|
|
42
|
-
next: any;
|
|
43
|
-
}>;
|
|
44
|
-
declare function getRegularAgentsOptions(params: any): Promise<{
|
|
45
|
-
items: any;
|
|
46
|
-
next: any;
|
|
47
|
-
}>;
|
|
48
|
-
declare function getAgentUsersOptions(params: any): Promise<{
|
|
49
|
-
items: any;
|
|
50
|
-
next: any;
|
|
51
|
-
}>;
|
|
52
|
-
declare function getSupervisorOptions(params: any): Promise<{
|
|
53
|
-
items: any;
|
|
54
|
-
next: any;
|
|
55
|
-
}>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export default BucketsAPI;
|
|
2
|
-
declare namespace BucketsAPI {
|
|
3
|
-
export { getBucketsList as getList };
|
|
4
|
-
export { getBucket as get };
|
|
5
|
-
export { addBucket as add };
|
|
6
|
-
export { updateBucket as update };
|
|
7
|
-
export { deleteBucket as delete };
|
|
8
|
-
export { getBucketsLookup as getLookup };
|
|
9
|
-
}
|
|
10
|
-
declare function getBucketsList(params: any): Promise<{
|
|
11
|
-
items: any;
|
|
12
|
-
next: any;
|
|
13
|
-
}>;
|
|
14
|
-
declare function getBucket({ itemId: id }: {
|
|
15
|
-
itemId: any;
|
|
16
|
-
}): Promise<any>;
|
|
17
|
-
declare function addBucket({ itemInstance }: {
|
|
18
|
-
itemInstance: any;
|
|
19
|
-
}): Promise<any>;
|
|
20
|
-
declare function updateBucket({ itemInstance, itemId: id }: {
|
|
21
|
-
itemInstance: any;
|
|
22
|
-
itemId: any;
|
|
23
|
-
}): Promise<any>;
|
|
24
|
-
declare function deleteBucket({ id }: {
|
|
25
|
-
id: any;
|
|
26
|
-
}): Promise<any>;
|
|
27
|
-
declare function getBucketsLookup(params: any): Promise<{
|
|
28
|
-
items: any;
|
|
29
|
-
next: any;
|
|
30
|
-
}>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export default CalendarsAPI;
|
|
2
|
-
declare namespace CalendarsAPI {
|
|
3
|
-
export { getCalendarList as getList };
|
|
4
|
-
export { getCalendar as get };
|
|
5
|
-
export { addCalendar as add };
|
|
6
|
-
export { updateCalendar as update };
|
|
7
|
-
export { deleteCalendar as delete };
|
|
8
|
-
export { getCalendarsLookup as getLookup };
|
|
9
|
-
export { getTimezonesLookup };
|
|
10
|
-
}
|
|
11
|
-
declare function getCalendarList(params: any): Promise<{
|
|
12
|
-
items: any;
|
|
13
|
-
next: any;
|
|
14
|
-
}>;
|
|
15
|
-
declare function getCalendar({ itemId: id }: {
|
|
16
|
-
itemId: any;
|
|
17
|
-
}): Promise<any>;
|
|
18
|
-
declare function addCalendar({ itemInstance }: {
|
|
19
|
-
itemInstance: any;
|
|
20
|
-
}): Promise<any>;
|
|
21
|
-
declare function updateCalendar({ itemInstance, itemId: id }: {
|
|
22
|
-
itemInstance: any;
|
|
23
|
-
itemId: any;
|
|
24
|
-
}): Promise<any>;
|
|
25
|
-
declare function deleteCalendar({ id }: {
|
|
26
|
-
id: any;
|
|
27
|
-
}): Promise<any>;
|
|
28
|
-
declare function getCalendarsLookup(params: any): Promise<{
|
|
29
|
-
items: any;
|
|
30
|
-
next: any;
|
|
31
|
-
}>;
|
|
32
|
-
declare function getTimezonesLookup(params: any): Promise<{
|
|
33
|
-
items: any;
|
|
34
|
-
next: any;
|
|
35
|
-
}>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export default CaseCloseReasonGroupsAPI;
|
|
2
|
-
declare namespace CaseCloseReasonGroupsAPI {
|
|
3
|
-
export { getCloseReasonGroupsList as getList };
|
|
4
|
-
export { getCloseReasonGroups as get };
|
|
5
|
-
export { addCloseReasonGroups as add };
|
|
6
|
-
export { updateCloseReasonGroups as update };
|
|
7
|
-
export { deleteCloseReasonGroups as delete };
|
|
8
|
-
export { getCloseReasonGroupsLookup as getLookup };
|
|
9
|
-
}
|
|
10
|
-
declare function getCloseReasonGroupsList(params: any): Promise<{
|
|
11
|
-
items: any;
|
|
12
|
-
next: any;
|
|
13
|
-
}>;
|
|
14
|
-
declare function getCloseReasonGroups({ itemId: id }: {
|
|
15
|
-
itemId: any;
|
|
16
|
-
}): Promise<any>;
|
|
17
|
-
declare function addCloseReasonGroups({ itemInstance }: {
|
|
18
|
-
itemInstance: any;
|
|
19
|
-
}): Promise<any>;
|
|
20
|
-
declare function updateCloseReasonGroups({ itemInstance, itemId: id }: {
|
|
21
|
-
itemInstance: any;
|
|
22
|
-
itemId: any;
|
|
23
|
-
}): Promise<any>;
|
|
24
|
-
declare function deleteCloseReasonGroups({ id }: {
|
|
25
|
-
id: any;
|
|
26
|
-
}): Promise<any>;
|
|
27
|
-
declare function getCloseReasonGroupsLookup(params: any): Promise<{
|
|
28
|
-
items: any;
|
|
29
|
-
next: any;
|
|
30
|
-
}>;
|