@webitel/ui-sdk 24.10.54 → 24.10.56
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/CHANGELOG.md +15 -0
- package/dist/ui-sdk.js +582 -579
- package/dist/ui-sdk.umd.cjs +3 -3
- package/package.json +2 -2
- package/src/api/clients/agents/agentChats.js +22 -2
- package/src/api/clients/catalog/catalog.js +44 -0
- package/src/api/clients/index.js +2 -0
- package/src/components/wt-action-bar/WtActionBarActionsOrder.js +4 -1
- package/src/locale/en/en.js +1 -0
- package/src/locale/ru/ru.js +1 -0
- package/src/locale/ua/ua.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "24.10.
|
|
3
|
+
"version": "24.10.56",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"vue-multiselect": "^3.0.0-beta.3",
|
|
129
129
|
"vue-observe-visibility": "^2.0.0-alpha.1",
|
|
130
130
|
"vue-router": "^4.1.6",
|
|
131
|
-
"webitel-sdk": "^24.8.
|
|
131
|
+
"webitel-sdk": "^24.8.5",
|
|
132
132
|
"xlsx": "^0.18.5"
|
|
133
133
|
},
|
|
134
134
|
"devDependencies": {
|
|
@@ -7,13 +7,16 @@ import applyTransform, {
|
|
|
7
7
|
notify,
|
|
8
8
|
snakeToCamel,
|
|
9
9
|
} from '../../transformers/index.js';
|
|
10
|
+
import i18n from '../../../locale/i18n.js';
|
|
11
|
+
|
|
12
|
+
const { t } = i18n.global;
|
|
10
13
|
|
|
11
14
|
const instance = getDefaultInstance();
|
|
12
15
|
const configuration = getDefaultOpenAPIConfig();
|
|
13
16
|
|
|
14
17
|
const agentChatsService = new AgentChatsServiceApi(configuration, '', instance);
|
|
15
18
|
|
|
16
|
-
const
|
|
19
|
+
const getChatsList = async (params) => {
|
|
17
20
|
const { onlyClosed } = params;
|
|
18
21
|
|
|
19
22
|
try {
|
|
@@ -34,8 +37,25 @@ const getList = async (params) => {
|
|
|
34
37
|
}
|
|
35
38
|
};
|
|
36
39
|
|
|
40
|
+
const markChatProcessed = async (chatId) => { // add to chat unprocessedClose: true
|
|
41
|
+
try {
|
|
42
|
+
const response = await agentChatsService.markChatProcessed(chatId);
|
|
43
|
+
return applyTransform(response.data, [
|
|
44
|
+
snakeToCamel(),
|
|
45
|
+
]);
|
|
46
|
+
} catch (err) {
|
|
47
|
+
throw applyTransform(err, [
|
|
48
|
+
notify(({ callback }) => callback({
|
|
49
|
+
type: 'error',
|
|
50
|
+
text: t('errorNotifications.markChatProcessed'),
|
|
51
|
+
})),
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
37
56
|
const AgentChatsAPI = {
|
|
38
|
-
getList,
|
|
57
|
+
getList: getChatsList,
|
|
58
|
+
markChatProcessed,
|
|
39
59
|
};
|
|
40
60
|
|
|
41
61
|
export default AgentChatsAPI;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CatalogApiFactory } from 'webitel-sdk';
|
|
2
|
+
import {
|
|
3
|
+
getDefaultInstance,
|
|
4
|
+
getDefaultOpenAPIConfig,
|
|
5
|
+
} from '../../defaults/index.js';
|
|
6
|
+
import applyTransform, {
|
|
7
|
+
notify,
|
|
8
|
+
snakeToCamel,
|
|
9
|
+
} from '../../transformers/index.js';
|
|
10
|
+
|
|
11
|
+
const instance = getDefaultInstance();
|
|
12
|
+
const configuration = getDefaultOpenAPIConfig();
|
|
13
|
+
|
|
14
|
+
const catalogService = new CatalogApiFactory(configuration, '', instance);
|
|
15
|
+
|
|
16
|
+
const getChatMessagesList = async ({ chatId }) => {
|
|
17
|
+
const mergeMessagesData = ({ messages, peers }) => {
|
|
18
|
+
return messages.map(({ from, ...message }) => {
|
|
19
|
+
return {
|
|
20
|
+
...message,
|
|
21
|
+
peer: peers[from.id - 1],
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const response = await catalogService.getHistory(chatId);
|
|
28
|
+
const { messages, peers } = applyTransform(response.data, [
|
|
29
|
+
snakeToCamel(),
|
|
30
|
+
]);
|
|
31
|
+
return {
|
|
32
|
+
items: applyTransform({ messages, peers }, [mergeMessagesData]),
|
|
33
|
+
peers,
|
|
34
|
+
};
|
|
35
|
+
} catch (err) {
|
|
36
|
+
throw applyTransform(err, [notify]);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const CatalogAPI = {
|
|
41
|
+
getChatMessagesList,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default CatalogAPI;
|
package/src/api/clients/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import agents from './agents/agents.js';
|
|
|
2
2
|
import agentChats from './agents/agentChats.js';
|
|
3
3
|
import buckets from './buckets/buckets.js';
|
|
4
4
|
import calendars from './calendars/calendars.js';
|
|
5
|
+
import catalog from './catalog/catalog.js';
|
|
5
6
|
import chatGateways from './chatGateways/chatGateways.js';
|
|
6
7
|
import communications from './communications/communications.js';
|
|
7
8
|
import configurations from './configurations/configurations.js';
|
|
@@ -19,6 +20,7 @@ export {
|
|
|
19
20
|
agentChats,
|
|
20
21
|
buckets,
|
|
21
22
|
calendars,
|
|
23
|
+
catalog,
|
|
22
24
|
chatGateways,
|
|
23
25
|
communications,
|
|
24
26
|
flows,
|
package/src/locale/en/en.js
CHANGED
package/src/locale/ru/ru.js
CHANGED