@webitel/api-services 0.0.93 → 0.0.95
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,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
createCallExportBody,
|
|
3
|
+
createScreenrecordingExportBody,
|
|
4
|
+
listScreenrecordingExportsQueryParams,
|
|
5
|
+
getPdfService,
|
|
6
6
|
} from '@webitel/api-services/gen';
|
|
7
7
|
import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
|
|
8
8
|
|
|
@@ -16,23 +16,23 @@ import {
|
|
|
16
16
|
snakeToCamel,
|
|
17
17
|
} from '../../transformers';
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const createScreenrecordingExport = async ({ agentId, itemInstance }) => {
|
|
20
20
|
const item = applyTransform(itemInstance, [
|
|
21
|
-
sanitize(getShallowFieldsToSendFromZodSchema(
|
|
21
|
+
sanitize(getShallowFieldsToSendFromZodSchema(createScreenrecordingExportBody)),
|
|
22
22
|
camelToSnake(),
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
25
|
try {
|
|
26
|
-
const response = await getPdfService().
|
|
26
|
+
const response = await getPdfService().createScreenrecordingExport(agentId, item);
|
|
27
27
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
28
28
|
} catch (err) {
|
|
29
29
|
throw applyTransform(err, [notify]);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const listScreenrecordingExports = async (params: any) => {
|
|
34
34
|
const fieldsToSend = getShallowFieldsToSendFromZodSchema(
|
|
35
|
-
|
|
35
|
+
listScreenrecordingExportsQueryParams,
|
|
36
36
|
);
|
|
37
37
|
|
|
38
38
|
const { page, size } = applyTransform(params, [
|
|
@@ -42,15 +42,15 @@ const getPdfExportHistory = async (params: any) => {
|
|
|
42
42
|
]);
|
|
43
43
|
|
|
44
44
|
try {
|
|
45
|
-
const response = await getPdfService().
|
|
45
|
+
const response = await getPdfService().listScreenrecordingExports(params.agentId, {
|
|
46
46
|
page,
|
|
47
47
|
size,
|
|
48
48
|
});
|
|
49
|
-
const {
|
|
49
|
+
const { items, next } = applyTransform(response.data, [
|
|
50
50
|
merge(getDefaultGetListResponse()),
|
|
51
51
|
]);
|
|
52
52
|
return {
|
|
53
|
-
items: applyTransform(
|
|
53
|
+
items: applyTransform(items, [snakeToCamel()]),
|
|
54
54
|
next,
|
|
55
55
|
};
|
|
56
56
|
} catch (err) {
|
|
@@ -58,9 +58,9 @@ const getPdfExportHistory = async (params: any) => {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
const
|
|
61
|
+
const createCallExport = async ({fileId, params}) => {
|
|
62
62
|
const fieldsToSend = getShallowFieldsToSendFromZodSchema(
|
|
63
|
-
|
|
63
|
+
createCallExportBody,
|
|
64
64
|
);
|
|
65
65
|
|
|
66
66
|
const { domainId } = applyTransform(params, [
|
|
@@ -68,7 +68,7 @@ const downloadPdfExport = async ({fileId, params}) => {
|
|
|
68
68
|
]);
|
|
69
69
|
|
|
70
70
|
try {
|
|
71
|
-
const response = await getPdfService().
|
|
71
|
+
const response = await getPdfService().createCallExport(fileId, {
|
|
72
72
|
domainId,
|
|
73
73
|
});
|
|
74
74
|
return response.data;
|
|
@@ -77,8 +77,18 @@ const downloadPdfExport = async ({fileId, params}) => {
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
+
const deleteExport = async (id: string) => {
|
|
81
|
+
try {
|
|
82
|
+
const response = await getPdfService().deleteExport(id);
|
|
83
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
84
|
+
} catch (err) {
|
|
85
|
+
throw applyTransform(err, [notify]);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
80
89
|
export const PdfServicesAPI = {
|
|
81
|
-
|
|
82
|
-
getList:
|
|
83
|
-
|
|
90
|
+
createScreenrecordingExport,
|
|
91
|
+
getList: listScreenrecordingExports,
|
|
92
|
+
delete: deleteExport,
|
|
93
|
+
download: createCallExport,
|
|
84
94
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const PdfServicesAPI: {
|
|
2
|
-
|
|
2
|
+
createScreenrecordingExport: ({ agentId, itemInstance }: {
|
|
3
3
|
agentId: any;
|
|
4
4
|
itemInstance: any;
|
|
5
5
|
}) => Promise<any>;
|
|
@@ -7,6 +7,7 @@ export declare const PdfServicesAPI: {
|
|
|
7
7
|
items: any;
|
|
8
8
|
next: any;
|
|
9
9
|
}>;
|
|
10
|
+
delete: (id: string) => Promise<any>;
|
|
10
11
|
download: ({ fileId, params }: {
|
|
11
12
|
fileId: any;
|
|
12
13
|
params: any;
|