@webitel/api-services 0.0.27 → 0.0.28
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 +42 -26
- package/src/api/clients/_shared/generatePermissionsApi.ts +4 -3
- package/src/api/clients/agents/agentChats.ts +5 -7
- package/src/api/clients/agents/agents.ts +4 -3
- package/src/api/clients/buckets/buckets.ts +4 -3
- package/src/api/clients/calendars/calendars.ts +4 -3
- package/src/api/clients/caseCloseReasonGroups/caseCloseReasonGroups.ts +4 -3
- package/src/api/clients/caseCloseReasons/caseCloseReasons.ts +4 -3
- package/src/api/clients/casePriorities/casePriorities.ts +4 -3
- package/src/api/clients/caseServiceCatalogs/serviceCatalogs.ts +9 -9
- package/src/api/clients/caseServices/services.ts +4 -3
- package/src/api/clients/caseSources/caseSources.ts +8 -12
- package/src/api/clients/caseStatusConditions/caseStatusConditions.ts +6 -5
- package/src/api/clients/caseStatuses/caseStatuses.ts +4 -3
- package/src/api/clients/catalog/catalog.ts +2 -5
- package/src/api/clients/chatGateways/chatGateways.ts +2 -2
- package/src/api/clients/communications/communications.ts +9 -7
- package/src/api/clients/configurations/configurations.ts +4 -3
- package/src/api/clients/contactGroups/contactGroups.ts +4 -3
- package/src/api/clients/flows/flow.ts +4 -3
- package/src/api/clients/gateways/gateways.ts +4 -3
- package/src/api/clients/history/transcript/callTranscript.ts +79 -0
- package/src/api/clients/index.ts +34 -68
- package/src/api/clients/labels/labels.ts +4 -3
- package/src/api/clients/lists/blacklists.ts +4 -3
- package/src/api/clients/media/media.ts +4 -3
- package/src/api/clients/object/object.ts +4 -3
- package/src/api/clients/queues/queues.ts +5 -4
- package/src/api/clients/quickReplies/quickReplies.ts +8 -12
- package/src/api/clients/roles/roles.ts +4 -3
- package/src/api/clients/skills/skills.ts +4 -3
- package/src/api/clients/slaConditions/slaConditions.ts +4 -3
- package/src/api/clients/slas/slas.ts +4 -3
- package/src/api/clients/teams/teams.ts +4 -3
- package/src/api/clients/users/users.ts +4 -3
- package/src/api/clients/wtTypes/index.ts +2 -0
- package/src/api/clients/wtTypes/sysTypes/sysTypes.ts +2 -1
- package/src/api/clients/wtTypes/typeExtensions/typeExtensions.ts +3 -2
- package/src/api/clients//321/201ontacts/contactChatMessagesHistory.ts +5 -7
- package/src/api/clients//321/201ontacts/contacts.ts +5 -4
- package/src/api/clients//321/201ontacts/enums/ContactsSearchMode.ts +1 -3
- package/src/api/clients//321/201ontacts/index.ts +3 -5
- package/src/api/defaults/index.ts +4 -11
- package/src/api/interceptors/request/index.ts +1 -1
- package/src/api/interceptors/response/index.ts +1 -1
- package/src/api/transformers/camelToSnake/camelToSnake.transformer.ts +1 -1
- package/src/api/transformers/notify/notify.transformer.ts +3 -3
- package/src/api/transformers/snakeToCamel/snakeToCamel.transformer.ts +1 -1
- package/src/api/transformers/starToSearch/starToSearch.transformer.ts +2 -4
- package/src/config/config.ts +13 -0
- package/src/gen/_docs/.nojekyll +1 -0
- package/src/gen/_docs/html/assets/hierarchy.js +1 -1
- package/src/gen/_docs/html/assets/highlight.css +101 -76
- package/src/gen/_docs/html/assets/icons.js +20 -17
- package/src/gen/_docs/html/assets/main.js +2503 -6
- package/src/gen/_docs/html/assets/navigation.js +2 -1
- package/src/gen/_docs/html/assets/search.js +2 -1
- package/src/gen/_docs/html/assets/style.css +1623 -1634
- package/src/index.ts +2 -2
- package/src/utils/api/caseConverters.ts +77 -0
- package/src/utils/api/index.ts +1 -0
- package/src/utils/gen/index.ts +19 -1
- package/src/utils/index.ts +1 -20
- package/types/api/clients/caseStatusConditions/caseStatusConditions.d.ts +2 -1
- package/types/api/clients/history/transcript/callTranscript.d.ts +11 -0
- package/types/api/clients/index.d.ts +31 -33
- package/types/api/clients/media/media.d.ts +2 -2
- package/types/api/clients/wtTypes/index.d.ts +2 -0
- package/types/api/clients/wtTypes/typeExtensions/typeExtensions.d.ts +1 -1
- package/types/api/clients//321/201ontacts/enums/ContactsSearchMode.d.ts +1 -2
- package/types/api/clients//321/201ontacts/index.d.ts +3 -4
- package/types/api/defaults/index.d.ts +4 -5
- package/types/api/interceptors/request/index.d.ts +1 -1
- package/types/api/interceptors/response/index.d.ts +1 -1
- package/types/config/config.d.ts +7 -0
- package/types/gen/_models/casesCaseCustom.d.ts +12 -0
- package/types/gen/_models/casesInputCaseCustom.d.ts +12 -0
- package/types/gen/_models/casesInputCreateCaseCustom.d.ts +12 -0
- package/types/gen/_models/engineTriggerObjectType.d.ts +1 -0
- package/types/gen/_models/fileServiceSearchFilesChannelItem.d.ts +2 -0
- package/types/gen/_models/protobufNullValue.d.ts +18 -0
- package/types/gen/_models/storageUploadFileChannel.d.ts +2 -0
- package/types/gen/file-policies-service/file-policies-service.zod.gen.d.ts +18 -0
- package/types/gen/file-service/file-service.api.gen.d.ts +3 -1
- package/types/gen/file-service/file-service.msw.api.gen.d.ts +3 -1
- package/types/gen/file-service/file-service.zod.gen.d.ts +18 -0
- package/types/gen/trigger-service/trigger-service.zod.gen.d.ts +9 -0
- package/types/index.d.ts +2 -2
- package/types/utils/api/caseConverters.d.ts +9 -0
- package/types/utils/api/index.d.ts +1 -0
- package/types/utils/index.d.ts +1 -7
- package/types/gen/_models/googleRpcStatus.d.ts +0 -12
- package/types/gen/_models/webitelCasesStatus.d.ts +0 -16
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/api-services",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
|
-
"make-all": "npm run gen:api && npm version patch && npm run publish-lib",
|
|
6
|
+
"make-all": "npm run gen:api && npm version patch && (npm run build:types || true) && (npm run format:all || true) && npm run publish-lib",
|
|
7
7
|
"gen:api": "npm run gen:api:convert-openapi && npm run gen:api:format-openapi && orval && npm run gen:api:typedoc && npm run gen:api:cleanup",
|
|
8
|
-
"publish-lib": "
|
|
8
|
+
"publish-lib": "npm publish --access public",
|
|
9
9
|
"gen:api:convert-openapi": "npx api-spec-converter --from=swagger_2 --to=openapi_3 --syntax=yaml https://raw.githubusercontent.com/webitel/protos/main/swagger/api.json > swagger.yaml",
|
|
10
10
|
"gen:api:format-openapi": "npx openapi-format swagger.yaml -o formatted-openapi.yaml",
|
|
11
11
|
"gen:api:typedoc": "npx typedoc",
|
|
@@ -17,28 +17,6 @@
|
|
|
17
17
|
"utils:i": "npm i"
|
|
18
18
|
},
|
|
19
19
|
"type": "module",
|
|
20
|
-
"exports": {
|
|
21
|
-
"./api": {
|
|
22
|
-
"types": "./types/api/index.d.ts",
|
|
23
|
-
"import": "./src/api/index.ts"
|
|
24
|
-
},
|
|
25
|
-
"./gen": {
|
|
26
|
-
"types": "./types/gen/index.d.ts",
|
|
27
|
-
"import": "./src/gen/index.ts"
|
|
28
|
-
},
|
|
29
|
-
"./utils": {
|
|
30
|
-
"types": "./types/utils/index.d.ts",
|
|
31
|
-
"import": "./src/utils/index.ts"
|
|
32
|
-
},
|
|
33
|
-
"./gen/utils": {
|
|
34
|
-
"types": "./types/utils/gen/index.d.ts",
|
|
35
|
-
"import": "./src/utils/gen/index.ts"
|
|
36
|
-
},
|
|
37
|
-
"./gen/models": {
|
|
38
|
-
"types": "./types/gen/_models/index.d.ts",
|
|
39
|
-
"import": "./src/gen/_models/index.ts"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
20
|
"files": [
|
|
43
21
|
"src/*",
|
|
44
22
|
"types/*",
|
|
@@ -48,7 +26,6 @@
|
|
|
48
26
|
"deep-copy": "^1.4.2",
|
|
49
27
|
"deep-equal": "^2.2.3",
|
|
50
28
|
"deepmerge": "^4.3.1",
|
|
51
|
-
"lodash-es": "^4.17.21",
|
|
52
29
|
"query-string": "^9.1.1",
|
|
53
30
|
"zod": "^3.25.55"
|
|
54
31
|
},
|
|
@@ -72,10 +49,49 @@
|
|
|
72
49
|
},
|
|
73
50
|
"dependencies": {
|
|
74
51
|
"@faker-js/faker": "^9.7.0",
|
|
52
|
+
"lodash-es": "^4.17.21",
|
|
75
53
|
"msw": "^2.8.2"
|
|
76
54
|
},
|
|
77
55
|
"engines": {
|
|
78
56
|
"npm": "10",
|
|
79
57
|
"node": "v22"
|
|
58
|
+
},
|
|
59
|
+
"exports": {
|
|
60
|
+
".": {
|
|
61
|
+
"types": "./types/index.d.ts",
|
|
62
|
+
"import": "./src/index.ts"
|
|
63
|
+
},
|
|
64
|
+
"./gen": {
|
|
65
|
+
"types": "./types/gen/index.d.ts",
|
|
66
|
+
"import": "./src/gen/index.ts"
|
|
67
|
+
},
|
|
68
|
+
"./gen/models": {
|
|
69
|
+
"types": "./types/gen/_models/index.d.ts",
|
|
70
|
+
"import": "./src/gen/_models/index.ts"
|
|
71
|
+
},
|
|
72
|
+
"./utils": {
|
|
73
|
+
"types": "./types/utils/index.d.ts",
|
|
74
|
+
"import": "./src/utils/index.ts"
|
|
75
|
+
},
|
|
76
|
+
"./gen/utils": {
|
|
77
|
+
"types": "./types/utils/gen/index.d.ts",
|
|
78
|
+
"import": "./src/utils/gen/index.ts"
|
|
79
|
+
},
|
|
80
|
+
"./api": {
|
|
81
|
+
"types": "./types/api/clients/index.d.ts",
|
|
82
|
+
"import": "./src/api/clients/index.ts"
|
|
83
|
+
},
|
|
84
|
+
"./api/defaults": {
|
|
85
|
+
"types": "./types/api/defaults/index.d.ts",
|
|
86
|
+
"import": "./src/api/defaults/index.ts"
|
|
87
|
+
},
|
|
88
|
+
"./api/transformers": {
|
|
89
|
+
"types": "./types/api/transformers/index.d.ts",
|
|
90
|
+
"import": "./src/api/transformers/index.ts"
|
|
91
|
+
},
|
|
92
|
+
"./api/axios": {
|
|
93
|
+
"types": "./types/api/axios/index.d.ts",
|
|
94
|
+
"import": "./src/api/axios/index.ts"
|
|
95
|
+
}
|
|
80
96
|
}
|
|
81
97
|
}
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
getDefaultGetListResponse,
|
|
3
3
|
getDefaultGetParams,
|
|
4
4
|
getDefaultInstance,
|
|
5
|
-
} from '../../defaults
|
|
6
|
-
import
|
|
5
|
+
} from '../../defaults';
|
|
6
|
+
import {
|
|
7
|
+
applyTransform,
|
|
7
8
|
camelToSnake,
|
|
8
9
|
generateUrl,
|
|
9
10
|
merge,
|
|
@@ -12,7 +13,7 @@ import applyTransform, {
|
|
|
12
13
|
sanitize,
|
|
13
14
|
snakeToCamel,
|
|
14
15
|
starToSearch,
|
|
15
|
-
} from '../../transformers
|
|
16
|
+
} from '../../transformers';
|
|
16
17
|
|
|
17
18
|
const permissionsUrl = 'acl';
|
|
18
19
|
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { AgentChatServiceApiFactory } from 'webitel-sdk';
|
|
2
2
|
|
|
3
|
-
import i18n from '../../../locale/i18n';
|
|
4
3
|
import {
|
|
5
4
|
getDefaultGetParams,
|
|
6
5
|
getDefaultInstance,
|
|
7
6
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
7
|
+
} from '../../defaults';
|
|
8
|
+
import {
|
|
9
|
+
applyTransform,
|
|
10
10
|
merge,
|
|
11
11
|
notify,
|
|
12
12
|
snakeToCamel,
|
|
13
|
-
} from '../../transformers
|
|
14
|
-
|
|
15
|
-
const { t } = i18n.global;
|
|
13
|
+
} from '../../transformers';
|
|
16
14
|
|
|
17
15
|
const instance = getDefaultInstance();
|
|
18
16
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -58,7 +56,7 @@ const markChatProcessed = async (chatId) => {
|
|
|
58
56
|
notify(({ callback }) =>
|
|
59
57
|
callback({
|
|
60
58
|
type: 'error',
|
|
61
|
-
text:
|
|
59
|
+
text: 'errorNotifications.markChatProcessed',
|
|
62
60
|
}),
|
|
63
61
|
),
|
|
64
62
|
]);
|
|
@@ -6,15 +6,16 @@ import {
|
|
|
6
6
|
getDefaultGetParams,
|
|
7
7
|
getDefaultInstance,
|
|
8
8
|
getDefaultOpenAPIConfig,
|
|
9
|
-
} from '../../defaults
|
|
10
|
-
import
|
|
9
|
+
} from '../../defaults';
|
|
10
|
+
import {
|
|
11
|
+
applyTransform,
|
|
11
12
|
camelToSnake,
|
|
12
13
|
merge,
|
|
13
14
|
notify,
|
|
14
15
|
sanitize,
|
|
15
16
|
snakeToCamel,
|
|
16
17
|
starToSearch,
|
|
17
|
-
} from '../../transformers
|
|
18
|
+
} from '../../transformers';
|
|
18
19
|
|
|
19
20
|
const instance = getDefaultInstance();
|
|
20
21
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
16
|
starToSearch,
|
|
16
|
-
} from '../../transformers
|
|
17
|
+
} from '../../transformers';
|
|
17
18
|
|
|
18
19
|
const instance = getDefaultInstance();
|
|
19
20
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -6,15 +6,16 @@ import {
|
|
|
6
6
|
getDefaultGetParams,
|
|
7
7
|
getDefaultInstance,
|
|
8
8
|
getDefaultOpenAPIConfig,
|
|
9
|
-
} from '../../defaults
|
|
10
|
-
import
|
|
9
|
+
} from '../../defaults';
|
|
10
|
+
import {
|
|
11
|
+
applyTransform,
|
|
11
12
|
camelToSnake,
|
|
12
13
|
merge,
|
|
13
14
|
notify,
|
|
14
15
|
sanitize,
|
|
15
16
|
snakeToCamel,
|
|
16
17
|
starToSearch,
|
|
17
|
-
} from '../../transformers
|
|
18
|
+
} from '../../transformers';
|
|
18
19
|
|
|
19
20
|
const instance = getDefaultInstance();
|
|
20
21
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
|
-
} from '../../transformers
|
|
16
|
+
} from '../../transformers';
|
|
16
17
|
|
|
17
18
|
const instance = getDefaultInstance();
|
|
18
19
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
|
-
} from '../../transformers
|
|
16
|
+
} from '../../transformers';
|
|
16
17
|
|
|
17
18
|
const instance = getDefaultInstance();
|
|
18
19
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
|
-
} from '../../transformers
|
|
16
|
+
} from '../../transformers';
|
|
16
17
|
|
|
17
18
|
const instance = getDefaultInstance();
|
|
18
19
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
16
|
starToSearch,
|
|
16
|
-
} from '../../transformers
|
|
17
|
+
} from '../../transformers';
|
|
17
18
|
|
|
18
19
|
const instance = getDefaultInstance();
|
|
19
20
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -58,19 +59,18 @@ const getCatalogsList = async (params) => {
|
|
|
58
59
|
'sort',
|
|
59
60
|
'fields',
|
|
60
61
|
'id',
|
|
62
|
+
'state',
|
|
61
63
|
'hasSubservices',
|
|
62
64
|
];
|
|
63
65
|
|
|
64
|
-
const { page, size, fields, sort, id, q, has_subservices } =
|
|
65
|
-
params,
|
|
66
|
-
[
|
|
66
|
+
const { page, size, fields, sort, id, q, state, has_subservices } =
|
|
67
|
+
applyTransform(params, [
|
|
67
68
|
merge(getDefaultGetParams()),
|
|
68
69
|
starToSearch('search'),
|
|
69
70
|
(params) => ({ ...params, q: params.search }),
|
|
70
71
|
sanitize(fieldsToSend),
|
|
71
72
|
camelToSnake(),
|
|
72
|
-
]
|
|
73
|
-
);
|
|
73
|
+
]);
|
|
74
74
|
try {
|
|
75
75
|
const response = await catalogsService.listCatalogs(
|
|
76
76
|
page,
|
|
@@ -79,7 +79,7 @@ const getCatalogsList = async (params) => {
|
|
|
79
79
|
sort,
|
|
80
80
|
id,
|
|
81
81
|
q,
|
|
82
|
-
|
|
82
|
+
state,
|
|
83
83
|
'100', // Implemented depth 100 for load all subservices in one request
|
|
84
84
|
servicesFieldsToSend,
|
|
85
85
|
has_subservices,
|
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
16
|
starToSearch,
|
|
16
|
-
} from '../../transformers
|
|
17
|
+
} from '../../transformers';
|
|
17
18
|
|
|
18
19
|
const instance = getDefaultInstance();
|
|
19
20
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -6,19 +6,15 @@ import {
|
|
|
6
6
|
} from '@webitel/api-services/gen';
|
|
7
7
|
import { getShallowFieldsToSendFromZodSchema } from '@webitel/api-services/gen/utils';
|
|
8
8
|
|
|
9
|
+
import { getDefaultGetListResponse, getDefaultGetParams } from '../../defaults';
|
|
9
10
|
import {
|
|
10
|
-
|
|
11
|
-
getDefaultGetParams,
|
|
12
|
-
} from '../../defaults/index';
|
|
13
|
-
import applyTransform, {
|
|
11
|
+
applyTransform,
|
|
14
12
|
camelToSnake,
|
|
15
13
|
merge,
|
|
16
14
|
notify,
|
|
17
15
|
sanitize,
|
|
18
16
|
snakeToCamel,
|
|
19
|
-
} from '../../transformers
|
|
20
|
-
|
|
21
|
-
const sourceService = getSources();
|
|
17
|
+
} from '../../transformers';
|
|
22
18
|
|
|
23
19
|
const getSourcesList = async (params) => {
|
|
24
20
|
const fieldsToSend = getShallowFieldsToSendFromZodSchema(
|
|
@@ -32,7 +28,7 @@ const getSourcesList = async (params) => {
|
|
|
32
28
|
]);
|
|
33
29
|
|
|
34
30
|
try {
|
|
35
|
-
const response = await
|
|
31
|
+
const response = await getSources().listSources({
|
|
36
32
|
page,
|
|
37
33
|
size,
|
|
38
34
|
fields,
|
|
@@ -57,7 +53,7 @@ const getSource = async ({ itemId: id }) => {
|
|
|
57
53
|
const itemResponseHandler = (item) => item.source; // TODO wtf??
|
|
58
54
|
|
|
59
55
|
try {
|
|
60
|
-
const response = await
|
|
56
|
+
const response = await getSources().locateSource(id);
|
|
61
57
|
return applyTransform(response.data, [snakeToCamel(), itemResponseHandler]);
|
|
62
58
|
} catch (err) {
|
|
63
59
|
throw applyTransform(err, [notify]);
|
|
@@ -70,7 +66,7 @@ const addSource = async ({ itemInstance }) => {
|
|
|
70
66
|
camelToSnake(),
|
|
71
67
|
]);
|
|
72
68
|
try {
|
|
73
|
-
const response = await
|
|
69
|
+
const response = await getSources().createSource(item);
|
|
74
70
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
75
71
|
} catch (err) {
|
|
76
72
|
throw applyTransform(err, [notify]);
|
|
@@ -84,7 +80,7 @@ const updateSource = async ({ itemInstance, itemId: id }) => {
|
|
|
84
80
|
]);
|
|
85
81
|
|
|
86
82
|
try {
|
|
87
|
-
const response = await
|
|
83
|
+
const response = await getSources().updateSource(id, item);
|
|
88
84
|
return applyTransform(response.data, [snakeToCamel()]);
|
|
89
85
|
} catch (err) {
|
|
90
86
|
throw applyTransform(err, [notify]);
|
|
@@ -93,7 +89,7 @@ const updateSource = async ({ itemInstance, itemId: id }) => {
|
|
|
93
89
|
|
|
94
90
|
const deleteSource = async ({ id }) => {
|
|
95
91
|
try {
|
|
96
|
-
const response = await
|
|
92
|
+
const response = await getSources().deleteSource(id);
|
|
97
93
|
return applyTransform(response.data, []);
|
|
98
94
|
} catch (err) {
|
|
99
95
|
throw applyTransform(err, [notify]);
|
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
|
-
} from '../../transformers
|
|
16
|
+
} from '../../transformers';
|
|
16
17
|
|
|
17
18
|
const instance = getDefaultInstance();
|
|
18
19
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -25,7 +26,7 @@ const statusConditionsService = StatusConditionsApiFactory(
|
|
|
25
26
|
|
|
26
27
|
const fieldsToSend = ['name', 'description'];
|
|
27
28
|
|
|
28
|
-
const getStatusConditionsList = async ({ parentId, ...rest }) => {
|
|
29
|
+
const getStatusConditionsList = async ({ statusId, parentId, ...rest }) => {
|
|
29
30
|
const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id'];
|
|
30
31
|
|
|
31
32
|
const { page, size, fields, sort, id, q } = applyTransform(rest, [
|
|
@@ -37,7 +38,7 @@ const getStatusConditionsList = async ({ parentId, ...rest }) => {
|
|
|
37
38
|
|
|
38
39
|
try {
|
|
39
40
|
const response = await statusConditionsService.listStatusConditions(
|
|
40
|
-
parentId,
|
|
41
|
+
statusId || parentId,
|
|
41
42
|
page,
|
|
42
43
|
size,
|
|
43
44
|
fields,
|
|
@@ -5,14 +5,15 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
|
-
} from '../../transformers
|
|
16
|
+
} from '../../transformers';
|
|
16
17
|
|
|
17
18
|
const instance = getDefaultInstance();
|
|
18
19
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { CatalogApiFactory } from 'webitel-sdk';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
getDefaultOpenAPIConfig,
|
|
6
|
-
} from '../../defaults/index';
|
|
7
|
-
import applyTransform, { notify, snakeToCamel } from '../../transformers/index';
|
|
3
|
+
import { getDefaultInstance, getDefaultOpenAPIConfig } from '../../defaults';
|
|
4
|
+
import { applyTransform, notify, snakeToCamel } from '../../transformers';
|
|
8
5
|
|
|
9
6
|
const instance = getDefaultInstance();
|
|
10
7
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getDefaultGetListResponse,
|
|
7
7
|
getDefaultGetParams,
|
|
8
8
|
getDefaultInstance,
|
|
9
|
-
} from '../../defaults
|
|
9
|
+
} from '../../defaults';
|
|
10
10
|
import {
|
|
11
11
|
applyTransform,
|
|
12
12
|
camelToSnake,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
sanitize,
|
|
17
17
|
snakeToCamel,
|
|
18
18
|
starToSearch,
|
|
19
|
-
} from '../../transformers
|
|
19
|
+
} from '../../transformers';
|
|
20
20
|
import { webChatGateway } from './defaults/webChatGateway';
|
|
21
21
|
|
|
22
22
|
const instance = getDefaultInstance();
|
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
mergeEach,
|
|
@@ -14,7 +15,7 @@ import applyTransform, {
|
|
|
14
15
|
sanitize,
|
|
15
16
|
snakeToCamel,
|
|
16
17
|
starToSearch,
|
|
17
|
-
} from '../../transformers
|
|
18
|
+
} from '../../transformers';
|
|
18
19
|
|
|
19
20
|
const instance = getDefaultInstance();
|
|
20
21
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -30,10 +31,10 @@ const getCommunicationsList = async (params) => {
|
|
|
30
31
|
default: false,
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
const { page, size, search, sort, fields, id } = applyTransform(
|
|
34
|
-
|
|
35
|
-
starToSearch('search'),
|
|
36
|
-
|
|
34
|
+
const { page, size, search, sort, fields, id, channel } = applyTransform(
|
|
35
|
+
params,
|
|
36
|
+
[merge(getDefaultGetParams()), starToSearch('search')],
|
|
37
|
+
);
|
|
37
38
|
|
|
38
39
|
try {
|
|
39
40
|
const response = await communicationService.searchCommunicationType(
|
|
@@ -43,6 +44,7 @@ const getCommunicationsList = async (params) => {
|
|
|
43
44
|
sort,
|
|
44
45
|
fields,
|
|
45
46
|
id,
|
|
47
|
+
channel,
|
|
46
48
|
);
|
|
47
49
|
const { items, next } = applyTransform(response.data, [
|
|
48
50
|
snakeToCamel(),
|
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
notify,
|
|
13
14
|
sanitize,
|
|
14
15
|
snakeToCamel,
|
|
15
16
|
starToSearch,
|
|
16
|
-
} from '../../transformers
|
|
17
|
+
} from '../../transformers';
|
|
17
18
|
|
|
18
19
|
const instance = getDefaultInstance();
|
|
19
20
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
getDefaultGetParams,
|
|
6
6
|
getDefaultInstance,
|
|
7
7
|
getDefaultOpenAPIConfig,
|
|
8
|
-
} from '../../defaults
|
|
9
|
-
import
|
|
8
|
+
} from '../../defaults';
|
|
9
|
+
import {
|
|
10
|
+
applyTransform,
|
|
10
11
|
camelToSnake,
|
|
11
12
|
merge,
|
|
12
13
|
mergeEach,
|
|
13
14
|
notify,
|
|
14
15
|
sanitize,
|
|
15
16
|
snakeToCamel,
|
|
16
|
-
} from '../../transformers
|
|
17
|
+
} from '../../transformers';
|
|
17
18
|
import { generatePermissionsApi } from '../_shared/generatePermissionsApi';
|
|
18
19
|
|
|
19
20
|
const instance = getDefaultInstance();
|
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
getDefaultGetParams,
|
|
9
9
|
getDefaultInstance,
|
|
10
10
|
getDefaultOpenAPIConfig,
|
|
11
|
-
} from '../../defaults
|
|
12
|
-
import
|
|
11
|
+
} from '../../defaults';
|
|
12
|
+
import {
|
|
13
|
+
applyTransform,
|
|
13
14
|
camelToSnake,
|
|
14
15
|
merge,
|
|
15
16
|
mergeEach,
|
|
@@ -17,7 +18,7 @@ import applyTransform, {
|
|
|
17
18
|
sanitize,
|
|
18
19
|
snakeToCamel,
|
|
19
20
|
starToSearch,
|
|
20
|
-
} from '../../transformers
|
|
21
|
+
} from '../../transformers';
|
|
21
22
|
|
|
22
23
|
const instance = getDefaultInstance();
|
|
23
24
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
getDefaultGetListResponse,
|
|
3
3
|
getDefaultGetParams,
|
|
4
4
|
getDefaultInstance,
|
|
5
|
-
} from '../../defaults
|
|
6
|
-
import
|
|
5
|
+
} from '../../defaults';
|
|
6
|
+
import {
|
|
7
|
+
applyTransform,
|
|
7
8
|
camelToSnake,
|
|
8
9
|
generateUrl,
|
|
9
10
|
merge,
|
|
@@ -12,7 +13,7 @@ import applyTransform, {
|
|
|
12
13
|
sanitize,
|
|
13
14
|
snakeToCamel,
|
|
14
15
|
starToSearch,
|
|
15
|
-
} from '../../transformers
|
|
16
|
+
} from '../../transformers';
|
|
16
17
|
import registerGateway from './defaults/registerGateway';
|
|
17
18
|
import trunkingGateway from './defaults/trunkingGateway';
|
|
18
19
|
|