@webitel/ui-sdk 24.10.29 → 24.10.31
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/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1509 -1509
- package/dist/ui-sdk.umd.cjs +15 -15
- package/package.json +1 -1
- package/src/api/crm/contactChatMessagesHistory.js +22 -4
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +1 -0
- package/src/locale/en/en.js +4 -0
- package/src/locale/ru/ru.js +3 -0
- package/src/locale/ua/ua.js +3 -0
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
getDefaultInstance,
|
|
5
5
|
getDefaultOpenAPIConfig,
|
|
6
6
|
} from '../defaults/index.js';
|
|
7
|
-
import applyTransform, { notify, snakeToCamel, merge } from '../transformers/index.js';
|
|
7
|
+
import applyTransform, { notify, snakeToCamel, merge, sanitize } from '../transformers/index.js';
|
|
8
8
|
|
|
9
9
|
const instance = getDefaultInstance();
|
|
10
10
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -33,7 +33,8 @@ const getChat = async ({ contactId, chatId }) => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// all messages from all contacts chats
|
|
36
|
-
const getAllMessages = async (
|
|
36
|
+
const getAllMessages = async (params) => {
|
|
37
|
+
|
|
37
38
|
const mergeMessagesData = ({ messages, peers, chats }) => {
|
|
38
39
|
return messages.map(({ from, chat, ...message }) => {
|
|
39
40
|
return {
|
|
@@ -44,8 +45,20 @@ const getAllMessages = async ({ id }) => {
|
|
|
44
45
|
});
|
|
45
46
|
};
|
|
46
47
|
|
|
48
|
+
const {
|
|
49
|
+
contactId,
|
|
50
|
+
page,
|
|
51
|
+
size,
|
|
52
|
+
} = params;
|
|
53
|
+
|
|
47
54
|
try {
|
|
48
|
-
const response = await contactChatService.getContactChatHistory2(
|
|
55
|
+
const response = await contactChatService.getContactChatHistory2(
|
|
56
|
+
contactId,
|
|
57
|
+
undefined,
|
|
58
|
+
undefined,
|
|
59
|
+
size,
|
|
60
|
+
`${page || 1}`,
|
|
61
|
+
);
|
|
49
62
|
const { messages, peers, chats, next } = applyTransform(response.data, [
|
|
50
63
|
snakeToCamel(),
|
|
51
64
|
merge(getDefaultGetListResponse()),
|
|
@@ -55,7 +68,12 @@ const getAllMessages = async ({ id }) => {
|
|
|
55
68
|
next,
|
|
56
69
|
};
|
|
57
70
|
} catch (err) {
|
|
58
|
-
throw applyTransform(err, [
|
|
71
|
+
throw applyTransform(err, [
|
|
72
|
+
notify(({ callback }) => callback({
|
|
73
|
+
type: 'error',
|
|
74
|
+
text: t('errorNotifications.chatHistoryApi'),
|
|
75
|
+
})),
|
|
76
|
+
]);
|
|
59
77
|
}
|
|
60
78
|
};
|
|
61
79
|
|
package/src/locale/en/en.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ChannelType,
|
|
6
6
|
EngineRoutingSchemaType,
|
|
7
7
|
} from 'webitel-sdk';
|
|
8
|
+
import { notify } from '../../api/transformers/index.js';
|
|
8
9
|
import ChatGatewayProvider from '../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
|
|
9
10
|
import QueueType from '../../enums/QueueType/QueueType.enum.js';
|
|
10
11
|
import AdminSections from '../../enums/WebitelApplications/AdminSections.enum.js';
|
|
@@ -385,4 +386,7 @@ export default {
|
|
|
385
386
|
exportToJson: 'Export to JSON',
|
|
386
387
|
},
|
|
387
388
|
},
|
|
389
|
+
errorNotifications: {
|
|
390
|
+
chatHistoryApi: 'There was an error loading the chat history',
|
|
391
|
+
},
|
|
388
392
|
};
|
package/src/locale/ru/ru.js
CHANGED