@webitel/ui-sdk 24.12.11 → 24.12.12

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "24.12.11",
3
+ "version": "24.12.12",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -2,10 +2,12 @@ import { AgentChatServiceApiFactory } from 'webitel-sdk';
2
2
  import {
3
3
  getDefaultInstance,
4
4
  getDefaultOpenAPIConfig,
5
+ getDefaultGetParams,
5
6
  } from '../../defaults/index.js';
6
7
  import applyTransform, {
8
+ merge,
7
9
  notify,
8
- snakeToCamel,
10
+ snakeToCamel, starToSearch,
9
11
  } from '../../transformers/index.js';
10
12
  import i18n from '../../../locale/i18n.js';
11
13
 
@@ -17,21 +19,30 @@ const configuration = getDefaultOpenAPIConfig();
17
19
  const agentChatsService = new AgentChatServiceApiFactory(configuration, '', instance);
18
20
 
19
21
  const getChatsList = async (params) => {
20
- const { onlyClosed } = params;
22
+ const {
23
+ size,
24
+ page,
25
+ onlyClosed
26
+ } = applyTransform(params, [
27
+ merge(getDefaultGetParams()),
28
+ ]);
21
29
 
22
30
  try {
23
31
  const response = await agentChatsService.getAgentChats(
24
- undefined,
25
- undefined,
32
+ size,
33
+ page,
26
34
  undefined,
27
35
  undefined,
28
36
  undefined,
29
37
  onlyClosed,
30
38
  );
31
- const { items } = applyTransform(response.data, [
39
+ const { items, next } = applyTransform(response.data, [
32
40
  snakeToCamel(),
33
41
  ]);
34
- return items;
42
+ return {
43
+ items,
44
+ next,
45
+ };
35
46
  } catch (err) {
36
47
  throw applyTransform(err, [notify]);
37
48
  }