@webitel/ui-sdk 24.10.3 → 24.10.4
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 +111 -114
- package/dist/ui-sdk.umd.cjs +8 -8
- package/package.json +6 -4
- package/src/api/axios/generateInstance.js +1 -4
- package/src/api/clients/agents/agents.js +31 -78
- package/src/api/clients/buckets/buckets.js +17 -57
- package/src/api/clients/calendars/calendars.js +18 -71
- package/src/api/clients/chatGateways/chatGateways.js +23 -61
- package/src/api/clients/chatGateways/defaults/webChatGateway.js +6 -8
- package/src/api/clients/chatGateways/enums/WebchatAlternativeChannel.enum.js +3 -3
- package/src/api/clients/communications/communications.js +20 -62
- package/src/api/clients/configurations/configurations.js +18 -3
- package/src/api/clients/flows/flow.js +17 -60
- package/src/api/clients/gateways/gateways.js +20 -59
- package/src/api/clients/index.js +1 -1
- package/src/api/clients/lists/blacklists.js +18 -60
- package/src/api/clients/media/media.js +13 -43
- package/src/api/clients/queues/defaults/processing.js +10 -6
- package/src/api/clients/queues/queues.js +21 -69
- package/src/api/clients/roles/roles.js +15 -33
- package/src/api/clients/users/__tests__/users.spec.js +43 -26
- package/src/api/clients/users/users.js +21 -56
- package/src/api/crm/contactChatMessagesHistory.js +8 -23
- package/src/api/crm/index.js +1 -3
- package/src/api/defaults/getDefaultGetParams/getDefaultGetParams.js +1 -4
- package/src/api/defaults/getDefaultInstance/getDefaultInstance.js +10 -11
- package/src/api/defaults/getDefaultOpenAPIConfig/getDefaultOpenAPIConfig.js +6 -5
- package/src/api/defaults/index.js +2 -4
- package/src/api/history/index.js +1 -3
- package/src/api/history/transcript/callTranscript.js +10 -30
- package/src/api/interceptors/request/updateToken.interceptor.js +1 -2
- package/src/api/transformers/merge/merge.transformer.js +4 -1
- package/src/api/transformers/mergeEach/mergeEach.transformer.js +4 -4
- package/src/api/transformers/notify/notify.transformer.js +9 -6
- package/src/api/transformers/starToSearch/starToSearch.transformer.js +8 -6
- package/src/components/index.js +3 -6
- package/src/components/on-demand/wt-cc-agent-status-timers/__tests__/wt-cc-agent-status-timers.spec.js +2 -4
- package/src/components/transitions/wt-expand-transition.vue +2 -3
- package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +1 -2
- package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +1 -2
- package/src/components/wt-app-header/wt-app-navigator.vue +15 -9
- package/src/components/wt-avatar/wt-avatar.vue +8 -3
- package/src/components/wt-button/wt-button.vue +0 -1
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +4 -5
- package/src/components/wt-button-select/wt-button-select.vue +0 -1
- package/src/components/wt-context-menu/wt-context-menu.vue +32 -35
- package/src/components/wt-dummy/wt-dummy.vue +2 -5
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +10 -7
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +4 -8
- package/src/components/wt-icon/wt-icon.vue +0 -1
- package/src/components/wt-indicator/__tests__/WtIndicator.spec.js +3 -2
- package/src/components/wt-indicator/wt-indicator.vue +10 -1
- package/src/components/wt-input/wt-input.vue +7 -10
- package/src/components/wt-item-link/wt-item-link.vue +7 -4
- package/src/components/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +7 -15
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +7 -7
- package/src/components/wt-notification/wt-notification.vue +1 -2
- package/src/components/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +6 -3
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +4 -1
- package/src/components/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +1 -2
- package/src/components/wt-pagination/wt-pagination.vue +1 -3
- package/src/components/wt-player/scripts/__tests__/createPlyrURL.spec.js +4 -8
- package/src/components/wt-player/wt-player.vue +13 -4
- package/src/components/wt-popup/wt-popup.vue +2 -1
- package/src/components/wt-search-bar/wt-search-bar.vue +1 -1
- package/src/components/wt-select/mixins/multiselectMixin.js +2 -5
- package/src/components/wt-select/wt-select.vue +12 -11
- package/src/components/wt-slider/wt-slider.vue +4 -2
- package/src/components/wt-status-select/wt-status-select.vue +10 -6
- package/src/components/wt-stepper/wt-stepper.vue +6 -4
- package/src/components/wt-switcher/wt-switcher.vue +1 -3
- package/src/components/wt-table/__tests__/WtTable.spec.js +2 -5
- package/src/components/wt-table/wt-table.vue +18 -16
- package/src/components/wt-table-column-select/wt-table-column-select.vue +9 -8
- package/src/components/wt-tabs/wt-tabs.vue +1 -3
- package/src/components/wt-tags-input/mixin/taggableMixin.js +7 -7
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +2 -4
- package/src/components/wt-textarea/wt-textarea.vue +3 -2
- package/src/components/wt-timepicker/wt-timepicker.vue +1 -3
- package/src/components/wt-tooltip/_internals/useTooltipTriggerSubscriptions.js +1 -3
- package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +8 -12
- package/src/components/wt-tooltip/wt-tooltip.vue +13 -13
- package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +6 -4
- package/src/composables/useCachedInterval/useCachedInterval.js +3 -8
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +11 -33
- package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +11 -9
- package/src/enums/WebitelApplications/AdminSections.enum.js +28 -28
- package/src/enums/WebitelApplications/CrmSections.enum.js +1 -1
- package/src/locale/en/en.js +12 -15
- package/src/locale/es/es.js +4 -8
- package/src/locale/kz/kz.js +5 -7
- package/src/locale/ru/ru.js +7 -11
- package/src/locale/ua/ua.js +13 -17
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +1 -2
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +4 -2
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +4 -1
- package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +1 -1
- package/src/mixins/dataFilterMixins/apiFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/enumFilterMixin.js +5 -6
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +1 -4
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +1 -2
- package/src/mixins/validationMixin/useValidation.js +25 -19
- package/src/mixins/validationMixin/validationMixin.js +22 -10
- package/src/modules/AgentStatusSelect/api/pause-cause.js +3 -11
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +16 -18
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +1 -2
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +12 -12
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +0 -1
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +20 -7
- package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +2 -4
- package/src/modules/Appearance/components/wt-dark-mode-switcher.vue +0 -1
- package/src/modules/AuditForm/components/__tests__/audit-form-question-read-wrapper.spec.js +1 -2
- package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +15 -25
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +11 -20
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +1 -4
- package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +4 -7
- package/src/modules/AuditForm/components/audit-form-question.vue +18 -17
- package/src/modules/AuditForm/components/audit-form.vue +12 -14
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options-write-row.spec.js +1 -2
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options.spec.js +1 -3
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue +11 -15
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +1 -4
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +16 -20
- package/src/modules/AuditForm/schemas/AuditFormQuestionOptionsSchema.js +1 -3
- package/src/modules/CSVExport/CSVExport.js +3 -7
- package/src/modules/CSVExport/XLSExport.js +6 -7
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +1 -2
- package/src/modules/CSVExport/mixins/exportCSVMixin.js +2 -5
- package/src/modules/CSVExport/mixins/exportXLSMixin.js +2 -4
- package/src/modules/CardStoreModule/store/CardStoreModule.js +2 -6
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +13 -10
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +5 -14
- package/src/modules/FilesExport/FilesExport.js +4 -3
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +12 -12
- package/src/modules/FilesExport/mixins/exportFilesMixin.js +6 -7
- package/src/modules/FilesExport/scripts/generateMediaURL.js +1 -2
- package/src/modules/Filters/classes/BaseFilterSchema.js +21 -25
- package/src/modules/Filters/components/filter-pagination.vue +7 -3
- package/src/modules/Filters/components/filter-search.vue +21 -12
- package/src/modules/Filters/components/filter-table-fields.vue +1 -3
- package/src/modules/Filters/scripts/getters/index.js +1 -5
- package/src/modules/Filters/scripts/getters/queryGetter.js +2 -3
- package/src/modules/Filters/scripts/restores/index.js +1 -4
- package/src/modules/Filters/scripts/setters/index.js +1 -5
- package/src/modules/Filters/scripts/setters/querySetter.js +24 -22
- package/src/modules/Filters/scripts/utils/changeRouteQuery.js +16 -15
- package/src/modules/Filters/store/FiltersStoreModule.js +51 -45
- package/src/modules/Filters/store/__tests__/FiltersStoreModule.spec.js +51 -45
- package/src/modules/Notifications/store/NotificationsStoreModule.js +41 -38
- package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +6 -6
- package/src/modules/QueryFilters/api/defaults.js +2 -3
- package/src/modules/QueryFilters/classes/ApiFilterSchema.js +1 -4
- package/src/modules/QueryFilters/classes/EnumFilterSchema.js +1 -4
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +1 -2
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +2 -4
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +2 -4
- package/src/modules/QueryFilters/components/filter-table-fields.vue +1 -5
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +4 -3
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +2 -4
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +4 -2
- package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +4 -1
- package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +1 -1
- package/src/modules/QueryFilters/mixins/apiFilterMixin.js +1 -1
- package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +4 -2
- package/src/modules/QueryFilters/mixins/enumFilterMixin.js +9 -11
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +2 -4
- package/src/modules/QueryFilters/mixins/sortFilterMixin.js +2 -5
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +13 -17
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +15 -16
- package/src/modules/TableStoreModule/store/TableStoreModule.js +14 -33
- package/src/modules/TableStoreModule/store/__tests__/TableStoreModule.spec.js +69 -83
- package/src/modules/Userinfo/api/userinfo.js +6 -19
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +5 -12
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +38 -41
- package/src/plugins/breakpoint/breakpoint.plugin.js +11 -16
- package/src/scripts/__tests__/caseConverters.spec.js +1 -4
- package/src/scripts/__tests__/debounce.spec.js +3 -1
- package/src/scripts/__tests__/prettifyFileSize.spec.js +2 -2
- package/src/scripts/__tests__/preventHiddenPageCallsDecorator.spec.js +7 -4
- package/src/scripts/__tests__/updateObject.spec.js +3 -5
- package/src/scripts/caseConverters.js +22 -38
- package/src/scripts/debounce.js +1 -5
- package/src/scripts/editProxy.js +8 -7
- package/src/scripts/prettifyFileSize.js +1 -1
- package/src/scripts/preventHiddenPageCallsDecorator.js +3 -6
- package/src/store/BaseStoreModules/ApiStoreModule.js +7 -33
- package/src/store/BaseStoreModules/BaseStoreModule.js +14 -23
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +7 -28
- package/src/store/helpers/getNamespacedState.js +2 -4
- package/src/store/new/modules/apiStoreModule/apiStoreModule.js +7 -27
- package/src/store/new/modules/cardStoreModule/cardStoreModule.js +0 -1
- package/src/store/new/modules/tableStoreModule/__tests__/tableStoreModule.spec.js +64 -77
- package/src/store/new/modules/tableStoreModule/tableStoreModule.js +12 -29
- package/src/tests/mocks/axiosMock.js +25 -19
- package/src/validators/decimalValidator.js +5 -4
- package/src/validators/websocketValidator/__tests__/websocketValidator.spec.js +1 -2
- package/src/validators/websocketValidator/websocketValidator.js +1 -1
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "24.10.
|
|
3
|
+
"version": "24.10.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
7
7
|
"build": "vite build",
|
|
8
8
|
"serve": "vite preview",
|
|
9
9
|
"test:unit": "vitest",
|
|
10
|
-
"lint
|
|
10
|
+
"lint-all": "npx @biomejs/biome check --write ./src",
|
|
11
|
+
"lint-all:unsafe": "npx @biomejs/biome check --write --unsafe ./src",
|
|
12
|
+
"lint-changed:unsafe": "npx @biomejs/biome check --write --unsafe --changed",
|
|
13
|
+
"lint:pre-commit": "npx @biomejs/biome check --write --unsafe --changed --no-errors-on-unmatched",
|
|
11
14
|
"publish-lib": "npm run test:unit && npm run build && npm publish --access public",
|
|
12
15
|
"publish-lib:testless": "npm run build && npm publish --access public",
|
|
13
16
|
"docs:dev": "vitepress dev docs --port 8080",
|
|
@@ -120,13 +123,12 @@
|
|
|
120
123
|
"xlsx": "^0.18.5"
|
|
121
124
|
},
|
|
122
125
|
"devDependencies": {
|
|
126
|
+
"@biomejs/biome": "1.8.3",
|
|
123
127
|
"@vitejs/plugin-vue": "5.0.4",
|
|
124
128
|
"@vitest/coverage-v8": "^1.4.0",
|
|
125
129
|
"@vue/compat": "^3.4.15",
|
|
126
130
|
"@vue/compiler-sfc": "^3.4.15",
|
|
127
131
|
"@vue/test-utils": "^2.4.5",
|
|
128
|
-
"eslint": "^9.3.0",
|
|
129
|
-
"eslint-plugin-vue": "^9.26.0",
|
|
130
132
|
"globby": "^14.0.0",
|
|
131
133
|
"happy-dom": "^14.11.0",
|
|
132
134
|
"markdown-it": "^13.0.2",
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
|
|
3
3
|
// 'X-Webitel-Access' ~ 'X-Access-Token'
|
|
4
|
-
const generateInstance = ({
|
|
5
|
-
interceptors,
|
|
6
|
-
baseURL,
|
|
7
|
-
} = {}) => {
|
|
4
|
+
const generateInstance = ({ interceptors, baseURL } = {}) => {
|
|
8
5
|
const instance = axios.create({
|
|
9
6
|
baseURL,
|
|
10
7
|
headers: {
|
|
@@ -47,10 +47,7 @@ const getAgentsList = async (params) => {
|
|
|
47
47
|
notTeamId,
|
|
48
48
|
supervisorId,
|
|
49
49
|
notSkillId,
|
|
50
|
-
} = applyTransform(params, [
|
|
51
|
-
merge(getDefaultGetParams()),
|
|
52
|
-
starToSearch('search'),
|
|
53
|
-
]);
|
|
50
|
+
} = applyTransform(params, [merge(getDefaultGetParams()), starToSearch('search')]);
|
|
54
51
|
|
|
55
52
|
try {
|
|
56
53
|
const response = await agentService.searchAgent(
|
|
@@ -79,15 +76,11 @@ const getAgentsList = async (params) => {
|
|
|
79
76
|
merge(getDefaultGetListResponse()),
|
|
80
77
|
]);
|
|
81
78
|
return {
|
|
82
|
-
items: applyTransform(items, [
|
|
83
|
-
listResponseHandler,
|
|
84
|
-
]),
|
|
79
|
+
items: applyTransform(items, [listResponseHandler]),
|
|
85
80
|
next,
|
|
86
81
|
};
|
|
87
82
|
} catch (err) {
|
|
88
|
-
throw applyTransform(err, [
|
|
89
|
-
notify,
|
|
90
|
-
]);
|
|
83
|
+
throw applyTransform(err, [notify]);
|
|
91
84
|
}
|
|
92
85
|
};
|
|
93
86
|
|
|
@@ -108,14 +101,9 @@ const getAgent = async ({ itemId: id }) => {
|
|
|
108
101
|
|
|
109
102
|
try {
|
|
110
103
|
const response = await agentService.readAgent(id);
|
|
111
|
-
return applyTransform(response.data, [
|
|
112
|
-
snakeToCamel(),
|
|
113
|
-
merge(defaultObject),
|
|
114
|
-
]);
|
|
104
|
+
return applyTransform(response.data, [snakeToCamel(), merge(defaultObject)]);
|
|
115
105
|
} catch (err) {
|
|
116
|
-
throw applyTransform(err, [
|
|
117
|
-
notify,
|
|
118
|
-
]);
|
|
106
|
+
throw applyTransform(err, [notify]);
|
|
119
107
|
}
|
|
120
108
|
};
|
|
121
109
|
|
|
@@ -133,53 +121,32 @@ const fieldsToSend = [
|
|
|
133
121
|
];
|
|
134
122
|
|
|
135
123
|
const addAgent = async ({ itemInstance }) => {
|
|
136
|
-
const item = applyTransform(itemInstance, [
|
|
137
|
-
sanitize(fieldsToSend),
|
|
138
|
-
camelToSnake(),
|
|
139
|
-
]);
|
|
124
|
+
const item = applyTransform(itemInstance, [sanitize(fieldsToSend), camelToSnake()]);
|
|
140
125
|
try {
|
|
141
126
|
const response = await agentService.createAgent(item);
|
|
142
|
-
return applyTransform(response.data, [
|
|
143
|
-
snakeToCamel(),
|
|
144
|
-
]);
|
|
127
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
145
128
|
} catch (err) {
|
|
146
|
-
throw applyTransform(err, [
|
|
147
|
-
notify,
|
|
148
|
-
]);
|
|
129
|
+
throw applyTransform(err, [notify]);
|
|
149
130
|
}
|
|
150
131
|
};
|
|
151
132
|
|
|
152
133
|
const patchAgent = async ({ changes, id }) => {
|
|
153
|
-
const body = applyTransform(changes, [
|
|
154
|
-
sanitize(fieldsToSend),
|
|
155
|
-
camelToSnake(),
|
|
156
|
-
]);
|
|
134
|
+
const body = applyTransform(changes, [sanitize(fieldsToSend), camelToSnake()]);
|
|
157
135
|
try {
|
|
158
136
|
const response = await agentService.patchAgent(id, body);
|
|
159
|
-
return applyTransform(response.data, [
|
|
160
|
-
snakeToCamel(),
|
|
161
|
-
]);
|
|
137
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
162
138
|
} catch (err) {
|
|
163
|
-
throw applyTransform(err, [
|
|
164
|
-
notify,
|
|
165
|
-
]);
|
|
139
|
+
throw applyTransform(err, [notify]);
|
|
166
140
|
}
|
|
167
141
|
};
|
|
168
142
|
|
|
169
143
|
const updateAgent = async ({ itemInstance, itemId: id }) => {
|
|
170
|
-
const item = applyTransform(itemInstance, [
|
|
171
|
-
sanitize(fieldsToSend),
|
|
172
|
-
camelToSnake(),
|
|
173
|
-
]);
|
|
144
|
+
const item = applyTransform(itemInstance, [sanitize(fieldsToSend), camelToSnake()]);
|
|
174
145
|
try {
|
|
175
146
|
const response = await agentService.updateAgent(id, item);
|
|
176
|
-
return applyTransform(response.data, [
|
|
177
|
-
snakeToCamel(),
|
|
178
|
-
]);
|
|
147
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
179
148
|
} catch (err) {
|
|
180
|
-
throw applyTransform(err, [
|
|
181
|
-
notify,
|
|
182
|
-
]);
|
|
149
|
+
throw applyTransform(err, [notify]);
|
|
183
150
|
}
|
|
184
151
|
};
|
|
185
152
|
|
|
@@ -188,16 +155,15 @@ const deleteAgent = async ({ id }) => {
|
|
|
188
155
|
const response = await agentService.deleteAgent(id);
|
|
189
156
|
return applyTransform(response.data, []);
|
|
190
157
|
} catch (err) {
|
|
191
|
-
throw applyTransform(err, [
|
|
192
|
-
notify,
|
|
193
|
-
]);
|
|
158
|
+
throw applyTransform(err, [notify]);
|
|
194
159
|
}
|
|
195
160
|
};
|
|
196
161
|
|
|
197
|
-
const getAgentsLookup = (params) =>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
162
|
+
const getAgentsLookup = (params) =>
|
|
163
|
+
getAgentsList({
|
|
164
|
+
...params,
|
|
165
|
+
fields: params.fields || ['id', 'name'],
|
|
166
|
+
});
|
|
201
167
|
|
|
202
168
|
const getAgentHistory = async (params) => {
|
|
203
169
|
const {
|
|
@@ -207,14 +173,16 @@ const getAgentHistory = async (params) => {
|
|
|
207
173
|
page,
|
|
208
174
|
size,
|
|
209
175
|
sort = '-joined_at',
|
|
210
|
-
} = applyTransform(params, [
|
|
211
|
-
merge(getDefaultGetParams()),
|
|
212
|
-
starToSearch('search'),
|
|
213
|
-
]);
|
|
176
|
+
} = applyTransform(params, [merge(getDefaultGetParams()), starToSearch('search')]);
|
|
214
177
|
|
|
215
178
|
try {
|
|
216
179
|
const response = await agentService.searchAgentStateHistory(
|
|
217
|
-
page,
|
|
180
|
+
page,
|
|
181
|
+
size,
|
|
182
|
+
from,
|
|
183
|
+
to,
|
|
184
|
+
parentId,
|
|
185
|
+
sort,
|
|
218
186
|
);
|
|
219
187
|
const { items, next } = applyTransform(response.data, [
|
|
220
188
|
snakeToCamel(),
|
|
@@ -225,31 +193,18 @@ const getAgentHistory = async (params) => {
|
|
|
225
193
|
next,
|
|
226
194
|
};
|
|
227
195
|
} catch (err) {
|
|
228
|
-
throw applyTransform(err, [
|
|
229
|
-
notify,
|
|
230
|
-
]);
|
|
196
|
+
throw applyTransform(err, [notify]);
|
|
231
197
|
}
|
|
232
198
|
};
|
|
233
199
|
|
|
234
200
|
const getAgentUsersOptions = async (params) => {
|
|
235
|
-
const {
|
|
236
|
-
page,
|
|
237
|
-
size,
|
|
238
|
-
search,
|
|
239
|
-
sort,
|
|
240
|
-
fields,
|
|
241
|
-
id,
|
|
242
|
-
} = applyTransform(params, [
|
|
201
|
+
const { page, size, search, sort, fields, id } = applyTransform(params, [
|
|
243
202
|
merge(getDefaultGetParams()),
|
|
244
203
|
starToSearch('search'),
|
|
245
204
|
]);
|
|
246
205
|
|
|
247
206
|
try {
|
|
248
|
-
const response = await agentService.searchLookupUsersAgentNotExists(
|
|
249
|
-
page,
|
|
250
|
-
size,
|
|
251
|
-
search,
|
|
252
|
-
);
|
|
207
|
+
const response = await agentService.searchLookupUsersAgentNotExists(page, size, search);
|
|
253
208
|
const { items, next } = applyTransform(response.data, [
|
|
254
209
|
snakeToCamel(),
|
|
255
210
|
merge(getDefaultGetListResponse()),
|
|
@@ -259,9 +214,7 @@ const getAgentUsersOptions = async (params) => {
|
|
|
259
214
|
next,
|
|
260
215
|
};
|
|
261
216
|
} catch (err) {
|
|
262
|
-
throw applyTransform(err, [
|
|
263
|
-
notify,
|
|
264
|
-
]);
|
|
217
|
+
throw applyTransform(err, [notify]);
|
|
265
218
|
}
|
|
266
219
|
};
|
|
267
220
|
const getSupervisorOptions = async (params) => {
|
|
@@ -20,27 +20,13 @@ const configuration = getDefaultOpenAPIConfig();
|
|
|
20
20
|
const bucketService = new BucketServiceApiFactory(configuration, '', instance);
|
|
21
21
|
|
|
22
22
|
const getBucketsList = async (params) => {
|
|
23
|
-
const {
|
|
24
|
-
page,
|
|
25
|
-
size,
|
|
26
|
-
search,
|
|
27
|
-
sort,
|
|
28
|
-
fields,
|
|
29
|
-
id,
|
|
30
|
-
} = applyTransform(params, [
|
|
23
|
+
const { page, size, search, sort, fields, id } = applyTransform(params, [
|
|
31
24
|
merge(getDefaultGetParams()),
|
|
32
25
|
starToSearch('search'),
|
|
33
26
|
]);
|
|
34
27
|
|
|
35
28
|
try {
|
|
36
|
-
const response = await bucketService.searchBucket(
|
|
37
|
-
page,
|
|
38
|
-
size,
|
|
39
|
-
search,
|
|
40
|
-
sort,
|
|
41
|
-
fields,
|
|
42
|
-
id,
|
|
43
|
-
);
|
|
29
|
+
const response = await bucketService.searchBucket(page, size, search, sort, fields, id);
|
|
44
30
|
const { items, next } = applyTransform(response.data, [
|
|
45
31
|
snakeToCamel(),
|
|
46
32
|
merge(getDefaultGetListResponse()),
|
|
@@ -50,62 +36,38 @@ const getBucketsList = async (params) => {
|
|
|
50
36
|
next,
|
|
51
37
|
};
|
|
52
38
|
} catch (err) {
|
|
53
|
-
throw applyTransform(err, [
|
|
54
|
-
|
|
55
|
-
notify,
|
|
56
|
-
]);
|
|
39
|
+
throw applyTransform(err, [notify]);
|
|
57
40
|
}
|
|
58
41
|
};
|
|
59
42
|
|
|
60
43
|
const getBucket = async ({ itemId: id }) => {
|
|
61
44
|
try {
|
|
62
45
|
const response = await bucketService.readBucket(id);
|
|
63
|
-
return applyTransform(response.data, [
|
|
64
|
-
snakeToCamel(),
|
|
65
|
-
]);
|
|
46
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
66
47
|
} catch (err) {
|
|
67
|
-
throw applyTransform(err, [
|
|
68
|
-
|
|
69
|
-
notify,
|
|
70
|
-
]);
|
|
48
|
+
throw applyTransform(err, [notify]);
|
|
71
49
|
}
|
|
72
50
|
};
|
|
73
51
|
|
|
74
52
|
const fieldsToSend = ['name', 'description'];
|
|
75
53
|
|
|
76
54
|
const addBucket = async ({ itemInstance }) => {
|
|
77
|
-
const item = applyTransform(itemInstance, [
|
|
78
|
-
sanitize(fieldsToSend),
|
|
79
|
-
camelToSnake(),
|
|
80
|
-
]);
|
|
55
|
+
const item = applyTransform(itemInstance, [sanitize(fieldsToSend), camelToSnake()]);
|
|
81
56
|
try {
|
|
82
57
|
const response = await bucketService.createBucket(item);
|
|
83
|
-
return applyTransform(response.data, [
|
|
84
|
-
snakeToCamel(),
|
|
85
|
-
]);
|
|
58
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
86
59
|
} catch (err) {
|
|
87
|
-
throw applyTransform(err, [
|
|
88
|
-
|
|
89
|
-
notify,
|
|
90
|
-
]);
|
|
60
|
+
throw applyTransform(err, [notify]);
|
|
91
61
|
}
|
|
92
62
|
};
|
|
93
63
|
|
|
94
64
|
const updateBucket = async ({ itemInstance, itemId: id }) => {
|
|
95
|
-
const item = applyTransform(itemInstance, [
|
|
96
|
-
sanitize(fieldsToSend),
|
|
97
|
-
camelToSnake(),
|
|
98
|
-
]);
|
|
65
|
+
const item = applyTransform(itemInstance, [sanitize(fieldsToSend), camelToSnake()]);
|
|
99
66
|
try {
|
|
100
67
|
const response = await bucketService.updateBucket(id, item);
|
|
101
|
-
return applyTransform(response.data, [
|
|
102
|
-
snakeToCamel(),
|
|
103
|
-
]);
|
|
68
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
104
69
|
} catch (err) {
|
|
105
|
-
throw applyTransform(err, [
|
|
106
|
-
|
|
107
|
-
notify,
|
|
108
|
-
]);
|
|
70
|
+
throw applyTransform(err, [notify]);
|
|
109
71
|
}
|
|
110
72
|
};
|
|
111
73
|
|
|
@@ -114,17 +76,15 @@ const deleteBucket = async ({ id }) => {
|
|
|
114
76
|
const response = await bucketService.deleteBucket(id);
|
|
115
77
|
return applyTransform(response.data, []);
|
|
116
78
|
} catch (err) {
|
|
117
|
-
throw applyTransform(err, [
|
|
118
|
-
|
|
119
|
-
notify,
|
|
120
|
-
]);
|
|
79
|
+
throw applyTransform(err, [notify]);
|
|
121
80
|
}
|
|
122
81
|
};
|
|
123
82
|
|
|
124
|
-
const getBucketsLookup = (params) =>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
83
|
+
const getBucketsLookup = (params) =>
|
|
84
|
+
getBucketsList({
|
|
85
|
+
...params,
|
|
86
|
+
fields: params.fields || ['id', 'name'],
|
|
87
|
+
});
|
|
128
88
|
|
|
129
89
|
const BucketsAPI = {
|
|
130
90
|
getList: getBucketsList,
|
|
@@ -21,27 +21,13 @@ const configuration = getDefaultOpenAPIConfig();
|
|
|
21
21
|
const calendarService = new CalendarServiceApiFactory(configuration, '', instance);
|
|
22
22
|
|
|
23
23
|
const getCalendarList = async (params) => {
|
|
24
|
-
const {
|
|
25
|
-
page,
|
|
26
|
-
size,
|
|
27
|
-
search,
|
|
28
|
-
sort,
|
|
29
|
-
fields,
|
|
30
|
-
id,
|
|
31
|
-
} = applyTransform(params, [
|
|
24
|
+
const { page, size, search, sort, fields, id } = applyTransform(params, [
|
|
32
25
|
merge(getDefaultGetParams()),
|
|
33
26
|
starToSearch('search'),
|
|
34
27
|
]);
|
|
35
28
|
|
|
36
29
|
try {
|
|
37
|
-
const response = await calendarService.searchCalendar(
|
|
38
|
-
page,
|
|
39
|
-
size,
|
|
40
|
-
search,
|
|
41
|
-
sort,
|
|
42
|
-
fields,
|
|
43
|
-
id,
|
|
44
|
-
);
|
|
30
|
+
const response = await calendarService.searchCalendar(page, size, search, sort, fields, id);
|
|
45
31
|
const { items, next } = applyTransform(response.data, [
|
|
46
32
|
snakeToCamel(),
|
|
47
33
|
merge(getDefaultGetListResponse()),
|
|
@@ -51,10 +37,7 @@ const getCalendarList = async (params) => {
|
|
|
51
37
|
next,
|
|
52
38
|
};
|
|
53
39
|
} catch (err) {
|
|
54
|
-
throw applyTransform(err, [
|
|
55
|
-
|
|
56
|
-
notify,
|
|
57
|
-
]);
|
|
40
|
+
throw applyTransform(err, [notify]);
|
|
58
41
|
}
|
|
59
42
|
};
|
|
60
43
|
|
|
@@ -79,7 +62,6 @@ const getCalendar = async ({ itemId: id }) => {
|
|
|
79
62
|
end: accept.endTimeOfDay || 0,
|
|
80
63
|
}));
|
|
81
64
|
if (copy.excepts) {
|
|
82
|
-
|
|
83
65
|
copy.excepts = copy.excepts.map((except) => ({
|
|
84
66
|
name: except.name || '',
|
|
85
67
|
date: except.date || 0,
|
|
@@ -94,15 +76,9 @@ const getCalendar = async ({ itemId: id }) => {
|
|
|
94
76
|
|
|
95
77
|
try {
|
|
96
78
|
const response = await calendarService.readCalendar(id);
|
|
97
|
-
return applyTransform(response.data, [
|
|
98
|
-
snakeToCamel(),
|
|
99
|
-
itemResponseHandler,
|
|
100
|
-
]);
|
|
79
|
+
return applyTransform(response.data, [snakeToCamel(), itemResponseHandler]);
|
|
101
80
|
} catch (err) {
|
|
102
|
-
throw applyTransform(err, [
|
|
103
|
-
|
|
104
|
-
notify,
|
|
105
|
-
]);
|
|
81
|
+
throw applyTransform(err, [notify]);
|
|
106
82
|
}
|
|
107
83
|
};
|
|
108
84
|
|
|
@@ -150,14 +126,9 @@ const addCalendar = async ({ itemInstance }) => {
|
|
|
150
126
|
]);
|
|
151
127
|
try {
|
|
152
128
|
const response = await calendarService.createCalendar(item);
|
|
153
|
-
return applyTransform(response.data, [
|
|
154
|
-
snakeToCamel(),
|
|
155
|
-
]);
|
|
129
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
156
130
|
} catch (err) {
|
|
157
|
-
throw applyTransform(err, [
|
|
158
|
-
|
|
159
|
-
notify,
|
|
160
|
-
]);
|
|
131
|
+
throw applyTransform(err, [notify]);
|
|
161
132
|
}
|
|
162
133
|
};
|
|
163
134
|
|
|
@@ -169,14 +140,9 @@ const updateCalendar = async ({ itemInstance, itemId: id }) => {
|
|
|
169
140
|
]);
|
|
170
141
|
try {
|
|
171
142
|
const response = await calendarService.updateCalendar(id, item);
|
|
172
|
-
return applyTransform(response.data, [
|
|
173
|
-
snakeToCamel(),
|
|
174
|
-
]);
|
|
143
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
175
144
|
} catch (err) {
|
|
176
|
-
throw applyTransform(err, [
|
|
177
|
-
|
|
178
|
-
notify,
|
|
179
|
-
]);
|
|
145
|
+
throw applyTransform(err, [notify]);
|
|
180
146
|
}
|
|
181
147
|
};
|
|
182
148
|
|
|
@@ -185,40 +151,24 @@ const deleteCalendar = async ({ id }) => {
|
|
|
185
151
|
const response = await calendarService.deleteCalendar(id);
|
|
186
152
|
return applyTransform(response.data, []);
|
|
187
153
|
} catch (err) {
|
|
188
|
-
throw applyTransform(err, [
|
|
189
|
-
|
|
190
|
-
notify,
|
|
191
|
-
]);
|
|
154
|
+
throw applyTransform(err, [notify]);
|
|
192
155
|
}
|
|
193
156
|
};
|
|
194
157
|
|
|
195
|
-
const getCalendarsLookup = (params) =>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
158
|
+
const getCalendarsLookup = (params) =>
|
|
159
|
+
getCalendarList({
|
|
160
|
+
...params,
|
|
161
|
+
fields: params.fields || ['id', 'name'],
|
|
162
|
+
});
|
|
199
163
|
|
|
200
164
|
const getTimezonesLookup = async (params) => {
|
|
201
|
-
const {
|
|
202
|
-
page,
|
|
203
|
-
size,
|
|
204
|
-
search,
|
|
205
|
-
sort,
|
|
206
|
-
fields,
|
|
207
|
-
id,
|
|
208
|
-
} = applyTransform(params, [
|
|
165
|
+
const { page, size, search, sort, fields, id } = applyTransform(params, [
|
|
209
166
|
merge(getDefaultGetParams()),
|
|
210
167
|
starToSearch('search'),
|
|
211
168
|
]);
|
|
212
169
|
|
|
213
170
|
try {
|
|
214
|
-
const response = await calendarService.searchTimezones(
|
|
215
|
-
page,
|
|
216
|
-
size,
|
|
217
|
-
search,
|
|
218
|
-
sort,
|
|
219
|
-
fields,
|
|
220
|
-
id,
|
|
221
|
-
);
|
|
171
|
+
const response = await calendarService.searchTimezones(page, size, search, sort, fields, id);
|
|
222
172
|
const { items, next } = applyTransform(response.data, [
|
|
223
173
|
snakeToCamel(),
|
|
224
174
|
merge(getDefaultGetListResponse()),
|
|
@@ -228,10 +178,7 @@ const getTimezonesLookup = async (params) => {
|
|
|
228
178
|
next,
|
|
229
179
|
};
|
|
230
180
|
} catch (err) {
|
|
231
|
-
throw applyTransform(err, [
|
|
232
|
-
|
|
233
|
-
notify,
|
|
234
|
-
]);
|
|
181
|
+
throw applyTransform(err, [notify]);
|
|
235
182
|
}
|
|
236
183
|
};
|
|
237
184
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import deepCopy from 'deep-copy';
|
|
2
2
|
import deepmerge from 'deepmerge';
|
|
3
|
-
import ChatGatewayProvider
|
|
4
|
-
from '../../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
|
|
3
|
+
import ChatGatewayProvider from '../../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js';
|
|
5
4
|
import {
|
|
6
5
|
getDefaultGetListResponse,
|
|
7
6
|
getDefaultGetParams,
|
|
@@ -22,21 +21,12 @@ import webChatGateway from './defaults/webChatGateway.js';
|
|
|
22
21
|
const instance = getDefaultInstance();
|
|
23
22
|
|
|
24
23
|
const baseUrl = '/chat/bots';
|
|
25
|
-
const fieldsToSend = [
|
|
26
|
-
'name',
|
|
27
|
-
'uri',
|
|
28
|
-
'flow',
|
|
29
|
-
'enabled',
|
|
30
|
-
'provider',
|
|
31
|
-
'metadata',
|
|
32
|
-
'updates',
|
|
33
|
-
];
|
|
24
|
+
const fieldsToSend = ['name', 'uri', 'flow', 'enabled', 'provider', 'metadata', 'updates'];
|
|
34
25
|
|
|
35
26
|
const convertWebchatSeconds = (num) => `${num}s`;
|
|
36
27
|
|
|
37
|
-
const parseTimeoutSeconds = (item) =>
|
|
38
|
-
? parseInt(item.replace('/s', '/'), 10)
|
|
39
|
-
: +item);
|
|
28
|
+
const parseTimeoutSeconds = (item) =>
|
|
29
|
+
item.includes('s') ? Number.parseInt(item.replace('/s', '/'), 10) : +item;
|
|
40
30
|
|
|
41
31
|
const webchatRequestConverter = (data) => {
|
|
42
32
|
const copy = deepCopy(data);
|
|
@@ -86,9 +76,7 @@ const viberRequestConverter = (item) => {
|
|
|
86
76
|
|
|
87
77
|
const webChatResponseConverter = (data) => {
|
|
88
78
|
const copy = deepCopy(data);
|
|
89
|
-
copy.metadata.allowOrigin = data.metadata.allowOrigin
|
|
90
|
-
? data.metadata.allowOrigin.split(',')
|
|
91
|
-
: [];
|
|
79
|
+
copy.metadata.allowOrigin = data.metadata.allowOrigin ? data.metadata.allowOrigin.split(',') : [];
|
|
92
80
|
if (data.metadata.readTimeout) {
|
|
93
81
|
copy.metadata.readTimeout = parseTimeoutSeconds(data.metadata.readTimeout);
|
|
94
82
|
}
|
|
@@ -116,7 +104,7 @@ const webChatResponseConverter = (data) => {
|
|
|
116
104
|
if (data.metadata.captcha) {
|
|
117
105
|
copy.metadata.captcha = JSON.parse(data.metadata.captcha);
|
|
118
106
|
}
|
|
119
|
-
copy.metadata._btnCodeDirty =
|
|
107
|
+
copy.metadata._btnCodeDirty = data.metadata._btnCodeDirty === 'true';
|
|
120
108
|
|
|
121
109
|
return deepmerge(webChatGateway(), copy);
|
|
122
110
|
};
|
|
@@ -182,20 +170,15 @@ const getChatGatewayList = async (params) => {
|
|
|
182
170
|
merge(getDefaultGetListResponse()),
|
|
183
171
|
]);
|
|
184
172
|
return {
|
|
185
|
-
items: applyTransform(items, [
|
|
186
|
-
mergeEach(defaultObject),
|
|
187
|
-
]),
|
|
173
|
+
items: applyTransform(items, [mergeEach(defaultObject)]),
|
|
188
174
|
next,
|
|
189
175
|
};
|
|
190
176
|
} catch (err) {
|
|
191
|
-
throw applyTransform(err, [
|
|
192
|
-
notify,
|
|
193
|
-
]);
|
|
177
|
+
throw applyTransform(err, [notify]);
|
|
194
178
|
}
|
|
195
179
|
};
|
|
196
180
|
|
|
197
181
|
const getChatGateway = async ({ itemId: id }) => {
|
|
198
|
-
|
|
199
182
|
const itemResponseHandler = (response) => {
|
|
200
183
|
switch (response.provider) {
|
|
201
184
|
case ChatGatewayProvider.WEBCHAT:
|
|
@@ -213,14 +196,9 @@ const getChatGateway = async ({ itemId: id }) => {
|
|
|
213
196
|
|
|
214
197
|
try {
|
|
215
198
|
const response = await instance.get(url);
|
|
216
|
-
return applyTransform(response.data, [
|
|
217
|
-
snakeToCamel(),
|
|
218
|
-
itemResponseHandler,
|
|
219
|
-
]);
|
|
199
|
+
return applyTransform(response.data, [snakeToCamel(), itemResponseHandler]);
|
|
220
200
|
} catch (err) {
|
|
221
|
-
throw applyTransform(err, [
|
|
222
|
-
notify,
|
|
223
|
-
]);
|
|
201
|
+
throw applyTransform(err, [notify]);
|
|
224
202
|
}
|
|
225
203
|
};
|
|
226
204
|
|
|
@@ -232,13 +210,9 @@ const addChatGateway = async ({ itemInstance }) => {
|
|
|
232
210
|
]);
|
|
233
211
|
try {
|
|
234
212
|
const response = await instance.post(baseUrl, item);
|
|
235
|
-
return applyTransform(response.data, [
|
|
236
|
-
snakeToCamel(),
|
|
237
|
-
]);
|
|
213
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
238
214
|
} catch (err) {
|
|
239
|
-
throw applyTransform(err, [
|
|
240
|
-
notify,
|
|
241
|
-
]);
|
|
215
|
+
throw applyTransform(err, [notify]);
|
|
242
216
|
}
|
|
243
217
|
};
|
|
244
218
|
|
|
@@ -252,31 +226,20 @@ const updateChatGateway = async ({ itemInstance, itemId: id }) => {
|
|
|
252
226
|
const url = `${baseUrl}/${id}`;
|
|
253
227
|
try {
|
|
254
228
|
const response = await instance.put(url, item);
|
|
255
|
-
return applyTransform(response.data, [
|
|
256
|
-
snakeToCamel(),
|
|
257
|
-
]);
|
|
229
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
258
230
|
} catch (err) {
|
|
259
|
-
throw applyTransform(err, [
|
|
260
|
-
notify,
|
|
261
|
-
]);
|
|
231
|
+
throw applyTransform(err, [notify]);
|
|
262
232
|
}
|
|
263
233
|
};
|
|
264
234
|
|
|
265
235
|
const patchChatGateway = async ({ changes, id }) => {
|
|
266
|
-
const body = applyTransform(changes, [
|
|
267
|
-
sanitize(fieldsToSend),
|
|
268
|
-
camelToSnake(),
|
|
269
|
-
]);
|
|
236
|
+
const body = applyTransform(changes, [sanitize(fieldsToSend), camelToSnake()]);
|
|
270
237
|
const url = `${baseUrl}/${id}`;
|
|
271
238
|
try {
|
|
272
239
|
const response = await instance.patch(url, body);
|
|
273
|
-
return applyTransform(response.data, [
|
|
274
|
-
snakeToCamel(),
|
|
275
|
-
]);
|
|
240
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
276
241
|
} catch (err) {
|
|
277
|
-
throw applyTransform(err, [
|
|
278
|
-
notify,
|
|
279
|
-
]);
|
|
242
|
+
throw applyTransform(err, [notify]);
|
|
280
243
|
}
|
|
281
244
|
};
|
|
282
245
|
|
|
@@ -286,16 +249,15 @@ const deleteChatGateway = async ({ id }) => {
|
|
|
286
249
|
const response = await instance.delete(url);
|
|
287
250
|
return applyTransform(response.data, []);
|
|
288
251
|
} catch (err) {
|
|
289
|
-
throw applyTransform(err, [
|
|
290
|
-
notify,
|
|
291
|
-
]);
|
|
252
|
+
throw applyTransform(err, [notify]);
|
|
292
253
|
}
|
|
293
254
|
};
|
|
294
255
|
|
|
295
|
-
const getLookup = (params) =>
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
256
|
+
const getLookup = (params) =>
|
|
257
|
+
getChatGatewayList({
|
|
258
|
+
...params,
|
|
259
|
+
fields: params.fields || ['id', 'name'],
|
|
260
|
+
});
|
|
299
261
|
|
|
300
262
|
const ChatGatewaysAPI = {
|
|
301
263
|
getList: getChatGatewayList,
|