@webitel/api-services 0.0.61 → 0.0.62
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
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getCallService } from '@webitel/api-services/gen';
|
|
2
|
+
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
3
|
+
import {
|
|
4
|
+
applyTransform,
|
|
5
|
+
camelToSnake,
|
|
6
|
+
merge,
|
|
7
|
+
notify,
|
|
8
|
+
snakeToCamel,
|
|
9
|
+
starToSearch,
|
|
10
|
+
} from '../../transformers';
|
|
11
|
+
|
|
12
|
+
const getCallHistoryList = async ({ options, ...params }) => {
|
|
13
|
+
const listParams = applyTransform(params, [
|
|
14
|
+
merge(getDefaultGetParams()),
|
|
15
|
+
starToSearch('search'),
|
|
16
|
+
]);
|
|
17
|
+
try {
|
|
18
|
+
const response = await getCallService().searchHistoryCall(
|
|
19
|
+
listParams,
|
|
20
|
+
options,
|
|
21
|
+
);
|
|
22
|
+
const { items, next } = applyTransform(response.data, [
|
|
23
|
+
snakeToCamel(),
|
|
24
|
+
merge(getDefaultGetListResponse()),
|
|
25
|
+
]);
|
|
26
|
+
return { items, next };
|
|
27
|
+
} catch (err) {
|
|
28
|
+
throw applyTransform(err, [notify]);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const getCallHistoryListPost = async ({ data, options }) => {
|
|
33
|
+
const body = applyTransform(data, [camelToSnake()]);
|
|
34
|
+
try {
|
|
35
|
+
const response = await getCallService().searchHistoryCallPost(
|
|
36
|
+
body,
|
|
37
|
+
options,
|
|
38
|
+
);
|
|
39
|
+
const { items, next } = applyTransform(response.data, [
|
|
40
|
+
snakeToCamel(),
|
|
41
|
+
merge(getDefaultGetListResponse()),
|
|
42
|
+
]);
|
|
43
|
+
return { items, next };
|
|
44
|
+
} catch (err) {
|
|
45
|
+
throw applyTransform(err, [notify]);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const getCallHistoryLookup = (params) =>
|
|
50
|
+
getCallHistoryList({
|
|
51
|
+
...params,
|
|
52
|
+
fields: params?.fields || ['id', 'destination', 'state', 'created_at'],
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const CallHistoryAPI = {
|
|
56
|
+
getList: getCallHistoryList,
|
|
57
|
+
getListPost: getCallHistoryListPost,
|
|
58
|
+
getLookup: getCallHistoryLookup,
|
|
59
|
+
};
|
package/src/api/clients/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './agents/agentChats';
|
|
|
3
3
|
export * from './agents/agents';
|
|
4
4
|
export * from './buckets/buckets';
|
|
5
5
|
export * from './calendars/calendars';
|
|
6
|
+
export * from './callHistory/callHistory';
|
|
6
7
|
export * from './caseCloseReasonGroups/caseCloseReasonGroups';
|
|
7
8
|
export * from './caseCloseReasons/caseCloseReasons';
|
|
8
9
|
export * from './casePriorities/casePriorities';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const CallHistoryAPI: {
|
|
2
|
+
getList: ({ options, ...params }: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
options: any;
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
items: any;
|
|
7
|
+
next: any;
|
|
8
|
+
}>;
|
|
9
|
+
getListPost: ({ data, options }: {
|
|
10
|
+
data: any;
|
|
11
|
+
options: any;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
items: any;
|
|
14
|
+
next: any;
|
|
15
|
+
}>;
|
|
16
|
+
getLookup: (params: any) => Promise<{
|
|
17
|
+
items: any;
|
|
18
|
+
next: any;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
@@ -2,6 +2,7 @@ export * from './_shared/generatePermissionsApi';
|
|
|
2
2
|
export * from './agents/agentChats';
|
|
3
3
|
export * from './agents/agents';
|
|
4
4
|
export * from './buckets/buckets';
|
|
5
|
+
export * from './callHistory/callHistory';
|
|
5
6
|
export * from './calendars/calendars';
|
|
6
7
|
export * from './caseCloseReasonGroups/caseCloseReasonGroups';
|
|
7
8
|
export * from './caseCloseReasons/caseCloseReasons';
|